Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Threshold theorem: below p_T, concatenated circuits simulate C to distance ε with polylog overhead

Open
QAlgorithms.GottesmanIntro.threshold_theorem

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

gottesman-introlecture-notesquantum-information

There exist an [[n,1,2t+1]][[n,1,2t+1]][[n,1,2t+1]] code with fault-tolerant gadgets of a common depth (Definitions 2–5) and a threshold pT>0p_T>0pT​>0 with the following property. For every ppp with 0≤p<pT0\le p<p_T0≤p<pT​ there are constants K>0K>0K>0 and c∈Nc\in\mathbb Nc∈N such that for every ideal circuit CCC (Definition 6: preparation, HHH, Rπ/8R_{\pi/8}Rπ/8​, CNOT, wait and measurement locations, no input) and every ε>0\varepsilon>0ε>0 there is a level LLL for which the LLL-fold concatenated fault-tolerant simulation C′=C(L)C'=C^{(L)}C′=C(L) satisfies

  1. #qubits(C′)≤K (log⁡2(2+∣C∣/ε))c #qubits(C)\#\mathrm{qubits}(C')\le K\,\big(\log_2(2+|C|/\varepsilon)\big)^{c}\,\#\mathrm{qubits}(C)#qubits(C′)≤K(log2​(2+∣C∣/ε))c#qubits(C) and #steps(C′)≤K (log⁡2(2+∣C∣/ε))c #steps(C)\#\mathrm{steps}(C')\le K\,\big(\log_2(2+|C|/\varepsilon)\big)^{c}\,\#\mathrm{steps}(C)#steps(C′)≤K(log2​(2+∣C∣/ε))c#steps(C), where ∣C∣|C|∣C∣ is the number of locations of CCC;
  2. for every local stochastic error model on C′C'C′ (Definition 12) with error bounds pi≤pp_i\le ppi​≤p, pi<1p_i<1pi​<1,
dTV(decoded output of C′, output of C)≤ε.d_{\mathrm{TV}}\big(\text{decoded output of } C',\ \text{output of } C\big)\le\varepsilon.dTV​(decoded output of C′, output of C)≤ε.

The output of C′C'C′ is decoded classically level by level. The threshold theorem shows that arbitrarily long quantum computations can be performed reliably with polylogarithmic overhead once the physical error rate is below a constant.

Formalization Note The fault-tolerant circuit is pinned to the concatenated circuit of the proof (p.42); an unconstrained circuit with free classical computation could sample the output of CCC classically. polylog(x)\mathrm{polylog}(x)polylog(x) is encoded as K(log⁡2(2+x))cK(\log_2(2+x))^cK(log2​(2+x))c, which is positive also for x≤1x\le 1x≤1.

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






/-- Gottesman intro p.41, Theorem 10 (threshold theorem): "There is a threshold error rate `p_T`.
Suppose we have a local stochastic error model with `p_i ≤ p < p_T`. Then for any ideal circuit
`C`, and any `ε > 0`, there exists a fault-tolerant circuit `C′` which, when it undergoes the
error model, produces an output which has statistical distance at most `ε` from the output of
`C`. `C′` has a number of qubits and a number of timesteps which are at most `polylog(|C|/ε)`
times bigger than the number of qubits and timesteps in `C`, where `|C|` is the number of
locations in `C`."

There are a fault-tolerant protocol `P` (an `[[n, 1, 2t + 1]]` code with gadgets of a common
depth) and a threshold `p_T > 0` such that for every `0 ≤ p < p_T` there are constants `K > 0` and
`c` with: for every ideal circuit `C` and every `ε > 0` there is a concatenation level `L` such
that `C′ = C^{(L)}` (the `L`-fold fault-tolerant simulation, p.42) has at most
`K (log₂(2 + |C|/ε))^c` times as many qubits and time steps as `C`, and for every local
stochastic error model on `C′` with bounds `p_i ≤ p` (`p_i < 1`, Def. 12) the decoded output
distribution of `C′` is within total variation distance `ε` of the output distribution of `C`. -/
theorem threshold_theorem :
    ∃ P : FTProtocol, P.IsFaultTolerant ∧ P.HasUniformDepth ∧
      ∃ pT : ℝ, 0 < pT ∧ ∀ p : ℝ, 0 ≤ p → p < pT →
        ∃ (K : ℝ) (c : ℕ), 0 < K ∧
          ∀ (N : ℕ) (C : LocCircuit N), C.IsIdealCircuit → ∀ ε : ℝ, 0 < ε →
            ∃ L : ℕ,
              ((concatCircuit P L C).numQubits : ℝ) ≤
                K * Real.logb 2 (2 + (C.size : ℝ) / ε) ^ c * (C.numQubits : ℝ) ∧
              ((concatCircuit P L C).numSteps : ℝ) ≤
                K * Real.logb 2 (2 + (C.size : ℝ) / ε) ^ c * (C.numSteps : ℝ) ∧
              ∀ (M : LocalStochasticModel (N * (P.n + P.A) ^ L)) (b : ℕ × ℕ → ℝ),
                (∀ ℓ ∈ (concatCircuit P L C).locs, b ℓ < 1) →
                (∀ ℓ ∈ (concatCircuit P L C).locs, b ℓ ≤ p) →
                IsLocalStochastic (concatCircuit P L C) M b →
                tvDist (pushDist (concatDecode P L C) (noisyOutDist (concatCircuit P L C) M))
                  C.idealOutDist ≤ ε := by
  sorry

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

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

Notions used.

A protocol PPP consists of:

  • numbers n,t,An,t,An,t,A;
  • a code C⊆C2n\mathcal C\subseteq\mathbb C^{2^n}C⊆C2n;
  • an encoder enc\mathrm{enc}enc and a decoder D\mathcal DD;
  • gadget circuits GκG_\kappaGκ​ for the location kinds prep, HHH, T=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4})T=diag(1,eiπ/4), CNOT, meas and wait;
  • an EC circuit GecG_{ec}Gec​;
  • a classical measDecode\mathrm{measDecode}measDecode.

