AFTD Auto-Formalizing Theoretical Domains

ErrorSphere

defimported Lean

The error sphere $\mathrm{ES}(C,t)$ is the subspace $\bigvee_{\mathrm{wt}(p)\le t} \hat{p}(C)$, i.e.\ the supremum of the Pauli images of $C$ over all $t$-errors.

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 ErrorSphere (n t : ℕ) (C : Submodule ℂ (Hn n)) : Submodule ℂ (Hn n)
Defined in
TCSlib, `ErrorSphere`
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…
  • PauliErrorsLeThe set of all Pauli strings of weight at most $t$:…
  • instFiniteDimensionalComplexSubtypeHnMemSubmoduleinstFiniteDimensionalComplexSubtypeHnMemSubmodule
  • instFintypePauliStringinstFintypePauliString
  • pauliOpFor $p \in \mathrm{PauliString}\,n$, the associated Pauli operator $\hat{p} : \mathcal{H}_n \to \mathcal{H}_n$.
  • PauliStringA Pauli string of length $n$ is a function $p : \mathrm{Fin}\,n \to \mathrm{PauliBasis}$.
Used by 2
  • quantum_hamming_bound_rawQuantum Hamming bound for non-degenerate codes. Let $C \le \mathcal{H}_n$ be a subspace of the $n$-qubit Hilbert space that is a…
  • error_sphere_dimensionDimension of the error sphere of a non-degenerate code. Let $C \le \mathcal{H}_n$ be a code on $n$ qubits that is non-degenerate for $t$…

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 error sphere: the span of all images `E(C)` over Pauli strings `E` of weight ≤ t. This is the subspace that must fit inside `Hn n` to derive the Hamming bound. -/
noncomputable def ErrorSphere (n t : ℕ) (C : Submodule ℂ (Hn n)) : Submodule ℂ (Hn n) :=
  (PauliErrorsLe n t).sup (fun E => C.map (pauliOp E))
See it in the graphDiscuss this resultChallenge it