See what a Lean statement means—before getting lost in the proof.
ProofLens turns Lean conjectures and theorems into visual, inspectable explanations. It shows the objects, relationships, assumptions, proof status and provenance without pretending that a numerical preview is a proof.
Open ProofLens in your browser — no install or account required. Load a built-in example, change one input, and see which assumptions and relationships control the result. To paste a supported declaration, open Explore your own Lean and choose Visualize statement.
Follow the exact two-minute walkthrough · Try one theorem locally · Connect the local MCP preview
If ProofLens answered a real question—or blocked you before it could—please share a short first-use report. Those reports decide what gets fixed next. If you want to follow the project, star the repository so the next release is easy to find.
Lean records the formal claim and checks completed proofs. ProofLens helps humans understand what the claim means, including while its proof is still incomplete.
Lean conjecture or theorem
↓
visual explanation + exploration
↓
human mathematical understanding
Open ProofLens, choose abs_upper_bound, and set a = 1, b = 1: both sides of |a + b| ≤ |a| + |b| equal 2. Change b to −1: the left side becomes 0 and the right side stays 2. The inputs cancel; the inequality still holds at these values.
Use Why this picture, the original Lean statement, and Save explanation to connect the picture to the claim. The bundled example carries extracted Lean proof metadata; the plot remains a numerical illustration. Browser source previews do not run Lean or prove a conjecture.
Inspect the Lean source · Try a supported pasted statement · Tell us what became clearer or blocked you
A formal statement can be precise and still be difficult to understand. ProofLens helps a reader see the objects involved, the relationship being asserted, and the role of the assumptions. Supported interactive scenes let the reader change inputs and follow their effects through the equation and picture.
Conjectures belong here too. An incomplete proof does not prevent a useful visual description of its statement. ProofLens marks admitted declarations as statements without completed proofs in that artifact: exploring examples does not establish that the general claim is true.
Visual understanding is the primary experience. Proof status and provenance keep that explanation honest; specialized certificate tools are secondary workflows. See the product direction for the user journey, current limits, and how we measure comprehension.
The browser accepts pasted Lean declarations, .lean files, and extracted Formal IR JSON.
For supported real arithmetic it shows interactive curves, values on both sides of the
relationship, assumption checks, and downloadable explanations and SVG charts. It also
recognizes square-root scaling and positive one-sided inverse-square divergence.
Source previews do not run Lean or verify proofs. Imported extraction metadata is not a verification attestation. Unsupported syntax and mathematical forms remain explicit gaps. Start with the own-statement walkthrough.
The Seymour graph explorer follows the pinned openai/math definitions of first
and second neighborhoods. Choose a small graph, edit arrow directions, inspect
each vertex, and save an example with source provenance. Start the local browser
app with pnpm dev:web, then open http://localhost:5173/#seymour.
The companion Lean specification checks that its definitions match the released target. Independent TypeScript tests compare all 59,809 oriented graphs with one to five vertices against a shortest-path oracle. These checks support finite example calculations; they do not verify the general conjecture or OpenAI's released solution. The companion uses Lean 4.24.0; the upstream 4.34.1 environment has not been reproduced.
Point it at a Lean 4 declaration and it will show you, in the infoview next to your code:
- the exact formal statement, as Lean printed it;
- a mathematical rendering of the conclusion (
N / t ≤ P · D / (kB · T · log 2)); - what kind of statement it is — an upper bound, a monotonicity property, a sign fact, a definition, an equivalence;
- which stated hypotheses occur nowhere in a completed extracted proof term, later hypothesis types, or the conclusion; admitted or unavailable proof terms produce no assumption-use findings;
- how the bound responds to each parameter, where that follows from the hypotheses;
- a generated figure — optionally animated: declaration-reference graphs
appear in increasing local-reference depth, and illustrative limit curves trace
toward their asymptote (
prooflens render --animate). Appearance order follows the displayed structure; pacing is a display choice, and neither reconstructs proof steps; - local declaration references from statements and bodies, when available; these references do not distinguish proof use from statement use;
- the declaration's axiom dependencies and whether its proof reaches
sorry; - an optional, source-pinned TorchLean adapter that explains neural robustness margins and carries an exact-real kernel certificate for its two displayed examples;
- a versioned research-paper packet importer that binds certificate-required claims to exact, hash-matched Formal IR and emits a downloadable READY/HOLD decision;
- and, for every one of the above, why ProofLens is telling you it.
Here is a real example, from ProofLens's own corpus:
$ prooflens explain examples/corpus.formal-ir.json information_rate_bound
WHAT WAS PROVED [verified]
∀ (P T kB D N t : ℝ), 0 < P → 0 < T → 0 < kB → 0 < D → 0 < t →
N * (kB * T * Real.log 2 / D) ≤ P * t → N / t ≤ P * D / (kB * T * Real.log 2)
WHAT KIND OF STATEMENT THIS IS [derived]
The theorem establishes an upper bound: `N / t` cannot exceed
`P · D / (kB · T · log(2))` under the stated assumptions.
WHICH ASSUMPTIONS DID THE WORK [derived]
`hP : 0 < P` is stated but never used by this proof term. That does not mean
the hypothesis is mathematically unnecessary — only that this particular
proof does not touch it.
HOW THE UPPER BOUND RESPONDS [derived]
The upper bound is `P · D / (kB · T · log(2))`. Holding the other quantities
fixed, and using only the sign hypotheses this theorem states: increasing `P`
increases it; increasing `T` decreases it; increasing `kB` decreases it;
increasing `D` increases it.
WHAT THE SYMBOLS MEAN [interpreted]
`P` is electrical power drawn by the machine (W); `T` is operating temperature
of the heat bath (K) … These readings come from the declaration's ProofLens
annotations, not from anything Lean checked.
The tag on every line distinguishes the mathematical statement from its explanation. See the epistemic model.
Nobody told ProofLens to look for a redundant hypothesis in that theorem. It
found hP by walking the elaborated proof term.
Every piece of information ProofLens produces carries one of six statuses:
verified |
Asserted by the Lean kernel. |
derived |
Computed from verified data by a deterministic, inspectable rule. |
interpreted |
A reading of the statement, or a human author's declaration about it. |
heuristic |
A rule of thumb, expected to be wrong sometimes. |
illustrative |
A display choice. It makes no mathematical claim. |
speculative |
Produced by a language model. Nothing underwrites it. |
Two properties are enforced in code rather than by convention:
verifiedcannot be manufactured. It requires a kernel witness that only the Formal IR loader can mint, and only for a declaration whose proof does not reachsorry.- Confidence only ever decreases. Every transformation combines its inputs with a weakest-wins fold, so nothing travels back uphill.
When AI-generated interpretation eventually arrives, it arrives labelled, and it cannot be promoted.
Requirements: elan (Lean 4.24.0), Node
22.12 or later in the 22.x line, or Node 24.x, and pnpm 10.28.0. The development
test suite uses Vitest 5; Node 20 is outside its supported runtime range. CI uses
Node 22; use the supported Node range in package.json for local development.
Want the smallest useful example first? Follow one theorem in five minutes to produce a layered explanation and animated SVG from the checked-in Formal IR without installing Lean.
git clone https://github.com/jdhart81/prooflens
cd prooflens
pnpm install
pnpm build
# Build the extractor (Lean core only — no mathlib needed)
cd lean && lake build && cd ..
# Build the example corpus (this one does use mathlib)
cd corpus && lake exe cache get && lake build && cd ..This is the primary surface.
import ProofLens.Widget
import ProofLensExamples.IntelligenceBound
#prooflens ProofLens.Examples.information_rate_boundPut your cursor on the command and the analysis appears in the infoview panel: figures, layered explanation, provenance, and every intermediate representation.
# Extract Formal IR from any Lake project
pnpm prooflens extract --project corpus \
--module ProofLensExamples.IntelligenceBound \
--out formal-ir.json
pnpm prooflens summary formal-ir.json
pnpm prooflens explain formal-ir.json information_rate_bound
pnpm prooflens render formal-ir.json --out-dir figures --format both
pnpm prooflens coverage formal-ir.json
pnpm prooflens inspect formal-ir.json information_rate_bound --stage mathpnpm dev:webFor a quick overview, watch the 45-second ProofLens community tour, then open the live application.
ProofLens does not send Lean source to a model and get a picture back. It builds intermediate representations, and they are the point:
Lean 4
↓ deterministic extraction over Lean.Environment
Formal IR preserves; interprets nothing
↓
MathIR proof-assistant plumbing becomes mathematics
↓
classification + sign analysis + explanation
↓
VisualIR what to show, never how to draw it
↓
SVG · Lean infoview widget · text
Renderers consume VisualIR and nothing else, which is why the same analysis drives an editor panel, a terminal, and a web page with no second implementation. The core requires no language model and no proprietary API.
Every stage is inspectable, from the CLI and from the UI. If ProofLens shows you something, you can ask it which rule fired and which subterm of which declaration made it fire.
It says so, and shows you the theorem anyway:
No deterministic visualization classifier currently supports this theorem
structure. `Filter.Tendsto` is not in ProofLens's constant table yet.
The formal statement, its structure, its hypotheses and its dependencies are all still displayed. Discarding mathematics because it cannot be drawn is the one outcome ProofLens is not permitted to have — and these cases are the roadmap. If you hit one, please report it.
v0.1. It works end to end, and it has been measured.
Against a 679-declaration slice of real mathlib — order theory, real analysis, inequalities, binary entropy — ProofLens structurally classifies 96.2% of declarations and reads 81.3% of them end to end, meaning the conclusion classified and every term inside it has a name. 1,490 figures render without a failure.
Those numbers started at 76.0% and 33.9%. They moved because ProofLens measures
itself: prooflens coverage emits a ranked backlog of exactly which Lean
constants and statement shapes are costing coverage, and two rounds of work
against that backlog produced the difference. Nothing was guessed at. The full
report, including what remains, is in docs/coverage.md.
pnpm prooflens coverage formal-ir.jsonOne calibration result is worth stating plainly: assumption sensitivity analysed 437 mathlib declarations and found zero stated-but-unused hypotheses. Not one. That is not a bug — all 770 hypothesis binders in the slice occur in their proof term, later binder types, or conclusion. Mathlib is curated and linted, and a redundant hypothesis has to survive both machinery and review to reach it. The tool's value is for drafts, reformalizations, and above all machine-generated proofs, where redundant hypotheses accumulate because nothing is grooming them. ProofLens's own hand-written corpus has two.
Remaining limits: only the final proof term is analysed, not tactic structure; most plots are schematic, while semantic scenes support a narrow subset of numeric bounds. The browser explores bundled examples and supported pasted Lean statements; use the editor or CLI to extract declarations from your own Lean project. Coverage is untested outside order theory and analysis; dependency graphs are single-module. Structural coverage does not measure reader comprehension. See the roadmap.
Agents and LLM tools can start from llms.txt and AGENTS.md.
-
Product direction — Lean code to visual mathematical understanding
-
One theorem in five minutes — the smallest complete Lean-to-visual path
-
Architecture — stages, packages, and what each is forbidden to do
-
The epistemic model — start here
-
MathIR — the semantic representation, and how to teach it a new constant
-
VisualIR — the visualization representation, and how to add a renderer
-
Semantic scenes — numeric, interactive explanations of what supported theorems represent
-
Research-paper packets — claim inventories, witness matching, and downloadable gate decisions
-
Coverage against mathlib — the measured numbers and the ranked backlog
-
ADR 0001 — how extraction works, and why we do not build a tracer
-
ADR 0002 — why the infoview came first
-
ADR 0003 — why annotations live in docstrings
ProofLens is built alongside, not against, the existing Lean ecosystem. LeanDojo is the right tool for repository-scale tracing and premise extraction, and ProofLens will consume it rather than reimplement it. doc-gen4 is the reference for reading Lean's environment. ProofWidgets4 is the toolkit for richer infoview interaction, and is where ProofLens will go when it needs round-trips to Lean.
See CONTRIBUTING.md. The short version: new information needs
a correct epistemic tag, new classifiers need a stable rule id and a test, and
verified may only originate from Lean.
Three bounded contribution paths are ready:
- visualize
Function.Injective— labelledgood first issue; - certify all 360 pinned TorchLean examples;
- prove generic
reshapeandconcatenclosure.
Apache-2.0. See LICENSE.