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.
elan: in any bash-compatible shell, run$ curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- --default-toolchain leanprover/lean4:nightlySee the
elan link above for other installation options and details. Note that using Lean with multi-file projects on Windows currently comes with some additional limitations.lean4 extension..lean and add the following code:import Leanpkg #eval Leanpkg.leanVersionStringYou 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.
leanpkg.toml. You can create your own packages using leanpkg init on 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.