The circuit-level threshold: many locations, one union bound, and the level count #
Category: 1-Mathlib (CSD-free; staged as a Mathlib-upstream candidate). BACKLOG #62, its probabilistic half.
Glossary: https://glossary.constraintsurfacedynamics.com/threshold-theorem/
Plain-language, CSD-role and formal statements of the threshold theorem, with this module as
the Lean anchor. Kept symmetric by scripts/check-glossary.sh.
CodeCapacityThreshold.lean bounds the failure of one encoded block. A computation is a circuit
of many locations, each replaced by a gadget, and it fails when any of them fails. This module is
that step: the fault patterns of a circuit of N locations whose level-k gadgets have L fault
locations each, the union bound over the circuit, and the count of levels an accuracy demands.
Fintype (ConcatPat n k)and ★card_concatPat— the level-kgadget hasn ^ kfault locations: its pattern space has2 ^ (n ^ k)elements. This is the overhead of the recursive simulation, in the only form this file needs;circuitMeasure N L ν k— independent faults at every location of every gadget: the product over theNcircuit locations ofconcatMeasure L ν k;circuitBad N L k— the circuit fails when some location's level-kgadget is bad;- ★★
circuitMeasure_circuitBad_le— the circuit-level boundℙ[circuit fails] ≤ N · (c p)^{2^k} / cwithc = C(L, 2): the union bound over the locations on top of the code-capacity recursion; - ★
exists_level_mul_ltand ★★★exists_level_circuitMeasure_lt— the threshold at circuit level: belowp < 1/c, for every circuit sizeNand every accuracyεthere is a levelkat which the whole circuit fails with probability less thanε; - ★
mul_codeCapacityBound_lt_of_log_div_lt— the quantitative form: anykwith2^k > log(c ε / N) / log(c p)will do. The right-hand side is a single logarithm, so the level needed grows likelog log (N/ε); - ★★
exists_level_two_pow_leand ★★★exists_level_overhead_le— the overhead is polylogarithmic: the levelk = ⌈log₂ X⌉ + 1(Xthe logarithm ratio above, floored at1) both meets the accuracy and keeps2^k ≤ 4X, so the gadget'sL^kfault locations are at most(4X)^{log₂ L}— a fixed power of a logarithm ofN/ε.pow_eq_rpow_logbis the identityL^k = (2^k)^{log₂ L}that turns the doubling parameter into the overhead.
Honest scope #
⚠️ This is the accounting, not the fault tolerance. What makes a gadget "bad" is an input to
this file, exactly as in CodeCapacityThreshold.lean: the consumer must prove that a gadget with at
most one fault does the right thing. For faulty gates on the Steane code that consumer is
Empirical/QM/QEC/SteaneFaultyGate.lean, at level one and with an ideal recovery. Faults inside the
recovery gadget itself — hence extended rectangles, and with them the Aharonov–Ben-Or simulation
theorem — are not here; specs/BACKLOG.md #62 records what is left.
⚠️ The locations of a circuit are indexed by Fin N and nothing here says what they do: there is
no circuit datatype, no gate set, no time ordering. The union bound needs none of that, and claiming
more would be claiming the simulation theorem.
References: D. Aharonov, M. Ben-Or, Fault-tolerant quantum computation with constant error rate,
SIAM J. Comput. 38 (2008), §2; P. Aliferis, D. Gottesman, J. Preskill, Quantum accuracy threshold
for concatenated distance-3 codes, Quantum Inf. Comput. 6 (2006); specs/BACKLOG.md #62;
specs/steane-plan.md; specs/future-work.md.
The pattern space of a level-k gadget is finite.
Equations
- instFintypeConcatPat n 0 = { elems := instFintypeConcatPat._aux_1 n, complete := ⋯ }
- instFintypeConcatPat n k.succ = { elems := instFintypeConcatPat._aux_4 n k (instFintypeConcatPat n k), complete := ⋯ }
★ The level-k gadget has n ^ k fault locations: its pattern space has 2 ^ (n ^ k)
elements, each location being faulty or not. This is the overhead of the recursive simulation.
Independent faults at every location of every gadget: the product over the N locations of a
circuit of the level-k gadget noise.
Equations
- circuitMeasure N L ν k = MeasureTheory.Measure.pi fun (x : Fin N) => ↑(concatMeasure L ν k)
Instances For
One location's failure has the level-k gadget's probability: a cylinder in one coordinate of
a product of probability measures.
★★ The circuit-level failure bound. A circuit of N locations, each simulated at level k
by a gadget of L fault locations under independent faults of rate at most p, has some bad gadget
with probability at most N · (c p)^{2^k} / c, c = C(L, 2): the code-capacity recursion at each
location, and the union bound over the locations.
★ How many levels an accuracy needs: any k whose 2^k exceeds
log(c ε / N) / log(c p) brings the circuit bound below ε. Both logarithms are negative below
the threshold, so the ratio is positive and a single logarithm — the level grows like
log log (N / ε).
★★★ The circuit-level threshold theorem, probabilistic form. Below the threshold
p < 1/C(L, 2), for every circuit size N and every accuracy ε there is a concatenation level at
which the probability that any of the circuit's N level-k gadgets is bad is less than ε —
with the gadgets' fault locations, and hence the overhead, counted by card_concatPat.
★★ The level that meets an accuracy has a doubly-logarithmic doubling parameter. Taking
k = ⌈log₂ X⌉ + 1, where X = max 1 (log(cε/N)/log(cp)) is the ratio of
mul_codeCapacityBound_lt_of_log_div_lt, both brings the circuit bound below ε and keeps
2 ^ k ≤ 4 X.
★★★ The overhead of the recursive simulation is polylogarithmic. At the level that meets
the accuracy, a gadget's L ^ k fault locations (card_concatPat) are at most (4 X) ^ (log₂ L),
with X a logarithm of N / ε: a fixed power of a logarithm, which is what “polylogarithmic
overhead” means in the threshold theorem.