combinatorics.set_family.shadow ⟷ Mathlib.Combinatorics.SetFamily.Shadow

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -105,7 +105,7 @@ theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ (βˆ‚ )
 #align finset.erase_mem_shadow Finset.erase_mem_shadow
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» s) -/
 #print Finset.mem_shadow_iff_insert_mem /-
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
@@ -231,7 +231,7 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (
 #align finset.up_shadow_monotone Finset.upShadow_monotone
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
 #print Finset.mem_upShadow_iff /-
 /-- `s` is in the upper shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element
 to get `s`. -/
Diff
@@ -189,7 +189,7 @@ theorem mem_shadow_iterate_iff_exists_mem_card_add :
   · rintro ⟨t, ht, hst, hcard⟩
     obtain ⟨u, hsu, hut, hu⟩ :=
       Finset.exists_intermediate_set k (by rw [add_comm, hcard]; exact le_succ _) hst
-    rw [add_comm] at hu 
+    rw [add_comm] at hu
     refine' ⟨u, mem_shadow_iff_exists_mem_card_add_one.2 ⟨t, ht, hut, _⟩, hsu, hu⟩
     rw [hcard, hu]
     rfl
@@ -319,7 +319,7 @@ theorem mem_upShadow_iff_exists_mem_card_add :
     obtain ⟨u, htu, hus, hu⟩ :=
       Finset.exists_intermediate_set 1
         (by rw [add_comm, ← hcard]; exact add_le_add_left (zero_lt_succ _) _) hts
-    rw [add_comm] at hu 
+    rw [add_comm] at hu
     refine' ⟨u, mem_up_shadow_iff_exists_mem_card_add_one.2 ⟨t, ht, htu, hu.symm⟩, hus, _⟩
     rw [hu, ← hcard, add_right_comm]
     rfl
Diff
@@ -120,6 +120,9 @@ theorem mem_shadow_iff_insert_mem : s ∈ (βˆ‚ ) π’œ ↔ βˆƒ (a : _) (_ : a βˆ‰
 #align finset.mem_shadow_iff_insert_mem Finset.mem_shadow_iff_insert_mem
 -/
 
+/- warning: set.sized.shadow clashes with finset.set.sized.shadow -> Set.Sized.shadow
+Case conversion may be inaccurate. Consider using '#align set.sized.shadow Set.Sized.shadowβ‚“'. -/
+#print Set.Sized.shadow /-
 /-- The shadow of a family of `r`-sets is a family of `r - 1`-sets. -/
 protected theorem Set.Sized.shadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r) :
     ((βˆ‚ ) π’œ : Set (Finset Ξ±)).Sized (r - 1) :=
@@ -128,6 +131,7 @@ protected theorem Set.Sized.shadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r) :
   obtain ⟨A, hA, i, hi, rfl⟩ := mem_shadow_iff.1 h
   rw [card_erase_of_mem hi, hπ’œ hA]
 #align set.sized.shadow Set.Sized.shadow
+-/
 
 #print Finset.sized_shadow_iff /-
 theorem sized_shadow_iff (h : βˆ… βˆ‰ π’œ) :
@@ -164,9 +168,9 @@ theorem exists_subset_of_mem_shadow (hs : s ∈ (βˆ‚ ) π’œ) : βˆƒ t ∈ π’œ, s
 #align finset.exists_subset_of_mem_shadow Finset.exists_subset_of_mem_shadow
 -/
 
-#print Finset.mem_shadow_iff_exists_mem_card_add /-
+#print Finset.mem_shadow_iterate_iff_exists_mem_card_add /-
 /-- `t ∈ βˆ‚^k π’œ` iff `t` is exactly `k` elements less than something in `π’œ`. -/
-theorem mem_shadow_iff_exists_mem_card_add :
+theorem mem_shadow_iterate_iff_exists_mem_card_add :
     s ∈ (βˆ‚ ^[k]) π’œ ↔ βˆƒ t ∈ π’œ, s βŠ† t ∧ t.card = s.card + k :=
   by
   induction' k with k ih generalizing π’œ s
@@ -189,7 +193,7 @@ theorem mem_shadow_iff_exists_mem_card_add :
     refine' ⟨u, mem_shadow_iff_exists_mem_card_add_one.2 ⟨t, ht, hut, _⟩, hsu, hu⟩
     rw [hcard, hu]
     rfl
-#align finset.mem_shadow_iff_exists_mem_card_add Finset.mem_shadow_iff_exists_mem_card_add
+#align finset.mem_shadow_iff_exists_mem_card_add Finset.mem_shadow_iterate_iff_exists_mem_card_add
 -/
 
 end Shadow
@@ -242,6 +246,9 @@ theorem insert_mem_upShadow (hs : s ∈ π’œ) (ha : a βˆ‰ s) : insert a s ∈ (
 #align finset.insert_mem_up_shadow Finset.insert_mem_upShadow
 -/
 
+/- warning: set.sized.up_shadow clashes with finset.set.sized.up_shadow -> Set.Sized.upShadow
+Case conversion may be inaccurate. Consider using '#align set.sized.up_shadow Set.Sized.upShadowβ‚“'. -/
+#print Set.Sized.upShadow /-
 /-- The upper shadow of a family of `r`-sets is a family of `r + 1`-sets. -/
 protected theorem Set.Sized.upShadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r) :
     ((βˆ‚βΊ ) π’œ : Set (Finset Ξ±)).Sized (r + 1) :=
@@ -250,6 +257,7 @@ protected theorem Set.Sized.upShadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r)
   obtain ⟨A, hA, i, hi, rfl⟩ := mem_up_shadow_iff.1 h
   rw [card_insert_of_not_mem hi, hπ’œ hA]
 #align set.sized.up_shadow Set.Sized.upShadow
+-/
 
 #print Finset.mem_upShadow_iff_erase_mem /-
 /-- `t` is in the upper shadow of `π’œ` iff we can remove an element from it so that the resulting
Diff
@@ -318,9 +318,9 @@ theorem mem_upShadow_iff_exists_mem_card_add :
 #align finset.mem_up_shadow_iff_exists_mem_card_add Finset.mem_upShadow_iff_exists_mem_card_add
 -/
 
-#print Finset.shadow_image_compl /-
+#print Finset.upShadow_compls /-
 @[simp]
-theorem shadow_image_compl : ((βˆ‚ ) π’œ).image compl = (βˆ‚βΊ ) (π’œ.image compl) :=
+theorem upShadow_compls : ((βˆ‚ ) π’œ).image compl = (βˆ‚βΊ ) (π’œ.image compl) :=
   by
   ext s
   simp only [mem_image, exists_prop, mem_shadow_iff, mem_up_shadow_iff]
