Exact Lean source
Nonadditivity.QuantumCodingDecoderBound
Download original .lean · View on GitHub · Jump to source
Imported by project modules
2 direct reverse imports
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
Nonadditivity.QuantumCoding.Projection.filtered_reject_norm_sqNonadditivity.QuantumCoding.Projection.reject_norm_leNonadditivity.QuantumCoding.ProjectiveTest.complement.eq_1internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.filteredDecoder.congr_simpNonadditivity.QuantumCoding.ProjectiveTest.filteredDecoder_error_boundNonadditivity.QuantumCoding.ProjectiveTest.filtered_raw_error_boundNonadditivity.QuantumCoding.ProjectiveTest.finiteTestsNonadditivity.QuantumCoding.ProjectiveTest.finiteTests.eq_1internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.finiteTests_applyNonadditivity.QuantumCoding.ProjectiveTest.finite_filteredDecoder_error_boundNonadditivity.QuantumCoding.ProjectiveTest.raw_error_boundNonadditivity.QuantumCoding.ProjectiveTest.raw_error_bound._proof_1_1internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.raw_error_bound._proof_1_2internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.raw_error_bound._proof_1_5internal/detail/privateNonadditivity.QuantumCoding.filtered_reject_traceNonadditivity.QuantumCoding.filtered_reject_trace_amplitudeNonadditivity.QuantumCoding.filtered_reject_trace_amplitude._simp_1_1internal/detail/private_private.Nonadditivity.QuantumCodingDecoderBound.0.Nonadditivity.QuantumCoding.ProjectiveTest.prefix_sum_le_erase_suminternal/detail/private_private.Nonadditivity.QuantumCodingDecoderBound.0.Nonadditivity.QuantumCoding.ProjectiveTest.prefix_sum_le_erase_sum._simp_1_1internal/detail/private_private.Nonadditivity.QuantumCodingDecoderBound.0.Nonadditivity.QuantumCoding.ProjectiveTest.prefix_sum_le_erase_sum._simp_1_2internal/detail/private
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‖ := by24have hp := P.pythagoras x25have hn := sq_nonneg ‖P.map x‖26nlinarith [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 ≤322*‖x-Q.map x‖^2+2*‖x-G.map x‖^2 := by33have hi : G.map x-Q.map (G.map x) =34(x-Q.map x)-((x-G.map x)-Q.map (x-G.map x)) := by35rw [map_sub]36abel37have hnorm : ‖G.map x-Q.map (G.map x)‖ ≤ ‖x-Q.map x‖+‖x-G.map x‖ := by38rw [hi]39exact (norm_sub_le _ _).trans (add_le_add le_rfl (Q.reject_norm_le _))40nlinarith [sq_nonneg (‖x-Q.map x‖-‖x-G.map x‖), norm_nonneg (G.map x-Q.map (G.map x)),41norm_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 ≤492*((1-Q.matrix)*(X*X.conjTranspose)).trace.re+502*((1-G.matrix)*(X*X.conjTranspose)).trace.re := by51have h := Finset.sum_le_sum (s := Finset.univ) (fun j _ =>52Projection.filtered_reject_norm_sq53(Projection.ofMatrix G.matrix G.hermitian G.idempotent)54(Projection.ofMatrix Q.matrix Q.hermitian Q.idempotent) (amplitudeColumn X j))55change (∑ j, ‖Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) G.matrix (amplitudeColumn X j)-56Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) Q.matrix57(Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) G.matrix (amplitudeColumn X j))‖^2) ≤ _ at h58have hf (j : κ) :59Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) G.matrix (amplitudeColumn X j)-60Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) Q.matrix61(Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) G.matrix (amplitudeColumn X j)) =62amplitudeColumn ((1-Q.matrix)*(G.matrix*X)) j := by63simpa only [amplitudeColumn_mul] using64(amplitudeColumn_sub_mul Q.matrix (G.matrix*X) j).symm65have hq (j : κ) : amplitudeColumn X j -66(Projection.ofMatrix Q.matrix Q.hermitian Q.idempotent).map (amplitudeColumn X j) =67amplitudeColumn ((1-Q.matrix)*X) j :=68(amplitudeColumn_sub_mul Q.matrix X j).symm69have hg (j : κ) : amplitudeColumn X j -70(Projection.ofMatrix G.matrix G.hermitian G.idempotent).map (amplitudeColumn X j) =71amplitudeColumn ((1-G.matrix)*X) j :=72(amplitudeColumn_sub_mul G.matrix X j).symm73simp_rw [hf,hq,hg] at h74rw [Finset.sum_add_distrib, ←Finset.mul_sum, ←Finset.mul_sum] at h75simp_rw [←trace_gram_eq_sum_column_norm_sq,76rejected_gram_trace Q.matrix Q.hermitian Q.idempotent,77rejected_gram_trace G.matrix G.hermitian G.idempotent] at h78simpa 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 ≤852*((1-Q.matrix)*ρ).trace.re+2*((1-G.matrix)*ρ).trace.re := by86have hroot : CFC.sqrt ρ * (CFC.sqrt ρ).conjTranspose = ρ := by87rw [(Matrix.nonneg_iff_posSemidef.mp (CFC.sqrt_nonneg ρ)).isHermitian.eq]88exact CFC.sqrt_mul_sqrt_self ρ hρ.nonneg89simpa 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 ≤984 * (((1-(P n).matrix)*ρ).trace.re +99∑ i ∈ Finset.range n, ((P i).matrix*ρ).trace.re) := by100let A : ℕ → Matrix ι ι ℂ := fun i =>101if i=n then (P n).matrix else (P i).complement.matrix102have hA (i : ℕ) : (A i).IsHermitian := by103dsimp [A]104split_ifs105· exact (P n).hermitian106· exact (P i).complement.hermitian107have hAA (i : ℕ) : A i*A i=A i := by108dsimp [A]109split_ifs110· exact (P n).idempotent111· exact (P i).complement.idempotent112have hprod (k : ℕ) (hk : k≤n) : actualProduct A k=rejectProduct P k := by113induction k with114| zero => rfl115| succ k ih =>116rw [actualProduct, rejectProduct, ih (by omega)]117have hkn : k≠n := by omega118simp [A,hkn,complement]119have hlast : actualProduct A (n+1)=(P n).matrix*rejectProduct P n := by120rw [actualProduct, hprod n le_rfl]121simp [A]122have 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) := by125rw [Finset.sum_range_succ, add_comm]126congr 1127· simp [A]128· apply Finset.sum_congr rfl129intro i hi130have hin : i≠n := by have := Finset.mem_range.mp hi; omega131simp [A,hin,complement]132have he : (((P n).matrix*rejectProduct P n)*ρ*133((P n).matrix*rejectProduct P n).conjTranspose).trace =134(ρ*effect P n).trace := by135rw [Matrix.conjTranspose_mul, (P n).hermitian.eq]136calc137_ = ((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 := by141rw [Matrix.trace_mul_cycle]142_ = ((P n).matrix*(rejectProduct P n*ρ*(rejectProduct P n).conjTranspose)).trace := by143rw [(P n).idempotent]144_ = (ρ*effect P n).trace := by145unfold effect146rw [Matrix.trace_mul_comm (P n).matrix]147simp only [Matrix.mul_assoc]148rw [Matrix.trace_mul_comm (rejectProduct P n)]149simp only [Matrix.mul_assoc]150have h := trace_union_bound A hA hAA ρ hρ (n+1)151rwa [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 ≤1589*((1-G.matrix)*ρ).trace.re + 8*((1-(P n).matrix)*ρ).trace.re +1594*∑ i ∈ Finset.range n, ((P i).matrix*(G.matrix*ρ*G.matrix)).trace.re := by160have hσ : (G.matrix*ρ*G.matrix).PosSemidef := by161simpa only [G.hermitian.eq] using hρ.conjTranspose_mul_mul_same G.matrix162have hraw := raw_error_bound P (G.matrix*ρ*G.matrix) hσ n163have hf := filtered_reject_trace G (P n) ρ hρ164have ht : (G.matrix*ρ*G.matrix).trace.re =165ρ.trace.re-((1-G.matrix)*ρ).trace.re := by166rw [Matrix.trace_mul_cycle, G.idempotent, Matrix.sub_mul, Matrix.one_mul,167Matrix.trace_sub, Complex.sub_re]168ring169have hs : ((G.matrix*ρ*G.matrix)*effect P n).trace =170(ρ*filteredEffect G P n).trace := by171unfold filteredEffect172simp only [Matrix.mul_assoc]173rw [Matrix.trace_mul_comm G.matrix]174simp only [Matrix.mul_assoc]175rw [ht,hs] at hraw176linarith177178/-- 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) :1821-(filteredDecoder G P N hN).probability ρ i ≤1839*((1-G.matrix)*ρ.matrix).trace.re + 8*((1-(P i.val).matrix)*ρ.matrix).trace.re +1844*∑ j ∈ Finset.range i.val,185((P j).matrix*(G.matrix*ρ.matrix*G.matrix)).trace.re := by186have hb := filtered_raw_error_bound G P ρ.matrix ρ.positive i.val187have hp := filteredDecoder_probability_ge G P N hN ρ i188rw [ρ.normalized, Complex.one_re] at hb189linarith190191/-- 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 := by198simp [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 := by204let e : Fin i.val → Fin M := fun j => ⟨j.val,j.isLt.trans i.isLt⟩205have he : Function.Injective e := by206intro a b hab207exact Fin.ext (congrArg (fun z : Fin M => z.val) hab)208have hs : Finset.univ.image e ⊆ Finset.univ.erase i := by209intro j hj210rcases Finset.mem_image.mp hj with ⟨a,ha,rfl⟩211simp only [Finset.mem_erase, Finset.mem_univ, and_true]212intro hai213have hva := congrArg Fin.val hai214change a.val=i.val at hva215exact (Nat.ne_of_lt a.isLt) hva216have hb := Finset.sum_le_sum_of_subset_of_nonneg hs (fun j _ _ => hf j)217rw [Finset.sum_image (fun a _ b _ hab => he hab)] at hb218exact 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) :2251-(filteredDecoder G (finiteTests Q G) M hM).probability ρ i ≤2269*((1-G.matrix)*ρ.matrix).trace.re + 8*((1-(Q i).matrix)*ρ.matrix).trace.re +2274*∑ j ∈ Finset.univ.erase i,228((Q j).matrix*(G.matrix*ρ.matrix*G.matrix)).trace.re := by229have hb := filteredDecoder_error_bound G (finiteTests Q G) M hM ρ i230simp only [finiteTests_apply] at hb231let f : Fin M → ℝ := fun j => ((Q j).matrix*(G.matrix*ρ.matrix*G.matrix)).trace.re232have hσ : (G.matrix*ρ.matrix*G.matrix).PosSemidef := by233simpa only [G.hermitian.eq] using ρ.positive.conjTranspose_mul_mul_same G.matrix234have hf (j : Fin M) : 0≤f j :=235(RCLike.nonneg_iff.mp (AdjointPurity.trace_mul_nonneg (Q j).positive hσ)).1236have hs := prefix_sum_le_erase_sum f hf i237have 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⟩ := by240rw [←Fin.sum_univ_eq_sum_range]241apply Finset.sum_congr rfl242intro j hj243simp [f, finiteTests, j.isLt.trans i.isLt]244rw [he] at hb245change _ ≤ _+_+4*∑j∈Finset.univ.erase i, f j246linarith247248end ProjectiveTest249end Nonadditivity.QuantumCoding