October 2026 · Preprint

A matching threshold of 2×10−3 for the rotated surface code under circuit-level noise

Abstract

We consider the rotated surface code, decoded by minimum-weight perfect matching, with its standard eight-step syndrome-extraction circuit, under circuit-level depolarizing noise in which every gate, idle step, preparation and measurement fails independently with probability p. For the two usual log-likelihood weights, computed from the first-order or from the exact edge probabilities, we prove a threshold of at least 2×10−3, and for all log-likelihood weights computed from a probability between q(1−q) and the first-order edge probability q, a threshold of at least 1.6×10−3. For p up to these values, the logical error rate per round of a memory experiment at odd distance d is at most an explicit bound that decays exponentially in d. The proof bounds the weighted paths that a decoding failure leaves in the decoding graph by a local criterion with memory for non-backtracking walks, after excluding short stretches that are incompatible with a minimum-weight correction chosen canonically in the proof; its computations are checked in exact arithmetic, and the results are also proved in the proof assistant Lean 4, with all computations checked by its kernel.

In plain words

Quantum computers make errors constantly. The surface code spreads one reliable qubit over many faulty ones and repairs their errors. For the standard circuit and repair method, this paper proves that the chance of a failed repair shrinks exponentially as the code grows, provided every operation, including idling, fails independently with the same probability of at most 0.2%. The 0.2% figure is more than twice the error rate allowed by the best earlier guarantee. The proof extends to idealized models built from the published error rates of three processors from Quantinuum and IBM.

A 7-by-7 grid of black dots on a pink and green checkerboard of square tiles, with half-disc tiles along the edges. Lines through three magenta dots and three teal dots form a closed loop that passes through two yellow tiles.
Illustration of a distance-7 rotated surface code (49 data qubits, X-type checks pink, Z-type checks green) with a chain of three X errors (magenta) that lights up two Z-type checks (yellow). The teal path is the minimum-weight perfect matching correction computed with PyMatching; together with the errors, it forms a product of two X-type checks, so the logical qubit is left unchanged.

Formal statement and axioms

Each main result as stated in Lean, copied verbatim from the published package, with the axioms that the proof rests on. Lean v4.35.0-rc3, Mathlib c55e6e786f49. The package.

QEC.Circ.thm11_circuit_kernel

Theorems 1.1–1.3: kernel-only

theorem thm11_circuit_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (p : ℝ) (hp0 : 0 < p) (hp : p ≤ 13 / 12500) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circ d T B).model p).Admissible r) :
    PfailExp d T B p r ≤ ((T : ℝ) + 1) * ((d : ℝ) + 1) / 2 * aOf (154 / 15 * p) *
        ((31 * Real.sqrt p) ^ (d - 1) / (1 - 31 * Real.sqrt p)) ∧
      PfailExp d T B p r ≤ 104 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
        ((31 * Real.sqrt p) ^ d / (1 - 31 * Real.sqrt p))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExp (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circ d T B).model p).μ (fun ω => ∃ C, ((circ d T B).model p).IsMinimizer r (physSyn B ω) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B ω = true))
noncomputable def aOf (q : ℝ) : ℝ := 2 * Real.sqrt (q / (1 - q))

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/Checks/Thm11V3.lean:17-23.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound.

QEC.Circ.thm11_circuit_native

Theorems 1.1–1.3: with compiled code

theorem thm11_circuit_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (p : ℝ) (hp0 : 0 < p) (hp : p ≤ 13 / 12500) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circ d T B).model p).Admissible r) :
    PfailExp d T B p r ≤ ((T : ℝ) + 1) * ((d : ℝ) + 1) / 2 * aOf (154 / 15 * p) *
        ((31 * Real.sqrt p) ^ (d - 1) / (1 - 31 * Real.sqrt p)) ∧
      PfailExp d T B p r ≤ 104 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
        ((31 * Real.sqrt p) ^ d / (1 - 31 * Real.sqrt p))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExp (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circ d T B).model p).μ (fun ω => ∃ C, ((circ d T B).model p).IsMinimizer r (physSyn B ω) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B ω = true))
noncomputable def aOf (q : ℝ) : ℝ := 2 * Real.sqrt (q / (1 - q))

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksN/Thm11V2.lean:14-20.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 61 native: `QEC.checkAll_native` (criterion for the 29 + 29 node types) and the 60 representative checks R.

QEC.Circ.thm12_circuit_kernel

Theorems 1.1–1.3: kernel-only

theorem thm12_circuit_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (p : ℝ) (hp0 : 0 < p) (hp : p ≤ 1 / 625) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circ d T B).model p).Admissible r) :
    PfailExp d T B p r ≤ 32 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((997 / 1000 * (625 * p) ^ ((21 : ℝ) / 50)) ^ d / (1 - 997 / 1000 * (625 * p) ^ ((21 : ℝ) / 50)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExp (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circ d T B).model p).μ (fun ω => ∃ C, ((circ d T B).model p).IsMinimizer r (physSyn B ω) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B ω = true))

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm12a.lean:25-29.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:16-16.

