v0.4.2Lean v4.28.0 to v4.35.0

Proof maps for Lean 4 projects

proofmap reads your compiled Lean project and writes one offline HTML page: the main theorems, what each one rests on, and any sorry or extra axiom beneath them.

curl -fsSL https://raw.githubusercontent.com/n0zer0d4y/proofmap/main/install.sh | sh
1HTML file
Double-click it, email it, or publish it with GitHub Pages.
0network requests
The page loads nothing, and proofmap sends nothing anywhere.
13,759declarations
The largest project tested, a 130-module library on Mathlib.
10seconds
To rebuild that project's page when nothing has changed.

Views

Six views of one proof, all read from what Lean recorded

Every line on the map is a dependency Lean stored when it checked the proof. Nothing is drawn or written by hand.

file:///home/you/sums-of-squares/proofmap.html
The Map view: Nat.sum_four_squares on the right with the three cards it rests on, and its statement and the twelve declarations it uses in the side panel The Outline view: the results of the project as an indented list, each with its docstring summary The Walkthrough view: step 1 of 7 of the four squares proof, with the Lean source on the left and the goals before and after the tactic The Health view: counts of theorems, definitions and main results, the sorry list and the axioms used

Path finder

Ask how a definition reaches a theorem. The answer comes in plain words, one step a line.

Why is it flagged?

A result is flagged when anything below it uses sorry, at any depth. Why? names the chain.

Compare

proofmap compare reads two snapshots and lists each result added, removed or changed.

Install

Install proofmap once, then map any Lean project

It needs elan, git and a project on Lean v4.28.0 or newer. It adds nothing to your project.

  1. Install it on your computer

    One command. After that it works in every Lean project you have.

    curl -fsSL https://raw.githubusercontent.com/n0zer0d4y/proofmap/main/install.sh | sh
  2. Build the map

    Run it in the folder with the lakefile. The first build for each Lean version takes a few minutes; later ones take seconds.

    proofmap build
  3. Open it, then share it

    Commit proofmap.html and turn on GitHub Pages, or send the file. Readers install nothing.

    proofmap open
  • It runs your codeAs lake build does. Run it only on code you would also build.
  • Nothing leaves your machineNo requests from proofmap, none from the page.
  • The page holds your codeShare it as you would the source. Security notes

Examples

Three Mathlib projects publish their proof map

Each one is built with proofmap and served by GitHub Pages. Open one and read the proofs.

n0zer0d4y.github.io/rankin-selberg-delta/lean/proofmap.htmlOpen this map ↗
The Rankin–Selberg proof map: the theorem that L(f, s) is not zero on the line Re s = 1, the results it rests on, and its statement The large sieve proof map: the main result exists_rich_class_rat with its description and statement The simple zeros proof map: the main result simple_on_line_numeric, the three results it rests on, and its statement

Questions

What people ask before running proofmap

Read the full FAQ

Does proofmap run my code?

Yes, as lake build does: it imports the compiled modules. Run it only on code you would also build. The page itself runs no Lean code.

Can I use it on private code?

Yes. Nothing leaves your machine. The page holds your statements and source, so share it as you would share the code.

Which Lean versions work?

Lean v4.28.0 and newer. proofmap builds a matching engine for each Lean version it meets, so projects on different versions all work.

How long does a build take?

On a 130-module Mathlib project, about 2.5 minutes from scratch and 10 seconds when nothing changed. Walkthroughs take about as long as lake build.

How does it find my main results?

From the ## Main statements sections of your module docstrings, as Mathlib writes them, or from roots in proofmap.toml.

Can I run it in CI?

proofmap check --strict exits with code 3 when anything depends on sorry or on an extra axiom.

Map your first Lean project

Free and open source under Apache 2.0. One command to install, one to build.

curl -fsSL https://raw.githubusercontent.com/n0zer0d4y/proofmap/main/install.sh | sh