Paperproofpaperproof
Lean 4 · VSCode extension

A proof tree for every
Lean theorem.

Lean proof is a list of tactics. Lean's default interface shows available goals and hypotheses after a single tactic.
Paperproof shows the entire proof, the way a mathematician would sketch it on paper.

Free & open-source · works inside the proof assistant and on paper
≡ Lean Infoview≡ Paperproof ×
hypotheses
s: Set ℕ
t: Set ℕ
ext x
x: ℕ
intro h1
h1: x ∈ s ∩ t
rw [Set.mem_inter_iff]
h1: x ∈ s ∧ x ∈ t
rw [and_comm]
h1: x ∈ t ∧ x ∈ s
🎉 exact h1 🎉
x ∈ t ∩ s
intro h1
x ∈ s ∩ t → x ∈ t ∩ s
intro h2
h2: x ∈ t ∩ s
rw [Set.mem_inter_iff]
h2: x ∈ t ∧ x ∈ s
rw [and_comm]
h2: x ∈ s ∧ x ∈ t
🎉 exact h2 🎉
x ∈ s ∩ t
intro h2
x ∈ t ∩ s → x ∈ s ∩ t
apply Iff.intro
x ∈ s ∩ t ↔ x ∈ t ∩ s
ext x
s ∩ t = t ∩ s
theorem
commutativityOfIntersections.lean - as Paperproof draws it
The idea

Mathematics is about hypotheses and goals.

A list of tactics is barely helpful in understanding the mathematical content behind the proof. In order to read a Lean proof, we have to inspect the proof state (hypotheses and goals) after every tactic.

Paperproof shows how hypotheses and goals were transforming throughout the proof, laid out in a consistent spatial notation, so that structure and dependencies is something you simply see.

The tactics you write
...
intro h1
rw [mem_inter_iff] at h1
rw [add_comm] at h1
...
↑ the proof state is invisible
The proof you read
intro h1
h1: x ∈ s ∩ t
rw [mem_inter_iff] at h1
h1: x ∈ s ∧ x ∈ t
rw [and_comm] at h1
h1: x ∈ t ∧ x ∈ s
The notation

Three boxes. Learn it in one glance.

The entire visual language is small enough to learn in a glance - colour tells you what a fact is, position tells you where it came from.

h: x ∈ s

Hypothesis

Everything we know: variables, assumptions, and facts derived during the proof.

s ∩ t = t ∩ s

Goal

What's left to show. Close every goal and the theorem is done.

intro h

Tactic

A verb. Tells us what action transformed one Hypothesis/Goal into another.

Get started

See your next proof
in two minutes.

Install the Paperproof VSCode extension & Lean library, open any .lean file of yours, and see your proof render as you type.

Read installation instructions →
01
Install Paperproof VSCode extension
02
Install Paperproof Lean library
03
Open the panel
Click on Paperproof icon and start proving.