Try doing some basic maths questions in the Lean Theorem Prover. Functions, real numbers, equivalence relations and groups. Click on README.md and then on "Open in CoCalc with one click".
License: APACHE
How to install Lean and mathlib on MacOS
This document explains how to get started with Lean and mathlib.
If you get stuck, please come to the chat room to ask for assistance.
If you prefer, you can watch a short video tutorial
We'll need to set up Lean, an editor that knows about Lean, and mathlib (the standard library).
Rather than installing Lean directly, we'll install a small program called elan which automatically provides the correct version of Lean on a per-project basis. This is recommended for all users.
Installing elan
We'll need a terminal, along with some basic prerequisites. Install homebrew, then run
brew install gmp coreutilsin a terminal (gmpis required bylean,coreutilsbyleanpkg).At a terminal, run the command
curl https://raw.githubusercontent.com/Kha/elan/master/elan-init.sh -sSf | shand hit enter when a question is asked.
It is recommended that you re-login, so that your environment knows about
elan. (Alternatively, typesource $HOME/.elan/envto update the current terminal.)
Installing mathlib supporting tools
At a terminal, run the command
If the script asks you whether you want to install python3 and pip3, type y.
This will install tools that, amongst other things, let you download compiled binaries for mathlib.
Then run source ~/.profile, so that your environment knows about update-mathlib.
Installing and configuring an editor
There are two editors you can use with Lean, VS Code and emacs. This document describes using VS Code (for emacs, look at https://github.com/leanprover/lean-mode).
Install VS Code.
Launch VS Code.
Click on the extension icon
(or
in older versions) in the side bar on the left edge of the screen (or press ⇧ Shift⌘ CommandX) and search for leanprover.Click "install" (In old versions of VSCode, you might need to click "reload" afterwards)
Verify Lean is working, for example by saving a file
test.leanand entering#eval 1+1. A green line should appear underneath#eval 1+1, and hovering the mouse over it you should see2displayed.
You can now read instructions about creating and working on Lean projects