Quelle LYM.lean
Sprache: Lean
|
|
/-
Copyright (c) 2022 Bhavik Mehta, Yaël Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Bhavik Mehta, Alena Gusakov, Yaël Dillies
-/
module
public import Mathlib.Algebra.Field.Rat
public import Mathlib.Combinatorics.SetFamily.Shadow
import Mathlib.Algebra.Field.Basic
import Mathlib.Algebra.Order.Ring.NNRat
import Mathlib.Combinatorics.Enumerative.DoubleCounting
import Mathlib.Data.Nat.Cast.Order.Ring
/-!
# Lubell-Yamamoto-Meshalkin inequality and Sperner's theorem
This file proves the local LYM and LYM inequalities as well as Sperner's theorem.
## Main declarations
* `Finset.local_lubell_yamamoto_meshalkin_inequality_div`: Local Lubell-Yamamoto-Meshalkin
inequality. The shadow of a set `` in a layer takes a greater proportion of its layer than ``
does.
* `Finset.lubell_yamamoto_meshalkin_inequality_sum_card_div_choose`: Lubell-Yamamoto-Meshalkin
inequality. The sum of densities of `` in each layer is at most `1` for any antichain ``.
* `IsAntichain.sperner`: Sperner's theorem. The size of any antichain in `Finset α` is at most the
size of the maximal layer of `Finset α`. It is a corollary of
`lubell_yamamoto_meshalkin_inequality_sum_card_div_choose`.
## TODO
Prove upward local LYM.
Provide equality cases. Local LYM gives that the equality case of LYM and Sperner is precisely when
`` is a middle layer.
`falling` could be useful more generally in grade orders.
## References
* http://b-mehta.github.io/maths-notes/iii/mich/combinatorics.pdf
* http://discretemath.imp.fu-berlin.de/DMII-2015-16/kruskal.pdf
## Tags
shadow, lym, slice, sperner, antichain
-/
@[expose] public section
open Finset Nat
open scoped FinsetFamily
variable { α : Type*} [Semifield ] [LinearOrder ] [IsStrictOrderedRing ]
namespace Finset
/-! ### Local LYM inequality -/
section LocalLYM
variable [DecidableEq α] [Fintype α] { : Finset (Finset α)} {r : ℕ}
/-- The downward **local LYM inequality**, with cancelled denominators. `` takes up less of `α^(r)`
(the finsets of card `r`) than `∂` takes up of `α^(r - 1)`. -/
theorem local_lubell_yamamoto_meshalkin_inequality_mul (h : ( : Set (Finset α)).Sized r) :
# * r ≤ #(∂ ) * (Fintype.card α - r + 1) := by
let i : DecidableRel ((· ⊆ ·) : Finset α → Finset α → Prop) := fun _ _ => Classical.dec _
refine card_mul_le_card_mul' (· ⊆ ·) (fun s hs => ?_) (fun s hs => ?_)
· rw [← h hs, ← card_image_of_injOn s.erase_injOn]
refine card_le_card ?_
simp_rw [image_subset_iff, mem_bipartiteBelow]
exact fun a ha => ⟨erase_mem_shadow hs ha, erase_subset _ _⟩
refine le_trans ?_ tsub_tsub_le_tsub_add
rw [← (Set.Sized.shadow h) hs, ← card_compl, ← card_image_of_injOn (insert_inj_on' _)]
refine card_le_card fun t ht => ?_
rw [mem_bipartiteAbove] at ht
have : ∅ ∉ := by
rw [← mem_coe, h.empty_mem_iff, coe_eq_singleton]
rintro rfl
rw [shadow_singleton_empty] at hs
exact notMem_empty s hs
have h := exists_eq_insert_iff.2 ⟨ht.2, by
rw [(sized_shadow_iff this).1 (Set.Sized.shadow h) ht.1, (Set.Sized.shadow h) hs]⟩
rcases h with ⟨a, ha, rfl⟩
exact mem_image_of_mem _ (mem_compl.2 ha)
@[inherit_doc local_lubell_yamamoto_meshalkin_inequality_mul]
alias card_mul_le_card_shadow_mul := local_lubell_yamamoto_meshalkin_inequality_mul
/-- The downward **local LYM inequality**. `` takes up less of `α^(r)` (the finsets of card `r`)
than `∂` takes up of `α^(r - 1)`. -/
theorem local_lubell_yamamoto_meshalkin_inequality_div (hr : r ≠ 0)
(h : ( : Set (Finset α)).Sized r) : (# : ) / (Fintype.card α).choose r
≤ #(∂ ) / (Fintype.card α).choose (r - 1) := by
obtain hr' | hr' := lt_or_ge (Fintype.card α) r
· rw [choose_eq_zero_of_lt hr', cast_zero, div_zero]
exact div_nonneg (cast_nonneg _) (cast_nonneg _)
replace h := local_lubell_yamamoto_meshalkin_inequality_mul h
rw [div_le_div_iff₀] <;> norm_cast
· rcases r with - | r
· exact (hr rfl).elim
rw [tsub_add_eq_add_tsub hr', add_tsub_add_eq_tsub_right] at h
apply le_of_mul_le_mul_right _ (pos_iff_ne_zero.2 hr)
convert Nat.mul_le_mul_right ((Fintype.card α).choose r) h using 1
· simpa [mul_assoc, Nat.choose_succ_right_eq] using Or.inl (mul_comm _ _)
· simp only [mul_assoc, choose_succ_right_eq, mul_eq_mul_left_iff]
exact Or.inl (mul_comm _ _)
· exact Nat.choose_pos hr'
· exact Nat.choose_pos (r.pred_le.trans hr')
@[inherit_doc local_lubell_yamamoto_meshalkin_inequality_div]
alias card_div_choose_le_card_shadow_div_choose := local_lubell_yamamoto_meshalkin_inequality_div
end LocalLYM
/-! ### LYM inequality -/
section LYM
section Falling
variable [DecidableEq α] (k : ℕ) ( : Finset (Finset α))
/-- `falling k ` is all the finsets of cardinality `k` which are a subset of something in ``. -/
def falling : Finset (Finset α) :=
.sup <| powersetCard k
variable { k} {s : Finset α}
theorem mem_falling : s ∈ falling k ↔ (∃ t ∈ , s ⊆ t) ∧ #s = k := by
grind [falling, mem_sup]
variable ( k)
theorem sized_falling : (falling k : Set (Finset α)).Sized k := fun _ hs => (mem_falling.1 hs).2
theorem slice_subset_falling : # k ⊆ falling k := fun s hs =>
mem_falling.2 <| (mem_slice.1 hs).imp_left fun h => ⟨s, h, Subset.refl _⟩
theorem falling_zero_subset : falling 0 ⊆ {∅} :=
subset_singleton_iff'.2 fun _ ht => card_eq_zero.1 <| sized_falling _ _ ht
theorem slice_union_shadow_falling_succ : # k ∪ ∂ (falling (k + 1) ) = falling k := by
ext s
simp_rw [mem_union, mem_slice, mem_shadow_iff, mem_falling]
constructor
· rintro (h | ⟨s, ⟨⟨t, ht, hst⟩, hs⟩, a, ha, rfl⟩)
· exact ⟨⟨s, h.1, Subset.refl _⟩, h.2⟩
refine ⟨⟨t, ht, (erase_subset _ _).trans hst⟩, ?_⟩
rw [card_erase_of_mem ha, hs]
rfl
· rintro ⟨⟨t, ht, hst⟩, hs⟩
by_cases h : s ∈
· exact Or.inl ⟨h, hs⟩
obtain ⟨a, ha, hst⟩ := ssubset_iff.1 (ssubset_of_subset_of_ne hst (ht.ne_of_notMem h).symm)
refine Or.inr ⟨insert a s, ⟨⟨t, ht, hst⟩, ?_⟩, a, mem_insert_self _ _, erase_insert ha⟩
rw [card_insert_of_notMem ha, hs]
variable { k}
/-- The shadow of `falling m ` is disjoint from the `n`-sized elements of ``, thanks to the
antichain property. -/
theorem IsAntichain.disjoint_slice_shadow_falling {m n : ℕ}
(h : IsAntichain (· ⊆ ·) ( : Set (Finset α))) : Disjoint ( # m) (∂ (falling n )) :=
disjoint_right.2 fun s h₁ h₂ => by
simp_rw [mem_shadow_iff, mem_falling] at h₁
obtain ⟨s, ⟨⟨t, ht, hst⟩, _⟩, a, ha, rfl⟩ := h₁
refine h (slice_subset h₂) ht ?_ ((erase_subset _ _).trans hst)
rintro rfl
exact notMem_erase _ _ (hst ha)
/-- A bound on any top part of the sum in LYM in terms of the size of `falling k `. -/
theorem le_card_falling_div_choose [Fintype α] (hk : k ≤ Fintype.card α)
(h : IsAntichain (· ⊆ ·) ( : Set (Finset α))) :
(∑ r ∈ range (k + 1),
(#( # (Fintype.card α - r)) : ) / (Fintype.card α).choose (Fintype.card α - r)) ≤
(falling (Fintype.card α - k) ).card / (Fintype.card α).choose (Fintype.card α - k) := by
induction k with
| zero =>
simp only [cast_one, cast_le, sum_singleton, div_one, choose_self, range_one,
zero_add, range_one, sum_singleton,
choose_self, cast_one, div_one, cast_le, tsub_zero]
exact card_le_card (slice_subset_falling _ _)
| succ k ih =>
rw [sum_range_succ, ← slice_union_shadow_falling_succ,
card_union_of_disjoint (IsAntichain.disjoint_slice_shadow_falling h),
cast_add, _root_.add_div, add_comm]
rw [← tsub_tsub, tsub_add_cancel_of_le (le_tsub_of_add_le_left hk)]
grw [ih <| le_of_succ_le hk, local_lubell_yamamoto_meshalkin_inequality_div
(tsub_pos_iff_lt.2 <| Nat.succ_le_iff.1 hk).ne' <| sized_falling _ _]
end Falling
variable [Fintype α] { : Finset (Finset α)}
/-- The **Lubell-Yamamoto-Meshalkin inequality**, also known as the **LYM inequality**.
If `` is an antichain, then the sum of the proportion of elements it takes from each layer is less
than `1`. -/
theorem lubell_yamamoto_meshalkin_inequality_sum_card_div_choose
(h : IsAntichain (· ⊆ ·) ( : Set (Finset α))) :
∑ r ∈ range (Fintype.card α + 1), (#( # r) / (Fintype.card α).choose r : ) ≤ 1 := by
classical
rw [← sum_flip]
refine (le_card_falling_div_choose le_rfl h).trans ?_
rw [div_le_iff₀] <;> norm_cast
· simpa only [Nat.sub_self, one_mul, Nat.choose_zero_right, falling] using
Set.Sized.card_le (sized_falling 0 )
· rw [tsub_self, choose_zero_right]
exact zero_lt_one
@[inherit_doc lubell_yamamoto_meshalkin_inequality_sum_card_div_choose]
alias sum_card_slice_div_choose_le_one := lubell_yamamoto_meshalkin_inequality_sum_card_div_choose
/-- The **Lubell-Yamamoto-Meshalkin inequality**, also known as the **LYM inequality**.
If `` is an antichain, then the sum of `(#α.choose #s)⁻¹` over `s ∈ ` is less than `1`. -/
theorem lubell_yamamoto_meshalkin_inequality_sum_inv_choose
(h : IsAntichain (· ⊆ ·) (SetLike.coe )) :
∑ s ∈ , ((Fintype.card α).choose #s : )⁻¹ ≤ 1 := by
calc
_ = ∑ r ∈ range (Fintype.card α + 1),
∑ s ∈ with #s = r, ((Fintype.card α).choose r : )⁻¹ := by
rw [sum_fiberwise_of_maps_to']; simp [card_le_univ]
_ = ∑ r ∈ range (Fintype.card α + 1), (#( # r) / (Fintype.card α).choose r : ) := by
simp [slice, div_eq_mul_inv]
_ ≤ 1 := lubell_yamamoto_meshalkin_inequality_sum_card_div_choose h
/-! ### Sperner's theorem -/
/-- **Sperner's theorem**. The size of an antichain in `Finset α` is bounded by the size of the
maximal layer in `Finset α`. This precisely means that `Finset α` is a Sperner order. -/
theorem _root_.IsAntichain.sperner (h : IsAntichain (· ⊆ ·) (SetLike.coe )) :
# ≤ (Fintype.card α).choose (Fintype.card α / 2) := by
have : 0 < ((Fintype.card α).choose (Fintype.card α / 2) : ℚ≥0) :=
Nat.cast_pos.2 <| choose_pos (Nat.div_le_self _ _)
have h := calc
∑ s ∈ , ((Fintype.card α).choose (Fintype.card α / 2) : ℚ≥0)⁻¹
_ ≤ ∑ s ∈ , ((Fintype.card α).choose #s : ℚ≥0)⁻¹ := by
gcongr with s hs
· exact mod_cast choose_pos s.card_le_univ
· exact choose_le_middle _ _
_ ≤ 1 := lubell_yamamoto_meshalkin_inequality_sum_inv_choose h
simpa [mul_inv_le_iff₀' this] using h
end LYM
end Finset
¤ Dauer der Verarbeitung: 0.2 Sekunden
(vorverarbeitet am 2026-11-24)
¤
*© Formatika GbR, Deutschland
|
|
2026-11-24
|