Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To get started with Lean, install VS Code and the official Lean 4 extension, follow its guided setup, and open a saved .lean file. Learn the basics with the Natural Number Game or an official tutorial suited to your background. When you move from experiments to a real project—or need Mathlib—use Lake and keep the project’s Lean toolchain and dependencies aligned.

What Lean does in a proof workflow

Lean is both a functional programming language and a theorem prover. You express definitions and propositions in Lean’s type theory, then construct proofs—directly or with tactics—and ask Lean to check them. Its editor integration gives continuous feedback as you write and revise code, so errors can be investigated in context rather than only after a separate build.

The official tutorial starts with dependent type theory, propositions and proofs, quantifiers, equality, and tactics. It describes its purpose this way: “This book is designed to teach you to develop and verify proofs in Lean.” Theorem Proving in Lean 4 is credited to Jeremy Avigad, Leonardo de Moura, Soonho Kong, and Sebastian Ullrich; that sentence is not attributed to any one of them.

Install Lean 4 with the recommended setup

  1. Install VS Code. Lean’s official installation guide recommends VS Code as its best-supported setup route.
  2. Install the official Lean 4 extension. Use the extension’s guided setup flow rather than piecing together a toolchain manually.
  3. Create and save a .lean file. Allow the setup to finish, then use the editor to work through Lean examples. Consult the extension setup guide if expected editor features have not appeared; incomplete setup can look like a Lean error.

A terminal-based route is available in the Lean manual, but some instructions are operating-system specific and may need adaptation. The official setup material does not specify minimum hardware requirements.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a learning path that fits your goal

The official Lean learning catalog offers different entry points. Pick based on what you want to learn, not an assumed completion time: the catalog does not provide a comparative time-to-completion or difficulty scale.

Starting point Best fit What it focuses on
Natural Number Game Beginners who want to start proving theorems interactively Learning proof construction through a guided game
Theorem Proving in Lean 4 Learners focused on Lean’s proof language and tactics Proof foundations, including propositions, proofs, quantifiers, equality, and tactics
Mathematics in Lean Readers aiming to formalize mathematics with Mathlib Mathematical formalization using Lean and Mathlib
Functional Programming in Lean Programmers who want to begin with the language Functional programming in Lean

If your immediate aim is writing proofs, start with the Natural Number Game or Theorem Proving in Lean 4. If your aim is to formalize mathematics, use Mathematics in Lean. If you are primarily learning the programming language, choose Functional Programming in Lean.

Move from a scratch file to a Lake project

A single saved file is useful for experimenting. When you need a managed project, use Lake, Lean’s project and dependency tooling. The Lean manual documents creating a project that uses Mathlib and notes that the initial dependency download can take time.

  1. Create or enter the project using the manual’s Lake instructions for your setup.
  2. Follow the project’s dependency instructions to obtain the required packages; allow extra time for the first Mathlib download.
  3. Use the Lean version specified by the project’s lean-toolchain file, and keep it aligned with the Mathlib revision the project requires.

Do not replace a project’s pinned toolchain with an unpinned “latest” version. Lean and Mathlib versions need to agree for the project to work as intended.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When to add Mathlib

Mathlib is Lean’s mathematical library and is the relevant dependency when your work follows a Mathlib-based formalization path, such as the material in Mathematics in Lean. For initial experiments with Lean’s proof language, begin with the chosen learning resource and its instructions; add dependencies when the project or lesson calls for them. This keeps the setup tied to the work you intend to do rather than adding project complexity prematurely.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep tutorial and project versions in sync

Lean’s version changes over time, and online documentation can follow those changes. At the time reflected by the current official pages, Theorem Proving in Lean 4 identifies Lean 4.33.0 as its assumed version. Official release pages list Lean 4.33.0, dated August 10, 2026, and Lean 4.32.0, dated July 13, 2026. For an existing project, its lean-toolchain and dependency instructions are the authority; for a tutorial, check the version the page says it assumes.

If code or editor behavior does not match an older lesson, first check whether the lesson and your project use compatible Lean versions. Avoid changing a project’s toolchain casually, especially when Mathlib is involved.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.