ComparatorChallenges/ExactQuantumFactoring.lean

GitHub source file

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

  1. inductive OAI.ExactQuantumFactoring.Primitive The five primitive gates exactly as in Section 2 line 12

    Source documentation

    The five primitive gates exactly as in Section 2.

    L4DEL explanation

    The five primitive gates exactly as in Section 2.

    1. 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
    …
  2. def OAI.ExactQuantumFactoring.Primitive.arity line 16

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:16 (same declaration text).

  3. def OAI.ExactQuantumFactoring.Primitive.code line 21

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:21 (same declaration text).

  4. structure OAI.ExactQuantumFactoring.Gate An inverse and/or one added control line 26

    Source 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.

    1. 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
    …
  5. def OAI.ExactQuantumFactoring.Gate.arity line 32

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:32 (same declaration text).

  6. def OAI.ExactQuantumFactoring.Primitive.matrix Matrix entries are indexed by lists in wire order (row first, column second) line 36

    Source 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.

    1. 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
      | _, _, _ => 0

    Mentions: OAI.ExactQuantumFactoring.Primitive

  7. def OAI.ExactQuantumFactoring.Gate.baseMatrix line 46

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:46 (same declaration text).

  8. def OAI.ExactQuantumFactoring.Gate.matrix line 49

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:49 (same declaration text).

  9. structure OAI.ExactQuantumFactoring.Instruction A primitive is placed on distinct actual wires, with no operation of unbounded arity hidden in a circuit instruction line 59

    Source 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.

    1. 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
    …
  10. abbrev OAI.ExactQuantumFactoring.Basis line 64

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:64 (same declaration text).

  11. abbrev OAI.ExactQuantumFactoring.State line 65

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:65 (same declaration text).

  12. def OAI.ExactQuantumFactoring.Instruction.matrix line 67

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:67 (same declaration text).

  13. structure OAI.ExactQuantumFactoring.Circuit line 75

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:75 (same declaration text).

  14. def OAI.ExactQuantumFactoring.Circuit.apply line 79

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:79 (same declaration text).

  15. def OAI.ExactQuantumFactoring.inputBasis Input wires are first, least significant bit first; all other wires start zero line 83

    Source 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.

    1. 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

  16. def OAI.ExactQuantumFactoring.Circuit.outputState line 86

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:86 (same declaration text).

  17. def OAI.ExactQuantumFactoring.paddedLength The cutoff and padding are the standing parameters in Section 2 line 91

    Source 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.

    1. 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 ℓ
  18. def OAI.ExactQuantumFactoring.readBit line 93

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:93 (same declaration text).

  19. def OAI.ExactQuantumFactoring.outputList n entries of n bits each, in the n² wires immediately after the input line 97

    Source 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.

    1. 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

  20. def OAI.ExactQuantumFactoring.CorrectEncoding Complete nondecreasing prime factorization, multiplicities included, padded by zeros, as in Section 6 line 104

    Source 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.

    1. 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 :=
    …
  21. def OAI.ExactQuantumFactoring.Circuit.correctProbability Unnormalized Born sum on correct outputs; success is exactly one, not positivity, postselection, or a limiting high probability line 110

    Source 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.

    1. 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

  22. def OAI.ExactQuantumFactoring.natWord Unary natural words with delimiters make the circuit description explicit line 118

    Source 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.

    1. 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]
  23. def OAI.ExactQuantumFactoring.Instruction.encode line 120

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:120 (same declaration text).

  24. def OAI.ExactQuantumFactoring.Circuit.encode line 124

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:124 (same declaration text).

  25. def OAI.ExactQuantumFactoring.Uniform A single finite-alphabet classical generator receives only the INPUT LENGTH line 131

    Source 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.

    1. 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

  26. def OAI.ExactQuantumFactoring.PolynomialResources line 136

    Also declared: OAI/Computability/QuantumFactoring/Basic.lean:136 (same declaration text).

  27. def OAI.ExactQuantumFactoring.MainTheorem Literal main endpoint: one length-uniform family, exact output for EVERY binary integer N≥2, and worst-case polynomial gates AND qubits line 143

    Source 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.

    1. 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 :=
    …
  28. theorem OAI.ExactQuantumFactoring.exact_quantum_factoring Challenge statement: Exact quantum factoring over a fixed finite gate set sorry line 149

    L4DEL 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.

    1. This is an exact comparator target linked by the pinned repository's formalization note for this result.
    2. 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