AIFeed

What is Lean? A guide to the software verifying AI maths breakthroughs

Summary

Nature, Published online: 03 December 2026; doi:10.1038/d41586-026-03876-5 The once-obscure system has been instrumental in validating proofs of groundbreaking maths problems.

Original text(via Nature)
A woman seen from behind, standing in front of a whiteboard with mathematical equations written on it.
A woman seen from behind, standing in front of a whiteboard with mathematical equations written on it.

Artificial-intelligence tools are massively speeding up the rate at which mathematicians can solve problems. But the resulting proofs are so massive that they are hard for humans to verify.Credit: Hill Street Studios/Getty

For more than a decade, a small cadre of mathematicians have worked out of the spotlight to build tools that enable mathematical proofs to be machine-verified. Now, because artificial-intelligence models have been toppling some of the toughest problems in mathematics, their little-known project — called Lean — has been thrown into the public sphere as a trusted verifier of mathematical proofs.

“None of us could have predicted, at the beginning, what would happen” with Lean, says Leonardo de Moura, a computer scientist at Amazon Web Services in Redmond, Washington, and creator of the Lean system. Indeed, many mathematicians have come to depend on the technology to check AI-written proofs of centuries-old problems.

Last month, mathematician Levent Alpöge posted 17 million lines of Lean code that proved the Riemann hypothesis, a notorious unsolved problem. Mathematicians scrambled to understand the proof, even using AI tools to generate a human-readable paper explaining it. Nevertheless, Lean’s stamp of approval was enough for the community to trust the result, says Emily Riehl, a mathematician at Johns Hopkins University in Baltimore, Maryland, and a member of the Mathlib Initiative, which oversees a digital library of Lean statements. “Had that proof been written on paper, there was absolutely no way that people would immediately be able to assess with a high degree of confidence that it’s a correct proof.”

“If I said, ‘One day, the Riemann hypothesis will be verified and proved using Lean and AI’, people would have said I was insane,” de Moura says.

What is Lean?

Lean is a proof assistant and programming language that can formally verify mathematical proofs. When mathematicians write statements and proofs in Lean, the system checks that every step is logically sound according to the rules of mathematical systems.

AI is ‘the end of mathematics as we know it’ — where does the field go next?

Mathematical proofs are typically constructed by combining previously established results. To prove that the square of every even number is even, for example, a mathematician draws on definitions that have already been established. Before Lean, mathematicians verified each other’s proofs manually, reading relevant papers and references to rebuild each step of the arguments in their own heads. This process could take years for complex problems, but Lean can verify massive proofs in hours.

Many mathematical building blocks have now been translated into Lean and added to Mathlib, an open-source, community-maintained library of Lean statements. Researchers can use the tool to build proofs on top of mathematics that has already been formalized.

Mathlib was created in 2017 and now contains more than two million lines of Lean code, thanks to a team composed primarily of volunteers who have reviewed and approved every submission. Their work has given formal mathematical proofs a common language — a feat that has garnered “very little academic recognition” for the reviewers, says Kevin Buzzard, a mathematician at Imperial College London who helps to maintain Mathlib.

The LEAN programming language homepage displayed on a smartphone screen with sample mathematical code visible.
The LEAN programming language homepage displayed on a smartphone screen with sample mathematical code visible.

Lean, a programming language designed to assist with verifying mathematical proofs, confirmed that the Riemann hypothesis had been proven.Credit: Michael Szebor/Nature

Although the software is heralded for ensuring correctness, Lean is still vulnerable to bugs and glitches that could produce imperfect proofs, says Buzzard. Therefore, Lean code needs to go through several extra verification steps before a proof is declared true.

How has Lean changed mathematics?

Enjoying our latest content? Log in or create an account to continue

  • Access the most recent journalism from Nature's award-winning team
  • Explore the latest features & opinion covering groundbreaking research

doi: https://doi.org/10.1038/d41586-026-03876-5

Reprints and permissions

Related Articles

  • Anthropic AI ‘formalizes’ proof of Fermat’s last theorem — a milestone for mathematics
  • Mathematicians astounded by AI and human-written proofs of iconic Riemann hypothesis
  • ‘If we can solve Riemann, what can’t we do?’: mathematicians shocked and excited by AI breakthroughs
  • AI cracks 80-year-old mathematics challenge — researchers are astonished
  • ‘It is incredible’: How AI is transforming mathematics
  • Feynman solved the ‘restaurant dilemma’ 50 years ago — now a study confirms his mathematics

