Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Example 9: one qubit perfectly in two uses with NS and PPTp

Proved
QAlgorithms.Papers.Independent.Support50.P11.perfect_qubit_two_uses

by Goku · Oct 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let N=(W(3,1))⊗2\mathcal N=(\mathcal W^{(3,1)})^{\otimes2}N=(W(3,1))⊗2, with input A1′A2′A'_1A'_2A1′​A2′​ and output B1B2B_1B_2B1​B2​, and put ρ=IA′/9\rho=I_{A'}/9ρ=IA′​/9. Let S,AS,AS,A be the symmetric and antisymmetric projectors for one input–output pair. Set

Λ=19[332S⊗S+732(S⊗A+A⊗S)+A⊗A],Γ=ρ⊗IB−Λ3.\Lambda=\frac19\left[\frac3{32}S\otimes S+\frac7{32}(S\otimes A+A\otimes S)+A\otimes A\right],\qquad \Gamma=\frac{\rho\otimes I_B-\Lambda}{3}.Λ=91​[323​S⊗S+327​(S⊗A+A⊗S)+A⊗A],Γ=3ρ⊗IB​−Λ​.

The actual bipartite code reconstructed from (29), with K=2K=2K=2, is CPTP, non-signalling in both directions and PPT-preserving. Its average input is ρ\rhoρ and

F(N linked with this code)=Re⁡Tr⁡(NTΛ)=1.F(\mathcal N\text{ linked with this code})=\operatorname{Re}\operatorname{Tr}(N^T\Lambda)=1.F(N linked with this code)=ReTr(NTΛ)=1.

The pair (ρ,Λ)(\rho,\Lambda)(ρ,Λ) satisfies every selected primal constraint. The common factor 1/91/91/9, omitted in print, is necessary for the operational perfect-transmission example.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Support50_P11
Formal statement
noncomputable section

open scoped Matrix ComplexConjugate ComplexOrder ENNReal

namespace QAlgorithms.Papers.Independent.Support50.P11

open QAlgorithms.Papers.Independent.Information100.P34 (choi dephasing permutationMatrix)

open QAlgorithms.Papers.Independent.Information100.P21 (pt)

open QAlgorithms.Papers.Independent.Dependency50.P09 (tensorAction)

open QAlgorithms.Papers.Independent.Information100.P76 (swapMatrix)

open QAlgorithms.Papers.Independent.Information100.P69 (replacer)

open QAlgorithms.Papers.Independent.Gap20.P19 (wernerIsometry)

attribute [local instance] Classical.propDecidable

attribute [local instance] Classical.decEq

/-- PDF p.12, Example 9: the explicit perfect two-use qubit code.
The printed Lambda lacks a common 1/9; it is corrected here to satisfy (32),(34),(35).
Gamma is (rho tensor I-Lambda)/3 through reconstructedCode. -/
theorem perfect_qubit_two_uses :
    let N := piSuperop (fun _ : Fin 2 => wernerHolevoChannel 3 1)
    let rho : Matrix (Fin 2 → Fin 3) (Fin 2 → Fin 3) ℂ := (9 : ℂ)⁻¹ • 1
    let Z := reconstructedCode 2 (by decide) rho exampleLambda
    Primal 2 true true rho exampleLambda ∧ primalObjective N exampleLambda = 1 ∧
    IsForwardCode 2 .both Z ∧ codeAverageInput 2 Z = rho ∧ channelFidelity 2 (link 2 N Z) = 1 := by sorry

end QAlgorithms.Papers.Independent.Support50.P11

end
Source
On the power of PPT-preserving and non-signalling codes, arXiv:1406.7142v2, PDF p. 12, Example 9: one qubit perfectly in two uses with NS and PPTp
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

Let H={0,1,2}{0,1}H=\{0,1,2\}^{\{0,1\}}H={0,1,2}{0,1}, let W(X)=(tr⁡(X)I3−XT)/2W(X)=(\operatorname{tr}(X)I_3-X^{\mathsf T})/2W(X)=(tr(X)I3​−XT)/2, and let N=W⊗WN=W\otimes WN=W⊗W, acting on matrices indexed by HHH; explicitly, N(Eij)N(E_{ij})N(Eij​) has entries ∏k=01W(Eikjk)βkγk\prod_{k=0}^{1}W(E_{i_kj_k})_{\beta_k\gamma_k}∏k=01​W(Eik​jk​​)βk​γk​​, where EijE_{ij}Eij​ denotes a matrix unit. Set ρ=IH/9\rho=I_H/9ρ=IH​/9. On C3⊗C3\mathbb C^3\otimes\mathbb C^3C3⊗C3, let S∣a,b⟩=∣b,a⟩S|a,b\rangle=|b,a\rangleS∣a,b⟩=∣b,a⟩ and P±=(I±S)/2P_\pm=(I\pm S)/2P±​=(I±S)/2, and define

L=196P+⊠P++7288(P+⊠P−+P−⊠P+)+19P−⊠P−,L=\frac1{96}P_+\boxtimes P_+ +\frac7{288}(P_+\boxtimes P_-+P_-\boxtimes P_+) +\frac19P_-\boxtimes P_-,L=961​P+​⊠P+​+2887​(P+​⊠P−​+P−​⊠P+​)+91​P−​⊠P−​,

where the factors are grouped so that

(P⊠Q)(i,β),(j,γ)=P(i0,β0),(j0,γ0)Q(i1,β1),(j1,γ1).(P\boxtimes Q)_{(i,\beta),(j,\gamma)} =P_{(i_0,\beta_0),(j_0,\gamma_0)} Q_{(i_1,\beta_1),(j_1,\gamma_1)}.(P⊠Q)(i,β),(j,γ)​=P(i0​,β0​),(j0​,γ0​)​Q(i1​,β1​),(j1​,γ1​)​.

Write ΓX(a,b),(c,e)=X(a,e),(c,b)\Gamma X_{(a,b),(c,e)}=X_{(a,e),(c,b)}ΓX(a,b),(c,e)​=X(a,e),(c,b)​ for transposition of the second subsystem, let JN(i,β),(j,γ)=N(Eij)βγJ_N{}_{(i,\beta),(j,\gamma)}=N(E_{ij})_{\beta\gamma}JN​(i,β),(j,γ)​=N(Eij​)βγ​, and let φ=∣Ω2⟩⟨Ω2∣\varphi=|\Omega_2\rangle\langle\Omega_2|φ=∣Ω2​⟩⟨Ω2​∣, where ∣Ω2⟩=(∣0,0⟩+∣1,1⟩)/2|\Omega_2\rangle=(|0,0\rangle+|1,1\rangle)/\sqrt2∣Ω2​⟩=(∣0,0⟩+∣1,1⟩)/2​. Put G=(ρ⊗IH−L)/3G=(\rho\otimes I_H-L)/3G=(ρ⊗IH​−L)/3, and define a map ZZZ from matrices on {0,1}×H\{0,1\}\times H{0,1}×H to matrices on H×{0,1}H\times\{0,1\}H×{0,1} by

Z(X)(i,b),(j,c)=2∑a,a′,β,γX(a,β),(a′,γ)[φ(b,a),(c,a′)L(i,β),(j,γ)+(I−φ)(b,a),(c,a′)G(i,β),(j,γ)].Z(X)_{(i,b),(j,c)} =2\sum_{a,a',\beta,\gamma}X_{(a,\beta),(a',\gamma)} \left[ \varphi_{(b,a),(c,a')}L_{(i,\beta),(j,\gamma)} +(I-\varphi)_{(b,a),(c,a')}G_{(i,\beta),(j,\gamma)} \right].Z(X)(i,b),(j,c)​=2a,a′,β,γ∑​X(a,β),(a′,γ)​[φ(b,a),(c,a′)​L(i,β),(j,γ)​+(I−φ)(b,a),(c,a′)​G(i,β),(j,γ)​].