'QEC.Circ.thm12_circuit_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]
25 more formal statements

QEC.Circ.thm12_circuit_native

Theorems 1.1–1.3: with compiled code

theorem thm12_circuit_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (p : ℝ) (hp0 : 0 < p) (hp : p ≤ 1 / 625) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circ d T B).model p).Admissible r) :
    PfailExp d T B p r ≤ 32 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((997 / 1000 * (625 * p) ^ ((21 : ℝ) / 50)) ^ d / (1 - 997 / 1000 * (625 * p) ^ ((21 : ℝ) / 50)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExp (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circ d T B).model p).μ (fun ω => ∃ C, ((circ d T B).model p).IsMinimizer r (physSyn B ω) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B ω = true))

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksN8/Thm12V2.lean:15-19.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 131 native: `heads8_k` (40), `cover8_b_d` (28), `wOK8`, `tabCheck_native`, `heads8_size`, R (60).

QEC.Circ.thm12b_circuit_kernel

Theorems 1.1–1.3: kernel-only

theorem thm12b_circuit_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (p : ℝ) (hp0 : 0 < p) (hp : p ≤ 1 / 500) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circ d T B).model p).Admissible r) (hpw : ProfWeights (circ d T B) p r) :
    PfailExp d T B p r ≤ 61 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((999 / 1000 * (500 * p) ^ ((9 : ℝ) / 25)) ^ d / (1 - 999 / 1000 * (500 * p) ^ ((9 : ℝ) / 25)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExp (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circ d T B).model p).μ (fun ω => ∃ C, ((circ d T B).model p).IsMinimizer r (physSyn B ω) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B ω = true))
def ProfWeights (Cc : Circuit V O) (p : ℝ) (r : Sym2 (Vx V) → ℝ) : Prop :=
  ∃ ψ : ℝ → Multiset ℝ → ℝ, ∀ e, r e = ψ p (profOf Cc e)
noncomputable def profOf (Cc : Circuit V O) (e : Sym2 (Vx V)) : Multiset ℝ :=
  (univ.filter (fun ℓ => ∃ o, Cc.edge ℓ o = some e)).val.map
    (fun ℓ => ∑ o, if Cc.edge ℓ o = some e then Cc.π ℓ o else 0)

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm12b.lean:24-28.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:17-17.

'QEC.Circ.thm12b_circuit_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]

QEC.Circ.thm12b_circuit_native

Theorems 1.1–1.3: with compiled code

theorem thm12b_circuit_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (p : ℝ) (hp0 : 0 < p) (hp : p ≤ 1 / 500) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circ d T B).model p).Admissible r) (hpw : ProfWeights (circ d T B) p r) :
    PfailExp d T B p r ≤ 61 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((999 / 1000 * (500 * p) ^ ((9 : ℝ) / 25)) ^ d / (1 - 999 / 1000 * (500 * p) ^ ((9 : ℝ) / 25)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExp (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circ d T B).model p).μ (fun ω => ∃ C, ((circ d T B).model p).IsMinimizer r (physSyn B ω) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B ω = true))
def ProfWeights (Cc : Circuit V O) (p : ℝ) (r : Sym2 (Vx V) → ℝ) : Prop :=
  ∃ ψ : ℝ → Multiset ℝ → ℝ, ∀ e, r e = ψ p (profOf Cc e)
noncomputable def profOf (Cc : Circuit V O) (e : Sym2 (Vx V)) : Multiset ℝ :=
  (univ.filter (fun ℓ => ∃ o, Cc.edge ℓ o = some e)).val.map
    (fun ℓ => ∑ o, if Cc.edge ℓ o = some e then Cc.π ℓ o else 0)

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksNS/Thm12bV2.lean:17-21.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 132 native: `headsS8_k` (40), `cover8_b_d` (28), `wOKS8`, `nmaxOKS8`, `tabCheckP8`, `heads8_size`, R (60).

QEC.Circ.thm13a_lean_kernel

Theorems 1.1–1.3: kernel-only

