Prove how fast a factoring algorithm is, in Lean, Cost model v1 (Lean v4.36.0, Mathlib v4.36.0)

Lean factoring cost submission #1

lit-mathlib-minfac · submitted · verified 2 d ago · Accepted source license

e = a/D, exponent of N0.5
k = b/D, exponent of len N2
Constant C96

Verifier report

C
96
a
1
b
4
D
2
bound
cost <= 96 * N^(1/2) * (len N)^(2)
axioms
["Classical.choice", "Quot.sound", "propext"]
declarations
4916
export sha256
26d7759345b5e2bd2f5a7b503f40f43155ee1973e25294eff8672ea260066bca
program nodes
30
program sha256
2ed9833cb3b1bff06e6dfc9b9692e8b4af1d5a277a51b90020739e06d76dce53
program
(seq (const 7 2) (seq (const 5 1) (seq (const 6 0) (seq (mod 4 0 7) (ite (eq 4 6) (copy 1 7) (seq (const 1 3) (seq (const 2 1) (seq (loop (eq 2 5) (seq (mul 3 1 1) (ite (lt 0 3) (const 2 0) (seq (mod 4 0 1) (ite (eq 4 6) (const 2 0) (add 1 1 7)))))) (seq (mul 3 1 1) (ite (lt 0 3) (copy 1 0) skip))))))))))
program truncated
False
stages
{"warm": {"rc": 0, "seconds": 33.02}, "U": {"rc": 0, "seconds": 141.68}, "K1": {"rc": 0, "seconds": 3.87}, "K2": {"rc": 0, "seconds": 1.17}, "S1": {"rc": 0, "seconds": 8.19}, "S2": {"rc": 0, "seconds": 2.22}}
verify seconds
191.3
verified on
NCAR Derecho (project UCUB0188), PBS job 8297125.desched1
View raw report
{
 "C": 96,
 "a": 1,
 "b": 4,
 "D": 2,
 "bound": "cost <= 96 * N^(1/2) * (len N)^(2)",
 "axioms": [
  "Classical.choice",
  "Quot.sound",
  "propext"
 ],
 "declarations": 4916,
 "export_sha256": "26d7759345b5e2bd2f5a7b503f40f43155ee1973e25294eff8672ea260066bca",
 "program_nodes": 30,
 "program_sha256": "2ed9833cb3b1bff06e6dfc9b9692e8b4af1d5a277a51b90020739e06d76dce53",
 "program": "(seq (const 7 2) (seq (const 5 1) (seq (const 6 0) (seq (mod 4 0 7) (ite (eq 4 6) (copy 1 7) (seq (const 1 3) (seq (const 2 1) (seq (loop (eq 2 5) (seq (mul 3 1 1) (ite (lt 0 3) (const 2 0) (seq (mod 4 0 1) (ite (eq 4 6) (const 2 0) (add 1 1 7)))))) (seq (mul 3 1 1) (ite (lt 0 3) (copy 1 0) skip))))))))))",
 "program_truncated": false,
 "stages": {
  "warm": {
   "rc": 0,
   "seconds": 33.02
  },
  "U": {
   "rc": 0,
   "seconds": 141.68
  },
  "K1": {
   "rc": 0,
   "seconds": 3.87
  },
  "K2": {
   "rc": 0,
   "seconds": 1.17
  },
  "S1": {
   "rc": 0,
   "seconds": 8.19
  },
  "S2": {
   "rc": 0,
   "seconds": 2.22
  }
 },
 "verify_seconds": 191.3,
 "verified_on": {
  "backend": "ncar-derecho",
  "project": "UCUB0188",
  "pbs_job": "8297125.desched1",
  "session": "c5e5fc51027db439"
 }
}

Submission file

Download submission JSON under the license of its source (license file)

sha256 e05f35e14b35a2bb85db2208f618b85c27b8fe392ff98342ef323fb528d4b616 · 18,470 bytes · verifier 3f54d115fa5dcd05

License

License: Published method run by QArena (Mathlib's Nat.minFac (trial division by 2 and the odd numbers up to the square root), ported to QArena's cost model with a cost proof): the file is QArena's run of the method, whose code is Apache-2.0 (Copyright 2015 Microsoft Corporation). The port's program, its equivalence proof and its cost proof are QArena's text; correctness is Mathlib's own theorems, used by name (https://github.com/leanprover-community/mathlib4/blob/fc4f59e577feb1a4956671bc04ac18aaaf8cd842/Mathlib/Data/Nat/Prime/Defs.lean, Mathlib v4.36.0 (commit fc4f59e577feb1a4956671bc04ac18aaaf8cd842) on Lean v4.36.0); see Published methods. source

QArena's own rows (its runs, published methods and imported results) keep the license of their source; the per-file choice is for participants. The download carries the license in its headers and in the license file beside it.

Builds on

This submission names no earlier submission.

Cited by

No other submission names this submission yet.

How citations count