@@ -329,12 +329,12 @@ theorem shadow_image_compl : ((βˆ‚ ) π’œ).image compl = (βˆ‚βΊ ) (π’œ.image c
     exact ⟨sᢜ, ⟨s, hs, rfl⟩, a, not_mem_compl.2 ha, compl_erase.symm⟩
   · rintro ⟨_, ⟨s, hs, rfl⟩, a, ha, rfl⟩
     exact ⟨s.erase a, ⟨s, hs, a, not_mem_compl.1 ha, rfl⟩, compl_erase⟩
-#align finset.shadow_image_compl Finset.shadow_image_compl
+#align finset.shadow_image_compl Finset.upShadow_compls
 -/
 
-#print Finset.upShadow_image_compl /-
+#print Finset.shadow_compls /-
 @[simp]
-theorem upShadow_image_compl : ((βˆ‚βΊ ) π’œ).image compl = (βˆ‚ ) (π’œ.image compl) :=
+theorem shadow_compls : ((βˆ‚βΊ ) π’œ).image compl = (βˆ‚ ) (π’œ.image compl) :=
   by
   ext s
   simp only [mem_image, exists_prop, mem_shadow_iff, mem_up_shadow_iff]
@@ -343,7 +343,7 @@ theorem upShadow_image_compl : ((βˆ‚βΊ ) π’œ).image compl = (βˆ‚ ) (π’œ.image
     exact ⟨sᢜ, ⟨s, hs, rfl⟩, a, mem_compl.2 ha, compl_insert.symm⟩
   · rintro ⟨_, ⟨s, hs, rfl⟩, a, ha, rfl⟩
     exact ⟨insert a s, ⟨s, hs, a, mem_compl.1 ha, rfl⟩, compl_insert⟩
-#align finset.up_shadow_image_compl Finset.upShadow_image_compl
+#align finset.up_shadow_image_compl Finset.shadow_compls
 -/
 
 end UpShadow
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Bhavik Mehta, Alena Gusakov, YaΓ«l Dillies
 -/
-import Mathbin.Data.Finset.Slice
-import Mathbin.Logic.Function.Iterate
+import Data.Finset.Slice
+import Logic.Function.Iterate
 
 #align_import combinatorics.set_family.shadow from "leanprover-community/mathlib"@"13a5329a8625701af92e9a96ffc90fa787fff24d"
 
@@ -105,7 +105,7 @@ theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ (βˆ‚ )
 #align finset.erase_mem_shadow Finset.erase_mem_shadow
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» s) -/
 #print Finset.mem_shadow_iff_insert_mem /-
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
@@ -227,7 +227,7 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (
 #align finset.up_shadow_monotone Finset.upShadow_monotone
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
 #print Finset.mem_upShadow_iff /-
 /-- `s` is in the upper shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element
 to get `s`. -/
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Bhavik Mehta. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Bhavik Mehta, Alena Gusakov, YaΓ«l Dillies
-
-! This file was ported from Lean 3 source module combinatorics.set_family.shadow
-! leanprover-community/mathlib commit 13a5329a8625701af92e9a96ffc90fa787fff24d
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Finset.Slice
 import Mathbin.Logic.Function.Iterate
 
+#align_import combinatorics.set_family.shadow from "leanprover-community/mathlib"@"13a5329a8625701af92e9a96ffc90fa787fff24d"
+
 /-!
 # Shadows
 
@@ -108,7 +105,7 @@ theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ (βˆ‚ )
 #align finset.erase_mem_shadow Finset.erase_mem_shadow
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» s) -/
 #print Finset.mem_shadow_iff_insert_mem /-
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
@@ -230,7 +227,7 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (
 #align finset.up_shadow_monotone Finset.upShadow_monotone
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
 #print Finset.mem_upShadow_iff /-
 /-- `s` is in the upper shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element
 to get `s`. -/
Diff
@@ -68,7 +68,6 @@ def shadow (π’œ : Finset (Finset Ξ±)) : Finset (Finset Ξ±) :=
 #align finset.shadow Finset.shadow
 -/
 
--- mathport name: finset.shadow
 scoped[FinsetFamily] notation:90 "βˆ‚ " => Finset.shadow
 
 #print Finset.shadow_empty /-
@@ -95,11 +94,13 @@ theorem shadow_monotone : Monotone (shadow : Finset (Finset Ξ±) β†’ Finset (Fins
 #align finset.shadow_monotone Finset.shadow_monotone
 -/
 
+#print Finset.mem_shadow_iff /-
 /-- `s` is in the shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element to
 get `s`. -/
 theorem mem_shadow_iff : s ∈ (βˆ‚ ) π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ a ∈ t, erase t a = s := by
   simp only [shadow, mem_sup, mem_image]
 #align finset.mem_shadow_iff Finset.mem_shadow_iff
+-/
 
 #print Finset.erase_mem_shadow /-
 theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ (βˆ‚ ) π’œ :=
@@ -141,6 +142,7 @@ theorem sized_shadow_iff (h : βˆ… βˆ‰ π’œ) :
 #align finset.sized_shadow_iff Finset.sized_shadow_iff
 -/
 
+#print Finset.mem_shadow_iff_exists_mem_card_add_one /-
 /-- `s ∈ βˆ‚ π’œ` iff `s` is exactly one element less than something from `π’œ` -/
 theorem mem_shadow_iff_exists_mem_card_add_one :
     s ∈ (βˆ‚ ) π’œ ↔ βˆƒ t ∈ π’œ, s βŠ† t ∧ t.card = s.card + 1 :=
@@ -155,13 +157,17 @@ theorem mem_shadow_iff_exists_mem_card_add_one :
       ⟨a, fun hat => not_mem_sdiff_of_mem_right hat ((ha.ge : _ βŠ† _) <| mem_singleton_self a), by
         rwa [insert_eq a s, ← ha, sdiff_union_of_subset hst]⟩
 #align finset.mem_shadow_iff_exists_mem_card_add_one Finset.mem_shadow_iff_exists_mem_card_add_one
+-/
 
+#print Finset.exists_subset_of_mem_shadow /-
 /-- Being in the shadow of `π’œ` means we have a superset in `π’œ`. -/
 theorem exists_subset_of_mem_shadow (hs : s ∈ (βˆ‚ ) π’œ) : βˆƒ t ∈ π’œ, s βŠ† t :=
   let ⟨t, ht, hst⟩ := mem_shadow_iff_exists_mem_card_add_one.1 hs
   ⟨t, ht, hst.1⟩
 #align finset.exists_subset_of_mem_shadow Finset.exists_subset_of_mem_shadow
+-/
 
+#print Finset.mem_shadow_iff_exists_mem_card_add /-
 /-- `t ∈ βˆ‚^k π’œ` iff `t` is exactly `k` elements less than something in `π’œ`. -/
 theorem mem_shadow_iff_exists_mem_card_add :
     s ∈ (βˆ‚ ^[k]) π’œ ↔ βˆƒ t ∈ π’œ, s βŠ† t ∧ t.card = s.card + k :=
@@ -187,6 +193,7 @@ theorem mem_shadow_iff_exists_mem_card_add :
     rw [hcard, hu]
     rfl
 #align finset.mem_shadow_iff_exists_mem_card_add Finset.mem_shadow_iff_exists_mem_card_add
+-/
 
 end Shadow
 
@@ -205,7 +212,6 @@ def upShadow (π’œ : Finset (Finset Ξ±)) : Finset (Finset Ξ±) :=
 #align finset.up_shadow Finset.upShadow
 -/
 
--- mathport name: finset.up_shadow
 scoped[FinsetFamily] notation:90 "βˆ‚βΊ " => Finset.upShadow
 
 #print Finset.upShadow_empty /-
@@ -225,11 +231,13 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (
 -/
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
+#print Finset.mem_upShadow_iff /-
 /-- `s` is in the upper shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element
 to get `s`. -/
 theorem mem_upShadow_iff : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ (a : _) (_ : a βˆ‰ t), insert a t = s := by
   simp_rw [up_shadow, mem_sup, mem_image, exists_prop, mem_compl]
 #align finset.mem_up_shadow_iff Finset.mem_upShadow_iff
+-/
 
 #print Finset.insert_mem_upShadow /-
 theorem insert_mem_upShadow (hs : s ∈ π’œ) (ha : a βˆ‰ s) : insert a s ∈ (βˆ‚βΊ ) π’œ :=
@@ -246,6 +254,7 @@ protected theorem Set.Sized.upShadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r)
   rw [card_insert_of_not_mem hi, hπ’œ hA]
 #align set.sized.up_shadow Set.Sized.upShadow
 
+#print Finset.mem_upShadow_iff_erase_mem /-
 /-- `t` is in the upper shadow of `π’œ` iff we can remove an element from it so that the resulting
 finset is in `π’œ`. -/
 theorem mem_upShadow_iff_erase_mem : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ a ∈ s, s.eraseβ‚“ a ∈ π’œ :=
@@ -257,7 +266,9 @@ theorem mem_upShadow_iff_erase_mem : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ a ∈ s, s.era
   · rintro ⟨a, ha, hs⟩
     exact ⟨s.erase a, hs, a, not_mem_erase _ _, insert_erase ha⟩
 #align finset.mem_up_shadow_iff_erase_mem Finset.mem_upShadow_iff_erase_mem
+-/
 
+#print Finset.mem_upShadow_iff_exists_mem_card_add_one /-
 /-- `s ∈ βˆ‚βΊ π’œ` iff `s` is exactly one element less than something from `π’œ`. -/
 theorem mem_upShadow_iff_exists_mem_card_add_one :
     s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ t ∈ π’œ, t βŠ† s ∧ t.card + 1 = s.card :=
@@ -271,13 +282,17 @@ theorem mem_upShadow_iff_exists_mem_card_add_one :
     refine' ⟨a, sdiff_subset _ _ ((ha.ge : _ βŠ† _) <| mem_singleton_self a), _⟩
     rwa [← sdiff_singleton_eq_erase, ← ha, sdiff_sdiff_eq_self hts]
 #align finset.mem_up_shadow_iff_exists_mem_card_add_one Finset.mem_upShadow_iff_exists_mem_card_add_one
+-/
 
+#print Finset.exists_subset_of_mem_upShadow /-
 /-- Being in the upper shadow of `π’œ` means we have a superset in `π’œ`. -/
 theorem exists_subset_of_mem_upShadow (hs : s ∈ (βˆ‚βΊ ) π’œ) : βˆƒ t ∈ π’œ, t βŠ† s :=
   let ⟨t, ht, hts, _⟩ := mem_upShadow_iff_exists_mem_card_add_one.1 hs
   ⟨t, ht, hts⟩
 #align finset.exists_subset_of_mem_up_shadow Finset.exists_subset_of_mem_upShadow
+-/
 
+#print Finset.mem_upShadow_iff_exists_mem_card_add /-
 /-- `t ∈ βˆ‚^k π’œ` iff `t` is exactly `k` elements more than something in `π’œ`. -/
 theorem mem_upShadow_iff_exists_mem_card_add :
     s ∈ (βˆ‚βΊ ^[k]) π’œ ↔ βˆƒ t ∈ π’œ, t βŠ† s ∧ t.card + k = s.card :=
@@ -304,6 +319,7 @@ theorem mem_upShadow_iff_exists_mem_card_add :
     rw [hu, ← hcard, add_right_comm]
     rfl
 #align finset.mem_up_shadow_iff_exists_mem_card_add Finset.mem_upShadow_iff_exists_mem_card_add
+-/
 
 #print Finset.shadow_image_compl /-
 @[simp]
Diff
@@ -107,7 +107,7 @@ theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ (βˆ‚ )
 #align finset.erase_mem_shadow Finset.erase_mem_shadow
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» s) -/
 #print Finset.mem_shadow_iff_insert_mem /-
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
@@ -224,7 +224,7 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (
 #align finset.up_shadow_monotone Finset.upShadow_monotone
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
 /-- `s` is in the upper shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element
 to get `s`. -/
 theorem mem_upShadow_iff : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ (a : _) (_ : a βˆ‰ t), insert a t = s := by
Diff
@@ -111,7 +111,7 @@ theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ (βˆ‚ )
 #print Finset.mem_shadow_iff_insert_mem /-
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
-theorem mem_shadow_iff_insert_mem : s ∈ (βˆ‚ ) π’œ ↔ βˆƒ (a : _)(_ : a βˆ‰ s), insert a s ∈ π’œ :=
+theorem mem_shadow_iff_insert_mem : s ∈ (βˆ‚ ) π’œ ↔ βˆƒ (a : _) (_ : a βˆ‰ s), insert a s ∈ π’œ :=
   by
   refine' mem_shadow_iff.trans ⟨_, _⟩
   · rintro ⟨s, hs, a, ha, rfl⟩
@@ -182,7 +182,7 @@ theorem mem_shadow_iff_exists_mem_card_add :
   · rintro ⟨t, ht, hst, hcard⟩
     obtain ⟨u, hsu, hut, hu⟩ :=
       Finset.exists_intermediate_set k (by rw [add_comm, hcard]; exact le_succ _) hst
-    rw [add_comm] at hu
+    rw [add_comm] at hu 
     refine' ⟨u, mem_shadow_iff_exists_mem_card_add_one.2 ⟨t, ht, hut, _⟩, hsu, hu⟩
     rw [hcard, hu]
     rfl
@@ -227,7 +227,7 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (
 /- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
 /-- `s` is in the upper shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element
 to get `s`. -/
-theorem mem_upShadow_iff : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ (a : _)(_ : a βˆ‰ t), insert a t = s := by
+theorem mem_upShadow_iff : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ (a : _) (_ : a βˆ‰ t), insert a t = s := by
   simp_rw [up_shadow, mem_sup, mem_image, exists_prop, mem_compl]
 #align finset.mem_up_shadow_iff Finset.mem_upShadow_iff
 
@@ -299,7 +299,7 @@ theorem mem_upShadow_iff_exists_mem_card_add :
     obtain ⟨u, htu, hus, hu⟩ :=
       Finset.exists_intermediate_set 1
         (by rw [add_comm, ← hcard]; exact add_le_add_left (zero_lt_succ _) _) hts
-    rw [add_comm] at hu
+    rw [add_comm] at hu 
     refine' ⟨u, mem_up_shadow_iff_exists_mem_card_add_one.2 ⟨t, ht, htu, hu.symm⟩, hus, _⟩
     rw [hu, ← hcard, add_right_comm]
     rfl
Diff
@@ -190,7 +190,7 @@ theorem mem_shadow_iff_exists_mem_card_add :
 
 end Shadow
 
-open FinsetFamily
+open scoped FinsetFamily
 
 section UpShadow
 
Diff
@@ -95,12 +95,6 @@ theorem shadow_monotone : Monotone (shadow : Finset (Finset Ξ±) β†’ Finset (Fins
 #align finset.shadow_monotone Finset.shadow_monotone
 -/
 
-/- warning: finset.mem_shadow_iff -> Finset.mem_shadow_iff is a dubious translation:
-lean 3 declaration is
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, Iff (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) s (Finset.shadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => Exists.{0} (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) (fun (H : Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) => Exists.{succ u1} Ξ± (fun (a : Ξ±) => Exists.{0} (Membership.Mem.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.hasMem.{u1} Ξ±) a t) (fun (H : Membership.Mem.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.hasMem.{u1} Ξ±) a t) => Eq.{succ u1} (Finset.{u1} Ξ±) (Finset.erase.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) t a) s)))))
-but is expected to have type
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, Iff (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) s (Finset.shadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => And (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) t π’œ) (Exists.{succ u1} Ξ± (fun (a : Ξ±) => And (Membership.mem.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.instMembershipFinset.{u1} Ξ±) a t) (Eq.{succ u1} (Finset.{u1} Ξ±) (Finset.erase.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) t a) s)))))
-Case conversion may be inaccurate. Consider using '#align finset.mem_shadow_iff Finset.mem_shadow_iffβ‚“'. -/
 /-- `s` is in the shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element to
 get `s`. -/
 theorem mem_shadow_iff : s ∈ (βˆ‚ ) π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ a ∈ t, erase t a = s := by
@@ -147,12 +141,6 @@ theorem sized_shadow_iff (h : βˆ… βˆ‰ π’œ) :
 #align finset.sized_shadow_iff Finset.sized_shadow_iff
 -/
 
-/- warning: finset.mem_shadow_iff_exists_mem_card_add_one -> Finset.mem_shadow_iff_exists_mem_card_add_one is a dubious translation:
-lean 3 declaration is
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, Iff (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) s (Finset.shadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => Exists.{0} (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) (fun (H : Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) => And (HasSubset.Subset.{u1} (Finset.{u1} Ξ±) (Finset.hasSubset.{u1} Ξ±) s t) (Eq.{1} Nat (Finset.card.{u1} Ξ± t) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (Finset.card.{u1} Ξ± s) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))))))
-but is expected to have type
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, Iff (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) s (Finset.shadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => And (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) t π’œ) (And (HasSubset.Subset.{u1} (Finset.{u1} Ξ±) (Finset.instHasSubsetFinset.{u1} Ξ±) s t) (Eq.{1} Nat (Finset.card.{u1} Ξ± t) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (Finset.card.{u1} Ξ± s) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))))
-Case conversion may be inaccurate. Consider using '#align finset.mem_shadow_iff_exists_mem_card_add_one Finset.mem_shadow_iff_exists_mem_card_add_oneβ‚“'. -/
 /-- `s ∈ βˆ‚ π’œ` iff `s` is exactly one element less than something from `π’œ` -/
 theorem mem_shadow_iff_exists_mem_card_add_one :
     s ∈ (βˆ‚ ) π’œ ↔ βˆƒ t ∈ π’œ, s βŠ† t ∧ t.card = s.card + 1 :=
@@ -168,24 +156,12 @@ theorem mem_shadow_iff_exists_mem_card_add_one :
         rwa [insert_eq a s, ← ha, sdiff_union_of_subset hst]⟩
 #align finset.mem_shadow_iff_exists_mem_card_add_one Finset.mem_shadow_iff_exists_mem_card_add_one
 
-/- warning: finset.exists_subset_of_mem_shadow -> Finset.exists_subset_of_mem_shadow is a dubious translation:
-lean 3 declaration is
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) s (Finset.shadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) π’œ)) -> (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => Exists.{0} (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) (fun (H : Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) => HasSubset.Subset.{u1} (Finset.{u1} Ξ±) (Finset.hasSubset.{u1} Ξ±) s t)))
-but is expected to have type
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) s (Finset.shadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) π’œ)) -> (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => And (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) t π’œ) (HasSubset.Subset.{u1} (Finset.{u1} Ξ±) (Finset.instHasSubsetFinset.{u1} Ξ±) s t)))
-Case conversion may be inaccurate. Consider using '#align finset.exists_subset_of_mem_shadow Finset.exists_subset_of_mem_shadowβ‚“'. -/
 /-- Being in the shadow of `π’œ` means we have a superset in `π’œ`. -/
 theorem exists_subset_of_mem_shadow (hs : s ∈ (βˆ‚ ) π’œ) : βˆƒ t ∈ π’œ, s βŠ† t :=
   let ⟨t, ht, hst⟩ := mem_shadow_iff_exists_mem_card_add_one.1 hs
   ⟨t, ht, hst.1⟩
 #align finset.exists_subset_of_mem_shadow Finset.exists_subset_of_mem_shadow
 
-/- warning: finset.mem_shadow_iff_exists_mem_card_add -> Finset.mem_shadow_iff_exists_mem_card_add is a dubious translation:
-lean 3 declaration is
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±} {k : Nat}, Iff (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) s (Nat.iterate.{succ u1} (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.shadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)) k π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => Exists.{0} (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) (fun (H : Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) => And (HasSubset.Subset.{u1} (Finset.{u1} Ξ±) (Finset.hasSubset.{u1} Ξ±) s t) (Eq.{1} Nat (Finset.card.{u1} Ξ± t) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (Finset.card.{u1} Ξ± s) k)))))
-but is expected to have type
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±} {k : Nat}, Iff (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) s (Nat.iterate.{succ u1} (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.shadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)) k π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => And (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) t π’œ) (And (HasSubset.Subset.{u1} (Finset.{u1} Ξ±) (Finset.instHasSubsetFinset.{u1} Ξ±) s t) (Eq.{1} Nat (Finset.card.{u1} Ξ± t) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (Finset.card.{u1} Ξ± s) k)))))
-Case conversion may be inaccurate. Consider using '#align finset.mem_shadow_iff_exists_mem_card_add Finset.mem_shadow_iff_exists_mem_card_addβ‚“'. -/
 /-- `t ∈ βˆ‚^k π’œ` iff `t` is exactly `k` elements less than something in `π’œ`. -/
 theorem mem_shadow_iff_exists_mem_card_add :
     s ∈ (βˆ‚ ^[k]) π’œ ↔ βˆƒ t ∈ π’œ, s βŠ† t ∧ t.card = s.card + k :=
