The largest Lean repositories by lines of code

OctoCounts has measured 14 public GitHub repositories whose primary programming language is Lean. openai/math is the largest, with 25,818,316 code lines across 167,820 files, counted with tokei on November 24, 2026. The table ranks the 14 largest by code lines; each row links to a report pinned to the commit it counted.

RankRepositoryCode linesTotal linesFilesLean share
1openai/math25,818,31630,944,825167,82098.5%
2CocoSgt/riemann-hypothesis-lean15,531,92417,374,525175,190100.0%
3leanprover-community/riemann-hypothesis14,706,47416,708,47360,58899.9%
4lexifina/global-law2,560,9343,499,53019,66412.8%
5leanprover-community/mathlib41,614,7792,492,6449,42399.4%
6tristanbuckmaster/fluid_lean1,578,2911,685,5653,627100.0%
7brilliant-hq/pequalnp-proofs1,152,1601,269,2942,39799.9%
8yang-mills-group/OpenAI-YM-20261028820,251989,9449,490100.0%
9tristanbuckmaster/navier-stokes554,414616,4752,281100.0%
10openai/NavierStokesAndEuler533,712641,6912,66699.9%
11mccorvie/riemann-masullo453,968636,21467198.4%
12lana-agents/iut160,024253,69580199.2%
13somamaley-ux/AASC-YangMills-Lean-Audit98,115116,95182296.4%
14digama0/lean4lean40,11949,55411899.9%

Ranking rule: a repository belongs to Lean when Lean is its largest programming language by code lines; data and prose formats such as JSON, YAML, TOML and Markdown do not count as a language for this rule. "Lean share" is the share of the repository's code lines written in Lean. Code lines exclude comments and blank lines. Every report uses OctoCounts' canonical public options, with tests, docs and generated directories excluded, and reports were generated on different dates.

Lean leaderboard FAQ

Which Lean repository has the most lines of code?

openai/math is the largest Lean repository in OctoCounts' index, with 25,818,316 code lines out of 30,944,825 total lines across 167,820 files, counted on November 24, 2026. CocoSgt/riemann-hypothesis-lean follows with 15,531,924 code lines. Code size is not code quality: a larger count only means more source material.

How does a repository join the Lean leaderboard?

Lean must be its primary programming language: the language with the most code lines in the repository's OctoCounts report, ignoring data and prose formats such as JSON, YAML, TOML and Markdown. The repository then needs a public report with at least 5 files, and it is listed when it is among the 50 largest by code lines.

How many Lean repositories has OctoCounts measured?

14 public GitHub repositories have Lean as their primary programming language in OctoCounts' index. This page lists the 14 largest by code lines; a repository analyzed with custom counting options keeps those counts as a separate saved result.

Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use line counts to gauge the scale of what you would be reading or maintaining, not as a quality signal.