File: Mathlib/Combinatorics/SetFamily/AhlswedeZhang.lean

full_name: _private.Mathlib.Combinatorics.SetFamily.AhlswedeZhang.0.binomial_sum_eq
code: private lemma binomial_sum_eq (h : n < m) :
    ∑ i ∈ range (n + 1), (n.choose i * (m - n) / ((m - i) * m.choose i) : ℚ) = 1 
goal: ∑ i ∈ Finset.range (n + 1), ↑(n.choose i) * (↑m - ↑n) / ((↑m - ↑i) * ↑(m.choose i)) = 1

full_name: _private.Mathlib.Combinatorics.SetFamily.AhlswedeZhang.0.Fintype.sum_div_mul_card_choose_card
code: private lemma Fintype.sum_div_mul_card_choose_card :
    ∑ s : Finset α, (card α / ((card α - s.card) * (card α).choose s.card) : ℚ) =
      card α * ∑ k ∈ range (card α), (↑k)⁻¹ + 1 
goal: ∑ s : Finset α, ↑(Fintype.card α) / ((↑(Fintype.card α) - ↑s.card) * ↑((Fintype.card α).choose s.card)) =
  ↑(Fintype.card α) * ∑ k ∈ Finset.range (Fintype.card α), (↑k)⁻¹ + 1

full_name: _private.Mathlib.Combinatorics.SetFamily.AhlswedeZhang.0.Finset.sup_aux
code: private lemma sup_aux : a ∈ lowerClosure s → (s.filter fun b ↦ a ≤ b).Nonempty 
goal: a ∈ lowerClosure ↑s → (Finset.filter (fun b => a ≤ b) s).Nonempty

full_name: Finset.truncatedSup
code: /-- The supremum of the elements of `s` less than `a` if there are some, otherwise `⊤`. -/
def truncatedSup (s : Finset α) (a : α) : α 
goal: α

full_name: Finset.truncatedSup_of_mem
code: lemma truncatedSup_of_mem (h : a ∈ lowerClosure s) :
    truncatedSup s a = (s.filter fun b ↦ a ≤ b).sup' (sup_aux h) id 
goal: s.truncatedSup a = (Finset.filter (fun b => a ≤ b) s).sup' ⋯ id

full_name: Finset.truncatedSup_of_not_mem
code: lemma truncatedSup_of_not_mem (h : a ∉ lowerClosure s) : truncatedSup s a = ⊤ 
goal: s.truncatedSup a = ⊤

full_name: Finset.truncatedSup_empty
code: @[simp] lemma truncatedSup_empty (a : α) : truncatedSup ∅ a = ⊤ 
goal: ∅.truncatedSup a = ⊤

full_name: Finset.truncatedSup_singleton
code: @[simp] lemma truncatedSup_singleton (b a : α) : truncatedSup {b} a = if a ≤ b then b else ⊤ 
goal: {b}.truncatedSup a = if a ≤ b then b else ⊤

full_name: Finset.le_truncatedSup
code: lemma le_truncatedSup : a ≤ truncatedSup s a 
goal: a ≤ s.truncatedSup a

full_name: Finset.map_truncatedSup
code: lemma map_truncatedSup (e : α ≃o β) (s : Finset α) (a : α) :
    e (truncatedSup s a) = truncatedSup (s.map e.toEquiv.toEmbedding) (e a) 
goal: e (s.truncatedSup a) = (Finset.map e.toEmbedding s).truncatedSup (e a)

full_name: _private.Mathlib.Combinatorics.SetFamily.AhlswedeZhang.0.Finset.lower_aux
code: private lemma lower_aux : a ∈ lowerClosure ↑(s ∪ t) ↔ a ∈ lowerClosure s ∨ a ∈ lowerClosure t 
goal: a ∈ lowerClosure ↑(s ∪ t) ↔ a ∈ lowerClosure ↑s ∨ a ∈ lowerClosure ↑t

full_name: Finset.truncatedSup_union
code: lemma truncatedSup_union (hs : a ∈ lowerClosure s) (ht : a ∈ lowerClosure t) :
    truncatedSup (s ∪ t) a = truncatedSup s a ⊔ truncatedSup t a 
goal: (s ∪ t).truncatedSup a = s.truncatedSup a ⊔ t.truncatedSup a

full_name: Finset.truncatedSup_union_left
code: lemma truncatedSup_union_left (hs : a ∈ lowerClosure s) (ht : a ∉ lowerClosure t) :
    truncatedSup (s ∪ t) a = truncatedSup s a 
