Basic Examples
Basic Examples
Import a focused mathlib module:
In[1]:=
env=LeanImport"Mathlib.Data.Nat.Choose.Basic","ProjectDir"->[]["Directory"]
Out[1]=
LeanEnvironment
Compute an exact binomial coefficient:
In[2]:=
LeanEvaluate[env["Nat.choose"],10,4]
Out[2]=
LeanEvaluateLeanTerm,10,4
Read a theorem's type:
In[3]:=
env["Nat.add_comm"]["TypeForm"]
Out[3]=
∀ (n m : ℕ), n + m = m + n
Release the environment:
In[4]:=
LeanFreeEnvironment[env]
Out[4]=
LeanFreeEnvironmentLeanEnvironment