# Mathlib

The math library of Lean 4

Repository: https://github.com/leanprover-community/mathlib4
Canonical: https://ross.abutalabs.com/products/mathlib
Homepage: https://leanprover-community.github.io/mathlib4_docs
Language: Lean
License: Apache-2.0
License Family: permissive
Topics: lean4
Last push: 2026-08-26T22:49:27+00:00
Link (homepage): https://leanprover-community.github.io/mathlib4_docs

## Health v2 (maintenance only)
Score: 99/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 98, longevity 100
- inputs: {"age_days": 1942, "days_push": 7, "days_rel": 12, "gap_med": 15.0, "n_releases_24m": 9}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3948, forks 1622 (observed 2026-08-28T04:08:30.301611+00:00)

## What it is
Mathlib is the community-maintained mathematics library for the Lean 4 theorem prover, containing formalized mathematical theories, tactics, and programming infrastructure. It is one of the largest collections of formalized mathematics, actively developed with frequent releases.

## Use cases
- formalize mathematical proofs in Lean 4
- use verified mathematical definitions and theorems in Lean projects
- learn interactive theorem proving with a tutorial project
- develop custom proof tactics on top of a large math infrastructure
- check research-level mathematics for correctness

## When to choose
- you are writing Lean 4 proofs and need standard mathematical libraries
- you want to contribute to or build on the largest formalized math repository
- you need verified tactics and infrastructure for theorem proving

## When to avoid
- you need a numeric computation library like NumPy rather than formal proofs
- you work in Lean 3 and have not migrated to Lean 4
- you want a CAS (computer algebra system) for symbolic computation rather than proof verification

## Facets
- artifact type: library
- maturity: active
- function: math, programming-language, developer-tools
- domain: mathematics, programming-languages, education
- platform: cross-platform, cli
- tags: lean4, theorem-proving, formal-methods, proof-assistant, formalized-mathematics, algorithms

## Member repositories
- leanprover-community/mathlib4 (main) score 99
- leanprover-community/mathlib3 (mirror) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:30.301611+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:24:33.557033+00:00, confidence not recorded.
  - readme: https://github.com/leanprover-community/mathlib4 (fetched 2026-08-28T04:08:30.301611+00:00, sha 7c67e2915209)
  - homepage: https://leanprover-community.github.io/mathlib4_docs (fetched 2026-08-29T09:18:05.655858+00:00, sha 57c55c33a18f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