"PPP is fault tolerant" means all of the following:

  • dim⁡C=2\dim\mathcal C=2dimC=2, and all operators on ≤2t\le2t≤2t qubits are detectable on C\mathcal CC.
  • enc\mathrm{enc}enc is an isometry onto C\mathcal CC.
  • D\mathcal DD is a Kraus channel decoding E enc ψE\,\mathrm{enc}\,\psiEencψ to ∥E enc ψ∥2∣ψ⟩⟨ψ∣\|E\,\mathrm{enc}\,\psi\|^2|\psi\rangle\langle\psi|∥Eencψ∥2∣ψ⟩⟨ψ∣ for all EEE in the span of weight-≤t\le t≤t Pauli strings.
  • All gadgets are well formed with the stated live data wires.
  • The Meas, Prep A/B, Gate A/B and EC A/B superoperator identities hold under Pauli faults. Each is stated with the filters Fr\mathcal F_rFr​ (projection onto Pauli-weight-≤r\le r≤r errors of C\mathcal CC) whenever fault count plus filter parameters is ≤t\le t≤t.

"Uniform depth" means all gadgets have the same number of time steps.

Concatenation. C(L)C^{(L)}C(L) is the level-LLL concatenation, on N(n+A)LN(n+A)^LN(n+A)L wires: C(0)=CC^{(0)}=CC(0)=C and C(L+1)=FTP(C(L))C^{(L+1)}=\mathrm{FT}_P(C^{(L)})C(L+1)=FTP​(C(L)). FTP\mathrm{FT}_PFTP​ replaces each step by a gadget phase followed by an EC phase on the blocks of non-measured wires. The decoder dec(L)\mathrm{dec}^{(L)}dec(L) applies the one-level logical record decoding LLL times, from the top level down. For a circuit:

  • numQubits\mathrm{numQubits}numQubits is its wire count;
  • numSteps\mathrm{numSteps}numSteps is its number of time steps;
  • size\mathrm{size}size is its number of locations.

Distributions. For a local stochastic model MMM (described below):