@@ -248,12 +224,6 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (
 #align finset.up_shadow_monotone Finset.upShadow_monotone
 -/
 
-/- warning: finset.mem_up_shadow_iff -> Finset.mem_upShadow_iff is a dubious translation:
-lean 3 declaration is
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, Iff (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) s (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => Exists.{0} (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) (fun (H : Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) => Exists.{succ u1} Ξ± (fun (a : Ξ±) => Exists.{0} (Not (Membership.Mem.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.hasMem.{u1} Ξ±) a t)) (fun (H : Not (Membership.Mem.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.hasMem.{u1} Ξ±) a t)) => Eq.{succ u1} (Finset.{u1} Ξ±) (Insert.insert.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.hasInsert.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)) a t) s)))))
-but is expected to have type
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, Iff (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) s (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => And (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) t π’œ) (Exists.{succ u1} Ξ± (fun (a : Ξ±) => Exists.{0} (Not (Membership.mem.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.instMembershipFinset.{u1} Ξ±) a t)) (fun (x._@.Mathlib.Combinatorics.SetFamily.Shadow._hyg.2641 : Not (Membership.mem.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.instMembershipFinset.{u1} Ξ±) a t)) => Eq.{succ u1} (Finset.{u1} Ξ±) (Insert.insert.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.instInsertFinset.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)) a t) s)))))
-Case conversion may be inaccurate. Consider using '#align finset.mem_up_shadow_iff Finset.mem_upShadow_iffβ‚“'. -/
 /- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
 /-- `s` is in the upper shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element
 to get `s`. -/
@@ -276,12 +246,6 @@ protected theorem Set.Sized.upShadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r)
   rw [card_insert_of_not_mem hi, hπ’œ hA]
 #align set.sized.up_shadow Set.Sized.upShadow
 
-/- warning: finset.mem_up_shadow_iff_erase_mem -> Finset.mem_upShadow_iff_erase_mem is a dubious translation:
-lean 3 declaration is
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, Iff (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) s (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 π’œ)) (Exists.{succ u1} Ξ± (fun (a : Ξ±) => Exists.{0} (Membership.Mem.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.hasMem.{u1} Ξ±) a s) (fun (H : Membership.Mem.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.hasMem.{u1} Ξ±) a s) => Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) (Finset.erase.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) s a) π’œ)))
-but is expected to have type
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, Iff (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) s (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 π’œ)) (Exists.{succ u1} Ξ± (fun (a : Ξ±) => And (Membership.mem.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.instMembershipFinset.{u1} Ξ±) a s) (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) (Finset.erase.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) s a) π’œ)))
-Case conversion may be inaccurate. Consider using '#align finset.mem_up_shadow_iff_erase_mem Finset.mem_upShadow_iff_erase_memβ‚“'. -/
 /-- `t` is in the upper shadow of `π’œ` iff we can remove an element from it so that the resulting
 finset is in `π’œ`. -/
 theorem mem_upShadow_iff_erase_mem : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ a ∈ s, s.eraseβ‚“ a ∈ π’œ :=
@@ -294,12 +258,6 @@ theorem mem_upShadow_iff_erase_mem : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ a ∈ s, s.era
     exact ⟨s.erase a, hs, a, not_mem_erase _ _, insert_erase ha⟩
 #align finset.mem_up_shadow_iff_erase_mem Finset.mem_upShadow_iff_erase_mem
 
-/- warning: finset.mem_up_shadow_iff_exists_mem_card_add_one -> Finset.mem_upShadow_iff_exists_mem_card_add_one is a dubious translation:
-lean 3 declaration is
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, Iff (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) s (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => Exists.{0} (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) (fun (H : Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) => And (HasSubset.Subset.{u1} (Finset.{u1} Ξ±) (Finset.hasSubset.{u1} Ξ±) t s) (Eq.{1} Nat (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (Finset.card.{u1} Ξ± t) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (Finset.card.{u1} Ξ± s)))))
-but is expected to have type
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, Iff (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) s (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => And (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) t π’œ) (And (HasSubset.Subset.{u1} (Finset.{u1} Ξ±) (Finset.instHasSubsetFinset.{u1} Ξ±) t s) (Eq.{1} Nat (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (Finset.card.{u1} Ξ± t) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (Finset.card.{u1} Ξ± s)))))
-Case conversion may be inaccurate. Consider using '#align finset.mem_up_shadow_iff_exists_mem_card_add_one Finset.mem_upShadow_iff_exists_mem_card_add_oneβ‚“'. -/
 /-- `s ∈ βˆ‚βΊ π’œ` iff `s` is exactly one element less than something from `π’œ`. -/
 theorem mem_upShadow_iff_exists_mem_card_add_one :
     s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ t ∈ π’œ, t βŠ† s ∧ t.card + 1 = s.card :=
@@ -314,24 +272,12 @@ theorem mem_upShadow_iff_exists_mem_card_add_one :
     rwa [← sdiff_singleton_eq_erase, ← ha, sdiff_sdiff_eq_self hts]
 #align finset.mem_up_shadow_iff_exists_mem_card_add_one Finset.mem_upShadow_iff_exists_mem_card_add_one
 
-/- warning: finset.exists_subset_of_mem_up_shadow -> Finset.exists_subset_of_mem_upShadow is a dubious translation:
-lean 3 declaration is
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) s (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 π’œ)) -> (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => Exists.{0} (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) (fun (H : Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) => HasSubset.Subset.{u1} (Finset.{u1} Ξ±) (Finset.hasSubset.{u1} Ξ±) t s)))
-but is expected to have type
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) s (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 π’œ)) -> (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => And (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) t π’œ) (HasSubset.Subset.{u1} (Finset.{u1} Ξ±) (Finset.instHasSubsetFinset.{u1} Ξ±) t s)))
-Case conversion may be inaccurate. Consider using '#align finset.exists_subset_of_mem_up_shadow Finset.exists_subset_of_mem_upShadowβ‚“'. -/
 /-- Being in the upper shadow of `π’œ` means we have a superset in `π’œ`. -/
 theorem exists_subset_of_mem_upShadow (hs : s ∈ (βˆ‚βΊ ) π’œ) : βˆƒ t ∈ π’œ, t βŠ† s :=
   let ⟨t, ht, hts, _⟩ := mem_upShadow_iff_exists_mem_card_add_one.1 hs
   ⟨t, ht, hts⟩
 #align finset.exists_subset_of_mem_up_shadow Finset.exists_subset_of_mem_upShadow
 
-/- warning: finset.mem_up_shadow_iff_exists_mem_card_add -> Finset.mem_upShadow_iff_exists_mem_card_add is a dubious translation:
-lean 3 declaration is
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±} {k : Nat}, Iff (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) s (Nat.iterate.{succ u1} (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2) k π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => Exists.{0} (Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) (fun (H : Membership.Mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.hasMem.{u1} (Finset.{u1} Ξ±)) t π’œ) => And (HasSubset.Subset.{u1} (Finset.{u1} Ξ±) (Finset.hasSubset.{u1} Ξ±) t s) (Eq.{1} Nat (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (Finset.card.{u1} Ξ± t) k) (Finset.card.{u1} Ξ± s)))))
-but is expected to have type
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±} {k : Nat}, Iff (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) s (Nat.iterate.{succ u1} (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2) k π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => And (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) t π’œ) (And (HasSubset.Subset.{u1} (Finset.{u1} Ξ±) (Finset.instHasSubsetFinset.{u1} Ξ±) t s) (Eq.{1} Nat (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (Finset.card.{u1} Ξ± t) k) (Finset.card.{u1} Ξ± s)))))
-Case conversion may be inaccurate. Consider using '#align finset.mem_up_shadow_iff_exists_mem_card_add Finset.mem_upShadow_iff_exists_mem_card_addβ‚“'. -/
 /-- `t ∈ βˆ‚^k π’œ` iff `t` is exactly `k` elements more than something in `π’œ`. -/
 theorem mem_upShadow_iff_exists_mem_card_add :
     s ∈ (βˆ‚βΊ ^[k]) π’œ ↔ βˆƒ t ∈ π’œ, t βŠ† s ∧ t.card + k = s.card :=
Diff
@@ -205,11 +205,7 @@ theorem mem_shadow_iff_exists_mem_card_add :
     rfl
   · rintro ⟨t, ht, hst, hcard⟩
     obtain ⟨u, hsu, hut, hu⟩ :=
-      Finset.exists_intermediate_set k
-        (by
-          rw [add_comm, hcard]
-          exact le_succ _)
-        hst
+      Finset.exists_intermediate_set k (by rw [add_comm, hcard]; exact le_succ _) hst
     rw [add_comm] at hu
     refine' ⟨u, mem_shadow_iff_exists_mem_card_add_one.2 ⟨t, ht, hut, _⟩, hsu, hu⟩
     rw [hcard, hu]
@@ -356,10 +352,7 @@ theorem mem_upShadow_iff_exists_mem_card_add :
   · rintro ⟨t, ht, hts, hcard⟩
     obtain ⟨u, htu, hus, hu⟩ :=
       Finset.exists_intermediate_set 1
-        (by
-          rw [add_comm, ← hcard]
-          exact add_le_add_left (zero_lt_succ _) _)
-        hts
+        (by rw [add_comm, ← hcard]; exact add_le_add_left (zero_lt_succ _) _) hts
     rw [add_comm] at hu
     refine' ⟨u, mem_up_shadow_iff_exists_mem_card_add_one.2 ⟨t, ht, htu, hu.symm⟩, hus, _⟩
     rw [hu, ← hcard, add_right_comm]
Diff
@@ -366,12 +366,7 @@ theorem mem_upShadow_iff_exists_mem_card_add :
     rfl
 #align finset.mem_up_shadow_iff_exists_mem_card_add Finset.mem_upShadow_iff_exists_mem_card_add
 
-/- warning: finset.shadow_image_compl -> Finset.shadow_image_compl is a dubious translation:
-lean 3 declaration is
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)}, Eq.{succ u1} (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.image.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} Ξ±) (fun (a : Finset.{u1} Ξ±) (b : Finset.{u1} Ξ±) => Finset.decidableEq.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) a b) (HasCompl.compl.{u1} (Finset.{u1} Ξ±) (BooleanAlgebra.toHasCompl.{u1} (Finset.{u1} Ξ±) (Finset.booleanAlgebra.{u1} Ξ± _inst_2 (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)))) (Finset.shadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) π’œ)) (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 (Finset.image.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} Ξ±) (fun (a : Finset.{u1} Ξ±) (b : Finset.{u1} Ξ±) => Finset.decidableEq.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) a b) (HasCompl.compl.{u1} (Finset.{u1} Ξ±) (BooleanAlgebra.toHasCompl.{u1} (Finset.{u1} Ξ±) (Finset.booleanAlgebra.{u1} Ξ± _inst_2 (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)))) π’œ))
-but is expected to have type
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)}, Eq.{succ u1} (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.image.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} Ξ±) (fun (a : Finset.{u1} Ξ±) (b : Finset.{u1} Ξ±) => Finset.decidableEq.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) a b) (HasCompl.compl.{u1} (Finset.{u1} Ξ±) (BooleanAlgebra.toHasCompl.{u1} (Finset.{u1} Ξ±) (Finset.instBooleanAlgebraFinset.{u1} Ξ± _inst_2 (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)))) (Finset.shadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) π’œ)) (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 (Finset.image.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} Ξ±) (fun (a : Finset.{u1} Ξ±) (b : Finset.{u1} Ξ±) => Finset.decidableEq.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) a b) (HasCompl.compl.{u1} (Finset.{u1} Ξ±) (BooleanAlgebra.toHasCompl.{u1} (Finset.{u1} Ξ±) (Finset.instBooleanAlgebraFinset.{u1} Ξ± _inst_2 (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)))) π’œ))
-Case conversion may be inaccurate. Consider using '#align finset.shadow_image_compl Finset.shadow_image_complβ‚“'. -/
+#print Finset.shadow_image_compl /-
 @[simp]
 theorem shadow_image_compl : ((βˆ‚ ) π’œ).image compl = (βˆ‚βΊ ) (π’œ.image compl) :=
   by
@@ -383,13 +378,9 @@ theorem shadow_image_compl : ((βˆ‚ ) π’œ).image compl = (βˆ‚βΊ ) (π’œ.image c
   · rintro ⟨_, ⟨s, hs, rfl⟩, a, ha, rfl⟩
     exact ⟨s.erase a, ⟨s, hs, a, not_mem_compl.1 ha, rfl⟩, compl_erase⟩
 #align finset.shadow_image_compl Finset.shadow_image_compl
+-/
 
-/- warning: finset.up_shadow_image_compl -> Finset.upShadow_image_compl is a dubious translation:
-lean 3 declaration is
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)}, Eq.{succ u1} (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.image.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} Ξ±) (fun (a : Finset.{u1} Ξ±) (b : Finset.{u1} Ξ±) => Finset.decidableEq.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) a b) (HasCompl.compl.{u1} (Finset.{u1} Ξ±) (BooleanAlgebra.toHasCompl.{u1} (Finset.{u1} Ξ±) (Finset.booleanAlgebra.{u1} Ξ± _inst_2 (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)))) (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 π’œ)) (Finset.shadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) (Finset.image.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} Ξ±) (fun (a : Finset.{u1} Ξ±) (b : Finset.{u1} Ξ±) => Finset.decidableEq.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) a b) (HasCompl.compl.{u1} (Finset.{u1} Ξ±) (BooleanAlgebra.toHasCompl.{u1} (Finset.{u1} Ξ±) (Finset.booleanAlgebra.{u1} Ξ± _inst_2 (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)))) π’œ))
-but is expected to have type
-  forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)}, Eq.{succ u1} (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.image.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} Ξ±) (fun (a : Finset.{u1} Ξ±) (b : Finset.{u1} Ξ±) => Finset.decidableEq.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) a b) (HasCompl.compl.{u1} (Finset.{u1} Ξ±) (BooleanAlgebra.toHasCompl.{u1} (Finset.{u1} Ξ±) (Finset.instBooleanAlgebraFinset.{u1} Ξ± _inst_2 (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)))) (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 π’œ)) (Finset.shadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) (Finset.image.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} Ξ±) (fun (a : Finset.{u1} Ξ±) (b : Finset.{u1} Ξ±) => Finset.decidableEq.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) a b) (HasCompl.compl.{u1} (Finset.{u1} Ξ±) (BooleanAlgebra.toHasCompl.{u1} (Finset.{u1} Ξ±) (Finset.instBooleanAlgebraFinset.{u1} Ξ± _inst_2 (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)))) π’œ))
-Case conversion may be inaccurate. Consider using '#align finset.up_shadow_image_compl Finset.upShadow_image_complβ‚“'. -/
+#print Finset.upShadow_image_compl /-
 @[simp]
 theorem upShadow_image_compl : ((βˆ‚βΊ ) π’œ).image compl = (βˆ‚ ) (π’œ.image compl) :=
   by
