Exact Lean source
Nonadditivity.EntropyMixtures
Download original .lean · View on GitHub · Jump to source
Direct imports
Nonadditivity.StateEnsemblesNonadditivity.EntropyProductsMathlib.Analysis.SpecialFunctions.Log.NegMulLogdependencyMathlib.Analysis.Convex.Jensendependency
Imported by project modules
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
Nonadditivity.Entropy.DensityMatrix.unitaryConjugate.eq_1internal/detail/privateNonadditivity.EntropyMixtures.DensityMatrix.vonNeumann_le_diagonalNonadditivity.EntropyMixtures.bipartiteLeft_entropy_le_shannonNonadditivity.EntropyMixtures.densityMatrix_entropy_concaveNonadditivity.EntropyMixtures.densityMatrix_mixture_entropy_concaveNonadditivity.EntropyMixtures.densityMatrix_mixture_entropy_upperNonadditivity.EntropyMixtures.densityMatrix_spectral_entryNonadditivity.EntropyMixtures.diagonal_unitary_conjugateNonadditivity.EntropyMixtures.ensembleAmplitudeNonadditivity.EntropyMixtures.ensembleAmplitude._proof_1internal/detail/privateNonadditivity.EntropyMixtures.ensembleAmplitude.eq_1internal/detail/privateNonadditivity.EntropyMixtures.ensembleAmplitude_columns_normSqNonadditivity.EntropyMixtures.ensembleAmplitude_leftGramNonadditivity.EntropyMixtures.ensembleAmplitude_leftGram._simp_1_1internal/detail/privateNonadditivity.EntropyMixtures.ensembleAmplitude_leftGram._simp_1_2internal/detail/privateNonadditivity.EntropyMixtures.ensembleAmplitude_termNonadditivity.EntropyMixtures.rightGram_diagonal_reNonadditivity.EntropyMixtures.shannon_eq_sum_negMulLogNonadditivity.EntropyMixtures.shannon_jointNonadditivity.EntropyMixtures.shannon_joint._simp_1_1internal/detail/privateNonadditivity.EntropyMixtures.shannon_joint._simp_1_2internal/detail/privateNonadditivity.EntropyMixtures.shannon_le_of_doublyStochasticNonadditivity.EntropyMixtures.shannon_le_of_doublyStochastic._simp_1_1internal/detail/privateNonadditivity.EntropyMixtures.shannon_mixture_concaveNonadditivity.EntropyMixtures.unitaryWeightsNonadditivity.EntropyMixtures.unitaryWeights.eq_1internal/detail/privateNonadditivity.EntropyMixtures.unitaryWeights_col_sumNonadditivity.EntropyMixtures.unitaryWeights_nonnegNonadditivity.EntropyMixtures.unitaryWeights_row_sum
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 : ι → ℝ) :28shannon p = ∑ i, Real.negMulLog (p i) := by29simp [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) :37shannon p ≤ shannon (fun i => ∑ j, q i j * p j) := by38classical39have hj (i : ι) :40(∑ j, q i j * Real.negMulLog (p j)) ≤ Real.negMulLog (∑ j, q i j * p j) := by41simpa 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)44have hs := Finset.sum_le_sum (fun i (_ : i ∈ Finset.univ) => hj i)45have hleft : (∑ i, ∑ j, q i j * Real.negMulLog (p j)) =46∑ j, Real.negMulLog (p j) := by47rw [Finset.sum_comm]48simp only [← Finset.sum_mul, hcol, one_mul]49rw [hleft] at hs50simpa 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) := by57classical58have hj (i : ι) :59(∑ j, p j * Real.negMulLog (q j i)) ≤ Real.negMulLog (∑ j, p j * q j i) := by60simpa 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)63have hs := Finset.sum_le_sum (fun i (_ : i ∈ Finset.univ) => hj i)64rw [Finset.sum_comm] at hs65simpa 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 : ι) : ℝ :=70Complex.normSq ((U : Matrix ι ι ℂ) i j)7172lemma unitaryWeights_nonneg {ι : Type*} [Fintype ι] [DecidableEq ι]73(U : unitary (Matrix ι ι ℂ)) (i j : ι) : 0 ≤ unitaryWeights U i j :=74Complex.normSq_nonneg _7576lemma unitaryWeights_row_sum {ι : Type*} [Fintype ι] [DecidableEq ι]77(U : unitary (Matrix ι ι ℂ)) (i : ι) : ∑ j, unitaryWeights U i j = 1 := by78have h := congrArg (fun M : Matrix ι ι ℂ => (M i i).re) (Unitary.coe_mul_star_self U)79simpa [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 := by83have h := congrArg (fun M : Matrix ι ι ℂ => (M j j).re) (Unitary.coe_star_mul_self U)84simpa [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 := by92classical93rw [Matrix.mul_apply]94simp only [Matrix.mul_diagonal, Matrix.star_apply]95rw [← Complex.coe_reAddGroupHom, map_sum]96apply Finset.sum_congr rfl97intro j _98change (((U : Matrix ι ι ℂ) i j * (p j : ℂ)) *99star ((U : Matrix ι ι ℂ) i j)).re = _100have hm : (((U : Matrix ι ι ℂ) i j * (p j : ℂ)) *101star ((U : Matrix ι ι ℂ) i j)) =102(((U : Matrix ι ι ℂ) i j * star ((U : Matrix ι ι ℂ) i j)) * (p j : ℂ)) := by ring103rw [hm]104simp [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) := by111let U := ρ.positive.isHermitian.eigenvectorUnitary112have hd (i : ι) : (ρ.matrix i i).re = ∑ j, unitaryWeights U i j * ρ.weights j := by113rw [ρ.positive.isHermitian.spectral_theorem, Unitary.conjStarAlgAut_apply]114exact diagonal_unitary_conjugate ρ.weights U i115change shannon ρ.weights ≤ _116simp_rw [hd]117exact 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 := by128classical129let U := ρ.positive.isHermitian.eigenvectorUnitary130let V := star U131let τ (j : κ) := (σ j).unitaryConjugate V132have hdiag : (ρ.unitaryConjugate V).matrix =133Matrix.diagonal (fun i => (ρ.weights i : ℂ)) :=134ρ.positive.isHermitian.conjStarAlgAut_star_eigenvectorUnitary135have hmat : (ρ.unitaryConjugate V).matrix = ∑ j, (p j : ℂ) • (τ j).matrix := by136change (V : Matrix ι ι ℂ) * ρ.matrix * (star V : Matrix ι ι ℂ) = _137rw [hmixture, Matrix.mul_sum, Matrix.sum_mul]138simp only [τ, DensityMatrix.unitaryConjugate, Matrix.mul_smul, Matrix.smul_mul]139have hd (i : ι) : ρ.weights i = ∑ j, p j * ((τ j).matrix i i).re := by140have h := congrArg (fun M : Matrix ι ι ℂ => (M i i).re) (hdiag.symm.trans hmat)141simpa [Matrix.sum_apply, Matrix.smul_apply, smul_eq_mul, Complex.mul_re] using h142have hnonneg (j : κ) (i : ι) : 0 ≤ ((τ j).matrix i i).re :=143(Complex.nonneg_iff.mp (τ j).positive.diag_nonneg).1144calc145(∑ j, p j * (σ j).vonNeumann) = ∑ j, p j * (τ j).vonNeumann := by146simp only [τ, DensityMatrix.unitaryConjugate_entropy]147_ ≤ ∑ j, p j * shannon (fun i => ((τ j).matrix i i).re) :=148Finset.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) :=151shannon_mixture_concave p hp hsum _ hnonneg152_ = ρ.vonNeumann := by153simp_rw [← hd]154rfl155156/-- 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 :=162densityMatrix_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) := by166simp [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 := by175calc176(bipartiteLeft A hnorm).vonNeumann = (bipartiteRight A hnorm).vonNeumann :=177bipartite_entropy_eq A hnorm178_ ≤ shannon (fun j => ((bipartiteRight A hnorm).matrix j j).re) :=179DensityMatrix.vonNeumann_le_diagonal (bipartiteRight A hnorm)180_ = shannon p := by181congr 1182funext j183exact (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) :188shannon (fun ji : κ × ι => p ji.1 * q ji.1 ji.2) =189shannon p + ∑ j, p j * shannon (q j) := by190simp only [shannon_eq_sum_negMulLog, Fintype.sum_prod_type, Real.negMulLog_mul,191Finset.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 ι (κ × ι) ℂ :=197fun 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 : ℂ) *205star ((ρ.positive.isHermitian.eigenvectorUnitary : Matrix ι ι ℂ) l k) := by206conv_lhs =>207rw [ρ.positive.isHermitian.spectral_theorem, Unitary.conjStarAlgAut_apply,208Matrix.mul_apply]209simp only [Matrix.mul_diagonal, Matrix.star_apply]210rfl211212lemma ensembleAmplitude_term {ι κ : Type*} [Fintype ι] [DecidableEq ι]213(p : κ → ℝ) (hp : ∀ j, 0 ≤ p j) (σ : κ → DensityMatrix ι)214(i l : ι) (j : κ) (k : ι) :215ensembleAmplitude 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 : ℂ) *219star (((σ j).positive.isHermitian.eigenvectorUnitary : Matrix ι ι ℂ) l k)) := by220have hw : 0 ≤ p j * (σ j).weights k := mul_nonneg (hp j) ((σ j).weights_nonneg k)221have hs : (Real.sqrt (p j * (σ j).weights k) : ℂ) *222(Real.sqrt (p j * (σ j).weights k) : ℂ) = (p j * (σ j).weights k : ℝ) := by223exact_mod_cast Real.mul_self_sqrt hw224simp only [ensembleAmplitude, star_mul, Complex.star_def, Complex.conj_ofReal]225calc226_ = ((Real.sqrt (p j * (σ j).weights k) : ℂ) *227(Real.sqrt (p j * (σ j).weights k) : ℂ)) *228(((σ j).positive.isHermitian.eigenvectorUnitary : Matrix ι ι ℂ) i k *229conj (((σ 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 ι) :236ensembleAmplitude p σ * (ensembleAmplitude p σ)ᴴ =237∑ j, (p j : ℂ) • (σ j).matrix := by238classical239ext i l240simp only [Matrix.mul_apply, Matrix.conjTranspose_apply, Fintype.sum_prod_type,241Matrix.sum_apply, Matrix.smul_apply, smul_eq_mul]242simp_rw [ensembleAmplitude_term p hp σ i l]243simp 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 := by249have hw : 0 ≤ p j * (σ j).weights k := mul_nonneg (hp j) ((σ j).weights_nonneg k)250simp only [ensembleAmplitude, Complex.normSq_mul, Complex.normSq_ofReal,251Real.mul_self_sqrt hw]252rw [← Finset.mul_sum]253have hc := unitaryWeights_col_sum (σ j).positive.isHermitian.eigenvectorUnitary k254unfold unitaryWeights at hc255rw [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 ≤265shannon p + ∑ j, p j * (σ j).vonNeumann := by266let A := ensembleAmplitude p σ267have hleft : A * Aᴴ = (DensityMatrix.mixture p hp hsum σ).matrix :=268ensembleAmplitude_leftGram p hp σ269have hn : (A * Aᴴ).trace = 1 := by270rw [hleft]271exact (DensityMatrix.mixture p hp hsum σ).normalized272have hstate : bipartiteLeft A hn = DensityMatrix.mixture p hp hsum σ :=273DensityMatrix.ext hleft274have 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)277rw [hstate, shannon_joint p (fun j => (σ j).weights) (fun j => (σ j).weights_sum)] at hb278exact hb279280end281282end Nonadditivity.EntropyMixtures