Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

A good truncated ExRec is correct for ideal decoders and *-decoders

Open
QAlgorithms.GottesmanIntro.good_truncated_exRec_correct

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

gottesman-introlecture-notesquantum-information

This lemma extends Theorem 6 to the truncated extended rectangles that appear when bad rectangles are pushed through in level reduction.

Fix an [[n,1,2t+1]][[n,1,2t+1]][[n,1,2t+1]] code with ideal decoder D\mathcal DD and fault-tolerant gadgets satisfying Definitions 2–5, with Pauli faults. A truncated ExRec is an ExRec of type κ\kappaκ from which the trailing EC steps on a nonempty set TTT of output blocks have been removed (Definition 10). Only ExRecs with trailing ECs can be truncated: gate, wait and preparation ExRecs. It is good if the remaining locations contain at most ttt faults:

slead+sgadget+∑j∉Tstrail,j≤t.s_{\mathrm{lead}} + s_{\mathrm{gadget}} + \sum_{j\notin T} s_{\mathrm{trail},j} \le t .slead​+sgadget​+j∈/T∑​strail,j​≤t.

Then:

  1. the truncated ExRec is correct for the ideal decoder, i.e. diagrams (72)/(73) hold with the removed trailing EC steps deleted;
  2. for every *-decoder WWW of D\mathcal DD, the truncated ExRec is correct for WWW (eq. (83) and its preparation version, with the removed trailing EC steps deleted).

Formalization Note The truncation set is a nonempty Finset of output blocks. For a measurement ExRec there are no output blocks, so the hypothesis cannot hold, matching the source.

Preamble
import Definitions.Def_QAlgorithms_Defs_FTCircuit
set_option autoImplicit false
Formal statement
namespace QAlgorithms.GottesmanIntro




/-- Gottesman intro p.38, Lemma 3: "A good truncated ExRec is correct for both ideal decoders and
*-decoders." Let `P` be a fault-tolerant protocol (Defs. 2–5). For every ExRec type `κ`, every
nonempty set `trunc` of output blocks whose trailing EC is removed (a truncated ExRec, Def. 10;
measurement ExRecs have no trailing EC, so for them the hypothesis is void), and every Pauli
fault arrangement `F` with at most `t` faults in the remaining locations (good, Def. 10), the
truncated ExRec is correct for the ideal decoder, and it is correct for every *-decoder `W` of
the ideal decoder. -/
theorem good_truncated_exRec_correct (P : FTProtocol) (hP : P.IsFaultTolerant) (κ : LocKind)
    (F : ExRecFaults κ) (trunc : Finset (Fin κ.trailCount)) (htrunc : trunc.Nonempty)
    (hgood : F.count P trunc ≤ P.t) :
    ExRecCorrect P κ F trunc ∧
      ∀ (σ : ℕ) (W : Matrix (Bool × Fin σ) (Qubits P.n) ℂ), IsStarDecoder P.dec W →
        ExRecCorrectStar P W κ F trunc := by
  sorry

end QAlgorithms.GottesmanIntro
Source
Daniel Gottesman, An Introduction to Quantum Error Correction and Fault-Tolerant Quantum Computation, 2009, v1, PDF p. 38, §5.2, Lemma 3. https://arxiv.org/pdf/0904.2557v1
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

The data.

  • PPP. A protocol (code C⊆C2n\mathcal C\subseteq\mathbb C^{2^n}C⊆C2n, encoder, decoder dec\mathrm{dec}dec, gadgets GκG_\kappaGκ​, EC circuit GECG_{\mathrm{EC}}GEC​, classical decoding md\mathrm{md}md, parameter ttt) satisfying the full fault-tolerance condition. This condition comprises:
    • a 2-dimensional code detecting all operators on ≤2t\le 2t≤2t qubits;
    • an isometric encoding onto C\mathcal CC;
    • a Kraus-channel decoder that perfectly decodes encoded states hit by operators in the span of weight-≤t\le t≤t Paulis;
    • well-formed gadgets with the expected live-qubit flows;
    • the properties Meas, Prep A/B, Gate A/B and EC A/B, whenever fault counts plus filter levels are ≤t\le t≤t.
  • κ\kappaκ. Any location kind.
  • FFF. ExRec fault data: leading EC arrangements FileadF^{\text{lead}}_iFilead​ (none for prep), a gadget arrangement FgadF^{\text{gad}}Fgad, and trailing EC arrangements FjtrailF^{\text{trail}}_jFjtrail​ (none for meas).
  • τ\tauτ. A nonempty set of output-block indices.
    • For meas there are no output blocks, so this hypothesis cannot hold and the statement is vacuous for κ=\kappa=κ= meas.
    • For prep it forces τ={0}\tau=\{0\}τ={0}.
  • Hypothesis hgoodh_{\text{good}}hgood​.
