Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.WeylPowersTwirl

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

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.WeylPowersIndex78/-! Exact independent local Weyl twirls for every positive tensor power. -/9set_option maxHeartbeats 100000010set_option backward.isDefEq.respectTransparency false11noncomputable section12namespace Nonadditivity.WeylPowersTwirl13open RegularizedHolevo14open scoped BigOperators Kronecker ComplexConjugate1516abbrev Basis (d n : ℕ) := PositiveTensorIndex (ZMod d) n17abbrev Label (d n : ℕ) := PositiveTensorIndex (ZMod d × ZMod d) n1819variable {d : ℕ} [NeZero d]2021abbrev tensorFamily (n : ℕ) : Label d n → Matrix.unitaryGroup (Basis d n) ℂ :=22  WeylPowers.positiveUnitaryPower Weyl.family n2324private theorem conjugate_single_apply {ι : Type*} [Fintype ι] [DecidableEq ι]25    (U : Matrix ι ι ℂ) (i j a b : ι) :26    (U * Matrix.single a b (1 : ℂ) * U.conjTranspose) i j = U i a * star (U j b) := by27  simp [Matrix.mul_apply, Matrix.single, Matrix.conjTranspose_apply, ite_and]2829private theorem family_entry_moment (i j a b : ZMod d) :30    (∑ q : ZMod d × ZMod d,31      (Weyl.family q : Matrix _ _ ℂ) i a * star ((Weyl.family q : Matrix _ _ ℂ) j b)) =32      if i = j ∧ a = b then (d : ℂ) else 0 := by33  have h := congrArg (fun M : Matrix (ZMod d) (ZMod d) ℂ => M i j)34    (Weyl.twirl_sum_eq (Matrix.single a b 1))35  simp only [Weyl.twirlSum, Matrix.sum_apply, conjugate_single_apply] at h36  simp only [Fintype.sum_prod_type, Weyl.family]37  rw [h]38  by_cases hij : i = j <;> by_cases hab : a = b39  · subst j; subst b; simp40  · simp [hij, hab]41  · simp [hij, hab]42  · simp [hij, hab]4344/-- Second-moment orthogonality for the product family. -/45theorem tensorFamily_entry_moment (n : ℕ) (i j a b : Basis d n) :46    (∑ q : Label d n,47      (tensorFamily n q : Matrix _ _ ℂ) i a *48        star ((tensorFamily n q : Matrix _ _ ℂ) j b)) =49      if i = j ∧ a = b then (Fintype.card (Basis d n) : ℂ) else 0 := by50  induction n with51  | zero => simpa [Basis, PositiveTensorIndex, tensorFamily, WeylPowers.positiveUnitaryPower, ZMod.card] using52      family_entry_moment i j a b53  | succ n ih =>54    change (∑ q : Label d n × (ZMod d × ZMod d),55      ((tensorFamily n q.1 : Matrix _ _ ℂ) i.1 a.1 *56        (Weyl.family q.2 : Matrix _ _ ℂ) i.2 a.2) *57      star ((tensorFamily n q.1 : Matrix _ _ ℂ) j.1 b.1 *58        (Weyl.family q.2 : Matrix _ _ ℂ) j.2 b.2)) = _59    rw [Fintype.sum_prod_type]60    have hfactor :61        (∑ q : Label d n, ∑ r : ZMod d × ZMod d,62          ((tensorFamily n q : Matrix _ _ ℂ) i.1 a.1 *63            (Weyl.family r : Matrix _ _ ℂ) i.2 a.2) *64          star ((tensorFamily n q : Matrix _ _ ℂ) j.1 b.1 *65            (Weyl.family r : Matrix _ _ ℂ) j.2 b.2)) =66        (∑ q : Label d n, (tensorFamily n q : Matrix _ _ ℂ) i.1 a.1 *67          star ((tensorFamily n q : Matrix _ _ ℂ) j.1 b.1)) *68        (∑ r : ZMod d × ZMod d, (Weyl.family r : Matrix _ _ ℂ) i.2 a.2 *69          star ((Weyl.family r : Matrix _ _ ℂ) j.2 b.2)) := by70      rw [Finset.sum_mul_sum]71      apply Finset.sum_congr rfl72      intro q _73      apply Finset.sum_congr rfl74      intro r _75      simp only [star_mul]76      ring77    rw [hfactor]78    rw [ih, family_entry_moment]79    change (if i.1 = j.1 ∧ a.1 = b.1 then _ else 0) *80      (if i.2 = j.2 ∧ a.2 = b.2 then _ else 0) =81      if i = j ∧ a = b then (Fintype.card (Basis d n × ZMod d) : ℂ) else 082    simp only [Fintype.card_prod, Nat.cast_mul, ZMod.card,83      show i = j ↔ i.1 = j.1 ∧ i.2 = j.2 from Prod.ext_iff,84      show a = b ↔ a.1 = b.1 ∧ a.2 = b.2 from Prod.ext_iff]85    split_ifs <;> simp_all8687/-- The unnormalized local twirl applies to arbitrary joint matrices. -/88theorem twirl_sum_eq (n : ℕ) (A : Matrix (Basis d n) (Basis d n) ℂ) :89    (∑ q : Label d n, (tensorFamily n q : Matrix _ _ ℂ) * A *90      (tensorFamily n q : Matrix _ _ ℂ).conjTranspose) =91      Matrix.diagonal (fun _ => (Fintype.card (Basis d n) : ℂ) * Matrix.trace A) := by92  ext i j93  simp only [Matrix.sum_apply, Matrix.mul_apply, Matrix.conjTranspose_apply,94    Finset.sum_mul]95  rw [Finset.sum_comm]96  apply Eq.trans (Finset.sum_congr rfl (fun b _ => Finset.sum_comm))97  simp_rw [mul_right_comm _ (A _ _), ← Finset.sum_mul, tensorFamily_entry_moment]98  by_cases hij : i = j99  · subst j100    simp [Matrix.trace, ← Finset.mul_sum]101  · simp [hij]102103104theorem label_card (n : ℕ) : Fintype.card (Label d n) = Fintype.card (Basis d n) ^ 2 := by105  simp only [Label, Basis, positiveTensorIndex_card, Fintype.card_prod, ZMod.card]106  rw [mul_pow, pow_two]107108def uniformWeight (n : ℕ) (_ : Label d n) : ℝ :=109  1 / (Fintype.card (Label d n) : ℝ)110111theorem uniformWeight_nonneg (n : ℕ) (q : Label d n) : 0 ≤ uniformWeight n q := by112  unfold uniformWeight113  positivity114115theorem uniformWeight_sum (n : ℕ) : (∑ q : Label d n, uniformWeight n q) = 1 := by116  simp [uniformWeight]117118/-- The normalized product twirl is completely depolarizing, including on entangled inputs. -/119theorem uniform_average_eq (n : ℕ) (A : Matrix (Basis d n) (Basis d n) ℂ) :120    (∑ q : Label d n, (uniformWeight n q : ℂ) •121      ((tensorFamily n q : Matrix _ _ ℂ) * A *122        (tensorFamily n q : Matrix _ _ ℂ).conjTranspose)) =123      (Matrix.trace A / (Fintype.card (Basis d n) : ℂ)) •124        (1 : Matrix (Basis d n) (Basis d n) ℂ) := by125  simp only [uniformWeight, Complex.ofReal_div, Complex.ofReal_one,126    ← Finset.smul_sum, twirl_sum_eq, label_card, Nat.cast_pow,127    Complex.ofReal_pow, Complex.ofReal_natCast]128  have hc : (Fintype.card (Basis d n) : ℂ) ≠ 0 := by129    exact_mod_cast Fintype.card_ne_zero130  ext i j131  by_cases hij : i = j132  · subst j133    simp only [Matrix.smul_apply, Matrix.diagonal_apply_eq, Matrix.one_apply_eq,134      smul_eq_mul, mul_one]135    field_simp136  · simp [Matrix.smul_apply, hij]137138def orbitIndex (n : ℕ) : Fin (Fintype.card (Label d n)) ≃ Label d n :=139  (Fintype.equivFin (Label d n)).symm140141/-- The complete finite local orbit, with an explicit normalized distribution. -/142def orbitEnsemble (n : ℕ) (outputs : Set (Entropy.DensityMatrix (Basis d n)))143    (ρ : Entropy.DensityMatrix (Basis d n))144    (hclosed : ∀ q : Label d n, ρ.unitaryConjugate (tensorFamily n q) ∈ outputs) :145    StateEnsembles.Ensemble outputs where146  size := Fintype.card (Label d n)147  weight := fun i => uniformWeight n (orbitIndex n i)148  weight_nonneg := fun _ => uniformWeight_nonneg _ _149  weight_sum := by150    exact (Fintype.sum_equiv (orbitIndex (d := d) n)151      (fun i => uniformWeight n (orbitIndex n i)) (uniformWeight n) (fun _ => rfl)).trans152        (uniformWeight_sum n)153  state := fun i => ρ.unitaryConjugate (tensorFamily n (orbitIndex n i))154  state_mem := fun i => hclosed (orbitIndex n i)155156theorem orbit_ensemble_average (n : ℕ) (outputs : Set (Entropy.DensityMatrix (Basis d n)))157    (ρ : Entropy.DensityMatrix (Basis d n))158    (hclosed : ∀ q : Label d n, ρ.unitaryConjugate (tensorFamily n q) ∈ outputs) :159    (orbitEnsemble n outputs ρ hclosed).average = Entropy.maximallyMixed (Basis d n) := by160  apply Entropy.DensityMatrix.ext161  change (∑ i : Fin (Fintype.card (Label d n)), (uniformWeight n (orbitIndex n i) : ℂ) •162    (ρ.unitaryConjugate (tensorFamily n (orbitIndex n i))).matrix) = _163  rw [Fintype.sum_equiv (orbitIndex (d := d) n)164    (fun i => (uniformWeight n (orbitIndex n i) : ℂ) •165      (ρ.unitaryConjugate (tensorFamily n (orbitIndex n i))).matrix)166    (fun q => (uniformWeight n q : ℂ) • (ρ.unitaryConjugate (tensorFamily n q)).matrix)167    (fun _ => rfl)]168  change (∑ q : Label d n, (uniformWeight n q : ℂ) •169    ((tensorFamily n q : Matrix _ _ ℂ) * ρ.matrix *170      (tensorFamily n q : Matrix _ _ ℂ).conjTranspose)) = _171  rw [uniform_average_eq, ρ.normalized]172  simp [Entropy.maximallyMixed]173174theorem orbit_ensemble_entropy (n : ℕ) (outputs : Set (Entropy.DensityMatrix (Basis d n)))175    (ρ : Entropy.DensityMatrix (Basis d n))176    (hclosed : ∀ q : Label d n, ρ.unitaryConjugate (tensorFamily n q) ∈ outputs)177    (i : Fin (Fintype.card (Label d n))) :178    ((orbitEnsemble n outputs ρ hclosed).state i).vonNeumann = ρ.vonNeumann :=179  ρ.unitaryConjugate_entropy _180181/-- Every state whose full local orbit is available gives the exact dimensional lower bound. -/182theorem orbit_information_lower_bound (n : ℕ)183    (outputs : Set (Entropy.DensityMatrix (Basis d n)))184    (ρ : Entropy.DensityMatrix (Basis d n))185    (hclosed : ∀ q : Label d n, ρ.unitaryConjugate (tensorFamily n q) ∈ outputs) :186    Real.log (Fintype.card (Basis d n)) - ρ.vonNeumann ≤ StateEnsembles.quantity outputs :=187  StateEnsembles.orbit_lower_bound (orbitEnsemble n outputs ρ hclosed) ρ188    (orbit_ensemble_average n outputs ρ hclosed) (orbit_ensemble_entropy n outputs ρ hclosed)189190theorem orbit_information_lower_bound_log (n : ℕ)191    (outputs : Set (Entropy.DensityMatrix (Basis d n)))192    (ρ : Entropy.DensityMatrix (Basis d n))193    (hclosed : ∀ q : Label d n, ρ.unitaryConjugate (tensorFamily n q) ∈ outputs) :194    ((n + 1 : ℕ) : ℝ) * Real.log d - ρ.vonNeumann ≤ StateEnsembles.quantity outputs := by195  simpa only [Basis, positiveTensorIndex_card, ZMod.card, Nat.cast_pow, Real.log_pow] using196    orbit_information_lower_bound n outputs ρ hclosed197198end Nonadditivity.WeylPowersTwirl