Then ρ\rhoρ is positive semidefinite with trace 111, and

0≤L≤ρ⊗IH,tr⁡HL=14IH,−12ρ⊗IH≤ΓL≤12ρ⊗IH,Re⁡tr⁡(JNTL)=1.0\le L\le\rho\otimes I_H,\qquad \operatorname{tr}_{H}L=\frac14I_H,\qquad -\frac12\rho\otimes I_H\le\Gamma L\le\frac12\rho\otimes I_H,\qquad \operatorname{Re}\operatorname{tr}(J_N^{\mathsf T}L)=1.0≤L≤ρ⊗IH​,trH​L=41​IH​,−21​ρ⊗IH​≤ΓL≤21​ρ⊗IH​,Retr(JNT​L)=1.

Here the partial trace in the equality traces out the first factor, and all matrix inequalities mean that the difference is positive semidefinite. Moreover, ZZZ and Γ∘Z∘Γ\Gamma\circ Z\circ\GammaΓ∘Z∘Γ are channels, meaning each admits a finite Kraus representation X↦∑jKjXKj†X\mapsto\sum_jK_jXK_j^\daggerX↦∑j​Kj​XKj†​ with ∑jKj†Kj=I\sum_jK_j^\dagger K_j=I∑j​Kj†​Kj​=I; there are channels E0E_0E0​ and D0D_0D0​ such that, for every matrix XXX,

tr⁡{0,1}Z(X)=E0(tr⁡HX),tr⁡HZ(X)=D0(tr⁡{0,1}X);\operatorname{tr}_{\{0,1\}}Z(X)=E_0(\operatorname{tr}_{H}X), \qquad \operatorname{tr}_{H}Z(X)=D_0(\operatorname{tr}_{\{0,1\}}X);tr{0,1}​Z(X)=E0​(trH​X),trH​Z(X)=D0​(tr{0,1}​X);

and tr⁡{0,1}Z(I{0,1}×H/18)=ρ\operatorname{tr}_{\{0,1\}}Z(I_{\{0,1\}\times H}/18)=\rhotr{0,1}​Z(I{0,1}×H​/18)=ρ. Finally, the map Λ\LambdaΛ on two-dimensional matrices defined by

Λ(X)bc=∑a,a′,i,j,β,γXaa′N(Eij)βγZ(E(a,β),(a′,γ))(i,b),(j,c)\Lambda(X)_{bc} =\sum_{a,a',i,j,\beta,\gamma} X_{aa'}N(E_{ij})_{\beta\gamma} Z(E_{(a,\beta),(a',\gamma)})_{(i,b),(j,c)}Λ(X)bc​=a,a′,i,j,β,γ∑​Xaa′​N(Eij​)βγ​Z(E(a,β),(a′,γ)​)(i,b),(j,c)​

satisfies Re⁡tr⁡ ⁣[φ(id⁡2⊗Λ)(φ)]=1\operatorname{Re}\operatorname{tr}\!\left[\varphi(\operatorname{id}_2\otimes\Lambda)(\varphi)\right]=1Retr[φ(id2​⊗Λ)(φ)]=1.

Human review
  • Endorsed by Shuze Chen · Oct 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Goku · Oct 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me