Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.QuantumCodingHSW

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

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

10 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.QuantumCodingTypicalTests7import Nonadditivity.QuantumCodingPacking8import Nonadditivity.QuantumCodingChannelWords9import Nonadditivity.QuantumCodingRates1011/-! # Achievability of finite-ensemble Holevo information1213The codes below have actual density-matrix codewords on channel tensor14powers and normalized POVM decoders. Their error is the Born error, bounded15by the independently proved spectral typicality and sequential packing16estimates. No coding theorem or capacity identification is assumed.17-/1819noncomputable section20namespace Nonadditivity.QuantumCoding2122open Entropy Channels Operational RegularizedHolevo23open scoped BigOperators ComplexOrder Matrix2425variable {ι ο κ α : Type*}26  [Fintype ι] [DecidableEq ι] [Fintype ο] [DecidableEq ο] [Fintype κ] [Fintype α]2728def outputEnsembleInformation (T : KrausChannel ι ο κ) (p : α → ℝ)29    (hp : ∀ a, 0 ≤ p a) (hs : ∑ a, p a = 1) (ρ : α → DensityMatrix ι) : ℝ :=30  (DensityMatrix.mixture p hp hs (fun a => T.output (ρ a))).vonNeumann -31    ensembleConditionalEntropy p (fun a => T.output (ρ a))3233def ensembleCodingVariance (T : KrausChannel ι ο κ) (p : α → ℝ)34    (hp : ∀ a, 0 ≤ p a) (hs : ∑ a, p a = 1) (ρ : α → DensityMatrix ι) : ℝ :=35  9 * QuantumCodingTypicality.variance36    (DensityMatrix.mixture p hp hs (fun a => T.output (ρ a))).weights +37  8 * ensembleConditionalVariance p (fun a => T.output (ρ a))3839/-- Actual finite-block codes with the explicit HSW packing estimate. -/40theorem finite_ensemble_codes (T : KrausChannel ι ο κ) (p : α → ℝ)41    (hp : ∀ a, 0 ≤ p a) (hs : ∑ a, p a = 1) (ρ : α → DensityMatrix ι)42    (n M : ℕ) (hM : 0 < M) {δ : ℝ} (hδ : 0 < δ) :43    ∃ C : Code (positiveTensorPower T n) M,44      C.error ≤ ensembleCodingVariance T p hp hs ρ /45        (((n + 1 : ℕ) : ℝ) * δ ^ 2) +46        4 * (M - 1 : ℕ) * Real.exp (-((n + 1 : ℕ) : ℝ) *47          (outputEnsembleInformation T p hp hs ρ - 2 * δ)) := by48  let out := fun a => T.output (ρ a)49  let σ := DensityMatrix.mixture p hp hs out50  let G := globalTypicalTest σ (n + 1) δ51  let Q := conditionalTypicalTest p out (n + 1) δ52  let w := tensorWeights p (n + 1)53  let states := fun x : Fin (n + 1) → α => tensorFamilyState (fun j => out (x j))54  have hcross : (∑ x, ∑ y, w x * w y * crossAcceptance G (Q y) (states x)) ≤55      Real.exp (-((n + 1 : ℕ) : ℝ) * (σ.vonNeumann - ensembleConditionalEntropy p out - 2 * δ)) := by56    have h := typicalProjectors_average_cross_le p hp hs out (n + 1) δ57    rw [Finset.sum_comm]58    simpa only [crossAcceptance, G, Q, globalTypicalTest, conditionalTypicalTest,59      states, w, Matrix.mul_assoc, mul_comm] using h60  obtain ⟨c, D, hD⟩ := exists_projective_packing hM G Q w61    (tensorWeights_nonneg p hp (n + 1)) (tensorWeights_sum p hs (n + 1)) states62    (globalTypicalTest_mean_rejection_le p hp hs out (Nat.succ_pos n) hδ)63    (conditionalTypicalTest_mean_rejection_le p hp hs out (Nat.succ_pos n) hδ) hcross64  refine ⟨wordCode T n M (fun m j => ρ (c m j)) D, ?_⟩65  rw [wordCode_error]66  have herr : 1 - (∑ m, D.probability67      (tensorFamilyState (fun j => T.output (ρ (c m j)))) m) / (M : ℝ) =68      1 - (M : ℝ)⁻¹ * ∑ m, D.probability (states (c m)) m := by69    simp only [states, out, div_eq_mul_inv, mul_comm]70  rw [herr]71  convert hD using 172  unfold ensembleCodingVariance outputEnsembleInformation73  dsimp [out, σ]74  ring7576/-- Every nonnegative rate strictly below a finite input ensemble's Holevo77information is attained by actual channel codes with error tending to zero. -/78theorem ensemble_rate_achievable [Nonempty ι] [Nonempty ο]79    (T : KrausChannel ι ο κ) (p : α → ℝ)80    (hp : ∀ a, 0 ≤ p a) (hs : ∑ a, p a = 1) (ρ : α → DensityMatrix ι)81    {r : ℝ} (hr : 0 ≤ r) (hinfo : r < outputEnsembleInformation T p hp hs ρ) :82    AchievableRate T (r / Real.log 2) := by83  let χ := outputEnsembleInformation T p hp hs ρ84  let δ := (χ - r) / 485  have hδ : 0 < δ := by dsimp [δ, χ]; linarith86  have hgap : r < χ - 2 * δ := by dsimp [δ, χ]; linarith87  apply achievableRate_of_finite_codes T hr hgap88    (ensembleCodingVariance T p hp hs ρ / δ ^ 2)89  intro n90  obtain ⟨C, hC⟩ := finite_ensemble_codes T p hp hs ρ n (expMessages r n)91    (expMessages_pos r n) hδ92  refine ⟨C, hC.trans ?_⟩93  have hc : ((expMessages r n - 1 : ℕ) : ℝ) ≤ (expMessages r n : ℝ) := by94    exact_mod_cast Nat.sub_le (expMessages r n) 195  have hm := mul_le_mul_of_nonneg_right96    (mul_le_mul_of_nonneg_left hc (by norm_num : (0 : ℝ) ≤ 4))97      (Real.exp_nonneg (-((n + 1 : ℕ) : ℝ) * (χ - 2 * δ)))98  have hdiv : ensembleCodingVariance T p hp hs ρ / (((n + 1 : ℕ) : ℝ) * δ ^ 2) =99      (ensembleCodingVariance T p hp hs ρ / δ ^ 2) / ((n + 1 : ℕ) : ℝ) := by100    rw [div_div, mul_comm]101  rw [hdiv]102  exact add_le_add (le_refl _) hm103104theorem ensemble_information_le_capacity [Nonempty ι] [Nonempty ο]105    (T : KrausChannel ι ο κ) (p : α → ℝ)106    (hp : ∀ a, 0 ≤ p a) (hs : ∑ a, p a = 1) (ρ : α → DensityMatrix ι) :107    outputEnsembleInformation T p hp hs ρ / Real.log 2 ≤ operationalCapacity T := by108  apply le_of_forall_lt_imp_le_of_dense109  intro q hq110  by_cases hq0 : 0 ≤ q111  · have h := ensemble_rate_achievable T p hp hs ρ112      (mul_nonneg hq0 Scalar.log_two_pos.le) ((lt_div_iff₀ Scalar.log_two_pos).mp hq)113    have hcap := achievableRate_le_capacity h114    simpa only [mul_div_cancel_right₀ _ Scalar.log_two_pos.ne'] using hcap115  · exact (le_of_not_ge hq0).trans (operationalCapacity_nonneg T)116117/-- HSW lower bound for the actual single-use Holevo supremum. Every finite118output ensemble is lifted to real channel inputs, then encoded by the119constructed vanishing-error codes. -/120theorem holevoBits_le_operationalCapacity [Nonempty ι] [Nonempty ο]121    (T : KrausChannel ι ο κ) : T.holevoBits ≤ operationalCapacity T := by122  apply (div_le_iff₀ Scalar.log_two_pos).mpr123  change StateEnsembles.quantity T.outputs ≤ operationalCapacity T * Real.log 2124  unfold StateEnsembles.quantity125  have hne : (Set.range (fun e : StateEnsembles.Ensemble T.outputs => e.information)).Nonempty := by126    obtain ⟨σ, hσ⟩ := T.outputs_nonempty127    exact ⟨_, ⟨StateEnsembles.singleton σ hσ, rfl⟩⟩128  apply csSup_le hne129  rintro _ ⟨e, rfl⟩130  have hex : ∀ a, ∃ ρ : DensityMatrix ι, T.output ρ = e.state a := e.state_mem131  choose input hinput using hex132  have hinfo : outputEnsembleInformation T e.weight e.weight_nonneg e.weight_sum input =133      e.information := by134    unfold outputEnsembleInformation ensembleConditionalEntropy135    simp_rw [hinput]136    rfl137  have h := ensemble_information_le_capacity T e.weight e.weight_nonneg e.weight_sum input138  rw [hinfo] at h139  exact (div_le_iff₀ Scalar.log_two_pos).mp h140141end Nonadditivity.QuantumCoding