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`
LeanExprToType
​
LeanExprToType[expr]
translates a Lean type expression expr into a Wolfram compiler type object.
​
Details and Options
▪
LeanExprToType
is the type-side counterpart of
LeanToFunction
: it maps a
LeanForall
to an arrow or
TypePi
over the mapped leaf types, and a
LeanConst
to the corresponding type constructor. It underpins the dependent-type path of
LeanCompileTyped
.
▪
The resulting type object's methods (its
"toString"
form, unification, …) live in the Wolfram compiler's
TypeFramework
; exercising them requires the forked compiler reached through the paclet's
compiler
symlink.
​
Examples  
(1)
Basic Examples  
(1)
Examples Initialization
Translate a Lean arrow type
Nat->Nat
to a compiler type object (shown without evaluating, since inspecting the object needs the forked compiler):
In[1]:=
LeanExprToType

LeanForall
"x",
LeanConst
["Nat"],
LeanConst
["Nat"],"default"
The call returns a
TypePi
/ arrow type object over the leaf types
Nat
map to; with the forked compiler loaded, its
"toString"
renders the Wolfram-side type and
TypeUnify
matches it against compiled signatures.
SeeAlso
LeanCompileTyped
 
▪
LeanCompile
 
▪
LeanForall
 
▪
LeanConst
RelatedGuides
▪
LeanLink
""

© 2026 Wolfram. All rights reserved.

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