Skip to content
— CH. 1 · ORIGINS AND EVOLUTION —

Lean (proof assistant)

~5 min read · Ch. 1 of 5
5 sections
  • The year 2013 marked the launch of a new tool called Lean. Brazilian computer scientist Leonardo de Moura developed this system while working at Microsoft Research. Early versions known as Lean 1 and 2 remained experimental throughout their short lifespans. These initial releases featured support for homotopy type theory foundations that developers later removed from the core language. A significant shift occurred on the 20th of January 2017 when version 3 arrived as the first moderately stable release. This iteration relied heavily on C++ code with some features written directly in the Lean language itself. Version 3.4.2 became the final update before official end-of-life status took effect. Community members continued development through unofficial builds reaching number 3.51.1 during the transition period. The landscape changed dramatically in 2021 with the arrival of Lean 4. This major release represented a complete reimplementation capable of generating executable C code. Developers gained the ability to modify frontend components without touching underlying C++ source files since all parts now existed within Lean. The project adopted C++17 standards to ensure modern compiler compatibility. In 2023 the nonprofit Lean Focused Research Organization formed to improve scalability and usability goals. Recognition followed quickly when the ACM SIGPLAN Programming Languages Software Award reached Gabriel Ebner, Soonho Kong, Leo de Moura and Sebastian Ullrich in 2025.

  • The system rests upon the calculus of constructions augmented by inductive types. Early iterations mixed C++ implementation with self-written features creating complex maintenance challenges for developers. Version 3 required direct modification of C++ code to alter core system behavior or add new functionality. A fundamental architectural shift happened in 2021 when engineers rebuilt the entire prover from scratch using Lean as the primary language. This decision allowed users to override key parts of the system without accessing low-level C++ sources. The new architecture supports efficient domain-specific automation through generated C code compilation pipelines. Memory management procedures received significant improvements over previous versions alongside enhanced type class synthesis capabilities. Macro systems became available to handle complex syntactic transformations during proof construction. The transition to version 4 broke backward compatibility entirely forcing existing libraries to undergo complete rewriting. Developers gained control over frontend interfaces previously locked behind C++ barriers. The project now runs on C++17 standards ensuring modern compiler support across platforms. Community members developed unofficial patches reaching version 3.51.1 while waiting for official updates. These interim builds kept the ecosystem alive during the multi-year development cycle. The final release enabled independent modification of all system components through pure Lean code.

  • The standard library named Std contains common data structures like tree maps and hash maps. It includes datetime functions and concurrency primitives essential for functional programming tasks. Community contributors maintain a complementary package called batteries that adds further data structure options. This extension serves both mathematical research purposes and conventional software development needs. A major community initiative began in 2017 with the mathlib project aiming to digitize pure mathematics. By May 2025 this effort had formalized more than 210,000 theorems and 100,000 definitions within the framework. Specialized domains received dedicated attention through projects like SciLean for scientific computing applications. PhysLean emerged as another specialized library designed to digitize physics concepts into the system. Integration occurs through Visual Studio Code Neovim and Emacs editors via client extensions. Users type Unicode symbols using LaTeX-like sequences such as backslash times for multiplication signs. Language Server Protocol servers handle communication between editors and the proof engine. These tools provide instant feedback mechanisms for students learning mathematical proofs. The ecosystem continues expanding as researchers contribute new libraries for diverse fields. Standardization efforts ensure compatibility across different implementation versions while maintaining flexibility for advanced users.

  • Thomas Hales initiated a project called Formal Abstracts utilizing Lean for verification work. Kevin Buzzard leads the Xena Project which aims to rewrite every undergraduate theorem from Imperial College London curriculum. Terence Tao released a companion volume to his Real analysis textbook Analysis I containing selected formalizations. Heather Macbeth employs the tool to teach students fundamental proof techniques with immediate feedback loops. A team of researchers achieved a major milestone in 2021 by verifying Peter Scholze's condensed mathematics proof. This accomplishment demonstrated the system could handle cutting-edge research results previously considered too complex for automation. Terence Tao utilized the platform in 2023 to formalize the Polynomial Freiman-Ruzsa conjecture published that same year. Undergraduate digitization efforts continue growing as more institutions adopt the framework for teaching purposes. The Natural Number Game provides an interactive tutorial experience for beginners entering the field. Community members maintain extensive documentation covering both basic concepts and advanced theoretical constructs. Research groups increasingly rely on these tools to validate complex arguments before publication. The shift toward formal verification represents a broader movement within mathematical communities seeking absolute certainty. Students gain confidence through instant error detection during their learning process. Professors use the system to create reproducible examples for classroom instruction.

  • OpenAI developed an AI model capable of generating proofs for high school level olympiad problems in 2022. Meta AI independently created a similar system available for public use within the Lean environment. Vlad Tenev and Tudor Achim founded Harmonic in 2023 to reduce AI hallucinations through code generation and checking. Google DeepMind released AlphaProof in 2024 achieving silver medalist performance at International Mathematical Olympiad competitions. This marked the first time any AI system reached medal-worthy standards on math olympiad problems. DeepSeek introduced DeepSeek-Prover-V2 in April 2025 built upon the DeepSeek-V3 foundation. These models demonstrate increasing sophistication in handling complex logical reasoning tasks automatically. Researchers now combine human intuition with machine precision to tackle previously unsolvable conjectures. The integration allows mathematicians to verify results faster than manual methods alone could achieve. AI systems generate candidate proofs that humans then refine or reject based on logical soundness. This collaborative approach accelerates discovery while maintaining rigorous verification standards throughout the process. Future developments promise even greater automation capabilities as training datasets expand across mathematical domains.

