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

  • LeanLink

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`
LeanExportString
​
LeanExportString
[env]
converts a
LeanEnvironment
to a Lean 4 source-code string.
​
Details and Options
Examples  
(2)
Scope  
(1)
Exporting an imported environment renders each declaration's type, with
sorry
standing in for bodies that are not reconstructible from compiled data:
In[1]:=
env=
LeanImportString
["theorem myT : Nat.succ 0 = 1 := rfl"];​​
LeanExportString
[env]
Out[1]=
theorem myT : (Nat.succ (OfNat.ofNat Nat 0 (instOfNatNat 0))) = (OfNat.ofNat Nat 1 (instOfNatNat 1)) := sorry
Properties & Relations  
(1)

SeeAlso
LeanExport
 
▪
LeanImportString
 
▪
ProofToLean
 
▪
LeanEnvironment
RelatedGuides
▪
LeanLink
Export a transpiled proof - the cleanest round-trip, since
ProofToLean
emits real tactic bodies:
In[1]:=
leanEnv=
ProofToLean
[FindEquationalProof[ac,{ab,bc}]];​​
LeanExportString
[leanEnv]
Out[1]=
axiom U : Type​​axiom Ax1 : b = aaxiom Ax2 : b = caxiom Hyp1 : a = ctheorem SL1 : a = c := by have h := Ax2 conv at h => lhs; simp only [Ax1] exact h​theorem FinalGoal : a = c := by exact SL1
""

© 2026 Wolfram. All rights reserved.

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