Plectis Atlas
Search

↑ and ↓ move, Enter opens, Esc closes.

Lean statement

Exact quantum factoring over a fixed finite gate set

Lean is a language for mathematical statements and proofs that a computer can verify. This page shows one statement file from OpenAI’s release, possible paper matches and independent reports. The code-like names below identify the definitions or theorems selected by the proof-verification settings.

Theorem selected for verification: OAI.ExactQuantumFactoring.exact_quantum_factoring

Lean statement file: ExactQuantumFactoring.leanShow on the mapOpenAI’s Lean catalogue does not list this as a main result; the release’s Lean notes for family 279 link it.

The Lean statement

The lines of the Lean statement that state the theorem, then the definitions in the file that it uses.

def MainTheorem : Prop :=  ∃ family : ℕ → Circuit, Uniform family ∧ PolynomialResources family ∧    ∀ (ℓ N : ℕ), 2 ≤ N → N.size = ℓ →      ℓ + (paddedLength ℓ)^2 ≤ (family ℓ).qubits ∧      (family ℓ).correctProbability ℓ N = 1theorem exact_quantum_factoring : MainTheorem := by  sorry

A Lean statement states the theorem and leaves its proof as sorry on purpose. OpenAI’s proof is in a separate solution module, and a program called Comparator checks that proof against this statement.

Definitions needed to read it

Local definitions the statement names, followed through the definitions they name in turn. The match is by name in the source text, so a name reached only through notation can be missed; the full file is below.

  • inductive type OAI.ExactQuantumFactoring.Primitive line 12

    inductive Primitive where  | not | cnot | toffoli | hadamard | phase  deriving DecidableEq
  • definition OAI.ExactQuantumFactoring.Primitive.arity line 16

    def Primitive.arity : Primitive → ℕ  | .not | .hadamard | .phase => 1  | .cnot => 2  | .toffoli => 3
  • definition OAI.ExactQuantumFactoring.Primitive.code line 21

    def Primitive.code : Primitive → ℕ  | .not => 0 | .cnot => 1 | .toffoli => 2 | .hadamard => 3 | .phase => 4
  • structure OAI.ExactQuantumFactoring.Gate line 26

    structure Gate where  primitive : Primitive  inverse : Bool  controlled : Bool  deriving DecidableEq
  • definition OAI.ExactQuantumFactoring.Primitive.matrix line 36

    noncomputable def Primitive.matrix : Primitive → List Bool → List Bool → ℂ  | .not, [a], [b] => if a = !b then 1 else 0  | .cnot, [a,b], [c,d] => if a = c ∧ b = Bool.xor c d then 1 else 0  | .toffoli, [a,b,c], [d,e,f] =>      if a = d ∧ b = e ∧ c = Bool.xor f (d && e) then 1 else 0  | .hadamard, [a], [b] =>      (if a && b then -1 else 1) / (Real.sqrt 2 : ℂ)  | .phase, [a], [b] => if a = b then (if b then Complex.I else 1) else 0  | _, _, _ => 0
  • structure OAI.ExactQuantumFactoring.Instruction line 59

    structure Instruction (q : ℕ) where  gate : Gate  wire : Fin gate.arity → Fin q  distinct : Function.Injective wire
  • abbreviation OAI.ExactQuantumFactoring.Basis line 64

    abbrev Basis (q : ℕ) := Fin q → Bool
  • abbreviation OAI.ExactQuantumFactoring.State line 65

    abbrev State (q : ℕ) := Basis q → ℂ
  • structure OAI.ExactQuantumFactoring.Circuit line 75

    structure Circuit where  qubits : ℕ  instructions : List (Instruction qubits)
  • definition OAI.ExactQuantumFactoring.Circuit.apply line 79

    noncomputable def Circuit.apply (c : Circuit) (ψ : State c.qubits) : State c.qubits :=  c.instructions.foldl (fun v o => o.matrix.mulVec v) ψ
  • definition OAI.ExactQuantumFactoring.inputBasis line 83

    def inputBasis (q ℓ N : ℕ) : Basis q :=  fun i => if i.val < ℓ then N.testBit i.val else false
  • definition OAI.ExactQuantumFactoring.Circuit.outputState line 86

    noncomputable def Circuit.outputState (c : Circuit) (ℓ N : ℕ) : State c.qubits := by  classical  exact c.apply (fun x => if x = inputBasis c.qubits ℓ N then 1 else 0)
  • definition OAI.ExactQuantumFactoring.paddedLength line 91

    def paddedLength (ℓ : ℕ) : ℕ := max 128 ℓ
  • definition OAI.ExactQuantumFactoring.readBit line 93

    def readBit {q : ℕ} (x : Basis q) (i : ℕ) : Bool :=  if h : i < q then x ⟨i,h⟩ else false
  • definition OAI.ExactQuantumFactoring.outputList line 97

    def outputList {q : ℕ} (ℓ : ℕ) (x : Basis q) : List ℕ :=  let n := paddedLength ℓ  List.ofFn (fun a : Fin n =>    ∑ j ∈ Finset.range n, if readBit x (ℓ + a.val * n + j) then 2^j else 0)
  • definition OAI.ExactQuantumFactoring.CorrectEncoding line 104

    def CorrectEncoding (N n : ℕ) (xs : List ℕ) : Prop :=  ∃ ps : List ℕ, (∀ p ∈ ps, Nat.Prime p) ∧ ps.Pairwise (· ≤ ·) ∧    ps.prod = N ∧ ps.length ≤ n ∧ xs = ps ++ List.replicate (n - ps.length) 0
  • definition OAI.ExactQuantumFactoring.Circuit.correctProbability line 110

    noncomputable def Circuit.correctProbability (c : Circuit) (ℓ N : ℕ) : ℝ := by  classical  exact ∑ x : Basis c.qubits,    if CorrectEncoding N (paddedLength ℓ) (outputList ℓ x) then      Complex.normSq (c.outputState ℓ N x) else 0
  • definition OAI.ExactQuantumFactoring.natWord line 118

    def natWord (k : ℕ) : List Bool := List.replicate k true ++ [false]
  • definition OAI.ExactQuantumFactoring.Instruction.encode line 120

    def Instruction.encode {q : ℕ} (o : Instruction q) : List Bool :=  natWord o.gate.primitive.code ++ [o.gate.inverse, o.gate.controlled] ++    (List.ofFn (fun i => o.wire i |>.val)).flatMap natWord
  • definition OAI.ExactQuantumFactoring.Uniform line 131

    def Uniform (family : ℕ → Circuit) : Prop :=  ∃ generator : Turing.TM2ComputableInPolyTime      (fun ℓ => List.replicate ℓ true) Circuit.encode family,    ∀ k, Finite (generator.tm.Γ k)
  • definition OAI.ExactQuantumFactoring.PolynomialResources line 136

    def PolynomialResources (family : ℕ → Circuit) : Prop :=  ∃ bound : Polynomial ℕ, ∀ ℓ,    (family ℓ).qubits ≤ bound.eval ℓ ∧    (family ℓ).instructions.length ≤ bound.eval ℓ

Paper theorem cited in the Lean source

A source comment for OAI.ExactQuantumFactoring.exact_quantum_factoring names this theorem’s label in the paper’s TeX source. Read the source comment from line 14

/-- Source Theorem 1.1 (`thm:main`): exact factoring over the fixed gate set,
with a single finite-alphabet polynomial-time length-uniform generator and
polynomial worst-case gate and qubit counts. -/

Theorem 1.1 of Exact quantum factoring over a fixed finite gate set

Theorem

There is a polynomial-time uniform family of polynomial-size quantum circuits that outputs the complete prime factorization of every input integer N\ge2 with probability one. The number of gates and qubits is bounded by a fixed polynomial in the bit length of N. One fixed finite gate set suffices: NOT, CNOT, Toffoli, Hadamard, \operatorname{diag}(1,i), their inverses, and their singly controlled versions.

Section 1, Introduction Read it in the paper TeX source, line 10
Show the TeX
There is a polynomial-time uniform family of polynomial-size quantum circuits that outputs the complete prime factorization of every input integer $N\ge2$ with probability one. The number of gates and qubits is bounded by a fixed polynomial in the bit length of $N$. One fixed finite gate set suffices: NOT, CNOT, Toffoli, Hadamard, $\operatorname{diag}(1,i)$, their inverses, and their singly controlled versions.

