Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarWordPhase

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

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

34 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarMixedMoments7import Mathlib.GroupTheory.FreeGroup.Reduce89/-! # Phase selection for traces of arbitrary Haar words1011Independent scalar phases annihilate every word whose signed number of12occurrences of some generator is nonzero. These are actual word evaluations13and actual integrals in every finite dimension; the degree is unrestricted.14-/15noncomputable section16set_option backward.isDefEq.respectTransparency false17set_option maxHeartbeats 80000018namespace Nonadditivity.HaarWordPhase19open MeasureTheory HaarModel HaarFourthMoments20open scoped Matrix Matrix.Norms.L2Operator BigOperators21variable {α : Type*} [Fintype α] [DecidableEq α] {N : ℕ}2223/-- Independent normalized Haar matrices, one for each generator. -/24def wordMeasure (α : Type*) [Fintype α] (N : ℕ) :25    Measure (α → LocalUnitary N) := Measure.pi (fun _ => haar N)2627instance : IsProbabilityMeasure (wordMeasure α N) := by28  unfold wordMeasure29  infer_instance3031instance : (wordMeasure α N).IsMulLeftInvariant := by32  unfold wordMeasure33  infer_instance3435/-- Scalar multiplication by a complex number on the unit circle. -/36def scalarPhase (z : ℂ) (hz : star z*z=1) : LocalUnitary N :=37  ⟨Matrix.diagonal (fun _ => z), by38    change (starRingEnd ℂ) z*z=1 at hz39    rw [Unitary.mem_iff]40    constructor <;>41      simp only [Matrix.star_eq_conjTranspose, Matrix.diagonal_conjTranspose,42        Matrix.diagonal_mul_diagonal] <;>43      ext r s <;> by_cases h : r=s <;> simp [h,hz,mul_comm z,Matrix.one_apply]⟩4445@[simp] theorem scalarPhase_mul (z : ℂ) (hz : star z*z=1) (U : LocalUnitary N) :46    ((scalarPhase (N := N) z hz * U : LocalUnitary N) : Mat N) = z • (U : Mat N) := by47  ext r s48  change (Matrix.diagonal (fun _ : Fin (N+1) => z) * (U : Mat N)) r s = _49  simp [Matrix.diagonal_mul]5051/-- Change the phase of one chosen generator, leaving the others fixed. -/52def coordinatePhase (a : α) (z : ℂ) (hz : star z*z=1) : α → LocalUnitary N :=53  fun b => if b=a then scalarPhase z hz else 15455omit [Fintype α] in56@[simp] theorem coordinatePhase_mul (a b : α) (z : ℂ) (hz : star z*z=1)57    (U : α → LocalUnitary N) :58    (((coordinatePhase (N := N) a z hz * U) b : LocalUnitary N) : Mat N) =59      (if b=a then z else 1) • (U b : Mat N) := by60  change (((if b=a then scalarPhase (N := N) z hz else 1) * U b : LocalUnitary N) : Mat N)=_61  split_ifs with h62  · exact scalarPhase_mul z hz (U b)63  · simp6465/-- Positive occurrences in a literal word. -/66def positiveCount (a : α) (l : List (α × Bool)) : ℕ := l.count (a,true)67/-- Negative occurrences in a literal word. -/68def negativeCount (a : α) (l : List (α × Bool)) : ℕ := l.count (a,false)6970omit [Fintype α] [DecidableEq α] in71lemma eval_cons (U : α → LocalUnitary N) (a : α) (b : Bool)72    (l : List (α × Bool)) :73    ((FreeGroup.lift U (FreeGroup.mk ((a,b)::l)) : LocalUnitary N) : Mat N) =74      (if b then (U a : Mat N) else (U a : Mat N)ᴴ) *75        ((FreeGroup.lift U (FreeGroup.mk l) : LocalUnitary N) : Mat N) := by76  cases b <;> simp [FreeGroup.lift_mk,Matrix.star_eq_conjTranspose]7778omit [Fintype α] in79/-- Arbitrary words acquire exactly their signed phase multiplicities. -/80theorem eval_coordinatePhase_mk (a : α) (z : ℂ) (hz : star z*z=1)81    (U : α → LocalUnitary N) (l : List (α × Bool)) :82    ((FreeGroup.lift (coordinatePhase (N := N) a z hz * U) (FreeGroup.mk l) : LocalUnitary N) : Mat N) =83      (z^(positiveCount a l) * (star z)^(negativeCount a l)) •84        ((FreeGroup.lift U (FreeGroup.mk l) : LocalUnitary N) : Mat N) := by85  induction l with86  | nil => simp [positiveCount,negativeCount,FreeGroup.lift_mk]87  | cons x l ih =>88    rcases x with ⟨b,t⟩89    rw [eval_cons,eval_cons,ih,coordinatePhase_mul]90    cases t <;> by_cases h : b=a <;>91      simp [positiveCount,negativeCount,h,92        Matrix.conjTranspose_smul,smul_smul,pow_succ] <;>93      congr 1 <;> ring9495/-- Normalized trace of an actual Haar word. -/96def normalizedWordTrace (w : FreeGroup α) (U : α → LocalUnitary N) : ℂ :=97  ((FreeGroup.lift U w : LocalUnitary N) : Mat N).trace / (N+1 : ℂ)9899omit [Fintype α] in100lemma normalizedWordTrace_coordinatePhase (a : α) (z : ℂ) (hz : star z*z=1)101    (w : FreeGroup α) (U : α → LocalUnitary N) :102    normalizedWordTrace w (coordinatePhase (N := N) a z hz * U) =103      (z^(positiveCount a w.toWord) * (star z)^(negativeCount a w.toWord)) *104        normalizedWordTrace w U := by105  unfold normalizedWordTrace106  have h := eval_coordinatePhase_mk a z hz U w.toWord107  rw [FreeGroup.mk_toWord] at h108  rw [h,Matrix.trace_smul]109  simp only [smul_eq_mul]110  ring111112/-- A nonzero signed occurrence count forces the actual expected trace to vanish. -/113theorem integral_normalizedWordTrace_eq_zero_of_unbalanced114    (w : FreeGroup α) (a : α)115    (ha : positiveCount a w.toWord ≠ negativeCount a w.toWord) :116    (∫ U, normalizedWordTrace w U ∂wordMeasure α N)=0 := by117  let p := positiveCount a w.toWord118  let q := negativeCount a w.toWord119  let m := p+q+1120  have hm : m ≠ 0 := by dsimp [m]; omega121  let z := Complex.exp (2 * Real.pi * Complex.I / m)122  have hzprim : IsPrimitiveRoot z m := Complex.isPrimitiveRoot_exp m hm123  have hznorm : ‖z‖=1 := hzprim.norm'_eq_one hm124  have hz : star z*z=1 := by125    rw [Complex.star_def,←Complex.normSq_eq_conj_mul_self,126      Complex.normSq_eq_norm_sq,hznorm]127    norm_num128  have hne : z^p ≠ z^q := fun h => ha (hzprim.pow_inj (by dsimp [m]; omega)129    (by dsimp [m]; omega) h)130  have h := integral_mul_left_eq_self (μ := wordMeasure α N)131    (normalizedWordTrace w) (coordinatePhase a z hz)132  simp_rw [normalizedWordTrace_coordinatePhase,integral_const_mul] at h133  have hzq : (star z)^q*z^q=1 := by rw [←mul_pow,hz,one_pow]134  have he : z^p*(∫ U, normalizedWordTrace w U ∂wordMeasure α N)=135      z^q*(∫ U, normalizedWordTrace w U ∂wordMeasure α N) := by136    calc137      _ = z^p*(((star z)^q*z^q)*(∫ U, normalizedWordTrace w U ∂wordMeasure α N)) := by138        rw [hzq,one_mul]139      _ = z^q*((z^p*(star z)^q)*(∫ U, normalizedWordTrace w U ∂wordMeasure α N)) := by ring140      _ = _ := by rw [h]141  exact (mul_eq_mul_right_iff.mp he).resolve_left hne142143omit [Fintype α] in144/-- Evaluation of a fixed word is continuous in all its unitary arguments. -/145theorem continuous_wordEval (w : FreeGroup α) :146    Continuous (fun U : α → LocalUnitary N => FreeGroup.lift U w) := by147  have hl : ∀ l : List (α × Bool), Continuous148      (fun U : α → LocalUnitary N => FreeGroup.lift U (FreeGroup.mk l)) := by149    intro l150    induction l with151    | nil => simpa using152        (continuous_const : Continuous (fun _ : α → LocalUnitary N => (1 : LocalUnitary N)))153    | cons x l ih =>154      simp only [FreeGroup.lift_mk,List.map_cons,List.prod_cons] at ih ⊢155      apply Continuous.mul _ ih156      cases hx : x.2157      · exact (continuous_apply x.1).inv158      · exact continuous_apply x.1159  simpa only [FreeGroup.mk_toWord] using hl w.toWord160161omit [Fintype α] in162/-- Every normalized word trace is a continuous scalar random variable. -/163theorem continuous_normalizedWordTrace (w : FreeGroup α) :164    Continuous (normalizedWordTrace (N := N) w) := by165  have hc := continuous_subtype_val.comp (continuous_wordEval (N := N) w)166  apply Continuous.div_const167  exact continuous_finset_sum _ (fun i _ => hc.matrix_elem i i)168169/-- Compactness supplies the integrability used in finite word expansions. -/170theorem integrable_normalizedWordTrace (w : FreeGroup α) :171    Integrable (normalizedWordTrace w) (wordMeasure α N) :=172  (continuous_normalizedWordTrace w).integrable_of_hasCompactSupport173    (HasCompactSupport.of_compactSpace _)174175/-- Signed multiplicity of a generator in the reduced word. -/176def exponentSum (a : α) (w : FreeGroup α) : ℤ :=177  (positiveCount a w.toWord : ℤ) - (negativeCount a w.toWord : ℤ)178179/-- The Haar trace vanishes whenever a generator has nonzero exponent sum. -/180theorem integral_normalizedWordTrace_eq_zero_of_exponentSum_ne_zero181    (w : FreeGroup α) (a : α) (ha : exponentSum a w ≠ 0) :182    (∫ U, normalizedWordTrace w U ∂wordMeasure α N)=0 := by183  apply integral_normalizedWordTrace_eq_zero_of_unbalanced w a184  intro he185  exact ha (by simp [exponentSum,he])186187lemma sum_counts (l : List (α × Bool)) :188    (∑ a, (positiveCount a l + negativeCount a l))=l.length := by189  have h := Multiset.sum_count_eq_card (s := Finset.univ)190    (m := (l : Multiset (α × Bool))) (fun _ _ => Finset.mem_univ _)191  simpa [positiveCount,negativeCount,Fintype.sum_prod_type,add_comm, List.count_eq_countP, Bool.beq_eq_decide_eq] using h192193/-- A word balanced in every generator necessarily has even length. -/194lemma even_length_of_balanced (l : List (α × Bool))195    (h : ∀ a, positiveCount a l=negativeCount a l) : Even l.length := by196  have hs := sum_counts l197  simp_rw [← h] at hs198  rw [Finset.sum_add_distrib] at hs199  exact ⟨∑ a, positiveCount a l,hs.symm⟩200201/-- Odd reduced-word lengths contribute exactly zero at every matrix size. -/202theorem integral_normalizedWordTrace_eq_zero_of_odd203    (w : FreeGroup α) (hw : Odd (FreeGroup.norm w)) :204    (∫ U, normalizedWordTrace w U ∂wordMeasure α N)=0 := by205  have hex : ∃ a, positiveCount a w.toWord ≠ negativeCount a w.toWord := by206    by_contra! h207    obtain ⟨j,hj⟩ := even_length_of_balanced w.toWord h208    obtain ⟨k,hk⟩ := hw209    change w.toWord.length = 2*k+1 at hk210    omega211  obtain ⟨a,ha⟩ := hex212  exact integral_normalizedWordTrace_eq_zero_of_unbalanced w a ha213214end Nonadditivity.HaarWordPhase