Installation & Setup
Set up Lean with VS Code, Lake, and the Lean 4 extension. This will give you the interactive Infoview and live feedback.
Install Lean via elan
Use elan to manage Lean toolchains. It works like Rust'srustup.
bash
1# Windows (PowerShell)2winget install Lean4.elan34# macOS / Linux5curl -sSf https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh | shVS Code Extension
Install the Lean 4 extension from the VS Code marketplace. Once installed, every Lean file gives you inline diagnostics and an Infoview panel.
💡
After installing the extension, open the command palette and run “Lean: Restart File” to refresh the toolchain if needed.
Create a First Project
Create a new project with lake and open it in VS Code.
bash
1mkdir lean-playground2cd lean-playground3lake init hello4code .Exercise: Verify Your Setup
Open Main.lean and add an #eval line. If the Infoview shows the result, your setup works.
lean
1#eval "Lean is ready"Key Takeaway
The fastest way to learn Lean is to keep the editor open, run small snippets, and read the Infoview after every change.