Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.OperationalConverse

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

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

67 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.QuantumHolevo78/-! # Actual finite quantum codes and their dimension converse910Messages are encoded into density matrices and decoded by positive operator11valued measures. The error probability is the actual Born probability. The12dimension bound below applies to every code and every Kraus channel, with13no coding or entropy inequalities assumed.14-/1516noncomputable section1718namespace Nonadditivity.Operational1920open Entropy Channels AdjointPurity21open scoped BigOperators Matrix ComplexOrder MatrixOrder Matrix.Norms.L2Operator2223set_option backward.isDefEq.respectTransparency false2425variable {ι ο κ μ : Type*}2627/-- A finite positive operator valued measure, including arbitrary effects28of any rank. -/29structure POVM (ο μ : Type*) [Fintype ο] [DecidableEq ο] [Fintype μ] where30  effect : μ → Matrix ο ο ℂ31  positive : ∀ m, (effect m).PosSemidef32  complete : ∑ m, effect m = 13334namespace POVM3536variable [Fintype ο] [DecidableEq ο] [Fintype μ]3738/-- The actual Born measurement probability. -/39def probability (P : POVM ο μ) (ρ : DensityMatrix ο) (m : μ) : ℝ :=40  (ρ.matrix * P.effect m).trace.re4142theorem probability_nonneg (P : POVM ο μ) (ρ : DensityMatrix ο) (m : μ) :43    0 ≤ P.probability ρ m :=44  (RCLike.nonneg_iff.mp (trace_mul_nonneg ρ.positive (P.positive m))).14546@[simp] theorem probability_sum (P : POVM ο μ) (ρ : DensityMatrix ο) :47    ∑ m, P.probability ρ m = 1 := by48  simp only [probability, ← Complex.re_sum, ← Matrix.trace_sum, ← Matrix.mul_sum,49    P.complete, Matrix.mul_one, ρ.normalized, Complex.one_re]5051theorem probability_le_one (P : POVM ο μ) (ρ : DensityMatrix ο) (m : μ) :52    P.probability ρ m ≤ 1 := by53  rw [← P.probability_sum ρ]54  exact Finset.single_le_sum (fun i _ => P.probability_nonneg ρ i) (Finset.mem_univ m)5556end POVM5758variable [Fintype ι] [DecidableEq ι] [Fintype ο] [DecidableEq ο] [Fintype κ]5960namespace POVM6162variable [Fintype μ]6364/-- Pull a decoder through the channel using the actual Kraus adjoint. -/65def pullback (P : POVM ο μ) (T : KrausChannel ι ο κ) : POVM ι μ where66  effect := fun m => T.adjointMap (P.effect m)67  positive := fun m => T.adjointMap_posSemidef _ (P.positive m)68  complete := by69    change ∑ m, T.adjointLinearMap (P.effect m) = 170    rw [← map_sum, P.complete]71    exact T.adjointMap_one7273@[simp] theorem probability_pullback (P : POVM ο μ) (T : KrausChannel ι ο κ)74    (ρ : DensityMatrix ι) (m : μ) :75    (P.pullback T).probability ρ m = P.probability (T.output ρ) m := by76  exact congrArg Complex.re (T.trace_duality ρ.matrix (P.effect m)).symm7778end POVM7980/-- An unassisted finite code for a specified actual quantum channel.81Uniform messages are used in the average success and error probabilities. -/82structure Code (T : KrausChannel ι ο κ) (M : ℕ) where83  encode : Fin M → DensityMatrix ι84  decode : POVM ο (Fin M)8586namespace DensityMatrix8788theorem weights_le_one (ρ : DensityMatrix ο) (i : ο) : ρ.weights i ≤ 1 := by89  rw [← ρ.weights_sum]90  exact Finset.single_le_sum (fun j _ => ρ.weights_nonneg j) (Finset.mem_univ i)9192/-- A normalized positive matrix is bounded above by the identity. -/93theorem one_sub_posSemidef (ρ : DensityMatrix ο) : (1 - ρ.matrix).PosSemidef := by94  let U := ρ.positive.isHermitian.eigenvectorUnitary95  let D := Matrix.diagonal (fun i => (ρ.weights i : ℂ))96  have hs : ρ.matrix = Unitary.conjStarAlgAut ℂ _ U D :=97    ρ.positive.isHermitian.spectral_theorem98  have hd : (1 - D).PosSemidef := by99    have he : 1 - D = Matrix.diagonal (fun i => ((1 - ρ.weights i : ℝ) : ℂ)) := by100      ext i j101      by_cases h : i = j102      · subst j; simp [D]103      · simp [D, h]104    rw [he]105    exact Matrix.PosSemidef.diagonal (fun i => by106      change (0 : ℂ) ≤ ((1 - ρ.weights i : ℝ) : ℂ)107      exact_mod_cast (sub_nonneg.mpr (weights_le_one ρ i)))108  have hh := hd.mul_mul_conjTranspose_same (U : Matrix ο ο ℂ)109  rw [← Matrix.star_eq_conjTranspose] at hh110  rw [hs]111  simpa only [Unitary.conjStarAlgAut_apply, Matrix.mul_sub, Matrix.sub_mul,112    Matrix.mul_one, ← Unitary.coe_star, Unitary.coe_mul_star_self] using hh113114/-- Every positive effect has expectation at most its trace. -/115theorem expectation_le_trace (ρ : DensityMatrix ο) (E : Matrix ο ο ℂ)116    (hE : E.PosSemidef) : (ρ.matrix * E).trace.re ≤ E.trace.re := by117  have h : 0 ≤ ((1 - ρ.matrix) * E).trace.re := (RCLike.nonneg_iff.mp118    (trace_mul_nonneg (one_sub_posSemidef ρ) hE)).1119  simp only [Matrix.sub_mul, Matrix.one_mul, Matrix.trace_sub, Complex.sub_re] at h120  linarith121122end DensityMatrix123124namespace Code125126variable {T : KrausChannel ι ο κ} {M : ℕ}127128/-- Average correct decoding probability for uniform messages. -/129def success (C : Code T M) : ℝ :=130  (∑ m, C.decode.probability (T.output (C.encode m)) m) / (M : ℝ)131132/-- Average decoding error probability for uniform messages. -/133def error (C : Code T M) : ℝ := 1 - C.success134135theorem success_nonneg (C : Code T M) : 0 ≤ C.success := by136  exact div_nonneg (Finset.sum_nonneg fun m _ => C.decode.probability_nonneg _ m)137    (Nat.cast_nonneg M)138139theorem success_le_one (C : Code T M) : C.success ≤ 1 := by140  by_cases hM : M = 0141  · simp [success, hM]142  · have hp : 0 < (M : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero hM143    apply (div_le_iff₀ hp).mpr144    simpa using Finset.sum_le_sum145      (fun m (_ : m ∈ Finset.univ) => C.decode.probability_le_one (T.output (C.encode m)) m)146147theorem error_nonneg (C : Code T M) : 0 ≤ C.error :=148  sub_nonneg.mpr C.success_le_one149150theorem error_le_one (C : Code T M) : C.error ≤ 1 := by151  unfold error152  linarith [C.success_nonneg]153154/-- The finite dimensional packing converse for actual quantum codes.155It holds for mixed inputs and arbitrary non-projective POVM decoders. -/156theorem success_le_dimension_div_messages (C : Code T M) :157    C.success ≤ (Fintype.card ο : ℝ) / M := by158  apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg M)159  calc160    ∑ m, C.decode.probability (T.output (C.encode m)) m ≤161        ∑ m, (C.decode.effect m).trace.re := by162      exact Finset.sum_le_sum fun m _ => DensityMatrix.expectation_le_trace163        (T.output (C.encode m)) (C.decode.effect m) (C.decode.positive m)164    _ = (Fintype.card ο : ℝ) := by165      rw [← Complex.re_sum, ← Matrix.trace_sum, C.decode.complete, Matrix.trace_one]166      simp167168/-- Any channel code is an identity-channel code with its POVM pulled back169to the input. This is an exact identity of Born probabilities. -/170def pulledBack (C : Code T M) :171    Code (KrausChannel.identity : KrausChannel ι ι Unit) M where172  encode := C.encode173  decode := C.decode.pullback T174175@[simp] theorem pulledBack_success (C : Code T M) : C.pulledBack.success = C.success := by176  have hidentity (ρ : DensityMatrix ι) :177      (KrausChannel.identity : KrausChannel ι ι Unit).output ρ = ρ := by178    apply Entropy.DensityMatrix.ext179    exact KrausChannel.identity_map ρ.matrix180  simp only [success, pulledBack, hidentity, POVM.probability_pullback]181182/-- The input dimension gives an independent converse, even when the output183space is larger than the input space. -/184theorem success_le_input_dimension_div_messages (C : Code T M) :185    C.success ≤ (Fintype.card ι : ℝ) / M := by186  simpa only [pulledBack_success] using C.pulledBack.success_le_dimension_div_messages187188theorem success_le_min_dimension_div_messages (C : Code T M) :189    C.success ≤ min (Fintype.card ι : ℝ) (Fintype.card ο : ℝ) / M := by190  by_cases h : Fintype.card ι ≤ Fintype.card ο191  · rw [min_eq_left (by exact_mod_cast h)]192    exact C.success_le_input_dimension_div_messages193  · rw [min_eq_right (by exact_mod_cast Nat.le_of_not_ge h)]194    exact C.success_le_dimension_div_messages195196/-- At error at most `ε < 1`, no more than `dim(output)/(1-ε)`197messages can be sent. -/198theorem messages_mul_one_sub_error_le_dimension (C : Code T M) :199    (M : ℝ) * (1 - C.error) ≤ Fintype.card ο := by200  by_cases hM : M = 0201  · simp [hM]202  · have hp : 0 < (M : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero hM203    have h := (le_div_iff₀ hp).mp C.success_le_dimension_div_messages204    simpa only [error, sub_sub_cancel, mul_comm] using h205206theorem messages_le_dimension_div_one_sub_error (C : Code T M) {ε : ℝ}207    (hε : ε < 1) (herror : C.error ≤ ε) :208    (M : ℝ) ≤ (Fintype.card ο : ℝ) / (1 - ε) := by209  apply (le_div_iff₀ (sub_pos.mpr hε)).mpr210  exact (mul_le_mul_of_nonneg_left (sub_le_sub_left herror 1) (Nat.cast_nonneg M)).trans211    C.messages_mul_one_sub_error_le_dimension212213end Code214215end Nonadditivity.Operational