AFTD Auto-Formalizing Theoretical Domains

KnillLaflamme

defimported Lean

A subspace $C \le \mathcal{H}_n$ satisfies the Knill--Laflamme condition for $t$-error correction if for all Pauli strings $E,F$ with $\mathrm{wt}(E),\mathrm{wt}(F) \le t$ there exists $\lambda_{EF}\in\mathbb{C}$ such that $P_C\,E^\dagger F\,P_C = \lambda_{EF}\,P_C$, where $P_C$ is the orthogonal projection onto $C$.

Statement

set_option linter.mathlibStandardSet false in
open scoped BigOperators in
open scoped Real in
open scoped Nat in
open scoped Classical in
open scoped Pointwise in
set_option maxRecDepth 4000 in
set_option synthInstance.maxHeartbeats 20000 in
set_option synthInstance.maxSize 128 in
set_option relaxedAutoImplicit false in
set_option autoImplicit false in
open Complex Matrix in
noncomputable def KnillLaflamme (n : ℕ) (C : Submodule ℂ (Hn n)) (t : ℕ) : Prop
Defined in
TCSlib, `KnillLaflamme`
Lean proof
By Allan Li, Hydroxyi (from the file's git history), from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
Verified
07 Oct 2026
Axioms
none listed
Built on 7
  • HnThe $n$-qubit Hilbert space $\mathcal{H}_n = \ell^2\!\bigl(\{0,1\}^n,\mathbb{C}\bigr)$, implemented as \texttt{EuclideanSpace ℂ (Fin n →…
  • codeProj_applyAction of the code projection. Let $C$ be a closed subspace of the $n$-qubit Hilbert space $\mathcal{H}_n$, and let…
  • codeProjThe orthogonal projection of $\mathcal{H}_n$ onto a subspace $C$, viewed as an endomorphism $P_C : \mathcal{H}_n \to \mathcal{H}_n$.
  • pauliOpAdjointThe adjoint (Hermitian conjugate) $\hat{p}^\dagger : \mathcal{H}_n \to \mathcal{H}_n$ of the Pauli operator associated with a Pauli string…
  • weightThe support $\mathrm{supp}(p) \subseteq \mathrm{Fin}\,n$ consists of coordinates where $p(i) \neq I$; the weight is…
  • PauliStringA Pauli string of length $n$ is a function $p : \mathrm{Fin}\,n \to \mathrm{PauliBasis}$.
  • pauliOpFor $p \in \mathrm{PauliString}\,n$, the associated Pauli operator $\hat{p} : \mathcal{H}_n \to \mathcal{H}_n$.
Used by 6

Lean source view module on GitHub

set_option linter.mathlibStandardSet false in
open scoped BigOperators in
open scoped Real in
open scoped Nat in
open scoped Classical in
open scoped Pointwise in
set_option maxRecDepth 4000 in
set_option synthInstance.maxHeartbeats 20000 in
set_option synthInstance.maxSize 128 in
set_option relaxedAutoImplicit false in
set_option autoImplicit false in
open Complex Matrix in
/-- The Knill–Laflamme quantum error correction condition: for all Pauli errors `E`, `F` of weight ≤ t, the code projection satisfies `Π_C ∘ E† ∘ F ∘ Π_C = α_{E,F} • Π_C` for some scalar. -/
noncomputable def KnillLaflamme (n : ℕ) (C : Submodule ℂ (Hn n)) (t : ℕ) : Prop :=
  ∀ E F : PauliString n, weight E ≤ t → weight F ≤ t →
    ∃ α : ℂ,
      (codeProj C).comp ((pauliOpAdjoint E).comp ((pauliOp F).comp (codeProj C))) =
      α • (codeProj C)
See it in the graphDiscuss this resultChallenge it