🧮 Daniel J. Bernstein: computer-checked proofs can be false too

In brief
- 📋 Cryptographer Daniel J. Bernstein collects reports of soundness bugs in seven major proof checkers, from HOL Light to Lean and Coq.
- 🔢 The list runs from 3 reports for HOL Light through 23 for Lean to 111 for Coq/Rocq.
- ⚠️ Such bugs can let a false statement pass as proven; many were shown to be exploitable.
- 🛠️ His remedies: small checking kernels, several independent checkers and proofs that the checker itself is correct.
🧮 Programs such as Lean, Isabelle and Coq are treated as mathematics' final authority: they check every step of a proof. The cryptographer Daniel J. Bernstein counters that proofs checked this way can still be false. Under the title "False computer-checked proofs" his website collects what he describes as reports of soundness bugs, flaws that could let a checking program accept a false statement. In many cases, he writes, these bugs were demonstrated to be exploitable. 📋 The list covers seven systems and 197 reports in all: 3 for HOL Light, 7 for Mizar, 9 for Metamath, 20 for Isabelle, 23 for Lean, 24 for HOL4 and 111 for Coq, now called Rocq. Bernstein says he has probably missed some reports, and that user-interface flaws, which can mislead users just as badly, are not included. 🔐 The question is timely because mathematics now leans heavily on such checkers: the Claude-assisted proof of the Riemann hypothesis exists only as Lean code, with no paper for humans to read. 🛠️ Bernstein does not argue against machine checking but for more care in it. He recommends keeping the trusted core as small as possible, running proofs through several independent checkers and, above all, proving that the checker itself works correctly.
What a soundness bug is. ⚙️ A proof assistant has, roughly, two parts: a large tool that produces proof steps and a kernel that re-checks every step. Only the kernel has to be trusted. If it has a gap, a proof of "False" can get through, and from such a proof any statement at all follows. Thomas Hales, the mathematician behind the formal proof of the Kepler conjecture, called this the most disastrous kind of bug a proof assistant can have in an October guest post on Terence Tao's blog.
How the list is built. 📋 Bernstein sorts the systems by the number of reports and links each report together with a copy in the Internet Archive. The counts cover default usage: for Lean the independent checker nanoda and the native_decide shortcut are excluded, for Coq the separate checker coqchk, for HOL Light the verified clone Candle. Striking is how recent many entries are: of the 23 Lean reports, 10 date from 2026; for Coq/Rocq it is more than 40. His list, Bernstein writes, includes many more bugs than two surveys by Lawrence Paulson and Stérin from this year.
The summer of soundness bugs. ☀️ What such bugs look like in practice is shown by the case Lean's creator Leonardo de Moura describes in a postmortem. On 25 July Ramana Kumar published an AI-assisted "disproof" of the Collatz conjecture that Lean accepted. It was not valid: it exploited a bug in how the kernel handled nested inductive types. The bug was reported on 28 July and, according to de Moura, fixed an hour later. The twist: a week-old version of the independent checker nanoda had also let the proof through, because of a second, unrelated bug. De Moura stresses that this was an implementation bug, not a hole in the theory behind Lean. Afterwards Daniel Selsam at OpenAI, using an AI specialised in cybersecurity, found further programming mistakes in the kernel; de Moura says all have been fixed.
Several checkers help, but not always. 🔁 Bernstein recommends running a proof through several checking programs, ideally each in its own isolated environment. How well that stops deliberate attacks he considers unclear, because bugs are sometimes shared by several checkers. The Collatz case shows a variant: two different bugs in two programs happened to fit together. De Moura's conclusion is that checking with an independent kernel still works, but users need current versions of both programs.
Who watches the provers? 🧩 For Bernstein the better answer is a proof that the checker works correctly. For a close translation of the inference rules of the HOL Light kernel this was achieved as early as 2006, leaving out the rules for new definitions. In 2022 Candle, a clone of HOL Light, was proven to allow only correct theorems, provided the processor executes the instructions used as expected; that proof was in turn checked in another system, HOL4. HOL Light's kernel, at about 400 lines of code, is also small enough to review carefully; Bernstein notes, however, that the line count says nothing about how carefully it has actually been reviewed, nor about possible bugs in the underlying programming language.
What still worries him. 🔐 From a security perspective, Bernstein writes, it remains concerning to rely on large proof-checking programs whose trustworthiness rests on the claim that another large proof-checking program has checked them. He would like to see more work on simplifying them. Hales points in his post to a second layer: even a correctly checked Lean proof should only be accepted once humans have confirmed that the statement in the code really is the original problem.
Sources
- False computer-checked proofs (D. J. Bernstein (cr.yp.to))
- Postmortem for Kernel Soundness Bug #14576 (Leonardo de Moura)
- What mathematicians should know about the Lean Theorem Prover: questions of reliability and AI (Terence Tao, What's new (guest post by Thomas Hales))
- Anthropic mathematician says Claude helped prove Riemann hypothesis (TNW)