Other possible paper matches, closest wording first

  • Proposition 3.1 of Exact quantum factoring over a fixed finite gate set. Words of the Lean statement, its names split into words, that also appear in the theorem: unit, cost, finite, order, quantum, case and seven more.
  • Proposition 5.2 of Exact quantum factoring over a fixed finite gate set. Words of the Lean statement, its names split into words, that also appear in the theorem: branch, correct, success, prime, exactly, case and eight more.
  • Proposition 4.1 of Exact quantum factoring over a fixed finite gate set. Words of the Lean statement, its names split into words, that also appear in the theorem: encoding, padded, resource, included, compute, causing and 13 more.

Reported Comparator runs

two independent groups report that Comparator accepted runs for this Lean statement file: Carlos Toledo’s cert-machine; MathVet. Each group reports its own Comparator run for this statement file. Atlas has not repeated the runs.

For a configured theorem, Comparator tests whether OpenAI’s proof proves the exact Lean statement. Some files instead configure definitions for comparison by name and type. Acceptance does not establish that the statement means the same thing as the paper’s theorem.

Carlos Toledo’s cert-machine

How they ran it, in their words

Every Comparator challenge re-run on Linux with nanoda switched on, decided by a preregistered rule; every family’s challenge statements read against OpenAI’s headline, clause by clause. Decider: Comparator (leanprover/comparator d03acab1 = tag v4.34.0, built with the release’s toolchain v4.34.1), lean4export 076e8e57, landrun 811cfff5, nanoda_lib 3a240721 — on GitHub’s Linux runners (.github/workflows/openai-math-kernel.yml), one j…

  • Accepted Their term: “CERTIFIED”.

    Re-run through Comparator with the independent nanoda kernel switched on: Lean’s kernel and nanoda both accept OpenAI’s solution.

    Reported 10 October 2026, at the release version shown here. Original verification report

MathVet

How they ran it, in their words

An independent, model-assisted, pre-referee reading of each family’s challenge statements against its headline claim under a published rubric (PROTOCOL.md), with its own Comparator runs per challenge. Its protocol describes a planned error-rate study; this import does not establish that the study has been completed.

  • Accepted Their term: “comparator-sandboxed-pass”.

    Re-run through Comparator in a sandboxed virtual machine: accepted.

    Reported 8 October 2026, at the release version shown here. Original verification report

What an accepted Comparator run would establish

If Comparator is run under this configuration and accepts, the solution proves the configured theorem using only the allowed axioms, and the Lean kernel accepts every step.

This configuration lists no definition holes, so every definition the statement uses is compared as it is written in this file.

Allowed axioms: propext, Quot.sound, Classical.choice

Acceptance leaves open whether the Lean statement means the same thing as the paper’s theorem, whether the paper’s other claims are correct, and whether the result is new. Those questions require comparing the definitions and statements, reviewing the paper’s arguments, and reading the earlier literature.

Do family 279’s Lean statements express the advertised result?

These assessments compare all the family’s Lean statements with the whole result OpenAI describes in its catalogue. They do not assess this statement alone. Each group uses its own published rules.

MathVet and cert-machine agree on how much of the advertised result the Lean statements express.

  • MathVet

    Finds the whole advertised result stated or implied Their term: “full”.

    The challenge statements imply the headline claim after unpacking definitions or one routine step. Their record

    Their note: exact_quantum_factoring : MainTheorem := ∃ family : ℕ → Circuit, Uniform family ∧ PolynomialResources family ∧ ∀ ℓ N, 2 ≤ N → N.size = ℓ → ℓ + (paddedLength ℓ)^2 ≤ (family ℓ).qubits ∧ (family ℓ).correctProbability ℓ N = 1 over a fixed 20-gate set (NOT/CNOT/Toffoli/Hadamard/phase with optional inverse and one control), where correctProbability is the exact Born probability of outputting the sorted prime factorization with multiplicities (CorrectEncoding) and Uniform uses a Mathlib TM2ComputableInPolyTime generator with finite alphabets. Matches the summary (exact, polynomial gates and qubits, fixed finite gate set).

    Definitions the group asks readers to compare with the paper: Hand-built circuit model: Gate := (primitive, inverse, controlled), Primitive.matrix entries on List Bool, Instruction.matrix, Circuit.apply := foldl over instructions; the polynomial-time notion is Mathlib's TM2ComputableInPolyTime applied to unary input replicate ℓ true with Finite (Γ k), which is standard; the quantum gate semantics are written by hand.

  • Carlos Toledo’s cert-machine

    Finds the whole advertised result stated or implied Their term: “MATCHES”.

    The challenge statements state the headline as OpenAI wrote it. Their record

