Wolfram Language
Paclet Repository
Community-contributed installable additions to the Wolfram Language
Primary Navigation
Categories
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
Create a Paclet
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`
L
e
a
n
I
m
p
o
r
t
S
t
r
i
n
g
L
e
a
n
I
m
p
o
r
t
S
t
r
i
n
g
[
s
r
c
]
c
o
m
p
i
l
e
s
a
L
e
a
n
4
s
o
u
r
c
e
s
t
r
i
n
g
a
n
d
r
e
t
u
r
n
s
a
L
e
a
n
E
n
v
i
r
o
n
m
e
n
t
o
f
t
h
e
c
o
n
s
t
a
n
t
s
i
t
d
e
c
l
a
r
e
s
.
L
e
a
n
I
m
p
o
r
t
S
t
r
i
n
g
[
{
s
r
c
1
,
s
r
c
2
,
.
.
.
}
]
c
o
m
p
i
l
e
s
t
h
e
s
o
u
r
c
e
s
j
o
i
n
e
d
w
i
t
h
n
e
w
l
i
n
e
s
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
▪
src
is ordinary Lean 4 source: any mix of
d
e
f
,
t
h
e
o
r
e
m
,
i
n
d
u
c
t
i
v
e
,
s
t
r
u
c
t
u
r
e
, and so on. Each top-level declaration becomes one
L
e
a
n
T
e
r
m
in the result.
▪
The string is compiled by the
l
e
a
n
of LeanLink's pinned toolchain and loaded into the embedded runtime. A type error in
src
returns
$
F
a
i
l
e
d
with a
L
e
a
n
I
m
p
o
r
t
:
:
e
r
r
message carrying Lean's diagnostic, as
l
a
k
e
b
u
i
l
d
would report it.
▪
With
"
P
r
o
j
e
c
t
D
i
r
"
*
d
i
r
*
,
src
can
i
m
p
o
r
t
the modules of the built Lake project in
dir
, of its packages, and of its path dependencies (
p
a
t
h
=
"
.
.
/
x
"
in the lakefile). A theorem proved
b
y
d
e
c
i
d
e
against the project's definitions is then a kernel-checked claim about them.
▪
Declarations inside a
n
a
m
e
s
p
a
c
e
are kept under their full names.
▪
A list of sources is one source, joined with newlines: an
i
m
p
o
r
t
line, a few declarations and generated source go in as they are, with no string joining.
▪
Use
L
e
a
n
I
m
p
o
r
t
S
t
r
i
n
g
for ad-hoc definitions and round-trips; use
L
e
a
n
I
m
p
o
r
t
to pull constants from a compiled module such as Mathlib.
Examples
(
4
)
Basic Examples
(
1
)
Compile a single theorem:
I
n
[
1
]
:
=
i
m
p
o
r
t
e
d
=
L
e
a
n
I
m
p
o
r
t
S
t
r
i
n
g
[
"
t
h
e
o
r
e
m
m
y
T
:
N
a
t
.
s
u
c
c
0
=
1
:
=
r
f
l
"
]
O
u
t
[
1
]
=
L
e
a
n
E
n
v
i
r
o
n
m
e
n
t
C
o
n
s
t
a
n
t
s
:
1
K
i
n
d
s
:
1
t
h
e
o
r
e
m
Read back its type:
I
n
[
2
]
:
=
i
m
p
o
r
t
e
d
[
"
m
y
T
"
]
[
"
T
y
p
e
F
o
r
m
"
]
O
u
t
[
2
]
=
N
a
t
.
s
u
c
c
0
=
1
S
c
o
p
e
(
1
)
P
r
o
p
e
r
t
i
e
s
&
R
e
l
a
t
i
o
n
s
(
1
)
P
o
s
s
i
b
l
e
I
s
s
u
e
s
(
1
)
S
e
e
A
l
s
o
L
e
a
n
I
m
p
o
r
t
▪
L
e
a
n
E
x
p
o
r
t
S
t
r
i
n
g
▪
L
e
a
n
E
n
v
i
r
o
n
m
e
n
t
▪
L
e
a
n
T
e
r
m
R
e
l
a
t
e
d
G
u
i
d
e
s
▪
L
e
a
n
4
f
r
o
m
t
h
e
W
o
l
f
r
a
m
L
a
n
g
u
a
g
e
"
"