Lean's kernel processes thousands of floating‑point verification tasks in milliseconds, as demonstrated by the FloatLib benchmarks.
*FloatLib's new release tackles thousands of floating‑point benchmarks inside the Lean proof assistant. The library’s interval tactic resolves most LLM2Cert obligations in under an hour, while native kernel arithmetic runs in sub‑millisecond bursts.*
The Lean proof assistant has long been praised for logical rigor, but its numeric speed has remained a question mark. Robert Joseph George’s latest FloatLib release puts that doubt to rest, delivering verified floating‑point computation at unprecedented rates. By running eleven external benchmarks—including LLM2Cert inequality proofs and the full SMT‑LIB Wintersteiger suite—inside Lean, the team shows that kernel‑level arithmetic can be both fast and trustworthy. The results reshape expectations for formal verification in domains that depend on heavy numeric workloads.
FloatLib now supports IEEE binary and decimal formats, arbitrary precision, posits and smaller ML formats. Its three core tactics—float_decide, interval and roundoff—operate entirely inside Lean's kernel. On a sample of 1,400 instances, the median time for a raw numerical decision was 0.48 ms, kernel proof checking 4.11 ms, and the full batched pipeline 62.3 ms. By contrast, Z3 required 23 ms per instance. The data shows that Lean can compute and certify floating‑point results faster than a dedicated SMT solver for many small cases, overturning the assumption that theorem provers are inherently slow for numeric work.
LLM2Cert generates Lyapunov functions with a language model, then asks Lean to verify the associated inequalities. Replacing the original proofs with a single "by interval" call resolved 281 of 291 obligations in 43.8 minutes of cumulative Lean time. The published LLM2Cert run needed 13.6 hours on the same successful obligations and consumed roughly 1.94 million model tokens. Raising interval limits pushed success to 282 obligations. The three remaining failures involve radial unboundedness, a scenario outside the current interval tactic’s scope. The contrast highlights that a deterministic numeric tactic can eclipse costly model‑token usage for inequality verification.
SMT‑LIB’s Wintersteiger family supplies 39,994 conformance tests for binary64 operations. Each test asks whether a specific floating‑point operation yields a prescribed result. Translating the suite into Lean statements and running float_decide produced a perfect 39,994/39,994 pass rate with zero disagreements. The benchmark demonstrates that FloatLib’s executable arithmetic matches the reference implementation across arithmetic, FMA, sqrt, remainder, comparisons and rounding modes. Moreover, the kernel’s decision time remained under half a millisecond per test, confirming that high‑volume floating‑point verification can be performed inside a proof assistant without external libraries.
Beyond standard binary formats, FloatLib can handle 4,096‑bit floats directly in the kernel. Benchmarks show that even with such extreme precision, the cost remains modest; the kernel’s arithmetic decision time stays in the sub‑millisecond range. This counters the expectation that arbitrary‑precision arithmetic would cripple Lean’s performance. The result opens the door for verified numerical analysis, PDE solving and cryptographic protocol verification that demand extreme precision, all while retaining the safety guarantees of a formal proof environment.
The interval tactic resolved 281 of 291 obligations in the default run and 282 of 291 when limits were raised.
The median time for actual numerical decision inside Lean's kernel was 0.48 ms.
Yes, float_decide proved all 39,994 Wintersteiger tests with zero disagreements.
The benchmarks prove that Lean is no longer a theoretical sandbox for numeric proofs; it is a practical engine for high‑throughput verification. With interval tactics eclipsing language‑model token costs and 4,096‑bit arithmetic running cheaply, developers can now trust Lean for both correctness and performance. The next wave of verified software—whether in control theory, cryptography or AI safety—will likely lean on this newfound speed.
Sources: [Hacker News article "So, how fast is numerical computation in Lean?" by Robert Joseph George, TorchLean Verified Examples]