Restated16% 157 of 998 principal statementsChecked4% 6 of 157 restatedScreened29% 20,612 of 70,421 on the dependency pathCompiled47% of 175,187 files, as of 2026-11-20 15:20 EST

The Lean project in numbers

Measurements of the source of the Lean 4 project whose final theorem is the Riemann hypothesis for Dirichlet L-functions.

Size

Files
175,187
Lines
17,374,215
Size
1.03 GB
Declarations
1,061,425
Theorems
818,755
Longest import chain
203

The source is plain Lean with no comments or docstrings. Half of the files have at most 58 lines; 80,084 have fewer than 50, and 323 have more than 1,000. The longest has 17,981 lines.

Against Mathlib

Mathlib, the library the project is built on, is the largest body of formalized mathematics in Lean. The project is 10.6 times its size in bytes.

Files: this project175,187
Files: Mathlib8,311
Lines: this project17,374,215
Lines: Mathlib2,293,877
Size: this project1,031 MB
Size: Mathlib97 MB

What the text consists of

Theorems and lemmas818,755
Definitions and structures234,471
Instances8,199

Measured in characters of declaration text, proofs outweigh statements by about 2.8 to 1. The median theorem has a statement of 168 characters and a proof of 266.

Theorem proofs565 M chars
Theorem statements203 M chars
Definition bodies60 M chars
Definition signatures17 M chars

A statement is taken to end at the first :=, so the split is approximate.

Length of proofs

up to 100 characters178,950
101 to 300 characters257,270
301 to 1,000 characters223,711
1,001 to 3,000 characters122,633
3,001 to 10,000 characters35,233
over 10,000 characters958

The longest proof runs to 30,858 characters, in the part of the project that proves resolution of singularities.

Libraries

LibraryFilesMBTheoremsDefinitions
Development/AbelianVarietyTheory99,187520375,91478,196
Formalism18,254165162,11876,543
Development/AutomorphicArithmetic18,43111171,15519,908
Development/AutomorphicSpectrum15,1477258,89410,004
GroundTheory8,5075554,21118,983
Development/WeilBound7,0514941,74013,292
ReciprocityTheory3,8452927,7228,426
CompanionTheory2,027119,4192,306
Development/ResolutionOfSingularities49986,6761,265
Development/EtaleCohomology1,39866,8283,313
PositivityTheory44932,7021,976
Development/DiscreteGroups21511,122249
Lemmata16702456

Library names are the source's own and do not reliably describe the contents: Development/WeilBound, for example, holds Arakelov geometry and unitary base change.

Most frequent proof words

have2,233,684
rw1,777,244
exact1,084,446
simp730,876
obtain590,710
refine519,360
intro512,382
ext215,368
apply157,237
omega137,597
ring113,886
linarith72,371
induction51,838
rcases47,406

Occurrences of each word anywhere in the source.

Structure

Building it