@@ -401,6 +392,7 @@ theorem upShadow_image_compl : ((βˆ‚βΊ ) π’œ).image compl = (βˆ‚ ) (π’œ.image
   · rintro ⟨_, ⟨s, hs, rfl⟩, a, ha, rfl⟩
     exact ⟨insert a s, ⟨s, hs, a, mem_compl.1 ha, rfl⟩, compl_insert⟩
 #align finset.up_shadow_image_compl Finset.upShadow_image_compl
+-/
 
 end UpShadow
 
Diff
@@ -113,7 +113,7 @@ theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ (βˆ‚ )
 #align finset.erase_mem_shadow Finset.erase_mem_shadow
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» s) -/
 #print Finset.mem_shadow_iff_insert_mem /-
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
@@ -258,7 +258,7 @@ lean 3 declaration is
 but is expected to have type
   forall {Ξ± : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} Ξ±] [_inst_2 : Fintype.{u1} Ξ±] {π’œ : Finset.{u1} (Finset.{u1} Ξ±)} {s : Finset.{u1} Ξ±}, Iff (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) s (Finset.upShadow.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b) _inst_2 π’œ)) (Exists.{succ u1} (Finset.{u1} Ξ±) (fun (t : Finset.{u1} Ξ±) => And (Membership.mem.{u1, u1} (Finset.{u1} Ξ±) (Finset.{u1} (Finset.{u1} Ξ±)) (Finset.instMembershipFinset.{u1} (Finset.{u1} Ξ±)) t π’œ) (Exists.{succ u1} Ξ± (fun (a : Ξ±) => Exists.{0} (Not (Membership.mem.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.instMembershipFinset.{u1} Ξ±) a t)) (fun (x._@.Mathlib.Combinatorics.SetFamily.Shadow._hyg.2641 : Not (Membership.mem.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.instMembershipFinset.{u1} Ξ±) a t)) => Eq.{succ u1} (Finset.{u1} Ξ±) (Insert.insert.{u1, u1} Ξ± (Finset.{u1} Ξ±) (Finset.instInsertFinset.{u1} Ξ± (fun (a : Ξ±) (b : Ξ±) => _inst_1 a b)) a t) s)))))
 Case conversion may be inaccurate. Consider using '#align finset.mem_up_shadow_iff Finset.mem_upShadow_iffβ‚“'. -/
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (a Β«expr βˆ‰ Β» t) -/
 /-- `s` is in the upper shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element
 to get `s`. -/
 theorem mem_upShadow_iff : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ (a : _)(_ : a βˆ‰ t), insert a t = s := by

Changes in mathlib4