goal: (s ∪ t).truncatedSup a = s.truncatedSup a

full_name: Finset.truncatedSup_union_right
code: lemma truncatedSup_union_right (hs : a ∉ lowerClosure s) (ht : a ∈ lowerClosure t) :
    truncatedSup (s ∪ t) a = truncatedSup t a 
goal: (s ∪ t).truncatedSup a = t.truncatedSup a

full_name: Finset.truncatedSup_union_of_not_mem
code: lemma truncatedSup_union_of_not_mem (hs : a ∉ lowerClosure s) (ht : a ∉ lowerClosure t) :
    truncatedSup (s ∪ t) a = ⊤ 
goal: (s ∪ t).truncatedSup a = ⊤

full_name: Finset.truncatedSup_of_isAntichain
code: lemma truncatedSup_of_isAntichain (hs : IsAntichain (· ≤ ·) (s : Set α)) (ha : a ∈ s) :
    truncatedSup s a = a 
goal: s.truncatedSup a = a

full_name: _private.Mathlib.Combinatorics.SetFamily.AhlswedeZhang.0.Finset.inf_aux
code: private lemma inf_aux : a ∈ upperClosure s → (s.filter (· ≤ a)).Nonempty 
goal: a ∈ upperClosure ↑s → (Finset.filter (fun x => x ≤ a) s).Nonempty

full_name: Finset.truncatedInf
code: /-- The infimum of the elements of `s` less than `a` if there are some, otherwise `⊥`. -/
def truncatedInf (s : Finset α) (a : α) : α 
goal: α

full_name: Finset.truncatedInf_of_mem
code: lemma truncatedInf_of_mem (h : a ∈ upperClosure s) :
    truncatedInf s a = (s.filter (· ≤ a)).inf' (inf_aux h) id 
goal: s.truncatedInf a = (Finset.filter (fun x => x ≤ a) s).inf' ⋯ id

full_name: Finset.truncatedInf_of_not_mem
code: lemma truncatedInf_of_not_mem (h : a ∉ upperClosure s) : truncatedInf s a = ⊥ 
goal: s.truncatedInf a = ⊥

full_name: Finset.truncatedInf_le
code: lemma truncatedInf_le : truncatedInf s a ≤ a 
goal: s.truncatedInf a ≤ a

full_name: Finset.truncatedInf_empty
code: @[simp] lemma truncatedInf_empty (a : α) : truncatedInf ∅ a = ⊥ 
goal: ∅.truncatedInf a = ⊥

full_name: Finset.truncatedInf_singleton
code: @[simp] lemma truncatedInf_singleton (b a : α) : truncatedInf {b} a = if b ≤ a then b else ⊥ 
goal: {b}.truncatedInf a = if b ≤ a then b else ⊥

full_name: Finset.map_truncatedInf
code: lemma map_truncatedInf (e : α ≃o β) (s : Finset α) (a : α) :
    e (truncatedInf s a) = truncatedInf (s.map e.toEquiv.toEmbedding) (e a) 
goal: e (s.truncatedInf a) = (Finset.map e.toEmbedding s).truncatedInf (e a)

full_name: _private.Mathlib.Combinatorics.SetFamily.AhlswedeZhang.0.Finset.upper_aux
code: private lemma upper_aux : a ∈ upperClosure ↑(s ∪ t) ↔ a ∈ upperClosure s ∨ a ∈ upperClosure t 
goal: a ∈ upperClosure ↑(s ∪ t) ↔ a ∈ upperClosure ↑s ∨ a ∈ upperClosure ↑t

full_name: Finset.truncatedInf_union
code: lemma truncatedInf_union (hs : a ∈ upperClosure s) (ht : a ∈ upperClosure t) :
    truncatedInf (s ∪ t) a = truncatedInf s a ⊓ truncatedInf t a 
goal: (s ∪ t).truncatedInf a = s.truncatedInf a ⊓ t.truncatedInf a

full_name: Finset.truncatedInf_union_left
code: lemma truncatedInf_union_left (hs : a ∈ upperClosure s) (ht : a ∉ upperClosure t) :
    truncatedInf (s ∪ t) a = truncatedInf s a 
goal: (s ∪ t).truncatedInf a = s.truncatedInf a

full_name: Finset.truncatedInf_union_right
code: lemma truncatedInf_union_right (hs : a ∉ upperClosure s) (ht : a ∈ upperClosure t) :
    truncatedInf (s ∪ t) a = truncatedInf t a 
goal: (s ∪ t).truncatedInf a = t.truncatedInf a

