Skip to content

Build2 publishers2 min readPublished

Lean's guarantee ends at 8,000 lines of C++ and its dependencies

The Clay Mathematics Institute has the claimed Navier-Stokes solution under review, and a summer of agent-found bugs in Lean's kernel shows how narrow the guarantee a Lean certificate actually gives.

The Engineer · Build desk

Illustration accompanying Lean's guarantee ends at 8,000 lines of C++ and its dependencies

What happened

  • The Clay Mathematics Institute said the Navier-Stokes problem has apparently been settled, and that it hopes the innovations behind the work will now be analyzed and interrogated.
  • The Lean Focused Research Organization, working with OpenAI, ran a systematic AI-assisted search of the Lean kernel that uncovered six new soundness bugs and changed several of the organization's security practices.
  • Patrick Hulin's GPT-5.6 Sol found a Lean kernel soundness issue after three and a half hours of work on a single bug-finding prompt.
  • Mathematician Tristan Buckmaster accuses OpenAI of redirecting resources to the problem after rumors of his research leaked, of using his drafts in training data, and of rejecting his co-author from authorship.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

  • cost An agent-written formalization costs a reviewer two audits: the mathematics, and the C++ path through the kernel that accepted the term.
  • exposure Anyone building on a fresh agent-produced formalization carries the retraction risk the LessWrong author prices at 75 percent over the next year.
  • contradiction The Clay Mathematics Institute frames faster machine-assisted mathematics as grounds for anticipation, while the LessWrong letter argues the agent-swarm case is exactly where a Lean certificate deserves less weight.
  • decision The million-dollar prize decision stays with the institute's reviewers on their own timetable, so the Lean check enters that process as evidence and does not close it.

A Lean proof is a term, and checking it means the kernel decides whether that term has the type the theorem claims. The deciding code is src/kernel, about 8,000 lines of C++ implementing Lean's type theory, and it is not self-contained: it calls out to external libraries, among them GMP for fast arithmetic on large integers [16]. The kernel is correct only if those dependencies are, down to GMP's implementation of the Fast Fourier Transform [17].

An agent optimizing for a term that Lean accepts is searching that acceptance test, not the mathematics behind it. Patrick Hulin pointed an agent at the test directly: "i'd like to audit the lean kernel. see if you can find an assumption-free proof of false. your primary task should be reading the source code and docs and building an understanding of how the kernel works to find the seams. treat this like a cybersecurity task." [12] The bug it came back with, pull request #14498, exploited a type-checking oversight [13].

Add the six bugs from the Lean Focused Research Organization's search to Hulin's and to Ramana Kumar's, and at least eight soundness bugs surfaced in one summer [24]. Two of the six came from faulty interactions with external dependencies, one in three [25]. Leo de Moura, Lean's creator, said: "[False statements being accepted by Lean] is going to keep happening. AIs are really good at exploiting soundness bugs in the kernels" [4].

Kumar released and circulated his result as a proof of the Collatz conjecture, and he knew at the time of posting that it was a soundness bug [14]. Lean's design favors runtime efficiency at the cost of greater logical complexity, which the post says makes Lean, and Lean4 in particular, more bug-prone than other formal verifiers [8].

None of that says the Navier-Stokes proof is wrong. The author of the LessWrong letter writes that the proof is likely correct, does not trust it on the strength of Lean alone, and says peer review is not yet complete [3]. OpenAI announced the result early this week, according to that post [1]. The Clay Mathematics Institute has the solution under review and wrote that "The process is deliberately unhurried, but we will provide updates" [20].

For "verified in Lean" to carry what a referee report carries, someone has to have checked the kernel path that a particular proof exercised. Mario Carneiro's Lean4Lean, a formalization of Lean's foundations inside Lean, is the project aimed at that, and the post says the most bug-prone parts of those foundations have yet to be incorporated into it [9].

What to watch

  • Whether the Lean4 C++ codebase takes another soundness patch inside 12 months, which the post prices at 95 percent.
  • Whether the Clay Mathematics Institute's review cites the Lean formalization as evidence, and what date it reports on.
  • Whether the most bug-prone parts of Lean's foundations get incorporated into Lean4Lean, giving reviewers an independent recheck.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories