Lean
Lean is an open-source programming language and proof assistant: users write mathematical definitions, theorem statements and proofs in a dependent type theory, and the compiler checks line by line whether a proof holds — errors and gaps fail to compile (per Wikipedia and the official site). It is based on the calculus of constructions with inductive types, placing it in the same type-theoretic tradition as Rocq (formerly Coq), and is open-sourced under Apache 2.0.
History and ecosystem
- Origins: Lean was designed by Leonardo de Moura while he worked at Microsoft Research and first appeared in 2013; Lean 4, released in 2021, is a reimplementation that can generate C code with an improved macro system and type-class synthesis.
- Maintenance: the nonprofit Lean Focused Research Organization (Lean FRO), formed in 2023, works on the language’s scalability and usability.
- mathlib: the community mathematics library started in 2017 with the goal of covering as much pure mathematics as possible in one cohesive library; per Wikipedia, as of May 2025 it had formalized over 210,000 theorems and 100,000 definitions.
- Use with AI: because proofs are machine-checked, Lean has become a common vehicle for verifying AI-generated mathematics. In 2023 Terence Tao formalized a proof of the polynomial Freiman–Ruzsa conjecture in Lean; per Wikipedia, in September 2026 Anthropic reported that its AI agents had produced a complete Lean formalization of Fermat’s Last Theorem in eleven days (about 13 million lines, checked by Kevin Buzzard), and in November 2026 Anthropic researcher Levent Alpöge posted a Claude-assisted proof of the generalized Riemann hypothesis verified in Lean. Acceptance of these proofs is a matter for the relevant mathematical communities’ ongoing discussions.
Discussed on Next Token
Episode 012 discusses the AI proof of the Riemann hypothesis in the chapter “Opus 5.6、黎曼猜想与文明升维” (Opus 5.6, the Riemann conjecture and upgrading civilization), where Lean plays a central role. Xiangyang Qiaomu says “but the proof was done in that Lean math, a formalized proof, and both communities came out saying it is correct”, but the problem is that “humans can’t read it — too much content”. Guizang and Xiangyang Qiaomu quote different line counts (1.5 million and 17 million lines) and mention a later compression to about 79,000 lines — these figures are participants’ retellings, not verified on the show. Xiangyang Qiaomu also notes that the Clay prize reserved for proving the Riemann hypothesis has not been awarded, suggesting the mathematical community is “not yet 100 percent” convinced; the discussion extends into whether humans can understand machine proofs and a judgment that civilization’s output now lives inside models — all participant views.
Frequently asked questions
What is Lean?
An open-source programming language and proof assistant: theorems and proofs are written with dependent types and checked mechanically by the compiler; see the official site.
How does Lean differ from Coq (Rocq) and Isabelle?
All three are interactive theorem provers. Lean builds on the calculus of constructions with inductive types, ships with the unified community library mathlib, and in recent years has been widely used to formalize AI-generated proofs precisely because its machine-checked proofs pair naturally with AI; which tool fits best depends on the domain and community.
What is mathlib?
Lean’s community mathematics library, started in 2017 to cover as much pure mathematics as possible in one cohesive library; per Wikipedia it contained over 210,000 formalized theorems as of May 2025.
Why are AI proofs verified in Lean?
Natural-language proofs produced by large language models can contain subtle errors, while a Lean proof is checked line by line by the compiler — if it compiles, the reasoning chain holds. This makes “does it pass Lean” an objective yardstick for AI mathematics; the 2026 Fermat’s Last Theorem formalization and the generalized Riemann hypothesis proof were both verified this way.
Who maintains Lean?
The nonprofit Lean FRO, formed in 2023, with original designer Leonardo de Moura; the project is open source on GitHub.