Common questions

Who developed the Lean proof assistant and when was it launched?

Brazilian computer scientist Leonardo de Moura developed the Lean proof assistant while working at Microsoft Research. The system officially launched in 2013 as a new tool for formal verification.

What major architectural change occurred with Lean version 4 released in 2021?

Engineers rebuilt the entire prover from scratch using Lean as the primary language instead of relying on C++ code. This decision allowed users to override key parts of the system without accessing low-level C++ sources and enabled generation of executable C code.

How many theorems had the mathlib project formalized by May 2025?

By May 2025 the mathlib project effort had formalized more than 210,000 theorems and 100,000 definitions within the framework. Community contributors maintain this extensive library alongside complementary packages like batteries for additional data structures.

Which AI systems achieved medal-worthy performance at International Mathematical Olympiad competitions?

Google DeepMind released AlphaProof in 2024 achieving silver medalist performance at International Mathematical Olympiad competitions. This marked the first time any AI system reached medal-worthy standards on math olympiad problems before DeepSeek introduced DeepSeek-Prover-V2 in April 2025.

All sources

35 references cited across the entry

  1. 1bookAutomated Deduction – CADE 28Leonardo de Moura et al. — Springer International Publishing — 2021
  2. 2webAbout
  3. 3bookAutomated Deduction -- CADE 28Leonardo de Moura et al. — Springer International Publishing — 2021
  4. 5webMission2023-07-25
  5. 8webStd
  6. 13webCSLib
  7. 14webSciLean
  8. 17webA Review of the Lean Theorem ProverThomas Hales — September 18, 2018
  9. 18webA Lean companion to "Analysis I"Terence Tao — WordPress — 31 May 2025
  10. 19webThe Mechanics of ProofHeather Macbeth
  11. 22webanalysisTerence Tao
  12. 23webA.I. Is Coming for Mathematics, TooSiobhan Roberts — July 2, 2023
  13. 24newsProof Assistant Makes Jump to Big-League MathKevin Hartnett — July 28, 2021
  14. 26webPhyslib
  15. 27newsNew Scientist2026-03-26
  16. 31newsIs Math the Path to Chatbots That Don't Make Stuff Up?Cade Metz — 23 September 2024
  17. 33webMove Over, Mathematicians, Here Comes AlphaProofSiobhan Roberts — July 25, 2024
  18. 35webThe Future of Mathematics?Kevin Buzzard