
Lean
Lean is a free, open-source programming language and proof assistant for formalizing mathematics, verifying software, and writing general-purpose code.
What Lean is
Lean is a free, open-source programming language and proof assistant for formalizing mathematics, verifying software, and writing general-purpose code. It uses Lean 4 as its input language, and projects are initialized and managed with Lake, the package manager bundled with Lean. Lean’s minimal trusted kernel is described as guaranteeing correctness in mathematical proof, software verification, and hardware verification. Its Grind tool automates some complex pattern matching, case analysis, and systems of linear inequalities; metaprogramming lets users add domain-specific notation and proof automation. Mathlib is a community-driven mathematical library with over a million lines spanning algebra, analysis, topology, probability, and computer science. The learning page links to Lean4Web, a web-based version that runs code in a browser. The recommended installation uses VS Code with the Lean 4 extension for syntax highlighting and code completion; Neovim with lean.nvim is well-supported, while VSCodium and Cursor support is unofficial. Lean supports Linux, macOS, Windows, and web use. Learning resources include textbooks, tutorials, interactive games, documentation, and an API reference. Lean was created by Leonardo de Moura in 2013, and the Lean FRO formed in July 2023 as a nonprofit under Convergent Research.
Good
- Free and open source under the Apache 2.0 license
- Lake manages Lean projects
- Mathlib spans several areas of mathematics
- Lean4Web runs code in a browser
- VS Code extension provides syntax highlighting and code completion
Watch out
- VSCodium and Cursor support is unofficial
- Tier 2 support includes x86-64 macOS and Emscripten WebAssembly
Who it suits
Lean suits programmers, theorem provers, and mathematicians working with formalization, proof checking, or software verification. Its general coding capability and browser version may also suit users exploring Lean before choosing a local setup.
Verdict
Lean brings programming and deductive proof work together, with a trusted kernel, extensible automation, and a substantial mathematical library. Its learning resources and editor options offer several ways to approach the language.
Plans and prices
From Lean's own pricing page, checked 9 Oct 2026.
| Plan | Price | What it gives you |
|---|---|---|
| Lean 4 | Free | Open-source programming language and proof assistant · no paid plans stated |
The facts
Each one read from Lean's own pages, with the date it was checked.
What it does
- Automation
- The site highlights the Grind tactic for handling pattern matching and case analysis and solving systems of linear inequalities.checked 9 Oct 2026
- Editor integration
- The recommended setup uses VS Code and the official Lean 4 extension, which provides syntax highlighting and code completion.checked 9 Oct 2026
- Extensibility
- Lean's metaprogramming capabilities let users add domain-specific notation and proof automation.checked 9 Oct 2026
- Learning resources
- The learning page links to textbooks, tutorials, interactive games, core documentation, and an API reference.checked 8 Oct 2026
- Libraries
- The official site describes Mathlib as a community-driven mathematical library with over a million lines spanning algebra, analysis, topology, probability, and computer science.checked 8 Oct 2026
- License
- Lean is released under the Apache 2.0 license, which the documentation describes as allowing others to use and extend the code and mathematical libraries freely.checked 9 Oct 2026
- Math and verification
- Lean is built for formalizing mathematics and formal verification, and is flexible enough for general coding.checked 9 Oct 2026
- Mathematical library
- Mathlib is a community-driven library containing over a million lines of formalized mathematics.checked 9 Oct 2026
- Other editors
- The manual installation guide says Neovim with lean.nvim is well-supported and describes VSCodium and Cursor support as unofficial.checked 9 Oct 2026
- Package manager
- Lean projects are initialized and managed with Lake, the package manager bundled with Lean.checked 8 Oct 2026
- Proof checking
- Lean's minimal trusted kernel is described as guaranteeing correctness in mathematical proof, software verification, and hardware verification.checked 9 Oct 2026
- Security and trust
- The Lean FRO privacy policy says it collects communication information when users contact it and describes practices for transferring, retaining, and protecting personal information.checked 9 Oct 2026
- Security example
- The site says AWS uses Lean to formally verify Cedar, an authorization policy language, by proving security properties and validating them against production code through differential testing.checked 8 Oct 2026
- Support
- The Lean Community Zulip is described as the central hub for questions and collaboration, and Lean FRO hosts weekly technical office hours.checked 9 Oct 2026
- Supported systems
- Tier 1 platforms include Linux, Apple Silicon macOS, and x86-64 Windows; x86-64 macOS and Emscripten WebAssembly are Tier 2.checked 9 Oct 2026
- Trusted kernel
- The official site says Lean’s minimal trusted kernel guarantees correctness in mathematical proof, software verification, and hardware verification.checked 8 Oct 2026
- Uses
- Lean is a functional programming language and theorem prover built for formalizing mathematics and formal verification, and it can also be used for general coding.checked 8 Oct 2026
- What it does
- Lean is an open-source programming language and proof assistant for writing correct, maintainable, formally verified code.checked 9 Oct 2026
- What it is
- Lean is an open-source programming language and proof assistant for correct, maintainable, and formally verified code.checked 8 Oct 2026
- Who it is for
- The Learn page recommends separate core resources for programmers, theorem provers, and mathematicians learning formalization.checked 9 Oct 2026
Where it runs
- Browser use
- The learning page links to Lean4Web, described as a web-based version that runs Lean code in a browser.checked 8 Oct 2026
- Platforms
- The reference lists Linux, macOS, and Windows among Lean’s supported platforms, with Tier 1 binary releases available through elan.checked 8 Oct 2026
The company
- Founded
- 2013checked 28 Sep 2026
- Maker
- The Lean FRO says Leonardo de Moura created Lean in 2013 and that the FRO formed in July 2023 as a nonprofit under Convergent Research.checked 9 Oct 2026
The full review of Lean
Lean pairs functional programming with theorem proving, for work where correctness must be established formally. It is best suited to mathematicians, theorem provers and programmers tackling verification; its trusted kernel and broad mathematical library are compelling strengths, but the formal-proof focus makes it a specialist choice.
Overview
Lean lets users write programs and formalize mathematics in the same language, then check proofs through a minimal trusted kernel. That foundation is intended to support correctness claims in mathematics and software and hardware verification. It is valuable when a proof needs to be machine-checked, but formalization demands a different kind of work from relying on conventional testing alone.
Created by Leonardo de Moura in 2013, Lean is open source under Apache 2.0. The Lean FRO became a nonprofit under Convergent Research in July 2023. The license allows others to use and extend Lean and its mathematical libraries.
Key features
Mathlib is a community-driven library of more than a million lines, spanning algebra, analysis, topology, probability and computer science. Its breadth gives formalization work substantial material to build on, though its value is greatest for users working in areas it covers.
Lean’s Grind tool automates complex pattern matching, case analysis and systems of linear inequalities. This can reduce repetitive proof work, while metaprogramming lets experienced users add domain-specific notation and automation. Those extension options make Lean adaptable, but are most relevant to users prepared to work with its programming and proof concepts.
Lean projects are managed with Lake, the bundled package manager. The recommended setup uses VS Code and the Lean 4 extension for syntax highlighting and code completion. Neovim with lean.nvim is also well-supported; VSCodium and Cursor support is unofficial. Lean4Web runs Lean code in a browser, offering a way to work without a local editor setup.
Learning resources include textbooks, tutorials, interactive games, core documentation and an API reference. Separate core resources serve programmers, theorem provers and mathematicians learning formalization, giving newcomers different entry points rather than a single route.
A concrete security application comes from AWS, which uses Lean to formally verify Cedar, an authorization policy language, proving security properties and validating them against production code through differential testing.
Pricing
Lean 4 costs nothing. It is open-source software with no paid plans or free trial. That makes it accessible for individual learning and formalization without a subscription; its free model does not change the specialist skills needed to use it effectively.
Platforms
Lean supports Linux, macOS, Windows and web use. Linux, Apple Silicon macOS and x86-64 Windows are Tier 1; x86-64 macOS and Emscripten WebAssembly are Tier 2. The distinction matters when choosing a machine: users on Tier 1 systems have the primary supported targets, while the other listed configurations are Tier 2.
Who it's for
Lean is a strong fit for mathematicians formalizing results, theorem provers building checked proofs, and programmers working on code whose correctness needs a formal argument. Its general-programming flexibility is useful, but it is not the natural choice for routine application development where formal verification is not a goal.
Questions and collaboration are centered in the Lean Community Zulip, and Lean FRO hosts weekly technical office hours. The privacy policy describes collection of communications when users contact the organization and its practices for transferring, retaining and protecting personal information.
Pros and cons
- Pros: A minimal trusted kernel underpins proof checking, making Lean suited to correctness-sensitive mathematical and verification work.
- Pros: Mathlib’s breadth and Lean’s automation and extension mechanisms offer a substantial foundation for formalization.
- Pros: It is free and open source, with editor options, browser access and learning materials for different audiences.
- Cons: Formal proof work is a specialized approach, so Lean is less suitable when ordinary programming without proof obligations is the priority.
- Cons: Support tiers vary by platform, and VSCodium and Cursor support is explicitly unofficial.
Alternatives
For another free interactive theorem prover and dependently typed programming language, consider Rocq. PVS may suit readers comparing a free noncommercial option with a commercial-use plan at custom pricing. Choose Z3 when its free MIT-licensed downloads and source code fit the need. HOL4 is another free option, distributed under a modified three-clause BSD license; Isabelle is also free and uses open-source licenses, with its main code base under BSD-style regulations. SPIN offers free source and executables under BSD 3-Clause. UPPAAL has a free academic license for eligible non-commercial use. Alloy Analyzer is a free open-source project with a self-contained executable. See the Formal Verification Tools directory to compare options across the category.
Verdict
Choose Lean if you need a free, extensible language for formal mathematics or verification and want a trusted proof-checking kernel backed by a large library. Look elsewhere if formal proofs are not central to your work or your platform falls outside Lean’s Tier 1 targets and you need primary-tier support.
Getting started
- Visit the Lean website.
- Choose a supported system: Linux, macOS, Windows, or the browser through Lean4Web.
- For the recommended editor setup, install VS Code and its Lean 4 extension.
- Initialize and manage Lean projects with Lake.
- Use the linked textbooks, tutorials, interactive games, documentation, or API reference to learn.
Questions
How much does Lean cost?
Lean is free, with no paid plans stated.
Is Lean open source?
Yes. Lean is released under the Apache 2.0 license.
What platforms does Lean support?
It supports Linux, macOS, Windows, and browser use through Lean4Web.
Which editors can I use?
VS Code with the Lean 4 extension is recommended, and Neovim with lean.nvim is well-supported. VSCodium and Cursor support is described as unofficial.
Who created Lean?
Lean was created by Leonardo de Moura in 2013. The Lean FRO formed in July 2023 as a nonprofit under Convergent Research.
What does Mathlib provide?
Mathlib is a community-driven mathematical library with over a million lines spanning areas such as algebra, analysis, topology, probability, and computer science.


