Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.EntropyContinuity

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

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

8 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarMomentTail7import Mathlib.Topology.UniformSpace.HeineCantor89/-!10# Uniform continuity of finite-dimensional von Neumann entropy1112The modulus depends only on the output dimension and the requested entropy13error.  It is obtained from scalar uniform continuity on `[0,1]`, diagonal14pinching, and unitary invariance, without any assumed spectral continuity15or probabilistic estimate.16-/1718noncomputable section1920namespace Nonadditivity.EntropyContinuity2122open Nonadditivity.Entropy Nonadditivity.EntropyMixtures23open scoped BigOperators ComplexOrder Matrix MatrixOrder Matrix.Norms.L2Operator2425set_option backward.isDefEq.respectTransparency false26set_option maxHeartbeats 6000002728variable {ι : Type*} [Fintype ι] [DecidableEq ι]2930omit [DecidableEq ι] in31/-- A uniform scalar modulus gives a uniform modulus for finite Shannon32entropy, including boundary distributions with zero probabilities. -/33theorem exists_shannon_modulus (η : ℝ) (hη : 0 < η) :34    ∃ δ > 0, ∀ p q : ι → ℝ,35      (∀ i, p i ∈ Set.Icc (0 : ℝ) 1) →36      (∀ i, q i ∈ Set.Icc (0 : ℝ) 1) →37      (∀ i, |p i - q i| ≤ δ) → |shannon p - shannon q| ≤ η := by38  classical39  have hd : 0 < (Fintype.card ι : ℝ) + 1 := by positivity40  have hu := (isCompact_Icc : IsCompact (Set.Icc (0 : ℝ) 1)).uniformContinuousOn_of_continuous41    Real.continuous_negMulLog.continuousOn42  obtain ⟨δ, hδ, hmod⟩ := Metric.uniformContinuousOn_iff_le.mp hu43    (η / ((Fintype.card ι : ℝ) + 1)) (div_pos hη hd)44  refine ⟨δ, hδ, fun p q hp hq hpq => ?_⟩45  rw [shannon_eq_sum_negMulLog, shannon_eq_sum_negMulLog, ← Finset.sum_sub_distrib]46  calc47    |∑ i, (Real.negMulLog (p i) - Real.negMulLog (q i))| ≤48        ∑ i, |Real.negMulLog (p i) - Real.negMulLog (q i)| :=49      Finset.abs_sum_le_sum_abs _ _50    _ ≤ ∑ _i : ι, η / ((Fintype.card ι : ℝ) + 1) := by51      apply Finset.sum_le_sum52      intro i _53      exact hmod (p i) (hp i) (q i) (hq i) (by simpa [Real.dist_eq] using hpq i)54    _ ≤ η := by55      simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul]56      rw [← mul_div_assoc]57      apply (div_le_iff₀ hd).mpr58      nlinarith5960lemma diagonal_mem_Icc (ρ : DensityMatrix ι) (i : ι) :61    (ρ.matrix i i).re ∈ Set.Icc (0 : ℝ) 1 := by62  have hn (j : ι) : 0 ≤ (ρ.matrix j j).re :=63    (Complex.nonneg_iff.mp ρ.positive.diag_nonneg).164  have hs : (∑ j, (ρ.matrix j j).re) = 1 := by65    simpa only [Matrix.trace, ← Complex.re_sum, Complex.one_re] using66      congrArg Complex.re ρ.normalized67  exact ⟨hn i, hs ▸ Finset.single_le_sum (fun j _ => hn j) (Finset.mem_univ i)⟩6869/-- Diagonal expectations of a Hermitian matrix are bounded by its genuine70Euclidean operator norm. -/71lemma abs_diagonal_re_le_opNorm (A : Matrix ι ι ℂ) (hA : A.IsHermitian) (i : ι) :72    |(A i i).re| ≤ ‖A‖ := by73  letI : CStarAlgebra (Matrix ι ι ℂ) := { }74  have hu : A ≤ algebraMap ℝ (Matrix ι ι ℂ) ‖A‖ :=75    IsSelfAdjoint.le_algebraMap_norm_self hA.isSelfAdjoint76  have hl : -A ≤ algebraMap ℝ (Matrix ι ι ℂ) ‖-A‖ :=77    IsSelfAdjoint.le_algebraMap_norm_self hA.neg.isSelfAdjoint78  have hu' : 0 ≤ ((algebraMap ℝ (Matrix ι ι ℂ) ‖A‖ - A) i i).re :=79    (Complex.nonneg_iff.mp (Matrix.le_iff.mp hu).diag_nonneg).180  have hl' : 0 ≤ ((algebraMap ℝ (Matrix ι ι ℂ) ‖-A‖ - -A) i i).re :=81    (Complex.nonneg_iff.mp (Matrix.le_iff.mp hl).diag_nonneg).182  simp [Algebra.algebraMap_eq_smul_one, Matrix.sub_apply, Matrix.smul_apply,83    Matrix.neg_apply] at hu' hl'84  exact abs_le.mpr ⟨by linarith, by linarith⟩8586lemma unitaryConjugate_sub_norm (ρ σ : DensityMatrix ι)87    (U : unitary (Matrix ι ι ℂ)) :88    ‖(ρ.unitaryConjugate U).matrix - (σ.unitaryConjugate U).matrix‖ =89      ‖ρ.matrix - σ.matrix‖ := by90  letI : CStarAlgebra (Matrix ι ι ℂ) := { }91  change ‖(U : Matrix ι ι ℂ) * ρ.matrix * (star U : Matrix ι ι ℂ) -92    (U : Matrix ι ι ℂ) * σ.matrix * (star U : Matrix ι ι ℂ)‖ = _93  rw [← sub_mul, ← mul_sub]94  exact (CStarRing.norm_mul_coe_unitary _ (star U)).trans95    (CStarRing.norm_coe_unitary_mul U _)9697/-- Uniform continuity in Euclidean operator norm of the actual spectral98von Neumann entropy on finite density matrices. -/99theorem exists_vonNeumann_opNorm_modulus (η : ℝ) (hη : 0 < η) :100    ∃ δ > 0, ∀ ρ σ : DensityMatrix ι,101      ‖ρ.matrix - σ.matrix‖ ≤ δ → |ρ.vonNeumann - σ.vonNeumann| ≤ η := by102  obtain ⟨δ, hδ, hmod⟩ := exists_shannon_modulus (ι := ι) η hη103  have hone (ρ σ : DensityMatrix ι) (hclose : ‖ρ.matrix - σ.matrix‖ ≤ δ) :104      ρ.vonNeumann ≤ σ.vonNeumann + η := by105    let U := star σ.positive.isHermitian.eigenvectorUnitary106    let τ := ρ.unitaryConjugate U107    let ω := σ.unitaryConjugate U108    have hdiag : ω.matrix = Matrix.diagonal (fun i => (σ.weights i : ℂ)) :=109      σ.positive.isHermitian.conjStarAlgAut_star_eigenvectorUnitary110    have hcoord (i : ι) : |(τ.matrix i i).re - (ω.matrix i i).re| ≤ δ := by111      calc112        |(τ.matrix i i).re - (ω.matrix i i).re| = |((τ.matrix - ω.matrix) i i).re| := rfl113        _ ≤ ‖τ.matrix - ω.matrix‖ := abs_diagonal_re_le_opNorm _114          (τ.positive.isHermitian.sub ω.positive.isHermitian) i115        _ = ‖ρ.matrix - σ.matrix‖ := unitaryConjugate_sub_norm ρ σ U116        _ ≤ δ := hclose117    have hs := hmod (fun i => (τ.matrix i i).re) (fun i => (ω.matrix i i).re)118      (diagonal_mem_Icc τ) (diagonal_mem_Icc ω) hcoord119    have hspec : shannon (fun i => (ω.matrix i i).re) = σ.vonNeumann := by120      simp only [hdiag, Matrix.diagonal_apply_eq, Complex.ofReal_re]121      rfl122    rw [hspec] at hs123    have hp := DensityMatrix.vonNeumann_le_diagonal τ124    have he : τ.vonNeumann = ρ.vonNeumann := ρ.unitaryConjugate_entropy U125    have hh := (abs_le.mp hs).2126    linarith127  refine ⟨δ, hδ, fun ρ σ hclose => abs_le.mpr ⟨?_, ?_⟩⟩128  · have hrev : ‖σ.matrix - ρ.matrix‖ ≤ δ := by129      simpa only [norm_sub_rev] using hclose130    linarith [hone σ ρ hrev]131  · linarith [hone ρ σ hclose]132133/-- The same uniform modulus applies to Hilbert--Schmidt perturbations. -/134theorem exists_vonNeumann_hsLength_modulus [Nonempty ι] (η : ℝ) (hη : 0 < η) :135    ∃ δ > 0, ∀ ρ σ : DensityMatrix ι,136      AdjointPurity.hsLength (ρ.matrix - σ.matrix) ≤ δ →137        |ρ.vonNeumann - σ.vonNeumann| ≤ η := by138  obtain ⟨δ, hδ, hmod⟩ := exists_vonNeumann_opNorm_modulus (ι := ι) η hη139  refine ⟨δ, hδ, fun ρ σ hclose => hmod ρ σ ?_⟩140  have hHerm := ρ.positive.isHermitian.sub σ.positive.isHermitian141  have hnorm := HaarMomentTail.norm_pow_le_trace_even (ρ.matrix - σ.matrix) hHerm 1142  simp only [show 2 * 1 = 2 by omega, pow_two] at hnorm143  have hs := AdjointPurity.hsLength_sq_of_isHermitian (ρ.matrix - σ.matrix) hHerm144  have hn : ‖ρ.matrix - σ.matrix‖ ≤ AdjointPurity.hsLength (ρ.matrix - σ.matrix) := by145    nlinarith [norm_nonneg (ρ.matrix - σ.matrix),146      AdjointPurity.hsLength_nonneg (ρ.matrix - σ.matrix)]147  exact hn.trans hclose148149end Nonadditivity.EntropyContinuity