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`
LeanConstant
​
LeanConstant
[name,kind,type,term]
is the raw constant record returned by the native shim: the constant's name, its declaration kind, its type expression, and its body.
​
Details and Options
▪
LeanConstant
is the low-level record
LeanConstantInfo
returns and
LeanListConstants
collects. The higher-level
LeanTerm
wraps the same data with the property interface (
"TypeForm"
,
"ExprGraph"
, …).
▪
kind is a string such as
"theorem"
,
"def"
,
"inductive"
,
"constructor"
, or
"axiom"
. type and term are CIC expression trees (or
LeanNoValue
for a constant with no body).
Examples  
(0)
SeeAlso
LeanConstantInfo
 
▪
LeanTerm
 
▪
LeanListConstants
RelatedGuides
▪
LeanLink
The raw record of a Mathlib theorem (gated on a built checkout): The name and kind are the first two parts:
In[1]:=
mathlibDir=FileNameJoin[{$HomeDirectory,"src","mathlib4"}];​​IfDirectoryQ[FileNameJoin[{mathlibDir,".lake","build"}]],​​
LeanConstantInfo
["And.comm",​​"Imports"{"Mathlib.Logic.Basic"},"ProjectDir"mathlibDir],​​"Mathlib not built"​​
Out[1]=
LeanConstant[And.comm,theorem,{a:Prop}{b:Prop}
Iff
And
#1
#0
And
#0
#1
,fun{a:Prop}fun{b:Prop}
Iff.intro
And
#1
#0
And
#0
#1
And.symm
#1
#0
And.symm
#0
#1
]
In[2]:=
mathlibDir=FileNameJoin[{$HomeDirectory,"src","mathlib4"}];​​IfDirectoryQ[FileNameJoin[{mathlibDir,".lake","build"}]],​​info=
LeanConstantInfo
["And.comm",​​"Imports"{"Mathlib.Logic.Basic"},"ProjectDir"mathlibDir];​​{info〚1〛,info〚2〛},​​"Mathlib not built"​​
Out[2]=
{And.comm,theorem}
""

© 2026 Wolfram. All rights reserved.

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