noisy(C,M)(r)=∑S⊆locsPr⁡M(S) out(C, ℓ↦[ℓ∈S]ES(ℓ), σ0)(r).\mathrm{noisy}(C,M)(r)=\sum_{S\subseteq\mathrm{locs}}\Pr_M(S)\,\mathrm{out}(C,\ \ell\mapsto[\ell\in S]\mathcal E_S(\ell),\ \sigma_0)(r).noisy(C,M)(r)=S⊆locs∑​MPr​(S)out(C, ℓ↦[ℓ∈S]ES​(ℓ), σ0​)(r).

The ideal distribution ideal(C)\mathrm{ideal}(C)ideal(C) is the output distribution with no errors and a trivial one-dimensional environment. The push-forward is pushdecμ(r)=∑dec(r′)=rμ(r′)\mathrm{push}_{\mathrm{dec}}\mu(r)=\sum_{\mathrm{dec}(r')=r}\mu(r')pushdec​μ(r)=∑dec(r′)=r​μ(r′), and the total variation distance is

tv(μ,ν)=12∑r∣μ(r)−ν(r)∣.\mathrm{tv}(\mu,\nu)=\tfrac12\sum_r|\mu(r)-\nu(r)|.tv(μ,ν)=21​r∑​∣μ(r)−ν(r)∣.

A model MMM is local stochastic for a circuit with bound bbb when:

  • its initial environment is a density matrix;
  • its weights are nonnegative, vanish off subsets of the locations, and sum to 111 over those subsets;
  • each ES(ℓ)\mathcal E_S(\ell)ES​(ℓ) with ℓ∈S\ell\in Sℓ∈S is a channel on the location's wires ⊗\otimes⊗ environment;
  • ∑R⊆S⊆locsPr⁡(S)≤∏i∈Rb(i)\sum_{R\subseteq S\subseteq\mathrm{locs}}\Pr(S)\le\prod_{i\in R}b(i)∑R⊆S⊆locs​Pr(S)≤∏i∈R​b(i) for every R⊆locsR\subseteq\mathrm{locs}R⊆locs.

Statement. There exists a fault-tolerant protocol PPP with uniform depth, and a real pT>0p_T>0pT​>0, such that the following holds.

For every ppp with 0≤p<pT0\le p<p_T0≤p<pT​ there exist a real K>0K>0K>0 and c∈Nc\in\mathbb Nc∈N, depending only on ppp, with the following property. For every NNN, every ideal circuit CCC on NNN wires (well formed from and to no live wires, all conditions constantly true) and every ε>0\varepsilon>0ε>0, there is a level LLL with:

N(n+A)L≤K log⁡2 ⁣(2+size(C)ε)c N,N(n+A)^L\le K\,\log_2\!\Big(2+\frac{\mathrm{size}(C)}{\varepsilon}\Big)^{c}\,N,N(n+A)L≤Klog2​(2+εsize(C)​)cN, numSteps(C(L))≤K log⁡2 ⁣(2+size(C)ε)c numSteps(C).\mathrm{numSteps}(C^{(L)})\le K\,\log_2\!\Big(2+\frac{\mathrm{size}(C)}{\varepsilon}\Big)^{c}\,\mathrm{numSteps}(C).numSteps(C(L))≤Klog2​(2+εsize(C)​)cnumSteps(C).

Moreover, for every local stochastic model MMM on N(n+A)LN(n+A)^LN(n+A)L wires with any bound bbb satisfying b(ℓ)<1b(\ell)<1b(ℓ)<1 and b(ℓ)≤pb(\ell)\le pb(ℓ)≤p at every location ℓ\ellℓ of C(L)C^{(L)}C(L):

tv(pushdec(L)noisy(C(L),M), ideal(C))≤ε.\mathrm{tv}\Big(\mathrm{push}_{\mathrm{dec}^{(L)}}\mathrm{noisy}(C^{(L)},M),\ \mathrm{ideal}(C)\Big)\le\varepsilon.tv(pushdec(L)​noisy(C(L),M), ideal(C))≤ε.

Remarks on edge cases.

  • The qubit count of C(L)C^{(L)}C(L) is by definition N(n+A)LN(n+A)^LN(n+A)L. For N=0N=0N=0 the qubit inequality reads 0≤00\le00≤0.
  • The constant 222 inside the logarithm makes the logarithm at least 111.
  • L=0L=0L=0 is permitted.
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