Exact Lean source
Nonadditivity.HaarWordPhase
Download original .lean · View on GitHub · Jump to source
Direct imports
Nonadditivity.HaarMixedMomentsMathlib.GroupTheory.FreeGroup.Reducedependency
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
Nonadditivity.HaarWordPhase.continuous_normalizedWordTraceNonadditivity.HaarWordPhase.continuous_wordEvalNonadditivity.HaarWordPhase.coordinatePhaseNonadditivity.HaarWordPhase.coordinatePhase.congr_simpNonadditivity.HaarWordPhase.coordinatePhase_mulNonadditivity.HaarWordPhase.eval_consNonadditivity.HaarWordPhase.eval_coordinatePhase_mkNonadditivity.HaarWordPhase.even_length_of_balancedNonadditivity.HaarWordPhase.exponentSumNonadditivity.HaarWordPhase.exponentSum.eq_1internal/detail/privateNonadditivity.HaarWordPhase.instIsMulLeftInvariantForallSubtypeMatrixFinHAddNatOfNatComplexMemSubmonoidLocalUnitaryWordMeasureNonadditivity.HaarWordPhase.instIsProbabilityMeasureForallSubtypeMatrixFinHAddNatOfNatComplexMemSubmonoidLocalUnitaryWordMeasureNonadditivity.HaarWordPhase.integrable_normalizedWordTraceNonadditivity.HaarWordPhase.integral_normalizedWordTrace_eq_zero_of_exponentSum_ne_zeroNonadditivity.HaarWordPhase.integral_normalizedWordTrace_eq_zero_of_oddNonadditivity.HaarWordPhase.integral_normalizedWordTrace_eq_zero_of_odd._proof_1_3internal/detail/privateNonadditivity.HaarWordPhase.integral_normalizedWordTrace_eq_zero_of_unbalancedNonadditivity.HaarWordPhase.integral_normalizedWordTrace_eq_zero_of_unbalanced._proof_1_1internal/detail/privateNonadditivity.HaarWordPhase.integral_normalizedWordTrace_eq_zero_of_unbalanced._proof_1_2internal/detail/privateNonadditivity.HaarWordPhase.integral_normalizedWordTrace_eq_zero_of_unbalanced._proof_1_3internal/detail/privateNonadditivity.HaarWordPhase.negativeCountNonadditivity.HaarWordPhase.negativeCount.congr_simpNonadditivity.HaarWordPhase.negativeCount.eq_1internal/detail/privateNonadditivity.HaarWordPhase.normalizedWordTraceNonadditivity.HaarWordPhase.normalizedWordTrace_coordinatePhaseNonadditivity.HaarWordPhase.positiveCountNonadditivity.HaarWordPhase.positiveCount.congr_simpNonadditivity.HaarWordPhase.positiveCount.eq_1internal/detail/privateNonadditivity.HaarWordPhase.scalarPhaseNonadditivity.HaarWordPhase.scalarPhase._proof_1internal/detail/privateNonadditivity.HaarWordPhase.scalarPhase.congr_simpNonadditivity.HaarWordPhase.scalarPhase_mulNonadditivity.HaarWordPhase.sum_countsNonadditivity.HaarWordPhase.wordMeasure
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 : ℕ) :25Measure (α → LocalUnitary N) := Measure.pi (fun _ => haar N)2627instance : IsProbabilityMeasure (wordMeasure α N) := by28unfold wordMeasure29infer_instance3031instance : (wordMeasure α N).IsMulLeftInvariant := by32unfold wordMeasure33infer_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), by38change (starRingEnd ℂ) z*z=1 at hz39rw [Unitary.mem_iff]40constructor <;>41simp only [Matrix.star_eq_conjTranspose, Matrix.diagonal_conjTranspose,42Matrix.diagonal_mul_diagonal] <;>43ext 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) := by47ext r s48change (Matrix.diagonal (fun _ : Fin (N+1) => z) * (U : Mat N)) r s = _49simp [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 :=53fun 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) := by60change (((if b=a then scalarPhase (N := N) z hz else 1) * U b : LocalUnitary N) : Mat N)=_61split_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) := by76cases 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) := by85induction l with86| nil => simp [positiveCount,negativeCount,FreeGroup.lift_mk]87| cons x l ih =>88rcases x with ⟨b,t⟩89rw [eval_cons,eval_cons,ih,coordinatePhase_mul]90cases t <;> by_cases h : b=a <;>91simp [positiveCount,negativeCount,h,92Matrix.conjTranspose_smul,smul_smul,pow_succ] <;>93congr 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) :102normalizedWordTrace w (coordinatePhase (N := N) a z hz * U) =103(z^(positiveCount a w.toWord) * (star z)^(negativeCount a w.toWord)) *104normalizedWordTrace w U := by105unfold normalizedWordTrace106have h := eval_coordinatePhase_mk a z hz U w.toWord107rw [FreeGroup.mk_toWord] at h108rw [h,Matrix.trace_smul]109simp only [smul_eq_mul]110ring111112/-- 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 := by117let p := positiveCount a w.toWord118let q := negativeCount a w.toWord119let m := p+q+1120have hm : m ≠ 0 := by dsimp [m]; omega121let z := Complex.exp (2 * Real.pi * Complex.I / m)122have hzprim : IsPrimitiveRoot z m := Complex.isPrimitiveRoot_exp m hm123have hznorm : ‖z‖=1 := hzprim.norm'_eq_one hm124have hz : star z*z=1 := by125rw [Complex.star_def,←Complex.normSq_eq_conj_mul_self,126Complex.normSq_eq_norm_sq,hznorm]127norm_num128have hne : z^p ≠ z^q := fun h => ha (hzprim.pow_inj (by dsimp [m]; omega)129(by dsimp [m]; omega) h)130have h := integral_mul_left_eq_self (μ := wordMeasure α N)131(normalizedWordTrace w) (coordinatePhase a z hz)132simp_rw [normalizedWordTrace_coordinatePhase,integral_const_mul] at h133have hzq : (star z)^q*z^q=1 := by rw [←mul_pow,hz,one_pow]134have he : z^p*(∫ U, normalizedWordTrace w U ∂wordMeasure α N)=135z^q*(∫ U, normalizedWordTrace w U ∂wordMeasure α N) := by136calc137_ = z^p*(((star z)^q*z^q)*(∫ U, normalizedWordTrace w U ∂wordMeasure α N)) := by138rw [hzq,one_mul]139_ = z^q*((z^p*(star z)^q)*(∫ U, normalizedWordTrace w U ∂wordMeasure α N)) := by ring140_ = _ := by rw [h]141exact (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 α) :146Continuous (fun U : α → LocalUnitary N => FreeGroup.lift U w) := by147have hl : ∀ l : List (α × Bool), Continuous148(fun U : α → LocalUnitary N => FreeGroup.lift U (FreeGroup.mk l)) := by149intro l150induction l with151| nil => simpa using152(continuous_const : Continuous (fun _ : α → LocalUnitary N => (1 : LocalUnitary N)))153| cons x l ih =>154simp only [FreeGroup.lift_mk,List.map_cons,List.prod_cons] at ih ⊢155apply Continuous.mul _ ih156cases hx : x.2157· exact (continuous_apply x.1).inv158· exact continuous_apply x.1159simpa 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 α) :164Continuous (normalizedWordTrace (N := N) w) := by165have hc := continuous_subtype_val.comp (continuous_wordEval (N := N) w)166apply Continuous.div_const167exact 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 α) :171Integrable (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 := by183apply integral_normalizedWordTrace_eq_zero_of_unbalanced w a184intro he185exact ha (by simp [exponentSum,he])186187lemma sum_counts (l : List (α × Bool)) :188(∑ a, (positiveCount a l + negativeCount a l))=l.length := by189have h := Multiset.sum_count_eq_card (s := Finset.univ)190(m := (l : Multiset (α × Bool))) (fun _ _ => Finset.mem_univ _)191simpa [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 := by196have hs := sum_counts l197simp_rw [← h] at hs198rw [Finset.sum_add_distrib] at hs199exact ⟨∑ 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 := by205have hex : ∃ a, positiveCount a w.toWord ≠ negativeCount a w.toWord := by206by_contra! h207obtain ⟨j,hj⟩ := even_length_of_balanced w.toWord h208obtain ⟨k,hk⟩ := hw209change w.toWord.length = 2*k+1 at hk210omega211obtain ⟨a,ha⟩ := hex212exact integral_normalizedWordTrace_eq_zero_of_unbalanced w a ha213214end Nonadditivity.HaarWordPhase