Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.HaarAveraging

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

Direct imports

  • Nonadditivity.HaarMoments
  • Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap dependency
  • Mathlib.MeasureTheory.Measure.Haar.Unique dependency

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

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

38 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarMoments7import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap8import Mathlib.MeasureTheory.Measure.Haar.Unique910/-! # Haar averaging in every finite-dimensional unitary representation1112The averaged matrix is proved to be the orthogonal projection onto the13invariant vectors.  The entries of the mixed tensor-power specialization14are Haar moments of arbitrary degree.  This is the algebraic starting point15of Weingarten calculus; it does not assert a growing-degree trace estimate.16-/1718noncomputable section19set_option backward.isDefEq.respectTransparency false20set_option maxHeartbeats 10000002122namespace Nonadditivity.HaarAveraging2324open MeasureTheory HaarModel25open scoped Matrix Matrix.Norms.L2Operator Kronecker2627variable {N : ℕ} {ι : Type*} [Fintype ι] [DecidableEq ι]2829/-- Normalization and Haar uniqueness give right invariance as well. -/30instance haarRightInvariant (N : ℕ) : (haar N).IsMulRightInvariant := by31  constructor32  intro V33  letI : IsProbabilityMeasure ((haar N).map (fun U => U * V)) :=34    Measure.isProbabilityMeasure_map (measurable_mul_const V).aemeasurable35  exact Measure.isHaarMeasure_eq_of_isProbabilityMeasure _ _3637/-- The canonical normalized Haar law is invariant under inversion. -/38instance haarInvInvariant (N : ℕ) : (haar N).IsInvInvariant := by39  letI : IsProbabilityMeasure (haar N).inv :=40    Measure.isProbabilityMeasure_map measurable_inv.aemeasurable41  letI : (haar N).inv.IsHaarMeasure := { }42  constructor43  exact Measure.isHaarMeasure_eq_of_isProbabilityMeasure _ _4445/-- Entrywise Haar averaging of a continuous matrix-valued representation. -/46def average (R : LocalUnitary N → Matrix ι ι ℂ) : Matrix ι ι ℂ :=47  fun i j => ∫ U, R U i j ∂haar N4849omit [Fintype ι] [DecidableEq ι] in50lemma integrable_entry {R : LocalUnitary N → Matrix ι ι ℂ}51    (hR : Continuous R) (i j : ι) : Integrable (fun U => R U i j) (haar N) :=52  (hR.matrix_elem i j).integrable_of_hasCompactSupport53    (HasCompactSupport.of_compactSpace _)5455omit [DecidableEq ι] in56/-- The actual average is fixed by every represented group element. -/57theorem mul_average (R : LocalUnitary N → Matrix ι ι ℂ)58    (hR : Continuous R) (hmul : ∀ U V, R (U * V) = R U * R V)59    (V : LocalUnitary N) : R V * average R = average R := by60  ext i j61  simp only [Matrix.mul_apply, average]62  simp_rw [← integral_const_mul]63  rw [← integral_finset_sum _ (fun k _ => (integrable_entry hR k j).const_mul _)]64  simp_rw [← Matrix.mul_apply, ← hmul]65  exact integral_mul_left_eq_self (μ := haar N) (fun U => R U i j) V6667omit [DecidableEq ι] in68/-- Averaging also absorbs multiplication on the right. -/69theorem average_mul (R : LocalUnitary N → Matrix ι ι ℂ)70    (hR : Continuous R) (hmul : ∀ U V, R (U * V) = R U * R V)71    (V : LocalUnitary N) : average R * R V = average R := by72  ext i j73  simp only [Matrix.mul_apply, average]74  simp_rw [← integral_mul_const]75  rw [← integral_finset_sum _ (fun k _ => (integrable_entry hR i k).mul_const _)]76  simp_rw [← Matrix.mul_apply, ← hmul]77  exact integral_mul_right_eq_self (μ := haar N) (fun U => R U i j) V7879omit [DecidableEq ι] in80/-- Arbitrary-order Haar averaging is idempotent. -/81theorem average_sq (R : LocalUnitary N → Matrix ι ι ℂ)82    (hR : Continuous R) (hmul : ∀ U V, R (U * V) = R U * R V) :83    average R * average R = average R := by84  ext i j85  change (∑ k, (∫ U, R U i k ∂haar N) * average R k j) = average R i j86  simp_rw [← integral_mul_const]87  rw [← integral_finset_sum _ (fun k _ => (integrable_entry hR i k).mul_const _)]88  change (∫ U, (R U * average R) i j ∂haar N) = average R i j89  simp_rw [mul_average R hR hmul]90  simp9192omit [Fintype ι] [DecidableEq ι] in93/-- Haar inversion makes the average of a unitary representation Hermitian. -/94theorem average_conjTranspose (R : LocalUnitary N → Matrix ι ι ℂ)95    (hinv : ∀ U, R U⁻¹ = (R U)ᴴ) : (average R)ᴴ = average R := by96  ext i j97  change starRingEnd ℂ (∫ U, R U j i ∂haar N) = ∫ U, R U i j ∂haar N98  rw [← integral_conj]99  change (∫ U, (R U)ᴴ i j ∂haar N) = _100  simp_rw [← hinv]101  exact integral_inv_eq_self (fun U => R U i j) (haar N)102103omit [DecidableEq ι] in104/-- A vector is fixed by the average exactly when it is invariant. -/105theorem average_mulVec_eq_iff (R : LocalUnitary N → Matrix ι ι ℂ)106    (hR : Continuous R) (hmul : ∀ U V, R (U * V) = R U * R V)107    (v : ι → ℂ) :108    average R *ᵥ v = v ↔ ∀ U, R U *ᵥ v = v := by109  constructor110  · intro hv U111    calc112      R U *ᵥ v = R U *ᵥ (average R *ᵥ v) := by rw [hv]113      _ = (R U * average R) *ᵥ v := Matrix.mulVec_mulVec v (R U) (average R)114      _ = v := by rw [mul_average R hR hmul, hv]115  · intro hv116    funext i117    change (∑ j, (∫ U, R U i j ∂haar N) * v j) = v i118    simp_rw [← integral_mul_const]119    rw [← integral_finset_sum _ (fun j _ => (integrable_entry hR i j).mul_const _)]120    change (∫ U, (R U *ᵥ v) i ∂haar N) = v i121    simp_rw [hv]122    simp123124section TensorPowers125126open Entropy127128abbrev PowerIndex (N p : ℕ) := TensorChainIndex (Fin (N+1)) p129130/-- The literal tensor power, including its one-dimensional zeroth power. -/131def tensorPower (A : Matrix (Fin (N+1)) (Fin (N+1)) ℂ) :132    (p : ℕ) → Matrix (PowerIndex N p) (PowerIndex N p) ℂ133  | 0 => 1134  | p+1 => tensorPower A p ⊗ₖ A135136theorem tensorPower_mul (A B : Matrix (Fin (N+1)) (Fin (N+1)) ℂ) (p : ℕ) :137    tensorPower (A*B) p = tensorPower A p * tensorPower B p := by138  induction p with139  | zero => simp [tensorPower]140  | succ p ih => simp only [tensorPower, ih, Matrix.mul_kronecker_mul]141142theorem tensorPower_conjTranspose (A : Matrix (Fin (N+1)) (Fin (N+1)) ℂ) (p : ℕ) :143    tensorPower Aᴴ p = (tensorPower A p)ᴴ := by144  induction p with145  | zero => simp [tensorPower]146  | succ p ih =>147    simp only [tensorPower, ih]148    exact (Matrix.conjTranspose_kronecker _ _).symm149150theorem continuous_tensorPower (p : ℕ) :151    Continuous (fun A : Matrix (Fin (N+1)) (Fin (N+1)) ℂ => tensorPower A p) := by152  induction p with153  | zero => exact continuous_const154  | succ p ih =>155    apply continuous_matrix156    intro i j157    change Continuous (fun A => tensorPower A p i.1 j.1 * A i.2 j.2)158    exact (ih.matrix_elem _ _).mul (continuous_id.matrix_elem _ _)159160/-- The concrete representation whose entries are arbitrary mixed Haar moments. -/161def mixedTensor (p q : ℕ) (U : LocalUnitary N) :162    Matrix (PowerIndex N p × PowerIndex N q) (PowerIndex N p × PowerIndex N q) ℂ :=163  tensorPower (U : Matrix (Fin (N+1)) (Fin (N+1)) ℂ) p ⊗ₖ164    tensorPower ((U : Matrix (Fin (N+1)) (Fin (N+1)) ℂ).map (starRingEnd ℂ)) q165166theorem mixedTensor_mul (p q : ℕ) (U V : LocalUnitary N) :167    mixedTensor p q (U*V) = mixedTensor p q U * mixedTensor p q V := by168  unfold mixedTensor169  change tensorPower ((U : Matrix (Fin (N+1)) (Fin (N+1)) ℂ) * (V : Matrix (Fin (N+1)) (Fin (N+1)) ℂ)) p ⊗ₖ170    tensorPower (((U : Matrix (Fin (N+1)) (Fin (N+1)) ℂ) * (V : Matrix (Fin (N+1)) (Fin (N+1)) ℂ)).map (starRingEnd ℂ)) q = _171  rw [Matrix.map_mul, tensorPower_mul, tensorPower_mul, Matrix.mul_kronecker_mul]172173theorem mixedTensor_inv (p q : ℕ) (U : LocalUnitary N) :174    mixedTensor p q U⁻¹ = (mixedTensor p q U)ᴴ := by175  have hu : ((U⁻¹ : LocalUnitary N) : Matrix (Fin (N+1)) (Fin (N+1)) ℂ) =176      (U : Matrix (Fin (N+1)) (Fin (N+1)) ℂ)ᴴ := rfl177  have hc : ((U : Matrix (Fin (N+1)) (Fin (N+1)) ℂ)ᴴ).map (starRingEnd ℂ) =178      ((U : Matrix (Fin (N+1)) (Fin (N+1)) ℂ).map (starRingEnd ℂ))ᴴ := by179    ext i j180    simp181  simp only [mixedTensor, hu, hc, tensorPower_conjTranspose, Matrix.conjTranspose_kronecker]182183theorem continuous_mixedTensor (p q : ℕ) : Continuous (mixedTensor (N := N) p q) := by184  have hc : Continuous (fun U : LocalUnitary N =>185      (U : Matrix (Fin (N+1)) (Fin (N+1)) ℂ).map (starRingEnd ℂ)) := by186    apply continuous_matrix187    intro i j188    exact (HaarMoments.continuous_entry i j).star189  apply continuous_matrix190  intro i j191  exact (((continuous_tensorPower p).comp continuous_subtype_val).matrix_elem i.1 j.1).mul192    (((continuous_tensorPower q).comp hc).matrix_elem i.2 j.2)193194/-- Every mixed moment matrix, at arbitrary orders, is an idempotent. -/195theorem average_mixedTensor_sq (p q : ℕ) :196    average (mixedTensor (N := N) p q) * average (mixedTensor p q) =197      average (mixedTensor p q) :=198  average_sq _ (continuous_mixedTensor p q) (mixedTensor_mul p q)199200/-- Every mixed moment matrix, at arbitrary orders, is Hermitian. -/201theorem average_mixedTensor_hermitian (p q : ℕ) :202    (average (mixedTensor (N := N) p q)).IsHermitian :=203  average_conjTranspose _ (mixedTensor_inv p q)204205/-- The concrete arbitrary-degree Haar moment matrix projects onto invariant tensors. -/206theorem average_mixedTensor_mulVec_eq_iff (p q : ℕ)207    (v : PowerIndex N p × PowerIndex N q → ℂ) :208    average (mixedTensor p q) *ᵥ v = v ↔ ∀ U : LocalUnitary N, mixedTensor p q U *ᵥ v = v :=209  average_mulVec_eq_iff _ (continuous_mixedTensor p q) (mixedTensor_mul p q) v210211end TensorPowers212213end Nonadditivity.HaarAveraging214