Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.EntropyProducts

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

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

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

25 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.Entropy7import Mathlib.Analysis.Matrix.Order89/-!10# Tensor products of actual quantum density matrices1112This file constructs the Kronecker product of two PSD trace-one complex13matrices and proves von Neumann entropy additivity. No entropy law or14eigenvalue formula is postulated: the proof uses unitary diagonalization,15characteristic-polynomial root multisets, and the logarithm product identity.16-/1718namespace Nonadditivity.Entropy1920open scoped BigOperators ComplexOrder ComplexConjugate Kronecker Matrix2122noncomputable section2324theorem mul_log_mul (x y : ℝ) :25    (x * y) * Real.log (x * y) = (x * Real.log x) * y + x * (y * Real.log y) := by26  by_cases hx : x = 027  · simp [hx]28  by_cases hy : y = 029  · simp [hy]30  rw [Real.log_mul hx hy]31  ring3233/-- Shannon entropy is additive for product distributions, including zero weights. -/34theorem shannon_product {ι κ : Type*} [Fintype ι] [Fintype κ]35    (p : ι → ℝ) (q : κ → ℝ) (hp : ∑ i, p i = 1) (hq : ∑ j, q j = 1) :36    shannon (fun ij : ι × κ => p ij.1 * q ij.2) = shannon p + shannon q := by37  simp only [shannon, Fintype.sum_prod_type, mul_log_mul, Finset.sum_add_distrib,38    ← Finset.sum_mul, ← Finset.mul_sum, hp, hq, mul_one, one_mul]39  ring4041/-- The genuine tensor-product density matrix. -/42def DensityMatrix.tensor {ι κ : Type*} [Fintype ι] [Fintype κ]43    [DecidableEq ι] [DecidableEq κ] (ρ : DensityMatrix ι) (σ : DensityMatrix κ) :44    DensityMatrix (ι × κ) where45  matrix := ρ.matrix ⊗ₖ σ.matrix46  positive := ρ.positive.kronecker σ.positive47  normalized := by rw [Matrix.trace_kronecker, ρ.normalized, σ.normalized, one_mul]4849theorem DensityMatrix.tensor_matrix {ι κ : Type*} [Fintype ι] [Fintype κ]50    [DecidableEq ι] [DecidableEq κ] (ρ : DensityMatrix ι) (σ : DensityMatrix κ) :51    (ρ.tensor σ).matrix = ρ.matrix ⊗ₖ σ.matrix := rfl5253/-- Tensoring actual unitaries gives an actual unitary. -/54def tensorUnitary {ι κ : Type*} [Fintype ι] [Fintype κ]55    [DecidableEq ι] [DecidableEq κ]56    (U : unitary (Matrix ι ι ℂ)) (V : unitary (Matrix κ κ ℂ)) :57    unitary (Matrix (ι × κ) (ι × κ) ℂ) :=58  ⟨(U : Matrix ι ι ℂ) ⊗ₖ (V : Matrix κ κ ℂ), by59    rw [Unitary.mem_iff]60    constructor61    · change ((U : Matrix ι ι ℂ) ⊗ₖ (V : Matrix κ κ ℂ))ᴴ *62        ((U : Matrix ι ι ℂ) ⊗ₖ (V : Matrix κ κ ℂ)) = 163      rw [Matrix.conjTranspose_kronecker, ← Matrix.mul_kronecker_mul]64      simp only [← Matrix.star_eq_conjTranspose, Unitary.coe_star_mul_self]65      exact Matrix.one_kronecker_one (m := ι) (n := κ)66    · change ((U : Matrix ι ι ℂ) ⊗ₖ (V : Matrix κ κ ℂ)) *67        ((U : Matrix ι ι ℂ) ⊗ₖ (V : Matrix κ κ ℂ))ᴴ = 168      rw [Matrix.conjTranspose_kronecker, ← Matrix.mul_kronecker_mul]69      simp only [← Matrix.star_eq_conjTranspose]70      have hU : (U : Matrix ι ι ℂ) * star (U : Matrix ι ι ℂ) = 1 := by71        simpa only [Unitary.coe_star] using Unitary.coe_mul_star_self U72      have hV : (V : Matrix κ κ ℂ) * star (V : Matrix κ κ ℂ) = 1 := by73        simpa only [Unitary.coe_star] using Unitary.coe_mul_star_self V74      rw [hU, hV]75      exact Matrix.one_kronecker_one (m := ι) (n := κ)⟩7677/-- Entropy can be evaluated using any unitary diagonalization, without sorting the eigenvalues. -/78theorem DensityMatrix.entropy_eq_shannon_of_diagonalization79    {ι : Type*} [Fintype ι] [DecidableEq ι] (ρ : DensityMatrix ι)80    (p : ι → ℝ) (U : unitary (Matrix ι ι ℂ))81    (h : ρ.matrix = (U : Matrix ι ι ℂ) * Matrix.diagonal (fun i => (p i : ℂ)) *82      (star U : Matrix ι ι ℂ)) : ρ.vonNeumann = shannon p := by83  have hc : ρ.matrix.charpoly = (Matrix.diagonal (fun i => (p i : ℂ))).charpoly := by84    rw [h, Matrix.charpoly_mul_comm, ← Matrix.mul_assoc,85      Unitary.coe_star_mul_self, Matrix.one_mul]86  have hr : ρ.matrix.charpoly.roots =87      Multiset.map (fun i => (p i : ℂ)) Finset.univ.val := by88    rw [hc, Matrix.charpoly_diagonal, Polynomial.roots_prod]89    · simp90    · simp [Finset.prod_ne_zero_iff, Polynomial.X_sub_C_ne_zero]91  have he := ρ.positive.isHermitian.roots_charpoly_eq_eigenvalues92  rw [hr] at he93  have hs := congrArg (fun s : Multiset ℂ =>94    (s.map (fun z => z.re * Real.log z.re)).sum) he95  simp only [Multiset.map_map, Function.comp_def, Complex.ofReal_re] at hs96  change (∑ i, p i * Real.log (p i)) =97    ∑ i, ρ.weights i * Real.log (ρ.weights i) at hs98  exact congrArg Neg.neg hs.symm99100set_option maxHeartbeats 1000000 in101/-- The quantum entropy additivity law used for Bell output tensor blocks. -/102theorem DensityMatrix.tensor_entropy {ι κ : Type*} [Fintype ι] [Fintype κ]103    [DecidableEq ι] [DecidableEq κ] (ρ : DensityMatrix ι) (σ : DensityMatrix κ) :104    (ρ.tensor σ).vonNeumann = ρ.vonNeumann + σ.vonNeumann := by105  let U := ρ.positive.isHermitian.eigenvectorUnitary106  let V := σ.positive.isHermitian.eigenvectorUnitary107  have hρ : ρ.matrix = (U : Matrix ι ι ℂ) *108      Matrix.diagonal (fun i => (ρ.weights i : ℂ)) * (star U : Matrix ι ι ℂ) :=109    ρ.positive.isHermitian.spectral_theorem110  have hσ : σ.matrix = (V : Matrix κ κ ℂ) *111      Matrix.diagonal (fun j => (σ.weights j : ℂ)) * (star V : Matrix κ κ ℂ) :=112    σ.positive.isHermitian.spectral_theorem113  have ht : (ρ.tensor σ).matrix = (tensorUnitary U V : Matrix _ _ ℂ) *114      Matrix.diagonal (fun ij : ι × κ => ((ρ.weights ij.1 * σ.weights ij.2 : ℝ) : ℂ)) *115      (star (tensorUnitary U V) : Matrix _ _ ℂ) := by116    rw [DensityMatrix.tensor_matrix, hρ, hσ,117      Matrix.mul_kronecker_mul, Matrix.mul_kronecker_mul,118      Matrix.diagonal_kronecker_diagonal]119    simp only [tensorUnitary, Matrix.star_eq_conjTranspose,120      Matrix.conjTranspose_kronecker, Complex.ofReal_mul]121  have he := (ρ.tensor σ).entropy_eq_shannon_of_diagonalization122    (fun ij : ι × κ => ρ.weights ij.1 * σ.weights ij.2) (tensorUnitary U V) ht123  exact he.trans (shannon_product ρ.weights σ.weights ρ.weights_sum σ.weights_sum)124125/-! ## Rectangular Gram matrices and pure-state reductions -/126127/-- The spectral entropy can equally be evaluated from characteristic-polynomial roots. -/128theorem DensityMatrix.entropy_eq_neg_root_sum129    {ι : Type*} [Fintype ι] [DecidableEq ι] (ρ : DensityMatrix ι) :130    ρ.vonNeumann =131      -(ρ.matrix.charpoly.roots.map (fun z : ℂ => z.re * Real.log z.re)).sum := by132  rw [ρ.positive.isHermitian.roots_charpoly_eq_eigenvalues]133  simp only [Multiset.map_map, Function.comp_def]134  rfl135136/-- Adding arbitrary zero eigenvalues leaves entropy unchanged.137The polynomial identity is an algebraic relation, not an entropy hypothesis. -/138theorem DensityMatrix.entropy_eq_of_padded_charpoly139    {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ]140    (ρ : DensityMatrix ι) (σ : DensityMatrix κ) (m n : ℕ)141    (h : (Polynomial.X : Polynomial ℂ) ^ m * ρ.matrix.charpoly =142      (Polynomial.X : Polynomial ℂ) ^ n * σ.matrix.charpoly) :143    ρ.vonNeumann = σ.vonNeumann := by144  have hr := congrArg Polynomial.roots h145  rw [Polynomial.roots_mul (mul_ne_zero146      (pow_ne_zero m Polynomial.X_ne_zero) ρ.matrix.charpoly_monic.ne_zero),147    Polynomial.roots_mul (mul_ne_zero148      (pow_ne_zero n Polynomial.X_ne_zero) σ.matrix.charpoly_monic.ne_zero),149    Polynomial.roots_X_pow, Polynomial.roots_X_pow] at hr150  have hs := congrArg (fun s : Multiset ℂ =>151    (s.map (fun z => z.re * Real.log z.re)).sum) hr152  simp [Multiset.nsmul_singleton, Multiset.map_replicate] at hs153  rw [ρ.entropy_eq_neg_root_sum, σ.entropy_eq_neg_root_sum]154  exact congrArg Neg.neg hs155156/-- Left reduced state of a normalized bipartite pure vector represented as a coefficient matrix. -/157def bipartiteLeft {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ]158    (A : Matrix ι κ ℂ) (hnorm : (A * Aᴴ).trace = 1) : DensityMatrix ι where159  matrix := A * Aᴴ160  positive := Matrix.posSemidef_self_mul_conjTranspose A161  normalized := hnorm162163/-- Right Gram state. Its transpose is the right physical reduction under164the coefficient convention; entropy is invariant under that conjugation. -/165def bipartiteRight {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ]166    (A : Matrix ι κ ℂ) (hnorm : (A * Aᴴ).trace = 1) : DensityMatrix κ where167  matrix := Aᴴ * A168  positive := Matrix.posSemidef_conjTranspose_mul_self A169  normalized := by rw [Matrix.trace_mul_comm]; exact hnorm170171/-- Schmidt entropy equality, including unequal dimensions and zero Schmidt coefficients. -/172theorem bipartite_entropy_eq {ι κ : Type*} [Fintype ι] [Fintype κ]173    [DecidableEq ι] [DecidableEq κ] (A : Matrix ι κ ℂ)174    (hnorm : (A * Aᴴ).trace = 1) :175    (bipartiteLeft A hnorm).vonNeumann = (bipartiteRight A hnorm).vonNeumann := by176  apply DensityMatrix.entropy_eq_of_padded_charpoly _ _ (Fintype.card κ) (Fintype.card ι)177  exact Matrix.charpoly_mul_comm' A Aᴴ178179/-- Entropy equality for the actual coefficient-basis left and right reduced matrices. -/180theorem bipartite_physical_reductions_entropy_eq {ι κ : Type*} [Fintype ι] [Fintype κ]181    [DecidableEq ι] [DecidableEq κ] (A : Matrix ι κ ℂ)182    (hnorm : (A * Aᴴ).trace = 1) :183    (bipartiteLeft A hnorm).vonNeumann = (bipartiteRight A hnorm).conjugate.vonNeumann := by184  rw [DensityMatrix.conjugate_entropy]185  exact bipartite_entropy_eq A hnorm186187end188189end Nonadditivity.Entropy