full_name: Finset.truncatedInf_union_of_not_mem
code: lemma truncatedInf_union_of_not_mem (hs : a ∉ upperClosure s) (ht : a ∉ upperClosure t) :
    truncatedInf (s ∪ t) a = ⊥ 
goal: (s ∪ t).truncatedInf a = ⊥

full_name: Finset.truncatedInf_of_isAntichain
code: lemma truncatedInf_of_isAntichain (hs : IsAntichain (· ≤ ·) (s : Set α)) (ha : a ∈ s) :
    truncatedInf s a = a 
goal: s.truncatedInf a = a

full_name: _private.Mathlib.Combinatorics.SetFamily.AhlswedeZhang.0.Finset.infs_aux
code: private lemma infs_aux : a ∈ lowerClosure ↑(s ⊼ t) ↔ a ∈ lowerClosure s ∧ a ∈ lowerClosure t 
goal: a ∈ lowerClosure ↑(s ⊼ t) ↔ a ∈ lowerClosure ↑s ∧ a ∈ lowerClosure ↑t

full_name: _private.Mathlib.Combinatorics.SetFamily.AhlswedeZhang.0.Finset.sups_aux
code: private lemma sups_aux : a ∈ upperClosure ↑(s ⊻ t) ↔ a ∈ upperClosure s ∧ a ∈ upperClosure t 
goal: a ∈ upperClosure ↑(s ⊻ t) ↔ a ∈ upperClosure ↑s ∧ a ∈ upperClosure ↑t

full_name: Finset.truncatedSup_infs
code: lemma truncatedSup_infs (hs : a ∈ lowerClosure s) (ht : a ∈ lowerClosure t) :
    truncatedSup (s ⊼ t) a = truncatedSup s a ⊓ truncatedSup t a 
goal: (s ⊼ t).truncatedSup a = s.truncatedSup a ⊓ t.truncatedSup a

full_name: Finset.truncatedInf_sups
code: lemma truncatedInf_sups (hs : a ∈ upperClosure s) (ht : a ∈ upperClosure t) :
    truncatedInf (s ⊻ t) a = truncatedInf s a ⊔ truncatedInf t a 
goal: (s ⊻ t).truncatedInf a = s.truncatedInf a ⊔ t.truncatedInf a

full_name: Finset.truncatedSup_infs_of_not_mem
code: lemma truncatedSup_infs_of_not_mem (ha : a ∉ lowerClosure s ⊓ lowerClosure t) :
    truncatedSup (s ⊼ t) a = ⊤ 
goal: (s ⊼ t).truncatedSup a = ⊤

full_name: Finset.truncatedInf_sups_of_not_mem
code: lemma truncatedInf_sups_of_not_mem (ha : a ∉ upperClosure s ⊔ upperClosure t) :
    truncatedInf (s ⊻ t) a = ⊥ 
goal: (s ⊻ t).truncatedInf a = ⊥

full_name: Finset.compl_truncatedSup
code: @[simp] lemma compl_truncatedSup (s : Finset α) (a : α) :
    (truncatedSup s a)ᶜ = truncatedInf sᶜˢ aᶜ 
goal: (s.truncatedSup a)ᶜ = sᶜˢ.truncatedInf aᶜ

full_name: Finset.compl_truncatedInf
code: @[simp] lemma compl_truncatedInf (s : Finset α) (a : α) :
    (truncatedInf s a)ᶜ = truncatedSup sᶜˢ aᶜ 
goal: (s.truncatedInf a)ᶜ = sᶜˢ.truncatedSup aᶜ

full_name: Finset.card_truncatedSup_union_add_card_truncatedSup_infs
code: lemma card_truncatedSup_union_add_card_truncatedSup_infs (𝒜 ℬ : Finset (Finset α)) (s : Finset α) :
    (truncatedSup (𝒜 ∪ ℬ) s).card + (truncatedSup (𝒜 ⊼ ℬ) s).card =
      (truncatedSup 𝒜 s).card + (truncatedSup ℬ s).card 
goal: ((𝒜 ∪ ℬ).truncatedSup s).card + ((𝒜 ⊼ ℬ).truncatedSup s).card = (𝒜.truncatedSup s).card + (ℬ.truncatedSup s).card

full_name: Finset.card_truncatedInf_union_add_card_truncatedInf_sups
code: lemma card_truncatedInf_union_add_card_truncatedInf_sups (𝒜 ℬ : Finset (Finset α)) (s : Finset α) :
    (truncatedInf (𝒜 ∪ ℬ) s).card + (truncatedInf (𝒜 ⊻ ℬ) s).card =
      (truncatedInf 𝒜 s).card + (truncatedInf ℬ s).card 
