Formal Verification

Formal verification is the use of mathematical proof to establish that a piece of software, a hardware design or a mathematical argument is correct with respect to a precise specification. Instead of testing a program on examples and hoping no bug remains, verification proves that it behaves as specified in every case. The proofs are checked by computer programs called proof assistants or verifiers, such as Lean, Coq (renamed Rocq), Isabelle and others, which accept an argument only if every step follows from the rules. AI has made formal verification newly important – both as a way to produce such proofs faster and as a way to check the output of AI systems themselves.

Software and hardware

Formal methods have long been used where errors are unacceptable. In 2009 researchers in Australia completed a machine-checked proof that the seL4 operating system kernel matched its specification; the CompCert compiler for the C language was proven to preserve the meaning of the programs it compiles. Chip makers verify parts of processor designs, aircraft and railway systems use formally checked software, and Amazon Web Services uses automated reasoning to check security policies. The cost has limited wider use: writing specifications and proofs by hand can take far longer than writing the code.

Lean and mathematics

Lean, created by Leonardo de Moura at Microsoft Research starting in 2013 and since 2023 developed by the nonprofit Lean FRO, has become the center of formal mathematics. Its community library, Mathlib, covers much of the undergraduate curriculum and a growing range of research-level topics. In 2022 mathematicians completed the Liquid Tensor Experiment, formally verifying a key theorem of Dustin Clausen and Peter Scholze, and Terence Tao has led collaborative formalization projects, such as the Equational Theories Project completed in 2025. In September 2026 Anthropic reported that Claude, working largely on its own for 11 days, had produced the first complete computer-checked proof of Fermat’s Last Theorem – 13 million lines of Lean. In November 2026 a proof of the Aaronson–Ambainis conjecture produced by an AI system passed Lean; Scott Aaronson said he believed it correct, though it had not been peer-reviewed (see our report). Working from a logician’s transcriptions of Kurt Gödel’s shorthand notebooks, Claude extracted 663 theorem candidates that were then checked in Coq; by the researcher’s account about 400 held as stated, though no data has been released (see our report).

Why AI changes the picture

Language models can now write specifications, programs and proofs, which could make verification much cheaper (see Automated Theorem Proving). At the same time, AI-generated code is produced in volumes no human can review (see Vibe Coding and Coding Agent), and a machine-checked proof offers a guarantee that does not depend on trusting the model that wrote it. Some researchers propose “guaranteed safe AI,” in which AI systems would come with formal proofs that they meet safety specifications.

Skeptics note the limits. A proof is only as good as its specification: if the specification misses what matters, a verified program can still do the wrong thing. Translating messy real-world requirements into formal language is itself error-prone, and verified components still run on hardware and alongside software that may not be verified. Models can also learn to game automated checks (see Reward Hacking).

Why it matters

Formal verification offers something rare in AI: assurance that does not depend on trusting the AI that produced the work. As machines write more of the world’s code and mathematics, proofs that a computer can check may become the main way people keep confidence in what those machines produce.

Written with Claude, made by Anthropic, whose researchers produced the Lean proof of Fermat’s Last Theorem described here and whose models were used in the Gödel project and, as a non-public model, in the Aaronson–Ambainis proof; Amazon, which made the largest single donation in the Lean FRO’s history, and Microsoft, where Lean was created, are investors in Anthropic.

Related

Automated Theorem Proving · Proof Assistant · Mathlib · Autoformalization · Coding Agent · Vibe Coding · AI Scientist · Reward Hacking · Safety Case · AI Control

Sources: Gerwin Klein et al.: seL4: Formal Verification of an OS Kernel (SOSP) (2009) · Xavier Leroy: Formal verification of a realistic compiler (Communications of the ACM) (2009) · Lean FRO: About · Lean community: Completion of the Liquid Tensor Experiment (July 14, 2022) · Anthropic: Formalizing Fermat’s Last Theorem (September 4, 2026) · Scott Aaronson: Shtetl-Optimized (November 8, 2026) · Mathlib community: Mathlib · Davide Castelvecchi: Mathematicians welcome computer-assisted proof in ‘grand unification’ theory (Nature) (2021) · David “davidad” Dalrymple et al.: Towards Guaranteed Safe AI (arXiv) (2024)

Leave a Reply

Your email address will not be published. Required fields are marked *