Exact Lean source
Nonadditivity.EntropyContinuity
Download original .lean · View on GitHub · Jump to source
Direct imports
Nonadditivity.HaarMomentTailMathlib.Topology.UniformSpace.HeineCantordependency
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
Nonadditivity.EntropyContinuity.abs_diagonal_re_le_opNormNonadditivity.EntropyContinuity.diagonal_mem_IccNonadditivity.EntropyContinuity.diagonal_mem_Icc._simp_1_1internal/detail/privateNonadditivity.EntropyContinuity.exists_shannon_modulusNonadditivity.EntropyContinuity.exists_vonNeumann_hsLength_modulusNonadditivity.EntropyContinuity.exists_vonNeumann_hsLength_modulus._proof_1_1internal/detail/privateNonadditivity.EntropyContinuity.exists_vonNeumann_opNorm_modulusNonadditivity.EntropyContinuity.unitaryConjugate_sub_norm
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| ≤ η := by38classical39have hd : 0 < (Fintype.card ι : ℝ) + 1 := by positivity40have hu := (isCompact_Icc : IsCompact (Set.Icc (0 : ℝ) 1)).uniformContinuousOn_of_continuous41Real.continuous_negMulLog.continuousOn42obtain ⟨δ, hδ, hmod⟩ := Metric.uniformContinuousOn_iff_le.mp hu43(η / ((Fintype.card ι : ℝ) + 1)) (div_pos hη hd)44refine ⟨δ, hδ, fun p q hp hq hpq => ?_⟩45rw [shannon_eq_sum_negMulLog, shannon_eq_sum_negMulLog, ← Finset.sum_sub_distrib]46calc47|∑ i, (Real.negMulLog (p i) - Real.negMulLog (q i))| ≤48∑ i, |Real.negMulLog (p i) - Real.negMulLog (q i)| :=49Finset.abs_sum_le_sum_abs _ _50_ ≤ ∑ _i : ι, η / ((Fintype.card ι : ℝ) + 1) := by51apply Finset.sum_le_sum52intro i _53exact hmod (p i) (hp i) (q i) (hq i) (by simpa [Real.dist_eq] using hpq i)54_ ≤ η := by55simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul]56rw [← mul_div_assoc]57apply (div_le_iff₀ hd).mpr58nlinarith5960lemma diagonal_mem_Icc (ρ : DensityMatrix ι) (i : ι) :61(ρ.matrix i i).re ∈ Set.Icc (0 : ℝ) 1 := by62have hn (j : ι) : 0 ≤ (ρ.matrix j j).re :=63(Complex.nonneg_iff.mp ρ.positive.diag_nonneg).164have hs : (∑ j, (ρ.matrix j j).re) = 1 := by65simpa only [Matrix.trace, ← Complex.re_sum, Complex.one_re] using66congrArg Complex.re ρ.normalized67exact ⟨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‖ := by73letI : CStarAlgebra (Matrix ι ι ℂ) := { }74have hu : A ≤ algebraMap ℝ (Matrix ι ι ℂ) ‖A‖ :=75IsSelfAdjoint.le_algebraMap_norm_self hA.isSelfAdjoint76have hl : -A ≤ algebraMap ℝ (Matrix ι ι ℂ) ‖-A‖ :=77IsSelfAdjoint.le_algebraMap_norm_self hA.neg.isSelfAdjoint78have hu' : 0 ≤ ((algebraMap ℝ (Matrix ι ι ℂ) ‖A‖ - A) i i).re :=79(Complex.nonneg_iff.mp (Matrix.le_iff.mp hu).diag_nonneg).180have hl' : 0 ≤ ((algebraMap ℝ (Matrix ι ι ℂ) ‖-A‖ - -A) i i).re :=81(Complex.nonneg_iff.mp (Matrix.le_iff.mp hl).diag_nonneg).182simp [Algebra.algebraMap_eq_smul_one, Matrix.sub_apply, Matrix.smul_apply,83Matrix.neg_apply] at hu' hl'84exact 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‖ := by90letI : CStarAlgebra (Matrix ι ι ℂ) := { }91change ‖(U : Matrix ι ι ℂ) * ρ.matrix * (star U : Matrix ι ι ℂ) -92(U : Matrix ι ι ℂ) * σ.matrix * (star U : Matrix ι ι ℂ)‖ = _93rw [← sub_mul, ← mul_sub]94exact (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| ≤ η := by102obtain ⟨δ, hδ, hmod⟩ := exists_shannon_modulus (ι := ι) η hη103have hone (ρ σ : DensityMatrix ι) (hclose : ‖ρ.matrix - σ.matrix‖ ≤ δ) :104ρ.vonNeumann ≤ σ.vonNeumann + η := by105let U := star σ.positive.isHermitian.eigenvectorUnitary106let τ := ρ.unitaryConjugate U107let ω := σ.unitaryConjugate U108have hdiag : ω.matrix = Matrix.diagonal (fun i => (σ.weights i : ℂ)) :=109σ.positive.isHermitian.conjStarAlgAut_star_eigenvectorUnitary110have hcoord (i : ι) : |(τ.matrix i i).re - (ω.matrix i i).re| ≤ δ := by111calc112|(τ.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_ ≤ δ := hclose117have hs := hmod (fun i => (τ.matrix i i).re) (fun i => (ω.matrix i i).re)118(diagonal_mem_Icc τ) (diagonal_mem_Icc ω) hcoord119have hspec : shannon (fun i => (ω.matrix i i).re) = σ.vonNeumann := by120simp only [hdiag, Matrix.diagonal_apply_eq, Complex.ofReal_re]121rfl122rw [hspec] at hs123have hp := DensityMatrix.vonNeumann_le_diagonal τ124have he : τ.vonNeumann = ρ.vonNeumann := ρ.unitaryConjugate_entropy U125have hh := (abs_le.mp hs).2126linarith127refine ⟨δ, hδ, fun ρ σ hclose => abs_le.mpr ⟨?_, ?_⟩⟩128· have hrev : ‖σ.matrix - ρ.matrix‖ ≤ δ := by129simpa only [norm_sub_rev] using hclose130linarith [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 ι,136AdjointPurity.hsLength (ρ.matrix - σ.matrix) ≤ δ →137|ρ.vonNeumann - σ.vonNeumann| ≤ η := by138obtain ⟨δ, hδ, hmod⟩ := exists_vonNeumann_opNorm_modulus (ι := ι) η hη139refine ⟨δ, hδ, fun ρ σ hclose => hmod ρ σ ?_⟩140have hHerm := ρ.positive.isHermitian.sub σ.positive.isHermitian141have hnorm := HaarMomentTail.norm_pow_le_trace_even (ρ.matrix - σ.matrix) hHerm 1142simp only [show 2 * 1 = 2 by omega, pow_two] at hnorm143have hs := AdjointPurity.hsLength_sq_of_isHermitian (ρ.matrix - σ.matrix) hHerm144have hn : ‖ρ.matrix - σ.matrix‖ ≤ AdjointPurity.hsLength (ρ.matrix - σ.matrix) := by145nlinarith [norm_nonneg (ρ.matrix - σ.matrix),146AdjointPurity.hsLength_nonneg (ρ.matrix - σ.matrix)]147exact hn.trans hclose148149end Nonadditivity.EntropyContinuity