Exact Lean source
Nonadditivity.QuantumCodingPacking
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
13 project constants, including generated, internal and private declarations.
13 declarations
Nonadditivity.QuantumCoding.crossAcceptanceNonadditivity.QuantumCoding.crossAcceptance.eq_1internal/detail/privateNonadditivity.QuantumCoding.crossAcceptance_leNonadditivity.QuantumCoding.crossAcceptance_nonnegNonadditivity.QuantumCoding.exists_packed_codebookNonadditivity.QuantumCoding.exists_projective_packingNonadditivity.QuantumCoding.exists_spectral_packingNonadditivity.QuantumCoding.expected_crossAcceptance_leNonadditivity.QuantumCoding.mean_crossAcceptanceNonadditivity.QuantumCoding.packedDecoderNonadditivity.QuantumCoding.packedErrorNonadditivity.QuantumCoding.packedError.congr_simpNonadditivity.QuantumCoding.packedError_le_codebookCost
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 ι) :240 ≤ crossAcceptance G Q ρ := by25apply (RCLike.nonneg_iff.mp (AdjointPurity.trace_mul_nonneg Q.positive ?_)).126simpa 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 := by34have 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)).136simp only [Matrix.mul_sub, Matrix.mul_smul, Matrix.trace_sub, Matrix.trace_smul,37Complex.sub_re, smul_eq_mul, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im,38zero_mul, sub_zero] at h₁39have h₂ := (RCLike.nonneg_iff.mp40(AdjointPurity.trace_mul_nonneg Q.positive G.complement.positive)).141change 0 ≤ (Q.matrix * (1-G.matrix)).trace.re at h₂42simp only [Matrix.mul_sub, Matrix.mul_one, Matrix.trace_sub, Complex.sub_re] at h₂43have h₃ := mul_le_mul_of_nonneg_left (show (Q.matrix*G.matrix).trace.re ≤ b by linarith) ha44unfold crossAcceptance45linarith4647theorem 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)) =51crossAcceptance G Q (DensityMatrix.mixture p hp hsum ρ) := by52simp only [crossAcceptance, DensityMatrix.mixture_matrix, Matrix.mul_sum,53Matrix.sum_mul, Matrix.mul_smul, Matrix.smul_mul, Matrix.trace_sum,54Matrix.trace_smul, Complex.re_sum, smul_eq_mul, Complex.mul_re,55Complex.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) :66Sampling.expect p (fun c : J → α => crossAcceptance G (Q (c j)) (ρ (c i))) ≤ a*b := by67rw [Sampling.expect_two p hsum hij (fun x y => crossAcceptance G (Q y) (ρ x))]68rw [Finset.sum_comm]69calc70(∑y, ∑x, p x * p y * crossAcceptance G (Q y) (ρ x)) =71∑y, p y * crossAcceptance G (Q y) (DensityMatrix.mixture p hp hsum ρ) := by72apply Finset.sum_congr rfl73intro y _74rw [← mean_crossAcceptance]75simp only [Finset.mul_sum]76congr 177funext x78ring79_ ≤ ∑y, p y * (a*b) := by80apply Finset.sum_le_sum81intro y _82exact 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) :=88ProjectiveTest.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 → α) : ℝ :=941 - (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 → α) :99packedError 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 := by103have h (i : Fin M) := ProjectiveTest.finite_filteredDecoder_error_bound hM G104(fun j => Q (c j)) (ρ (c i)) i105have hs := mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun i (_ : i∈Finset.univ) => h i))106(show (0 : ℝ) ≤ (M : ℝ)⁻¹ by positivity)107have hm : (M : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hM)108have 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 := by111rw [Finset.sum_sub_distrib, Finset.sum_const, Finset.card_univ, Fintype.card_fin]112simp only [nsmul_eq_mul, mul_one, mul_sub, inv_mul_cancel₀ hm]113rfl114rw [hleft] at hs115exact 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:ℕ)*β := by128obtain ⟨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 hcross132exact ⟨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),1431-(M : ℝ)⁻¹ * (∑i, D.probability (ρ (c i)) i) ≤1449*εG+8*εQ+4*(M-1:ℕ)*β := by145obtain ⟨c, hc⟩ := exists_packed_codebook hM G Q p hp hsum ρ hG hQ hcross146exact ⟨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),1601-(M : ℝ)⁻¹ * (∑i, D.probability (ρ (c i)) i) ≤1619*εG+8*εQ+4*(M-1:ℕ)*(a*b) := by162apply exists_projective_packing hM G Q p hp hsum ρ hG hQ163have h := expected_crossAcceptance_le (J := Fin 2) G Q p hp hsum ρ ha hflat hrank164(i := 0) (j := 1) (by decide)165rw [Sampling.expect_two p hsum (show (0 : Fin 2) ≠ 1 by decide)166(fun x y => crossAcceptance G (Q y) (ρ x))] at h167exact h168169end Nonadditivity.QuantumCoding