Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.EntropyMixtures

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

Direct imports

Imported by project modules

5 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

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

29 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.StateEnsembles7import Nonadditivity.EntropyProducts8import Mathlib.Analysis.SpecialFunctions.Log.NegMulLog9import Mathlib.Analysis.Convex.Jensen1011/-!12# Entropy monotonicity under diagonal pinching1314These statements concern genuine finite complex density matrices and their15spectrally defined von Neumann entropy. The pinching inequality is derived16from the spectral theorem, unitarity, and scalar Jensen's inequality; it is17not supplied as a hypothesis.18-/1920namespace Nonadditivity.EntropyMixtures2122open scoped BigOperators ComplexOrder ComplexConjugate Matrix23open Nonadditivity.Entropy2425noncomputable section2627lemma shannon_eq_sum_negMulLog {ι : Type*} [Fintype ι] (p : ι → ℝ) :28    shannon p = ∑ i, Real.negMulLog (p i) := by29  simp [shannon, Real.negMulLog, Finset.sum_neg_distrib]3031/-- A doubly stochastic matrix increases Shannon entropy, including zero32weights. This result is independent of a quantum interpretation. -/33theorem shannon_le_of_doublyStochastic {ι κ : Type*} [Fintype ι] [Fintype κ]34    (p : κ → ℝ) (hp : ∀ j, 0 ≤ p j) (q : ι → κ → ℝ)35    (hq : ∀ i j, 0 ≤ q i j) (hrow : ∀ i, ∑ j, q i j = 1)36    (hcol : ∀ j, ∑ i, q i j = 1) :37    shannon p ≤ shannon (fun i => ∑ j, q i j * p j) := by38  classical39  have hj (i : ι) :40      (∑ j, q i j * Real.negMulLog (p j)) ≤ Real.negMulLog (∑ j, q i j * p j) := by41    simpa only [smul_eq_mul] using Real.concaveOn_negMulLog.le_map_sum42      (t := Finset.univ) (w := q i) (p := p)43      (fun j _ => hq i j) (hrow i) (fun j _ => hp j)44  have hs := Finset.sum_le_sum (fun i (_ : i ∈ Finset.univ) => hj i)45  have hleft : (∑ i, ∑ j, q i j * Real.negMulLog (p j)) =46      ∑ j, Real.negMulLog (p j) := by47    rw [Finset.sum_comm]48    simp only [← Finset.sum_mul, hcol, one_mul]49  rw [hleft] at hs50  simpa only [shannon_eq_sum_negMulLog] using hs5152/-- Shannon entropy is concave for finite nonnegative distributions. -/53theorem shannon_mixture_concave {ι κ : Type*} [Fintype ι] [Fintype κ]54    (p : κ → ℝ) (hp : ∀ j, 0 ≤ p j) (hsum : ∑ j, p j = 1)55    (q : κ → ι → ℝ) (hq : ∀ j i, 0 ≤ q j i) :56    (∑ j, p j * shannon (q j)) ≤ shannon (fun i => ∑ j, p j * q j i) := by57  classical58  have hj (i : ι) :59      (∑ j, p j * Real.negMulLog (q j i)) ≤ Real.negMulLog (∑ j, p j * q j i) := by60    simpa only [smul_eq_mul] using Real.concaveOn_negMulLog.le_map_sum61      (t := Finset.univ) (w := p) (p := fun j => q j i)62      (fun j _ => hp j) hsum (fun j _ => hq j i)63  have hs := Finset.sum_le_sum (fun i (_ : i ∈ Finset.univ) => hj i)64  rw [Finset.sum_comm] at hs65  simpa only [shannon_eq_sum_negMulLog, Finset.mul_sum] using hs6667/-- Squared matrix-entry moduli of a genuine unitary. -/68def unitaryWeights {ι : Type*} [Fintype ι] [DecidableEq ι]69    (U : unitary (Matrix ι ι ℂ)) (i j : ι) : ℝ :=70  Complex.normSq ((U : Matrix ι ι ℂ) i j)7172lemma unitaryWeights_nonneg {ι : Type*} [Fintype ι] [DecidableEq ι]73    (U : unitary (Matrix ι ι ℂ)) (i j : ι) : 0 ≤ unitaryWeights U i j :=74  Complex.normSq_nonneg _7576lemma unitaryWeights_row_sum {ι : Type*} [Fintype ι] [DecidableEq ι]77    (U : unitary (Matrix ι ι ℂ)) (i : ι) : ∑ j, unitaryWeights U i j = 1 := by78  have h := congrArg (fun M : Matrix ι ι ℂ => (M i i).re) (Unitary.coe_mul_star_self U)79  simpa [unitaryWeights, Matrix.mul_apply, Matrix.star_apply, Complex.mul_conj] using h8081lemma unitaryWeights_col_sum {ι : Type*} [Fintype ι] [DecidableEq ι]82    (U : unitary (Matrix ι ι ℂ)) (j : ι) : ∑ i, unitaryWeights U i j = 1 := by83  have h := congrArg (fun M : Matrix ι ι ℂ => (M j j).re) (Unitary.coe_star_mul_self U)84  simpa [unitaryWeights, Matrix.mul_apply, Matrix.star_apply, mul_comm, Complex.mul_conj] using h8586/-- The diagonal entries of a unitarily conjugated real diagonal matrix are87exactly its unistochastic averages. -/88lemma diagonal_unitary_conjugate {ι : Type*} [Fintype ι] [DecidableEq ι]89    (p : ι → ℝ) (U : unitary (Matrix ι ι ℂ)) (i : ι) :90    (((U : Matrix ι ι ℂ) * Matrix.diagonal (fun j => (p j : ℂ)) *91      (star U : Matrix ι ι ℂ)) i i).re = ∑ j, unitaryWeights U i j * p j := by92  classical93  rw [Matrix.mul_apply]94  simp only [Matrix.mul_diagonal, Matrix.star_apply]95  rw [← Complex.coe_reAddGroupHom, map_sum]96  apply Finset.sum_congr rfl97  intro j _98  change (((U : Matrix ι ι ℂ) i j * (p j : ℂ)) *99    star ((U : Matrix ι ι ℂ) i j)).re = _100  have hm : (((U : Matrix ι ι ℂ) i j * (p j : ℂ)) *101      star ((U : Matrix ι ι ℂ) i j)) =102      (((U : Matrix ι ι ℂ) i j * star ((U : Matrix ι ι ℂ) i j)) * (p j : ℂ)) := by ring103  rw [hm]104  simp [unitaryWeights, Complex.mul_conj]105106/-- Genuine von Neumann entropy is at most the Shannon entropy of diagonal107measurement probabilities in any fixed orthonormal basis. -/108theorem DensityMatrix.vonNeumann_le_diagonal {ι : Type*} [Fintype ι] [DecidableEq ι]109    (ρ : DensityMatrix ι) :110    ρ.vonNeumann ≤ shannon (fun i => (ρ.matrix i i).re) := by111  let U := ρ.positive.isHermitian.eigenvectorUnitary112  have hd (i : ι) : (ρ.matrix i i).re = ∑ j, unitaryWeights U i j * ρ.weights j := by113    rw [ρ.positive.isHermitian.spectral_theorem, Unitary.conjStarAlgAut_apply]114    exact diagonal_unitary_conjugate ρ.weights U i115  change shannon ρ.weights ≤ _116  simp_rw [hd]117  exact shannon_le_of_doublyStochastic ρ.weights ρ.weights_nonneg118    (unitaryWeights U) (unitaryWeights_nonneg U) (unitaryWeights_row_sum U)119    (unitaryWeights_col_sum U)120121/-- Genuine von Neumann entropy concavity. The hypothesis is an explicit122matrix convex-combination identity, not an entropy inequality. -/123theorem densityMatrix_entropy_concave {ι κ : Type*} [Fintype ι] [DecidableEq ι]124    [Fintype κ] (ρ : DensityMatrix ι) (σ : κ → DensityMatrix ι)125    (p : κ → ℝ) (hp : ∀ j, 0 ≤ p j) (hsum : ∑ j, p j = 1)126    (hmixture : ρ.matrix = ∑ j, (p j : ℂ) • (σ j).matrix) :127    (∑ j, p j * (σ j).vonNeumann) ≤ ρ.vonNeumann := by128  classical129  let U := ρ.positive.isHermitian.eigenvectorUnitary130  let V := star U131  let τ (j : κ) := (σ j).unitaryConjugate V132  have hdiag : (ρ.unitaryConjugate V).matrix =133      Matrix.diagonal (fun i => (ρ.weights i : ℂ)) :=134    ρ.positive.isHermitian.conjStarAlgAut_star_eigenvectorUnitary135  have hmat : (ρ.unitaryConjugate V).matrix = ∑ j, (p j : ℂ) • (τ j).matrix := by136    change (V : Matrix ι ι ℂ) * ρ.matrix * (star V : Matrix ι ι ℂ) = _137    rw [hmixture, Matrix.mul_sum, Matrix.sum_mul]138    simp only [τ, DensityMatrix.unitaryConjugate, Matrix.mul_smul, Matrix.smul_mul]139  have hd (i : ι) : ρ.weights i = ∑ j, p j * ((τ j).matrix i i).re := by140    have h := congrArg (fun M : Matrix ι ι ℂ => (M i i).re) (hdiag.symm.trans hmat)141    simpa [Matrix.sum_apply, Matrix.smul_apply, smul_eq_mul, Complex.mul_re] using h142  have hnonneg (j : κ) (i : ι) : 0 ≤ ((τ j).matrix i i).re :=143    (Complex.nonneg_iff.mp (τ j).positive.diag_nonneg).1144  calc145    (∑ j, p j * (σ j).vonNeumann) = ∑ j, p j * (τ j).vonNeumann := by146      simp only [τ, DensityMatrix.unitaryConjugate_entropy]147    _ ≤ ∑ j, p j * shannon (fun i => ((τ j).matrix i i).re) :=148      Finset.sum_le_sum (fun j _ => mul_le_mul_of_nonneg_left149        (DensityMatrix.vonNeumann_le_diagonal (τ j)) (hp j))150    _ ≤ shannon (fun i => ∑ j, p j * ((τ j).matrix i i).re) :=151      shannon_mixture_concave p hp hsum _ hnonneg152    _ = ρ.vonNeumann := by153      simp_rw [← hd]154      rfl155156/-- Concavity stated for the verified state mixture constructor. -/157theorem densityMatrix_mixture_entropy_concave {ι κ : Type*}158    [Fintype ι] [DecidableEq ι] [Fintype κ]159    (p : κ → ℝ) (hp : ∀ j, 0 ≤ p j) (hsum : ∑ j, p j = 1)160    (σ : κ → DensityMatrix ι) :161    (∑ j, p j * (σ j).vonNeumann) ≤ (DensityMatrix.mixture p hp hsum σ).vonNeumann :=162  densityMatrix_entropy_concave _ σ p hp hsum rfl163164lemma rightGram_diagonal_re {ι κ : Type*} [Fintype ι] (A : Matrix ι κ ℂ) (j : κ) :165    ((Aᴴ * A) j j).re = ∑ i, Complex.normSq (A i j) := by166  simp [Matrix.mul_apply, Matrix.conjTranspose_apply, mul_comm, Complex.mul_conj]167168/-- The entropy of an actual normalized Gram output is bounded by the169Shannon entropy of its column squared norms. This is the pure-ensemble170entropy bound without any assumed entropy law. -/171theorem bipartiteLeft_entropy_le_shannon {ι κ : Type*} [Fintype ι] [Fintype κ]172    [DecidableEq ι] [DecidableEq κ] (A : Matrix ι κ ℂ) (hnorm : (A * Aᴴ).trace = 1)173    (p : κ → ℝ) (hcolumns : ∀ j, ∑ i, Complex.normSq (A i j) = p j) :174    (bipartiteLeft A hnorm).vonNeumann ≤ shannon p := by175  calc176    (bipartiteLeft A hnorm).vonNeumann = (bipartiteRight A hnorm).vonNeumann :=177      bipartite_entropy_eq A hnorm178    _ ≤ shannon (fun j => ((bipartiteRight A hnorm).matrix j j).re) :=179      DensityMatrix.vonNeumann_le_diagonal (bipartiteRight A hnorm)180    _ = shannon p := by181      congr 1182      funext j183      exact (rightGram_diagonal_re A j).trans (hcolumns j)184185/-- Shannon's finite conditional chain rule, including zero weights. -/186theorem shannon_joint {ι κ : Type*} [Fintype ι] [Fintype κ]187    (p : κ → ℝ) (q : κ → ι → ℝ) (hq : ∀ j, ∑ i, q j i = 1) :188    shannon (fun ji : κ × ι => p ji.1 * q ji.1 ji.2) =189      shannon p + ∑ j, p j * shannon (q j) := by190  simp only [shannon_eq_sum_negMulLog, Fintype.sum_prod_type, Real.negMulLog_mul,191    Finset.sum_add_distrib, ← Finset.sum_mul, ← Finset.mul_sum, hq, one_mul]192193/-- A concrete amplitude matrix refining each mixed component into its194spectral pure-state ensemble. -/195def ensembleAmplitude {ι κ : Type*} [Fintype ι] [DecidableEq ι]196    (p : κ → ℝ) (σ : κ → DensityMatrix ι) : Matrix ι (κ × ι) ℂ :=197  fun i jk => (Real.sqrt (p jk.1 * (σ jk.1).weights jk.2) : ℂ) *198    ((σ jk.1).positive.isHermitian.eigenvectorUnitary : Matrix ι ι ℂ) i jk.2199200lemma densityMatrix_spectral_entry {ι : Type*} [Fintype ι] [DecidableEq ι]201    (ρ : DensityMatrix ι) (i l : ι) :202    ρ.matrix i l = ∑ k,203      (ρ.positive.isHermitian.eigenvectorUnitary : Matrix ι ι ℂ) i k *204      (ρ.weights k : ℂ) *205      star ((ρ.positive.isHermitian.eigenvectorUnitary : Matrix ι ι ℂ) l k) := by206  conv_lhs =>207    rw [ρ.positive.isHermitian.spectral_theorem, Unitary.conjStarAlgAut_apply,208      Matrix.mul_apply]209  simp only [Matrix.mul_diagonal, Matrix.star_apply]210  rfl211212lemma ensembleAmplitude_term {ι κ : Type*} [Fintype ι] [DecidableEq ι]213    (p : κ → ℝ) (hp : ∀ j, 0 ≤ p j) (σ : κ → DensityMatrix ι)214    (i l : ι) (j : κ) (k : ι) :215    ensembleAmplitude p σ i (j,k) * star (ensembleAmplitude p σ l (j,k)) =216      (p j : ℂ) *217      (((σ j).positive.isHermitian.eigenvectorUnitary : Matrix ι ι ℂ) i k *218      ((σ j).weights k : ℂ) *219      star (((σ j).positive.isHermitian.eigenvectorUnitary : Matrix ι ι ℂ) l k)) := by220  have hw : 0 ≤ p j * (σ j).weights k := mul_nonneg (hp j) ((σ j).weights_nonneg k)221  have hs : (Real.sqrt (p j * (σ j).weights k) : ℂ) *222      (Real.sqrt (p j * (σ j).weights k) : ℂ) = (p j * (σ j).weights k : ℝ) := by223    exact_mod_cast Real.mul_self_sqrt hw224  simp only [ensembleAmplitude, star_mul, Complex.star_def, Complex.conj_ofReal]225  calc226    _ = ((Real.sqrt (p j * (σ j).weights k) : ℂ) *227      (Real.sqrt (p j * (σ j).weights k) : ℂ)) *228      (((σ j).positive.isHermitian.eigenvectorUnitary : Matrix ι ι ℂ) i k *229        conj (((σ j).positive.isHermitian.eigenvectorUnitary : Matrix ι ι ℂ) l k)) := by ring230    _ = _ := by rw [hs, Complex.ofReal_mul]; ring231232/-- The left Gram matrix of the actual spectral refinement is the original233convex combination of density matrices. -/234lemma ensembleAmplitude_leftGram {ι κ : Type*} [Fintype ι] [DecidableEq ι]235    [Fintype κ] (p : κ → ℝ) (hp : ∀ j, 0 ≤ p j) (σ : κ → DensityMatrix ι) :236    ensembleAmplitude p σ * (ensembleAmplitude p σ)ᴴ =237      ∑ j, (p j : ℂ) • (σ j).matrix := by238  classical239  ext i l240  simp only [Matrix.mul_apply, Matrix.conjTranspose_apply, Fintype.sum_prod_type,241    Matrix.sum_apply, Matrix.smul_apply, smul_eq_mul]242  simp_rw [ensembleAmplitude_term p hp σ i l]243  simp only [← Finset.mul_sum, ← densityMatrix_spectral_entry]244245lemma ensembleAmplitude_columns_normSq {ι κ : Type*} [Fintype ι] [DecidableEq ι]246    (p : κ → ℝ) (hp : ∀ j, 0 ≤ p j) (σ : κ → DensityMatrix ι)247    (j : κ) (k : ι) :248    (∑ i, Complex.normSq (ensembleAmplitude p σ i (j,k))) = p j * (σ j).weights k := by249  have hw : 0 ≤ p j * (σ j).weights k := mul_nonneg (hp j) ((σ j).weights_nonneg k)250  simp only [ensembleAmplitude, Complex.normSq_mul, Complex.normSq_ofReal,251    Real.mul_self_sqrt hw]252  rw [← Finset.mul_sum]253  have hc := unitaryWeights_col_sum (σ j).positive.isHermitian.eigenvectorUnitary k254  unfold unitaryWeights at hc255  rw [hc, mul_one]256257/-- Genuine quantum entropy of mixing, proved by spectral refinement into a258normalized rectangular amplitude matrix, equality of its two Gram entropies,259and the already proved diagonal pinching bound. Zero weights are allowed. -/260theorem densityMatrix_mixture_entropy_upper {ι κ : Type*}261    [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ]262    (p : κ → ℝ) (hp : ∀ j, 0 ≤ p j) (hsum : ∑ j, p j = 1)263    (σ : κ → DensityMatrix ι) :264    (DensityMatrix.mixture p hp hsum σ).vonNeumann ≤265      shannon p + ∑ j, p j * (σ j).vonNeumann := by266  let A := ensembleAmplitude p σ267  have hleft : A * Aᴴ = (DensityMatrix.mixture p hp hsum σ).matrix :=268    ensembleAmplitude_leftGram p hp σ269  have hn : (A * Aᴴ).trace = 1 := by270    rw [hleft]271    exact (DensityMatrix.mixture p hp hsum σ).normalized272  have hstate : bipartiteLeft A hn = DensityMatrix.mixture p hp hsum σ :=273    DensityMatrix.ext hleft274  have hb := bipartiteLeft_entropy_le_shannon A hn275    (fun jk : κ × ι => p jk.1 * (σ jk.1).weights jk.2)276    (fun jk => ensembleAmplitude_columns_normSq p hp σ jk.1 jk.2)277  rw [hstate, shannon_joint p (fun j => (σ j).weights) (fun j => (σ j).weights_sum)] at hb278  exact hb279280end281282end Nonadditivity.EntropyMixtures