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`
P
r
o
o
f
T
o
L
e
a
n
P
r
o
o
f
T
o
L
e
a
n
[
p
r
o
o
f
]
t
r
a
n
s
p
i
l
e
s
a
W
o
l
f
r
a
m
P
r
o
o
f
O
b
j
e
c
t
i
n
t
o
a
L
e
a
n
E
n
v
i
r
o
n
m
e
n
t
w
h
o
s
e
c
o
n
s
t
a
n
t
s
a
r
e
t
h
e
a
x
i
o
m
s
,
l
e
m
m
a
s
,
a
n
d
f
i
n
a
l
t
h
e
o
r
e
m
o
f
t
h
e
p
r
o
o
f
,
w
i
t
h
s
t
r
u
c
t
u
r
e
d
L
e
a
n
t
a
c
t
i
c
b
o
d
i
e
s
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
▪
proof
is a
P
r
o
o
f
O
b
j
e
c
t
such as the result of
F
i
n
d
E
q
u
a
t
i
o
n
a
l
P
r
o
o
f
. Each premise becomes an
a
x
i
o
m
, each derived step a
t
h
e
o
r
e
m
with a tactic proof, and the goal the
"
F
i
n
a
l
G
o
a
l
"
theorem.
▪
Types are carried as
L
e
a
n
T
e
r
m
expression trees; step proofs are emitted as Lean tactic blocks (
h
a
v
e
,
c
o
n
v
,
s
i
m
p
o
n
l
y
,
e
x
a
c
t
). The result therefore round-trips through
L
e
a
n
E
x
p
o
r
t
S
t
r
i
n
g
into compilable Lean source.
▪
Because the transpiled environment is real Lean, you can re-check it - opening the
"
F
i
n
a
l
G
o
a
l
"
with
L
e
a
n
S
t
a
t
e
and confirming it auto-completes verifies the transpilation.
▪
A step of the proof with no translation to Lean yet, such as a substitution rule an axiom gives, leaves the theorem it proves with the proof
s
o
r
r
y
, and
P
r
o
o
f
T
o
L
e
a
n
says which theorems those are.
Examples
(
4
)
Basic Examples
(
1
)
Transpile an equational proof:
I
n
[
1
]
:
=
p
r
o
o
f
=
F
i
n
d
E
q
u
a
t
i
o
n
a
l
P
r
o
o
f
[
a
c
,
{
a
b
,
b
c
}
]
;
l
e
a
n
E
n
v
=
P
r
o
o
f
T
o
L
e
a
n
[
p
r
o
o
f
]
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
:
5
K
i
n
d
s
:
3
a
x
i
o
m
2
t
h
e
o
r
e
m
The generated constants - premises, derived step, and goal:
I
n
[
2
]
:
=
K
e
y
s
[
l
e
a
n
E
n
v
]
O
u
t
[
2
]
=
{
A
x
1
,
A
x
2
,
H
y
p
1
,
S
L
1
,
F
i
n
a
l
G
o
a
l
}
The final goal's type:
I
n
[
3
]
:
=
l
e
a
n
E
n
v
[
"
F
i
n
a
l
G
o
a
l
"
]
[
"
T
y
p
e
F
o
r
m
"
]
O
u
t
[
3
]
=
∀
(
a
:
U
)
(
c
:
U
)
,
a
=
c
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
E
x
p
o
r
t
S
t
r
i
n
g
▪
L
e
a
n
S
t
a
t
e
▪
L
e
a
n
E
n
v
i
r
o
n
m
e
n
t
▪
L
e
a
n
I
m
p
o
r
t
S
t
r
i
n
g
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
"
"