@@ -4,8 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
44Authors: Ching-Tsun Chou, Chris Wong
55-/
66import LeanCamCombi.Mathlib.Data.Fintype.Card
7+ import Mathlib.Data.Fintype.Prod
78import Mathlib.Data.Fintype.Perm
8- import Mathlib.Probability.UniformOn
99
1010/-!
1111# The LYM inequality using probability theory
@@ -29,15 +29,13 @@ The proof of Theorem 1.10, Lecture 3 in the Cambridge lecture notes on combinato
2929is basically the same proof, except without using probability theory.
3030-/
3131
32- open BigOperators Fintype Finset Set MeasureTheory ProbabilityTheory
33- open MeasureTheory.Measure
34- open scoped ENNReal
32+ open Fintype Finset Set
3533
3634noncomputable section
3735
3836/-- A numbering is a bijective map from a finite type or set to a Fin type
3937of the same cardinality. We cannot use the existing notion of permutations
40- in mathlib because we need the special property `set_prefix_subset ` below. -/
38+ in mathlib because we need the special property `subset_IsPrefix_IsPrefix ` below. -/
4139
4240@[reducible]
4341def Numbering (α : Type *) [Fintype α] := α ≃ Fin (card α)
@@ -134,67 +132,4 @@ theorem card_PrefixedNumbering (s : Finset α) :
134132 rw [Fintype.card_subtype] at h_eq
135133 simp [PrefixedNumbering, h_eq, card_Numbering]
136134
137- private lemma auxLemma {k m n : ℕ} (hn : 0 < n) (heq : k * m = n) :
138- (↑ m : ENNReal) / (↑ n : ENNReal) = 1 / (↑ k : ENNReal) := by
139- -- The following proof is due to Aaron Liu.
140- subst heq
141- have hm : m ≠ 0 := by rintro rfl ; simp at hn
142- have hk : k ≠ 0 := by rintro rfl ; simp at hn
143- refine (ENNReal.toReal_eq_toReal ?_ ?_).mp ?_
144- · intro h
145- apply_fun ENNReal.toReal at h
146- simp [hm, hk] at h
147- · intro h
148- apply_fun ENNReal.toReal at h
149- simp [hk] at h
150- · field_simp
151- ring
152-
153- instance : MeasurableSpace (Numbering α) := ⊤
154-
155- theorem count_PrefixedNumbering (s : Finset α) :
156- count (PrefixedNumbering s).toSet = ↑((#s).factorial * (card α - #s).factorial) := by
157- rw [← card_PrefixedNumbering s, count_apply_finset]
158-
159- theorem prob_PrefixedNumbering (s : Finset α) :
160- uniformOn Set.univ (PrefixedNumbering s).toSet = 1 / (card α).choose #s := by
161- rw [uniformOn_univ, count_PrefixedNumbering s, card_Numbering]
162- apply auxLemma (Nat.factorial_pos (card α))
163- rw [← mul_assoc]
164- exact Nat.choose_mul_factorial_mul_factorial (Finset.card_le_univ s)
165-
166- theorem disj_PrefixedNumbering {s t : Finset α} (h_st : ¬ s ⊆ t) (h_ts : ¬ t ⊆ s) :
167- Disjoint (PrefixedNumbering s).toSet (PrefixedNumbering t).toSet := by
168- refine Set.disjoint_iff.mpr ?_
169- intro p
170- simp only [mem_inter_iff, Finset.mem_coe, mem_empty_iff_false, imp_false, not_and]
171- simp [PrefixedNumbering]
172- intro h_s h_t
173- rcases Nat.le_total #s t.card with h_st' | h_ts'
174- · exact h_st (subset_IsPrefix_IsPrefix h_s h_t h_st')
175- · exact h_ts (subset_IsPrefix_IsPrefix h_t h_s h_ts')
176-
177- variable {𝓐 : Finset (Finset α)}
178-
179- theorem prob_biUnion_antichain (h𝓐 : IsAntichain (· ⊆ ·) 𝓐.toSet) :
180- uniformOn Set.univ (⋃ s ∈ 𝓐, (PrefixedNumbering s).toSet) =
181- ∑ s ∈ 𝓐, uniformOn Set.univ (PrefixedNumbering s).toSet := by
182- have hd : 𝓐.toSet.PairwiseDisjoint (fun s ↦ (PrefixedNumbering s).toSet) := by
183- intro s h_s t h_t h_ne
184- simp only [Function.onFun]
185- have h_st := h𝓐 h_s h_t h_ne
186- have h_ts := h𝓐 h_t h_s h_ne.symm
187- exact disj_PrefixedNumbering h_st h_ts
188- have hm : ∀ s ∈ 𝓐, MeasurableSet (PrefixedNumbering s).toSet := by
189- intro s h_s ; exact trivial
190- rw [measure_biUnion_finset hd hm (μ := uniformOn Set.univ)]
191-
192- theorem LYM_inequality (h𝓐 : IsAntichain (· ⊆ ·) 𝓐.toSet) :
193- ∑ s ∈ 𝓐, ((1 : ENNReal) / (card α).choose #s) ≤ 1 := by
194- have h1 s (hs : s ∈ 𝓐) :
195- (1 : ENNReal) / (card α).choose #s = uniformOn Set.univ (PrefixedNumbering s).toSet := by
196- rw [prob_PrefixedNumbering]
197- rw [Finset.sum_congr (rfl : 𝓐 = 𝓐) h1, ← prob_biUnion_antichain h𝓐]
198- exact prob_le_one
199-
200135end
0 commit comments