theorem thm13a_lean_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (p : ℝ) (hp0 : 0 < p) (hp : p ≤ 153 / 100000) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WL d T B).model p).Admissible r) :
    PfailLean d T B p r ≤ 985 / 10000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((2555 / 100 * Real.sqrt p) ^ d / (1 - 2555 / 100 * Real.sqrt p))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailLean (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr (fun ℓ o => p * piLn (d := d) (T := T) ℓ o) (fun ω => ∃ C,
    ((circW WL d T B).model p).IsMinimizer r (physSynLn B ω) C ∧ ¬ (Odd (vdeg C .b1) ↔ physLogLn B ω = true))
def WL : WSpec := ⟨15, fun s lk => if IsLeanLoc s lk then wt15 lk else 0, 15⟩
def IsLeanLoc (s : ℕ) (lk : LocKind) : Prop := (s = 0 ∧ lk = .prep) ∨ (2 ≤ s ∧ s ≤ 5) ∨ s = 7

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm13a.lean:19-23.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:18-18.

'QEC.Circ.thm13a_lean_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]

QEC.Circ.thm13a_lean_native

Theorems 1.1–1.3: with compiled code

theorem thm13a_lean_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (p : ℝ) (hp0 : 0 < p) (hp : p ≤ 153 / 100000) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WL d T B).model p).Admissible r) :
    PfailLean d T B p r ≤ 985 / 10000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((2555 / 100 * Real.sqrt p) ^ d / (1 - 2555 / 100 * Real.sqrt p))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailLean (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr (fun ℓ o => p * piLn (d := d) (T := T) ℓ o) (fun ω => ∃ C,
    ((circW WL d T B).model p).IsMinimizer r (physSynLn B ω) C ∧ ¬ (Odd (vdeg C .b1) ↔ physLogLn B ω = true))
def WL : WSpec := ⟨15, fun s lk => if IsLeanLoc s lk then wt15 lk else 0, 15⟩
def IsLeanLoc (s : ℕ) (lk : LocKind) : Prop := (s = 0 ∧ lk = .prep) ∨ (2 ≤ s ∧ s ≤ 5) ∨ s = 7

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksNW/Thm13aV2.lean:18-22.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 63 native: `critOKL_native`, `tabCheckL`, `nmaxOKL`, R (60).

QEC.Circ.thm13b_lean_kernel

Theorems 1.1–1.3: kernel-only

theorem thm13b_lean_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (p : ℝ) (hp0 : 0 < p) (hp : p ≤ 3 / 1250) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WL d T B).model p).Admissible r) :
    PfailLean d T B p r ≤ 28 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((997 / 1000 * (1250 / 3 * p) ^ ((21 : ℝ) / 50)) ^ d /
        (1 - 997 / 1000 * (1250 / 3 * p) ^ ((21 : ℝ) / 50)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailLean (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr (fun ℓ o => p * piLn (d := d) (T := T) ℓ o) (fun ω => ∃ C,
    ((circW WL d T B).model p).IsMinimizer r (physSynLn B ω) C ∧ ¬ (Odd (vdeg C .b1) ↔ physLogLn B ω = true))
def WL : WSpec := ⟨15, fun s lk => if IsLeanLoc s lk then wt15 lk else 0, 15⟩
def IsLeanLoc (s : ℕ) (lk : LocKind) : Prop := (s = 0 ∧ lk = .prep) ∨ (2 ≤ s ∧ s ≤ 5) ∨ s = 7

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm13b.lean:51-56.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:20-20.

'QEC.Circ.thm13b_lean_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]

QEC.Circ.thm13b_lean_native

Theorems 1.1–1.3: with compiled code

theorem thm13b_lean_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (p : ℝ) (hp0 : 0 < p) (hp : p ≤ 3 / 1250) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WL d T B).model p).Admissible r) :
    PfailLean d T B p r ≤ 28 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((997 / 1000 * (1250 / 3 * p) ^ ((21 : ℝ) / 50)) ^ d /
        (1 - 997 / 1000 * (1250 / 3 * p) ^ ((21 : ℝ) / 50)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailLean (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr (fun ℓ o => p * piLn (d := d) (T := T) ℓ o) (fun ω => ∃ C,
    ((circW WL d T B).model p).IsMinimizer r (physSynLn B ω) C ∧ ¬ (Odd (vdeg C .b1) ↔ physLogLn B ω = true))
def WL : WSpec := ⟨15, fun s lk => if IsLeanLoc s lk then wt15 lk else 0, 15⟩
def IsLeanLoc (s : ℕ) (lk : LocKind) : Prop := (s = 0 ∧ lk = .prep) ∨ (2 ≤ s ∧ s ≤ 5) ∨ s = 7

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksNW/Thm13bV2.lean:30-35.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 132 native: `headsL_k` (40), `coverL_b_d` (28), `wOKL`, `nmaxOKL`, `tabCheckL`, `heads8_size`, R (60).

QEC.Circ.thm13c_lean_kernel

Theorems 1.1–1.3: kernel-only

theorem thm13c_lean_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (p : ℝ) (hp0 : 0 < p) (hp : p ≤ 3 / 1000) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WL d T B).model p).Admissible r) (hpw : ProfWeights (circW WL d T B) p r) :
    PfailLean d T B p r ≤ 52 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((997 / 1000 * (1000 / 3 * p) ^ ((9 : ℝ) / 25)) ^ d /
        (1 - 997 / 1000 * (1000 / 3 * p) ^ ((9 : ℝ) / 25)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailLean (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr (fun ℓ o => p * piLn (d := d) (T := T) ℓ o) (fun ω => ∃ C,
    ((circW WL d T B).model p).IsMinimizer r (physSynLn B ω) C ∧ ¬ (Odd (vdeg C .b1) ↔ physLogLn B ω = true))
def ProfWeights (Cc : Circuit V O) (p : ℝ) (r : Sym2 (Vx V) → ℝ) : Prop :=
  ∃ ψ : ℝ → Multiset ℝ → ℝ, ∀ e, r e = ψ p (profOf Cc e)
noncomputable def profOf (Cc : Circuit V O) (e : Sym2 (Vx V)) : Multiset ℝ :=
  (univ.filter (fun ℓ => ∃ o, Cc.edge ℓ o = some e)).val.map
    (fun ℓ => ∑ o, if Cc.edge ℓ o = some e then Cc.π ℓ o else 0)
def WL : WSpec := ⟨15, fun s lk => if IsLeanLoc s lk then wt15 lk else 0, 15⟩
def IsLeanLoc (s : ℕ) (lk : LocKind) : Prop := (s = 0 ∧ lk = .prep) ∨ (2 ≤ s ∧ s ≤ 5) ∨ s = 7

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm13c.lean:53-58.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:22-22.

'QEC.Circ.thm13c_lean_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]

QEC.Circ.thm13c_lean_native

Theorems 1.1–1.3: with compiled code

theorem thm13c_lean_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (p : ℝ) (hp0 : 0 < p) (hp : p ≤ 3 / 1000) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WL d T B).model p).Admissible r) (hpw : ProfWeights (circW WL d T B) p r) :
    PfailLean d T B p r ≤ 52 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((997 / 1000 * (1000 / 3 * p) ^ ((9 : ℝ) / 25)) ^ d /
        (1 - 997 / 1000 * (1000 / 3 * p) ^ ((9 : ℝ) / 25)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailLean (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr (fun ℓ o => p * piLn (d := d) (T := T) ℓ o) (fun ω => ∃ C,
    ((circW WL d T B).model p).IsMinimizer r (physSynLn B ω) C ∧ ¬ (Odd (vdeg C .b1) ↔ physLogLn B ω = true))
def ProfWeights (Cc : Circuit V O) (p : ℝ) (r : Sym2 (Vx V) → ℝ) : Prop :=
  ∃ ψ : ℝ → Multiset ℝ → ℝ, ∀ e, r e = ψ p (profOf Cc e)
noncomputable def profOf (Cc : Circuit V O) (e : Sym2 (Vx V)) : Multiset ℝ :=
  (univ.filter (fun ℓ => ∃ o, Cc.edge ℓ o = some e)).val.map
    (fun ℓ => ∑ o, if Cc.edge ℓ o = some e then Cc.π ℓ o else 0)
def WL : WSpec := ⟨15, fun s lk => if IsLeanLoc s lk then wt15 lk else 0, 15⟩
def IsLeanLoc (s : ℕ) (lk : LocKind) : Prop := (s = 0 ∧ lk = .prep) ∨ (2 ≤ s ∧ s ≤ 5) ∨ s = 7

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksNS/Thm13cV2.lean:30-35.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 132 native: `headsSL_k` (40), `coverL_b_d` (28), `wOKSL`, `nmaxOKSL`, `tabCheckPL`, `heads8_size`, R (60).

QEC.Circ.thm81a_helios_kernel

Theorem 8.1 for the device error models of Section 8: kernel-only

theorem thm81a_helios_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WHelios d T B).model t).Admissible r) :
    PfailExpW WHelios d T B t r ≤ ((T : ℝ) + 1) * ((d : ℝ) + 1) / 2 * (aOf (143 / 15000) / (373 / 400)) *
      ((373 / 400 * Real.sqrt t) ^ d / (1 - 373 / 400 * Real.sqrt t))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
