RH proof size unofficial
Relative to the original
Commits, newest first
Code lines added or removed by each commit that changes them
Code lines by folder
Modules that could build at the same time
An ideal build on as many cores as needed: every module starts as soon as the modules it imports are built, and takes time in proportion to its code lines (a rough assumption).
Imports between modules
Each picture is the project's modules in path order, along both sides, grouped by top-level folder (dotted lines). A cell holds 1/160 of the modules each way and is coloured when modules of its row import modules of its column; the darker, the more imports per pair of modules in the cell:
A well-structured project probably shows dark squares along the diagonal (folders importing mostly from themselves), some vertical stripes (modules that much builds on) and little else; dots spread over the whole picture are imports between unrelated parts. A cell of the RH proof holds about 300 times more pairs of modules than one of Mathlib, so compare the patterns rather than the darkness.
Declarations by length
Compared with Mathlib
How many times as frequent as in Mathlib (Mathlib = 1×, the solid line; log scale), originally and now.
How it's measured
Text search, not Lean. All numbers come from plain text search, with Python
regular expressions, over the .lean files as stored in git
(collect.py).
Lean is never run and nothing is elaborated.
There is one data point per commit on main; a merged pull request counts as one
commit, not as the commits it contains. A GitHub Action checks for new commits every 15 minutes.
- Total lines
- lines of the
.leanfiles undersrc/, including blank lines and comments - Code lines
- total lines, without blank lines and lines that are only comments (
--, nested/- -/) - Theorems
- code lines starting with
theoremorlemma, also after attributes and modifiers such as@[simp] private - Other declarations
- code lines starting with
def,abbrev,instance,structure,inductive,class,opaqueoraxiom, likewise - Declarations
- theorems and other declarations
- Files
.leanfiles undersrc/- Folders
- the folders directly in
src/, each with everything below it; the files directly insrc/are one more group - Import statements
importstatements (alsopublic import,meta import), counted as code lines starting with one, assuming the usual one import per line- Repeated theorem statements
- theorems and lemmas whose statement (from after the name up to
:=, white space aside, at least 30 characters) is word for word that of another theorem, counting the copies beyond the first. The same text can mean different things in different namespaces, which is why Mathlib has some too - maxHeartbeats overrides
set_option maxHeartbeats, which gives a proof more time than Lean's default- omega and nlinarith
- uses of these two tactics, which settle arithmetic by brute force
- Declaration lengths
- code lines from a declaration to the next one in its file, or to the end of the file
- Modules, imports
- in the pictures of the imports: the
.leanfiles undersrc/, and the modules of the project their import statements name (imports of Mathlib and other dependencies are left out) - Mathlib
- for comparison, the version of Oct 13, 2026 (56a0058): its modules under
Mathlib/and the imports between them, measured the same way - Ideal build
- a simulated build on as many cores as needed: every module starts as soon as all modules it imports are built, and takes time in proportion to its code lines. That is an assumption: how long Lean takes depends mostly on the proofs, which text search cannot tell. The fastest such build takes as long as the longest chain of modules that each import the next, in code lines; all the other modules can be built beside it
Because this is text search, declarations generated by commands or macros are missed.