goal: ((𝒜 ∪ ℬ).truncatedInf s).card + ((𝒜 ⊻ ℬ).truncatedInf s).card = (𝒜.truncatedInf s).card + (ℬ.truncatedInf s).card

full_name: AhlswedeZhang.infSum
code: /-- Weighted sum of the size of the truncated infima of a set family. Relevant to the
Ahlswede-Zhang identity. -/
def infSum (𝒜 : Finset (Finset α)) : ℚ 
goal: ℚ

full_name: AhlswedeZhang.supSum
code: /-- Weighted sum of the size of the truncated suprema of a set family. Relevant to the
Ahlswede-Zhang identity. -/
def supSum (𝒜 : Finset (Finset α)) : ℚ 
goal: ℚ

full_name: AhlswedeZhang.supSum_union_add_supSum_infs
code: lemma supSum_union_add_supSum_infs (𝒜 ℬ : Finset (Finset α)) :
    supSum (𝒜 ∪ ℬ) + supSum (𝒜 ⊼ ℬ) = supSum 𝒜 + supSum ℬ 
goal: AhlswedeZhang.supSum (𝒜 ∪ ℬ) + AhlswedeZhang.supSum (𝒜 ⊼ ℬ) = AhlswedeZhang.supSum 𝒜 + AhlswedeZhang.supSum ℬ

full_name: AhlswedeZhang.infSum_union_add_infSum_sups
code: lemma infSum_union_add_infSum_sups (𝒜 ℬ : Finset (Finset α)) :
    infSum (𝒜 ∪ ℬ) + infSum (𝒜 ⊻ ℬ) = infSum 𝒜 + infSum ℬ 
goal: AhlswedeZhang.infSum (𝒜 ∪ ℬ) + AhlswedeZhang.infSum (𝒜 ⊻ ℬ) = AhlswedeZhang.infSum 𝒜 + AhlswedeZhang.infSum ℬ

full_name: AhlswedeZhang.IsAntichain.le_infSum
code: lemma IsAntichain.le_infSum (h𝒜 : IsAntichain (· ⊆ ·) (𝒜 : Set (Finset α))) (h𝒜₀ : ∅ ∉ 𝒜) :
    ∑ s ∈ 𝒜, ((card α).choose s.card : ℚ)⁻¹ ≤ infSum 𝒜 
goal: ∑ s ∈ 𝒜, (↑((Fintype.card α).choose s.card))⁻¹ ≤ AhlswedeZhang.infSum 𝒜

full_name: AhlswedeZhang.supSum_singleton
code: @[simp] lemma supSum_singleton (hs : s ≠ univ) :
    supSum ({s} : Finset (Finset α)) = card α * ∑ k ∈ range (card α), (k : ℚ)⁻¹ 
goal: AhlswedeZhang.supSum {s} = ↑(Fintype.card α) * ∑ k ∈ Finset.range (Fintype.card α), (↑k)⁻¹

full_name: AhlswedeZhang.infSum_compls_add_supSum
code: /-- The **Ahlswede-Zhang Identity**. -/
lemma infSum_compls_add_supSum (𝒜 : Finset (Finset α)) :
    infSum 𝒜ᶜˢ + supSum 𝒜 = card α * ∑ k ∈ range (card α), (k : ℚ)⁻¹ + 1 
goal: AhlswedeZhang.infSum 𝒜ᶜˢ + AhlswedeZhang.supSum 𝒜 = ↑(Fintype.card α) * ∑ k ∈ Finset.range (Fintype.card α), (↑k)⁻¹ + 1

full_name: AhlswedeZhang.supSum_of_not_univ_mem
code: lemma supSum_of_not_univ_mem (h𝒜₁ : 𝒜.Nonempty) (h𝒜₂ : univ ∉ 𝒜) :
    supSum 𝒜 = card α * ∑ k ∈ range (card α), (k : ℚ)⁻¹ 
goal: AhlswedeZhang.supSum 𝒜 = ↑(Fintype.card α) * ∑ k ∈ Finset.range (Fintype.card α), (↑k)⁻¹

full_name: AhlswedeZhang.infSum_eq_one
code: /-- The **Ahlswede-Zhang Identity**. -/
lemma infSum_eq_one (h𝒜₁ : 𝒜.Nonempty) (h𝒜₀ : ∅ ∉ 𝒜) : infSum 𝒜 = 1 
goal: AhlswedeZhang.infSum 𝒜 = 1