Subjects

  • Mathematics and computing

Latest on:

  • Mathematics and computing
  • In the AI era, coding means thinking like a systems architect Career Column 13 OCT 26

In the AI era, coding means thinking like a systems architect

Career Column 13 OCT 26

  • Chinese companies doubled down on science after US tech restrictions News 18 SEP 26

Chinese companies doubled down on science after US tech restrictions

News 18 SEP 26

  • Who gets credit in the AI era? OpenAI maths bombshell sparks debate News 17 SEP 26

Who gets credit in the AI era? OpenAI maths bombshell sparks debate

News 17 SEP 26

  • Internet security needs urgent ‘post-quantum’ upgrade — what you need to know News Explainer 03 DEC 26

Internet security needs urgent ‘post-quantum’ upgrade — what you need to know

News Explainer 03 DEC 26

  • Artificial intelligence and the future of public opinion research Perspective 02 DEC 26

Artificial intelligence and the future of public opinion research

Perspective 02 DEC 26

  • Regulators must keep testing AI systems even after initial release Correspondence 01 DEC 26

Regulators must keep testing AI systems even after initial release

Correspondence 01 DEC 26

Jobs

  • Associate Editor or Senior Editor, Nature Progress Bioengineering Title: Associate or Senior Editor (bioengineering), Nature Progress Bioengineering Location: Shanghai, Beijing, New Delhi or Pune – hybrid working ... Associate or Senior Editor (bioengineering), Nature Progress Bioengineering Springer Nature Ltd

Associate Editor or Senior Editor, Nature Progress Bioengineering

Title: Associate or Senior Editor (bioengineering), Nature Progress Bioengineering Location: Shanghai, Beijing, New Delhi or Pune – hybrid working ...

Associate or Senior Editor (bioengineering), Nature Progress Bioengineering

Springer Nature Ltd

  • Open PI Positions at SMART Shenzhen Medical Academy of Research and Translation sincerely invites outstanding talents of all levels. 17F, Tower A, Guangming Life Science Park, Xinhu Subdistrict, Guanngming, Shenzhen, Guangdong Shenzhen Medical Academy of Research and Translation

Open PI Positions at SMART

Shenzhen Medical Academy of Research and Translation sincerely invites outstanding talents of all levels.

17F, Tower A, Guangming Life Science Park, Xinhu Subdistrict, Guanngming, Shenzhen, Guangdong

Shenzhen Medical Academy of Research and Translation

  • Faculty Positions in Biomedical Sciences/Biomedical Informatics/Intelligent Healthcare ZJE is seeking outstanding scholars at Assistant Professor, Associate Professor, and Full Professor levels. Haining, Zhejiang, China Zhejiang University-University of Edinburgh Institute

Faculty Positions in Biomedical Sciences/Biomedical Informatics/Intelligent Healthcare

ZJE is seeking outstanding scholars at Assistant Professor, Associate Professor, and Full Professor levels.

Haining, Zhejiang, China

Zhejiang University-University of Edinburgh Institute

  • Executive Publisher, npj Series Applied and Physical Sciences Job title: Executive Publisher, npj Series Applied and Physical Sciences Location: Shanghai or Pune – hybrid working model Closing date: 20th Decem... Shanghai or Pune – hybrid working model Springer Nature Ltd

Executive Publisher, npj Series Applied and Physical Sciences

Job title: Executive Publisher, npj Series Applied and Physical Sciences Location: Shanghai or Pune – hybrid working model Closing date: 20th Decem...

Shanghai or Pune – hybrid working model

Springer Nature Ltd

  • Global Recruitment for Faculty and Researchers at Anhui Normal University Anhui Normal University sincerely invites outstanding researchers and academics worldwide to join its faculty. Wuhu, Anhui (CN) Anhui Normal University

Global Recruitment for Faculty and Researchers at Anhui Normal University

Anhui Normal University sincerely invites outstanding researchers and academics worldwide to join its faculty.

Wuhu, Anhui (CN)

Anhui Normal University

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by Nature
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