Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Correctable errors are closed under linear combinations; weight-t Pauli errors give all t-qubit errors

Open
QAlgorithms.GottesmanIntro.corrects_linearCombination

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

gottesman-introlecture-notesquantum-information

Let CCC be a quantum code on nnn qubits, i.e. a linear subspace of (C2)⊗n(\mathbb C^2)^{\otimes n}(C2)⊗n. Say that CCC corrects a set S\mathcal SS of operators if there is one quantum operation R\mathcal RR (a trace-preserving map ρ↦∑iRiρRi†\rho\mapsto\sum_i R_i\rho R_i^\daggerρ↦∑i​Ri​ρRi†​, ∑iRi†Ri=I\sum_i R_i^\dagger R_i=I∑i​Ri†​Ri​=I) such that for every E∈SE\in\mathcal SE∈S and every unit vector ∣ψ⟩∈C|\psi\rangle\in C∣ψ⟩∈C,

R(E∣ψ⟩⟨ψ∣E†)=∥E∣ψ⟩∥2 ∣ψ⟩⟨ψ∣.\mathcal R\big(E|\psi\rangle\langle\psi|E^\dagger\big)=\|E|\psi\rangle\|^2\,|\psi\rangle\langle\psi|.R(E∣ψ⟩⟨ψ∣E†)=∥E∣ψ⟩∥2∣ψ⟩⟨ψ∣.

Then:

  1. If CCC corrects {A,B}\{A,B\}{A,B}, then CCC corrects the whole linear span {aA+bB:a,b∈C}\{aA+bB : a,b\in\mathbb C\}{aA+bB:a,b∈C}.
  2. For every ttt, if CCC corrects every Pauli operator of weight at most ttt (a tensor product of I,X,Y,ZI,X,Y,ZI,X,Y,Z with a phase, at most ttt factors different from III), then CCC corrects every operator that acts on at most ttt qubits. Such an operator has the form M⊗IM\otimes IM⊗I for an arbitrary, not necessarily unitary, operator MMM on a set of at most ttt qubits.

The theorem reduces error correction to a basis of errors. It is why it suffices to correct the discrete Pauli errors in order to correct arbitrary, even continuous or non-unitary, errors on few qubits.

Formalization Note The factor ∥E∣ψ⟩∥2\|E|\psi\rangle\|^2∥E∣ψ⟩∥2 is forced by trace preservation of R\mathcal RR. One recovery must serve all errors at once: this is the source's procedure (record the error, measure, invert). With separate recoveries the claim fails.

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

open scoped Matrix

open QAlgorithms Stabilizer


/-- Gottesman intro p.4, Theorem 2: for an `n`-qubit quantum code `C`, (1) if `C` corrects the
errors `A` and `B` (with one recovery operation), it corrects every linear combination of `A`
and `B` (all of them with one recovery operation); (2) if `C` corrects all Pauli errors of
weight at most `t`, it corrects all errors acting on at most `t` qubits (arbitrary, not
necessarily unitary, operators; p.5). -/
theorem corrects_linearCombination (n : ℕ) (C : Submodule ℂ (EuclideanSpace ℂ (Qubits n))) :
    (∀ A B : Matrix (Qubits n) (Qubits n) ℂ, Corrects C {A, B} →
      Corrects C (Submodule.span ℂ {A, B} : Set (Matrix (Qubits n) (Qubits n) ℂ))) ∧
    ∀ t : ℕ, Corrects C {M | ∃ P : PauliString n, P.weight ≤ t ∧ M = P.toMatrix} →
      Corrects C {E | ActsOnAtMost t E} := by
  sorry



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

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

Setting. Fix n∈Nn\in\mathbb{N}n∈N and a complex subspace C⊆C{0,1}nC\subseteq\mathbb{C}^{\{0,1\}^n}C⊆C{0,1}n (the nnn-qubit state space).

Correctability. For a set SSS of 2n×2n2^n\times 2^n2n×2n complex matrices, "CCC corrects SSS" means the following. There exists a single map RRR from 2n×2n2^n\times2^n2n×2n matrices to 2n×2n2^n\times2^n2n×2n matrices that is a Kraus-form channel, meaning R(ρ)=∑jKjρKj†R(\rho)=\sum_j K_j\rho K_j^\daggerR(ρ)=∑j​Kj​ρKj†​ for finitely many KjK_jKj​ with ∑jKj†Kj=I\sum_j K_j^\dagger K_j=I∑j​Kj†​Kj​=I. This one RRR must satisfy, for every E∈SE\in SE∈S and every unit vector ψ∈C\psi\in Cψ∈C,

R(∣Eψ⟩⟨Eψ∣)=∥Eψ∥2 ∣ψ⟩⟨ψ∣.R\big(|E\psi\rangle\langle E\psi|\big)=\|E\psi\|^2\,|\psi\rangle\langle\psi|.R(∣Eψ⟩⟨Eψ∣)=∥Eψ∥2∣ψ⟩⟨ψ∣.

The theorem is a conjunction of two statements.

  1. Spans. For all matrices A,BA,BA,B: if CCC corrects {A,B}\{A,B\}{A,B}, then CCC corrects the entire complex linear span {αA+βB:α,β∈C}\{\alpha A+\beta B:\alpha,\beta\in\mathbb{C}\}{αA+βB:α,β∈C}.

  2. From Paulis to local errors. For every t∈Nt\in\mathbb{N}t∈N, suppose CCC corrects the set of Pauli-string matrices of weight ≤t\le t≤t. Then CCC corrects every matrix acting on at most ttt qubits.

    • Pauli strings. These are the matrices
ic σ1⊗⋯⊗σn,c∈{0,1,2,3}, σq∈{I,X,Y,Z},i^{c}\,\sigma_{1}\otimes\cdots\otimes\sigma_{n}, \qquad c\in\{0,1,2,3\},\ \sigma_q\in\{I,X,Y,Z\},icσ1​⊗⋯⊗σn​,c∈{0,1,2,3}, σq​∈{I,X,Y,Z},
 where $Y=\begin{pmatrix}0&-i\\ i&0\end{pmatrix}$. Factor $q$ acts on wire $q$.
  • Weight. The weight of a Pauli string is the number of factors σq≠I\sigma_q\ne Iσq​=I. The overall phase is unrestricted.

  • Acting on at most ttt qubits. EEE acts on at most ttt qubits if there are:

    • a set FFF of at most ttt wires;
    • an injective listing w:{0,…,k−1}→{0,…,n−1}w:\{0,\dots,k-1\}\to\{0,\dots,n-1\}w:{0,…,k−1}→{0,…,n−1} with image inside FFF;
    • an arbitrary (not necessarily unitary) 2k×2k2^k\times2^k2k×2k matrix MMM,

    such that EEE is MMM placed on wires www and the identity elsewhere. Explicitly, Ey,z=My∘w,  z∘wE_{y,z}=M_{y\circ w,\;z\circ w}Ey,z​=My∘w,z∘w​ when yyy and zzz agree outside the image of www, and Ey,z=0E_{y,z}=0Ey,z​=0 otherwise.

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