Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarPathLocalPhase

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

Direct imports

Imported by project modules

2 direct reverse imports

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

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

16 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathWeights78/-! # Row and column phase balance for literal Haar entry lists -/9noncomputable section10attribute [local instance 2000] instBEqOfDecidableEq11set_option backward.isDefEq.respectTransparency false12set_option maxHeartbeats 100000013namespace Nonadditivity.HaarPathLocalPhase14open MeasureTheory HaarModel HaarFourthMoments HaarInvariantTensor HaarMixedMoments HaarPathWeights15open scoped BigOperators Matrix Matrix.Norms.L2Operator16variable {N : ℕ}1718@[simp] theorem mul_rowPhase_entry (i r s : Fin (N+1)) (z : ℂ)19    (hz : star z*z=1) (U : LocalUnitary N) :20    ((U * rowPhase i z hz : LocalUnitary N) : Mat N) r s =21      (if s=i then z else 1) * (U : Mat N) r s := by22  change ((U : Mat N) * Matrix.diagonal (fun a : Fin (N+1) => if a=i then z else 1)) r s = _23  simp [Matrix.mul_diagonal,mul_comm]2425theorem integral_eq_zero_of_column_phase (f : LocalUnitary N → ℂ)26    (i : Fin (N+1)) (p q : ℕ) (hpq : p ≠ q)27    (hf : ∀ z : ℂ, ∀ hz : star z*z=1, ∀ U : LocalUnitary N,28      f (U * rowPhase i z hz) = (z^p * (star z)^q) * f U) :29    (∫ U, f U ∂haar N) = 0 := by30  let m := p+q+131  have hm : m ≠ 0 := by dsimp [m]; omega32  let z := Complex.exp (2 * Real.pi * Complex.I / m)33  have hzprim : IsPrimitiveRoot z m := Complex.isPrimitiveRoot_exp m hm34  have hznorm : ‖z‖ = 1 := hzprim.norm'_eq_one hm35  have hz : star z*z=1 := by36    rw [Complex.star_def, ← Complex.normSq_eq_conj_mul_self,37      Complex.normSq_eq_norm_sq, hznorm]38    norm_num39  have hne : z^p ≠ z^q := fun h => hpq (hzprim.pow_inj (by dsimp [m]; omega)40    (by dsimp [m]; omega) h)41  have h := integral_mul_right_eq_self (μ := haar N) f (rowPhase i z hz)42  simp_rw [hf, integral_const_mul] at h43  have hzq : (star z)^q * z^q = 1 := by rw [← mul_pow, hz, one_pow]44  have he : z^p * (∫ U, f U ∂haar N) = z^q * (∫ U, f U ∂haar N) := by45    calc46      _ = z^p * (((star z)^q * z^q) * (∫ U, f U ∂haar N)) := by rw [hzq, one_mul]47      _ = z^q * ((z^p * (star z)^q) * (∫ U, f U ∂haar N)) := by ring48      _ = _ := by rw [h]49  exact (mul_eq_mul_right_iff.mp he).resolve_left hne505152lemma entryMonomial_column_phase {p q : ℕ}53    (i j : Tuple N p) (k l : Tuple N q)54    (r : Fin (N+1)) (z : ℂ) (hz : star z*z=1) (U : LocalUnitary N) :55    entryMonomial i j k l (U * rowPhase r z hz) =56      (z^(multiplicity j r) * (star z)^(multiplicity l r)) * entryMonomial i j k l U := by57  simp only [entryMonomial, mul_rowPhase_entry, star_mul, apply_ite star, star_one,58    Finset.prod_mul_distrib, prod_row_phase]59  ring6061theorem integral_entryMonomial_eq_zero_of_column_mismatch {p q : ℕ}62    (i j : Tuple N p) (k l : Tuple N q) (r : Fin (N+1))63    (hr : multiplicity j r ≠ multiplicity l r) :64    (∫ U : LocalUnitary N, entryMonomial i j k l U ∂haar N)=0 :=65  integral_eq_zero_of_column_phase _ r _ _ hr (entryMonomial_column_phase i j k l r)6667def rowCount (L : List (Entry N)) (r : Fin (N+1)) := (L.map Prod.fst).count r68def columnCount (L : List (Entry N)) (r : Fin (N+1)) := (L.map Prod.snd).count r6970lemma rowCount_eq_multiplicity (L : List (Entry N)) (r : Fin (N+1)) :71    rowCount L r = multiplicity (fun a => (L.get a).1) r := by72  have h := HaarMatchingCount.count_ofFn_eq_card (fun a => (L.get a).1) r73  simpa only [rowCount, List.ofFn_comp', List.ofFn_get,74    HaarMixedMoments.multiplicity] using h7576lemma columnCount_eq_multiplicity (L : List (Entry N)) (r : Fin (N+1)) :77    columnCount L r = multiplicity (fun a => (L.get a).2) r := by78  have h := HaarMatchingCount.count_ofFn_eq_card (fun a => (L.get a).2) r79  simpa only [columnCount, List.ofFn_comp', List.ofFn_get,80    HaarMixedMoments.multiplicity] using h8182/-- Nonzero Haar monomials have identical row and column multiplicities in83the positive and negative lists, with no restriction on their degrees. -/84theorem counts_eq_of_integral_ne_zero (L R : List (Entry N))85    (h : (∫ U : LocalUnitary N, listMonomial L R U ∂haar N) ≠ 0) (r : Fin (N+1)) :86    rowCount L r=rowCount R r ∧ columnCount L r=columnCount R r := by87  simp_rw [listMonomial_eq_entryMonomial] at h88  constructor89  · by_contra hn90    rw [rowCount_eq_multiplicity, rowCount_eq_multiplicity] at hn91    exact h (HaarMixedMoments.integral_entryMonomial_eq_zero_of_row_mismatch _ _ _ _ r hn)92  · by_contra hn93    rw [columnCount_eq_multiplicity, columnCount_eq_multiplicity] at hn94    exact h (integral_entryMonomial_eq_zero_of_column_mismatch _ _ _ _ r hn)9596lemma selected_rowCount_ofFn {m : ℕ} (f : Fin m → SignedEntry N)97    (c : HaarPathProfiles.Color 2) (v : Fin (N+1)) :98    rowCount (selected c (List.ofFn f)) v =99      (Finset.univ.filter (fun i => (f i).1=c ∧ (f i).2.1=v)).card := by100  have h : rowCount (selected c (List.ofFn f)) v =101      ∑ i, if (f i).1=c ∧ (f i).2.1=v then 1 else 0 := by102    induction m with103    | zero => simp [rowCount,selected]104    | succ m ih =>105      rw [List.ofFn_succ,Fin.sum_univ_succ]106      simp only [rowCount,selected,List.filter_cons] at ih ⊢107      by_cases hc : (f 0).1=c <;> by_cases hv : (f 0).2.1=v <;>108        simp_all [Nat.add_comm]109  simpa using h110111lemma selected_columnCount_ofFn {m : ℕ} (f : Fin m → SignedEntry N)112    (c : HaarPathProfiles.Color 2) (v : Fin (N+1)) :113    columnCount (selected c (List.ofFn f)) v =114      (Finset.univ.filter (fun i => (f i).1=c ∧ (f i).2.2=v)).card := by115  have h : columnCount (selected c (List.ofFn f)) v =116      ∑ i, if (f i).1=c ∧ (f i).2.2=v then 1 else 0 := by117    induction m with118    | zero => simp [columnCount,selected]119    | succ m ih =>120      rw [List.ofFn_succ,Fin.sum_univ_succ]121      simp only [columnCount,selected,List.filter_cons] at ih ⊢122      by_cases hc : (f 0).1=c <;> by_cases hv : (f 0).2.2=v <;>123        simp_all [Nat.add_comm]124  simpa using h125126end Nonadditivity.HaarPathLocalPhase