Holevo Additivity Gap in Lean 4

Lean explorer

Exact Lean source

Nonadditivity.QuantumCodingSequential

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

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

52 declarations

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 ι] where23  matrix : Matrix ι ι ℂ24  hermitian : matrix.IsHermitian25  idempotent : matrix*matrix=matrix2627namespace ProjectiveTest2829theorem positive (P : ProjectiveTest ι) : P.matrix.PosSemidef := by30  have h := Matrix.posSemidef_conjTranspose_mul_self P.matrix31  simpa only [P.hermitian.eq, P.idempotent] using h3233def complement (P : ProjectiveTest ι) : ProjectiveTest ι where34  matrix := 1-P.matrix35  hermitian := by36    change (1-P.matrix).conjTranspose=1-P.matrix37    rw [Matrix.conjTranspose_sub, Matrix.conjTranspose_one, P.hermitian.eq]38  idempotent := by39    simp only [Matrix.sub_mul, Matrix.mul_sub, Matrix.one_mul, Matrix.mul_one,40      P.idempotent]41    abel4243/-- 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 : ℕ) :62    effect P n+failure P (n+1)=failure P n := by63  have hQ := (P n).complement.idempotent64  change (1-(P n).matrix)*(1-(P n).matrix)=1-(P n).matrix at hQ65  have hf : failure P (n+1) =66      (rejectProduct P n).conjTranspose*(1-(P n).matrix)*rejectProduct P n := by67    unfold failure68    rw [rejectProduct, Matrix.conjTranspose_mul, Matrix.conjTranspose_sub,69      Matrix.conjTranspose_one, (P n).hermitian.eq]70    calc71      _ = (rejectProduct P n).conjTranspose*72          ((1-(P n).matrix)*(1-(P n).matrix))*rejectProduct P n := by73        simp only [Matrix.mul_assoc]74      _ = _ := by rw [hQ]75  rw [hf]76  unfold effect failure77  rw [← Matrix.add_mul, ← Matrix.mul_add]78  simp7980/-- 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 := by83  induction n with84  | zero => simp [failure,rejectProduct]85  | succ n ih =>86    rw [Finset.sum_range_succ, add_assoc, step_complete]87    exact 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) where92  effect := fun i => effect P i.val + if i.val=0 then failure P n else 093  positive := fun i => (effect_positive P i.val).add (by94    split_ifs95    · exact failure_positive P n96    · exact Matrix.PosSemidef.zero)97  complete := by98    simp only [Finset.sum_add_distrib]99    have hf : (∑ i : Fin n, if i.val=0 then failure P n else 0) = failure P n := by100      have hi (i : Fin n) : i.val=0 ↔ i=⟨0,hn⟩ := by101        constructor102        · exact fun h => Fin.ext h103        · intro h; exact congrArg Fin.val h104      simp_rw [hi]105      simp106    rw [hf, Fin.sum_univ_eq_sum_range]107    exact 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 := by113  unfold POVM.probability decoder114  simp only [Matrix.mul_add, Matrix.trace_add, Complex.add_re]115  have h : 0≤(ρ.matrix*(if i.val=0 then failure P n else 0)).trace.re := by116    split_ifs117    · exact (RCLike.nonneg_iff.mp118        (AdjointPurity.trace_mul_nonneg ρ.positive (failure_positive P n))).1119    · simp120  linarith121122def filteredEffect (G : ProjectiveTest ι) (P : ℕ → ProjectiveTest ι) (i : ℕ) :123    Matrix ι ι ℂ := G.matrix*effect P i*G.matrix124125def filteredFailure (G : ProjectiveTest ι) (P : ℕ → ProjectiveTest ι) (n : ℕ) :126    Matrix ι ι ℂ := 1-G.matrix+G.matrix*failure P n*G.matrix127128theorem filteredEffect_positive (G : ProjectiveTest ι) (P : ℕ → ProjectiveTest ι)129    (i : ℕ) : (filteredEffect G P i).PosSemidef := by130  simpa 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 :=135  G.complement.positive.add (by136    simpa 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 := by141  have h := congrArg (fun A : Matrix ι ι ℂ => G.matrix*A*G.matrix) (complete P n)142  simp only [Matrix.mul_add, Matrix.add_mul, Matrix.mul_sum, Matrix.sum_mul,143    Matrix.mul_one, G.idempotent] at h144  unfold filteredEffect filteredFailure145  calc146    _ = 1-G.matrix + ((∑ i ∈ Finset.range n, G.matrix*effect P i*G.matrix)+147        G.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) where154  effect := fun i => filteredEffect G P i.val + if i.val=0 then filteredFailure G P n else 0155  positive := fun i => (filteredEffect_positive G P i.val).add (by156    split_ifs157    · exact filteredFailure_positive G P n158    · exact Matrix.PosSemidef.zero)159  complete := by160    simp only [Finset.sum_add_distrib]161    have hf : (∑ i : Fin n, if i.val=0 then filteredFailure G P n else 0) =162        filteredFailure G P n := by163      have hi (i : Fin n) : i.val=0 ↔ i=⟨0,hn⟩ := by164        constructor165        · exact fun h => Fin.ext h166        · intro h; exact congrArg Fin.val h167      simp_rw [hi]168      simp169    rw [hf, Fin.sum_univ_eq_sum_range]170    exact 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 := by177  unfold POVM.probability filteredDecoder178  simp only [Matrix.mul_add, Matrix.trace_add, Complex.add_re]179  have h : 0≤(ρ.matrix*(if i.val=0 then filteredFailure G P n else 0)).trace.re := by180    split_ifs181    · exact (RCLike.nonneg_iff.mp182        (AdjointPurity.trace_mul_nonneg ρ.positive (filteredFailure_positive G P n))).1183    · simp184  linarith185186end ProjectiveTest187end Nonadditivity.QuantumCoding