Lean
lean-lang.org
What it is
Lean is an open-source programming language and proof assistant for formalizing mathematics, verifying software, and writing general code. Its minimal trusted kernel checks proofs, and the project describes it as supporting correctness in mathematical, software, and hardware verification. Lean includes the Grind tool for automating some pattern matching, case analysis, and systems of linear inequalities; metaprogramming lets users add notation and proof automation. Projects are managed with Lake, the package manager bundled with Lean. Mathlib is a community-driven library with over a million lines spanning areas including algebra, analysis, topology, probability, and computer science. The recommended setup uses VS Code with the Lean 4 extension for syntax highlighting and code completion, while Neovim with lean.nvim is also well-supported. Lean runs on Linux, macOS, and Windows, and Lean4Web lets users run code in a browser. The software is free under the Apache 2.0 license. Learning resources include textbooks, tutorials, interactive games, documentation, and an API reference.
Spec sheet
- What it does
- Lean is an open-source programming language and proof assistant for writing correct, maintainable, formally verified code.Read 9 Oct 2026 · lean-lang.org
- Platforms
- The reference lists Linux, macOS, and Windows among Lean’s supported platforms, with Tier 1 binary releases available through elan.Read 8 Oct 2026 · lean-lang.org
- Support
- The Lean Community Zulip is described as the central hub for questions and collaboration, and Lean FRO hosts weekly technical office hours.Read 9 Oct 2026 · lean-lang.org
- 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.Read 9 Oct 2026 · lean-lang.org
- Founded
- 2013Read 28 Sep 2026 · lean-lang.org
- 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.Read 9 Oct 2026 · lean-lang.org
- Automation
- The site highlights the Grind tactic for handling pattern matching and case analysis and solving systems of linear inequalities.Read 9 Oct 2026 · lean-lang.org
- Browser use
- The learning page links to Lean4Web, described as a web-based version that runs Lean code in a browser.Read 8 Oct 2026 · lean-lang.org
- Editor integration
- The recommended setup uses VS Code and the official Lean 4 extension, which provides syntax highlighting and code completion.Read 9 Oct 2026 · lean-lang.org
- Extensibility
- Lean's metaprogramming capabilities let users add domain-specific notation and proof automation.Read 9 Oct 2026 · lean-lang.org
- Learning resources
- The learning page links to textbooks, tutorials, interactive games, core documentation, and an API reference.Read 8 Oct 2026 · lean-lang.org
- 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.Read 8 Oct 2026 · lean-lang.org
- Math and verification
- Lean is built for formalizing mathematics and formal verification, and is flexible enough for general coding.Read 9 Oct 2026 · lean-lang.org
- Mathematical library
- Mathlib is a community-driven library containing over a million lines of formalized mathematics.Read 9 Oct 2026 · lean-lang.org
- Other editors
- The manual installation guide says Neovim with lean.nvim is well-supported and describes VSCodium and Cursor support as unofficial.Read 9 Oct 2026 · lean-lang.org
- Package manager
- Lean projects are initialized and managed with Lake, the package manager bundled with Lean.Read 8 Oct 2026 · lean-lang.org
- Proof checking
- Lean's minimal trusted kernel is described as guaranteeing correctness in mathematical proof, software verification, and hardware verification.Read 9 Oct 2026 · lean-lang.org
- 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.Read 9 Oct 2026 · lean-lang.org
- 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.Read 8 Oct 2026 · lean-lang.org
- Supported systems
- Tier 1 platforms include Linux, Apple Silicon macOS, and x86-64 Windows; x86-64 macOS and Emscripten WebAssembly are Tier 2.Read 9 Oct 2026 · lean-lang.org
- Trusted kernel
- The official site says Lean’s minimal trusted kernel guarantees correctness in mathematical proof, software verification, and hardware verification.Read 8 Oct 2026 · lean-lang.org
- 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.Read 8 Oct 2026 · lean-lang.org
- What it is
- Lean is an open-source programming language and proof assistant for correct, maintainable, and formally verified code.Read 8 Oct 2026 · lean-lang.org
- Who it is for
- The Learn page recommends separate core resources for programmers, theorem provers, and mathematicians learning formalization.Read 9 Oct 2026 · lean-lang.org
Plans and prices
Strong points and limits
Strong points
- Free and open source under Apache 2.0
- Supports mathematical, software, and hardware verification
- Mathlib has over a million lines
- Lake manages Lean projects
- Browser use is available through Lean4Web
Limits
- VSCodium and Cursor support is unofficial
- x86-64 macOS and WebAssembly are Tier 2
Who it suits
Lean suits programmers, theorem provers, and mathematicians working on formalization or verification. It can also serve general coding needs, with resources aimed at these different audiences.
Lean in depth
Read the full write-up
Lean is a functional language and proof assistant for work that calls for machine-checked mathematics or verification. It is a strong fit for mathematicians, theorem provers, and developers prepared to formalize correctness; teams seeking a conventional programming environment should look elsewhere.
Overview
Lean brings programming and proof construction into one language, with a small trusted kernel at the center of its correctness claims. That makes it useful when a mathematical result or software property needs a proof the system can check, including work on hardware verification. It is a focused tool: its strengths matter most when formal assurance is part of the goal.
Created by Leonardo de Moura in 2013, Lean is maintained through the Lean FRO, a nonprofit formed under Convergent Research in July 2023. Its Apache 2.0 license permits free use and extension of the language and its mathematical libraries.
Key features
Mathlib contains more than a million lines of community-developed formal mathematics across algebra, analysis, topology, probability, and computer science. That gives formalization projects a substantial base to build on, especially in established areas, though it remains a specialized resource for work expressed in Lean.
Lean's Grind tool can automate involved pattern matching, case analysis, and systems of linear inequalities. This can shorten parts of proof construction, while metaprogramming lets users create domain-specific notation and proof automation. Those extension points reward people with the expertise to shape their own workflows.
Lean projects use 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. For a first experiment, Lean4Web runs Lean code in a browser, and the learning resources include textbooks, tutorials, interactive games, core documentation, and an API reference.
A concrete verification use is AWS's work on Cedar, an authorization policy language: Lean is used to prove security properties and validate them against production code through differential testing. This illustrates a demanding application rather than a turnkey security product.
Pricing
Lean 4 costs nothing. The open-source language and proof assistant has no paid plans or free-trial clock, so individuals and organizations can use the same core software without a seat charge or usage quota stated here. Apache 2.0 also allows users to extend the code and mathematical libraries.
There are no lower tiers that withhold capabilities, but the free software does not include a paid service plan. Readers choosing Lean should weigh setup and formalization effort alongside its zero software price.
Platforms
Lean supports Linux, Apple Silicon macOS, and x86-64 Windows as Tier 1 platforms. x86-64 macOS and Emscripten WebAssembly are Tier 2, so users on those targets should account for their lower support tier. The browser option is useful for trying code, while the recommended desktop workflow centers on VS Code; platform support does not mean every editor has equal standing.
Who it's for
Lean is best for mathematicians formalizing results, theorem provers building machine-checked proofs, and programmers whose verification work justifies a formal language. The learning materials are organized to serve those three audiences, which helps newcomers choose a relevant route. General programmers can also use Lean, but should choose it when proof checking or formalization is a real requirement rather than a side benefit.
For collaboration and questions, the Lean Community Zulip is the central hub, and the Lean FRO hosts weekly technical office hours. These are useful avenues for users learning a specialized system, though they are community support rather than a commercial support plan.
Pros and cons
Pros: A minimal trusted kernel underpins proof checking, giving formal correctness work a clear foundation.
Pros: Mathlib's breadth and Grind's automation can support substantial mathematical formalization and reduce some repetitive proof steps.
Pros: The language, libraries, package manager, and editor integrations are available without a software fee, and projects can be extended through metaprogramming.
Cons: Lean's strongest case depends on willingness to formalize claims, which makes it a poor fit when conventional programming alone will do.
Cons: Users on x86-64 macOS or WebAssembly are on Tier 2, and VSCodium and Cursor support is unofficial.
Cons: The free software has no paid service plan; users seeking commercial support arrangements should account for that distinction.
Alternatives
Formal Verification Tools is the broader category for comparing approaches. Choose PVS if its free noncommercial plan suits the work; commercial users should note that its commercial pricing is not given here. Rocq is another free interactive theorem prover and dependently typed programming language, distributed under the GNU Lesser General Public License.
Pick cvc5 when a free open-source solver better matches the task; optional GPL-licensed dependencies affect the combined work's license. Why3 is a free option under the GNU Lesser General Public License 2.1 with a special linking exception. Z3 offers free MIT-licensed downloads and source code.
Boogie is free under the MIT license and requires.NET and a supported SMT solver. HOL4 is free software under the Modified BSD 3-Clause license. Alloy Analyzer is a free, open-source project distributed as a self-contained executable.
Verdict
Choose Lean if you need machine-checked proofs for mathematics or verification and want a programmable language backed by a large mathematical library. Its zero-cost, extensible toolchain is a persuasive foundation for formal work; look elsewhere if you need ordinary application development without the demands of proof formalization, or require a paid support plan.
Verdict
Lean pairs a proof-checking kernel with programming and metaprogramming tools, backed by a substantial mathematical library. Its editor options and platform tiers are worth considering when choosing a setup.
Where Specifiction places it
- Formal Verification Tools#2 of 358.6