Lean 4
Open-source programming language and proof assistant for writing formally verified software and mathematics.
At a Glance
Lean 4 core programming language and theorem prover, licensed under Apache License 2.0 (OSI-approved) and free to use, modify and distribute.
Engagement
Available On
Listed Dec 2026
About Lean 4
Lean 4 is an open-source programming language and proof assistant developed by the Lean FRO and the Lean community. It lets users write programs and mathematical proofs in the same language, with a small trusted kernel checking every proof. The latest GitHub release listed is v4.36.0, published 2026-11-16.
What It Is
Lean is both a general-purpose functional programming language and a theorem prover based on dependent type theory. Users write definitions, specifications and tactic-based proofs, and Lean tracks the remaining goals as the proof is built. The FAQ says Lean compiles ahead of time to native code, so verified programs can run as native binaries.
How Verification Works
Proof scripts and tactics produce explicit proof terms, which are passed to a small trusted kernel for checking. Proofs can also be exported and checked by independent checkers, such as the Rust-based Nanoda. Automation includes the grind tactic, which implements SMT-like reasoning inside Lean, and bv_decide for bitvector equations. Metaprogramming lets users add notations and new proof automation.
Use Cases and Ecosystem
The site lists use cases across mathematics and software verification:
- Mathlib, the community mathematics library.
- Aeneas, for verifying Rust programs.
- Cedar, the AWS authorization policy language, which AWS verifies with Lean.
- Tau Ceti and the Fermat's Last Theorem formalization project.
Supporting tools include an online Playground, the Reservoir package index, Loogle search, Verso, a VS Code extension, and documentation such as the language reference and the Theorem Proving in Lean and Functional Programming in Lean books.
Security Considerations
The FAQ warns that building a Lean project, opening a Lean file or running lake update can execute arbitrary code from the project or its dependencies. It recommends an isolated environment, such as a virtual machine, for untrusted code.
Collections
Popular collections
- Obsidian Agentic & AI plugins
Collection by @samofcode
- Codebase Context Generators
Collection by @joemseifi
- Frameworks
Collection by @joemseifi
- Let Your Agents Talk to Each Other
Collection by @leftchannel
Add Lean 4 to one of your collections.
Community Discussions
Be the first to start a conversation about Lean 4
Share your experience with Lean 4, ask questions, or help others learn from your insights.
Pricing
Open Source
Lean 4 core programming language and theorem prover, licensed under Apache License 2.0 (OSI-approved) and free to use, modify and distribute.
- Apache License 2.0
- Open-source programming language and proof assistant
- Source code available on GitHub
- Perpetual, worldwide, no-charge, royalty-free license
Capabilities
Key Features
- Dependently typed functional programming language
- Interactive theorem proving with tactics
- Small trusted proof kernel
- grind tactic with SMT-like reasoning
- bv_decide for bitvector equations
- Metaprogramming and extensible notation
- Native code compilation
- Infoview with live goal display
- Independent proof checking via exported proof objects
- Online Playground
- Reservoir package index
