Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarInvariantTensor

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

Direct imports

Imported by project modules

3 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

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

47 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarAveraging7import Nonadditivity.HaarMixedMoments8import Mathlib.Algebra.BigOperators.Ring.Finset910/-! # Permutation contraction tensors at arbitrary degree1112The contraction tensors are genuine invariant vectors of the mixed tensor13representation of the compact unitary group.  When the tensor degree does not14exceed the local dimension their Gram matrix is strictly positive and hence15invertible.  No invariant-spanning or Weingarten integration theorem is assumed.16-/1718noncomputable section19set_option backward.isDefEq.respectTransparency false20set_option maxHeartbeats 10000002122namespace Nonadditivity.HaarInvariantTensor2324open MeasureTheory HaarModel HaarAveraging25open scoped BigOperators Matrix Matrix.Norms.L2Operator ComplexOrder Kronecker2627abbrev Tuple (N p : ℕ) := Fin p → Fin (N+1)28abbrev Pair (N p : ℕ) := Tuple N p × Tuple N p29abbrev Perm (p : ℕ) := Equiv.Perm (Fin p)3031/-- The pure tensor power, indexed directly by coordinate tuples. -/32def power (p : ℕ) {N : ℕ} (A : HaarFourthMoments.Mat N) :33    Matrix (Tuple N p) (Tuple N p) ℂ := fun x y => ∏ r, A (x r) (y r)3435theorem power_mul (p : ℕ) {N : ℕ} (A B : HaarFourthMoments.Mat N) :36    power p (A*B) = power p A * power p B := by37  ext x y38  simp only [power, Matrix.mul_apply, ← Finset.prod_mul_distrib]39  exact Fintype.prod_sum (fun r k => A (x r) k * B k (y r))4041theorem power_conjTranspose (p : ℕ) {N : ℕ} (A : HaarFourthMoments.Mat N) :42    power p Aᴴ = (power p A)ᴴ := by43  ext x y44  simp [power]4546theorem power_map_star (p : ℕ) {N : ℕ} (A : HaarFourthMoments.Mat N) :47    power p (A.map (starRingEnd ℂ)) = (power p A).map (starRingEnd ℂ) := by48  ext x y49  simp [power]5051/-- The columns are the permutation contraction tensors. -/52def contractions (N p : ℕ) : Matrix (Pair N p) (Perm p) ℂ :=53  fun xy σ => if xy.1 = xy.2 ∘ σ then 1 else 05455/-- Coordinate formula for the mixed tensor representation. -/56def mixed (N p : ℕ) (U : LocalUnitary N) : Matrix (Pair N p) (Pair N p) ℂ :=57  fun xy ab => (∏ r, (U : HaarFourthMoments.Mat N) (xy.1 r) (ab.1 r)) *58    (∏ r, star ((U : HaarFourthMoments.Mat N) (xy.2 r) (ab.2 r)))5960lemma prod_delta {ι α : Type*} [Fintype ι] [DecidableEq α] (f g : ι → α) :61    (∏ a, (if f a = g a then (1:ℂ) else 0)) = if f=g then 1 else 0 := by62  classical63  by_cases h : f=g64  · subst g; simp65  · rw [if_neg h]66    obtain ⟨a, ha⟩ := Function.ne_iff.mp h67    exact Finset.prod_eq_zero (Finset.mem_univ a) (if_neg ha)6869theorem power_one (N p : ℕ) : power p (1 : HaarFourthMoments.Mat N) = 1 := by70  ext x y71  simpa only [power, Matrix.one_apply] using prod_delta x y7273theorem mixed_eq_kronecker (N p : ℕ) (U : LocalUnitary N) :74    mixed N p U = power p (U : HaarFourthMoments.Mat N) ⊗ₖ75      (power p (U : HaarFourthMoments.Mat N)).map (starRingEnd ℂ) := by76  ext xy ab77  simp [mixed, power, map_prod]7879theorem mixed_mul (N p : ℕ) (U V : LocalUnitary N) :80    mixed N p (U*V) = mixed N p U * mixed N p V := by81  simp only [mixed_eq_kronecker]82  change power p ((U : HaarFourthMoments.Mat N) * (V : HaarFourthMoments.Mat N)) ⊗ₖ83      (power p ((U : HaarFourthMoments.Mat N) * (V : HaarFourthMoments.Mat N))).map84        (starRingEnd ℂ) = _85  rw [power_mul, Matrix.map_mul, Matrix.mul_kronecker_mul]8687theorem mixed_inv (N p : ℕ) (U : LocalUnitary N) :88    mixed N p U⁻¹ = (mixed N p U)ᴴ := by89  simp only [mixed_eq_kronecker]90  change power p (U : HaarFourthMoments.Mat N)ᴴ ⊗ₖ91    (power p (U : HaarFourthMoments.Mat N)ᴴ).map (starRingEnd ℂ) = _92  rw [power_conjTranspose, Matrix.conjTranspose_kronecker]93  congr 19495theorem mixed_average_sq (N p : ℕ) :96    average (mixed N p) * average (mixed N p) = average (mixed N p) := by97  exact average_sq _ (by98    apply continuous_matrix99    intro xy ab100    exact (continuous_finset_prod _ fun r _ => HaarMoments.continuous_entry _ _).mul101      (continuous_finset_prod _ fun r _ => (HaarMoments.continuous_entry _ _).star))102    (mixed_mul N p)103104theorem mixed_average_hermitian (N p : ℕ) : (average (mixed N p)).IsHermitian :=105  average_conjTranspose _ (mixed_inv N p)106107lemma sum_row_products {N : ℕ} (U : LocalUnitary N) (i j : Fin (N+1)) :108    ∑ k, (U : HaarFourthMoments.Mat N) i k *109      star ((U : HaarFourthMoments.Mat N) j k) = if i=j then 1 else 0 := by110  have hu : (U : HaarFourthMoments.Mat N) *111      (U : HaarFourthMoments.Mat N)ᴴ = 1 :=112    (Unitary.mem_iff.mp U.property).2113  have h := congrFun (congrFun hu i) j114  simpa [Matrix.mul_apply, Matrix.star_eq_conjTranspose, Matrix.one_apply] using h115116/-- Every contraction column is fixed by every actual unitary. -/117theorem mixed_mul_contractions (N p : ℕ) (U : LocalUnitary N) :118    mixed N p U * contractions N p = contractions N p := by119  classical120  ext xy σ121  simp only [Matrix.mul_apply, mixed, contractions, Fintype.sum_prod_type,122    mul_ite, mul_one, mul_zero]123  rw [Finset.sum_comm]124  simp only [Finset.sum_ite_eq', Finset.mem_univ, if_true]125  have he (b : Tuple N p) :126      (∏ r, (U : HaarFourthMoments.Mat N) (xy.1 r) (b (σ r))) =127      ∏ r, (U : HaarFourthMoments.Mat N) (xy.1 (σ.symm r)) (b r) := by128    simpa using (Equiv.prod_comp σ (fun r =>129      (U : HaarFourthMoments.Mat N) (xy.1 (σ.symm r)) (b r)))130  simp_rw [Function.comp_apply, he, ← Finset.prod_mul_distrib]131  rw [← Fintype.prod_sum (fun r k => (U : HaarFourthMoments.Mat N)132    (xy.1 (σ.symm r)) k * star ((U : HaarFourthMoments.Mat N) (xy.2 r) k))]133  simp_rw [sum_row_products]134  rw [prod_delta]135  congr 1136  apply propext137  constructor138  · intro h139    funext r140    simpa using congrFun h (σ r)141  · intro h142    funext r143    simpa using congrFun h (σ.symm r)144145theorem continuous_mixed (N p : ℕ) : Continuous (mixed N p) := by146  apply continuous_matrix147  intro xy ab148  exact (continuous_finset_prod _ fun r _ => HaarMoments.continuous_entry _ _).mul149    (continuous_finset_prod _ fun r _ => (HaarMoments.continuous_entry _ _).star)150151/-- Haar integration really fixes the contraction tensors, at every degree. -/152theorem average_mul_contractions (N p : ℕ) :153    average (mixed N p) * contractions N p = contractions N p := by154  ext xy σ155  simp only [Matrix.mul_apply, average]156  simp_rw [← integral_mul_const]157  rw [← integral_finset_sum _ (fun ab _ =>158    (integrable_entry (continuous_mixed N p) xy ab).mul_const _)]159  change (∫ U, (mixed N p U * contractions N p) xy σ ∂haar N) = _160  simp_rw [mixed_mul_contractions]161  simp162163/-- Equal coordinate multiplicities are exactly equality up to permutation. -/164theorem exists_perm_of_multiplicity_eq {N p : ℕ} (x y : Tuple N p)165    (h : ∀ r, HaarMixedMoments.multiplicity x r = HaarMixedMoments.multiplicity y r) :166    ∃ σ : Perm p, x = y ∘ σ := by167  classical168  have hc (r : Fin (N+1)) : Fintype.card {a // x a=r} = Fintype.card {a // y a=r} := by169    simpa [Fintype.card_subtype, HaarMixedMoments.multiplicity] using h r170  let e (r : Fin (N+1)) := Fintype.equivOfCardEq (hc r)171  refine ⟨Equiv.ofFiberEquiv e, ?_⟩172  funext a173  exact (Equiv.ofFiberEquiv_map e a).symm174175/-- The coordinate realization of a matrix as a mixed tensor. -/176def vectorize {N p : ℕ} (T : Matrix (Tuple N p) (Tuple N p) ℂ) : Pair N p → ℂ :=177  fun xy => T xy.1 xy.2178179theorem mixed_mulVec_vectorize {N p : ℕ} (U : LocalUnitary N)180    (T : Matrix (Tuple N p) (Tuple N p) ℂ) :181    mixed N p U *ᵥ vectorize T = vectorize182      (power p (U : HaarFourthMoments.Mat N) * T *183        (power p (U : HaarFourthMoments.Mat N))ᴴ) := by184  funext xy185  simp only [Matrix.mulVec, dotProduct, vectorize, mixed_eq_kronecker,186    Matrix.mul_apply,187    Matrix.conjTranspose_apply, Fintype.sum_prod_type, Finset.sum_mul]188  rw [Finset.sum_comm]189  apply Finset.sum_congr rfl190  intro a _191  apply Finset.sum_congr rfl192  intro b _193  change power p (U : HaarFourthMoments.Mat N) xy.1 b *194    star (power p (U : HaarFourthMoments.Mat N) xy.2 a) * T b a = _195  ring196197theorem power_mul_star {N p : ℕ} (U : LocalUnitary N) :198    power p (U : HaarFourthMoments.Mat N) * (power p (U : HaarFourthMoments.Mat N))ᴴ = 1 := by199  rw [← power_conjTranspose, ← power_mul]200  have hu : (U : HaarFourthMoments.Mat N) * (U : HaarFourthMoments.Mat N)ᴴ = 1 :=201    (Unitary.mem_iff.mp U.property).2202  rw [hu, power_one]203204theorem power_star_mul {N p : ℕ} (U : LocalUnitary N) :205    (power p (U : HaarFourthMoments.Mat N))ᴴ * power p (U : HaarFourthMoments.Mat N) = 1 := by206  rw [← power_conjTranspose, ← power_mul]207  have hu : (U : HaarFourthMoments.Mat N)ᴴ * (U : HaarFourthMoments.Mat N) = 1 :=208    (Unitary.mem_iff.mp U.property).1209  rw [hu, power_one]210211theorem mixed_fixed_iff_commute {N p : ℕ} (U : LocalUnitary N)212    (T : Matrix (Tuple N p) (Tuple N p) ℂ) :213    mixed N p U *ᵥ vectorize T = vectorize T ↔214      power p (U : HaarFourthMoments.Mat N) * T = T * power p (U : HaarFourthMoments.Mat N) := by215  rw [mixed_mulVec_vectorize]216  constructor217  · intro h218    have hm : power p (U : HaarFourthMoments.Mat N) * T *219        (power p (U : HaarFourthMoments.Mat N))ᴴ = T := by220      ext x y221      exact congrFun h (x,y)222    have hr := congrArg (fun M => M * power p (U : HaarFourthMoments.Mat N)) hm223    simpa only [Matrix.mul_assoc, power_star_mul, Matrix.mul_one] using hr224  · intro h225    rw [h, Matrix.mul_assoc, power_mul_star, Matrix.mul_one]226227/-- Phase invariance gives the row-support condition on every invariant tensor. -/228theorem invariant_eq_zero_of_multiplicity_ne {N p : ℕ} (v : Pair N p → ℂ)229    (hv : ∀ U : LocalUnitary N, mixed N p U *ᵥ v = v)230    (x y : Tuple N p) (r : Fin (N+1))231    (hr : HaarMixedMoments.multiplicity x r ≠ HaarMixedMoments.multiplicity y r) :232    v (x,y) = 0 := by233  have h := (average_mulVec_eq_iff _ (continuous_mixed N p) (mixed_mul N p) v).mpr hv234  have he (ab : Pair N p) : average (mixed N p) (x,y) ab = 0 := by235    exact HaarMixedMoments.integral_entryMonomial_eq_zero_of_row_mismatch236      x ab.1 y ab.2 r hr237  have hxy := congrFun h (x,y)238  simp only [Matrix.mulVec, dotProduct, he, zero_mul, Finset.sum_const_zero] at hxy239  exact hxy.symm240241/-- Rows indexed by distinct coordinates contain an identity submatrix. -/242theorem contractions_injective_row {N p : ℕ} (e : Fin p ↪ Fin (N+1)) (σ τ : Perm p) :243    contractions N p (e ∘ σ, e) τ = if σ=τ then 1 else 0 := by244  unfold contractions245  congr 1246  apply propext247  constructor248  · intro h249    apply Equiv.ext250    intro r251    exact e.injective (congrFun h r)252  · intro h253    subst τ254    rfl255256theorem contractions_row_mulVec {N p : ℕ} (e : Fin p ↪ Fin (N+1))257    (c : Perm p → ℂ) (σ : Perm p) :258    (contractions N p *ᵥ c) (e ∘ σ, e) = c σ := by259  simp [Matrix.mulVec, dotProduct, contractions_injective_row]260261/-- Every coordinate tensor is a matrix image of a fixed distinct-coordinate tensor.262This works with a possibly singular matrix and needs no density argument. -/263theorem exists_power_column {N p : ℕ} (e : Fin p ↪ Fin (N+1)) (y : Tuple N p) :264    ∃ A : HaarFourthMoments.Mat N, ∀ x : Tuple N p,265      power p A x e = if x=y then 1 else 0 := by266  classical267  let A : HaarFourthMoments.Mat N := fun a b =>268    ∑ r : Fin p, if b=e r then (if a=y r then 1 else 0) else 0269  have ha (a : Fin (N+1)) (r : Fin p) : A a (e r) = if a=y r then 1 else 0 := by270    simp [A, e.injective.eq_iff]271  refine ⟨A, fun x => ?_⟩272  simp only [power, ha]273  exact prod_delta x y274275/-- A map commuting with every matrix tensor power is determined by its value276on one tensor of distinct coordinate vectors. -/277theorem eq_zero_of_commute_power_of_column_zero {N p : ℕ}278    (e : Fin p ↪ Fin (N+1)) (T : Matrix (Tuple N p) (Tuple N p) ℂ)279    (hT : ∀ A : HaarFourthMoments.Mat N, power p A * T = T * power p A)280    (he : ∀ x, T x e = 0) : T = 0 := by281  ext x y282  obtain ⟨A, hA⟩ := exists_power_column e y283  have h := congrFun (congrFun (hT A) x) e284  simpa [Matrix.mul_apply, he, hA] using h.symm285286/-- The contraction map is injective throughout the stable range. -/287theorem contractions_mulVec_injective {N p : ℕ} (hp : p ≤ N+1) :288    Function.Injective (contractions N p).mulVec := by289  let e : Fin p ↪ Fin (N+1) := ⟨Fin.castLE hp, Fin.castLE_injective hp⟩290  intro v w h291  funext σ292  have hv := congrFun h (e ∘ σ, e)293  simpa [Matrix.mulVec, dotProduct, contractions_injective_row] using hv294295/-- The permutation Gram matrix, before any combinatorial simplification. -/296def gram (N p : ℕ) : Matrix (Perm p) (Perm p) ℂ :=297  (contractions N p)ᴴ * contractions N p298299theorem gram_posDef {N p : ℕ} (hp : p ≤ N+1) : (gram N p).PosDef :=300  Matrix.PosDef.conjTranspose_mul_self _ (contractions_mulVec_injective hp)301302theorem gram_isUnit {N p : ℕ} (hp : p ≤ N+1) : IsUnit (gram N p) :=303  (gram_posDef hp).isUnit304305theorem gram_det_isUnit {N p : ℕ} (hp : p ≤ N+1) : IsUnit (gram N p).det :=306  (Matrix.isUnit_iff_isUnit_det _).mp (gram_isUnit hp)307308/-- The inverse Gram coefficients exist in every required high-moment range. -/309def weingarten (N p : ℕ) : Matrix (Perm p) (Perm p) ℂ := (gram N p)⁻¹310311theorem weingarten_mul_gram {N p : ℕ} (hp : p ≤ N+1) :312    weingarten N p * gram N p = 1 :=313  Matrix.nonsing_inv_mul _ (gram_det_isUnit hp)314315theorem gram_mul_weingarten {N p : ℕ} (hp : p ≤ N+1) :316    gram N p * weingarten N p = 1 :=317  Matrix.mul_nonsing_inv _ (gram_det_isUnit hp)318319end Nonadditivity.HaarInvariantTensor