Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.QuantumCodingTensorSpectrum

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

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

26 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.QuantumCodingSpectral7import Mathlib.Algebra.BigOperators.Ring.Finset89/-! # The actual spectrum of a finite tensor power1011Tensor powers here have the standard word basis `Fin n → ι`, and their matrix12entries are products of the original entries. Diagonalization is proved13entrywise, including the zero-fold tensor product.14-/1516noncomputable section1718set_option backward.isDefEq.respectTransparency false19set_option maxHeartbeats 8000002021namespace Nonadditivity.QuantumCoding2223open Entropy24open scoped BigOperators ComplexOrder Matrix2526variable {ι : Type*} [Fintype ι] [DecidableEq ι]2728def tensorMatrix (A : Matrix ι ι ℂ) (n : ℕ) :29    Matrix (Fin n → ι) (Fin n → ι) ℂ := fun x y => ∏ j, A (x j) (y j)3031omit [DecidableEq ι] in32theorem tensorMatrix_mul (A B : Matrix ι ι ℂ) (n : ℕ) :33    tensorMatrix (A * B) n = tensorMatrix A n * tensorMatrix B n := by34  ext x y35  simp only [tensorMatrix, Matrix.mul_apply]36  rw [Fintype.prod_sum]37  apply Finset.sum_congr rfl38  intro z _39  exact Finset.prod_mul_distrib4041omit [Fintype ι] [DecidableEq ι] in42theorem tensorMatrix_star (A : Matrix ι ι ℂ) (n : ℕ) :43    tensorMatrix (star A) n = star (tensorMatrix A n) := by44  ext x y45  simp [tensorMatrix, Matrix.star_apply]4647omit [Fintype ι] in48theorem tensorMatrix_diagonal (p : ι → ℂ) (n : ℕ) :49    tensorMatrix (Matrix.diagonal p) n = Matrix.diagonal (fun x => ∏ j, p (x j)) := by50  ext x y51  by_cases h : x = y52  · subst y53    simp [tensorMatrix]54  · have hj : ∃ j, x j ≠ y j := by55      by_contra hn56      push_neg at hn57      exact h (funext hn)58    obtain ⟨j, hj⟩ := hj59    rw [Matrix.diagonal_apply_ne _ h]60    apply Finset.prod_eq_zero (Finset.mem_univ j)61    exact Matrix.diagonal_apply_ne _ hj6263omit [Fintype ι] in64theorem tensorMatrix_one (n : ℕ) : tensorMatrix (1 : Matrix ι ι ℂ) n = 1 := by65  rw [← Matrix.diagonal_one, tensorMatrix_diagonal]66  simp6768def tensorPowerUnitary (U : unitary (Matrix ι ι ℂ)) (n : ℕ) :69    unitary (Matrix (Fin n → ι) (Fin n → ι) ℂ) :=70  ⟨tensorMatrix U n, by71    rw [Unitary.mem_iff]72    constructor73    · rw [← tensorMatrix_star, ← tensorMatrix_mul, Unitary.coe_star_mul_self,74        tensorMatrix_one]75    · rw [← tensorMatrix_star, ← tensorMatrix_mul]76      have h : (U : Matrix ι ι ℂ) * star (U : Matrix ι ι ℂ) = 1 :=77        Unitary.coe_mul_star_self U78      rw [h, tensorMatrix_one]⟩7980def tensorWeights (p : ι → ℝ) (n : ℕ) (x : Fin n → ι) : ℝ := ∏ j, p (x j)8182theorem tensorMatrix_diagonalization (ρ : DensityMatrix ι) (n : ℕ) :83    tensorMatrix ρ.matrix n =84      Unitary.conjStarAlgAut ℂ _85        (tensorPowerUnitary ρ.positive.isHermitian.eigenvectorUnitary n)86        (Matrix.diagonal (fun x => (tensorWeights ρ.weights n x : ℂ))) := by87  conv_lhs => rw [ρ.positive.isHermitian.spectral_theorem]88  rw [Unitary.conjStarAlgAut_apply,89    tensorMatrix_mul, tensorMatrix_mul, tensorMatrix_diagonal, tensorMatrix_star,90    Unitary.conjStarAlgAut_apply]91  simp only [tensorPowerUnitary, tensorWeights, Complex.ofReal_prod]92  rfl9394omit [Fintype ι] [DecidableEq ι] in95theorem tensorWeights_nonneg (p : ι → ℝ) (hp : ∀ i, 0 ≤ p i) (n : ℕ)96    (x : Fin n → ι) : 0 ≤ tensorWeights p n x :=97  Finset.prod_nonneg fun i _ => hp (x i)9899omit [DecidableEq ι] in100theorem tensorWeights_sum (p : ι → ℝ) (hp : ∑ i, p i = 1) (n : ℕ) :101    ∑ x, tensorWeights p n x = 1 := by102  unfold tensorWeights103  rw [← Fintype.prod_sum]104  simp [hp]105106/-- Actual product matrix state, with positivity proved by diagonalization. -/107def tensorState (ρ : DensityMatrix ι) (n : ℕ) : DensityMatrix (Fin n → ι) where108  matrix := tensorMatrix ρ.matrix n109  positive := by110    rw [tensorMatrix_diagonalization]111    exact unitaryDiagonal_posSemidef _ _ (tensorWeights_nonneg _ ρ.weights_nonneg n)112  normalized := by113    rw [tensorMatrix_diagonalization, unitaryDiagonal_trace, tensorWeights_sum _ ρ.weights_sum]114    simp115116def tensorTypicalProjector (ρ : DensityMatrix ι) (n : ℕ) (δ : ℝ) :117    Matrix (Fin n → ι) (Fin n → ι) ℂ :=118  spectralProjector (tensorPowerUnitary ρ.positive.isHermitian.eigenvectorUnitary n)119    (spectralBand (tensorWeights ρ.weights n)120      (Real.exp (-(n : ℝ) * (ρ.vonNeumann + δ)))121      (Real.exp (-(n : ℝ) * (ρ.vonNeumann - δ))))122123theorem tensorTypicalProjector_idempotent (ρ : DensityMatrix ι) (n : ℕ) (δ : ℝ) :124    tensorTypicalProjector ρ n δ * tensorTypicalProjector ρ n δ =125      tensorTypicalProjector ρ n δ := spectralProjector_idempotent _ _126127theorem tensorTypicalProjector_posSemidef (ρ : DensityMatrix ι) (n : ℕ) (δ : ℝ) :128    (tensorTypicalProjector ρ n δ).PosSemidef := spectralProjector_posSemidef _ _129130theorem tensorTypicalProjector_le_one (ρ : DensityMatrix ι) (n : ℕ) (δ : ℝ) :131    (1 - tensorTypicalProjector ρ n δ).PosSemidef := spectralProjector_le_one _ _132133theorem tensorTypicalProjector_trace_bound (ρ : DensityMatrix ι) (n : ℕ) (δ : ℝ) :134    (tensorTypicalProjector ρ n δ).trace.re ≤ Real.exp ((n : ℝ) * (ρ.vonNeumann + δ)) := by135  rw [tensorTypicalProjector, spectralProjector_trace, Complex.natCast_re]136  have h := spectralBand_card (tensorWeights ρ.weights n)137    (tensorWeights_nonneg ρ.weights ρ.weights_nonneg n)138    (tensorWeights_sum ρ.weights ρ.weights_sum n)139    (hi := Real.exp (-(n : ℝ) * (ρ.vonNeumann - δ)))140    (Real.exp_pos (-(n : ℝ) * (ρ.vonNeumann + δ)))141  convert h using 1142  rw [one_div, ← Real.exp_neg]143  congr 1144  ring145146theorem tensorTypicalProjector_compression_le (ρ : DensityMatrix ι) (n : ℕ) (δ : ℝ) :147    ((Real.exp (-(n : ℝ) * (ρ.vonNeumann - δ)) : ℂ) • tensorTypicalProjector ρ n δ -148      tensorTypicalProjector ρ n δ * (tensorState ρ n).matrix *149        tensorTypicalProjector ρ n δ).PosSemidef := by150  change (_ - _ * tensorMatrix ρ.matrix n * _).PosSemidef151  rw [tensorMatrix_diagonalization]152  exact spectralBand_compression_le _ _ _ _153154theorem tensorTypicalProjector_acceptance (ρ : DensityMatrix ι) (n : ℕ) (δ : ℝ) :155    ((tensorState ρ n).matrix * tensorTypicalProjector ρ n δ).trace.re =156      ∑ x ∈ spectralBand (tensorWeights ρ.weights n)157        (Real.exp (-(n : ℝ) * (ρ.vonNeumann + δ)))158        (Real.exp (-(n : ℝ) * (ρ.vonNeumann - δ))), tensorWeights ρ.weights n x := by159  change (tensorMatrix ρ.matrix n * _).trace.re = _160  rw [tensorMatrix_diagonalization]161  exact spectralProjector_acceptance _ _ _162163end Nonadditivity.QuantumCoding