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`
LeanState
​
LeanState
[term]
opens the
LeanTerm
term as a proof goal and returns a proof state.
​
​
LeanState
[env,name]
opens the constant name from environment env.
​
Details and Options
▪
A
LeanState
renders as a summary box and exposes properties:
"Goals"
(a list of
LeanGoal
s),
"GoalCount"
, and
"Complete"
(whether no goals remain).
▪
Advance the state by applying a
LeanTactic
:
LeanTactic[tac][state]
returns the new
LeanState
. A proof is finished when
"Complete"
is
True
.
▪
Opening a state from a fully-proved theorem still presents the statement as a goal to re-derive interactively; tactics operate on the goal stack the same way Lean's tactic mode does.
​
Examples  
(3)
Basic Examples  
(1)
Examples Initialization
Open a theorem as a goal:
In[1]:=
env=
LeanImport
[PacletObject["Wolfram/LeanLink"]["AssetLocation","Examples"]];​​s0=
LeanState
[env["id_proof"]]
Out[1]=
1 goal
————————————
⊳ ∀ (P : Prop) (a : P), P
How many goals remain, and whether it is finished:
In[2]:=
s0["GoalCount"]
Out[2]=
1
In[3]:=
s0["Complete"]
Out[3]=
False
The first goal's target:
In[4]:=
s0["Goals"]〚1〛["Target"]
Out[4]=
∀ (P : Prop), P → P
Scope  
(1)

Possible Issues  
(1)

SeeAlso
LeanTactic
 
▪
LeanGoal
 
▪
LeanTerm
 
▪
LeanEnvironment
RelatedGuides
▪
LeanLink
""

© 2026 Wolfram. All rights reserved.

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