Read the complete assessments on the family page.

OpenAI’s own note on what this Lean statement covers

“The formalization constructs a polynomial-time uniform quantum circuit family that outputs the complete prime factorization of every integer $N\ge2$ with probability exactly one. The circuits use one fixed finite set of bounded-arity gates, and both the gate count and number of qubits have polynomial worst-case bounds in the bit length of $N$. The probability-one conclusion is exact, rather than an asymptotic or bounded-error guarantee.”

An AI agent drafted an interpretation of that note, classifying this statement as “states a paper’s theorem as the paper does”. No human review of the draft is recorded.

Supporting material

The complete Lean statement file

154 lines, copied from release version fd4aeeb. A name defined in this file links to its line; pointing at the name shows its definition.

Declared in this fileOpenAI’s library at fd4aeebOther linked names open the current documentation for Mathlib, Lean’s mathematical library.

Links in the file: 44 to its own declarations, 59 to Mathlib’s documentation. 28 declared names also link to the same declaration in OpenAI’s library. OpenAI uses Mathlib version d13f23b. The linked documentation describes the current version, so names that have since changed may be missing there.

import Mathlibnamespace OAInamespace ExactQuantumFactoringopen scoped BigOperators/-- The five primitive gates exactly as in Section 2. -/inductive Primitive where  | not | cnot | toffoli | hadamard | phase  deriving DecidableEqdef Primitive.arity : Primitive → ℕ  | .not | .hadamard | .phase => 1  | .cnot => 2  | .toffoli => 3def Primitive.code : Primitive → ℕ  | .not => 0 | .cnot => 1 | .toffoli => 2 | .hadamard => 3 | .phase => 4/-- An inverse and/or one added control. This is a fixed set of 20 gate names,not an unbounded-control or arbitrary-angle gate model. -/structure Gate where  primitive : Primitive  inverse : Bool  controlled : Bool  deriving DecidableEqdef Gate.arity (g : Gate) : ℕ := g.primitive.arity + if g.controlled then 1 else 0/-- Matrix entries are indexed by lists in wire order (row first, column second).Entries on ill-sized lists are irrelevant and set to zero. -/noncomputable def Primitive.matrix : Primitive → List Bool → List Bool → ℂ  | .not, [a], [b] => if a = !b then 1 else 0  | .cnot, [a,b], [c,d] => if a = c ∧ b = Bool.xor c d then 1 else 0  | .toffoli, [a,b,c], [d,e,f] =>      if a = d ∧ b = e ∧ c = Bool.xor f (d && e) then 1 else 0  | .hadamard, [a], [b] =>      (if a && b then -1 else 1) / (Real.sqrt 2 : ℂ)  | .phase, [a], [b] => if a = b then (if b then Complex.I else 1) else 0  | _, _, _ => 0noncomputable def Gate.baseMatrix (g : Gate) (a b : List Bool) : ℂ :=  if g.inverse then star (g.primitive.matrix b a) else g.primitive.matrix a bnoncomputable def Gate.matrix (g : Gate) (a b : List Bool) : ℂ :=  if g.controlled then    match a, b with    | false :: a', false :: b' => if a' = b' then 1 else 0    | true :: a', true :: b' => g.baseMatrix a' b'    | _, _ => 0  else g.baseMatrix a b/-- A primitive is placed on distinct actual wires, with no operation ofunbounded arity hidden in a circuit instruction. -/structure Instruction (q : ℕ) where  gate : Gate  wire : Fin gate.arity → Fin q  distinct : Function.Injective wireabbrev Basis (q : ℕ) := Fin q → Boolabbrev State (q : ℕ) := Basis q → ℂnoncomputable def Instruction.matrix {q : ℕ} (o : Instruction q) :    Matrix (Basis q) (Basis q) ℂ := by  classical  exact fun a b =>    if ∀ i : Fin q, (∀ j, o.wire j ≠ i) → a i = b i then      o.gate.matrix (List.ofFn (a ∘ o.wire)) (List.ofFn (b ∘ o.wire))    else 0structure Circuit where  qubits : ℕ  instructions : List (Instruction qubits)noncomputable def Circuit.apply (c : Circuit) (ψ : State c.qubits) : State c.qubits :=  c.instructions.foldl (fun v o => o.matrix.mulVec v) ψ/-- Input wires are first, least significant bit first; all other wires start zero. -/def inputBasis (q ℓ N : ℕ) : Basis q :=  fun i => if i.val < ℓ then N.testBit i.val else falsenoncomputable def Circuit.outputState (c : Circuit) (ℓ N : ℕ) : State c.qubits := by  classical  exact c.apply (fun x => if x = inputBasis c.qubits ℓ N then 1 else 0)/-- The cutoff and padding are the standing parameters in Section 2. -/def paddedLength (ℓ : ℕ) : ℕ := max 128 ℓdef readBit {q : ℕ} (x : Basis q) (i : ℕ) : Bool :=  if h : i < q then x ⟨i,h⟩ else false/-- n entries of n bits each, in the n² wires immediately after the input. -/def outputList {q : ℕ} (ℓ : ℕ) (x : Basis q) : List ℕ :=  let n := paddedLength ℓ  List.ofFn (fun a : Fin n =>    ∑ j ∈ Finset.range n, if readBit x (ℓ + a.val * n + j) then 2^j else 0)/-- Complete nondecreasing prime factorization, multiplicities included,padded by zeros, as in Section 6. There is no primality oracle in the circuit. -/def CorrectEncoding (N n : ℕ) (xs : List ℕ) : Prop :=  ∃ ps : List ℕ, (∀ p ∈ ps, Nat.Prime p) ∧ ps.Pairwise (· ≤ ·) ∧    ps.prod = N ∧ ps.length ≤ n ∧ xs = ps ++ List.replicate (n - ps.length) 0/-- Unnormalized Born sum on correct outputs; success is exactly one,not positivity, postselection, or a limiting high probability. -/noncomputable def Circuit.correctProbability (c : Circuit) (ℓ N : ℕ) : ℝ := by  classical  exact ∑ x : Basis c.qubits,    if CorrectEncoding N (paddedLength ℓ) (outputList ℓ x) then      Complex.normSq (c.outputState ℓ N x) else 0/-- Unary natural words with delimiters make the circuit description explicit.Unary wire addresses cause at most polynomial overhead when width is polynomial. -/def natWord (k : ℕ) : List Bool := List.replicate k true ++ [false]def Instruction.encode {q : ℕ} (o : Instruction q) : List Bool :=  natWord o.gate.primitive.code ++ [o.gate.inverse, o.gate.controlled] ++    (List.ofFn (fun i => o.wire i |>.val)).flatMap natWorddef Circuit.encode (c : Circuit) : List Bool :=  natWord c.qubits ++ natWord c.instructions.length ++    c.instructions.flatMap Instruction.encode/-- A single finite-alphabet classical generator receives only the INPUT LENGTH.All stack alphabets, states and labels are finite: no large-integer unit-costoracle is hidden in TM2 push/branch functions. -/def Uniform (family : ℕ → Circuit) : Prop :=  ∃ generator : Turing.TM2ComputableInPolyTime      (fun ℓ => List.replicate ℓ true) Circuit.encode family,    ∀ k, Finite (generator.tm.Γ k)def PolynomialResources (family : ℕ → Circuit) : Prop :=  ∃ bound : Polynomial ℕ, ∀ ℓ,    (family ℓ).qubits ≤ bound.eval ℓ ∧    (family ℓ).instructions.length ≤ bound.eval ℓ/-- Literal main endpoint: one length-uniform family, exact output for EVERYbinary integer N≥2, and worst-case polynomial gates AND qubits. -/def MainTheorem : Prop :=  ∃ family : ℕ → Circuit, Uniform family ∧ PolynomialResources family ∧    ∀ (ℓ N : ℕ), 2 ≤ N → N.size = ℓ →      ℓ + (paddedLength ℓ)^2 ≤ (family ℓ).qubits ∧      (family ℓ).correctProbability ℓ N = 1theorem exact_quantum_factoring : MainTheorem := by  sorryend ExactQuantumFactoringend OAI
Every extracted statement of the accompanying papers