mathlib3
mathlib4
chore: tidy various files (#11490)
Diff
@@ -105,7 +105,7 @@ lemma mem_shadow_iff_exists_sdiff : t ∈ βˆ‚ π’œ ↔ βˆƒ s ∈ π’œ, t βŠ† s 
 
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
-lemma mem_shadow_iff_insert_mem : t ∈ βˆ‚ π’œ ↔ βˆƒ a, a βˆ‰ t ∧ insert a t ∈ π’œ := by
+lemma mem_shadow_iff_insert_mem : t ∈ βˆ‚ π’œ ↔ βˆƒ a βˆ‰ t, insert a t ∈ π’œ := by
   simp_rw [mem_shadow_iff_exists_sdiff, ← covBy_iff_card_sdiff_eq_one, covBy_iff_exists_insert]
   aesop
 #align finset.mem_shadow_iff_insert_mem Finset.mem_shadow_iff_insert_mem
chore: move Mathlib to v4.7.0-rc1 (#11162)

This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0 branch as we update to intermediate nightlies.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>

Diff
@@ -125,6 +125,7 @@ lemma mem_shadow_iterate_iff_exists_card :
     t ∈ βˆ‚^[k] π’œ ↔ βˆƒ u : Finset Ξ±, u.card = k ∧ Disjoint t u ∧ t βˆͺ u ∈ π’œ := by
   induction' k with k ih generalizing t
   Β· simp
+  set_option tactic.skipAssignedInstances false in
   simp only [mem_shadow_iff_insert_mem, ih, Function.iterate_succ_apply', card_eq_succ]
   aesop
 
chore(Covby): rename Covby to CovBy (#9578)

Rename

  • Covby β†’ CovBy, Wcovby β†’ WCovBy
  • *covby* β†’ *covBy*
  • wcovby.finset_val β†’ WCovBy.finset_val, wcovby.finset_coe β†’ WCovBy.finset_coe
  • Covby.is_coatom β†’ CovBy.isCoatom
Diff
@@ -101,12 +101,12 @@ theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ βˆ‚ 
 
 See also `Finset.mem_shadow_iff_exists_mem_card_add_one`. -/
 lemma mem_shadow_iff_exists_sdiff : t ∈ βˆ‚ π’œ ↔ βˆƒ s ∈ π’œ, t βŠ† s ∧ (s \ t).card = 1 := by
-  simp_rw [mem_shadow_iff, ← covby_iff_card_sdiff_eq_one, covby_iff_exists_erase]
+  simp_rw [mem_shadow_iff, ← covBy_iff_card_sdiff_eq_one, covBy_iff_exists_erase]
 
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
 lemma mem_shadow_iff_insert_mem : t ∈ βˆ‚ π’œ ↔ βˆƒ a, a βˆ‰ t ∧ insert a t ∈ π’œ := by
-  simp_rw [mem_shadow_iff_exists_sdiff, ← covby_iff_card_sdiff_eq_one, covby_iff_exists_insert]
+  simp_rw [mem_shadow_iff_exists_sdiff, ← covBy_iff_card_sdiff_eq_one, covBy_iff_exists_insert]
   aesop
 #align finset.mem_shadow_iff_insert_mem Finset.mem_shadow_iff_insert_mem
 
@@ -223,12 +223,12 @@ theorem insert_mem_upShadow (hs : s ∈ π’œ) (ha : a βˆ‰ s) : insert a s ∈ 
 
 See also `Finset.mem_upShadow_iff_exists_mem_card_add_one`. -/
 lemma mem_upShadow_iff_exists_sdiff : t ∈ βˆ‚βΊ π’œ ↔ βˆƒ s ∈ π’œ, s βŠ† t ∧ (t \ s).card = 1 := by
-  simp_rw [mem_upShadow_iff, ← covby_iff_card_sdiff_eq_one, covby_iff_exists_insert]
+  simp_rw [mem_upShadow_iff, ← covBy_iff_card_sdiff_eq_one, covBy_iff_exists_insert]
 
 /-- `t` is in the upper shadow of `π’œ` iff we can remove an element from it so that the resulting
 finset is in `π’œ`. -/
 lemma mem_upShadow_iff_erase_mem : t ∈ βˆ‚βΊ π’œ ↔ βˆƒ a, a ∈ t ∧ erase t a ∈ π’œ := by
-  simp_rw [mem_upShadow_iff_exists_sdiff, ← covby_iff_card_sdiff_eq_one, covby_iff_exists_erase]
+  simp_rw [mem_upShadow_iff_exists_sdiff, ← covBy_iff_card_sdiff_eq_one, covBy_iff_exists_erase]
   aesop
 #align finset.mem_up_shadow_iff_erase_mem Finset.mem_upShadow_iff_erase_mem
 
chore(*): replace $ with <| (#9319)

See Zulip thread for the discussion.

Diff
@@ -115,7 +115,7 @@ lemma mem_shadow_iff_insert_mem : t ∈ βˆ‚ π’œ ↔ βˆƒ a, a βˆ‰ t ∧ insert a
 See also `Finset.mem_shadow_iff_exists_sdiff`. -/
 lemma mem_shadow_iff_exists_mem_card_add_one :
     t ∈ βˆ‚ π’œ ↔ βˆƒ s ∈ π’œ, t βŠ† s ∧ s.card = t.card + 1 := by
-  refine mem_shadow_iff_exists_sdiff.trans $ exists_congr fun t ↦ and_congr_right fun _ ↦
+  refine mem_shadow_iff_exists_sdiff.trans <| exists_congr fun t ↦ and_congr_right fun _ ↦
     and_congr_right fun hst ↦ ?_
   rw [card_sdiff hst, tsub_eq_iff_eq_add_of_le, add_comm]
   exact card_mono hst
@@ -145,7 +145,7 @@ lemma mem_shadow_iterate_iff_exists_sdiff : t ∈ βˆ‚^[k] π’œ ↔ βˆƒ s ∈ 
 See also `Finset.mem_shadow_iterate_iff_exists_sdiff`. -/
 lemma mem_shadow_iterate_iff_exists_mem_card_add :
     t ∈ βˆ‚^[k] π’œ ↔ βˆƒ s ∈ π’œ, t βŠ† s ∧ s.card = t.card + k := by
-  refine mem_shadow_iterate_iff_exists_sdiff.trans $ exists_congr fun t ↦ and_congr_right fun _ ↦
+  refine mem_shadow_iterate_iff_exists_sdiff.trans <| exists_congr fun t ↦ and_congr_right fun _ ↦
     and_congr_right fun hst ↦ ?_
   rw [card_sdiff hst, tsub_eq_iff_eq_add_of_le, add_comm]
   exact card_mono hst
@@ -237,7 +237,7 @@ lemma mem_upShadow_iff_erase_mem : t ∈ βˆ‚βΊ π’œ ↔ βˆƒ a, a ∈ t ∧ eras
 See also `Finset.mem_upShadow_iff_exists_sdiff`. -/
 lemma mem_upShadow_iff_exists_mem_card_add_one :
     t ∈ βˆ‚βΊ π’œ ↔ βˆƒ s ∈ π’œ, s βŠ† t ∧ t.card = s.card + 1 := by
-  refine mem_upShadow_iff_exists_sdiff.trans $ exists_congr fun t ↦ and_congr_right fun _ ↦
+  refine mem_upShadow_iff_exists_sdiff.trans <| exists_congr fun t ↦ and_congr_right fun _ ↦
     and_congr_right fun hst ↦ ?_
   rw [card_sdiff hst, tsub_eq_iff_eq_add_of_le, add_comm]
   exact card_mono hst
@@ -273,7 +273,7 @@ lemma mem_upShadow_iterate_iff_exists_sdiff :
 See also `Finset.mem_upShadow_iterate_iff_exists_sdiff`. -/
 lemma mem_upShadow_iterate_iff_exists_mem_card_add :
     t ∈ βˆ‚βΊ^[k] π’œ ↔ βˆƒ s ∈ π’œ, s βŠ† t ∧ t.card = s.card + k := by
-  refine mem_upShadow_iterate_iff_exists_sdiff.trans $ exists_congr fun t ↦ and_congr_right fun _ ↦
+  refine mem_upShadow_iterate_iff_exists_sdiff.trans <| exists_congr fun t ↦ and_congr_right fun _ ↦
     and_congr_right fun hst ↦ ?_
   rw [card_sdiff hst, tsub_eq_iff_eq_add_of_le, add_comm]
   exact card_mono hst
chore: Improve Finset lemma names (#8894)

Change a few lemma names that have historically bothered me.

  • Finset.card_le_of_subset β†’ Finset.card_le_card
  • Multiset.card_le_of_le β†’ Multiset.card_le_card
  • Multiset.card_lt_of_lt β†’ Multiset.card_lt_card
  • Set.ncard_le_of_subset β†’ Set.ncard_le_ncard
  • Finset.image_filter β†’ Finset.filter_image
  • CompleteLattice.finset_sup_compact_of_compact β†’ CompleteLattice.isCompactElement_finset_sup
Diff
@@ -164,7 +164,7 @@ lemma _root_.Set.Sized.shadow_iterate (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r)
     (βˆ‚^[k] π’œ : Set (Finset Ξ±)).Sized (r - k) := by
   simp_rw [Set.Sized, mem_coe, mem_shadow_iterate_iff_exists_sdiff]
   rintro t ⟨s, hs, hts, rfl⟩
-  rw [card_sdiff hts, ← hπ’œ hs, Nat.sub_sub_self (card_le_of_subset hts)]
+  rw [card_sdiff hts, ← hπ’œ hs, Nat.sub_sub_self (card_le_card hts)]
 
 theorem sized_shadow_iff (h : βˆ… βˆ‰ π’œ) :
     (βˆ‚ π’œ : Set (Finset Ξ±)).Sized r ↔ (π’œ : Set (Finset Ξ±)).Sized (r + 1) := by
chore: update std4 to b197bd2, catching up to leanprover/std4#427 (#8888)

Co-authored-by: James <jamesgallicchio@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Siddharth Bhat <siddu.druid@gmail.com>

Diff
@@ -211,7 +211,7 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (
 
 /-- `t` is in the upper shadow of `π’œ` iff there is a `s ∈ π’œ` from which we can remove one element
 to get `t`. -/
-lemma mem_upShadow_iff : t ∈ βˆ‚βΊ π’œ ↔ βˆƒ s ∈ π’œ, βˆƒ a, a βˆ‰ s ∧ insert a s = t := by
+lemma mem_upShadow_iff : t ∈ βˆ‚βΊ π’œ ↔ βˆƒ s ∈ π’œ, βˆƒ a βˆ‰ s, insert a s = t := by
   simp_rw [upShadow, mem_sup, mem_image, mem_compl]
 #align finset.mem_up_shadow_iff Finset.mem_upShadow_iff
 
feat: Finsets and multisets are graded (#8892)

Characterise IsAtom, IsCoatom, Covby in Set Ξ±, Multiset Ξ±, Finset Ξ± and deduce that Multiset Ξ±, Finset Ξ± are graded orders.

Note I am moving some existing characterisations to here because it makes sense thematically, but I could be convinced otherwise.

Diff
@@ -3,6 +3,7 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Bhavik Mehta, Alena Gusakov, YaΓ«l Dillies
 -/
+import Mathlib.Data.Finset.Grade
 import Mathlib.Data.Finset.Sups
 import Mathlib.Logic.Function.Iterate
 
@@ -100,7 +101,7 @@ theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ βˆ‚ 
 
 See also `Finset.mem_shadow_iff_exists_mem_card_add_one`. -/
 lemma mem_shadow_iff_exists_sdiff : t ∈ βˆ‚ π’œ ↔ βˆƒ s ∈ π’œ, t βŠ† s ∧ (s \ t).card = 1 := by
-  simp_rw [mem_shadow_iff, ← covby_iff_card_sdiff_eq_one, covby_iff_exists_erase, eq_comm]
+  simp_rw [mem_shadow_iff, ← covby_iff_card_sdiff_eq_one, covby_iff_exists_erase]
 
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
chore: space after ← (#8178)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -100,12 +100,12 @@ theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ βˆ‚ 
 
 See also `Finset.mem_shadow_iff_exists_mem_card_add_one`. -/
 lemma mem_shadow_iff_exists_sdiff : t ∈ βˆ‚ π’œ ↔ βˆƒ s ∈ π’œ, t βŠ† s ∧ (s \ t).card = 1 := by
-  simp_rw [mem_shadow_iff, ←covby_iff_card_sdiff_eq_one, covby_iff_exists_erase, eq_comm]
+  simp_rw [mem_shadow_iff, ← covby_iff_card_sdiff_eq_one, covby_iff_exists_erase, eq_comm]
 
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
 lemma mem_shadow_iff_insert_mem : t ∈ βˆ‚ π’œ ↔ βˆƒ a, a βˆ‰ t ∧ insert a t ∈ π’œ := by
-  simp_rw [mem_shadow_iff_exists_sdiff, ←covby_iff_card_sdiff_eq_one, covby_iff_exists_insert]
+  simp_rw [mem_shadow_iff_exists_sdiff, ← covby_iff_card_sdiff_eq_one, covby_iff_exists_insert]
   aesop
 #align finset.mem_shadow_iff_insert_mem Finset.mem_shadow_iff_insert_mem
 
@@ -163,7 +163,7 @@ lemma _root_.Set.Sized.shadow_iterate (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r)
     (βˆ‚^[k] π’œ : Set (Finset Ξ±)).Sized (r - k) := by
   simp_rw [Set.Sized, mem_coe, mem_shadow_iterate_iff_exists_sdiff]
   rintro t ⟨s, hs, hts, rfl⟩
-  rw [card_sdiff hts, ←hπ’œ hs, Nat.sub_sub_self (card_le_of_subset hts)]
+  rw [card_sdiff hts, ← hπ’œ hs, Nat.sub_sub_self (card_le_of_subset hts)]
 
 theorem sized_shadow_iff (h : βˆ… βˆ‰ π’œ) :
     (βˆ‚ π’œ : Set (Finset Ξ±)).Sized r ↔ (π’œ : Set (Finset Ξ±)).Sized (r + 1) := by
@@ -222,12 +222,12 @@ theorem insert_mem_upShadow (hs : s ∈ π’œ) (ha : a βˆ‰ s) : insert a s ∈ 
 
 See also `Finset.mem_upShadow_iff_exists_mem_card_add_one`. -/
 lemma mem_upShadow_iff_exists_sdiff : t ∈ βˆ‚βΊ π’œ ↔ βˆƒ s ∈ π’œ, s βŠ† t ∧ (t \ s).card = 1 := by
-  simp_rw [mem_upShadow_iff, ←covby_iff_card_sdiff_eq_one, covby_iff_exists_insert]
+  simp_rw [mem_upShadow_iff, ← covby_iff_card_sdiff_eq_one, covby_iff_exists_insert]
 
 /-- `t` is in the upper shadow of `π’œ` iff we can remove an element from it so that the resulting
 finset is in `π’œ`. -/
 lemma mem_upShadow_iff_erase_mem : t ∈ βˆ‚βΊ π’œ ↔ βˆƒ a, a ∈ t ∧ erase t a ∈ π’œ := by
-  simp_rw [mem_upShadow_iff_exists_sdiff, ←covby_iff_card_sdiff_eq_one, covby_iff_exists_erase]
+  simp_rw [mem_upShadow_iff_exists_sdiff, ← covby_iff_card_sdiff_eq_one, covby_iff_exists_erase]
   aesop
 #align finset.mem_up_shadow_iff_erase_mem Finset.mem_upShadow_iff_erase_mem
 
@@ -247,7 +247,7 @@ lemma mem_upShadow_iterate_iff_exists_card :
   induction' k with k ih generalizing t
   Β· simp
   simp only [mem_upShadow_iff_erase_mem, ih, Function.iterate_succ_apply', card_eq_succ,
-    subset_erase, erase_sdiff_comm, ←sdiff_insert]
+    subset_erase, erase_sdiff_comm, ← sdiff_insert]
   constructor
   · rintro ⟨a, hat, u, rfl, ⟨hut, hau⟩, htu⟩
     exact ⟨_, ⟨_, _, hau, rfl, rfl⟩, insert_subset hat hut, htu⟩
@@ -324,14 +324,14 @@ theorem mem_upShadow_iff_exists_mem_card_add :
   ext s
   simp only [mem_image, exists_prop, mem_shadow_iff, mem_upShadow_iff, mem_compls]
   refine (compl_involutive.toPerm _).exists_congr_left.trans ?_
-  simp [←compl_involutive.eq_iff]
+  simp [← compl_involutive.eq_iff]
 #align finset.up_shadow_image_compl Finset.shadow_compls
 
 @[simp] lemma upShadow_compls : βˆ‚βΊ π’œαΆœΛ’ = (βˆ‚ π’œ)ᢜ˒ := by
   ext s
   simp only [mem_image, exists_prop, mem_shadow_iff, mem_upShadow_iff, mem_compls]
   refine (compl_involutive.toPerm _).exists_congr_left.trans ?_
-  simp [←compl_involutive.eq_iff]
+  simp [← compl_involutive.eq_iff]
 #align finset.shadow_image_compl Finset.upShadow_compls
 
 end UpShadow
feat: Lemmas about the iterated shadow (#7863)

Move the lemmas characterising Covby on Finset Ξ± from Data.Finset.Interval to Data.Finset.Basic. Golf the other proofs in Data.Finset.Interval and make sure the lemma names reflect whether each lemma is about insert or cons.

Diff
@@ -71,6 +71,9 @@ theorem shadow_empty : βˆ‚ (βˆ… : Finset (Finset Ξ±)) = βˆ… :=
   rfl
 #align finset.shadow_empty Finset.shadow_empty
 
+@[simp] lemma shadow_iterate_empty (k : β„•) : βˆ‚^[k] (βˆ… : Finset (Finset Ξ±)) = βˆ… := by
+  induction' k <;> simp [*, shadow_empty]
+
 @[simp]
 theorem shadow_singleton_empty : βˆ‚ ({βˆ…} : Finset (Finset Ξ±)) = βˆ… :=
   rfl
@@ -83,9 +86,9 @@ theorem shadow_monotone : Monotone (shadow : Finset (Finset Ξ±) β†’ Finset (Fins
   sup_mono
 #align finset.shadow_monotone Finset.shadow_monotone
 
-/-- `s` is in the shadow of `π’œ` iff there is a `t ∈ π’œ` from which we can remove one element to
-get `s`. -/
-theorem mem_shadow_iff : s ∈ βˆ‚ π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ a ∈ t, erase t a = s := by
+/-- `t` is in the shadow of `π’œ` iff there is a `s ∈ π’œ` from which we can remove one element to
+get `t`. -/
+lemma mem_shadow_iff : t ∈ βˆ‚ π’œ ↔ βˆƒ s ∈ π’œ, βˆƒ a ∈ s, erase s a = t := by
   simp only [shadow, mem_sup, mem_image]
 #align finset.mem_shadow_iff Finset.mem_shadow_iff
 
@@ -93,24 +96,74 @@ theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ βˆ‚ 
   mem_shadow_iff.2 ⟨s, hs, a, ha, rfl⟩
 #align finset.erase_mem_shadow Finset.erase_mem_shadow
 
+/-- `t ∈ βˆ‚π’œ` iff `t` is exactly one element less than something from `π’œ`.
+
+See also `Finset.mem_shadow_iff_exists_mem_card_add_one`. -/
+lemma mem_shadow_iff_exists_sdiff : t ∈ βˆ‚ π’œ ↔ βˆƒ s ∈ π’œ, t βŠ† s ∧ (s \ t).card = 1 := by
+  simp_rw [mem_shadow_iff, ←covby_iff_card_sdiff_eq_one, covby_iff_exists_erase, eq_comm]
+
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
-theorem mem_shadow_iff_insert_mem : s ∈ βˆ‚ π’œ ↔ βˆƒ (a : _) (_ : a βˆ‰ s), insert a s ∈ π’œ := by
-  refine' mem_shadow_iff.trans ⟨_, _⟩
-  · rintro ⟨s, hs, a, ha, rfl⟩
-    refine' ⟨a, not_mem_erase a s, _⟩
-    rwa [insert_erase ha]
-  · rintro ⟨a, ha, hs⟩
-    exact ⟨insert a s, hs, a, mem_insert_self _ _, erase_insert ha⟩
+lemma mem_shadow_iff_insert_mem : t ∈ βˆ‚ π’œ ↔ βˆƒ a, a βˆ‰ t ∧ insert a t ∈ π’œ := by
+  simp_rw [mem_shadow_iff_exists_sdiff, ←covby_iff_card_sdiff_eq_one, covby_iff_exists_insert]
+  aesop
 #align finset.mem_shadow_iff_insert_mem Finset.mem_shadow_iff_insert_mem
 
+/-- `s ∈ βˆ‚ π’œ` iff `s` is exactly one element less than something from `π’œ`.
+
+See also `Finset.mem_shadow_iff_exists_sdiff`. -/
+lemma mem_shadow_iff_exists_mem_card_add_one :
+    t ∈ βˆ‚ π’œ ↔ βˆƒ s ∈ π’œ, t βŠ† s ∧ s.card = t.card + 1 := by
+  refine mem_shadow_iff_exists_sdiff.trans $ exists_congr fun t ↦ and_congr_right fun _ ↦
+    and_congr_right fun hst ↦ ?_
+  rw [card_sdiff hst, tsub_eq_iff_eq_add_of_le, add_comm]
+  exact card_mono hst
+#align finset.mem_shadow_iff_exists_mem_card_add_one Finset.mem_shadow_iff_exists_mem_card_add_one
+
+lemma mem_shadow_iterate_iff_exists_card :
+    t ∈ βˆ‚^[k] π’œ ↔ βˆƒ u : Finset Ξ±, u.card = k ∧ Disjoint t u ∧ t βˆͺ u ∈ π’œ := by
+  induction' k with k ih generalizing t
+  Β· simp
+  simp only [mem_shadow_iff_insert_mem, ih, Function.iterate_succ_apply', card_eq_succ]
+  aesop
+
+/-- `t ∈ βˆ‚^k π’œ` iff `t` is exactly `k` elements less than something from `π’œ`.
+
+See also `Finset.mem_shadow_iff_exists_mem_card_add`. -/
+lemma mem_shadow_iterate_iff_exists_sdiff : t ∈ βˆ‚^[k] π’œ ↔ βˆƒ s ∈ π’œ, t βŠ† s ∧ (s \ t).card = k := by
+  rw [mem_shadow_iterate_iff_exists_card]
+  constructor
+  · rintro ⟨u, rfl, htu, hsuA⟩
+    exact ⟨_, hsuA, subset_union_left _ _, by rw [union_sdiff_cancel_left htu]⟩
+  · rintro ⟨s, hs, hts, rfl⟩
+    refine ⟨s \ t, rfl, disjoint_sdiff, ?_⟩
+    rwa [union_sdiff_self_eq_union, union_eq_right.2 hts]
+
+/-- `t ∈ βˆ‚^k π’œ` iff `t` is exactly `k` elements less than something in `π’œ`.
+
+See also `Finset.mem_shadow_iterate_iff_exists_sdiff`. -/
+lemma mem_shadow_iterate_iff_exists_mem_card_add :
+    t ∈ βˆ‚^[k] π’œ ↔ βˆƒ s ∈ π’œ, t βŠ† s ∧ s.card = t.card + k := by
+  refine mem_shadow_iterate_iff_exists_sdiff.trans $ exists_congr fun t ↦ and_congr_right fun _ ↦
+    and_congr_right fun hst ↦ ?_
+  rw [card_sdiff hst, tsub_eq_iff_eq_add_of_le, add_comm]
+  exact card_mono hst
+#align finset.mem_shadow_iff_exists_mem_card_add Finset.mem_shadow_iterate_iff_exists_mem_card_add
+
 /-- The shadow of a family of `r`-sets is a family of `r - 1`-sets. -/
-protected theorem Set.Sized.shadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r) :
+protected theorem _root_.Set.Sized.shadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r) :
     (βˆ‚ π’œ : Set (Finset Ξ±)).Sized (r - 1) := by
   intro A h
   obtain ⟨A, hA, i, hi, rfl⟩ := mem_shadow_iff.1 h
   rw [card_erase_of_mem hi, hπ’œ hA]
-#align finset.set.sized.shadow Finset.Set.Sized.shadow
+#align finset.set.sized.shadow Set.Sized.shadow
+
+/-- The `k`-th shadow of a family of `r`-sets is a family of `r - k`-sets. -/
+lemma _root_.Set.Sized.shadow_iterate (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r) :
+    (βˆ‚^[k] π’œ : Set (Finset Ξ±)).Sized (r - k) := by
+  simp_rw [Set.Sized, mem_coe, mem_shadow_iterate_iff_exists_sdiff]
+  rintro t ⟨s, hs, hts, rfl⟩
+  rw [card_sdiff hts, ←hπ’œ hs, Nat.sub_sub_self (card_le_of_subset hts)]
 
 theorem sized_shadow_iff (h : βˆ… βˆ‰ π’œ) :
     (βˆ‚ π’œ : Set (Finset Ξ±)).Sized r ↔ (π’œ : Set (Finset Ξ±)).Sized (r + 1) := by
@@ -119,55 +172,12 @@ theorem sized_shadow_iff (h : βˆ… βˆ‰ π’œ) :
   rw [← hπ’œ (erase_mem_shadow hs ha), card_erase_add_one ha]
 #align finset.sized_shadow_iff Finset.sized_shadow_iff
 
-/-- `s ∈ βˆ‚ π’œ` iff `s` is exactly one element less than something from `π’œ` -/
-theorem mem_shadow_iff_exists_mem_card_add_one :
-    s ∈ βˆ‚ π’œ ↔ βˆƒ t ∈ π’œ, s βŠ† t ∧ t.card = s.card + 1 := by
-  refine' mem_shadow_iff_insert_mem.trans ⟨_, _⟩
-  · rintro ⟨a, ha, hs⟩
-    exact ⟨insert a s, hs, subset_insert _ _, card_insert_of_not_mem ha⟩
-  · rintro ⟨t, ht, hst, h⟩
-    obtain ⟨a, ha⟩ : βˆƒ a, t \ s = {a} :=
-      card_eq_one.1 (by rw [card_sdiff hst, h, add_tsub_cancel_left])
-    exact
-      ⟨a, fun hat => not_mem_sdiff_of_mem_right hat (ha.superset <| mem_singleton_self a),
-       by rwa [insert_eq a s, ← ha, sdiff_union_of_subset hst]⟩
-#align finset.mem_shadow_iff_exists_mem_card_add_one Finset.mem_shadow_iff_exists_mem_card_add_one
-
 /-- Being in the shadow of `π’œ` means we have a superset in `π’œ`. -/
-theorem exists_subset_of_mem_shadow (hs : s ∈ βˆ‚ π’œ) : βˆƒ t ∈ π’œ, s βŠ† t :=
+lemma exists_subset_of_mem_shadow (hs : t ∈ βˆ‚ π’œ) : βˆƒ s ∈ π’œ, t βŠ† s :=
   let ⟨t, ht, hst⟩ := mem_shadow_iff_exists_mem_card_add_one.1 hs
   ⟨t, ht, hst.1⟩
 #align finset.exists_subset_of_mem_shadow Finset.exists_subset_of_mem_shadow
 
-/-- `t ∈ βˆ‚^k π’œ` iff `t` is exactly `k` elements less than something in `π’œ`. -/
-theorem mem_shadow_iff_exists_mem_card_add :
-    s ∈ βˆ‚ ^[k] π’œ ↔ βˆƒ t ∈ π’œ, s βŠ† t ∧ t.card = s.card + k := by
-  induction' k with k ih generalizing π’œ s
-  · refine' ⟨fun hs => ⟨s, hs, Subset.refl _, rfl⟩, _⟩
-    rintro ⟨t, ht, hst, hcard⟩
-    rwa [eq_of_subset_of_card_le hst hcard.le]
-  simp only [exists_prop, Function.comp_apply, Function.iterate_succ]
-  refine' ih.trans _
-  clear ih
-  constructor
-  · rintro ⟨t, ht, hst, hcardst⟩
-    obtain ⟨u, hu, htu, hcardtu⟩ := mem_shadow_iff_exists_mem_card_add_one.1 ht
-    refine' ⟨u, hu, hst.trans htu, _⟩
-    rw [hcardtu, hcardst]
-    rfl
-  · rintro ⟨t, ht, hst, hcard⟩
-    obtain ⟨u, hsu, hut, hu⟩ :=
-      Finset.exists_intermediate_set k
-        (by
-          rw [add_comm, hcard]
-          exact le_succ _)
-        hst
-    rw [add_comm] at hu
-    refine' ⟨u, mem_shadow_iff_exists_mem_card_add_one.2 ⟨t, ht, hut, _⟩, hsu, hu⟩
-    rw [hcard, hu]
-    rfl
-#align finset.mem_shadow_iff_exists_mem_card_add Finset.mem_shadow_iff_exists_mem_card_add
-
 end Shadow
 
 open FinsetFamily
@@ -198,48 +208,83 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (
   fun _ _ => sup_mono
 #align finset.up_shadow_monotone Finset.upShadow_monotone
 
-/-- `s` is in the upper shadow of `π’œ` iff there is a `t ∈ π’œ` from which we can remove one element
-to get `s`. -/
-theorem mem_upShadow_iff : s ∈ βˆ‚βΊ π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ (a : _) (_ : a βˆ‰ t), insert a t = s := by
-  simp_rw [upShadow, mem_sup, mem_image, exists_prop, mem_compl]
+/-- `t` is in the upper shadow of `π’œ` iff there is a `s ∈ π’œ` from which we can remove one element
+to get `t`. -/
+lemma mem_upShadow_iff : t ∈ βˆ‚βΊ π’œ ↔ βˆƒ s ∈ π’œ, βˆƒ a, a βˆ‰ s ∧ insert a s = t := by
+  simp_rw [upShadow, mem_sup, mem_image, mem_compl]
 #align finset.mem_up_shadow_iff Finset.mem_upShadow_iff
 
 theorem insert_mem_upShadow (hs : s ∈ π’œ) (ha : a βˆ‰ s) : insert a s ∈ βˆ‚βΊ π’œ :=
   mem_upShadow_iff.2 ⟨s, hs, a, ha, rfl⟩
 #align finset.insert_mem_up_shadow Finset.insert_mem_upShadow
 
-/-- The upper shadow of a family of `r`-sets is a family of `r + 1`-sets. -/
-protected theorem Set.Sized.upShadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r) :
-    (βˆ‚βΊ π’œ : Set (Finset Ξ±)).Sized (r + 1) := by
-  intro A h
-  obtain ⟨A, hA, i, hi, rfl⟩ := mem_upShadow_iff.1 h
-  rw [card_insert_of_not_mem hi, hπ’œ hA]
-#align finset.set.sized.up_shadow Finset.Set.Sized.upShadow
+/-- `t` is in the upper shadow of `π’œ` iff `t` is exactly one element more than something from `π’œ`.
+
+See also `Finset.mem_upShadow_iff_exists_mem_card_add_one`. -/
+lemma mem_upShadow_iff_exists_sdiff : t ∈ βˆ‚βΊ π’œ ↔ βˆƒ s ∈ π’œ, s βŠ† t ∧ (t \ s).card = 1 := by
+  simp_rw [mem_upShadow_iff, ←covby_iff_card_sdiff_eq_one, covby_iff_exists_insert]
 
 /-- `t` is in the upper shadow of `π’œ` iff we can remove an element from it so that the resulting
 finset is in `π’œ`. -/
-theorem mem_upShadow_iff_erase_mem : s ∈ βˆ‚βΊ π’œ ↔ βˆƒ a ∈ s, s.erase a ∈ π’œ := by
-  refine' mem_upShadow_iff.trans ⟨_, _⟩
-  · rintro ⟨s, hs, a, ha, rfl⟩
-    refine' ⟨a, mem_insert_self a s, _⟩
-    rwa [erase_insert ha]
-  · rintro ⟨a, ha, hs⟩
-    exact ⟨s.erase a, hs, a, not_mem_erase _ _, insert_erase ha⟩
+lemma mem_upShadow_iff_erase_mem : t ∈ βˆ‚βΊ π’œ ↔ βˆƒ a, a ∈ t ∧ erase t a ∈ π’œ := by
+  simp_rw [mem_upShadow_iff_exists_sdiff, ←covby_iff_card_sdiff_eq_one, covby_iff_exists_erase]
+  aesop
 #align finset.mem_up_shadow_iff_erase_mem Finset.mem_upShadow_iff_erase_mem
 
-/-- `s ∈ βˆ‚βΊ π’œ` iff `s` is exactly one element less than something from `π’œ`. -/
-theorem mem_upShadow_iff_exists_mem_card_add_one :
-    s ∈ βˆ‚βΊ π’œ ↔ βˆƒ t ∈ π’œ, t βŠ† s ∧ t.card + 1 = s.card := by
-  refine' mem_upShadow_iff_erase_mem.trans ⟨_, _⟩
-  · rintro ⟨a, ha, hs⟩
-    exact ⟨s.erase a, hs, erase_subset _ _, card_erase_add_one ha⟩
-  · rintro ⟨t, ht, hts, h⟩
-    obtain ⟨a, ha⟩ : βˆƒ a, s \ t = {a} :=
-      card_eq_one.1 (by rw [card_sdiff hts, ← h, add_tsub_cancel_left])
-    refine' ⟨a, sdiff_subset _ _ ((ha.ge : _ βŠ† _) <| mem_singleton_self a), _⟩
-    rwa [← sdiff_singleton_eq_erase, ← ha, sdiff_sdiff_eq_self hts]
+/-- `t` is in the upper shadow of `π’œ` iff `t` is exactly one element less than something from `π’œ`.
+
+See also `Finset.mem_upShadow_iff_exists_sdiff`. -/
+lemma mem_upShadow_iff_exists_mem_card_add_one :
+    t ∈ βˆ‚βΊ π’œ ↔ βˆƒ s ∈ π’œ, s βŠ† t ∧ t.card = s.card + 1 := by
+  refine mem_upShadow_iff_exists_sdiff.trans $ exists_congr fun t ↦ and_congr_right fun _ ↦
+    and_congr_right fun hst ↦ ?_
+  rw [card_sdiff hst, tsub_eq_iff_eq_add_of_le, add_comm]
+  exact card_mono hst
 #align finset.mem_up_shadow_iff_exists_mem_card_add_one Finset.mem_upShadow_iff_exists_mem_card_add_one
 
+lemma mem_upShadow_iterate_iff_exists_card :
+    t ∈ βˆ‚βΊ^[k] π’œ ↔ βˆƒ u : Finset Ξ±, u.card = k ∧ u βŠ† t ∧ t \ u ∈ π’œ := by
+  induction' k with k ih generalizing t
+  Β· simp
+  simp only [mem_upShadow_iff_erase_mem, ih, Function.iterate_succ_apply', card_eq_succ,
+    subset_erase, erase_sdiff_comm, ←sdiff_insert]
+  constructor
+  · rintro ⟨a, hat, u, rfl, ⟨hut, hau⟩, htu⟩
+    exact ⟨_, ⟨_, _, hau, rfl, rfl⟩, insert_subset hat hut, htu⟩
+  · rintro ⟨_, ⟨a, u, hau, rfl, rfl⟩, hut, htu⟩
+    rw [insert_subset_iff] at hut
+    exact ⟨a, hut.1, _, rfl, ⟨hut.2, hau⟩, htu⟩
+
+/-- `t` is in the upper shadow of `π’œ` iff `t` is exactly `k` elements less than something from `π’œ`.
+
+See also `Finset.mem_upShadow_iff_exists_mem_card_add`. -/
+lemma mem_upShadow_iterate_iff_exists_sdiff :
+    t ∈ βˆ‚βΊ^[k] π’œ ↔ βˆƒ s ∈ π’œ, s βŠ† t ∧ (t \ s).card = k := by
+  rw [mem_upShadow_iterate_iff_exists_card]
+  constructor
+  · rintro ⟨u, rfl, hut, htu⟩
+    exact ⟨_, htu, sdiff_subset _ _, by rw [sdiff_sdiff_eq_self hut]⟩
+  · rintro ⟨s, hs, hst, rfl⟩
+    exact ⟨_, rfl, sdiff_subset _ _, by rwa [sdiff_sdiff_eq_self hst]⟩
+
+/-- `t ∈ βˆ‚βΊ^k π’œ` iff `t` is exactly `k` elements less than something in `π’œ`.
+
+See also `Finset.mem_upShadow_iterate_iff_exists_sdiff`. -/
+lemma mem_upShadow_iterate_iff_exists_mem_card_add :
+    t ∈ βˆ‚βΊ^[k] π’œ ↔ βˆƒ s ∈ π’œ, s βŠ† t ∧ t.card = s.card + k := by
+  refine mem_upShadow_iterate_iff_exists_sdiff.trans $ exists_congr fun t ↦ and_congr_right fun _ ↦
+    and_congr_right fun hst ↦ ?_
+  rw [card_sdiff hst, tsub_eq_iff_eq_add_of_le, add_comm]
+  exact card_mono hst
+
+/-- The upper shadow of a family of `r`-sets is a family of `r + 1`-sets. -/
+protected lemma _root_.Set.Sized.upShadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r) :
+    (βˆ‚βΊ π’œ : Set (Finset Ξ±)).Sized (r + 1) := by
+  intro A h
+  obtain ⟨A, hA, i, hi, rfl⟩ := mem_upShadow_iff.1 h
+  rw [card_insert_of_not_mem hi, hπ’œ hA]
+#align finset.set.sized.up_shadow Set.Sized.upShadow
+
 /-- Being in the upper shadow of `π’œ` means we have a superset in `π’œ`. -/
 theorem exists_subset_of_mem_upShadow (hs : s ∈ βˆ‚βΊ π’œ) : βˆƒ t ∈ π’œ, t βŠ† s :=
   let ⟨t, ht, hts, _⟩ := mem_upShadow_iff_exists_mem_card_add_one.1 hs
@@ -260,7 +305,7 @@ theorem mem_upShadow_iff_exists_mem_card_add :
   · rintro ⟨t, ht, hts, hcardst⟩
     obtain ⟨u, hu, hut, hcardtu⟩ := mem_upShadow_iff_exists_mem_card_add_one.1 ht
     refine' ⟨u, hu, hut.trans hts, _⟩
-    rw [← hcardst, ← hcardtu, add_right_comm]
+    rw [← hcardst, hcardtu, add_right_comm]
     rfl
   · rintro ⟨t, ht, hts, hcard⟩
     obtain ⟨u, htu, hus, hu⟩ :=
@@ -270,7 +315,7 @@ theorem mem_upShadow_iff_exists_mem_card_add :
           exact add_le_add_left (succ_le_of_lt (zero_lt_succ _)) _)
         hts
     rw [add_comm] at hu
-    refine' ⟨u, mem_upShadow_iff_exists_mem_card_add_one.2 ⟨t, ht, htu, hu.symm⟩, hus, _⟩
+    refine' ⟨u, mem_upShadow_iff_exists_mem_card_add_one.2 ⟨t, ht, htu, hu⟩, hus, _⟩
     rw [hu, ← hcard, add_right_comm]
     rfl
 #align finset.mem_up_shadow_iff_exists_mem_card_add Finset.mem_upShadow_iff_exists_mem_card_add
feat: Pointwise set difference, complement (#7383)

Define Finset.diffs and Finset.compls, the pointwise set difference of two finsets and pointwise complement of a finset.

diffs appears in the statement of the Marica-SchΓΆnheim inequality and compls in the proof.

Also fix the corresponding statements for sups and infs to use the new Β· notation.

Diff
@@ -3,7 +3,7 @@ Copyright (c) 2021 Bhavik Mehta. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Bhavik Mehta, Alena Gusakov, YaΓ«l Dillies
 -/
-import Mathlib.Data.Finset.Slice
+import Mathlib.Data.Finset.Sups
 import Mathlib.Logic.Function.Iterate
 
 #align_import combinatorics.set_family.shadow from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
@@ -20,7 +20,7 @@ to projecting each finset down once in all available directions.
 
 * `Finset.shadow`: The shadow of a set family. Everything we can get by removing a new element from
   some set.
-* `Finset.up_shadow`: The upper shadow of a set family. Everything we can get by adding an element
+* `Finset.upShadow`: The upper shadow of a set family. Everything we can get by adding an element
   to some set.
 
 ## Notation
@@ -275,27 +275,19 @@ theorem mem_upShadow_iff_exists_mem_card_add :
     rfl
 #align finset.mem_up_shadow_iff_exists_mem_card_add Finset.mem_upShadow_iff_exists_mem_card_add
 
-@[simp]
-theorem shadow_image_compl : (βˆ‚ π’œ).image compl = βˆ‚βΊ (π’œ.image compl) := by
+@[simp] lemma shadow_compls : βˆ‚ π’œαΆœΛ’ = (βˆ‚βΊ π’œ)ᢜ˒ := by
   ext s
-  simp only [mem_image, exists_prop, mem_shadow_iff, mem_upShadow_iff]
-  constructor
-  · rintro ⟨_, ⟨s, hs, a, ha, rfl⟩, rfl⟩
-    exact ⟨sᢜ, ⟨s, hs, rfl⟩, a, not_mem_compl.2 ha, compl_erase.symm⟩
-  · rintro ⟨_, ⟨s, hs, rfl⟩, a, ha, rfl⟩
-    exact ⟨s.erase a, ⟨s, hs, a, not_mem_compl.1 ha, rfl⟩, compl_erase⟩
-#align finset.shadow_image_compl Finset.shadow_image_compl
+  simp only [mem_image, exists_prop, mem_shadow_iff, mem_upShadow_iff, mem_compls]
+  refine (compl_involutive.toPerm _).exists_congr_left.trans ?_
+  simp [←compl_involutive.eq_iff]
+#align finset.up_shadow_image_compl Finset.shadow_compls
 
-@[simp]
-theorem upShadow_image_compl : (βˆ‚βΊ π’œ).image compl = βˆ‚ (π’œ.image compl) := by
+@[simp] lemma upShadow_compls : βˆ‚βΊ π’œαΆœΛ’ = (βˆ‚ π’œ)ᢜ˒ := by
   ext s
-  simp only [mem_image, exists_prop, mem_shadow_iff, mem_upShadow_iff]
-  constructor
-  · rintro ⟨_, ⟨s, hs, a, ha, rfl⟩, rfl⟩
-    exact ⟨sᢜ, ⟨s, hs, rfl⟩, a, mem_compl.2 ha, compl_insert.symm⟩
-  · rintro ⟨_, ⟨s, hs, rfl⟩, a, ha, rfl⟩
-    exact ⟨insert a s, ⟨s, hs, a, mem_compl.1 ha, rfl⟩, compl_insert⟩
-#align finset.up_shadow_image_compl Finset.upShadow_image_compl
+  simp only [mem_image, exists_prop, mem_shadow_iff, mem_upShadow_iff, mem_compls]
+  refine (compl_involutive.toPerm _).exists_congr_left.trans ?_
+  simp [←compl_involutive.eq_iff]
+#align finset.shadow_image_compl Finset.upShadow_compls
 
 end UpShadow
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -45,7 +45,7 @@ shadow, set family
 
 open Finset Nat
 
-variable {Ξ± : Type _}
+variable {Ξ± : Type*}
 
 namespace Finset
 
chore: tidy various files (#6158)
Diff
@@ -60,7 +60,6 @@ def shadow (π’œ : Finset (Finset Ξ±)) : Finset (Finset Ξ±) :=
   π’œ.sup fun s => s.image (erase s)
 #align finset.shadow Finset.shadow
 
--- mathport name: finset.shadow
 -- Porting note: added `inherit_doc` to calm linter
 @[inherit_doc] scoped[FinsetFamily] notation:max "βˆ‚ " => Finset.shadow
 -- Porting note: had to open FinsetFamily
@@ -130,8 +129,8 @@ theorem mem_shadow_iff_exists_mem_card_add_one :
     obtain ⟨a, ha⟩ : βˆƒ a, t \ s = {a} :=
       card_eq_one.1 (by rw [card_sdiff hst, h, add_tsub_cancel_left])
     exact
-      ⟨a, fun hat => not_mem_sdiff_of_mem_right hat ((ha.ge : _ βŠ† _) <| mem_singleton_self a), by
-        rwa [insert_eq a s, ← ha, sdiff_union_of_subset hst]⟩
+      ⟨a, fun hat => not_mem_sdiff_of_mem_right hat (ha.superset <| mem_singleton_self a),
+       by rwa [insert_eq a s, ← ha, sdiff_union_of_subset hst]⟩
 #align finset.mem_shadow_iff_exists_mem_card_add_one Finset.mem_shadow_iff_exists_mem_card_add_one
 
 /-- Being in the shadow of `π’œ` means we have a superset in `π’œ`. -/
@@ -178,13 +177,12 @@ section UpShadow
 variable [DecidableEq Ξ±] [Fintype Ξ±] {π’œ : Finset (Finset Ξ±)} {s t : Finset Ξ±} {a : Ξ±} {k r : β„•}
 
 /-- The upper shadow of a set family `π’œ` is all sets we can get by adding one element to any set in
-`π’œ`, and the (`k` times) iterated upper shadow (`up_shadow^[k]`) is all sets we can get by adding
+`π’œ`, and the (`k` times) iterated upper shadow (`upShadow^[k]`) is all sets we can get by adding
 `k` elements from any set in `π’œ`. -/
 def upShadow (π’œ : Finset (Finset Ξ±)) : Finset (Finset Ξ±) :=
   π’œ.sup fun s => sᢜ.image fun a => insert a s
 #align finset.up_shadow Finset.upShadow
 
--- mathport name: finset.up_shadow
 -- Porting note: added `inherit_doc` to calm linter
 @[inherit_doc] scoped[FinsetFamily] notation:max "βˆ‚βΊ " => Finset.upShadow
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Bhavik Mehta. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Bhavik Mehta, Alena Gusakov, YaΓ«l Dillies
-
-! This file was ported from Lean 3 source module combinatorics.set_family.shadow
-! leanprover-community/mathlib commit f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Finset.Slice
 import Mathlib.Logic.Function.Iterate
 
+#align_import combinatorics.set_family.shadow from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
+
 /-!
 # Shadows
 
chore: fix grammar in docs (#5668)
Diff
@@ -87,7 +87,7 @@ theorem shadow_monotone : Monotone (shadow : Finset (Finset Ξ±) β†’ Finset (Fins
   sup_mono
 #align finset.shadow_monotone Finset.shadow_monotone
 
-/-- `s` is in the shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element to
+/-- `s` is in the shadow of `π’œ` iff there is a `t ∈ π’œ` from which we can remove one element to
 get `s`. -/
 theorem mem_shadow_iff : s ∈ βˆ‚ π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ a ∈ t, erase t a = s := by
   simp only [shadow, mem_sup, mem_image]
@@ -203,7 +203,7 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (
   fun _ _ => sup_mono
 #align finset.up_shadow_monotone Finset.upShadow_monotone
 
-/-- `s` is in the upper shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element
+/-- `s` is in the upper shadow of `π’œ` iff there is a `t ∈ π’œ` from which we can remove one element
 to get `s`. -/
 theorem mem_upShadow_iff : s ∈ βˆ‚βΊ π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ (a : _) (_ : a βˆ‰ t), insert a t = s := by
   simp_rw [upShadow, mem_sup, mem_image, exists_prop, mem_compl]
fix: precedence of shadow (#5620)
Diff
@@ -65,18 +65,18 @@ def shadow (π’œ : Finset (Finset Ξ±)) : Finset (Finset Ξ±) :=
 
 -- mathport name: finset.shadow
 -- Porting note: added `inherit_doc` to calm linter
-@[inherit_doc] scoped[FinsetFamily] notation:90 "βˆ‚ " => Finset.shadow
+@[inherit_doc] scoped[FinsetFamily] notation:max "βˆ‚ " => Finset.shadow
 -- Porting note: had to open FinsetFamily
 open FinsetFamily
 
 /-- The shadow of the empty set is empty. -/
 @[simp]
-theorem shadow_empty : (βˆ‚ ) (βˆ… : Finset (Finset Ξ±)) = βˆ… :=
+theorem shadow_empty : βˆ‚ (βˆ… : Finset (Finset Ξ±)) = βˆ… :=
   rfl
 #align finset.shadow_empty Finset.shadow_empty
 
 @[simp]
-theorem shadow_singleton_empty : (βˆ‚ ) ({βˆ…} : Finset (Finset Ξ±)) = βˆ… :=
+theorem shadow_singleton_empty : βˆ‚ ({βˆ…} : Finset (Finset Ξ±)) = βˆ… :=
   rfl
 #align finset.shadow_singleton_empty Finset.shadow_singleton_empty
 
@@ -89,17 +89,17 @@ theorem shadow_monotone : Monotone (shadow : Finset (Finset Ξ±) β†’ Finset (Fins
 
 /-- `s` is in the shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element to
 get `s`. -/
-theorem mem_shadow_iff : s ∈ (βˆ‚ ) π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ a ∈ t, erase t a = s := by
+theorem mem_shadow_iff : s ∈ βˆ‚ π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ a ∈ t, erase t a = s := by
   simp only [shadow, mem_sup, mem_image]
 #align finset.mem_shadow_iff Finset.mem_shadow_iff
 
-theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ (βˆ‚ ) π’œ :=
+theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ βˆ‚ π’œ :=
   mem_shadow_iff.2 ⟨s, hs, a, ha, rfl⟩
 #align finset.erase_mem_shadow Finset.erase_mem_shadow
 
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
-theorem mem_shadow_iff_insert_mem : s ∈ (βˆ‚ ) π’œ ↔ βˆƒ (a : _) (_ : a βˆ‰ s), insert a s ∈ π’œ := by
+theorem mem_shadow_iff_insert_mem : s ∈ βˆ‚ π’œ ↔ βˆƒ (a : _) (_ : a βˆ‰ s), insert a s ∈ π’œ := by
   refine' mem_shadow_iff.trans ⟨_, _⟩
   · rintro ⟨s, hs, a, ha, rfl⟩
     refine' ⟨a, not_mem_erase a s, _⟩
@@ -110,14 +110,14 @@ theorem mem_shadow_iff_insert_mem : s ∈ (βˆ‚ ) π’œ ↔ βˆƒ (a : _) (_ : a βˆ‰
 
 /-- The shadow of a family of `r`-sets is a family of `r - 1`-sets. -/
 protected theorem Set.Sized.shadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r) :
-    ((βˆ‚ ) π’œ : Set (Finset Ξ±)).Sized (r - 1) := by
+    (βˆ‚ π’œ : Set (Finset Ξ±)).Sized (r - 1) := by
   intro A h
   obtain ⟨A, hA, i, hi, rfl⟩ := mem_shadow_iff.1 h
   rw [card_erase_of_mem hi, hπ’œ hA]
 #align finset.set.sized.shadow Finset.Set.Sized.shadow
 
 theorem sized_shadow_iff (h : βˆ… βˆ‰ π’œ) :
-    ((βˆ‚ ) π’œ : Set (Finset Ξ±)).Sized r ↔ (π’œ : Set (Finset Ξ±)).Sized (r + 1) := by
+    (βˆ‚ π’œ : Set (Finset Ξ±)).Sized r ↔ (π’œ : Set (Finset Ξ±)).Sized (r + 1) := by
   refine' ⟨fun hπ’œ s hs => _, Set.Sized.shadow⟩
   obtain ⟨a, ha⟩ := nonempty_iff_ne_empty.2 (ne_of_mem_of_not_mem hs h)
   rw [← hπ’œ (erase_mem_shadow hs ha), card_erase_add_one ha]
@@ -125,7 +125,7 @@ theorem sized_shadow_iff (h : βˆ… βˆ‰ π’œ) :
 
 /-- `s ∈ βˆ‚ π’œ` iff `s` is exactly one element less than something from `π’œ` -/
 theorem mem_shadow_iff_exists_mem_card_add_one :
-    s ∈ (βˆ‚ ) π’œ ↔ βˆƒ t ∈ π’œ, s βŠ† t ∧ t.card = s.card + 1 := by
+    s ∈ βˆ‚ π’œ ↔ βˆƒ t ∈ π’œ, s βŠ† t ∧ t.card = s.card + 1 := by
   refine' mem_shadow_iff_insert_mem.trans ⟨_, _⟩
   · rintro ⟨a, ha, hs⟩
     exact ⟨insert a s, hs, subset_insert _ _, card_insert_of_not_mem ha⟩
@@ -138,7 +138,7 @@ theorem mem_shadow_iff_exists_mem_card_add_one :
 #align finset.mem_shadow_iff_exists_mem_card_add_one Finset.mem_shadow_iff_exists_mem_card_add_one
 
 /-- Being in the shadow of `π’œ` means we have a superset in `π’œ`. -/
-theorem exists_subset_of_mem_shadow (hs : s ∈ (βˆ‚ ) π’œ) : βˆƒ t ∈ π’œ, s βŠ† t :=
+theorem exists_subset_of_mem_shadow (hs : s ∈ βˆ‚ π’œ) : βˆƒ t ∈ π’œ, s βŠ† t :=
   let ⟨t, ht, hst⟩ := mem_shadow_iff_exists_mem_card_add_one.1 hs
   ⟨t, ht, hst.1⟩
 #align finset.exists_subset_of_mem_shadow Finset.exists_subset_of_mem_shadow
@@ -189,11 +189,11 @@ def upShadow (π’œ : Finset (Finset Ξ±)) : Finset (Finset Ξ±) :=
 
 -- mathport name: finset.up_shadow
 -- Porting note: added `inherit_doc` to calm linter
-@[inherit_doc] scoped[FinsetFamily] notation:90 "βˆ‚βΊ " => Finset.upShadow
+@[inherit_doc] scoped[FinsetFamily] notation:max "βˆ‚βΊ " => Finset.upShadow
 
 /-- The upper shadow of the empty set is empty. -/
 @[simp]
-theorem upShadow_empty : (βˆ‚βΊ ) (βˆ… : Finset (Finset Ξ±)) = βˆ… :=
+theorem upShadow_empty : βˆ‚βΊ (βˆ… : Finset (Finset Ξ±)) = βˆ… :=
   rfl
 #align finset.up_shadow_empty Finset.upShadow_empty
 
@@ -205,17 +205,17 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (
 
 /-- `s` is in the upper shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element
 to get `s`. -/
-theorem mem_upShadow_iff : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ (a : _) (_ : a βˆ‰ t), insert a t = s := by
+theorem mem_upShadow_iff : s ∈ βˆ‚βΊ π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ (a : _) (_ : a βˆ‰ t), insert a t = s := by
   simp_rw [upShadow, mem_sup, mem_image, exists_prop, mem_compl]
 #align finset.mem_up_shadow_iff Finset.mem_upShadow_iff
 
-theorem insert_mem_upShadow (hs : s ∈ π’œ) (ha : a βˆ‰ s) : insert a s ∈ (βˆ‚βΊ ) π’œ :=
+theorem insert_mem_upShadow (hs : s ∈ π’œ) (ha : a βˆ‰ s) : insert a s ∈ βˆ‚βΊ π’œ :=
   mem_upShadow_iff.2 ⟨s, hs, a, ha, rfl⟩
 #align finset.insert_mem_up_shadow Finset.insert_mem_upShadow
 
 /-- The upper shadow of a family of `r`-sets is a family of `r + 1`-sets. -/
 protected theorem Set.Sized.upShadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r) :
-    ((βˆ‚βΊ ) π’œ : Set (Finset Ξ±)).Sized (r + 1) := by
+    (βˆ‚βΊ π’œ : Set (Finset Ξ±)).Sized (r + 1) := by
   intro A h
   obtain ⟨A, hA, i, hi, rfl⟩ := mem_upShadow_iff.1 h
   rw [card_insert_of_not_mem hi, hπ’œ hA]
@@ -223,7 +223,7 @@ protected theorem Set.Sized.upShadow (hπ’œ : (π’œ : Set (Finset Ξ±)).Sized r)
 
 /-- `t` is in the upper shadow of `π’œ` iff we can remove an element from it so that the resulting
 finset is in `π’œ`. -/
-theorem mem_upShadow_iff_erase_mem : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ a ∈ s, s.erase a ∈ π’œ := by
+theorem mem_upShadow_iff_erase_mem : s ∈ βˆ‚βΊ π’œ ↔ βˆƒ a ∈ s, s.erase a ∈ π’œ := by
   refine' mem_upShadow_iff.trans ⟨_, _⟩
   · rintro ⟨s, hs, a, ha, rfl⟩
     refine' ⟨a, mem_insert_self a s, _⟩
@@ -234,7 +234,7 @@ theorem mem_upShadow_iff_erase_mem : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ a ∈ s, s.era
 
 /-- `s ∈ βˆ‚βΊ π’œ` iff `s` is exactly one element less than something from `π’œ`. -/
 theorem mem_upShadow_iff_exists_mem_card_add_one :
-    s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ t ∈ π’œ, t βŠ† s ∧ t.card + 1 = s.card := by
+    s ∈ βˆ‚βΊ π’œ ↔ βˆƒ t ∈ π’œ, t βŠ† s ∧ t.card + 1 = s.card := by
   refine' mem_upShadow_iff_erase_mem.trans ⟨_, _⟩
   · rintro ⟨a, ha, hs⟩
     exact ⟨s.erase a, hs, erase_subset _ _, card_erase_add_one ha⟩
@@ -246,7 +246,7 @@ theorem mem_upShadow_iff_exists_mem_card_add_one :
 #align finset.mem_up_shadow_iff_exists_mem_card_add_one Finset.mem_upShadow_iff_exists_mem_card_add_one
 
 /-- Being in the upper shadow of `π’œ` means we have a superset in `π’œ`. -/
-theorem exists_subset_of_mem_upShadow (hs : s ∈ (βˆ‚βΊ ) π’œ) : βˆƒ t ∈ π’œ, t βŠ† s :=
+theorem exists_subset_of_mem_upShadow (hs : s ∈ βˆ‚βΊ π’œ) : βˆƒ t ∈ π’œ, t βŠ† s :=
   let ⟨t, ht, hts, _⟩ := mem_upShadow_iff_exists_mem_card_add_one.1 hs
   ⟨t, ht, hts⟩
 #align finset.exists_subset_of_mem_up_shadow Finset.exists_subset_of_mem_upShadow
@@ -281,7 +281,7 @@ theorem mem_upShadow_iff_exists_mem_card_add :
 #align finset.mem_up_shadow_iff_exists_mem_card_add Finset.mem_upShadow_iff_exists_mem_card_add
 
 @[simp]
-theorem shadow_image_compl : ((βˆ‚ ) π’œ).image compl = (βˆ‚βΊ ) (π’œ.image compl) := by
+theorem shadow_image_compl : (βˆ‚ π’œ).image compl = βˆ‚βΊ (π’œ.image compl) := by
   ext s
   simp only [mem_image, exists_prop, mem_shadow_iff, mem_upShadow_iff]
   constructor
@@ -292,7 +292,7 @@ theorem shadow_image_compl : ((βˆ‚ ) π’œ).image compl = (βˆ‚βΊ ) (π’œ.image c
 #align finset.shadow_image_compl Finset.shadow_image_compl
 
 @[simp]
-theorem upShadow_image_compl : ((βˆ‚βΊ ) π’œ).image compl = (βˆ‚ ) (π’œ.image compl) := by
+theorem upShadow_image_compl : (βˆ‚βΊ π’œ).image compl = βˆ‚ (π’œ.image compl) := by
   ext s
   simp only [mem_image, exists_prop, mem_shadow_iff, mem_upShadow_iff]
   constructor
fix precedence of Nat.iterate (#5589)
Diff
@@ -145,7 +145,7 @@ theorem exists_subset_of_mem_shadow (hs : s ∈ (βˆ‚ ) π’œ) : βˆƒ t ∈ π’œ, s
 
 /-- `t ∈ βˆ‚^k π’œ` iff `t` is exactly `k` elements less than something in `π’œ`. -/
 theorem mem_shadow_iff_exists_mem_card_add :
-    s ∈ (βˆ‚ ^[k]) π’œ ↔ βˆƒ t ∈ π’œ, s βŠ† t ∧ t.card = s.card + k := by
+    s ∈ βˆ‚ ^[k] π’œ ↔ βˆƒ t ∈ π’œ, s βŠ† t ∧ t.card = s.card + k := by
   induction' k with k ih generalizing π’œ s
   · refine' ⟨fun hs => ⟨s, hs, Subset.refl _, rfl⟩, _⟩
     rintro ⟨t, ht, hst, hcard⟩
@@ -253,7 +253,7 @@ theorem exists_subset_of_mem_upShadow (hs : s ∈ (βˆ‚βΊ ) π’œ) : βˆƒ t ∈ 
 
 /-- `t ∈ βˆ‚^k π’œ` iff `t` is exactly `k` elements more than something in `π’œ`. -/
 theorem mem_upShadow_iff_exists_mem_card_add :
-    s ∈ (βˆ‚βΊ ^[k]) π’œ ↔ βˆƒ t ∈ π’œ, t βŠ† s ∧ t.card + k = s.card := by
+    s ∈ βˆ‚βΊ ^[k] π’œ ↔ βˆƒ t ∈ π’œ, t βŠ† s ∧ t.card + k = s.card := by
   induction' k with k ih generalizing π’œ s
   · refine' ⟨fun hs => ⟨s, hs, Subset.refl _, rfl⟩, _⟩
     rintro ⟨t, ht, hst, hcard⟩
chore: formatting issues (#4947)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -99,7 +99,7 @@ theorem erase_mem_shadow (hs : s ∈ π’œ) (ha : a ∈ s) : erase s a ∈ (βˆ‚ )
 
 /-- `t` is in the shadow of `π’œ` iff we can add an element to it so that the resulting finset is in
 `π’œ`. -/
-theorem mem_shadow_iff_insert_mem : s ∈ (βˆ‚ ) π’œ ↔ βˆƒ (a : _)(_ : a βˆ‰ s), insert a s ∈ π’œ := by
+theorem mem_shadow_iff_insert_mem : s ∈ (βˆ‚ ) π’œ ↔ βˆƒ (a : _) (_ : a βˆ‰ s), insert a s ∈ π’œ := by
   refine' mem_shadow_iff.trans ⟨_, _⟩
   · rintro ⟨s, hs, a, ha, rfl⟩
     refine' ⟨a, not_mem_erase a s, _⟩
@@ -205,7 +205,7 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (
 
 /-- `s` is in the upper shadow of `π’œ` iff there is an `t ∈ π’œ` from which we can remove one element
 to get `s`. -/
-theorem mem_upShadow_iff : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ (a : _)(_ : a βˆ‰ t), insert a t = s := by
+theorem mem_upShadow_iff : s ∈ (βˆ‚βΊ ) π’œ ↔ βˆƒ t ∈ π’œ, βˆƒ (a : _) (_ : a βˆ‰ t), insert a t = s := by
   simp_rw [upShadow, mem_sup, mem_image, exists_prop, mem_compl]
 #align finset.mem_up_shadow_iff Finset.mem_upShadow_iff
 
chore: fix many typos (#4967)

These are all doc fixes

Diff
@@ -188,7 +188,7 @@ def upShadow (π’œ : Finset (Finset Ξ±)) : Finset (Finset Ξ±) :=
 #align finset.up_shadow Finset.upShadow
 
 -- mathport name: finset.up_shadow
--- Porting note: added `inheric_doc` to calm linter
+-- Porting note: added `inherit_doc` to calm linter
 @[inherit_doc] scoped[FinsetFamily] notation:90 "βˆ‚βΊ " => Finset.upShadow
 
 /-- The upper shadow of the empty set is empty. -/
chore: fix upper/lowercase in comments (#4360)
  • Run a non-interactive version of fix-comments.py on all files.
  • Go through the diff and manually add/discard/edit chunks.
Diff
@@ -15,7 +15,7 @@ import Mathlib.Logic.Function.Iterate
 # Shadows
 
 This file defines shadows of a set family. The shadow of a set family is the set family of sets we
-get by removing any element from any set of the original family. If one pictures `finset Ξ±` as a big
+get by removing any element from any set of the original family. If one pictures `Finset Ξ±` as a big
 hypercube (each dimension being membership of a given element), then taking the shadow corresponds
 to projecting each finset down once in all available directions.
 
@@ -32,8 +32,8 @@ We define notation in locale `FinsetFamily`:
 * `βˆ‚ π’œ`: Shadow of `π’œ`.
 * `βˆ‚βΊ π’œ`: Upper shadow of `π’œ`.
 
-We also maintain the convention that `a, b : Ξ±` are elements of the ground type, `s, t : finset Ξ±`
-are finsets, and `π’œ, ℬ : finset (finset Ξ±)` are finset families.
+We also maintain the convention that `a, b : Ξ±` are elements of the ground type, `s, t : Finset Ξ±`
+are finsets, and `π’œ, ℬ : Finset (Finset Ξ±)` are finset families.
 
 ## References
 
@@ -80,7 +80,7 @@ theorem shadow_singleton_empty : (βˆ‚ ) ({βˆ…} : Finset (Finset Ξ±)) = βˆ… :=
   rfl
 #align finset.shadow_singleton_empty Finset.shadow_singleton_empty
 
---TODO: Prove `βˆ‚ {{a}} = {βˆ…}` quickly using `covers` and `grade_order`
+--TODO: Prove `βˆ‚ {{a}} = {βˆ…}` quickly using `covers` and `GradeOrder`
 /-- The shadow is monotone. -/
 @[mono]
 theorem shadow_monotone : Monotone (shadow : Finset (Finset Ξ±) β†’ Finset (Finset Ξ±)) := fun _ _ =>
chore: Restore most of the mono attribute (#2491)

Restore most of the mono attribute now that #1740 is merged.

I think I got all of the monos.

Diff
@@ -82,8 +82,7 @@ theorem shadow_singleton_empty : (βˆ‚ ) ({βˆ…} : Finset (Finset Ξ±)) = βˆ… :=
 
 --TODO: Prove `βˆ‚ {{a}} = {βˆ…}` quickly using `covers` and `grade_order`
 /-- The shadow is monotone. -/
--- Porting note: unknown attribute `[mono]`
--- @[mono]
+@[mono]
 theorem shadow_monotone : Monotone (shadow : Finset (Finset Ξ±) β†’ Finset (Finset Ξ±)) := fun _ _ =>
   sup_mono
 #align finset.shadow_monotone Finset.shadow_monotone
@@ -199,8 +198,7 @@ theorem upShadow_empty : (βˆ‚βΊ ) (βˆ… : Finset (Finset Ξ±)) = βˆ… :=
 #align finset.up_shadow_empty Finset.upShadow_empty
 
 /-- The upper shadow is monotone. -/
--- Porting note: unknown attribute `[mono]`
--- @[mono]
+@[mono]
 theorem upShadow_monotone : Monotone (upShadow : Finset (Finset Ξ±) β†’ Finset (Finset Ξ±)) :=
   fun _ _ => sup_mono
 #align finset.up_shadow_monotone Finset.upShadow_monotone
feat: port Combinatorics.SetFamily.Shadow (#1938)

Co-authored-by: Moritz Firsching <firsching@google.com> Co-authored-by: Chris Hughes <33847686+ChrisHughes24@users.noreply.github.com>

Dependencies 7 + 231

232 files ported (97.1%)
101364 lines ported (97.1%)
Show graph

The unported dependencies are