Basic Examples (4)
Load the bundled example environment:
How many constants, and of what kinds:
A single constant is a LeanTerm summary box:
Its type, pretty-printed as Lean source - the proposition it proves:
And the proof term:
Every expression is a tree; "ExprGraph" draws it:
"CallGraph" shows which constants a proof depends on:
Scope (2)
Import from Mathlib by pointing "ProjectDir" at a built mathlib4 checkout (gated so the page still builds without one):
The "Parameters" property unfolds a theorem's binder chain - explicit, implicit, and instance arguments - as a Dataset:
Applications (3)
Open any theorem as a proof goal and step through it with tactics:
Transpile a Wolfram ProofObject into a checkable Lean environment:
Lower a (non-dependent) Lean definition to native code via FunctionCompile:
Properties and Relations (1)
LeanImportString round-trips with LeanExportString: import a source string, query it, and export an environment back to Lean source:
ProofToLean complements MetamathImport - both bring an external formal-proof corpus into the Wolfram Language; LeanLink targets Lean 4 / Mathlib and additionally drives the prover interactively.
Possible Issues
The native bridge needs the platform dylib under
LeanLink/LibraryResources/. Mathlib import and the out-of-process graph functions (
LeanExprGraph,
LeanCallGraph) additionally need
elan /
lake on
PATH and a
built project -
LeanImport of an unbuilt module returns an empty environment.
LeanCompile's
dependent-type path (Vector-sized signatures via
TypePi) requires a forked Wolfram compiler; the non-dependent path works against the stock compiler.
A type shown in isolation can print an unresolved bound variable as #0 / #1; the full-theorem "TypeForm" resolves binder names.
Neat Examples (1)
The type of a Mathlib theorem, drawn as its expression tree (gated on a built checkout):