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

Tutorials

  • Checking Mathlib with TypeTheory
  • Exploring Mathlib with LeanLink
  • An Import Graph for Mathlib
  • Getting Started with LeanLink

Guides

  • Lean 4 from the Wolfram Language

Symbols

  • ImportDOT
  • LeanApp
  • LeanBuild
  • LeanBVar
  • LeanCallGraph
  • LeanCompile
  • LeanConstantInfo
  • LeanConstant
  • LeanConst
  • LeanEnvironment
  • LeanEvaluate
  • LeanExport
  • LeanExportString
  • LeanExprGraph
  • LeanExpr
  • 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
  • LeanToTypeTheory
  • LeanTruncated
  • LeanValue
  • ProofToLean
  • TypeTheoryToLean
Wolfram`LeanLink`
LeanEvaluate
​
LeanEvaluate
["expr"]
evaluates the Lean expression expr with
#eval
and returns its value as a Wolfram Language expression.
​
Details and Options
▪
The value comes back through
Lean.toJson
:
Nat
and
Int
give integers,
Bool
gives
True
or
False
,
String
gives strings,
Float
gives machine reals, exactly, with
Infinity
and
Indeterminate
for the infinities and NaN, and
List
and
Array
give lists. A type without a
ToJson
instance fails; wrap the expression in
toString
to get a string instead.
▪
Options:
Option
Default
​
"ProjectDir"
None
a built Lake project whose modules the expression may use
"Imports"
{}
modules to import
"Source"
""
Lean declarations the expression uses (definitions,
open
s), placed after the imports
"Open"
{}
namespaces to open
"TimeLimit"
600
seconds before the evaluation is stopped
▪
The value is computed by Lean's interpreter, not checked by its kernel. For a kernel-checked claim, state it as a theorem proved
bydecide
with
LeanImportString
.
▪
An expression that does not elaborate returns a
"LeanEvaluateFailed"
Failure
carrying Lean's message; one that runs past
"TimeLimit"
returns a
"TimedOut"
Failure
.
​
Examples  
(4)
Basic Examples  
(1)
Evaluate Lean expressions:
In[1]:=
LeanEvaluate
["(List.range 10).map (· ^ 2)"]
Out[1]=
{0,1,4,9,16,25,36,49,64,81}
In[2]:=
LeanEvaluate
["decide (2 ^ 10 = 1024)"]
Out[2]=
True
Scope  
(2)

Possible Issues  
(1)

SeeAlso
LeanImportString
 
▪
LeanBuild
 
▪
LeanImport
RelatedGuides
▪
Lean 4 from the Wolfram Language
""

© 2026 Wolfram. All rights reserved.

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