Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

LeanLink

Guides

  • Lean 4 from the Wolfram Language

Tech Notes

  • Exploring Mathlib with LeanLink
  • An Import Graph for Mathlib
  • Getting Started with LeanLink

Symbols

  • ImportDOT
  • LeanApp
  • LeanBVar
  • LeanCallGraph
  • LeanCompile
  • LeanCompileTyped
  • LeanConstantInfo
  • LeanConstant
  • LeanConst
  • LeanEnvironment
  • LeanExport
  • LeanExportString
  • LeanExprGraph
  • LeanExpr
  • LeanExprToType
  • LeanForall
  • LeanFreeEnvironment
  • LeanFVar
  • LeanGoal
  • LeanImport
  • LeanImportString
  • LeanLam
  • LeanLet
  • LeanLevelIMax
  • LeanLevelMax
  • LeanLevelMVar
  • LeanLevelParam
  • LeanLevelSucc
  • LeanLevelZero
  • LeanListConstants
  • LeanListTheorems
  • LeanLitNat
  • LeanLitStr
  • LeanLoadEnvironment
  • LeanMVar
  • LeanNoValue
  • LeanProj
  • LeanSort
  • LeanState
  • LeanTactic
  • LeanTerm
  • LeanToFunction
  • LeanTruncated
  • LeanValue
  • ProofToLean
Wolfram`LeanLink`
LeanExprGraph
​
LeanExprGraph
[root]
generates the expression graph of a Lean constant root as a
Graph
, computed by a Lean subprocess.
​
Details and Options
▪
The graph shows the constant's type and term as a tree of expression nodes. Where the in-process
"ExprGraph"
property of a
LeanTerm
works from an already-imported environment,
LeanExprGraph
runs the Lean toolchain out of process and reads back a DOT graph (via
ImportDOT
).
▪
Options include
"Files"
(bare
.lean
files to load),
"Imports"
/
"ProjectDir"
(a lake project and modules),
"ConstDepth"
(how many constant definitions to expand into, default
1
), and
"Depth"
.
▪
A subprocess call needs
lean
/
lake
on
PATH
. Loading a large project (Mathlib) into the subprocess is slow; prefer bare
"Files"
for quick graphs.
​
Examples  
(2)
Basic Examples  
(1)
Examples Initialization
The expression graph of a constant in the bundled examples file:
In[1]:=
ex=PacletObject["Wolfram/LeanLink"]["AssetLocation","Examples"];​​
LeanExprGraph
["id_proof","Files"{ex}]
Out[1]=
Properties & Relations  
(1)

SeeAlso
LeanCallGraph
 
▪
LeanListTheorems
 
▪
LeanTerm
 
▪
ImportDOT
RelatedGuides
▪
LeanLink
""

© 2026 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com