Skip to content
ContentLora

    Tip: press / anywhere to search.

    technology

    Lean and mathlib: the proof assistant and its maths library

    Also known as Lean, Lean 4, Lean theorem prover, mathlib, Mathlib, mathlib4, Lean FRO

    Lean is an open-source programming language and proof assistant, created by Leonardo de Moura in 2013.[1][2] Mathlib is its community-built library of formalised mathematics. In November 2026 it listed about 142,000 definitions and 296,000 theorems.[3][4] Together they underpin large formalisation projects such as the Fermat's Last Theorem project and AI systems such as AlphaProof that write checkable proofs.[5][6]

    Editor reviewedUpdated Wiki19 claims · 89% primaryMathematics research, Computing, AI for science
    Key facts

    This page is part of the mathematics crash course. Read proof assistants explained first for what a proof assistant does. Counts are as of 22 November 2026 and change daily.

    What Lean is

    Lean is an open-source programming language and proof assistant.[1] Its developers say its minimal trusted kernel is what makes its checks reliable.[7] Leonardo de Moura created it in 2013, after working on automated reasoning at Microsoft Research and SRI International. The first commit to the Lean repository was in July 2013.[2]

    Lean 3.0 was released in January 2017. Work on Lean 4 began in April 2018, and Lean 4.0 was officially released in September 2023.[8] The Lean Focused Research Organization (Lean FRO) was formed in July 2023. It is a non-profit under Convergent Research and works on Lean’s scalability, usability, documentation and proof automation.[9] Its listed funders include Alex Gerko, the Alfred P. Sloan Foundation, the Richard Merkin Foundation and Simons Foundation International.[10]

    In 2025 Lean received the ACM SIGPLAN Programming Languages Software Award. The 2015 paper describing it won the Skolem Award the same year.[11]

    mathlib, the community library

    Mathlib is a community-driven library of mathematics formalised in Lean. Its authors say it stands out for its dependently typed foundations, its focus on classical mathematics, its extensive hierarchy of structures, and its distributed organisation.[3] The original library for Lean 3 was started in July 2017. The community finished porting it to Lean 4 in July 2023.[12] The Lean 4 repository, mathlib4, was created in May 2021 and is released under the Apache 2.0 licence.[13]

    On 22 November 2026, mathlib’s statistics page listed 142,131 definitions, 296,355 theorems and 772 contributors.[4] The Lean website describes it as over a million lines of formalised mathematics across algebra, analysis, topology, probability and computer science.[14]

    Big projects built on Lean

    Several large formalisations have run as separate Lean projects:

    • The Liquid Tensor Experiment was completed in July 2021.[5]
    • The Polynomial Freiman-Ruzsa project began in November 2023 and, Quanta Magazine reported, formalised a brand-new proof in three weeks. See the PFR page.[5][15]
    • The Fermat’s Last Theorem project began in December 2023 and contributes its foundations to mathlib. See fermats-last-theorem-formalisation-project.[5][16]

    Lean in software and AI

    Outside mathematics, AWS uses Lean to formally verify Cedar, its authorization policy language. The approach proves security properties of executable models in Lean and validates them against production code through differential testing.[17]

    Lean is also the target language for many AI systems that write proofs. Google DeepMind’s AlphaProof, for example, trains itself to prove statements in Lean.[6] Machine-checkable output matters here because natural-language reasoning can include plausible but wrong steps.[18] One example is an AI-generated Lean proof of Fermat’s Last Theorem that Anthropic announced in September 2026. The company says it runs to 13 million lines, more than five times the size of mathlib.[19] For more, see AI for mathematics.

    Facts about Lean’s history, funding and awards come from the Lean FRO’s own pages; mathlib counts come from mathlib’s statistics page. This page did not independently check any proof.

    Next in the crash course

    More in Mathematics research

    Developing in AI & Computing

    Questions readers ask

    What is Lean?

    An open-source programming language and proof assistant. You write definitions, theorem statements and proofs in it, and Lean checks every step.[1]

    What is mathlib?

    Lean's community library of formalised mathematics. Its developers say it stands out for its dependently typed foundations, its focus on classical mathematics and its distributed organisation.[3]

    How big is mathlib?

    On 22 November 2026 its statistics page listed 142,131 definitions, 296,355 theorems and 772 contributors. The Lean website describes it as over a million lines of formalised mathematics.[4][14]

    Who develops Lean?

    Leonardo de Moura created it in 2013. Since July 2023 the Lean FRO, a non-profit under Convergent Research, has worked on Lean's scalability, usability, documentation and proof automation. mathlib is maintained by its community.[2][9][3]

    Is Lean used outside pure mathematics?

    Yes. AWS uses it to formally verify Cedar, its authorization policy language.[17]

    Sources

    · 19 claims from 8 publishers

    Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.

    1. [1]

      Lean is an open-source programming language and proof assistant. confirmedas of 2026-11-22

    2. [2]

      Leonardo de Moura created Lean in 2013, with the first commit to the Lean repository in July 2013; he had previously worked on automated reasoning at Microsoft Research and SRI International. confirmedas of 2026-11-22

    3. [3]

      Mathlib is a community-driven library of mathematics formalised in Lean, distinguished by its dependently typed foundations, focus on classical mathematics, extensive hierarchy of structures and distributed organisation. reportedas of 2019-12-16

    4. [4]

      On 22 November 2026, mathlib's statistics page listed 142,131 definitions, 296,355 theorems and 772 contributors. confirmedas of 2026-11-22

      • Mathlib statistics · Lean prover community (mathlib) · Primary source · Counts (retrieved 2026-11-22)
    5. [5]

      The Lean FRO's history records the Liquid Tensor Experiment as completed in July 2021, the Polynomial Freiman-Ruzsa project as established in November 2023 and the Fermat's Last Theorem project as established in December 2023. confirmedas of 2026-11-22

    6. [6]

      Google DeepMind describes AlphaProof as a system that trains itself to prove mathematical statements in the formal language Lean, coupling a pre-trained language model with the AlphaZero reinforcement learning algorithm. confirmedas of 2024-07-25

    7. [7]

      Lean's developers say its minimal trusted kernel is what guarantees the correctness of proofs it checks. confirmedas of 2026-11-22

    8. [8]

      Lean 3.0 was released in January 2017, development of Lean 4 began in April 2018, and Lean 4.0 was officially released in September 2023. confirmedas of 2026-11-22

    9. [9]

      The Lean Focused Research Organization (Lean FRO), formed in July 2023 as a non-profit under Convergent Research, works on Lean's scalability, usability, documentation and proof automation. confirmedas of 2026-11-22

    10. [10]

      The Lean FRO lists its funders and supporters as including Alex Gerko, the Alfred P. Sloan Foundation, the Richard Merkin Foundation, Simons Foundation International and Convergent Research. confirmedas of 2026-11-22

    11. [11]

      Lean received the 2025 ACM SIGPLAN Programming Languages Software Award, and the 2025 Skolem Award for the 2015 CADE paper describing it. confirmedas of 2026-11-22

    12. [12]

      The original mathlib library (for Lean 3) was created in July 2017, and the Lean community completed its port to Lean 4 in July 2023. confirmedas of 2026-11-22

    13. [13]

      The mathlib4 repository on GitHub, described as the math library of Lean 4, was created in May 2021 and is licensed under Apache 2.0. confirmedas of 2026-11-22

    14. [14]

      The Lean website describes mathlib as containing over a million lines of formalised mathematics spanning algebra, analysis, topology, probability and computer science. confirmedas of 2026-11-22

    15. [15]

      Quanta Magazine reported that the collaborative Lean formalisation of the PFR proof took three weeks, and that on 5 December 2023 Tao announced that Lean had verified the proof with no remaining "sorry" placeholders. reportedas of 2023-12-06

    16. [16]

      The FLT project contributes the foundational theories it needs to mathlib, Lean's mathematics library. confirmedas of 2026-11-22

    17. [17]

      AWS uses Lean to formally verify Cedar, its authorization policy language, by proving security properties of executable models and testing them against production code. confirmedas of 2026-11-22

    18. [18]

      Google DeepMind notes that proofs in formal languages can be verified for correctness, whereas natural-language approaches can produce plausible but incorrect reasoning steps. confirmedas of 2024-07-25

    19. [19]

      Anthropic says the proof runs to 13 million lines of Lean, more than five times the size of mathlib, and proves 29,500 intermediate theorems. reportedas of 2026-09-04

    Revision history (1)
    1. Page created.

    Created Nov 22, 2026. Last reviewed by an editor on Nov 22, 2026. Next scheduled review: May 24, 2027.

    Cite this page

    "Lean and mathlib: the proof assistant and its maths library." ContentLora, updated Nov 22, 2026. https://contentlora.com/wiki/lean-and-mathlib

    Spotted an error? Suggest a correction or emailcorrections@contentlora.com.