← Mon, Nov 30 digest

So, how fast is numerical computation in Lean?

read article ↗ hn thread ↗

An extensive benchmark of FloatLib evaluates floating-point arithmetic and interval analysis performance in Lean 4 against SMT solvers and Coq.

read it Offers rigorous benchmarks and performance data for floating-point arithmetic and interval analysis inside Lean 4.

summary

The author benchmarks FloatLib, a library for certified floating-point arithmetic and numerical computation in Lean 4, across eleven external benchmark suites. Results show high success rates on fixed arithmetic and interval bounds, such as proving thousands of SMT-LIB conformance tests and LLM2Cert obligations. However, nonlinear real arithmetic benchmarks reveal scaling bottlenecks in search heuristics compared to established SMT solvers. The post also explores counterexample verification for neural networks and high-precision arithmetic inside the proof kernel.

key points

  1. FloatLib successfully proved all 39,994 SMT-LIB Wintersteiger floating-point conformance tests using the float_decide tactic.
  2. High-precision 4,096-bit floating-point addition inside Lean's kernel takes only 64 milliseconds, showing minimal overhead compared to 32-bit operations.
  3. Nonlinear real arithmetic benchmarks highlight performance bottlenecks, solving only 56 of 66 box-bounded instances due to inefficient subdivision search heuristics.

who should read it

Theorem prover developers, formal verification researchers, and engineers interested in numerical computing and Lean 4.

discussion positive

best comment by tkz1312 ↗

It doesn't. The kernel is pretty much just a typechecker for a dependently typed lambda calculus with inductive types. You can see the core datatype here: https://github.com/leanprover/lean4/blob/master/src/Lean/Exp....

Clarifies that Lean's kernel does not natively implement floating-point operations, correcting a common architectural misconception.

Generated by an LLM from the article and thread. Check the sources before relying on it.