The statements the atlas extracted automatically from each accompanying paper’s TeX source, with links to the full sources.

Exact quantum factoring over a fixed finite gate set

Theorem

There is a polynomial-time uniform family of polynomial-size quantum circuits that outputs the complete prime factorization of every input integer N\ge2 with probability one. The number of gates and qubits is bounded by a fixed polynomial in the bit length of N. One fixed finite gate set suffices: NOT, CNOT, Toffoli, Hadamard, \operatorname{diag}(1,i), their inverses, and their singly controlled versions.

Section 1, Introduction Read it in the paper TeX source, line 10
Show the TeX
There is a polynomial-time uniform family of polynomial-size quantum circuits that outputs the complete prime factorization of every input integer $N\ge2$ with probability one. The number of gates and qubits is bounded by a fixed polynomial in the bit length of $N$. One fixed finite gate set suffices: NOT, CNOT, Toffoli, Hadamard, $\operatorname{diag}(1,i)$, their inverses, and their singly controlled versions.
Configuration and file facts
OpenAI’s Lean catalogue
OpenAI’s Lean catalogue does not list this as a main result; the release’s Lean notes for family 279 link it.
Solution module
OAI.Computability.QuantumFactoring.Main
Allowed axioms
propext, Quot.sound, Classical.choiceThe axioms this configuration allows a proof to use. A replay shows which of them a proof uses.
Imports
Mathlib
Imports from outside Mathlib
None
Local vocabulary
27 local vocabulary declarations
Lines of Lean, without comments or blank lines
93
Second proof-verification program (nanoda)
Off in OpenAI's configuration.

