Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.QuantumCodingPacking

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

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.QuantumCodingSampling7import Nonadditivity.QuantumCodingDecoderBound89/-! # Finite random packing with actual projective quantum decoders -/1011noncomputable section12namespace Nonadditivity.QuantumCoding13open Entropy Operational14open scoped BigOperators Matrix ComplexOrder15set_option backward.isDefEq.respectTransparency false1617variable {ι α : Type*} [Fintype ι] [DecidableEq ι] [Fintype α]1819/-- Cross acceptance of a competing conditional projector after the global filter. -/20def crossAcceptance (G Q : ProjectiveTest ι) (ρ : DensityMatrix ι) : ℝ :=21  (Q.matrix * (G.matrix * ρ.matrix * G.matrix)).trace.re2223theorem crossAcceptance_nonneg (G Q : ProjectiveTest ι) (ρ : DensityMatrix ι) :24    0 ≤ crossAcceptance G Q ρ := by25  apply (RCLike.nonneg_iff.mp (AdjointPurity.trace_mul_nonneg Q.positive ?_)).126  simpa only [G.hermitian.eq] using ρ.positive.conjTranspose_mul_mul_same G.matrix2728/-- The global spectral ceiling and conditional rank bound control every29independent competing projector's acceptance of the average state. -/30theorem crossAcceptance_le (G Q : ProjectiveTest ι) (ρ : DensityMatrix ι)31    {a b : ℝ} (ha : 0 ≤ a)32    (hflat : ((a : ℂ) • G.matrix - G.matrix * ρ.matrix * G.matrix).PosSemidef)33    (hrank : Q.matrix.trace.re ≤ b) : crossAcceptance G Q ρ ≤ a*b := by34  have h₁ : 0 ≤ (Q.matrix * ((a : ℂ) • G.matrix - G.matrix * ρ.matrix * G.matrix)).trace.re :=35    (RCLike.nonneg_iff.mp (AdjointPurity.trace_mul_nonneg Q.positive hflat)).136  simp only [Matrix.mul_sub, Matrix.mul_smul, Matrix.trace_sub, Matrix.trace_smul,37    Complex.sub_re, smul_eq_mul, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im,38    zero_mul, sub_zero] at h₁39  have h₂ := (RCLike.nonneg_iff.mp40    (AdjointPurity.trace_mul_nonneg Q.positive G.complement.positive)).141  change 0 ≤ (Q.matrix * (1-G.matrix)).trace.re at h₂42  simp only [Matrix.mul_sub, Matrix.mul_one, Matrix.trace_sub, Complex.sub_re] at h₂43  have h₃ := mul_le_mul_of_nonneg_left (show (Q.matrix*G.matrix).trace.re ≤ b by linarith) ha44  unfold crossAcceptance45  linarith4647theorem mean_crossAcceptance (G Q : ProjectiveTest ι)48    (p : α → ℝ) (hp : ∀x, 0 ≤ p x) (hsum : ∑x, p x = 1)49    (ρ : α → DensityMatrix ι) :50    (∑x, p x * crossAcceptance G Q (ρ x)) =51      crossAcceptance G Q (DensityMatrix.mixture p hp hsum ρ) := by52  simp only [crossAcceptance, DensityMatrix.mixture_matrix, Matrix.mul_sum,53    Matrix.sum_mul, Matrix.mul_smul, Matrix.smul_mul, Matrix.trace_sum,54    Matrix.trace_smul, Complex.re_sum, smul_eq_mul, Complex.mul_re,55    Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero]5657/-- Exact independent codebook averaging reduces every distinct-message58interference term to the average output state's spectral ceiling. -/59theorem expected_crossAcceptance_le {J : Type*} [Fintype J] [DecidableEq J]60    (G : ProjectiveTest ι) (Q : α → ProjectiveTest ι)61    (p : α → ℝ) (hp : ∀x, 0 ≤ p x) (hsum : ∑x, p x = 1)62    (ρ : α → DensityMatrix ι) {a b : ℝ} (ha : 0 ≤ a)63    (hflat : ((a : ℂ) • G.matrix - G.matrix *64      (DensityMatrix.mixture p hp hsum ρ).matrix * G.matrix).PosSemidef)65    (hrank : ∀x, (Q x).matrix.trace.re ≤ b) {i j : J} (hij : i ≠ j) :66    Sampling.expect p (fun c : J → α => crossAcceptance G (Q (c j)) (ρ (c i))) ≤ a*b := by67  rw [Sampling.expect_two p hsum hij (fun x y => crossAcceptance G (Q y) (ρ x))]68  rw [Finset.sum_comm]69  calc70    (∑y, ∑x, p x * p y * crossAcceptance G (Q y) (ρ x)) =71        ∑y, p y * crossAcceptance G (Q y) (DensityMatrix.mixture p hp hsum ρ) := by72      apply Finset.sum_congr rfl73      intro y _74      rw [← mean_crossAcceptance]75      simp only [Finset.mul_sum]76      congr 177      funext x78      ring79    _ ≤ ∑y, p y * (a*b) := by80      apply Finset.sum_le_sum81      intro y _82      exact mul_le_mul_of_nonneg_left (crossAcceptance_le G (Q y) _ ha hflat (hrank y)) (hp y)83    _ = a*b := by rw [← Finset.sum_mul, hsum, one_mul]8485/-- The physical decoder associated with one sampled codebook. -/86def packedDecoder {M : ℕ} (hM : 0 < M) (G : ProjectiveTest ι)87    (Q : α → ProjectiveTest ι) (c : Fin M → α) : POVM ι (Fin M) :=88  ProjectiveTest.filteredDecoder G89    (ProjectiveTest.finiteTests (fun i => Q (c i)) G) M hM9091/-- Average message error of the actual decoder on the selected physical states. -/92def packedError {M : ℕ} (hM : 0 < M) (G : ProjectiveTest ι)93    (Q : α → ProjectiveTest ι) (ρ : α → DensityMatrix ι) (c : Fin M → α) : ℝ :=94  1 - (M : ℝ)⁻¹ * ∑ i, (packedDecoder hM G Q c).probability (ρ (c i)) i9596omit [Fintype α] in97theorem packedError_le_codebookCost {M : ℕ} (hM : 0 < M) (G : ProjectiveTest ι)98    (Q : α → ProjectiveTest ι) (ρ : α → DensityMatrix ι) (c : Fin M → α) :99    packedError hM G Q ρ c ≤ Sampling.codebookCost100      (fun x => ((1-G.matrix)*(ρ x).matrix).trace.re)101      (fun x => ((1-(Q x).matrix)*(ρ x).matrix).trace.re)102      (fun x y => crossAcceptance G (Q y) (ρ x)) c := by103  have h (i : Fin M) := ProjectiveTest.finite_filteredDecoder_error_bound hM G104    (fun j => Q (c j)) (ρ (c i)) i105  have hs := mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun i (_ : i∈Finset.univ) => h i))106    (show (0 : ℝ) ≤ (M : ℝ)⁻¹ by positivity)107  have hm : (M : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hM)108  have hleft : (M : ℝ)⁻¹ * ∑ i, (1 -109      (ProjectiveTest.filteredDecoder G (ProjectiveTest.finiteTests (fun j => Q (c j)) G) M hM).probability110        (ρ (c i)) i) = packedError hM G Q ρ c := by111    rw [Finset.sum_sub_distrib, Finset.sum_const, Finset.card_univ, Fintype.card_fin]112    simp only [nsmul_eq_mul, mul_one, mul_sub, inv_mul_cancel₀ hm]113    rfl114  rw [hleft] at hs115  exact hs116117/-- A genuine finite random packing theorem. Its premises concern only the118ensemble's projector masses and average independent interference. The decoding119error estimate is proved from the explicit sequential POVM. -/120theorem exists_packed_codebook {M : ℕ} (hM : 0 < M)121    (G : ProjectiveTest ι) (Q : α → ProjectiveTest ι)122    (p : α → ℝ) (hp : ∀x, 0 ≤ p x) (hsum : ∑x, p x = 1)123    (ρ : α → DensityMatrix ι) {εG εQ β : ℝ}124    (hG : ∑x, p x * ((1-G.matrix)*(ρ x).matrix).trace.re ≤ εG)125    (hQ : ∑x, p x * ((1-(Q x).matrix)*(ρ x).matrix).trace.re ≤ εQ)126    (hcross : ∑x, ∑y, p x*p y*crossAcceptance G (Q y) (ρ x) ≤ β) :127    ∃c : Fin M → α, packedError hM G Q ρ c ≤ 9*εG+8*εQ+4*(M-1:ℕ)*β := by128  obtain ⟨c, hc⟩ := Sampling.exists_codebook_cost_le p hp hsum hM129    (fun x => ((1-G.matrix)*(ρ x).matrix).trace.re)130    (fun x => ((1-(Q x).matrix)*(ρ x).matrix).trace.re)131    (fun x y => crossAcceptance G (Q y) (ρ x)) hG hQ hcross132  exact ⟨c, (packedError_le_codebookCost hM G Q ρ c).trans hc⟩133134/-- Explicit codewords and an actual normalized POVM with the packing error bound. -/135theorem exists_projective_packing {M : ℕ} (hM : 0 < M)136    (G : ProjectiveTest ι) (Q : α → ProjectiveTest ι)137    (p : α → ℝ) (hp : ∀x, 0 ≤ p x) (hsum : ∑x, p x = 1)138    (ρ : α → DensityMatrix ι) {εG εQ β : ℝ}139    (hG : ∑x, p x * ((1-G.matrix)*(ρ x).matrix).trace.re ≤ εG)140    (hQ : ∑x, p x * ((1-(Q x).matrix)*(ρ x).matrix).trace.re ≤ εQ)141    (hcross : ∑x, ∑y, p x*p y*crossAcceptance G (Q y) (ρ x) ≤ β) :142    ∃c : Fin M → α, ∃D : POVM ι (Fin M),143      1-(M : ℝ)⁻¹ * (∑i, D.probability (ρ (c i)) i) ≤144        9*εG+8*εQ+4*(M-1:ℕ)*β := by145  obtain ⟨c, hc⟩ := exists_packed_codebook hM G Q p hp hsum ρ hG hQ hcross146  exact ⟨c, packedDecoder hM G Q c, hc⟩147148/-- Standard spectral packing bound: a global spectral ceiling `a` and149conditional ranks at most `b` give average interference at most `a*b`. -/150theorem exists_spectral_packing {M : ℕ} (hM : 0 < M)151    (G : ProjectiveTest ι) (Q : α → ProjectiveTest ι)152    (p : α → ℝ) (hp : ∀x, 0 ≤ p x) (hsum : ∑x, p x = 1)153    (ρ : α → DensityMatrix ι) {εG εQ a b : ℝ} (ha : 0 ≤ a)154    (hG : ∑x, p x * ((1-G.matrix)*(ρ x).matrix).trace.re ≤ εG)155    (hQ : ∑x, p x * ((1-(Q x).matrix)*(ρ x).matrix).trace.re ≤ εQ)156    (hflat : ((a : ℂ) • G.matrix - G.matrix *157      (DensityMatrix.mixture p hp hsum ρ).matrix * G.matrix).PosSemidef)158    (hrank : ∀x, (Q x).matrix.trace.re ≤ b) :159    ∃c : Fin M → α, ∃D : POVM ι (Fin M),160      1-(M : ℝ)⁻¹ * (∑i, D.probability (ρ (c i)) i) ≤161        9*εG+8*εQ+4*(M-1:ℕ)*(a*b) := by162  apply exists_projective_packing hM G Q p hp hsum ρ hG hQ163  have h := expected_crossAcceptance_le (J := Fin 2) G Q p hp hsum ρ ha hflat hrank164    (i := 0) (j := 1) (by decide)165  rw [Sampling.expect_two p hsum (show (0 : Fin 2) ≠ 1 by decide)166    (fun x y => crossAcceptance G (Q y) (ρ x))] at h167  exact h168169end Nonadditivity.QuantumCoding