Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.AdjointPurity

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

Direct imports

  • Nonadditivity.Entropy
  • Mathlib.Analysis.Matrix.Order dependency
  • Mathlib.Analysis.CStarAlgebra.Matrix dependency
  • Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order dependency
  • Mathlib.Data.Real.Sqrt dependency
  • Mathlib.Tactic.Linarith dependency

Imported by project modules

6 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

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

13 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.Order8import Mathlib.Analysis.CStarAlgebra.Matrix9import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order10import Mathlib.Data.Real.Sqrt11import Mathlib.Tactic.Linarith1213/-!14# Concrete state expectations and the adjoint-to-purity bridge1516The norm on matrices in this file is the Euclidean operator norm. The17Hilbert--Schmidt length is defined by the actual matrix trace, independently18of the operator norm instance. The state expectation bound is proved from19positive semidefiniteness and trace normalization.20-/2122noncomputable section2324namespace Nonadditivity.AdjointPurity2526open Nonadditivity.Entropy27open scoped Matrix ComplexOrder MatrixOrder Matrix.Norms.L2Operator2829set_option backward.isDefEq.respectTransparency false3031variable {ι κ : Type*} [Fintype ι] [DecidableEq ι]32  [Fintype κ] [DecidableEq κ]3334/-- Even though a product of positive matrices need not be positive,35its trace is nonnegative. -/36theorem trace_mul_nonneg {A B : Matrix ι ι ℂ}37    (hA : A.PosSemidef) (hB : B.PosSemidef) : 0 ≤ (A * B).trace := by38  have hQ : (CFC.sqrt A).conjTranspose = CFC.sqrt A :=39    (Matrix.nonneg_iff_posSemidef.mp (CFC.sqrt_nonneg A)).isHermitian.eq40  have htrace := (hB.conjTranspose_mul_mul_same (CFC.sqrt A)).trace_nonneg41  rw [Matrix.trace_mul_cycle, hQ, CFC.sqrt_mul_sqrt_self A hA.nonneg] at htrace42  exact htrace4344/-- A normalized density matrix evaluates every Hermitian observable below45its operator norm. This supplies the missing input-state estimate. -/46theorem state_expectation_re_le_opNorm (ρ : DensityMatrix ι)47    (A : Matrix ι ι ℂ) (hA : A.IsHermitian) :48    (ρ.matrix * A).trace.re ≤ ‖A‖ := by49  letI : CStarAlgebra (Matrix ι ι ℂ) := { }50  have hupper : A ≤ algebraMap ℝ (Matrix ι ι ℂ) ‖A‖ :=51    IsSelfAdjoint.le_algebraMap_norm_self (A := Matrix ι ι ℂ) hA.isSelfAdjoint52  have htrace := trace_mul_nonneg ρ.positive (Matrix.le_iff.mp hupper)53  have hscalar : (ρ.matrix * algebraMap ℝ (Matrix ι ι ℂ) ‖A‖).trace = (‖A‖ : ℂ) := by54    simp [Algebra.algebraMap_eq_smul_one, Matrix.trace_smul, ρ.normalized]55  have hre : 0 ≤ (ρ.matrix * (algebraMap ℝ (Matrix ι ι ℂ) ‖A‖ - A)).trace.re :=56    (RCLike.nonneg_iff.mp htrace).157  rw [Matrix.mul_sub, Matrix.trace_sub, hscalar, Complex.sub_re, Complex.ofReal_re] at hre58  linarith5960/-- The absolute state expectation estimate in the manuscript. -/61theorem abs_state_expectation_re_le_opNorm (ρ : DensityMatrix ι)62    (A : Matrix ι ι ℂ) (hA : A.IsHermitian) :63    |(ρ.matrix * A).trace.re| ≤ ‖A‖ := by64  have hu := state_expectation_re_le_opNorm ρ A hA65  have hl := state_expectation_re_le_opNorm ρ (-A) hA.neg66  simp only [Matrix.mul_neg, Matrix.trace_neg, Complex.neg_re, norm_neg] at hl67  exact abs_le.mpr ⟨by linarith, hu⟩6869/-- Hermitian state-observable trace pairings are real even when the two70matrices do not commute. -/71theorem state_expectation_im_eq_zero (ρ : DensityMatrix ι)72    (A : Matrix ι ι ℂ) (hA : A.IsHermitian) : (ρ.matrix * A).trace.im = 0 := by73  have hstar : star ((ρ.matrix * A).trace) = (ρ.matrix * A).trace := by74    rw [← Matrix.trace_conjTranspose, Matrix.conjTranspose_mul,75      hA.eq, ρ.positive.isHermitian.eq, Matrix.trace_mul_comm]76  have him := congrArg Complex.im hstar77  change -(ρ.matrix * A).trace.im = (ρ.matrix * A).trace.im at him78  linarith7980/-- Literal complex absolute-value version of the normalized state bound. -/81theorem norm_state_expectation_le_opNorm (ρ : DensityMatrix ι)82    (A : Matrix ι ι ℂ) (hA : A.IsHermitian) : ‖(ρ.matrix * A).trace‖ ≤ ‖A‖ := by83  have hreal : (ρ.matrix * A).trace = ((ρ.matrix * A).trace.re : ℂ) := by84    apply Complex.ext85    · rfl86    · simpa using state_expectation_im_eq_zero ρ A hA87  rw [hreal, Complex.norm_real, Real.norm_eq_abs]88  exact abs_state_expectation_re_le_opNorm ρ A hA8990/-- The actual Hilbert--Schmidt length computed by matrix multiplication. -/91def hsLength (A : Matrix ι ι ℂ) : ℝ :=92  Real.sqrt ((A.conjTranspose * A).trace.re)9394omit [DecidableEq ι] in95theorem hsLength_nonneg (A : Matrix ι ι ℂ) : 0 ≤ hsLength A :=96  Real.sqrt_nonneg _9798omit [DecidableEq ι] in99theorem trace_conjTranspose_mul_self_re_nonneg (A : Matrix ι ι ℂ) :100    0 ≤ (A.conjTranspose * A).trace.re :=101  (RCLike.nonneg_iff.mp (Matrix.posSemidef_conjTranspose_mul_self A).trace_nonneg).1102103omit [DecidableEq ι] in104theorem hsLength_sq (A : Matrix ι ι ℂ) :105    hsLength A ^ 2 = (A.conjTranspose * A).trace.re :=106  Real.sq_sqrt (trace_conjTranspose_mul_self_re_nonneg A)107108omit [DecidableEq ι] in109theorem hsLength_sq_of_isHermitian (A : Matrix ι ι ℂ) (hA : A.IsHermitian) :110    hsLength A ^ 2 = (A * A).trace.re := by111  rw [hsLength_sq, hA.eq]112113/-- The channel's matrix-trace adjoint certificate bounds the genuine114centered Hilbert--Schmidt length. The state expectation bound is a theorem115above, rather than an assumption in this statement. -/116theorem centered_hsLength_le_of_adjoint_certificate [Nonempty ι]117    (ρ : DensityMatrix κ) (Y : DensityMatrix ι)118    (adjoint : Matrix ι ι ℂ →ₗ[ℂ] Matrix κ κ ℂ) {t : ℝ} (ht : 0 ≤ t)119    (hhermitian : ∀ A, A.IsHermitian → (adjoint A).IsHermitian)120    (hduality : ∀ A, A.IsHermitian → A.trace = 0 →121      (Y.matrix * A).trace = (ρ.matrix * adjoint A).trace)122    (hcertificate : ∀ A, A.IsHermitian → A.trace = 0 →123      ‖adjoint A‖ ≤ t * hsLength A) : hsLength Y.centered ≤ t := by124  have hHerm := Y.centered_isHermitian125  have htrace := Y.centered_trace_zero126  have hsq : hsLength Y.centered ^ 2 ≤ t * hsLength Y.centered := by127    calc128      hsLength Y.centered ^ 2 = (Y.centered * Y.centered).trace.re :=129        hsLength_sq_of_isHermitian _ hHerm130      _ = (Y.matrix * Y.centered).trace.re := by rw [Y.centered_trace_pairing]131      _ = (ρ.matrix * adjoint Y.centered).trace.re := by rw [hduality _ hHerm htrace]132      _ ≤ ‖adjoint Y.centered‖ :=133        state_expectation_re_le_opNorm ρ _ (hhermitian _ hHerm)134      _ ≤ t * hsLength Y.centered := hcertificate _ hHerm htrace135  nlinarith [hsLength_nonneg Y.centered]136137/-- Both conclusions of Lemma `purity`, from a concrete matrix-trace adjoint138relation and a genuine operator-to-Hilbert--Schmidt norm certificate. -/139theorem purity_and_entropy_of_adjoint_certificate [Nonempty ι]140    (ρ : DensityMatrix κ) (Y : DensityMatrix ι)141    (adjoint : Matrix ι ι ℂ →ₗ[ℂ] Matrix κ κ ℂ) {t : ℝ} (ht : 0 ≤ t)142    (hhermitian : ∀ A, A.IsHermitian → (adjoint A).IsHermitian)143    (hduality : ∀ A, A.IsHermitian → A.trace = 0 →144      (Y.matrix * A).trace = (ρ.matrix * adjoint A).trace)145    (hcertificate : ∀ A, A.IsHermitian → A.trace = 0 →146      ‖adjoint A‖ ≤ t * hsLength A) :147    Y.purity ≤ 1 / (Fintype.card ι : ℝ) + t ^ 2 ∧148      Real.log (Fintype.card ι) - Real.log (1 + (Fintype.card ι : ℝ) * t ^ 2) ≤149        Y.vonNeumann := by150  have hlength := centered_hsLength_le_of_adjoint_certificate ρ Y adjoint ht151    hhermitian hduality hcertificate152  apply Y.purity_and_entropy_of_centered_bound t153  rw [← hsLength_sq_of_isHermitian _ Y.centered_isHermitian]154  exact pow_le_pow_left₀ (hsLength_nonneg Y.centered) hlength 2155156/-- Instantiation for ordinary complex linear maps with the standard trace157duality. The output is supplied as an actual normalized positive density158matrix, so no hidden output-positivity premise is used. -/159theorem channel_output_purity_and_entropy [Nonempty ι]160    (channel : Matrix κ κ ℂ →ₗ[ℂ] Matrix ι ι ℂ)161    (adjoint : Matrix ι ι ℂ →ₗ[ℂ] Matrix κ κ ℂ)162    (ρ : DensityMatrix κ) (Y : DensityMatrix ι)163    (houtput : channel ρ.matrix = Y.matrix) {t : ℝ} (ht : 0 ≤ t)164    (hhermitian : ∀ A, A.IsHermitian → (adjoint A).IsHermitian)165    (hduality : ∀ X A, (channel X * A).trace = (X * adjoint A).trace)166    (hcertificate : ∀ A, A.IsHermitian → A.trace = 0 →167      ‖adjoint A‖ ≤ t * hsLength A) :168    Y.purity ≤ 1 / (Fintype.card ι : ℝ) + t ^ 2 ∧169      Real.log (Fintype.card ι) - Real.log (1 + (Fintype.card ι : ℝ) * t ^ 2) ≤170        Y.vonNeumann := by171  apply purity_and_entropy_of_adjoint_certificate ρ Y adjoint ht hhermitian _ hcertificate172  intro A _ _173  rw [← houtput]174  exact hduality ρ.matrix A175176end Nonadditivity.AdjointPurity