Skip to content

Commit 8a45f5b

Browse files
committed
fix: precedence of shadow (#5620)
1 parent 074b9eb commit 8a45f5b

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

Mathlib/Combinatorics/SetFamily/Compression/UV.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,10 @@ that `𝒜` is `(u.erase x, v.erase y)`-compressed. This is the key fact about c
323323
Kruskal-Katona. -/
324324
theorem shadow_compression_subset_compression_shadow (u v : Finset α)
325325
(huv : ∀ x ∈ u, ∃ y ∈ v, IsCompressed (u.erase x) (v.erase y) 𝒜) :
326-
(∂ ) (𝓒 u v 𝒜) ⊆ 𝓒 u v ((∂ ) 𝒜) := by
326+
(𝓒 u v 𝒜) ⊆ 𝓒 u v ( 𝒜) := by
327327
set 𝒜' := 𝓒 u v 𝒜
328-
suffices H : ∀ s ∈ (∂ ) 𝒜',
329-
s ∉ (∂ ) 𝒜 → u ⊆ s ∧ Disjoint v s ∧ (s ∪ v) \ u ∈ (∂ ) 𝒜 ∧ (s ∪ v) \ u ∉ (∂ ) 𝒜'
328+
suffices H : ∀ s ∈ 𝒜',
329+
s ∉ 𝒜 → u ⊆ s ∧ Disjoint v s ∧ (s ∪ v) \ u ∈ 𝒜 ∧ (s ∪ v) \ u ∉ 𝒜'
330330
· rintro s hs'
331331
rw [mem_compression]
332332
by_cases hs : s ∈ 𝒜.shadow
@@ -431,7 +431,7 @@ such that `𝒜` is `(u.erase x, v.erase y)`-compressed. This is the key UV-comp
431431
Kruskal-Katona. -/
432432
theorem card_shadow_compression_le (u v : Finset α)
433433
(huv : ∀ x ∈ u, ∃ y ∈ v, IsCompressed (u.erase x) (v.erase y) 𝒜) :
434-
((∂ ) (𝓒 u v 𝒜)).card ≤ ((∂ ) 𝒜).card :=
434+
((𝓒 u v 𝒜)).card ≤ ( 𝒜).card :=
435435
(card_le_of_subset <| shadow_compression_subset_compression_shadow _ _ huv).trans
436436
(card_compression _ _ _).le
437437
#align uv.card_shadow_compression_le UV.card_shadow_compression_le

Mathlib/Combinatorics/SetFamily/LYM.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ variable [DecidableEq α] [Fintype α]
6565
/-- The downward **local LYM inequality**, with cancelled denominators. `𝒜` takes up less of `α^(r)`
6666
(the finsets of card `r`) than `∂𝒜` takes up of `α^(r - 1)`. -/
6767
theorem card_mul_le_card_shadow_mul (h𝒜 : (𝒜 : Set (Finset α)).Sized r) :
68-
𝒜.card * r ≤ ((∂ ) 𝒜).card * (Fintype.card α - r + 1) := by
68+
𝒜.card * r ≤ ( 𝒜).card * (Fintype.card α - r + 1) := by
6969
let i : DecidableRel ((. ⊆ .) : Finset α → Finset α → Prop) := fun _ _ => Classical.dec _
7070
refine' card_mul_le_card_mul' (· ⊆ ·) (fun s hs => _) (fun s hs => _)
7171
· rw [← h𝒜 hs, ← card_image_of_injOn s.erase_injOn]
@@ -93,7 +93,7 @@ theorem card_mul_le_card_shadow_mul (h𝒜 : (𝒜 : Set (Finset α)).Sized r) :
9393
than `∂𝒜` takes up of `α^(r - 1)`. -/
9494
theorem card_div_choose_le_card_shadow_div_choose (hr : r ≠ 0)
9595
(h𝒜 : (𝒜 : Set (Finset α)).Sized r) : (𝒜.card : 𝕜) / (Fintype.card α).choose r
96-
≤ ((∂ ) 𝒜).card / (Fintype.card α).choose (r - 1) := by
96+
≤ ( 𝒜).card / (Fintype.card α).choose (r - 1) := by
9797
obtain hr' | hr' := lt_or_le (Fintype.card α) r
9898
· rw [choose_eq_zero_of_lt hr', cast_zero, div_zero]
9999
exact div_nonneg (cast_nonneg _) (cast_nonneg _)
@@ -149,7 +149,7 @@ theorem falling_zero_subset : falling 0 𝒜 ⊆ {∅} :=
149149
subset_singleton_iff'.2 fun _ ht => card_eq_zero.1 <| sized_falling _ _ ht
150150
#align finset.falling_zero_subset Finset.falling_zero_subset
151151

152-
theorem slice_union_shadow_falling_succ : 𝒜 # k ∪ (∂ ) (falling (k + 1) 𝒜) = falling k 𝒜 := by
152+
theorem slice_union_shadow_falling_succ : 𝒜 # k ∪ (falling (k + 1) 𝒜) = falling k 𝒜 := by
153153
ext s
154154
simp_rw [mem_union, mem_slice, mem_shadow_iff, mem_falling]
155155
constructor
@@ -171,7 +171,7 @@ variable {𝒜 k}
171171
/-- The shadow of `falling m 𝒜` is disjoint from the `n`-sized elements of `𝒜`, thanks to the
172172
antichain property. -/
173173
theorem IsAntichain.disjoint_slice_shadow_falling {m n : ℕ}
174-
(h𝒜 : IsAntichain (· ⊆ ·) (𝒜 : Set (Finset α))) : Disjoint (𝒜 # m) ((∂ ) (falling n 𝒜)) :=
174+
(h𝒜 : IsAntichain (· ⊆ ·) (𝒜 : Set (Finset α))) : Disjoint (𝒜 # m) ( (falling n 𝒜)) :=
175175
disjoint_right.2 fun s h₁ h₂ => by
176176
simp_rw [mem_shadow_iff, mem_falling] at h₁
177177
obtain ⟨s, ⟨⟨t, ht, hst⟩, _⟩, a, ha, rfl⟩ := h₁

Mathlib/Combinatorics/SetFamily/Shadow.lean

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ def shadow (𝒜 : Finset (Finset α)) : Finset (Finset α) :=
6565

6666
-- mathport name: finset.shadow
6767
-- Porting note: added `inherit_doc` to calm linter
68-
@[inherit_doc] scoped[FinsetFamily] notation:90 "∂ " => Finset.shadow
68+
@[inherit_doc] scoped[FinsetFamily] notation:max "∂ " => Finset.shadow
6969
-- Porting note: had to open FinsetFamily
7070
open FinsetFamily
7171

7272
/-- The shadow of the empty set is empty. -/
7373
@[simp]
74-
theorem shadow_empty : (∂ ) (∅ : Finset (Finset α)) = ∅ :=
74+
theorem shadow_empty : (∅ : Finset (Finset α)) = ∅ :=
7575
rfl
7676
#align finset.shadow_empty Finset.shadow_empty
7777

7878
@[simp]
79-
theorem shadow_singleton_empty : (∂ ) ({∅} : Finset (Finset α)) = ∅ :=
79+
theorem shadow_singleton_empty : ({∅} : Finset (Finset α)) = ∅ :=
8080
rfl
8181
#align finset.shadow_singleton_empty Finset.shadow_singleton_empty
8282

@@ -89,17 +89,17 @@ theorem shadow_monotone : Monotone (shadow : Finset (Finset α) → Finset (Fins
8989

9090
/-- `s` is in the shadow of `𝒜` iff there is an `t ∈ 𝒜` from which we can remove one element to
9191
get `s`. -/
92-
theorem mem_shadow_iff : s ∈ (∂ ) 𝒜 ↔ ∃ t ∈ 𝒜, ∃ a ∈ t, erase t a = s := by
92+
theorem mem_shadow_iff : s ∈ 𝒜 ↔ ∃ t ∈ 𝒜, ∃ a ∈ t, erase t a = s := by
9393
simp only [shadow, mem_sup, mem_image]
9494
#align finset.mem_shadow_iff Finset.mem_shadow_iff
9595

96-
theorem erase_mem_shadow (hs : s ∈ 𝒜) (ha : a ∈ s) : erase s a ∈ (∂ ) 𝒜 :=
96+
theorem erase_mem_shadow (hs : s ∈ 𝒜) (ha : a ∈ s) : erase s a ∈ 𝒜 :=
9797
mem_shadow_iff.2 ⟨s, hs, a, ha, rfl⟩
9898
#align finset.erase_mem_shadow Finset.erase_mem_shadow
9999

100100
/-- `t` is in the shadow of `𝒜` iff we can add an element to it so that the resulting finset is in
101101
`𝒜`. -/
102-
theorem mem_shadow_iff_insert_mem : s ∈ (∂ ) 𝒜 ↔ ∃ (a : _) (_ : a ∉ s), insert a s ∈ 𝒜 := by
102+
theorem mem_shadow_iff_insert_mem : s ∈ 𝒜 ↔ ∃ (a : _) (_ : a ∉ s), insert a s ∈ 𝒜 := by
103103
refine' mem_shadow_iff.trans ⟨_, _⟩
104104
· rintro ⟨s, hs, a, ha, rfl⟩
105105
refine' ⟨a, not_mem_erase a s, _⟩
@@ -110,22 +110,22 @@ theorem mem_shadow_iff_insert_mem : s ∈ (∂ ) 𝒜 ↔ ∃ (a : _) (_ : a ∉
110110

111111
/-- The shadow of a family of `r`-sets is a family of `r - 1`-sets. -/
112112
protected theorem Set.Sized.shadow (h𝒜 : (𝒜 : Set (Finset α)).Sized r) :
113-
((∂ ) 𝒜 : Set (Finset α)).Sized (r - 1) := by
113+
( 𝒜 : Set (Finset α)).Sized (r - 1) := by
114114
intro A h
115115
obtain ⟨A, hA, i, hi, rfl⟩ := mem_shadow_iff.1 h
116116
rw [card_erase_of_mem hi, h𝒜 hA]
117117
#align finset.set.sized.shadow Finset.Set.Sized.shadow
118118

119119
theorem sized_shadow_iff (h : ∅ ∉ 𝒜) :
120-
((∂ ) 𝒜 : Set (Finset α)).Sized r ↔ (𝒜 : Set (Finset α)).Sized (r + 1) := by
120+
( 𝒜 : Set (Finset α)).Sized r ↔ (𝒜 : Set (Finset α)).Sized (r + 1) := by
121121
refine' ⟨fun h𝒜 s hs => _, Set.Sized.shadow⟩
122122
obtain ⟨a, ha⟩ := nonempty_iff_ne_empty.2 (ne_of_mem_of_not_mem hs h)
123123
rw [← h𝒜 (erase_mem_shadow hs ha), card_erase_add_one ha]
124124
#align finset.sized_shadow_iff Finset.sized_shadow_iff
125125

126126
/-- `s ∈ ∂ 𝒜` iff `s` is exactly one element less than something from `𝒜` -/
127127
theorem mem_shadow_iff_exists_mem_card_add_one :
128-
s ∈ (∂ ) 𝒜 ↔ ∃ t ∈ 𝒜, s ⊆ t ∧ t.card = s.card + 1 := by
128+
s ∈ 𝒜 ↔ ∃ t ∈ 𝒜, s ⊆ t ∧ t.card = s.card + 1 := by
129129
refine' mem_shadow_iff_insert_mem.trans ⟨_, _⟩
130130
· rintro ⟨a, ha, hs⟩
131131
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 :
138138
#align finset.mem_shadow_iff_exists_mem_card_add_one Finset.mem_shadow_iff_exists_mem_card_add_one
139139

140140
/-- Being in the shadow of `𝒜` means we have a superset in `𝒜`. -/
141-
theorem exists_subset_of_mem_shadow (hs : s ∈ (∂ ) 𝒜) : ∃ t ∈ 𝒜, s ⊆ t :=
141+
theorem exists_subset_of_mem_shadow (hs : s ∈ 𝒜) : ∃ t ∈ 𝒜, s ⊆ t :=
142142
let ⟨t, ht, hst⟩ := mem_shadow_iff_exists_mem_card_add_one.1 hs
143143
⟨t, ht, hst.1
144144
#align finset.exists_subset_of_mem_shadow Finset.exists_subset_of_mem_shadow
@@ -189,11 +189,11 @@ def upShadow (𝒜 : Finset (Finset α)) : Finset (Finset α) :=
189189

190190
-- mathport name: finset.up_shadow
191191
-- Porting note: added `inherit_doc` to calm linter
192-
@[inherit_doc] scoped[FinsetFamily] notation:90 "∂⁺ " => Finset.upShadow
192+
@[inherit_doc] scoped[FinsetFamily] notation:max "∂⁺ " => Finset.upShadow
193193

194194
/-- The upper shadow of the empty set is empty. -/
195195
@[simp]
196-
theorem upShadow_empty : (∂⁺ ) (∅ : Finset (Finset α)) = ∅ :=
196+
theorem upShadow_empty : ∂⁺ (∅ : Finset (Finset α)) = ∅ :=
197197
rfl
198198
#align finset.up_shadow_empty Finset.upShadow_empty
199199

@@ -205,25 +205,25 @@ theorem upShadow_monotone : Monotone (upShadow : Finset (Finset α) → Finset (
205205

206206
/-- `s` is in the upper shadow of `𝒜` iff there is an `t ∈ 𝒜` from which we can remove one element
207207
to get `s`. -/
208-
theorem mem_upShadow_iff : s ∈ (∂⁺ ) 𝒜 ↔ ∃ t ∈ 𝒜, ∃ (a : _) (_ : a ∉ t), insert a t = s := by
208+
theorem mem_upShadow_iff : s ∈ ∂⁺ 𝒜 ↔ ∃ t ∈ 𝒜, ∃ (a : _) (_ : a ∉ t), insert a t = s := by
209209
simp_rw [upShadow, mem_sup, mem_image, exists_prop, mem_compl]
210210
#align finset.mem_up_shadow_iff Finset.mem_upShadow_iff
211211

212-
theorem insert_mem_upShadow (hs : s ∈ 𝒜) (ha : a ∉ s) : insert a s ∈ (∂⁺ ) 𝒜 :=
212+
theorem insert_mem_upShadow (hs : s ∈ 𝒜) (ha : a ∉ s) : insert a s ∈ ∂⁺ 𝒜 :=
213213
mem_upShadow_iff.2 ⟨s, hs, a, ha, rfl⟩
214214
#align finset.insert_mem_up_shadow Finset.insert_mem_upShadow
215215

216216
/-- The upper shadow of a family of `r`-sets is a family of `r + 1`-sets. -/
217217
protected theorem Set.Sized.upShadow (h𝒜 : (𝒜 : Set (Finset α)).Sized r) :
218-
((∂⁺ ) 𝒜 : Set (Finset α)).Sized (r + 1) := by
218+
(∂⁺ 𝒜 : Set (Finset α)).Sized (r + 1) := by
219219
intro A h
220220
obtain ⟨A, hA, i, hi, rfl⟩ := mem_upShadow_iff.1 h
221221
rw [card_insert_of_not_mem hi, h𝒜 hA]
222222
#align finset.set.sized.up_shadow Finset.Set.Sized.upShadow
223223

224224
/-- `t` is in the upper shadow of `𝒜` iff we can remove an element from it so that the resulting
225225
finset is in `𝒜`. -/
226-
theorem mem_upShadow_iff_erase_mem : s ∈ (∂⁺ ) 𝒜 ↔ ∃ a ∈ s, s.erase a ∈ 𝒜 := by
226+
theorem mem_upShadow_iff_erase_mem : s ∈ ∂⁺ 𝒜 ↔ ∃ a ∈ s, s.erase a ∈ 𝒜 := by
227227
refine' mem_upShadow_iff.trans ⟨_, _⟩
228228
· rintro ⟨s, hs, a, ha, rfl⟩
229229
refine' ⟨a, mem_insert_self a s, _⟩
@@ -234,7 +234,7 @@ theorem mem_upShadow_iff_erase_mem : s ∈ (∂⁺ ) 𝒜 ↔ ∃ a ∈ s, s.era
234234

235235
/-- `s ∈ ∂⁺ 𝒜` iff `s` is exactly one element less than something from `𝒜`. -/
236236
theorem mem_upShadow_iff_exists_mem_card_add_one :
237-
s ∈ (∂⁺ ) 𝒜 ↔ ∃ t ∈ 𝒜, t ⊆ s ∧ t.card + 1 = s.card := by
237+
s ∈ ∂⁺ 𝒜 ↔ ∃ t ∈ 𝒜, t ⊆ s ∧ t.card + 1 = s.card := by
238238
refine' mem_upShadow_iff_erase_mem.trans ⟨_, _⟩
239239
· rintro ⟨a, ha, hs⟩
240240
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 :
246246
#align finset.mem_up_shadow_iff_exists_mem_card_add_one Finset.mem_upShadow_iff_exists_mem_card_add_one
247247

248248
/-- Being in the upper shadow of `𝒜` means we have a superset in `𝒜`. -/
249-
theorem exists_subset_of_mem_upShadow (hs : s ∈ (∂⁺ ) 𝒜) : ∃ t ∈ 𝒜, t ⊆ s :=
249+
theorem exists_subset_of_mem_upShadow (hs : s ∈ ∂⁺ 𝒜) : ∃ t ∈ 𝒜, t ⊆ s :=
250250
let ⟨t, ht, hts, _⟩ := mem_upShadow_iff_exists_mem_card_add_one.1 hs
251251
⟨t, ht, hts⟩
252252
#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 :
281281
#align finset.mem_up_shadow_iff_exists_mem_card_add Finset.mem_upShadow_iff_exists_mem_card_add
282282

283283
@[simp]
284-
theorem shadow_image_compl : ((∂ ) 𝒜).image compl = (∂⁺ ) (𝒜.image compl) := by
284+
theorem shadow_image_compl : (𝒜).image compl = ∂⁺ (𝒜.image compl) := by
285285
ext s
286286
simp only [mem_image, exists_prop, mem_shadow_iff, mem_upShadow_iff]
287287
constructor
@@ -292,7 +292,7 @@ theorem shadow_image_compl : ((∂ ) 𝒜).image compl = (∂⁺ ) (𝒜.image c
292292
#align finset.shadow_image_compl Finset.shadow_image_compl
293293

294294
@[simp]
295-
theorem upShadow_image_compl : ((∂⁺ ) 𝒜).image compl = (∂ ) (𝒜.image compl) := by
295+
theorem upShadow_image_compl : (∂⁺ 𝒜).image compl = (𝒜.image compl) := by
296296
ext s
297297
simp only [mem_image, exists_prop, mem_shadow_iff, mem_upShadow_iff]
298298
constructor

0 commit comments

Comments
 (0)