← All papers
First page of "Not Used Elsewhere" Is Not "Unused" in a Lean Formalization of the Riemann Hypothesis: Reverse Lookup Against the Compiled Index, Based on Eduinformatics

"Not Used Elsewhere" Is Not "Unused" in a Lean Formalization of the Riemann Hypothesis: Reverse Lookup Against the Compiled Index, Based on Eduinformatics

Kunihiko Takamatsu, Katsuhiko Murakami, Sayaka Matsumoto, Tomohiro Akiyama, Shimpei Matsumoto, Katsuyuki Kunida, Satoshi Takahashi, Tokuro Matsuo, Sachio Hirokawa, Kazuya Tsuruta, Ryosuke Kozaki, Shuto Nishida, Koma Takamatsu, Ford Lumban Gaol, Masao Mori

cs.AI Nov 27, 2026 · v1 cs.LO cs.SE
Builds a forward/reverse declaration-use index from compiled .olean files of a large Lean 4 Riemann Hypothesis development, using a Lean program.
On 20 November 2026 a Lean 4 proof of the Riemann Hypothesis of about 175,000 files was released, and some 200 volunteers began to consolidate and prune it. Deciding that a declaration is unused, and can be deleted, is a reverse lookup: it is only as reliable as the forward links it is built from. From the compiled files of the consolidated branch (commit e497a66) we built a forward and reverse index of all declarations, covering 47,780 of 47,885 modules. Of the 454,574 declarations that no other file uses, 96.5% are used inside their own file, so "not used elsewhere" badly overstates "unused"; a deletion based on it broke the build and had to be partly reverted. Restoring the pre-consolidation partition of 174,793 files while holding the use relation fixed leaves this share unchanged (96.7% on the mapped declarations), so the false zeros are not an artifact of the consolidation: helper declarations already sat in the files of their users. We then asked how much a capture-recapture estimate built from source text alone can say about use. When the compiled index serves both as one capture and as the ground truth, the ratio of the Lincoln-Petersen estimate to the truth equals the reciprocal of the text matcher's precision by construction; we make this identity explicit, and report what the comparison still shows: how low the precision of plausible text matchers is, how recall differs between same-file and cross-file uses, and which uses text cannot see at all. We give a procedure for safe deletion based on the compiled index.

Volunteers pruning a roughly 175,000-file Lean 4 proof of the Riemann Hypothesis treated declarations with no uses from other files as unused and deleted them. A deletion made on this basis broke the build. The question is how reliable such 'unused' judgements are, and whether text-based estimates of use can be trusted.

A short Lean program walks the kernel terms stored in compiled .olean files and records declarations, cross-file uses and same-file uses, giving a forward and reverse index over 47,780 of 47,885 modules. The authors compare the 'not used elsewhere' rule with this index, and repeat the comparison under the pre-consolidation file partition with the use relation held fixed. They then evaluate text matchers on the source as the second capture in a Lincoln-Petersen capture-recapture estimate, using the compiled index as both first capture and ground truth.

Of 454,574 declarations with no cross-file use, 96.5% are used within their own file; the share is unchanged (96.7%) under the pre-consolidation partition. The ratio of the capture-recapture estimate to the truth equals the reciprocal of the matcher's precision by construction. Cross-file matchers reach only 16-45% recall at 82-87% precision. The authors give a deletion procedure based on the compiled index.

PairsMatcherRecallPrecisionRatio
Cross-fileA0.1610.8181.22
Cross-fileB0.4520.8741.14
Same-fileA0.9730.9691.03
Same-fileB0.6960.9741.03
Text matchers vs. compiled index (selected rows)