Lean
by Lean FRO · Language · also known as Lean 4, Lean theorem prover, Lean prover
Open-source functional programming language and interactive theorem prover with dependent types, the Mathlib mathematics library and VS Code tooling, stewarded by the Lean FRO
Overview
Lean is an open-source programming language and proof assistant whose dependent type system lets users state mathematical theorems or software specifications and check proofs mechanically. Lean 4, released under the Apache 2.0 license, compiles to native code and is developed with support from the Lean Focused Research Organization (Lean FRO), which funds core development, documentation and community infrastructure. The community-maintained Mathlib library formalizes a large body of undergraduate and research mathematics across algebra, analysis, topology, probability and computer science, and tools such as Loogle (search), Verso (documentation) and the VS Code extension with live goal display make interactive proving practical.
Lean is used by mathematicians formalizing results, by computer scientists verifying programs and increasingly as a target for AI systems that generate machine-checkable proofs. It runs on Linux, macOS and Windows and is installed through the elan toolchain manager, with Lake as the build system. The learning curve is steep, Mathlib's conventions take time to absorb, and formalization of a new result typically takes much longer than the informal proof, so it suits projects where machine-checked certainty is worth the cost.
Capabilities
- Dependent type theory for theorems and specifications
- Interactive proving with live goal display in VS Code
- Mathlib library of formalized mathematics
- Compilation of Lean programs to native code
- Lake build system and elan toolchain manager
- Metaprogramming and tactic framework
- Search (Loogle) and documentation (Verso) tooling
Typical workflows
- Formalizing a theorem against Mathlib
- Verifying properties of an algorithm
- Checking AI-generated proofs mechanically
Strengths
- Apache-2.0 open source with dedicated FRO support
- Largest active formal mathematics library
- Serves as both language and prover
Limitations
- Steep learning curve
- Formalization is slow relative to informal proof
- Smaller general-purpose software ecosystem than mainstream languages
Prerequisites
- elan toolchain installer
- VS Code with the Lean 4 extension (recommended)
Who it is for
- Mathematicians formalizing results
- Researchers in verification and AI for math
- Students of type theory
Alternatives & comparison
SymPy and Mathematica compute with symbolic expressions but do not produce machine-checked proofs; Coq, Isabelle and Agda (not recorded) are the closest proof-assistant peers. Rust and Julia are general-purpose languages without dependent types.
- Julia
Dynamically typed, JIT-compiled language for numerical and scientific computing that aims to combine high-level syntax with compiled-code speed
Open sourceOpen source - Rust
Compiled systems programming language with ownership-based memory safety, the Cargo build tool and no garbage collector
Open sourceOpen source - SymPy
Pure-Python computer algebra system for symbolic algebra, calculus, equation solving, matrices, physics modules, code generation and LaTeX output
Open sourceFree - Wolfram Mathematica
Wolfram Research's proprietary technical computing system built on the Wolfram Language, with notebooks, symbolic and numeric computation, visualization, machine learning and curated data
ProprietaryPaid
Sources & verification
Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.
- Licenselean4 LICENSEchecked Nov 1, 2026
https://github.com/leanprover/lean4/blob/master/LICENSE
Supports: license_spdx, source_model
- Official sitechecked Nov 1, 2026
- Repositorychecked Nov 1, 2026
- Repositorychecked Nov 1, 2026
- Confidence
- High
- Reviewed
- Nov 1, 2026
- Links
- Verified · Nov 2, 2026
Spotted an error?
More in Mathematical & statistical computing
pandas
pandas development team (NumFOCUS) · DataFrames & array computing
The standard Python DataFrame library for labeled tabular data, time series and I/O to CSV, Excel, SQL, Parquet and more
Python
Python Software Foundation · Programming languages & runtimes
General-purpose, dynamically typed programming language with a large standard library and the dominant ecosystem for data science and machine learning
QuantLib
QuantLib project (Luigi Ballabio and contributors) · Financial analysis & investing
Open-source C++ library for quantitative finance covering instruments, term structures, pricing engines and calendars, with Python and other bindings
statsmodels
statsmodels developers (NumFOCUS) · Econometrics & causal inference
Python library for estimating statistical and econometric models with R-style formulas, rich result summaries and tests: OLS, GLM, discrete choice, ARIMA, state space, VAR and more
Stata
StataCorp LLC · Mathematical & statistical computing
Commercial statistical software from StataCorp widely used in economics and social science, with editions BE/SE/MP, a command language, Mata and comprehensive PDF manuals
Positron
Posit Software, PBC · Mathematical & statistical computing
Posit's multi-language data-science IDE built on Code OSS, with first-class R and Python consoles, variables and plots panes, under the Elastic License 2.0