Lean Draftboard puts your code and a graph of your proof side by side. It helps new and intermediate Lean users connect individual tactics to the structure of a proof.
Learning with the graph
Follow a proof as it splits into cases, introduces assumptions, and uses earlier facts. Select a node to find its code and read an explanation of the tactic. When Lean is connected, Before and after shows the actual goals and local context at that step.
Red nodes mark proof gaps or errors. A sorry remains a gap even when Lean accepts the file. Use the legend above the graph to distinguish goals, cases, hypotheses, and supporting lemmas.
Using the editor
- Start in the empty
Main.lean file, or use Open to load a file. Double-click the file name to rename it.
- Write your proof and click Compile, or press Ctrl / Cmd + Enter. Enable Auto compile to check after edits.
- Read Lean's messages and results from commands such as
#eval in Output.
- Click a graph node to highlight its source. Move the cursor into a source expression to select the matching node. Use the tabs below the graph to inspect it.
- Click a red node to open the tactic palette beside it. Choose a tactic or fill in its parameters. Right-click a node, connection or empty canvas to add a fact, local value or TODO note. New nodes created on empty canvas are drafts until you click their insertion point. Select Use in a goal on a fact or hypothesis, then click a red goal to use exact, apply or rewrite. Undo and Redo step through graph edits.
- Drag a node to move it; its connections follow. Drag empty graph space to pan, and use the zoom controls or Fit to change the view. Reset layout restores automatic node positions. Moving nodes only changes the view.
- Save downloads your Lean file. The graph controls download the graph data, Graphviz source, or an image.