Osegi
Science·2 min read

Lean, the proof checker behind the Riemann hypothesis claim

A proof of 17 million lines of code was accepted by Lean, a program that checks maths without needing to understand it. Here is how that auditor works.

A mathematician's blackboard covered in equations next to a screen showing lines of Lean code.
Image: xataka.com

Nobody may know exactly how the accounts were balanced, but they balance. That is the idea behind Lean, the proof assistant that has just checked a claimed proof of the Riemann hypothesis, 17 million lines of code long.

The story starts with oranges. In 1998 Thomas Hales and Samuel Ferguson announced a proof of the Kepler conjecture, which asks whether spheres can be stacked more tightly than a grocer stacks oranges. Four years of review later, a panel of twelve referees at Annals of Mathematics said they were "99% sure" it was right. The debate went on anyway. So Hales decided a machine had to check it. He announced the Flyspeck project in January 2003 and finished it in August 2014.

What is Lean?

Lean is a proof assistant and a programming language at once. In 2015 Leonardo de Moura released it as open source, after a decade working on automatic logic solvers at Microsoft. It works like a compiler: just as a compiler rejects a program with errors, Lean rejects proofs that do not fit the statement they claim to prove.

There are two layers. A large, extensible one, the elaborator, translates what a human or a machine writes into a minimal theory. A small one, the kernel, only checks that theory step by step. Think of an auditor who does not need to know the business, only whether the numbers add up.

Mathematicians adopted it fast. Mathlib became a shared library of maths in Lean, Kevin Buzzard of Imperial College started the Xena project, and in 2020 Fields medallist Peter Scholze challenged the community to check a theorem he wrote with Dustin Clausen. It worked.

Can the Riemann proof be trusted?

On 12 November Buzzard posted four questions for any "Lean-verified" proof. All four came back yes. The statement used the definition already in Mathlib, which fits on one line and was not written by the author. Dozens of people compiled it and got the same file, and an isolated rebuild at MIT matched byte for byte. A tool called comparator, from the Lean FRO, confirmed the proof states exactly what it should. And every kernel accepted it, one of them, nanoda, in 28 minutes on 80 threads. The proof relies only on Lean's three standard axioms.

Lean's kernel has been wrong before, but there is no sign of that here. Andrew Sutherland, who ran the MIT checks, told Scientific American the chance that something is off is "approximately zero". Terence Tao said digesting the result "will take some time", but that checking 17 million lines this precisely is an achievement in itself.

Apps worth a look

SUMO: the number puzzle

Tap the right tiles, add them up, hit the target. Easy to learn, hard to master. Free, for all ages.

Tags:leanriemann hypothesismathematicsproof assistantmathlibformal verification

More from this day

See all →

More in: Science

See all →