Exact Lean source
Nonadditivity.OperationalBlockingCodes
Download original .lean · View on GitHub · Jump to source
Direct imports
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
18 project constants, including generated, internal and private declarations.
18 declarations
Nonadditivity.Operational.Code.padNonadditivity.Operational.Code.pad._sunfoldinternal/detail/privateNonadditivity.Operational.Code.pad._unsafe_recinternal/detail/privateNonadditivity.Operational.Code.pad.match_1internal/detail/privateNonadditivity.Operational.Code.padRightNonadditivity.Operational.Code.padRight_errorNonadditivity.Operational.Code.padRight_successNonadditivity.Operational.Code.padToNonadditivity.Operational.Code.padTo.eq_1internal/detail/privateNonadditivity.Operational.Code.padTo_errorNonadditivity.Operational.Code.pad_errorNonadditivity.Operational.Code.transportNonadditivity.Operational.Code.transport_errorNonadditivity.Operational.Code.transport_successNonadditivity.Operational.POVM.ignoreRightNonadditivity.Operational.POVM.ignoreRight._proof_1internal/detail/privateNonadditivity.Operational.POVM.ignoreRight._proof_2internal/detail/privateNonadditivity.Operational.POVM.ignoreRight_probability
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.OperationalReindex7import Nonadditivity.OperationalCapacity8import Nonadditivity.HolevoRateLimit910/-! # Physical code padding and exact channel transport -/11noncomputable section12namespace Nonadditivity.Operational13open Entropy Channels RegularizedHolevo14open scoped BigOperators Matrix ComplexOrder Kronecker15set_option backward.isDefEq.respectTransparency false16set_option maxHeartbeats 8000001718namespace POVM19variable {ι ο μ : Type*} [Fintype ι] [DecidableEq ι]20[Fintype ο] [DecidableEq ο] [Fintype μ]2122/-- Ignore the second output register of an actual product channel. -/23def ignoreRight (P : POVM ι μ) : POVM (ι × ο) μ where24effect := fun m => P.effect m ⊗ₖ (1 : Matrix ο ο ℂ)25positive := fun m => (P.positive m).kronecker Matrix.PosSemidef.one26complete := by27calc28(∑m, P.effect m ⊗ₖ (1 : Matrix ο ο ℂ)) =29(∑m, P.effect m) ⊗ₖ (1 : Matrix ο ο ℂ) := by30ext a b31simp only [Matrix.sum_apply, Matrix.kroneckerMap_apply, Finset.sum_mul]32_ = 1 := by rw [P.complete,Matrix.one_kronecker_one]3334@[simp] theorem ignoreRight_probability (P : POVM ι μ)35(ρ : DensityMatrix ι) (σ : DensityMatrix ο) (m : μ) :36P.ignoreRight.probability (ρ.tensor σ) m = P.probability ρ m := by37unfold probability ignoreRight38rw [DensityMatrix.tensor_matrix, ←Matrix.mul_kronecker_mul, Matrix.mul_one,39Matrix.trace_kronecker, σ.normalized, mul_one]4041end POVM4243namespace Code44variable {ι ο κ μ ν η ι' ο' κ' : Type*}45[Fintype ι] [DecidableEq ι] [Fintype ο] [DecidableEq ο] [Fintype κ]46[Fintype μ] [DecidableEq μ] [Fintype ν] [DecidableEq ν] [Fintype η]47[Fintype ι'] [DecidableEq ι'] [Fintype ο'] [DecidableEq ο'] [Fintype κ']48{T : KrausChannel ι ο κ} {M : ℕ}4950/-- Append an independently prepared input and ignore its output. -/51def padRight (C : Code T M) (S : KrausChannel μ ν η) (σ : DensityMatrix μ) :52Code (T.tensor S) M where53encode := fun m => (C.encode m).tensor σ54decode := C.decode.ignoreRight5556@[simp] theorem padRight_success (C : Code T M) (S : KrausChannel μ ν η)57(σ : DensityMatrix μ) : (C.padRight S σ).success=C.success := by58have ho (m : Fin M) : (T.tensor S).output ((C.encode m).tensor σ) =59(T.output (C.encode m)).tensor (S.output σ) := by60apply Entropy.DensityMatrix.ext61exact T.tensor_map S _ _62unfold success padRight63simp only [ho,POVM.ignoreRight_probability]6465@[simp] theorem padRight_error (C : Code T M) (S : KrausChannel μ ν η)66(σ : DensityMatrix μ) : (C.padRight S σ).error=C.error := by67simp only [error,padRight_success]6869/-- Transport a physical code along input/output basis changes whose channel70map identity has been proved independently. -/71def transport (C : Code T M) (S : KrausChannel ι' ο' κ')72(ei : ι ≃ ι') (eo : ο ≃ ο') : Code S M where73encode := fun m => (C.encode m).reindex ei74decode := C.decode.reindex eo7576theorem transport_success (C : Code T M) (S : KrausChannel ι' ο' κ')77(ei : ι ≃ ι') (eo : ο ≃ ο')78(hmap : ∀X, S.map (Matrix.reindex ei ei X)=Matrix.reindex eo eo (T.map X)) :79(C.transport S ei eo).success=C.success := by80have ho (m : Fin M) : S.output ((C.encode m).reindex ei) =81(T.output (C.encode m)).reindex eo := by82apply Entropy.DensityMatrix.ext83exact hmap _84unfold success transport85simp only [ho,POVM.probability_reindex]8687theorem transport_error (C : Code T M) (S : KrausChannel ι' ο' κ')88(ei : ι ≃ ι') (eo : ο ≃ ο')89(hmap : ∀X, S.map (Matrix.reindex ei ei X)=Matrix.reindex eo eo (T.map X)) :90(C.transport S ei eo).error=C.error := by91simp only [error,transport_success C S ei eo hmap]9293variable [Nonempty ι]9495/-- Append any number of unused channel inputs. -/96def pad (T : KrausChannel ι ο κ) {m : ℕ} (C : Code (positiveTensorPower T m) M) :97(r : ℕ) → Code (positiveTensorPower T (m+r)) M98| 0 => C99| r+1 => (pad T C r).padRight T (maximallyMixed ι)100101@[simp] theorem pad_error (T : KrausChannel ι ο κ) {m : ℕ}102(C : Code (positiveTensorPower T m) M) (r : ℕ) : (pad T C r).error=C.error := by103induction r with104| zero => rfl105| succ r ih =>106change ((pad T C r).padRight T (maximallyMixed ι)).error=C.error107exact (padRight_error (pad T C r) T (maximallyMixed ι)).trans ih108109/-- A code at a shorter positive block length is a code at every longer length. -/110def padTo (T : KrausChannel ι ο κ) {m n : ℕ} (C : Code (positiveTensorPower T m) M)111(h : m≤n) : Code (positiveTensorPower T n) M :=112Nat.leRecOn (C := fun l => Code (positiveTensorPower T l) M) h113(fun D => D.padRight T (maximallyMixed ι)) C114115@[simp] theorem padTo_error (T : KrausChannel ι ο κ) {m n : ℕ}116(C : Code (positiveTensorPower T m) M) (h : m≤n) : (padTo T C h).error=C.error := by117induction h using Nat.leRec with118| refl => simp only [padTo,Nat.leRecOn_self]119| le_succ_of_le h ih =>120unfold padTo121rw [Nat.leRecOn_succ h]122exact (padRight_error _ T (maximallyMixed ι)).trans ih123124end Code125end Nonadditivity.Operational