Lean Draftboard
Connecting…
Line 1, column 1Ready
Output

Compile to check this file and run its Lean commands.

Graph
Legend

    Drag nodes to arrange. Red node: choose a tactic. Right-click: add a node. Fact or hypothesis: use it in a goal.

    Compile a Lean file to display its proof graph.

    Select a graph node to inspect its source and proof state.

    About Lean Draftboard

    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

    1. Start in the empty Main.lean file, or use Open to load a file. Double-click the file name to rename it.
    2. Write your proof and click Compile, or press Ctrl / Cmd + Enter. Enable Auto compile to check after edits.
    3. Read Lean's messages and results from commands such as #eval in Output.
    4. 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.
    5. 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.
    6. 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.
    7. Save downloads your Lean file. The graph controls download the graph data, Graphviz source, or an image.