Applied Identity Physics™ · SNSFT Foundation

LeanMass™ theorem mass of any Lean repository

Paste a GitHub repository, folder or file, or open a folder on your own computer. LeanMass reads every .lean file and returns its theorem mass: the theorems and lemmas it declares, by file and by folder, with lines, corpus coordinates and proof-level sorry counts. Only declarations in files with no sorry in proof code count: a theorem in a file that still holds a sorry is not theorem mass until its proof is closed.

Read a repository

How theorem mass is counted

declaration = a line that opens with theorem or lemma, after any attribute @[…] and any of private · protected · noncomputable · nonrec ^\s*(?:@\[[^\]]*\]\s*)?(?:(?:private|protected|noncomputable|nonrec)\s+)*(?:theorem|lemma)\s block text = /- … -/ comments (doc comments included) are removed before counting, so a theorem written inside a comment is not counted lines = newlines + 1, on the file as written coordinate = the first "Coordinate: [a,b,c,d]" in the file proof sorry = sorry used as a tactic in proof code: nested /- -/ comments, -- comments and strings removed as Lean reads them; statements of closure ("0 sorry", "zero `sorry`") are not holes theorem mass = Σ declarations over the files with no sorry in proof code (lakefile.lean excluded); a declaration in a file that still holds a sorry is not theorem mass declared = Σ declarations over every .lean file read, sorry or not held back = declared − theorem mass

Any public repository reads with no account and no key: LeanMass reads the repository from GitHub on its server and archives the result against the repository’s current tree, so a repository that has not changed is served instantly. A folder on your own computer reads without any network request at all. A snapshot reads the repository as it stands on the chosen branch. To keep a permanent day-by-day record of a repository's theorem mass, with the mass to date that only rises, add it to the scan list at uuia.app/rap; the collector reads its whole commit history.