noncomputable def aOf (q : ℝ) : ℝ := 2 * Real.sqrt (q / (1 - q))
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nHelios : Cat → ℕ
  | .reset => 300
  | .meas => 300
  | .q1 => 27
  | .q2 => 600
  | .idleS => 540
  | .idleR => 540
  | .idleM => 540
def WHelios : WSpec := WOf 600000 nHelios

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm81a.lean:23-27.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:23-23.

'QEC.Circ.thm81a_helios_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]

QEC.Circ.thm81a_h2_kernel

Theorem 8.1 for the device error models of Section 8: kernel-only

theorem thm81a_h2_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WH2 d T B).model t).Admissible r) :
    PfailExpW WH2 d T B t r ≤ ((T : ℝ) + 1) * ((d : ℝ) + 1) / 2 * (aOf (3 / 500) / (8957 / 10000)) *
      ((8957 / 10000 * Real.sqrt t) ^ d / (1 - 8957 / 10000 * Real.sqrt t))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
noncomputable def aOf (q : ℝ) : ℝ := 2 * Real.sqrt (q / (1 - q))
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nH2 : Cat → ℕ
  | .reset => 600
  | .meas => 600
  | .q1 => 27
  | .q2 => 750
  | .idleS => 180
  | .idleR => 180
  | .idleM => 180