∑i#EC(Filead)+#Gκ(Fgad)+∑j∉τ#EC(Fjtrail)≤t,\textstyle\sum_i\#_{\mathrm{EC}}(F^{\text{lead}}_i)+\#_{G_\kappa}(F^{\text{gad}})+\sum_{j\notin\tau}\#_{\mathrm{EC}}(F^{\text{trail}}_j)\le t,∑i​#EC​(Filead​)+#Gκ​​(Fgad)+∑j∈/τ​#EC​(Fjtrail​)≤t,

where #G(f)\#_G(f)#G​(f) is the number of locations of GGG at which fff places a Pauli pair.

Conclusion, part 1: the truncated ExRec is correct.

  • prep: dec(PrepFgad)=∣0⟩⟨0∣\mathrm{dec}(\mathrm{Prep}_{F^{\text{gad}}})=|0\rangle\langle0|dec(PrepFgad​)=∣0⟩⟨0∣. The trailing EC is omitted, since 0∈τ0\in\tau0∈τ.
  • gate/wait (HHH, TTT, CNOT, wait):
(⨂dec)∘Trτ∘Gateκ,Fgad∘⨂iECFilead=Uκ∘(⨂dec)∘⨂iECFilead.\textstyle(\bigotimes\mathrm{dec})\circ\mathrm{Tr}_\tau\circ\mathrm{Gate}_{\kappa,F^{\text{gad}}}\circ\bigotimes_i\mathrm{EC}_{F^{\text{lead}}_i}=\mathcal U_\kappa\circ(\bigotimes\mathrm{dec})\circ\bigotimes_i\mathrm{EC}_{F^{\text{lead}}_i}.(⨂dec)∘Trτ​∘Gateκ,Fgad​∘⨂i​ECFilead​​=Uκ​∘(⨂dec)∘⨂i​ECFilead​​.

Here:

  • Trτ\mathrm{Tr}_\tauTrτ​ applies the identity on blocks j∈τj\in\tauj∈τ and ECFjtrail\mathrm{EC}_{F^{\text{trail}}_j}ECFjtrail​​ on the others;
  • the gadget maps run the gadget under the Pauli faults with ancillas in ∣0⟩|0\rangle∣0⟩, sum over measurement records, and trace out the ancillas;
  • Uκ\mathcal U_\kappaUκ​ is conjugation by HHH, T=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4})T=diag(1,eiπ/4), CNOT (first wire is the control), or III.

Conclusion, part 2: the ∗*∗-version holds for every ∗*∗-decoder. Take every σ∈N\sigma\in\mathbb Nσ∈N and every (2σ)×2n(2\sigma)\times2^n(2σ)×2n matrix WWW with W†W=IW^\dagger W=IW†W=I, WW†=IWW^\dagger=IWW†=I and Tr2(WρW†)=dec(ρ)\mathrm{Tr}_2(W\rho W^\dagger)=\mathrm{dec}(\rho)Tr2​(WρW†)=dec(ρ) for all ρ\rhoρ. Then:

  • prep: there is a density matrix τ0\tau_0τ0​ on Cσ\mathbb C^\sigmaCσ with W PrepFgad W†=∣0⟩⟨0∣⊗τ0W\,\mathrm{Prep}_{F^{\text{gad}}}\,W^\dagger=|0\rangle\langle0|\otimes\tau_0WPrepFgad​W†=∣0⟩⟨0∣⊗τ0​.
  • gate/wait: there is a Kraus channel VVV on the σ\sigmaσ-parts such that
(⨂W)∘Trτ∘Gateκ,Fgad∘Lead=PUκ,V∘(⨂W)∘Lead.\textstyle(\bigotimes\mathcal W)\circ\mathrm{Tr}_\tau\circ\mathrm{Gate}_{\kappa,F^{\text{gad}}}\circ\mathrm{Lead}=\mathcal P_{U_\kappa,V}\circ(\bigotimes\mathcal W)\circ\mathrm{Lead}.(⨂W)∘Trτ​∘Gateκ,Fgad​∘Lead=PUκ​,V​∘(⨂W)∘Lead.

Here W(ρ)=WρW†\mathcal W(\rho)=W\rho W^\daggerW(ρ)=WρW† on each block. PU,V\mathcal P_{U,V}PU,V​ applies VVV to the joint σ\sigmaσ-parts and conjugates the joint bit-parts by UκU_\kappaUκ​.

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

    Confirmed by the moderator at approval.

  • Endorsed by Goku · Oct 13, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me