1.6 KiB
1.6 KiB
Quickstart
These instructions will walk you through setting up Lean using the "basic" setup and VS Code as the editor. See Setup for other ways and more details on setting up Lean.
- Install the latest Lean 4 nightly through
elan: in any bash-compatible shell, run
Alternatively, on Windows, download the latest release and run the contained$ curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- --default-toolchain leanprover/lean4:nightlyelan-init.exe.
See theelanlink above for other installation options and details. - Install VS Code.
- Open VS Code and install the
lean4extension.

- Create a new file with the extension
.leanand add the following code:
You should get a syntax-highlighted file with a "Lean Infoview" on the right that tells you the installed Lean version when placing your cursor on the last line.import Leanpkg #eval Leanpkg.leanVersionString

- You are set up! Try opening a Lean package with a
leanpkg.toml. You can create your own packages usingleanpkg initon the command line. Packages have to be opened using "File > Open Folder..." for imports to work. Saved changes are visibly in other files after running "Lean 4: Refresh File Dependencies" (Ctrl+Shift+X) in them.