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`
LeanTerm
​
LeanTerm
[assoc]
represents one Lean constant - its name, kind, type, and body - as returned by indexing a
LeanEnvironment
.
​
​
LeanTerm
[expr,env]
wraps a hand-built expression tree expr, bound to environment env so it can be type-checked.
​
Details and Options
▪
A
LeanTerm
renders as a summary box (icon, name, kind). Query it with properties via
term["prop"]
:
Property
Result
"Type"
/
"Term"
the type / body as a symbolic expression tree
"TypeForm"
/
"TermForm"
the type / body pretty-printed as Lean source
"Parameters"
the binder chain (name, type, binder kind) as rows
"TypeRefs"
/
"TermRefs"
constants the type / body refers to
"ExprGraph"
/
"CallGraph"
a
Graph
of the expression tree / dependencies
"Name"
/
"Kind"
the constant's name / declaration kind
▪
The expression tree is built from the CIC heads
LeanConst
,
LeanApp
,
LeanForall
,
LeanLam
,
LeanBVar
,
LeanSort
,
LeanLitNat
, … which carry box formatting, so a
"Type"
displays in Lean notation rather than as raw heads.
​
Examples  
(3)
Basic Examples  
(1)
Examples Initialization
A constant from an imported environment:
In[1]:=
env=
LeanImport
[PacletObject["Wolfram/LeanLink"]["AssetLocation","Examples"]];​​env["id_proof"]
Out[1]=
LeanTerm
Kind: theorem
Name: id_proof

Its type as Lean source, and its proof body:
In[2]:=
env["id_proof"]["TypeForm"]
Out[2]=
∀ (P : Prop) (a : P), P
In[3]:=
env["id_proof"]["TermForm"]
Out[3]=
fun x hp => hp
The type as a symbolic tree (rendered in Lean notation by the
LeanForall
boxes):
In[4]:=
env["id_proof"]["Type"]
Out[4]=
(P:Prop)(a:
#0
)
#1
Scope  
(1)

Properties & Relations  
(1)

SeeAlso
LeanEnvironment
 
▪
LeanConst
 
▪
LeanForall
 
▪
LeanState
 
▪
LeanCompile
RelatedGuides
▪
LeanLink
""

© 2026 Wolfram. All rights reserved.

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