A Lean 4 Proof Gym

Learn mathematics
by proving it.

Progressive exercises in formal proof. Start from True, build to real analysis. You don't understand a theorem until you've proved it yourself.

How it works

1

Read the mathematics

Each exercise explains the concept — what the theorem means, why it matters, and the intuition behind it.

2

Write the proof

Translate your understanding into a formal Lean 4 proof. Start with the skeleton, fill in the tactics.

3

Check it compiles

Paste into Lean 4 Web or your local VS Code. If Lean accepts it, you've proved it.

Tracks

Each track is a sequence of lessons and exercises, ordered by difficulty. Learn the maths, then prove it.

∧ ∨ ¬

Logic

Propositional logic, implications, if-and-only-if, negation, classical reasoning.

6 exercises
ℕ → ℤ

Natural Numbers

Peano axioms, induction, addition, multiplication, ordering.

5 exercises
∈ ∪ ∩

Sets

Membership, subsets, union, intersection, complements, power sets.

coming soon
f : A → B

Functions

Injectivity, surjectivity, composition, inverse functions.

coming soon
G × H

Algebra

Groups, rings, homomorphisms, quotients.

coming soon
ε → 0

Real Analysis

Limits, continuity, sequences, series, the reals.

coming soon

What you need

Mathematics

None beyond basic arithmetic. We teach the maths as we go. That's the point.

Programming

Helpful but not required. If you've used any programming language, Lean's syntax will feel familiar.

Tools

A browser. Use Lean 4 Web to check your proofs. Or install Lean 4 + VS Code locally for a better experience.