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`
LeanEnvironment
​
LeanEnvironment
[assoc]
holds a collection of named Lean constants, where assoc maps each name to a
LeanTerm
.
​
Details and Options
▪
A
LeanEnvironment
is produced by
LeanImport
,
LeanImportString
, or
ProofToLean
- you rarely build one by hand.
▪
Index it by constant name to get a
LeanTerm
:
env["mul_comm"]
. It also supports
Keys
,
Values
,
Length
,
KeyExistsQ
, and
Normal
(which returns the underlying
Association
).
▪
Information
[env,prop]
exposes environment metadata. Properties:
"Constants"
(the names),
"Kinds"
(a count by declaration kind),
"Handle"
(the native environment id),
"Source"
,
"DeclOrder"
,
"Preamble"
.
​
Examples  
(3)
Basic Examples  
(1)
Examples Initialization
Import the bundled environment:
In[1]:=
env=
LeanImport
[PacletObject["Wolfram/LeanLink"]["AssetLocation","Examples"]]
Out[1]=
LeanEnvironment
Constants: 25
Kinds: 18 theorem6 def1 inductive

Its size and constant names:
In[2]:=
Length[env]
Out[2]=
25
In[3]:=
Keys[env]
Out[3]=
{id_proof,add_zero_term,bor_false,eq_transport,Vec.map,sigma_example,even_two,exists_succ,Vec,band_true,comp_proof,reverse_reverse,zero_add_proof,Vec.head,fin_example,add_comm_proof,contrapositive,add_succ_term,bnot_bnot,Vec.tail,and_comm_proof,add_assoc_proof,modus_ponens,nat_eq_decide,or_comm_proof}
Index a constant by name to get a
LeanTerm
:
In[4]:=
env["id_proof"]
Out[4]=
LeanTerm
Kind: theorem
Name: id_proof

Scope  
(1)

Properties & Relations  
(1)

SeeAlso
LeanImport
 
▪
LeanImportString
 
▪
LeanTerm
 
▪
ProofToLean
 
▪
LeanState
RelatedGuides
▪
LeanLink
""

© 2026 Wolfram. All rights reserved.

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