Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Knill–Laflamme condition for quantum error correction

Open
QAlgorithms.GottesmanIntro.knillLaflamme

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

gottesman-introlecture-notesquantum-information

This is the Knill–Laflamme criterion.

Let H\mathcal HH be a finite-dimensional Hilbert space, E\mathcal EE a linear space of operators on H\mathcal HH (the errors) and C⊆HC\subseteq\mathcal HC⊆H a subspace. Say CCC corrects E\mathcal EE if there is a quantum operation R\mathcal RR on H\mathcal HH (a map ρ↦∑iRiρRi†\rho\mapsto\sum_i R_i\rho R_i^\daggerρ↦∑i​Ri​ρRi†​ with ∑iRi†Ri=I\sum_i R_i^\dagger R_i=I∑i​Ri†​Ri​=I) such that R(E∣ψ⟩⟨ψ∣E†)=∥E∣ψ⟩∥2∣ψ⟩⟨ψ∣\mathcal R(E|\psi\rangle\langle\psi|E^\dagger)=\|E|\psi\rangle\|^2|\psi\rangle\langle\psi|R(E∣ψ⟩⟨ψ∣E†)=∥E∣ψ⟩∥2∣ψ⟩⟨ψ∣ for all E∈EE\in\mathcal EE∈E and all unit vectors ∣ψ⟩∈C|\psi\rangle\in C∣ψ⟩∈C. Then CCC corrects E\mathcal EE if and only if there is a function c:E→Cc:\mathcal E\to\mathbb Cc:E→C such that

⟨ψ∣E†E∣ψ⟩=c(E)for all E∈E and all unit vectors ∣ψ⟩∈C.\langle\psi|E^\dagger E|\psi\rangle=c(E)\qquad\text{for all }E\in\mathcal E\text{ and all unit vectors }|\psi\rangle\in C.⟨ψ∣E†E∣ψ⟩=c(E)for all E∈E and all unit vectors ∣ψ⟩∈C.

The criterion turns the existence of a recovery operation into a checkable condition on the code alone. It is the basis of the distance, degeneracy and counting bounds that follow.

Formalization Note The function ccc is quantified before ∣ψ⟩|\psi\rangle∣ψ⟩, so it does not depend on the state. Codewords are normalized, following the source's convention of omitted normalization (p.2).

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.6, Theorem 3 (Knill–Laflamme): for a linear space `𝓔` of errors on a
finite-dimensional Hilbert space `H` and a subspace `C` of `H`, `C` is a quantum
error-correcting code correcting `𝓔` iff there is a function `c(E)`, independent of the state,
with `⟨ψ|E†E|ψ⟩ = c(E)` for all `E ∈ 𝓔` and all normalized `|ψ⟩ ∈ C` (eq. (29)). -/
theorem knillLaflamme {ι : Type*} [Fintype ι] [DecidableEq ι]
    (𝓔 : Submodule ℂ (Matrix ι ι ℂ)) (C : Submodule ℂ (EuclideanSpace ℂ ι)) :
    Corrects C (𝓔 : Set (Matrix ι ι ℂ)) ↔
      ∃ c : Matrix ι ι ℂ → ℂ, ∀ E ∈ 𝓔, ∀ ψ ∈ C, ‖ψ‖ = 1 → inner ℂ ψ (act (Eᴴ * E) ψ) = c E := by
  sorry


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

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

Setting. Let ι\iotaι be a finite index set with decidable equality. Let E\mathcal{E}E be a complex linear subspace of the ι×ι\iota\times\iotaι×ι complex matrices, and let CCC be a complex subspace of Cι\mathbb{C}^\iotaCι.

Statement. The following are equivalent.

  1. CCC corrects E\mathcal{E}E. There is a single Kraus-form channel RRR with the following property. Here R(ρ)=∑jKjρKj†R(\rho)=\sum_j K_j\rho K_j^\daggerR(ρ)=∑j​Kj​ρKj†​ for finitely many ι×ι\iota\times\iotaι×ι matrices KjK_jKj​ with ∑jKj†Kj=I\sum_j K_j^\dagger K_j=I∑j​Kj†​Kj​=I. For every E∈EE\in\mathcal{E}E∈E 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∣ψ⟩⟨ψ∣.

Here ∣ϕ⟩⟨ϕ∣|\phi\rangle\langle\phi|∣ϕ⟩⟨ϕ∣ is the matrix (a,b)↦ϕaϕb‾(a,b)\mapsto\phi_a\overline{\phi_b}(a,b)↦ϕa​ϕb​​.

  1. Constant expectation. There is a function ccc from matrices to C\mathbb{C}C such that, for every E∈EE\in\mathcal{E}E∈E and every unit vector ψ∈C\psi\in Cψ∈C,
⟨ψ, E†E ψ⟩=c(E).\langle\psi,\,E^\dagger E\,\psi\rangle=c(E).⟨ψ,E†Eψ⟩=c(E).

The inner product is conjugate-linear in its first argument.

Condition 2 constrains only the diagonal expectations ⟨ψ,E†Eψ⟩\langle\psi,E^\dagger E\psi\rangle⟨ψ,E†Eψ⟩ of single operators E∈EE\in\mathcal{E}E∈E. It requires these to be independent of the unit codeword ψ\psiψ. It does not explicitly mention cross terms ⟨ψi,E†Fψj⟩\langle\psi_i,E^\dagger F\psi_j\rangle⟨ψi​,E†Fψj​⟩.

If C={0}C=\{0\}C={0}, there are no unit vectors in CCC, and both sides hold trivially.

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