What Is Lean? The Proof Checker Behind the Riemann Result

Lean is free software that checks mathematical proofs line by line, the way a compiler checks code. On 21 November 2026 its teams certified a 17-million-line proof of the Riemann Hypothesis, the 1859 prime-number problem explained here.

This explainer covers what Lean is, who runs it, how a check works, what it has verified before and what a Lean check does not tell you. The build behind the Riemann proof is measured here.

We track what AI systems can do in mathematics and other tests on our AI model benchmarks page.

Business Pill: The Cost of Checking

An evergreen Business Engineer explainer on the cost of checking work. It teaches the general idea only and does not discuss Lean or the Riemann proof.

The key insight: Lean, created by Leonardo de Moura in 2013, accepts a proof only if every step checks; its teams certified a 17-million-line Riemann proof on 21 Nov 2026, after checks by Lean’s official kernel and several independent checkers.

What Is a Proof Assistant?

A proof assistant is a program where a proof is written as code. The program accepts the proof only if every step follows from the rules of logic and from results it has already accepted.

That is the difference from a paper proof. A human referee reads an argument and judges it; the software either accepts every step or reports an error.

Anthropic's Lean proof of Fermat's Last Theorem ran to 13 million lines, per Kevin Buzzard; Alpoge's Riemann l
Anthropic’s Lean proof of Fermat’s Last Theorem ran to 13 million lines, per Kevin Buzzard; Alpoge’s Riemann library is 17 million lines, per the Lean FRO and Mathlib Initiative, about 1.3 times larger by our arithmetic.

Who Makes Lean?

Leonardo de Moura created Lean in 2013, according to the Lean FRO, the non-profit he co-founded in July 2023 to develop it. He is a senior principal applied scientist at Amazon Web Services.

Mathlib is Lean’s shared library of mathematics. Its statistics page listed 142,131 definitions, 296,300 theorems and 772 contributors when we read it on 21 November.

The Mathlib Initiative supports that library and is a program of Renaissance Philanthropy. Alex Gerko, founder of XTX Markets, gave $10 million in July 2025, split $5 million to each group, the Lean FRO says.

How Does a Lean Check Work?

At the bottom of Lean sits a small program called the kernel. It re-checks the final proof against the basic rules, so a mistake anywhere in millions of lines should be caught there.

Mathematician Kevin Buzzard lists four questions to ask before trusting a claim that a proof was “checked in Lean”. Does the Lean statement match the informal one? Does the code compile? Does it prove the theorem as stated? Does it exploit a bug in the kernel?

On the last point he writes that a kernel bug was once “fixed four hours after it was discovered”, and that Lean “now has many kernels”, so a proof can be re-checked by independent programs.

What Has It Verified Before?

In July 2022 the Lean community said it had completed the Liquid Tensor Experiment, a challenge set by mathematician Peter Scholze, “a year and a half after the challenge was posed”, its blog said.

Other tools came first. The Flyspeck project checked Thomas Hales’s proof of the Kepler conjecture on packing spheres in the HOL Light and Isabelle proof assistants, its official account says.

In July 2024 Google DeepMind’s AlphaProof, which “trains itself to prove mathematical statements in the formal language Lean”, scored 28 of 42 points at the International Mathematical Olympiad, silver-medal level, DeepMind said.

Why Does It Matter for AI?

AI systems can produce long proofs that no person has time to read. A Lean check gives a way to trust the result without reading it all. Alpöge wrote that he found the Riemann proof “working with Claude”, Anthropic’s AI model.

Buzzard says Anthropic’s Lean proof of Fermat’s Last Theorem ran to 13 million lines. His own machine ran out of memory compiling it, and Anthropic gave him temporary access to one with 96 cores and 500 gigabytes of memory. The Riemann library is 17 million lines, about 1.3 times larger, by our arithmetic.

For the Riemann proof, the joint statement says the theorem was compared with Mathlib’s statement using two independent tools, and checked by Lean’s official kernel and several independent checkers.

Lean has also been used to check an AI-found result in computer science. In a paper posted on 5 October 2026, Josh Alman of Columbia University and Virginia Vassilevska Williams of MIT give algorithms for two classic problems, 3SUM (do three numbers in a list add up to zero?) and all-pairs shortest paths, in O(n1.9992) and O(n2.9995) time. Those are small gains over the textbook n2 and n3, but the paper says they refute two long-standing hardness hypotheses. The paper states that “Claude, an AI model developed by Anthropic, discovered the algorithm” and that “Claude also verified this paper’s main results using the Lean 4 proof assistant with the Mathlib library.”

