Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarMatchingSharp

Download original .lean · View on GitHub · Jump to source

Relationships above come from literal import commands. The declarations below link to types and references extracted from Lean’s environment. Source text is complete and unchanged.

Declarations in this module

22 project constants, including generated, internal and private declarations.

22 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarMatchingCount7import Nonadditivity.HaarMatchingFibers89/-! # The high-multiplicity matching bound1011Fixing the disagreement images leaves a literal bijection between fibers of12identical entries. Fibers of size zero or one carry no factorial cost; all13other costs are charged to half the total multiplicity of entries occurring14at least four times.15-/16noncomputable section17set_option backward.isDefEq.respectTransparency false18set_option maxHeartbeats 100000019namespace Nonadditivity.HaarMatchingSharp20open HaarMatchingCount HaarMatchingFibers HaarPathMultiplicity21open scoped BigOperators22variable {E : Type*} [Fintype E] [DecidableEq E] {p : ℕ}2324abbrev Remaining (S : Finset (Fin p)) := {a : Fin p // a ∉ S}2526def restriction (x y : Fin p → E) (S : Finset (Fin p))27    (σ : AgreementMatching x y S) : S → Fin p := fun a => σ.val a.val2829abbrev RestrictionFiber (x y : Fin p → E) (S : Finset (Fin p)) (t : S → Fin p) :=30  {σ : AgreementMatching x y S // restriction x y S σ=t}3132/-- Fixed images on the exceptional positions leave an actual bijection33between the complementary occurrence sets, preserving their entry labels. -/34def fiberToLabel (x y : Fin p → E) (S : Finset (Fin p)) (t : S → Fin p)35    (σ₀ σ : RestrictionFiber x y S t) :36    LabelEquiv (fun a : Remaining S => x a.val)37      (fun b : Remaining (S.image σ₀.val.val) => y b.val) := by38  classical39  have hs (a : Fin p) (ha : a ∈ S) : σ.val.val a=σ₀.val.val a :=40    congrFun (σ.property.trans σ₀.property.symm) ⟨a,ha⟩41  let e : Remaining S ≃ Remaining (S.image σ₀.val.val) :=42    σ.val.val.subtypeEquiv (fun a => by43      constructor44      · intro ha hm45        obtain ⟨b,hb,he⟩ := Finset.mem_image.mp hm46        have hba : b=a := σ.val.val.injective ((hs b hb).trans he)47        exact ha (hba ▸ hb)48      · intro ha hm49        exact ha (Finset.mem_image.mpr ⟨a,hm,(hs a hm).symm⟩))50  exact ⟨e,fun a => (σ.val.property a.val a.property).symm⟩5152omit [Fintype E] [DecidableEq E] in53theorem fiberToLabel_injective (x y : Fin p → E) (S : Finset (Fin p)) (t : S → Fin p)54    (σ₀ : RestrictionFiber x y S t) : Function.Injective (fiberToLabel x y S t σ₀) := by55  classical56  intro σ τ h57  apply Subtype.ext58  apply Subtype.ext59  apply Equiv.ext60  intro a61  by_cases ha : a ∈ S62  · exact congrFun (σ.property.trans τ.property.symm) ⟨a,ha⟩63  · exact congrArg (fun f : LabelEquiv (fun a : Remaining S => x a.val)64      (fun b : Remaining (S.image σ₀.val.val) => y b.val) => (f.val ⟨a,ha⟩).val) h6566/-- Actual residual multiplicity of one entry value. -/67def residualCount (x : Fin p → E) (S : Finset (Fin p)) (e : E) : ℕ :=68  Fintype.card {a : Remaining S // x a.val=e}6970omit [Fintype E] in71theorem residualCount_le (x : Fin p → E) (S : Finset (Fin p)) (e : E) :72    residualCount x S e ≤ p := by73  classical74  apply (Fintype.card_subtype_le _).trans75  simpa only [Fintype.card_fin] using Fintype.card_subtype_le (fun a : Fin p => a ∉ S)7677omit [Fintype E] in78/-- Every remaining positive occurrence has a distinct negative partner;79the combined multiplicity is therefore at least twice the residual size. -/80theorem twice_residualCount_le (x y : Fin p → E) (S : Finset (Fin p))81    (σ : AgreementMatching x y S) (e : E) :82    2*residualCount x S e ≤ (List.ofFn x ++ List.ofFn y).count e := by83  classical84  let A := {a : Remaining S // x a.val=e}85  let f : A → {a : Fin p // x a=e} := fun a => ⟨a.val.val,a.property⟩86  have hf : Function.Injective f := by87    intro a b h88    apply Subtype.ext89    apply Subtype.ext90    exact congrArg (fun z : {a : Fin p // x a=e} => z.val) h91  let g : A → {b : Fin p // y b=e} := fun a =>92    ⟨σ.val a.val.val,(σ.property a.val.val a.val.property).symm.trans a.property⟩93  have hg : Function.Injective g := by94    intro a b h95    apply Subtype.ext96    apply Subtype.ext97    exact σ.val.injective (congrArg Subtype.val h)98  have hpos := Fintype.card_le_of_injective f hf99  have hneg := Fintype.card_le_of_injective g hg100  have hx : Fintype.card {a : Fin p // x a=e}=(List.ofFn x).count e := by101    rw [count_ofFn_eq_card,Fintype.card_subtype]102  have hy : Fintype.card {a : Fin p // y a=e}=(List.ofFn y).count e := by103    rw [count_ofFn_eq_card,Fintype.card_subtype]104  rw [hx] at hpos105  rw [hy] at hneg106  change residualCount x S e ≤ _ at hpos hneg107  rw [List.count_append]108  omega109110lemma sum_high_multiplicity (L : List E) :111    (∑ e : E, if 4 ≤ L.count e then L.count e else 0)=highMultiplicityOccurrences L := by112  classical113  symm114  apply Finset.sum_subset (Finset.subset_univ _)115  intro e _ he116  have hz : L.count e=0 := List.count_eq_zero.mpr117    (fun h => he (List.mem_toFinset.mpr h))118  simp [hz]119120/-- After the exceptional images have been fixed, only repeated pairs carry121any choice: their total cost is at most half the high multiplicity count. -/122theorem card_restrictionFiber_le (hp : 0 < p) (x y : Fin p → E)123    (S : Finset (Fin p)) (t : S → Fin p) :124    Fintype.card (RestrictionFiber x y S t) ≤125      p^(highMultiplicityOccurrences (List.ofFn x ++ List.ofFn y)/2) := by126  classical127  by_cases h : Nonempty (RestrictionFiber x y S t)128  · obtain ⟨σ₀⟩ := h129    calc130      _ ≤ Fintype.card (LabelEquiv (fun a : Remaining S => x a.val)131          (fun b : Remaining (S.image σ₀.val.val) => y b.val)) :=132        Fintype.card_le_of_injective (fiberToLabel x y S t σ₀)133          (fiberToLabel_injective x y S t σ₀)134      _ ≤ ∏ e : E, (residualCount x S e).factorial := by135        simpa only [residualCount, ← Nat.card_eq_fintype_card] using136          (card_labelEquiv_le (fun a : Remaining S => x a.val)137            (fun b : Remaining (S.image σ₀.val.val) => y b.val))138      _ ≤ _ := by139        have hnum := prod_factorial_le_pow_half_high p hp (residualCount x S)140          (fun e => (List.ofFn x ++ List.ofFn y).count e)141          (residualCount_le x S) (twice_residualCount_le x y S σ₀.val)142        simpa only [sum_high_multiplicity] using hnum143  · letI : IsEmpty (RestrictionFiber x y S t) := not_nonempty_iff.mp h144    simp145146/-- The sharp matching estimate before selecting any row/column data. -/147theorem card_agreementMatching_le_sharp (hp : 0 < p) (x y : Fin p → E)148    (S : Finset (Fin p)) :149    Fintype.card (AgreementMatching x y S) ≤150      p^(S.card+highMultiplicityOccurrences (List.ofFn x ++ List.ofFn y)/2) := by151  classical152  calc153    _ = ∑ t : S → Fin p, Fintype.card (RestrictionFiber x y S t) := by154      rw [← Fintype.card_sigma]155      exact (Fintype.card_congr (Equiv.sigmaFiberEquiv (restriction x y S))).symm156    _ ≤ ∑ _t : S → Fin p,157        p^(highMultiplicityOccurrences (List.ofFn x ++ List.ofFn y)/2) :=158      Finset.sum_le_sum (fun t _ => card_restrictionFiber_le hp x y S t)159    _ = p^S.card * p^(highMultiplicityOccurrences (List.ofFn x ++ List.ofFn y)/2) := by160      simp161    _ = _ := (pow_add _ _ _).symm162163/-- The actual fixed-relative Haar matching bound, with the fourth-and-higher164multiplicity statistic from the literal entry list. -/165theorem card_relativeMatching_le_sharp {R C : Type*}166    [Fintype R] [Fintype C] [DecidableEq R] [DecidableEq C]167    (hp : 0 < p) (i k : Fin p → R) (j l : Fin p → C) (α : Equiv.Perm (Fin p)) :168    Fintype.card (RelativeMatching i k j l α) ≤ p^(α.support.card+169      highMultiplicityOccurrences (List.ofFn (fun a => (i a,j a)) ++170        List.ofFn (fun a => (k a,l a)))/2) := by171  classical172  let f : RelativeMatching i k j l α →173      AgreementMatching (fun a => (i a,j a)) (fun a => (k a,l a)) α.support := fun σ =>174    ⟨σ.val,by175      intro a ha176      have hα : α a=a := by simpa only [Equiv.Perm.mem_support,not_not] using ha177      apply Prod.ext178      · exact congrFun σ.property.1 a179      · simpa only [Function.comp_apply,Equiv.Perm.mul_apply,hα] using congrFun σ.property.2 a⟩180  have hf : Function.Injective f := by181    intro σ τ h182    apply Subtype.ext183    exact congrArg (fun z : AgreementMatching (fun a => (i a,j a))184      (fun a => (k a,l a)) α.support => z.val) h185  exact (Fintype.card_le_of_injective f hf).trans (card_agreementMatching_le_sharp hp _ _ α.support)186187end Nonadditivity.HaarMatchingSharp