def WH2 : WSpec := WOf 600000 nH2

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm81a.lean:33-37.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:24-24.

'QEC.Circ.thm81a_h2_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]

QEC.Circ.thm81a_helios_native

Theorem 8.1 for the device error models of Section 8: with compiled code

theorem thm81a_helios_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WHelios d T B).model t).Admissible r) :
    PfailExpW WHelios d T B t r ≤ ((T : ℝ) + 1) * ((d : ℝ) + 1) / 2 * (aOf (143 / 15000) / (373 / 400)) *
      ((373 / 400 * Real.sqrt t) ^ d / (1 - 373 / 400 * Real.sqrt t))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
noncomputable def aOf (q : ℝ) : ℝ := 2 * Real.sqrt (q / (1 - q))
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nHelios : Cat → ℕ
  | .reset => 300
  | .meas => 300
  | .q1 => 27
  | .q2 => 600
  | .idleS => 540
  | .idleR => 540
  | .idleM => 540
def WHelios : WSpec := WOf 600000 nHelios

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksNW/Thm81aV2.lean:22-26.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 63 native each: `critOKX_native`, `tabCheckX`, `nmaxOKX`, R (60); X = Hl, H2.

QEC.Circ.thm81a_h2_native

Theorem 8.1 for the device error models of Section 8: with compiled code

theorem thm81a_h2_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WH2 d T B).model t).Admissible r) :
    PfailExpW WH2 d T B t r ≤ ((T : ℝ) + 1) * ((d : ℝ) + 1) / 2 * (aOf (3 / 500) / (8957 / 10000)) *
      ((8957 / 10000 * Real.sqrt t) ^ d / (1 - 8957 / 10000 * Real.sqrt t))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
noncomputable def aOf (q : ℝ) : ℝ := 2 * Real.sqrt (q / (1 - q))
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nH2 : Cat → ℕ
  | .reset => 600
  | .meas => 600
  | .q1 => 27
  | .q2 => 750
  | .idleS => 180
  | .idleR => 180
  | .idleM => 180
def WH2 : WSpec := WOf 600000 nH2

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksNW/Thm81aV2.lean:31-35.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 63 native each: `critOKX_native`, `tabCheckX`, `nmaxOKX`, R (60); X = Hl, H2.

QEC.Circ.thm81b_heron_kernel

Theorem 8.1 for the device error models of Section 8: kernel-only

