Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathWeights

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

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

50 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPairEntryBound7import Nonadditivity.HaarPathGraph8import Nonadditivity.HaarWordPhase910/-! # Actual two-generator path weights1112A literal path contributes a product of ordinary and conjugated Haar entries.13This file connects those products to the proved Weingarten entry estimate.14-/15noncomputable section16attribute [local instance 2000] instBEqOfDecidableEq17set_option backward.isDefEq.respectTransparency false18set_option maxHeartbeats 120000019namespace Nonadditivity.HaarPathWeights20open MeasureTheory HaarModel HaarInvariantTensor HaarPathMultiplicity HaarFourthMoments21open scoped BigOperators Matrix Matrix.Norms.L2Operator2223abbrev Entry (N : ℕ) := Fin (N+1) × Fin (N+1)24abbrev SignedEntry (N : ℕ) := (Fin 2 × Bool) × Entry N2526def selected {N : ℕ} (c : Fin 2 × Bool) (L : List (SignedEntry N)) : List (Entry N) :=27  (L.filter (fun e => e.1=c)).map Prod.snd2829def entryProduct {N : ℕ} (L : List (Entry N)) (U : LocalUnitary N) : ℂ :=30  (L.map (fun e => (U : Mat N) e.1 e.2)).prod3132def listMonomial {N : ℕ} (L R : List (Entry N)) (U : LocalUnitary N) : ℂ :=33  entryProduct L U * star (entryProduct R U)3435def signedProduct {N : ℕ} (L : List (SignedEntry N)) (U : LocalUnitary N × LocalUnitary N) : ℂ :=36  (L.map (fun e => if e.1.2 then37    ((if e.1.1=0 then U.1 else U.2) : Mat N) e.2.1 e.2.2 else38    star (((if e.1.1=0 then U.1 else U.2) : Mat N) e.2.1 e.2.2))).prod3940/-- Sorting entries by their generator and sign does not change the scalar41product associated with the original ordered path. -/42theorem signedProduct_eq {N : ℕ} (L : List (SignedEntry N))43    (U : LocalUnitary N × LocalUnitary N) :44    signedProduct L U =45      listMonomial (selected (0,true) L) (selected (0,false) L) U.1 *46      listMonomial (selected (1,true) L) (selected (1,false) L) U.2 := by47  induction L with48  | nil => simp [signedProduct, listMonomial, selected, entryProduct]49  | cons e L ih =>50    obtain ⟨⟨a,b⟩,x⟩ := e51    fin_cases a <;> cases b <;>52      simp [signedProduct, listMonomial, selected, entryProduct,53        star_mul] at ih ⊢ <;> rw [ih] <;> ring5455/-- List and tuple presentations are definitionally the same Haar monomial56up to the standard finite-product enumeration. -/57theorem listMonomial_eq_entryMonomial {N : ℕ} (L R : List (Entry N))58    (U : LocalUnitary N) :59    listMonomial L R U = HaarMixedMoments.entryMonomial60      (fun a => (L.get a).1) (fun a => (L.get a).2)61      (fun a => (R.get a).1) (fun a => (R.get a).2) U := by62  simp only [listMonomial, entryProduct, HaarMixedMoments.entryMonomial]63  have hp (S : List (Entry N)) (f : Entry N → ℂ) :64      (S.map f).prod = ∏ a : Fin S.length, f (S.get a) := by65    rw [← List.prod_ofFn, List.ofFn_comp', List.ofFn_get]66  rw [hp L, hp R]67  simp only [star_prod]6869/-- A Haar monomial with unequal total positive and negative degrees vanishes. -/70theorem integral_entryMonomial_eq_zero_of_degree_ne {N p q : ℕ}71    (i j : Tuple N p) (k l : Tuple N q) (hpq : p ≠ q) :72    (∫ U : LocalUnitary N, HaarMixedMoments.entryMonomial i j k l U ∂haar N)=0 := by73  have hsum (x : Fin p → Fin (N+1)) :74      (∑ r, HaarMixedMoments.multiplicity x r)=p := by75    have h := Finset.card_eq_sum_card_fiberwise (s := Finset.univ)76      (t := Finset.univ) (f := x) (fun _ _ => Finset.mem_univ _)77    simpa [HaarMixedMoments.multiplicity] using h.symm78  have hsumq (x : Fin q → Fin (N+1)) :79      (∑ r, HaarMixedMoments.multiplicity x r)=q := by80    have h := Finset.card_eq_sum_card_fiberwise (s := Finset.univ)81      (t := Finset.univ) (f := x) (fun _ _ => Finset.mem_univ _)82    simpa [HaarMixedMoments.multiplicity] using h.symm83  have hex : ∃ r, HaarMixedMoments.multiplicity i r ≠ HaarMixedMoments.multiplicity k r := by84    by_contra! h85    exact hpq ((hsum i).symm.trans ((Finset.sum_congr rfl (fun r _ => h r)).trans (hsumq k)))86  obtain ⟨r,hr⟩ := hex87  exact HaarMixedMoments.integral_entryMonomial_eq_zero_of_row_mismatch i j k l r hr8889/-- Exact zero for an unbalanced literal entry list. -/90theorem integral_listMonomial_eq_zero_of_length_ne {N : ℕ} (L R : List (Entry N))91    (h : L.length ≠ R.length) :92    (∫ U : LocalUnitary N, listMonomial L R U ∂haar N)=0 := by93  simp_rw [listMonomial_eq_entryMonomial]94  exact integral_entryMonomial_eq_zero_of_degree_ne _ _ _ _ h9596/-- The established entry bound in a literal-list presentation. -/97theorem norm_listMonomial_integral_le {N P : ℕ} (L R : List (Entry N))98    (hbal : L.length=R.length) (hP : L.length ≤ P)99    (hN : 16*(P:ℝ)^4 ≤ N+1) :100    ‖∫ U : LocalUnitary N, listMonomial L R U ∂haar N‖ ≤101      (2/(N+1:ℝ)^L.length) * (P:ℝ)^(highMultiplicityOccurrences (L++R)/2) *102        (2*(P:ℝ)/Real.sqrt (Real.sqrt (N+1)))^(singletonEdges (L++R)).card := by103  induction L using List.ofFnRec with104  | h p f =>105    induction R using List.ofFnRec with106    | h q g =>107      simp only [List.length_ofFn] at hbal hP ⊢108      subst q109      have h := norm_entry_moment_le_uniform hP hN110        (fun a => (f a).1) (fun a => (f a).2)111        (fun a => (g a).1) (fun a => (g a).2)112      simpa only [listMonomial, entryProduct, List.map_ofFn, List.prod_ofFn,113        star_prod, HaarMixedMoments.entryMonomial, entryList, Function.comp_apply,114        Prod.mk.eta] using h115116/-- The actual path integral vanishes if either generator has unequal numbers117of ordinary and conjugated entries. -/118theorem integral_signedProduct_eq_zero_of_unbalanced {N : ℕ}119    (L : List (SignedEntry N)) (a : Fin 2)120    (h : (selected (a,true) L).length ≠ (selected (a,false) L).length) :121    (∫ U : LocalUnitary N × LocalUnitary N, signedProduct L U ∂(haar N).prod (haar N))=0 := by122  simp_rw [signedProduct_eq]123  rw [integral_prod_mul]124  fin_cases a125  · change (selected (0,true) L).length ≠ (selected (0,false) L).length at h126    rw [integral_listMonomial_eq_zero_of_length_ne _ _ h, zero_mul]127  · change (selected (1,true) L).length ≠ (selected (1,false) L).length at h128    rw [integral_listMonomial_eq_zero_of_length_ne _ _ h, mul_zero]129130def familyList {N : ℕ} (a : Fin 2) (L : List (SignedEntry N)) : List (Entry N) :=131  selected (a,true) L ++ selected (a,false) L132133def edgeList {N : ℕ} (L : List (SignedEntry N)) : List (HaarPathGraph.Edge (Fin (N+1)) 2) :=134  L.map (fun e => (e.2.1,e.1.1,e.2.2))135136/-- The unsigned colored edge multiplicity is exactly its positive plus137negative entry multiplicity in the corresponding Haar family. -/138theorem count_edgeList {N : ℕ} (L : List (SignedEntry N))139    (x y : Fin (N+1)) (a : Fin 2) :140    (edgeList L).count (x,a,y) = (familyList a L).count (x,y) := by141  simp only [familyList, List.count_append]142  induction L with143  | nil => simp [edgeList, selected]144  | cons e L ih =>145    obtain ⟨⟨b,c⟩,u,v⟩ := e146    cases c <;> by_cases hba : b=a <;> by_cases hx : u=x <;> by_cases hy : v=y <;>147      simp_all [edgeList, selected] <;> omega148149/-- Singleton counting can equivalently be performed over the full finite150edge alphabet; absent edges make zero contribution. -/151theorem singleton_card_eq_sum {E : Type*} [Fintype E] [DecidableEq E] (L : List E) :152    (singletonEdges L).card = ∑ e : E, if L.count e=1 then 1 else 0 := by153  rw [singletonEdges, Finset.card_filter]154  apply Finset.sum_subset (Finset.subset_univ _)155  intro e _ he156  have hz : L.count e=0 := List.count_eq_zero.mpr157    (fun h => he (List.mem_toFinset.mpr h))158  simp [hz]159160/-- Different Haar families have disjoint colored edges. -/161theorem singleton_card_edgeList {N : ℕ} (L : List (SignedEntry N)) :162    (singletonEdges (edgeList L)).card =163      (singletonEdges (familyList 0 L)).card + (singletonEdges (familyList 1 L)).card := by164  simp only [singleton_card_eq_sum, Fintype.sum_prod_type,165    Fin.sum_univ_two, Finset.sum_add_distrib]166  simp_rw [count_edgeList (N := N) L]167168/-- Fourth-and-higher multiplicities split exactly across independent colors. -/169theorem highMultiplicity_edgeList {N : ℕ} (L : List (SignedEntry N)) :170    highMultiplicityOccurrences (edgeList L) =171      highMultiplicityOccurrences (familyList 0 L) +172        highMultiplicityOccurrences (familyList 1 L) := by173  simp only [← HaarMatchingSharp.sum_high_multiplicity, Fintype.sum_prod_type,174    Fin.sum_univ_two, Finset.sum_add_distrib]175  simp_rw [count_edgeList (N := N) L]176177/-- Splitting a literal word into the four signed colors preserves its length. -/178theorem selected_lengths {N : ℕ} (L : List (SignedEntry N)) :179    (selected (0,true) L).length + (selected (0,false) L).length +180      (selected (1,true) L).length + (selected (1,false) L).length = L.length := by181  induction L with182  | nil => simp [selected]183  | cons e L ih =>184    obtain ⟨⟨a,b⟩,x⟩ := e185    fin_cases a <;> cases b <;>186      simp [selected] at ih ⊢ <;> omega187188/-- A singleton-sensitive estimate for the actual product of entries in an189arbitrarily ordered balanced word; no matching enumeration is assumed. -/190theorem norm_signedProduct_integral_le {N P : ℕ} (L : List (SignedEntry N))191    (hP : 1 ≤ P) (hbal : ∀ a : Fin 2,192      (selected (a,true) L).length=(selected (a,false) L).length)193    (hlen : L.length ≤ 2*P) (hN : 16*(P:ℝ)^4 ≤ N+1) :194    ‖∫ U : LocalUnitary N × LocalUnitary N, signedProduct L U ∂(haar N).prod (haar N)‖ ≤195      (4/(N+1:ℝ)^(L.length/2)) * (P:ℝ)^(highMultiplicityOccurrences (edgeList L)/2) *196        (2*(P:ℝ)/Real.sqrt (Real.sqrt (N+1)))^(singletonEdges (edgeList L)).card := by197  have hs := selected_lengths L198  have hb0 := hbal 0199  have hb1 := hbal 1200  have h0P : (selected (0,true) L).length ≤ P := by omega201  have h1P : (selected (1,true) L).length ≤ P := by omega202  have hdeg : (selected (0,true) L).length + (selected (1,true) L).length=L.length/2 := by omega203  have h0 := norm_listMonomial_integral_le _ _ hb0 h0P hN204  have h1 := norm_listMonomial_integral_le _ _ hb1 h1P hN205  simp_rw [signedProduct_eq]206  rw [integral_prod_mul, norm_mul]207  apply (mul_le_mul h0 h1 (norm_nonneg _) (by positivity)).trans208  have heq :209      (2/(N+1:ℝ)^(selected (0,true) L).length *210        (P:ℝ)^(highMultiplicityOccurrences (familyList 0 L)/2) *211        (2*(P:ℝ)/Real.sqrt (Real.sqrt (N+1)))^(singletonEdges (familyList 0 L)).card) *212      (2/(N+1:ℝ)^(selected (1,true) L).length *213        (P:ℝ)^(highMultiplicityOccurrences (familyList 1 L)/2) *214        (2*(P:ℝ)/Real.sqrt (Real.sqrt (N+1)))^(singletonEdges (familyList 1 L)).card) =215      (4/(N+1:ℝ)^(L.length/2)) *216        (P:ℝ)^(highMultiplicityOccurrences (familyList 0 L)/2+217          highMultiplicityOccurrences (familyList 1 L)/2) *218        (2*(P:ℝ)/Real.sqrt (Real.sqrt (N+1)))^(singletonEdges (edgeList L)).card := by219    rw [singleton_card_edgeList, ←hdeg]220    simp only [pow_add, div_eq_mul_inv, mul_inv_rev]221    ring222  simp only [familyList] at heq223  rw [heq]224  apply mul_le_mul_of_nonneg_right _ (by positivity)225  apply mul_le_mul_of_nonneg_left _ (by positivity)226  apply pow_le_pow_right₀ (by exact_mod_cast hP)227  rw [highMultiplicity_edgeList]228  simp only [familyList]229  omega230231/-- The oriented entries of a literal path, with negative letters represented232by conjugated entries in the reverse direction. -/233def pathEntries {N m : ℕ} (P : HaarPathGraph.Path (Fin (N+1)) 2 m) : List (SignedEntry N) :=234  List.ofFn fun i => (P.colors i, if (P.colors i).2 then235    (P.vertex i.castSucc,P.vertex i.succ) else (P.vertex i.succ,P.vertex i.castSucc))236237def pathProduct {N m : ℕ} (P : HaarPathGraph.Path (Fin (N+1)) 2 m)238    (U : LocalUnitary N × LocalUnitary N) : ℂ :=239  ∏ i : Fin m, (if (P.colors i).2 then240    ((if (P.colors i).1=0 then U.1 else U.2) : Mat N) else241    ((if (P.colors i).1=0 then U.1 else U.2) : Mat N)ᴴ)242      (P.vertex i.castSucc) (P.vertex i.succ)243244@[simp] theorem pathEntries_length {N m : ℕ} (P : HaarPathGraph.Path (Fin (N+1)) 2 m) :245    (pathEntries P).length=m := by simp [pathEntries]246247/-- The edge list used by the graph defect is the literal entry list used by248Weingarten integration; loops and parallel colors retain their multiplicities. -/249@[simp] theorem edgeList_pathEntries {N m : ℕ} (P : HaarPathGraph.Path (Fin (N+1)) 2 m) :250    edgeList (pathEntries P)=P.edgeList := by251  simp only [edgeList, pathEntries, List.map_ofFn, HaarPathGraph.Path.edgeList]252  congr 1253  funext i254  cases hb : (P.colors i).2 <;> simp [HaarPathGraph.edge, hb]255256/-- The matrix-entry product of the path is exactly the signed scalar product. -/257theorem pathProduct_eq {N m : ℕ} (P : HaarPathGraph.Path (Fin (N+1)) 2 m)258    (U : LocalUnitary N × LocalUnitary N) :259    pathProduct P U=signedProduct (pathEntries P) U := by260  simp only [pathProduct, signedProduct, pathEntries, List.map_ofFn, List.prod_ofFn]261  apply Finset.prod_congr rfl262  intro i _263  cases hb : (P.colors i).2 <;> simp [hb, Matrix.conjTranspose_apply]264265/-- The probabilistic BC path weight estimate for the actual pair of independent266Haar matrices. The graph defect and singleton count are computed from `P`.267The prefactor `4` improves the published `25/4`; no probabilistic input remains. -/268theorem norm_pathProduct_integral_le {N m : ℕ}269    (P : HaarPathGraph.Path (Fin (N+1)) 2 m) (hm : 0 < m)270    (hN : 16*((m/2:ℕ):ℝ)^4 ≤ N+1) :271    ‖∫ U : LocalUnitary N × LocalUnitary N, pathProduct P U ∂(haar N).prod (haar N)‖ ≤272      (4/(N+1:ℝ)^(m/2)) * (m:ℝ)^P.defectTwice *273        ((m:ℝ)/Real.sqrt (Real.sqrt (N+1)))^(singletonEdges P.edgeList).card := by274  by_cases hbal : ∀ a : Fin 2,275      (selected (a,true) (pathEntries P)).length=(selected (a,false) (pathEntries P)).length276  · have hs := selected_lengths (pathEntries P)277    have hb0 := hbal 0278    have hb1 := hbal 1279    rw [pathEntries_length] at hs280    have hhalf : 1 ≤ m/2 := by omega281    have hlen : (pathEntries P).length ≤ 2*(m/2) := by rw [pathEntries_length]; omega282    have h := norm_signedProduct_integral_le (pathEntries P) hhalf hbal hlen hN283    simp only [pathEntries_length, edgeList_pathEntries] at h284    simp_rw [pathProduct_eq]285    apply h.trans286    apply mul_le_mul287    · apply mul_le_mul_of_nonneg_left _ (by positivity)288      have hhigh := P.highMultiplicityOccurrences_le_twice_defect289      calc290        ((m/2:ℕ):ℝ)^(highMultiplicityOccurrences P.edgeList/2) ≤291            (m:ℝ)^(highMultiplicityOccurrences P.edgeList/2) := by292          gcongr293          exact_mod_cast (Nat.div_le_self m 2)294        _ ≤ (m:ℝ)^P.defectTwice := by295          apply pow_le_pow_right₀ (by exact_mod_cast hm)296          omega297    · apply pow_le_pow_left₀ (by positivity)298      apply div_le_div_of_nonneg_right _ (by positivity)299      exact_mod_cast (by omega : 2*(m/2) ≤ m)300    · positivity301    · positivity302  · push_neg at hbal303    obtain ⟨a,ha⟩ := hbal304    simp_rw [pathProduct_eq]305    rw [integral_signedProduct_eq_zero_of_unbalanced _ a ha, norm_zero]306    positivity307308end Nonadditivity.HaarPathWeights