rh-insight

rh-insight

Interactive views of the Lean 4 Riemann Hypothesis proof's import graph across its cleanup snapshots

HTMLStarted

README

Two interactive views of the Lean 4 proof of the Riemann Hypothesis (and GRH for Dirichlet L-functions), and how its code changed as people cleaned it up.

Live at https://rh.io27.com.

  • Import Web (/): every module of the proof as a node and every import as an edge, laid out with a force-directed simulation on the GPU (WebGPU). Step through eight snapshots, from the original 175,187-file release on 2026-11-20 to the roughly 800-module editions a week later, and watch the graph shrink.
  • Ownership Map (/ownership.html): a zoomable icicle of the module-level dominator tree rooted at Main, showing which parts of the proof each module is solely responsible for.

Snapshots

Snapshot Date What it is
Original release 2026-11-20 The archive exactly as published
Duplicates pruned 2026-11-23 Unimported modules and exact duplicates deleted
Thin wrappers removed 2026-11-23 22,054 re-export-only modules deleted
Modules clumped 2026-11-23 Chains of small modules merged along the import graph
Community main, Nov 23 2026-11-23 leanprover-community/riemann-hypothesis before the rewrite landed
Anthropic rewrite (readable) 2026-11-25 grh-lean readable edition
Anthropic rewrite (compact) 2026-11-25 grh-lean compact edition
Community main, Nov 28 2026-11-28 Community main after adopting the readable edition

Files

  • export_graph.py <src_dir> <out_dir>: reads a checkout's .lean files and writes graph.json (node table) and edges.bin (uint32 importer/imported pairs). The output for each snapshot is in web/snap/<id>/.
  • build_standalone.py <web_dir> <out_html>: inlines web/index.html and every snapshot (gzipped, base64) into one HTML file that also opens from disk.
  • domtree.py <src_dir> <out_json>: computes the dominator tree behind the ownership map (dom.json). index.html is the ownership map reading dom.json; rh-ownership-map.html is the same page with the data inlined.
  • build.sh: builds the site into dist/.

Build and deploy

npm install
sh build.sh        # dist/index.html and dist/ownership.html
npm run deploy     # flint deploy to rh.io27.com

The Import Web needs a browser with WebGPU (recent Chrome, Edge or Safari).