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

  • LeanLink

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
Examples  
(2)
Scope  
(1)
The binder chain as a
Dataset
:
In[1]:=
env["modus_ponens"]["Parameters"]//Dataset
Out[1]=
Name
Type
TypeForm
Binder
P
Prop
Prop
explicit
Q
Prop
Prop
explicit
a._@._internal._hyg.0
#1
#1
explicit
a._@._internal._hyg.0
(
a
:
#2
)

#2
∀ (a : #2), #1
explicit
The expression tree as a graph:
In[2]:=
env["id_proof"]["ExprGraph"]
Out[2]=
Properties & Relations  
(1)

SeeAlso
LeanEnvironment
 
▪
LeanConst
 
▪
LeanForall
 
▪
LeanState
 
▪
LeanCompile
RelatedGuides
▪
LeanLink
A constant from an imported environment: Its type as Lean source, and its proof body: The type as a symbolic tree (rendered in Lean notation by the
LeanForall
boxes):
In[1]:=
env=
LeanImport
[PacletObject["Wolfram/LeanLink"]["AssetLocation","Examples"]];​​env["id_proof"]
Out[1]=
LeanTerm
Kind: theorem
Name: id_proof

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
In[4]:=
env["id_proof"]["Type"]
Out[4]=
(P:Prop)(a:
#0
)
#1
""

© 2026 Wolfram. All rights reserved.

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