theorem thm81b_heron_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WHeron d T B).model t).Admissible r) :
    PfailExpW WHeron d T B t r ≤ 23 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((97 / 100 * t ^ ((43 : ℝ) / 100)) ^ d / (1 - 97 / 100 * t ^ ((43 : ℝ) / 100)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nHeron : Cat → ℕ
  | .reset => 12000
  | .meas => 20880
  | .q1 => 1656
  | .q2 => 11625
  | .idleS => 600
  | .idleR => 6000
  | .idleM => 12000
def WHeron : WSpec := WOf 6000000 nHeron

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm81b.lean:29-33.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:25-25.

'QEC.Circ.thm81b_heron_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]

QEC.Circ.thm81b_helios_kernel

Theorem 8.1 for the device error models of Section 8: kernel-only

theorem thm81b_helios_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WHelios d T B).model t).Admissible r) :
    PfailExpW WHelios d T B t r ≤ 33 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((3 / 4 * t ^ ((43 : ℝ) / 100)) ^ d / (1 - 3 / 4 * t ^ ((43 : ℝ) / 100)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nHelios : Cat → ℕ
  | .reset => 300
  | .meas => 300
  | .q1 => 27
  | .q2 => 600
  | .idleS => 540
  | .idleR => 540
  | .idleM => 540
def WHelios : WSpec := WOf 600000 nHelios

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm81b.lean:54-58.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:26-26.

'QEC.Circ.thm81b_helios_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]

QEC.Circ.thm81b_h2_kernel

Theorem 8.1 for the device error models of Section 8: kernel-only

theorem thm81b_h2_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WH2 d T B).model t).Admissible r) :
    PfailExpW WH2 d T B t r ≤ 22 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((143 / 200 * t ^ ((43 : ℝ) / 100)) ^ d / (1 - 143 / 200 * t ^ ((43 : ℝ) / 100)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nH2 : Cat → ℕ
  | .reset => 600
  | .meas => 600
  | .q1 => 27
  | .q2 => 750
  | .idleS => 180
  | .idleR => 180
  | .idleM => 180
def WH2 : WSpec := WOf 600000 nH2

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm81b.lean:79-83.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:27-27.

'QEC.Circ.thm81b_h2_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]

QEC.Circ.thm81b_heron_native

Theorem 8.1 for the device error models of Section 8: with compiled code

theorem thm81b_heron_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WHeron d T B).model t).Admissible r) :
    PfailExpW WHeron d T B t r ≤ 23 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((97 / 100 * t ^ ((43 : ℝ) / 100)) ^ d / (1 - 97 / 100 * t ^ ((43 : ℝ) / 100)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nHeron : Cat → ℕ
  | .reset => 12000
  | .meas => 20880
  | .q1 => 1656
  | .q2 => 11625
  | .idleS => 600
  | .idleR => 6000
  | .idleM => 12000
def WHeron : WSpec := WOf 6000000 nHeron

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksNW/Thm81bV2.lean:19-23.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 132 native each: `headsX_k` (40), `coverX_b_d` (28), `wOKX`, `nmaxOKX`, `tabCheckX`, `heads8_size`, R (60); X = He, Hl, H2.

QEC.Circ.thm81b_helios_native

Theorem 8.1 for the device error models of Section 8: with compiled code

theorem thm81b_helios_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WHelios d T B).model t).Admissible r) :
    PfailExpW WHelios d T B t r ≤ 33 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((3 / 4 * t ^ ((43 : ℝ) / 100)) ^ d / (1 - 3 / 4 * t ^ ((43 : ℝ) / 100)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nHelios : Cat → ℕ
  | .reset => 300
  | .meas => 300
  | .q1 => 27
  | .q2 => 600
  | .idleS => 540
  | .idleR => 540
  | .idleM => 540
def WHelios : WSpec := WOf 600000 nHelios

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksNW/Thm81bV2.lean:27-31.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 132 native each: `headsX_k` (40), `coverX_b_d` (28), `wOKX`, `nmaxOKX`, `tabCheckX`, `heads8_size`, R (60); X = He, Hl, H2.

QEC.Circ.thm81b_h2_native

Theorem 8.1 for the device error models of Section 8: with compiled code

theorem thm81b_h2_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WH2 d T B).model t).Admissible r) :
    PfailExpW WH2 d T B t r ≤ 22 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((143 / 200 * t ^ ((43 : ℝ) / 100)) ^ d / (1 - 143 / 200 * t ^ ((43 : ℝ) / 100)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nH2 : Cat → ℕ
  | .reset => 600
  | .meas => 600
  | .q1 => 27
  | .q2 => 750
  | .idleS => 180
  | .idleR => 180
  | .idleM => 180
def WH2 : WSpec := WOf 600000 nH2

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksNW/Thm81bV2.lean:35-39.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 132 native each: `headsX_k` (40), `coverX_b_d` (28), `wOKX`, `nmaxOKX`, `tabCheckX`, `heads8_size`, R (60); X = He, Hl, H2.

QEC.Circ.thm81c_heron_kernel

Theorem 8.1 for the device error models of Section 8: kernel-only

theorem thm81c_heron_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WHeron d T B).model t).Admissible r) (hpw : ProfWeights (circW WHeron d T B) t r) :
    PfailExpW WHeron d T B t r ≤ 39 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((873 / 1000 * t ^ ((19 : ℝ) / 50)) ^ d / (1 - 873 / 1000 * t ^ ((19 : ℝ) / 50)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
def ProfWeights (Cc : Circuit V O) (p : ℝ) (r : Sym2 (Vx V) → ℝ) : Prop :=
  ∃ ψ : ℝ → Multiset ℝ → ℝ, ∀ e, r e = ψ p (profOf Cc e)
noncomputable def profOf (Cc : Circuit V O) (e : Sym2 (Vx V)) : Multiset ℝ :=
  (univ.filter (fun ℓ => ∃ o, Cc.edge ℓ o = some e)).val.map
    (fun ℓ => ∑ o, if Cc.edge ℓ o = some e then Cc.π ℓ o else 0)
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nHeron : Cat → ℕ
  | .reset => 12000
  | .meas => 20880
  | .q1 => 1656
  | .q2 => 11625
  | .idleS => 600
  | .idleR => 6000
  | .idleM => 12000
def WHeron : WSpec := WOf 6000000 nHeron

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm81c.lean:30-34.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:28-28.

'QEC.Circ.thm81c_heron_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]

QEC.Circ.thm81c_helios_kernel

Theorem 8.1 for the device error models of Section 8: kernel-only

theorem thm81c_helios_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WHelios d T B).model t).Admissible r) (hpw : ProfWeights (circW WHelios d T B) t r) :
    PfailExpW WHelios d T B t r ≤ 58 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((27 / 40 * t ^ ((19 : ℝ) / 50)) ^ d / (1 - 27 / 40 * t ^ ((19 : ℝ) / 50)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
def ProfWeights (Cc : Circuit V O) (p : ℝ) (r : Sym2 (Vx V) → ℝ) : Prop :=
  ∃ ψ : ℝ → Multiset ℝ → ℝ, ∀ e, r e = ψ p (profOf Cc e)
noncomputable def profOf (Cc : Circuit V O) (e : Sym2 (Vx V)) : Multiset ℝ :=
  (univ.filter (fun ℓ => ∃ o, Cc.edge ℓ o = some e)).val.map
    (fun ℓ => ∑ o, if Cc.edge ℓ o = some e then Cc.π ℓ o else 0)
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nHelios : Cat → ℕ
  | .reset => 300
  | .meas => 300
  | .q1 => 27
  | .q2 => 600
  | .idleS => 540
  | .idleR => 540
  | .idleM => 540
def WHelios : WSpec := WOf 600000 nHelios

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm81c.lean:55-59.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:29-29.

'QEC.Circ.thm81c_helios_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]

QEC.Circ.thm81c_h2_kernel

Theorem 8.1 for the device error models of Section 8: kernel-only

theorem thm81c_h2_kernel (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WH2 d T B).model t).Admissible r) (hpw : ProfWeights (circW WH2 d T B) t r) :
    PfailExpW WH2 d T B t r ≤ 39 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((643 / 1000 * t ^ ((19 : ℝ) / 50)) ^ d / (1 - 643 / 1000 * t ^ ((19 : ℝ) / 50)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
def ProfWeights (Cc : Circuit V O) (p : ℝ) (r : Sym2 (Vx V) → ℝ) : Prop :=
  ∃ ψ : ℝ → Multiset ℝ → ℝ, ∀ e, r e = ψ p (profOf Cc e)
noncomputable def profOf (Cc : Circuit V O) (e : Sym2 (Vx V)) : Multiset ℝ :=
  (univ.filter (fun ℓ => ∃ o, Cc.edge ℓ o = some e)).val.map
    (fun ℓ => ∑ o, if Cc.edge ℓ o = some e then Cc.π ℓ o else 0)
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nH2 : Cat → ℕ
  | .reset => 600
  | .meas => 600
  | .q1 => 27
  | .q2 => 750
  | .idleS => 180
  | .idleR => 180
  | .idleM => 180
def WH2 : WSpec := WOf 600000 nH2

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QECKernel/Fin/Thm81c.lean:80-84.

Axioms, as Lean reports them. Recorded in zenodo:23749989/qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4_build/StmtV3.txt:30-30.

'QEC.Circ.thm81c_h2_kernel' depends on axioms: [propext, Classical.choice, Quot.sound]

QEC.Circ.thm81c_heron_native

Theorem 8.1 for the device error models of Section 8: with compiled code

theorem thm81c_heron_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WHeron d T B).model t).Admissible r) (hpw : ProfWeights (circW WHeron d T B) t r) :
    PfailExpW WHeron d T B t r ≤ 39 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((873 / 1000 * t ^ ((19 : ℝ) / 50)) ^ d / (1 - 873 / 1000 * t ^ ((19 : ℝ) / 50)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
def ProfWeights (Cc : Circuit V O) (p : ℝ) (r : Sym2 (Vx V) → ℝ) : Prop :=
  ∃ ψ : ℝ → Multiset ℝ → ℝ, ∀ e, r e = ψ p (profOf Cc e)
noncomputable def profOf (Cc : Circuit V O) (e : Sym2 (Vx V)) : Multiset ℝ :=
  (univ.filter (fun ℓ => ∃ o, Cc.edge ℓ o = some e)).val.map
    (fun ℓ => ∑ o, if Cc.edge ℓ o = some e then Cc.π ℓ o else 0)
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nHeron : Cat → ℕ
  | .reset => 12000
  | .meas => 20880
  | .q1 => 1656
  | .q2 => 11625
  | .idleS => 600
  | .idleR => 6000
  | .idleM => 12000
def WHeron : WSpec := WOf 6000000 nHeron

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksNS/Thm81cV2.lean:20-24.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 132 native each: `headsSX_k` (40), `coverX_b_d` (28), `wOKSX`, `nmaxOKSX`, `tabCheckPX`, `heads8_size`, R (60); X = He, Hl, H2.

QEC.Circ.thm81c_helios_native

Theorem 8.1 for the device error models of Section 8: with compiled code

theorem thm81c_helios_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WHelios d T B).model t).Admissible r) (hpw : ProfWeights (circW WHelios d T B) t r) :
    PfailExpW WHelios d T B t r ≤ 58 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((27 / 40 * t ^ ((19 : ℝ) / 50)) ^ d / (1 - 27 / 40 * t ^ ((19 : ℝ) / 50)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
def ProfWeights (Cc : Circuit V O) (p : ℝ) (r : Sym2 (Vx V) → ℝ) : Prop :=
  ∃ ψ : ℝ → Multiset ℝ → ℝ, ∀ e, r e = ψ p (profOf Cc e)
noncomputable def profOf (Cc : Circuit V O) (e : Sym2 (Vx V)) : Multiset ℝ :=
  (univ.filter (fun ℓ => ∃ o, Cc.edge ℓ o = some e)).val.map
    (fun ℓ => ∑ o, if Cc.edge ℓ o = some e then Cc.π ℓ o else 0)
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nHelios : Cat → ℕ
  | .reset => 300
  | .meas => 300
  | .q1 => 27
  | .q2 => 600
  | .idleS => 540
  | .idleR => 540
  | .idleM => 540
def WHelios : WSpec := WOf 600000 nHelios

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksNS/Thm81cV2.lean:29-33.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 132 native each: `headsSX_k` (40), `coverX_b_d` (28), `wOKSX`, `nmaxOKSX`, `tabCheckPX`, `heads8_size`, R (60); X = He, Hl, H2.

QEC.Circ.thm81c_h2_native

Theorem 8.1 for the device error models of Section 8: with compiled code

theorem thm81c_h2_native (B : Basis) (d T : ℕ) (hd3 : 3 ≤ d) (hd : d % 2 = 1) (hT : 1 ≤ T)
    (t : ℝ) (ht0 : 0 < t) (ht1 : t ≤ 1) (r : Sym2 (Vx (Det d T B)) → ℝ)
    (hr : ((circW WH2 d T B).model t).Admissible r) (hpw : ProfWeights (circW WH2 d T B) t r) :
    PfailExpW WH2 d T B t r ≤ 39 / 1000 * ((T : ℝ) + 1) * ((d : ℝ) + 1) *
      ((643 / 1000 * t ^ ((19 : ℝ) / 50)) ^ d / (1 - 643 / 1000 * t ^ ((19 : ℝ) / 50)))
Definitions used in the statement
def Admissible (r : Sym2 (Vx V) → ℝ) : Prop := ∀ e ∈ M.Eg, M.q e * (1 - M.q e) ≤ r e ∧ r e ≤ M.q e
def IsMinimizer (r : Sym2 (Vx V) → ℝ) (A : Finset V) (C : Finset (Sym2 (Vx V))) : Prop :=
  C ⊆ M.Eg ∧ bd C = A ∧ ∀ C' ⊆ M.Eg, bd C' = A → wsum r C ≤ wsum r C'
noncomputable def PfailExpW (d T : ℕ) (B : Basis) (p : ℝ) (r : Sym2 (Vx (Det d T B)) → ℝ) : ℝ :=
  Pr ((circW W d T B).model p).μ (fun ω => ∃ C, ((circW W d T B).model p).IsMinimizer r (physSyn B (extW W ω)) C ∧
    ¬ (Odd (vdeg C .b1) ↔ physLog B (extW W ω) = true))
def ProfWeights (Cc : Circuit V O) (p : ℝ) (r : Sym2 (Vx V) → ℝ) : Prop :=
  ∃ ψ : ℝ → Multiset ℝ → ℝ, ∀ e, r e = ψ p (profOf Cc e)
noncomputable def profOf (Cc : Circuit V O) (e : Sym2 (Vx V)) : Multiset ℝ :=
  (univ.filter (fun ℓ => ∃ o, Cc.edge ℓ o = some e)).val.map
    (fun ℓ => ∑ o, if Cc.edge ℓ o = some e then Cc.π ℓ o else 0)
def WOf (S : ℕ) (n : Cat → ℕ) : WSpec := ⟨S, fun s lk => n (catOf s lk) / lk.nOut, n .meas⟩
def catOf (s : ℕ) : LocKind → Cat
  | .prep => .reset
  | .meas => .meas
  | .had => .q1
  | .cx => .q2
  | .idle => if s = 0 then .idleR else if s = 7 then .idleM else .idleS
inductive Cat where
  | reset
  | meas
  | q1
  | q2
  | idleS
  | idleR
  | idleM
  deriving DecidableEq, Repr
def nH2 : Cat → ℕ
  | .reset => 600
  | .meas => 600
  | .q1 => 27
  | .q2 => 750
  | .idleS => 180
  | .idleR => 180
  | .idleM => 180
def WH2 : WSpec := WOf 600000 nH2

Source: Zenodo record 23749989, qec-threshold-supplement-v4.zip/qec-threshold-supplement-v4/lean4/QEC/ChecksNS/Thm81cV2.lean:38-42.

The package does not record Lean’s axiom report for this theorem, but names the axioms in words: propext, Classical.choice, Quot.sound and 1 more, for example 132 native each: `headsSX_k` (40), `coverX_b_d` (28), `wOKSX`, `nmaxOKSX`, `tabCheckPX`, `heads8_size`, R (60); X = He, Hl, H2.