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
Nonadditivity.HaarPathLocalPhase.columnCountNonadditivity.HaarPathLocalPhase.columnCount.eq_1internal/detail/privateNonadditivity.HaarPathLocalPhase.columnCount_eq_multiplicityNonadditivity.HaarPathLocalPhase.counts_eq_of_integral_ne_zeroNonadditivity.HaarPathLocalPhase.entryMonomial_column_phaseNonadditivity.HaarPathLocalPhase.integral_entryMonomial_eq_zero_of_column_mismatchNonadditivity.HaarPathLocalPhase.integral_eq_zero_of_column_phaseNonadditivity.HaarPathLocalPhase.integral_eq_zero_of_column_phase._proof_1_1internal/detail/privateNonadditivity.HaarPathLocalPhase.integral_eq_zero_of_column_phase._proof_1_2internal/detail/privateNonadditivity.HaarPathLocalPhase.integral_eq_zero_of_column_phase._proof_1_3internal/detail/privateNonadditivity.HaarPathLocalPhase.mul_rowPhase_entryNonadditivity.HaarPathLocalPhase.rowCountNonadditivity.HaarPathLocalPhase.rowCount.eq_1internal/detail/privateNonadditivity.HaarPathLocalPhase.rowCount_eq_multiplicityNonadditivity.HaarPathLocalPhase.selected_columnCount_ofFnNonadditivity.HaarPathLocalPhase.selected_rowCount_ofFn
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 := by22change ((U : Mat N) * Matrix.diagonal (fun a : Fin (N+1) => if a=i then z else 1)) r s = _23simp [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,28f (U * rowPhase i z hz) = (z^p * (star z)^q) * f U) :29(∫ U, f U ∂haar N) = 0 := by30let m := p+q+131have hm : m ≠ 0 := by dsimp [m]; omega32let z := Complex.exp (2 * Real.pi * Complex.I / m)33have hzprim : IsPrimitiveRoot z m := Complex.isPrimitiveRoot_exp m hm34have hznorm : ‖z‖ = 1 := hzprim.norm'_eq_one hm35have hz : star z*z=1 := by36rw [Complex.star_def, ← Complex.normSq_eq_conj_mul_self,37Complex.normSq_eq_norm_sq, hznorm]38norm_num39have hne : z^p ≠ z^q := fun h => hpq (hzprim.pow_inj (by dsimp [m]; omega)40(by dsimp [m]; omega) h)41have h := integral_mul_right_eq_self (μ := haar N) f (rowPhase i z hz)42simp_rw [hf, integral_const_mul] at h43have hzq : (star z)^q * z^q = 1 := by rw [← mul_pow, hz, one_pow]44have he : z^p * (∫ U, f U ∂haar N) = z^q * (∫ U, f U ∂haar N) := by45calc46_ = 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]49exact (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) :55entryMonomial 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 := by57simp only [entryMonomial, mul_rowPhase_entry, star_mul, apply_ite star, star_one,58Finset.prod_mul_distrib, prod_row_phase]59ring6061theorem 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 :=65integral_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)) :71rowCount L r = multiplicity (fun a => (L.get a).1) r := by72have h := HaarMatchingCount.count_ofFn_eq_card (fun a => (L.get a).1) r73simpa only [rowCount, List.ofFn_comp', List.ofFn_get,74HaarMixedMoments.multiplicity] using h7576lemma columnCount_eq_multiplicity (L : List (Entry N)) (r : Fin (N+1)) :77columnCount L r = multiplicity (fun a => (L.get a).2) r := by78have h := HaarMatchingCount.count_ofFn_eq_card (fun a => (L.get a).2) r79simpa only [columnCount, List.ofFn_comp', List.ofFn_get,80HaarMixedMoments.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)) :86rowCount L r=rowCount R r ∧ columnCount L r=columnCount R r := by87simp_rw [listMonomial_eq_entryMonomial] at h88constructor89· by_contra hn90rw [rowCount_eq_multiplicity, rowCount_eq_multiplicity] at hn91exact h (HaarMixedMoments.integral_entryMonomial_eq_zero_of_row_mismatch _ _ _ _ r hn)92· by_contra hn93rw [columnCount_eq_multiplicity, columnCount_eq_multiplicity] at hn94exact 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)) :98rowCount (selected c (List.ofFn f)) v =99(Finset.univ.filter (fun i => (f i).1=c ∧ (f i).2.1=v)).card := by100have h : rowCount (selected c (List.ofFn f)) v =101∑ i, if (f i).1=c ∧ (f i).2.1=v then 1 else 0 := by102induction m with103| zero => simp [rowCount,selected]104| succ m ih =>105rw [List.ofFn_succ,Fin.sum_univ_succ]106simp only [rowCount,selected,List.filter_cons] at ih ⊢107by_cases hc : (f 0).1=c <;> by_cases hv : (f 0).2.1=v <;>108simp_all [Nat.add_comm]109simpa using h110111lemma selected_columnCount_ofFn {m : ℕ} (f : Fin m → SignedEntry N)112(c : HaarPathProfiles.Color 2) (v : Fin (N+1)) :113columnCount (selected c (List.ofFn f)) v =114(Finset.univ.filter (fun i => (f i).1=c ∧ (f i).2.2=v)).card := by115have h : columnCount (selected c (List.ofFn f)) v =116∑ i, if (f i).1=c ∧ (f i).2.2=v then 1 else 0 := by117induction m with118| zero => simp [columnCount,selected]119| succ m ih =>120rw [List.ofFn_succ,Fin.sum_univ_succ]121simp only [columnCount,selected,List.filter_cons] at ih ⊢122by_cases hc : (f 0).1=c <;> by_cases hv : (f 0).2.2=v <;>123simp_all [Nat.add_comm]124simpa using h125126end Nonadditivity.HaarPathLocalPhase