Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.QuantumCodingDecoderBound

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

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

20 declarations

Full module

1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.QuantumCodingTraceUnion7import Nonadditivity.QuantumCodingSequential89/-! # Deterministic error bound for actual sequential decoding1011An initial common spectral filter and the individual codeword tests are12controlled by literal trace probabilities on the codeword density matrix.13-/14noncomputable section15namespace Nonadditivity.QuantumCoding16open Entropy Operational17open scoped BigOperators InnerProductSpace Matrix MatrixOrder ComplexOrder Matrix.Norms.L2Operator18set_option backward.isDefEq.respectTransparency false1920namespace Projection21variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E]2223theorem reject_norm_le (P : Projection E) (x : E) : ‖x-P.map x‖≤‖x‖ := by24  have hp := P.pythagoras x25  have hn := sq_nonneg ‖P.map x‖26  nlinarith [norm_nonneg (x-P.map x), norm_nonneg x]2728/-- The loss of a second projection after filtering is bounded on the29original vector; both terms have the sharp elementary factor two. -/30theorem filtered_reject_norm_sq (G Q : Projection E) (x : E) :31    ‖G.map x-Q.map (G.map x)‖^2 ≤32      2*‖x-Q.map x‖^2+2*‖x-G.map x‖^2 := by33  have hi : G.map x-Q.map (G.map x) =34      (x-Q.map x)-((x-G.map x)-Q.map (x-G.map x)) := by35    rw [map_sub]36    abel37  have hnorm : ‖G.map x-Q.map (G.map x)‖ ≤ ‖x-Q.map x‖+‖x-G.map x‖ := by38    rw [hi]39    exact (norm_sub_le _ _).trans (add_le_add le_rfl (Q.reject_norm_le _))40  nlinarith [sq_nonneg (‖x-Q.map x‖-‖x-G.map x‖), norm_nonneg (G.map x-Q.map (G.map x)),41    norm_nonneg (x-Q.map x), norm_nonneg (x-G.map x)]42end Projection4344variable {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ]4546/-- Two projection failures on an amplitude control the filtered failure. -/47theorem filtered_reject_trace_amplitude (G Q : ProjectiveTest ι) (X : Matrix ι κ ℂ) :48    ((1-Q.matrix)*(G.matrix*(X*X.conjTranspose)*G.matrix)).trace.re ≤49      2*((1-Q.matrix)*(X*X.conjTranspose)).trace.re+50        2*((1-G.matrix)*(X*X.conjTranspose)).trace.re := by51  have h := Finset.sum_le_sum (s := Finset.univ) (fun j _ =>52    Projection.filtered_reject_norm_sq53      (Projection.ofMatrix G.matrix G.hermitian G.idempotent)54      (Projection.ofMatrix Q.matrix Q.hermitian Q.idempotent) (amplitudeColumn X j))55  change (∑ j, ‖Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) G.matrix (amplitudeColumn X j)-56    Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) Q.matrix57      (Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) G.matrix (amplitudeColumn X j))‖^2) ≤ _ at h58  have hf (j : κ) :59      Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) G.matrix (amplitudeColumn X j)-60      Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) Q.matrix61        (Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) G.matrix (amplitudeColumn X j)) =62      amplitudeColumn ((1-Q.matrix)*(G.matrix*X)) j := by63    simpa only [amplitudeColumn_mul] using64      (amplitudeColumn_sub_mul Q.matrix (G.matrix*X) j).symm65  have hq (j : κ) : amplitudeColumn X j -66      (Projection.ofMatrix Q.matrix Q.hermitian Q.idempotent).map (amplitudeColumn X j) =67      amplitudeColumn ((1-Q.matrix)*X) j :=68    (amplitudeColumn_sub_mul Q.matrix X j).symm69  have hg (j : κ) : amplitudeColumn X j -70      (Projection.ofMatrix G.matrix G.hermitian G.idempotent).map (amplitudeColumn X j) =71      amplitudeColumn ((1-G.matrix)*X) j :=72    (amplitudeColumn_sub_mul G.matrix X j).symm73  simp_rw [hf,hq,hg] at h74  rw [Finset.sum_add_distrib, ←Finset.mul_sum, ←Finset.mul_sum] at h75  simp_rw [←trace_gram_eq_sum_column_norm_sq,76    rejected_gram_trace Q.matrix Q.hermitian Q.idempotent,77    rejected_gram_trace G.matrix G.hermitian G.idempotent] at h78  simpa only [Matrix.conjTranspose_mul, G.hermitian.eq, Matrix.mul_assoc] using h7980/-- Filtering cannot spoil a later projective acceptance by more than twice81either original failure probability. -/82theorem filtered_reject_trace (G Q : ProjectiveTest ι)83    (ρ : Matrix ι ι ℂ) (hρ : ρ.PosSemidef) :84    ((1-Q.matrix)*(G.matrix*ρ*G.matrix)).trace.re ≤85      2*((1-Q.matrix)*ρ).trace.re+2*((1-G.matrix)*ρ).trace.re := by86  have hroot : CFC.sqrt ρ * (CFC.sqrt ρ).conjTranspose = ρ := by87    rw [(Matrix.nonneg_iff_posSemidef.mp (CFC.sqrt_nonneg ρ)).isHermitian.eq]88    exact CFC.sqrt_mul_sqrt_self ρ hρ.nonneg89  simpa only [hroot] using filtered_reject_trace_amplitude G Q (CFC.sqrt ρ)9091namespace ProjectiveTest9293/-- The raw success effect has a trace error controlled by the original94failure of the target test and false acceptance of earlier tests. -/95theorem raw_error_bound (P : ℕ → ProjectiveTest ι)96    (ρ : Matrix ι ι ℂ) (hρ : ρ.PosSemidef) (n : ℕ) :97    ρ.trace.re - (ρ * effect P n).trace.re ≤98      4 * (((1-(P n).matrix)*ρ).trace.re +99        ∑ i ∈ Finset.range n, ((P i).matrix*ρ).trace.re) := by100  let A : ℕ → Matrix ι ι ℂ := fun i =>101    if i=n then (P n).matrix else (P i).complement.matrix102  have hA (i : ℕ) : (A i).IsHermitian := by103    dsimp [A]104    split_ifs105    · exact (P n).hermitian106    · exact (P i).complement.hermitian107  have hAA (i : ℕ) : A i*A i=A i := by108    dsimp [A]109    split_ifs110    · exact (P n).idempotent111    · exact (P i).complement.idempotent112  have hprod (k : ℕ) (hk : k≤n) : actualProduct A k=rejectProduct P k := by113    induction k with114    | zero => rfl115    | succ k ih =>116      rw [actualProduct, rejectProduct, ih (by omega)]117      have hkn : k≠n := by omega118      simp [A,hkn,complement]119  have hlast : actualProduct A (n+1)=(P n).matrix*rejectProduct P n := by120    rw [actualProduct, hprod n le_rfl]121    simp [A]122  have hs : (∑ i ∈ Finset.range (n+1), ((1-A i)*ρ).trace.re) =123      (((1-(P n).matrix)*ρ).trace.re +124        ∑ i ∈ Finset.range n, ((P i).matrix*ρ).trace.re) := by125    rw [Finset.sum_range_succ, add_comm]126    congr 1127    · simp [A]128    · apply Finset.sum_congr rfl129      intro i hi130      have hin : i≠n := by have := Finset.mem_range.mp hi; omega131      simp [A,hin,complement]132  have he : (((P n).matrix*rejectProduct P n)*ρ*133      ((P n).matrix*rejectProduct P n).conjTranspose).trace =134      (ρ*effect P n).trace := by135    rw [Matrix.conjTranspose_mul, (P n).hermitian.eq]136    calc137      _ = ((P n).matrix * (rejectProduct P n*ρ*(rejectProduct P n).conjTranspose) *138          (P n).matrix).trace := by simp only [Matrix.mul_assoc]139      _ = (((P n).matrix*(P n).matrix)*140          (rejectProduct P n*ρ*(rejectProduct P n).conjTranspose)).trace := by141        rw [Matrix.trace_mul_cycle]142      _ = ((P n).matrix*(rejectProduct P n*ρ*(rejectProduct P n).conjTranspose)).trace := by143        rw [(P n).idempotent]144      _ = (ρ*effect P n).trace := by145        unfold effect146        rw [Matrix.trace_mul_comm (P n).matrix]147        simp only [Matrix.mul_assoc]148        rw [Matrix.trace_mul_comm (rejectProduct P n)]149        simp only [Matrix.mul_assoc]150  have h := trace_union_bound A hA hAA ρ hρ (n+1)151  rwa [hlast,hs,he] at h152153/-- The filtered raw decoder has an explicit error estimate on every positive154input. The constants arise from Gao's factor four and one filter triangle bound. -/155theorem filtered_raw_error_bound (G : ProjectiveTest ι) (P : ℕ → ProjectiveTest ι)156    (ρ : Matrix ι ι ℂ) (hρ : ρ.PosSemidef) (n : ℕ) :157    ρ.trace.re - (ρ * filteredEffect G P n).trace.re ≤158      9*((1-G.matrix)*ρ).trace.re + 8*((1-(P n).matrix)*ρ).trace.re +159        4*∑ i ∈ Finset.range n, ((P i).matrix*(G.matrix*ρ*G.matrix)).trace.re := by160  have hσ : (G.matrix*ρ*G.matrix).PosSemidef := by161    simpa only [G.hermitian.eq] using hρ.conjTranspose_mul_mul_same G.matrix162  have hraw := raw_error_bound P (G.matrix*ρ*G.matrix) hσ n163  have hf := filtered_reject_trace G (P n) ρ hρ164  have ht : (G.matrix*ρ*G.matrix).trace.re =165      ρ.trace.re-((1-G.matrix)*ρ).trace.re := by166    rw [Matrix.trace_mul_cycle, G.idempotent, Matrix.sub_mul, Matrix.one_mul,167      Matrix.trace_sub, Complex.sub_re]168    ring169  have hs : ((G.matrix*ρ*G.matrix)*effect P n).trace =170      (ρ*filteredEffect G P n).trace := by171    unfold filteredEffect172    simp only [Matrix.mul_assoc]173    rw [Matrix.trace_mul_comm G.matrix]174    simp only [Matrix.mul_assoc]175  rw [ht,hs] at hraw176  linarith177178/-- The completed physical POVM obeys the same deterministic error bound on179each normalized input state. -/180theorem filteredDecoder_error_bound (G : ProjectiveTest ι) (P : ℕ → ProjectiveTest ι)181    (N : ℕ) (hN : 0<N) (ρ : DensityMatrix ι) (i : Fin N) :182    1-(filteredDecoder G P N hN).probability ρ i ≤183      9*((1-G.matrix)*ρ.matrix).trace.re + 8*((1-(P i.val).matrix)*ρ.matrix).trace.re +184        4*∑ j ∈ Finset.range i.val,185          ((P j).matrix*(G.matrix*ρ.matrix*G.matrix)).trace.re := by186  have hb := filtered_raw_error_bound G P ρ.matrix ρ.positive i.val187  have hp := filteredDecoder_probability_ge G P N hN ρ i188  rw [ρ.normalized, Complex.one_re] at hb189  linarith190191/-- Extend a finite family of message tests to the index type used by the192sequential product. The fallback is never queried by the finite decoder. -/193def finiteTests {M : ℕ} (Q : Fin M → ProjectiveTest ι) (fallback : ProjectiveTest ι)194    (t : ℕ) : ProjectiveTest ι := if h : t<M then Q ⟨t,h⟩ else fallback195196@[simp] theorem finiteTests_apply {M : ℕ} (Q : Fin M → ProjectiveTest ι)197    (fallback : ProjectiveTest ι) (i : Fin M) : finiteTests Q fallback i.val=Q i := by198  simp [finiteTests,i.isLt]199200private theorem prefix_sum_le_erase_sum {M : ℕ} (f : Fin M → ℝ)201    (hf : ∀j, 0≤f j) (i : Fin M) :202    (∑ j : Fin i.val, f ⟨j.val,j.isLt.trans i.isLt⟩) ≤203      ∑ j ∈ Finset.univ.erase i, f j := by204  let e : Fin i.val → Fin M := fun j => ⟨j.val,j.isLt.trans i.isLt⟩205  have he : Function.Injective e := by206    intro a b hab207    exact Fin.ext (congrArg (fun z : Fin M => z.val) hab)208  have hs : Finset.univ.image e ⊆ Finset.univ.erase i := by209    intro j hj210    rcases Finset.mem_image.mp hj with ⟨a,ha,rfl⟩211    simp only [Finset.mem_erase, Finset.mem_univ, and_true]212    intro hai213    have hva := congrArg Fin.val hai214    change a.val=i.val at hva215    exact (Nat.ne_of_lt a.isLt) hva216  have hb := Finset.sum_le_sum_of_subset_of_nonneg hs (fun j _ _ => hf j)217  rw [Finset.sum_image (fun a _ b _ hab => he hab)] at hb218  exact hb219220/-- The physical filtered decoder is controlled by the interference from all221other messages. This symmetric form is suitable for random-codebook averaging. -/222theorem finite_filteredDecoder_error_bound {M : ℕ} (hM : 0<M)223    (G : ProjectiveTest ι) (Q : Fin M → ProjectiveTest ι)224    (ρ : DensityMatrix ι) (i : Fin M) :225    1-(filteredDecoder G (finiteTests Q G) M hM).probability ρ i ≤226      9*((1-G.matrix)*ρ.matrix).trace.re + 8*((1-(Q i).matrix)*ρ.matrix).trace.re +227        4*∑ j ∈ Finset.univ.erase i,228          ((Q j).matrix*(G.matrix*ρ.matrix*G.matrix)).trace.re := by229  have hb := filteredDecoder_error_bound G (finiteTests Q G) M hM ρ i230  simp only [finiteTests_apply] at hb231  let f : Fin M → ℝ := fun j => ((Q j).matrix*(G.matrix*ρ.matrix*G.matrix)).trace.re232  have hσ : (G.matrix*ρ.matrix*G.matrix).PosSemidef := by233    simpa only [G.hermitian.eq] using ρ.positive.conjTranspose_mul_mul_same G.matrix234  have hf (j : Fin M) : 0≤f j :=235    (RCLike.nonneg_iff.mp (AdjointPurity.trace_mul_nonneg (Q j).positive hσ)).1236  have hs := prefix_sum_le_erase_sum f hf i237  have he : (∑ j ∈ Finset.range i.val,238      ((finiteTests Q G j).matrix*(G.matrix*ρ.matrix*G.matrix)).trace.re) =239      ∑ j : Fin i.val, f ⟨j.val,j.isLt.trans i.isLt⟩ := by240    rw [←Fin.sum_univ_eq_sum_range]241    apply Finset.sum_congr rfl242    intro j hj243    simp [f, finiteTests, j.isLt.trans i.isLt]244  rw [he] at hb245  change _ ≤ _+_+4*∑j∈Finset.univ.erase i, f j246  linarith247248end ProjectiveTest249end Nonadditivity.QuantumCoding