Freedom251 › Formal Verification Tools
Lean

What Lean is
Lean is a free, open-source programming language and proof assistant for formal mathematics, software verification and general coding. Its minimal trusted kernel checks proofs, and the official site describes it as guaranteeing correctness in mathematical, software and hardware verification. Lean 4 projects use Lake, the bundled package manager. The Grind tool automates some pattern matching, case analysis and systems of linear inequalities, while metaprogramming lets users add notation and proof automation. Mathlib, a community-driven library with over a million lines, covers areas including algebra, analysis, topology, probability and computer science. Lean runs on Linux, macOS and Windows, and Lean4Web provides browser-based use. VS Code with the Lean 4 extension is the recommended setup; Neovim with lean.nvim is also well-supported, while VSCodium and Cursor support is described as unofficial. Learning materials include textbooks, tutorials, interactive games, documentation and an API reference. The project was created by Leonardo de Moura in 2013; the Lean FRO formed as a nonprofit in July 2023. Lean is released under the Apache 2.0 license.
Who it suits
Lean suits programmers, mathematicians and theorem provers who want to formalize mathematics or verify software. It can also be used for general coding.
What it does well
- Free and open source under Apache 2.0.
- Mathlib contains over a million lines.
- Lake manages Lean projects.
- Lean4Web runs Lean code in a browser.
- Learning resources include tutorials and interactive games.
What to know first
- VSCodium and Cursor support is unofficial.
- x86-64 macOS and WebAssembly are Tier 2 platforms.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| Lean 4 | Open-source programming language and proof assistant · no paid plans stated | Free |
As lean-lang.org lists them, read 9 Oct 2026. The maker's own page has the final word.
Getting started
- Open the Lean website and choose a learning resource suited to your background.
- Install Lean and use the recommended VS Code setup with the Lean 4 extension.
- Initialize and manage a project with Lake.
- Alternatively, use Lean4Web to run Lean code in a browser.
- Use Mathlib for community-maintained formalized mathematics.
Lean is a programming language and proof assistant for people who need to formalize mathematics or verify software. It is strongest for mathematicians, theorem provers and developers prepared to work with proof tooling; its formal methods focus is a poor fit for ordinary coding without verification needs.
Overview
Lean brings functional programming and theorem proving into one environment, allowing users to write code and formalize mathematical claims. Its minimal trusted kernel checks proofs, supporting correctness arguments in mathematics, software verification and hardware verification. That makes it a considered choice when correctness needs a formal basis, rather than a substitute for a general-purpose language when conventional development is enough.
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.
Key features
Mathlib, a community-driven library of more than a million lines, covers algebra, analysis, topology, probability and computer science. That breadth gives formalization work a substantial foundation, especially in mathematics, though its benefit depends on the subject area and willingness to work in Lean.
The Grind tool automates complex pattern matching, case analysis and systems of linear inequalities, which can reduce repetitive proof work. Metaprogramming lets users add domain-specific notation and proof automation, making Lean adaptable for specialized work but placing more responsibility on users to build what they need.
Projects are initialized and managed with Lake, bundled with Lean. The recommended VS Code setup and Lean 4 extension provide syntax highlighting and code completion. Neovim with lean.nvim is also well-supported, while VSCodium and Cursor support is unofficial. These editor options offer flexibility, but the recommended path is clearest for users comfortable with VS Code.
Lean4Web runs Lean code in a browser, providing a way to work without a local installation. Learning materials include textbooks, tutorials, interactive games, core documentation and an API reference. The Lean Community Zulip is the central place for questions and collaboration, and Lean FRO hosts weekly technical office hours.
Lean is used in a security context: AWS uses it to formally verify Cedar, an authorization policy language, proving security properties and validating them against production code through differential testing. This is a concrete example of verification work, not a promise that Lean automatically secures arbitrary software.
Pricing
Lean 4 costs nothing. It is open-source software under Apache 2.0, with no paid plans stated and no free trial. The free plan is the product itself, rather than a capped tier, making it suitable for individual learning, research and formalization without a subscription decision.
Its price removes a financial barrier, not the learning and proof-work investment. There are no paid plans to choose for additional capabilities.
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 browser option is useful for trying Lean code, while users choosing a local setup should note the distinction between Tier 1 and Tier 2 support.
Who it's for
Lean is a strong fit for mathematicians formalizing results, theorem provers, and programmers building or checking code where formal verification matters. Its learning page separates core resources for programmers, theorem provers and mathematicians, reflecting that each group approaches the language differently. Developers seeking a conventional coding environment without proof obligations should look elsewhere.
Pros and cons
- Pro: The trusted kernel checks proofs, giving formal correctness work a clear foundation.
- Pro: Mathlib’s breadth offers substantial reusable formalized mathematics across several disciplines.
- Pro: Open-source access at no cost avoids plan caps and subscription costs.
- Con: Formalization and proof tooling make Lean specialized; users who do not need proofs may find its core strengths beside the point.
- Con: Some macOS and browser-target support is Tier 2, so platform support is not uniform.
- Con: VSCodium and Cursor support is unofficial, making them less assured choices than the recommended VS Code setup.
Alternatives
Choose Rocq if you want a free interactive theorem prover and dependently typed programming language with broader listed platform coverage, including extensions.
Z3 is a free alternative if you need an MIT-licensed solver, with Android, API and self-hosted options among its listed platforms. Boogie is another free choice for users who can work with its .NET and supported SMT-solver requirements.
cvc5 suits readers seeking a free open-source solver; optional GPL-licensed dependencies affect the license of the combined work. HOL4 is a free choice under the Modified (3-clause) BSD licence.
PVS offers a free noncommercial plan, while commercial use has custom pricing; its Allegro runtime requires accepting a click-through license. Why3 is a free option under the GNU Lesser General Public License version 2.1 with a special linking exception. Alloy Analyzer is a free, open-source project distributed as a self-contained executable.
See Formal Verification Tools for more options.
Verdict
Choose Lean if you are a mathematician, theorem prover or developer who wants machine-checked proofs, a trusted kernel and a substantial mathematical library without a license fee. Its combination of formalization and general coding is compelling for verification-led work; if you mainly need a conventional programming language or a different kind of solver, a more focused alternative may suit you better.
Verdict
Lean combines general programming with formal proof work and a substantial community mathematical library. It is a focused choice for people willing to work with formalization and proof tooling.
Questions
How much does Lean cost?
Lean is free and open source, with no paid plans stated.
Which operating systems does Lean support?
Lean lists Linux, macOS, Windows, and web access. Linux, Apple Silicon macOS, and x86-64 Windows are Tier 1; x86-64 macOS and Emscripten WebAssembly are Tier 2.
Can Lean be used in a browser?
Yes. Lean4Web is a web-based version for running Lean code in a browser.
Which editors can I use?
The recommended setup is VS Code with the Lean 4 extension. Neovim with lean.nvim is well-supported; VSCodium and Cursor support is described as unofficial.
Is Lean open source?
Yes. Lean is released under the Apache 2.0 license.
Who created Lean?
Leonardo de Moura created Lean in 2013. The Lean FRO formed as a nonprofit in July 2023.
Facts from Lean's own pages
- Automation
- The site highlights the Grind tactic for handling pattern matching and case analysis and solving systems of linear inequalities. · lean-lang.org, 9 Oct 2026
- Browser use
- The learning page links to Lean4Web, described as a web-based version that runs Lean code in a browser. · lean-lang.org, 8 Oct 2026
- Editor integration
- The recommended setup uses VS Code and the official Lean 4 extension, which provides syntax highlighting and code completion. · lean-lang.org, 9 Oct 2026
- Extensibility
- Lean's metaprogramming capabilities let users add domain-specific notation and proof automation. · lean-lang.org, 9 Oct 2026
- Founded
- 2013 · lean-lang.org, 28 Sept 2026
- Learning resources
- The learning page links to textbooks, tutorials, interactive games, core documentation, and an API reference. · lean-lang.org, 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. · lean-lang.org, 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. · lean-lang.org, 9 Oct 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. · lean-lang.org, 9 Oct 2026
- Math and verification
- Lean is built for formalizing mathematics and formal verification, and is flexible enough for general coding. · lean-lang.org, 9 Oct 2026
- Mathematical library
- Mathlib is a community-driven library containing over a million lines of formalized mathematics. · lean-lang.org, 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. · lean-lang.org, 9 Oct 2026
- Package manager
- Lean projects are initialized and managed with Lake, the package manager bundled with Lean. · lean-lang.org, 8 Oct 2026
- Platforms
- The reference lists Linux, macOS, and Windows among Lean’s supported platforms, with Tier 1 binary releases available through elan. · lean-lang.org, 8 Oct 2026
- Proof checking
- Lean's minimal trusted kernel is described as guaranteeing correctness in mathematical proof, software verification, and hardware verification. · lean-lang.org, 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. · lean-lang.org, 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. · lean-lang.org, 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. · lean-lang.org, 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. · lean-lang.org, 9 Oct 2026
- Trusted kernel
- The official site says Lean’s minimal trusted kernel guarantees correctness in mathematical proof, software verification, and hardware verification. · lean-lang.org, 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. · lean-lang.org, 8 Oct 2026
- What it does
- Lean is an open-source programming language and proof assistant for writing correct, maintainable, formally verified code. · lean-lang.org, 9 Oct 2026
- What it is
- Lean is an open-source programming language and proof assistant for correct, maintainable, and formally verified code. · lean-lang.org, 8 Oct 2026
- Who it is for
- The Learn page recommends separate core resources for programmers, theorem provers, and mathematicians learning formalization. · lean-lang.org, 9 Oct 2026
Where Lean stands on Freedom251
- Formal Verification Tools#11 of 34