The Structural Read

As we read it, Lean turns the question ‘is this AI proof right?’ into one a machine can answer, which is why AI labs now ship their maths results as Lean code.

As we read it, the bottleneck moves from checking to explaining: the software can confirm a 17-million-line proof, but people still have to understand it.

Kevin Buzzard, Xena Project

“Even if the Lean code compiles and passes all these tests, and is thus overwhelmingly likely to be a correct proof of a theorem, this does not mean that any corresponding pdf also contains a correct proof!”

Three Implications

FOR READERS a Lean check means every step was verified by software.

FOR AI LABS Anthropic formalized Fermat’s Last Theorem in Lean, Buzzard says.

FOR MATHEMATICIANS a readable write-up is still the human job.

What Is Not Established

Lean checks the statement as written in code. Whether that code matches the problem mathematicians care about is a human judgment; for the Riemann Hypothesis the Lean teams say Mathlib’s statement “has been carefully vetted by experts in Lean and number theory”.

A checked proof is not an explanation. Buzzard warns that passing the tests “does not mean that any corresponding pdf also contains a correct proof”, and the Lean teams say they look forward to work that will “help explain the new ideas in this proof”.

This Week In The AI Supercycle

A World Without an Order, and an AI Central Bank Without a Successor

This week’s issue: the week AI memory stayed largely sold out while the people holding the shares paid: why the AI Supercycle is not a dot-com replay, read through geopolitics, macro and technology, with the gap between building and financing the widest we’ve recorded.

Read the full issue →

Business Engineer Framework

The AI Supercycle

The Business Engineer map of where AI capability turns into business leverage.

Read the Map of AI →

The Bottom Line

Lean, created in 2013, accepts a proof only if every step checks out, and independent checkers can confirm it. That is how a 17-million-line proof of the Riemann Hypothesis, which Alpöge says he found working with Claude, was certified on 21 November; explaining it to people is the next job.

97,000+ executives read Business Engineer for the AI strategy frameworks cited by ChatGPT, Claude, and Perplexity.

A note on sourcing. Lean’s history, its funders and the Riemann certification come from the Lean FRO, the Mathlib Initiative and their joint statement. The four questions, the Fermat line count and the kernel points are from Kevin Buzzard’s Xena post. Mathlib’s counts are from its statistics page as read on 21 November. The 13-year span and the 1.3 times comparison are our arithmetic.

Sources: Lean FRO, About page and Lean history, read 21 Nov 2026 · Mathlib Initiative, home page, read 21 Nov 2026 · Mathlib statistics page, read 21 Nov 2026 · Kevin Buzzard, Xena Project, ‘…and the proof is checked in Lean’, 12 Nov 2026 · Lean community blog, ‘Completion of the Liquid Tensor Experiment’, 15 Jul 2022 · Hales et al., ‘A formal proof of the Kepler conjecture’, arXiv:1501.02155 · Google DeepMind, AlphaProof and AlphaGeometry 2 IMO blog post, Jul 2024 · Lean FRO and Mathlib Initiative, ‘Lean verification of the Riemann Hypothesis’, 21 Nov 2026

Frequently Asked Questions

What is Lean?

Lean is free software, created by Leonardo de Moura in 2013, that checks mathematical proofs written as code. It accepts a proof only if every step follows from the rules of logic and results it has already accepted.

What is Mathlib?

Mathlib is Lean's shared library of mathematics. Its statistics page listed 142,131 definitions, 296,300 theorems and 772 contributors on 21 November 2026.

Does a Lean check prove the Riemann Hypothesis is true?

The Lean FRO and the Mathlib Initiative certified on 21 November 2026 that a 17-million-line Lean proof is correct and proves Mathlib's statement of the hypothesis, which they say experts vetted. A human-readable explanation is still to come.

Can a Lean check be wrong?

Kevin Buzzard says a kernel bug was once fixed four hours after discovery, and that Lean now has several independent kernels that can re-check a proof. The Riemann proof was checked by Lean's official kernel and several independent checkers.

Scroll to Top
FourWeekMBA