Exact Lean source
Nonadditivity.QuantumCodingSequential
Download original .lean · View on GitHub · Jump to source
Direct imports
Imported by project modules
3 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
52 project constants, including generated, internal and private declarations.
52 declarations
Nonadditivity.QuantumCoding.ProjectiveTestNonadditivity.QuantumCoding.ProjectiveTest._sizeOf_1internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest._sizeOf_instinternal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.casesOnNonadditivity.QuantumCoding.ProjectiveTest.complementNonadditivity.QuantumCoding.ProjectiveTest.complement._proof_1internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.complement._proof_2internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.completeNonadditivity.QuantumCoding.ProjectiveTest.ctorIdxNonadditivity.QuantumCoding.ProjectiveTest.decoderNonadditivity.QuantumCoding.ProjectiveTest.decoder._proof_1internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.decoder._proof_2internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.decoder_probability_geNonadditivity.QuantumCoding.ProjectiveTest.effectNonadditivity.QuantumCoding.ProjectiveTest.effect_positiveNonadditivity.QuantumCoding.ProjectiveTest.failureNonadditivity.QuantumCoding.ProjectiveTest.failure.eq_1internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.failure_positiveNonadditivity.QuantumCoding.ProjectiveTest.filteredDecoderNonadditivity.QuantumCoding.ProjectiveTest.filteredDecoder._proof_1internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.filteredDecoder._proof_2internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.filteredDecoder_probability_geNonadditivity.QuantumCoding.ProjectiveTest.filteredEffectNonadditivity.QuantumCoding.ProjectiveTest.filteredEffect_positiveNonadditivity.QuantumCoding.ProjectiveTest.filteredFailureNonadditivity.QuantumCoding.ProjectiveTest.filteredFailure_positiveNonadditivity.QuantumCoding.ProjectiveTest.filtered_completeNonadditivity.QuantumCoding.ProjectiveTest.hermitianNonadditivity.QuantumCoding.ProjectiveTest.idempotentNonadditivity.QuantumCoding.ProjectiveTest.matrixNonadditivity.QuantumCoding.ProjectiveTest.mkNonadditivity.QuantumCoding.ProjectiveTest.mk._flat_ctorinternal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.mk.injNonadditivity.QuantumCoding.ProjectiveTest.mk.injEqNonadditivity.QuantumCoding.ProjectiveTest.mk.noConfusionNonadditivity.QuantumCoding.ProjectiveTest.mk.sizeOf_specNonadditivity.QuantumCoding.ProjectiveTest.noConfusionNonadditivity.QuantumCoding.ProjectiveTest.noConfusionTypeNonadditivity.QuantumCoding.ProjectiveTest.positiveNonadditivity.QuantumCoding.ProjectiveTest.recNonadditivity.QuantumCoding.ProjectiveTest.recOnNonadditivity.QuantumCoding.ProjectiveTest.rejectProductNonadditivity.QuantumCoding.ProjectiveTest.rejectProduct._sunfoldinternal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.rejectProduct._unsafe_recinternal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.rejectProduct.eq_1internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.rejectProduct.eq_2internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.rejectProduct.eq_defNonadditivity.QuantumCoding.ProjectiveTest.rejectProduct.match_1internal/detail/privateNonadditivity.QuantumCoding.ProjectiveTest.step_complete_private.Nonadditivity.QuantumCodingSequential.0.Nonadditivity.QuantumCoding.ProjectiveTest.rejectProduct.match_1.eq_1internal/detail/private_private.Nonadditivity.QuantumCodingSequential.0.Nonadditivity.QuantumCoding.ProjectiveTest.rejectProduct.match_1.eq_2internal/detail/private_private.Nonadditivity.QuantumCodingSequential.0.Nonadditivity.QuantumCoding.ProjectiveTest.rejectProduct.match_1.splitterinternal/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.OperationalConverse78/-! # Actual sequential projective decoders910The decoder tests a list of orthogonal projectors in order. Its effects11are the literal products of the preceding rejection operators. All effects12are positive, and the remaining failure effect completes a genuine POVM.13-/14noncomputable section15namespace Nonadditivity.QuantumCoding16open Entropy Operational17open scoped BigOperators Matrix ComplexOrder18set_option backward.isDefEq.respectTransparency false1920variable {ι : Type*} [Fintype ι] [DecidableEq ι]2122structure ProjectiveTest (ι : Type*) [Fintype ι] [DecidableEq ι] where23matrix : Matrix ι ι ℂ24hermitian : matrix.IsHermitian25idempotent : matrix*matrix=matrix2627namespace ProjectiveTest2829theorem positive (P : ProjectiveTest ι) : P.matrix.PosSemidef := by30have h := Matrix.posSemidef_conjTranspose_mul_self P.matrix31simpa only [P.hermitian.eq, P.idempotent] using h3233def complement (P : ProjectiveTest ι) : ProjectiveTest ι where34matrix := 1-P.matrix35hermitian := by36change (1-P.matrix).conjTranspose=1-P.matrix37rw [Matrix.conjTranspose_sub, Matrix.conjTranspose_one, P.hermitian.eq]38idempotent := by39simp only [Matrix.sub_mul, Matrix.mul_sub, Matrix.one_mul, Matrix.mul_one,40P.idempotent]41abel4243/-- All preceding tests have returned their rejection outcome. -/44def rejectProduct (P : ℕ → ProjectiveTest ι) : ℕ → Matrix ι ι ℂ45| 0 => 146| n+1 => (1-(P n).matrix)*rejectProduct P n4748def effect (P : ℕ → ProjectiveTest ι) (i : ℕ) : Matrix ι ι ℂ :=49(rejectProduct P i).conjTranspose*(P i).matrix*rejectProduct P i5051def failure (P : ℕ → ProjectiveTest ι) (n : ℕ) : Matrix ι ι ℂ :=52(rejectProduct P n).conjTranspose*rejectProduct P n5354theorem effect_positive (P : ℕ → ProjectiveTest ι) (i : ℕ) :55(effect P i).PosSemidef :=56(P i).positive.conjTranspose_mul_mul_same _5758theorem failure_positive (P : ℕ → ProjectiveTest ι) (n : ℕ) :59(failure P n).PosSemidef := Matrix.posSemidef_conjTranspose_mul_self _6061theorem step_complete (P : ℕ → ProjectiveTest ι) (n : ℕ) :62effect P n+failure P (n+1)=failure P n := by63have hQ := (P n).complement.idempotent64change (1-(P n).matrix)*(1-(P n).matrix)=1-(P n).matrix at hQ65have hf : failure P (n+1) =66(rejectProduct P n).conjTranspose*(1-(P n).matrix)*rejectProduct P n := by67unfold failure68rw [rejectProduct, Matrix.conjTranspose_mul, Matrix.conjTranspose_sub,69Matrix.conjTranspose_one, (P n).hermitian.eq]70calc71_ = (rejectProduct P n).conjTranspose*72((1-(P n).matrix)*(1-(P n).matrix))*rejectProduct P n := by73simp only [Matrix.mul_assoc]74_ = _ := by rw [hQ]75rw [hf]76unfold effect failure77rw [← Matrix.add_mul, ← Matrix.mul_add]78simp7980/-- Exact telescoping completeness, including the no-success outcome. -/81theorem complete (P : ℕ → ProjectiveTest ι) (n : ℕ) :82(∑ i ∈ Finset.range n, effect P i)+failure P n=1 := by83induction n with84| zero => simp [failure,rejectProduct]85| succ n ih =>86rw [Finset.sum_range_succ, add_assoc, step_complete]87exact ih8889/-- Assign the residual failure outcome to a fixed message. This is a90normalized POVM on precisely the original message alphabet. -/91def decoder (P : ℕ → ProjectiveTest ι) (n : ℕ) (hn : 0<n) : POVM ι (Fin n) where92effect := fun i => effect P i.val + if i.val=0 then failure P n else 093positive := fun i => (effect_positive P i.val).add (by94split_ifs95· exact failure_positive P n96· exact Matrix.PosSemidef.zero)97complete := by98simp only [Finset.sum_add_distrib]99have hf : (∑ i : Fin n, if i.val=0 then failure P n else 0) = failure P n := by100have hi (i : Fin n) : i.val=0 ↔ i=⟨0,hn⟩ := by101constructor102· exact fun h => Fin.ext h103· intro h; exact congrArg Fin.val h104simp_rw [hi]105simp106rw [hf, Fin.sum_univ_eq_sum_range]107exact complete P n108109/-- Completing the POVM can only improve the selected message's success. -/110theorem decoder_probability_ge (P : ℕ → ProjectiveTest ι) (n : ℕ) (hn : 0<n)111(ρ : DensityMatrix ι) (i : Fin n) :112(ρ.matrix*effect P i.val).trace.re ≤ (decoder P n hn).probability ρ i := by113unfold POVM.probability decoder114simp only [Matrix.mul_add, Matrix.trace_add, Complex.add_re]115have h : 0≤(ρ.matrix*(if i.val=0 then failure P n else 0)).trace.re := by116split_ifs117· exact (RCLike.nonneg_iff.mp118(AdjointPurity.trace_mul_nonneg ρ.positive (failure_positive P n))).1119· simp120linarith121122def filteredEffect (G : ProjectiveTest ι) (P : ℕ → ProjectiveTest ι) (i : ℕ) :123Matrix ι ι ℂ := G.matrix*effect P i*G.matrix124125def filteredFailure (G : ProjectiveTest ι) (P : ℕ → ProjectiveTest ι) (n : ℕ) :126Matrix ι ι ℂ := 1-G.matrix+G.matrix*failure P n*G.matrix127128theorem filteredEffect_positive (G : ProjectiveTest ι) (P : ℕ → ProjectiveTest ι)129(i : ℕ) : (filteredEffect G P i).PosSemidef := by130simpa only [G.hermitian.eq] using131(effect_positive P i).conjTranspose_mul_mul_same G.matrix132133theorem filteredFailure_positive (G : ProjectiveTest ι) (P : ℕ → ProjectiveTest ι)134(n : ℕ) : (filteredFailure G P n).PosSemidef :=135G.complement.positive.add (by136simpa only [G.hermitian.eq] using137(failure_positive P n).conjTranspose_mul_mul_same G.matrix)138139theorem filtered_complete (G : ProjectiveTest ι) (P : ℕ → ProjectiveTest ι) (n : ℕ) :140(∑ i ∈ Finset.range n, filteredEffect G P i)+filteredFailure G P n=1 := by141have h := congrArg (fun A : Matrix ι ι ℂ => G.matrix*A*G.matrix) (complete P n)142simp only [Matrix.mul_add, Matrix.add_mul, Matrix.mul_sum, Matrix.sum_mul,143Matrix.mul_one, G.idempotent] at h144unfold filteredEffect filteredFailure145calc146_ = 1-G.matrix + ((∑ i ∈ Finset.range n, G.matrix*effect P i*G.matrix)+147G.matrix*failure P n*G.matrix) := by abel148_ = 1 := by rw [h]; abel149150/-- A complete physical decoder: first filter by `G`, then run the tests.151Both initial rejection and final undecided outcomes are assigned to message zero. -/152def filteredDecoder (G : ProjectiveTest ι) (P : ℕ → ProjectiveTest ι)153(n : ℕ) (hn : 0<n) : POVM ι (Fin n) where154effect := fun i => filteredEffect G P i.val + if i.val=0 then filteredFailure G P n else 0155positive := fun i => (filteredEffect_positive G P i.val).add (by156split_ifs157· exact filteredFailure_positive G P n158· exact Matrix.PosSemidef.zero)159complete := by160simp only [Finset.sum_add_distrib]161have hf : (∑ i : Fin n, if i.val=0 then filteredFailure G P n else 0) =162filteredFailure G P n := by163have hi (i : Fin n) : i.val=0 ↔ i=⟨0,hn⟩ := by164constructor165· exact fun h => Fin.ext h166· intro h; exact congrArg Fin.val h167simp_rw [hi]168simp169rw [hf, Fin.sum_univ_eq_sum_range]170exact filtered_complete G P n171172theorem filteredDecoder_probability_ge (G : ProjectiveTest ι)173(P : ℕ → ProjectiveTest ι) (n : ℕ) (hn : 0<n)174(ρ : DensityMatrix ι) (i : Fin n) :175(ρ.matrix*filteredEffect G P i.val).trace.re ≤176(filteredDecoder G P n hn).probability ρ i := by177unfold POVM.probability filteredDecoder178simp only [Matrix.mul_add, Matrix.trace_add, Complex.add_re]179have h : 0≤(ρ.matrix*(if i.val=0 then filteredFailure G P n else 0)).trace.re := by180split_ifs181· exact (RCLike.nonneg_iff.mp182(AdjointPurity.trace_mul_nonneg ρ.positive (filteredFailure_positive G P n))).1183· simp184linarith185186end ProjectiveTest187end Nonadditivity.QuantumCoding