A user-maintained library for the Lean theorem prover with mathematics, programming infrastructure, and supporting tactics.
Overview
Mathlib is the community mathematics library for the Lean 4 proof assistant. It combines formalized mathematics with programming utilities and tactics that help develop and maintain those results.
You can install Lean, mathlib, and related tools from project documentation, open a hosted codespace, or add mathlib4 as a dependency in your own Lean project. A tutorial project is suggested for newcomers.
Documentation includes auto-generated API docs from Lean sources, overview material for mathematicians, and community discussion channels. Maintainers organize work across algebra, analysis, topology, category theory, and related areas.
Cached build artifacts can be fetched to avoid long local compiles. HTML documentation is produced through a separate docs repository that can also be built locally.
Key features
- Formalized mathematics for Lean 4
- Tactics for proof development
- Programming infrastructure
- Dependency use via Lake
- Cached precompiled artifacts
- Generated API documentation
Use cases
- Formalizing math in Lean 4
- Lean coursework and tutorials
- Building on community lemmas
- Proof engineering projects