Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.StateEnsembles

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

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

57 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.Order.ConditionallyCompleteLattice.Basic89/-!10# Ensembles of actual quantum states1112Every average below is proved positive semidefinite and trace one. The13Holevo quantity is a supremum over normalized finite ensembles of states in14the specified output set. Entropies use natural logarithms.15-/1617noncomputable section1819namespace Nonadditivity.Entropy2021open scoped BigOperators ComplexOrder Matrix2223variable {ι : Type*} [Fintype ι] [DecidableEq ι]2425@[ext] theorem DensityMatrix.ext {ρ σ : DensityMatrix ι}26    (h : ρ.matrix = σ.matrix) : ρ = σ := by27  cases ρ28  cases σ29  cases h30  rfl3132/-- A convex combination is an actual state, including zero-weight terms. -/33def DensityMatrix.mixture {κ : Type*} [Fintype κ]34    (p : κ → ℝ) (hp : ∀ k, 0 ≤ p k) (hsum : ∑ k, p k = 1)35    (ρ : κ → DensityMatrix ι) : DensityMatrix ι where36  matrix := ∑ k, (p k : ℂ) • (ρ k).matrix37  positive := Matrix.posSemidef_sum _ (fun k _ => (ρ k).positive.smul38    (show (0 : ℂ) ≤ (p k : ℂ) by exact_mod_cast hp k))39  normalized := by40    simp only [Matrix.trace_sum, Matrix.trace_smul, DensityMatrix.normalized]41    rw [← Finset.sum_smul, ← Complex.ofReal_sum, hsum]42    simp4344@[simp] theorem DensityMatrix.mixture_matrix {κ : Type*} [Fintype κ]45    (p : κ → ℝ) (hp : ∀ k, 0 ≤ p k) (hsum : ∑ k, p k = 1)46    (ρ : κ → DensityMatrix ι) :47    (DensityMatrix.mixture p hp hsum ρ).matrix = ∑ k, (p k : ℂ) • (ρ k).matrix := rfl4849/-- The completely mixed state. -/50def maximallyMixed (ι : Type*) [Fintype ι] [DecidableEq ι] [Nonempty ι] :51    DensityMatrix ι where52  matrix := ((1 / (Fintype.card ι : ℝ) : ℝ) : ℂ) • (1 : Matrix ι ι ℂ)53  positive := Matrix.PosSemidef.one.smul (show (0 : ℂ) ≤ ((1 / (Fintype.card ι : ℝ) : ℝ) : ℂ) by54    exact_mod_cast (show (0 : ℝ) ≤ 1 / (Fintype.card ι : ℝ) by positivity))55  normalized := by56    rw [Matrix.trace_smul, Matrix.trace_one]57    simp only [smul_eq_mul, Complex.ofReal_div, Complex.ofReal_one,58      Complex.ofReal_natCast]59    field_simp6061theorem maximallyMixed_purity [Nonempty ι] :62    (maximallyMixed ι).purity = 1 / (Fintype.card ι : ℝ) := by63  have h := (maximallyMixed ι).trace_square_eq_purity64  have hd : (Fintype.card ι : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero65  have hm : ((maximallyMixed ι).matrix * (maximallyMixed ι).matrix).trace =66      ((1 / (Fintype.card ι : ℝ) : ℝ) : ℂ) := by67    simp only [maximallyMixed, Matrix.smul_mul, Matrix.mul_smul, Matrix.one_mul,68      Matrix.trace_smul, Matrix.trace_one, smul_smul]69    simp only [smul_eq_mul, ← Complex.ofReal_mul, ← Complex.ofReal_natCast]70    congr 171    field_simp72  rw [hm] at h73  exact Complex.ofReal_injective h.symm7475theorem maximallyMixed_entropy [Nonempty ι] :76    (maximallyMixed ι).vonNeumann = Real.log (Fintype.card ι) := by77  apply le_antisymm (maximallyMixed ι).vonNeumann_le_log_dim78  have h := (maximallyMixed ι).vonNeumann_ge_neg_log_purity79  simpa [maximallyMixed_purity, Real.log_inv] using h8081end Nonadditivity.Entropy8283namespace Nonadditivity.StateEnsembles8485open Entropy86open scoped BigOperators8788variable {ι : Type*} [Fintype ι] [DecidableEq ι]8990structure Ensemble (outputs : Set (DensityMatrix ι)) where91  size : ℕ92  weight : Fin size → ℝ93  weight_nonneg : ∀ i, 0 ≤ weight i94  weight_sum : ∑ i, weight i = 195  state : Fin size → DensityMatrix ι96  state_mem : ∀ i, state i ∈ outputs9798def Ensemble.average {outputs : Set (DensityMatrix ι)} (e : Ensemble outputs) :99    DensityMatrix ι :=100  DensityMatrix.mixture e.weight e.weight_nonneg e.weight_sum e.state101102def Ensemble.information {outputs : Set (DensityMatrix ι)} (e : Ensemble outputs) : ℝ :=103  e.average.vonNeumann - ∑ i, e.weight i * (e.state i).vonNeumann104105def minimumEntropy (outputs : Set (DensityMatrix ι)) : ℝ :=106  sInf (DensityMatrix.vonNeumann '' outputs)107108def quantity (outputs : Set (DensityMatrix ι)) : ℝ :=109  sSup (Set.range fun e : Ensemble outputs => e.information)110111def singleton {outputs : Set (DensityMatrix ι)} (ρ : DensityMatrix ι)112    (hρ : ρ ∈ outputs) : Ensemble outputs where113  size := 1114  weight := fun _ => 1115  weight_nonneg := fun _ => zero_le_one116  weight_sum := by simp117  state := fun _ => ρ118  state_mem := fun _ => hρ119120@[simp] theorem singleton_information {outputs : Set (DensityMatrix ι)}121    (ρ : DensityMatrix ι) (hρ : ρ ∈ outputs) :122    (singleton ρ hρ).information = 0 := by123  have ha : (singleton ρ hρ).average = ρ := by124    apply DensityMatrix.ext125    simp [Ensemble.average, singleton]126  unfold Ensemble.information127  rw [ha]128  simp [singleton]129130theorem entropy_bddBelow (outputs : Set (DensityMatrix ι)) :131    BddBelow (DensityMatrix.vonNeumann '' outputs) := by132  refine ⟨0, ?_⟩133  rintro _ ⟨ρ, _, rfl⟩134  exact ρ.vonNeumann_nonneg135136theorem minimumEntropy_le {outputs : Set (DensityMatrix ι)}137    {ρ : DensityMatrix ι} (hρ : ρ ∈ outputs) :138    minimumEntropy outputs ≤ ρ.vonNeumann :=139  csInf_le (entropy_bddBelow outputs) ⟨ρ, hρ, rfl⟩140141theorem information_le [Nonempty ι] {outputs : Set (DensityMatrix ι)}142    (e : Ensemble outputs) {s : ℝ}143    (hmin : ∀ ρ ∈ outputs, s ≤ ρ.vonNeumann) :144    e.information ≤ Real.log (Fintype.card ι) - s := by145  have hsum : s ≤ ∑ i, e.weight i * (e.state i).vonNeumann := by146    calc147      s = ∑ i, e.weight i * s := by rw [← Finset.sum_mul, e.weight_sum, one_mul]148      _ ≤ _ := Finset.sum_le_sum fun i _ =>149        mul_le_mul_of_nonneg_left (hmin _ (e.state_mem i)) (e.weight_nonneg i)150  have hmax := e.average.vonNeumann_le_log_dim151  unfold Ensemble.information152  linarith153154theorem information_bddAbove [Nonempty ι] (outputs : Set (DensityMatrix ι)) :155    BddAbove (Set.range fun e : Ensemble outputs => e.information) := by156  refine ⟨Real.log (Fintype.card ι), ?_⟩157  rintro _ ⟨e, rfl⟩158  simpa using information_le e (fun ρ _ => ρ.vonNeumann_nonneg)159160theorem quantity_nonneg [Nonempty ι] {outputs : Set (DensityMatrix ι)}161    (hne : outputs.Nonempty) : 0 ≤ quantity outputs := by162  obtain ⟨ρ, hρ⟩ := hne163  have h := le_csSup (information_bddAbove outputs)164    (show (singleton ρ hρ).information ∈ Set.range (fun e : Ensemble outputs => e.information)165      from ⟨singleton ρ hρ, rfl⟩)166  simpa [quantity] using h167168/-- The upper Holevo bound for a set of genuine quantum outputs. -/169theorem quantity_le [Nonempty ι] {outputs : Set (DensityMatrix ι)}170    (hne : outputs.Nonempty) {s : ℝ}171    (hmin : ∀ ρ ∈ outputs, s ≤ ρ.vonNeumann) :172    quantity outputs ≤ Real.log (Fintype.card ι) - s := by173  obtain ⟨ρ, hρ⟩ := hne174  unfold quantity175  have hs : (Set.range fun e : Ensemble outputs => e.information).Nonempty :=176    ⟨(singleton ρ hρ).information, singleton ρ hρ, rfl⟩177  apply csSup_le hs178  rintro _ ⟨e, rfl⟩179  exact information_le e hmin180181theorem quantity_le_log_dim_sub_minimumEntropy [Nonempty ι]182    {outputs : Set (DensityMatrix ι)} (hne : outputs.Nonempty) :183    quantity outputs ≤ Real.log (Fintype.card ι) - minimumEntropy outputs :=184  quantity_le hne (fun _ hρ => minimumEntropy_le hρ)185186/-- An orbit of *any* output gives a lower bound, without a minimizing state. -/187theorem orbit_lower_bound [Nonempty ι] {outputs : Set (DensityMatrix ι)}188    (e : Ensemble outputs) (ρ : DensityMatrix ι)189    (havg : e.average = maximallyMixed ι)190    (hent : ∀ i, (e.state i).vonNeumann = ρ.vonNeumann) :191    Real.log (Fintype.card ι) - ρ.vonNeumann ≤ quantity outputs := by192  have hinfo : e.information = Real.log (Fintype.card ι) - ρ.vonNeumann := by193    unfold Ensemble.information194    simp_rw [hent]195    rw [← Finset.sum_mul, e.weight_sum, one_mul, havg, maximallyMixed_entropy]196  rw [← hinfo]197  exact le_csSup (information_bddAbove outputs) ⟨e, rfl⟩198199/-- Covariance suffices for the equality; compactness and attainment are unnecessary. -/200theorem quantity_eq_of_orbits [Nonempty ι] {outputs : Set (DensityMatrix ι)}201    (hne : outputs.Nonempty)202    (horbit : ∀ ρ ∈ outputs, ∃ e : Ensemble outputs,203      e.average = maximallyMixed ι ∧204      ∀ i, (e.state i).vonNeumann = ρ.vonNeumann) :205    quantity outputs = Real.log (Fintype.card ι) - minimumEntropy outputs := by206  apply le_antisymm (quantity_le_log_dim_sub_minimumEntropy hne)207  have hglb : Real.log (Fintype.card ι) - quantity outputs ≤ minimumEntropy outputs := by208    apply le_csInf (hne.image _)209    rintro _ ⟨ρ, hρ, rfl⟩210    obtain ⟨e, havg, hent⟩ := horbit ρ hρ211    have h := orbit_lower_bound e ρ havg hent212    linarith213  linarith214215end Nonadditivity.StateEnsembles