ComparatorChallenges/ExactQuantumFactoring.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: OpenAI's pinned repository says an unreleased internal model produced the manuscripts and supporting proof artifacts. The collection builds on the mathematics community's accumulated problems, results, language, and formal libraries; each manuscript's BibTeX and bibliography are the authority for individual scholarly credit.
Project sources: Pinned openai/math documentation, Pinned formalization catalogue
28 declarations, 1 contain sorry, 0 declared as axioms
- inductive
OAI.ExactQuantumFactoring.PrimitiveThe five primitive gates exactly as in Section 2 line 12Source documentation
The five primitive gates exactly as in Section 2.
L4DEL explanation
The five primitive gates exactly as in Section 2.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Computability/QuantumFactoring/Basic.lean:12 (same declaration text).
inductive Primitive where …
- def
OAI.ExactQuantumFactoring.Primitive.arityline 16Also declared: OAI/Computability/QuantumFactoring/Basic.lean:16 (same declaration text).
- def
OAI.ExactQuantumFactoring.Primitive.codeline 21Also declared: OAI/Computability/QuantumFactoring/Basic.lean:21 (same declaration text).
- structure
OAI.ExactQuantumFactoring.GateAn inverse and/or one added control line 26Source documentation
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.
L4DEL explanation
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.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Computability/QuantumFactoring/Basic.lean:26 (same declaration text).
structure Gate where …
- def
OAI.ExactQuantumFactoring.Gate.arityline 32Also declared: OAI/Computability/QuantumFactoring/Basic.lean:32 (same declaration text).
- def
OAI.ExactQuantumFactoring.Primitive.matrixMatrix entries are indexed by lists in wire order (row first, column second) line 36Source documentation
Matrix entries are indexed by lists in wire order (row first, column second). Entries on ill-sized lists are irrelevant and set to zero.
L4DEL explanation
Matrix entries are indexed by lists in wire order (row first, column second). Entries on ill-sized lists are irrelevant and set to zero.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Computability/QuantumFactoring/Basic.lean:36 (same declaration text).
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 | _, _, _ => 0Mentions: OAI.ExactQuantumFactoring.Primitive
- def
OAI.ExactQuantumFactoring.Gate.baseMatrixline 46Also declared: OAI/Computability/QuantumFactoring/Basic.lean:46 (same declaration text).
- def
OAI.ExactQuantumFactoring.Gate.matrixline 49Also declared: OAI/Computability/QuantumFactoring/Basic.lean:49 (same declaration text).
- structure
OAI.ExactQuantumFactoring.InstructionA primitive is placed on distinct actual wires, with no operation of unbounded arity hidden in a circuit instruction line 59Source documentation
A primitive is placed on distinct actual wires, with no operation of unbounded arity hidden in a circuit instruction.
L4DEL explanation
A primitive is placed on distinct actual wires, with no operation of unbounded arity hidden in a circuit instruction.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Computability/QuantumFactoring/Basic.lean:59 (same declaration text).
structure Instruction (q : ℕ) where …
- abbrev
OAI.ExactQuantumFactoring.Basisline 64Also declared: OAI/Computability/QuantumFactoring/Basic.lean:64 (same declaration text).
- abbrev
OAI.ExactQuantumFactoring.Stateline 65Also declared: OAI/Computability/QuantumFactoring/Basic.lean:65 (same declaration text).
- def
OAI.ExactQuantumFactoring.Instruction.matrixline 67Also declared: OAI/Computability/QuantumFactoring/Basic.lean:67 (same declaration text).
- structure
OAI.ExactQuantumFactoring.Circuitline 75Also declared: OAI/Computability/QuantumFactoring/Basic.lean:75 (same declaration text).
- def
OAI.ExactQuantumFactoring.Circuit.applyline 79Also declared: OAI/Computability/QuantumFactoring/Basic.lean:79 (same declaration text).
- def
OAI.ExactQuantumFactoring.inputBasisInput wires are first, least significant bit first; all other wires start zero line 83Source documentation
Input wires are first, least significant bit first; all other wires start zero.
L4DEL explanation
Input wires are first, least significant bit first; all other wires start zero.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Computability/QuantumFactoring/Basic.lean:83 (same declaration text).
def inputBasis (q ℓ N : ℕ) : Basis q := …
Mentions: OAI.ExactQuantumFactoring.Basis
- def
OAI.ExactQuantumFactoring.Circuit.outputStateline 86Also declared: OAI/Computability/QuantumFactoring/Basic.lean:86 (same declaration text).
- def
OAI.ExactQuantumFactoring.paddedLengthThe cutoff and padding are the standing parameters in Section 2 line 91Source documentation
The cutoff and padding are the standing parameters in Section 2.
L4DEL explanation
The cutoff and padding are the standing parameters in Section 2.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Computability/QuantumFactoring/Basic.lean:91 (same declaration text).
def paddedLength (ℓ : ℕ) : ℕ := max 128 ℓ
- def
OAI.ExactQuantumFactoring.readBitline 93Also declared: OAI/Computability/QuantumFactoring/Basic.lean:93 (same declaration text).
- def
OAI.ExactQuantumFactoring.outputListn entries of n bits each, in the n² wires immediately after the input line 97Source documentation
n entries of n bits each, in the n² wires immediately after the input.
L4DEL explanation
n entries of n bits each, in the n² wires immediately after the input.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Computability/QuantumFactoring/Basic.lean:97 (same declaration text).
def outputList {q : ℕ} (ℓ : ℕ) (x : Basis q) : List ℕ := …Mentions: OAI.ExactQuantumFactoring.Basis
- def
OAI.ExactQuantumFactoring.CorrectEncodingComplete nondecreasing prime factorization, multiplicities included, padded by zeros, as in Section 6 line 104Source documentation
Complete nondecreasing prime factorization, multiplicities included, padded by zeros, as in Section 6. There is no primality oracle in the circuit.
L4DEL explanation
Complete nondecreasing prime factorization, multiplicities included, padded by zeros, as in Section 6. There is no primality oracle in the circuit.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Computability/QuantumFactoring/Basic.lean:104 (same declaration text).
def CorrectEncoding (N n : ℕ) (xs : List ℕ) : Prop := …
- def
OAI.ExactQuantumFactoring.Circuit.correctProbabilityUnnormalized Born sum on correct outputs; success is exactly one, not positivity, postselection, or a limiting high probability line 110Source documentation
Unnormalized Born sum on correct outputs; success is exactly one, not positivity, postselection, or a limiting high probability.
L4DEL explanation
Unnormalized Born sum on correct outputs; success is exactly one, not positivity, postselection, or a limiting high probability.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Computability/QuantumFactoring/Basic.lean:110 (same declaration text).
noncomputable def Circuit.correctProbability (c : Circuit) (ℓ N : ℕ) : ℝ := by …
Mentions: OAI.ExactQuantumFactoring.Circuit
- def
OAI.ExactQuantumFactoring.natWordUnary natural words with delimiters make the circuit description explicit line 118Source documentation
Unary natural words with delimiters make the circuit description explicit. Unary wire addresses cause at most polynomial overhead when width is polynomial.
L4DEL explanation
Unary natural words with delimiters make the circuit description explicit. Unary wire addresses cause at most polynomial overhead when width is polynomial.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Computability/QuantumFactoring/Basic.lean:118 (same declaration text).
def natWord (k : ℕ) : List Bool := List.replicate k true ++ [false]
- def
OAI.ExactQuantumFactoring.Instruction.encodeline 120Also declared: OAI/Computability/QuantumFactoring/Basic.lean:120 (same declaration text).
- def
OAI.ExactQuantumFactoring.Circuit.encodeline 124Also declared: OAI/Computability/QuantumFactoring/Basic.lean:124 (same declaration text).
- def
OAI.ExactQuantumFactoring.UniformA single finite-alphabet classical generator receives only the INPUT LENGTH line 131Source documentation
A single finite-alphabet classical generator receives only the INPUT LENGTH. All stack alphabets, states and labels are finite: no large-integer unit-cost oracle is hidden in TM2 push/branch functions.
L4DEL explanation
A single finite-alphabet classical generator receives only the INPUT LENGTH. All stack alphabets, states and labels are finite: no large-integer unit-cost oracle is hidden in TM2 push/branch functions.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Computability/QuantumFactoring/Basic.lean:131 (same declaration text).
def Uniform (family : ℕ → Circuit) : Prop := …
Mentions: OAI.ExactQuantumFactoring.Circuit
- def
OAI.ExactQuantumFactoring.PolynomialResourcesline 136Also declared: OAI/Computability/QuantumFactoring/Basic.lean:136 (same declaration text).
- def
OAI.ExactQuantumFactoring.MainTheoremLiteral main endpoint: one length-uniform family, exact output for EVERY binary integer N≥2, and worst-case polynomial gates AND qubits line 143Source documentation
Literal main endpoint: one length-uniform family, exact output for EVERY binary integer N≥2, and worst-case polynomial gates AND qubits.
L4DEL explanation
Literal main endpoint: one length-uniform family, exact output for EVERY binary integer N≥2, and worst-case polynomial gates AND qubits.
- This explanation is a condensed rendering of the declaration's own doc comment at the pinned source commit; consult the exact Lean statement below for authority.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Also declared: OAI/Computability/QuantumFactoring/Basic.lean:143 (same declaration text).
def MainTheorem : Prop := …
- theorem
OAI.ExactQuantumFactoring.exact_quantum_factoringChallenge statement: Exact quantum factoring over a fixed finite gate set sorry line 149L4DEL explanation
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.
- This is an exact comparator target linked by the pinned repository's formalization note for this result.
- The repository's comparator configuration selects OAI.Computability.QuantumFactoring.Main as the released solution module checked against this declaration.
Sources and attribution: Pinned Lean source (fd4aeeb2ee4f)
Distinct definitions of this name: OAI/Computability/QuantumFactoring/Main.lean:17 (same statement text; different proof or body). Qualify references as OAI.ExactQuantumFactoring.exact_quantum_factoring@path.
theorem exact_quantum_factoring : MainTheorem := by …
Mentions: OAI.ExactQuantumFactoring.MainTheorem