Wolfram Language Paclet Repository
Community-contributed installable additions to the Wolfram Language
Native link between Wolfram Language and Lean 4
Contributed by: Nik Murzin
LeanLink is a high-performance native bridge between the Wolfram Language and the Lean 4 theorem prover. It enables interoperability, allowing users to import entire Lean projects like Mathlib directly into a native Wolfram environment. Utilizing a fast binary serialization backend, the package lets you seamlessly visualize proof dependencies as native graphs, transpile mathematical proofs into validated Lean code, and compile formal Lean types into executable Wolfram functions.
To install this paclet in your Wolfram Language environment,
evaluate this code:
PacletInstall["Wolfram/LeanLink"]
To load the code after installation, evaluate this code:
Needs["Wolfram`LeanLink`"]
Load an example lean environment:
| In[1]:= |
| Out[1]= |
Query its properties:
| In[2]:= |
| Out[2]= |
| In[3]:= |
| Out[3]= | ![]() |
Inspect Lean terms:
| In[4]:= |
| Out[4]= |
| In[5]:= |
| Out[5]= |
| In[6]:= |
| Out[6]= |
| In[7]:= |
| Out[7]= |
| In[8]:= |
| Out[8]= | ![]() |
| In[9]:= |
| Out[9]= | ![]() |
Load mathlib environment:
| In[10]:= |
| Out[10]= | ![]() |
| In[11]:= |
| Out[11]= | ![]() |
Create Lean state for interactive proving:
| In[12]:= |
| Out[12]= | ![]() |
Apply tactic:
| In[13]:= |
| Out[13]= | ![]() |
Wolfram Language Version 14.0