Statement comparison

A shareable summary of this page: the proposed paper match, what the Lean statement expresses, and which reviews are recorded.

Plectis Atlas

Exact quantum factoring over a fixed finite gate set

Family 279: Exact quantum factoring over a fixed finite gate set

Cited in the Lean source

Theorem

There is a polynomial-time uniform family of polynomial-size quantum circuits that outputs the complete prime factorization of every input integer N\ge2 with probability one. The number of gates and qubits is bounded by a fixed polynomial in the bit length of N. One fixed finite gate set suffices: NOT, CNOT, Toffoli, Hadamard, \operatorname{diag}(1,i), their inverses, and their singly controlled versions.

Exact quantum factoring over a fixed finite gate set

TeX label thm:main, build/sections/01-introduction.tex, line 10

The Lean statement says

def MainTheorem : Prop :=  ∃ family : ℕ → Circuit, Uniform family ∧ PolynomialResources family ∧    ∀ (ℓ N : ℕ), 2 ≤ N → N.size = ℓ →      ℓ + (paddedLength ℓ)^2 ≤ (family ℓ).qubits ∧      (family ℓ).correctProbability ℓ N = 1theorem exact_quantum_factoring : MainTheorem := by  sorry

A Lean statement states the theorem and leaves its proof as sorry on purpose. OpenAI’s proof is in a separate solution module, and a program called Comparator checks that proof against this statement.

The Lean source cites this theorem by its label. Atlas records no review of whether the two statements mean the same thing.two independent groups report that Comparator accepted runs for this file at the release version shown here.Statement review: none recorded

27 local vocabulary declarationsAllowed axioms: propext, Quot.sound, Classical.choiceopenai/math at fd4aeebwcook04.github.io/plectis-atlas/statements/ExactQuantumFactoring.html

Recorded comparisons with the paper

Atlas records no contributed comparison of this statement with the paper.

Contributed Comparator run reports

Atlas records no contributed report of running Comparator for this statement file.

Compare this statement with the paperShare a Comparator run reportSuggest a change