Writing Mathematical Proofs in Lean 4
ANT
• Instant access to your digital edition.
• Read anytime, anywhere, on your favorite device.
• No shipping — your book is delivered digitally.
• Simple, secure access after purchase.
Instant digital delivery after purchase.
Discover another great read to add to your digital library.
Description
Writing Mathematical Proofs in Lean 4 is a hands-on guide to turning familiar “paper proofs” into precise, machine-checked code. Lean 4 is a modern proof assistant: it lets you write mathematical statements as types and proofs as programs, and it refuses to accept hidden gaps, missing assumptions, or hand-wavy steps. The result is a new kind of confidence—proofs you can run, reuse, and build on.
This book is not about handing mathematics over to a machine. You still supply the ideas: definitions, lemmas, and the structure of the argument. Lean provides the footing. It tells you exactly what remains to be proved, which hypotheses are available, and where a proof attempt goes off the rails. Compared with pencil-and-paper proofs, each step may feel smaller—but it is also unambiguous, repairable, and reusable.
Written for readers who want to learn by doing , the book encourages you to type Lean code yourself, watch goals evolve in the Infoview, and build practical habits for debugging proofs: using #check and #eval, reading error messages, and letting simplification and rewriting handle the routine work while you focus on the ideas.
Inside the book
Set up a Lean 4 environment (VS Code, toolchains, projects, and mathlib). Learn the core language ideas—functions, data types, and propositions—through Lean's type system. Build an “everyday tactics” toolkit: intro, rw, simp, cases, induction, calc, and more. Practice on concrete, readable theorems with paper-style explanations alongside Lean code. Formalize classic results: algebraic identities, De Morgan's laws, Euclid's proof of infinitely many primes, the irrationality of √2 , and the Pythagorean theorem. Get a guided tour of mathlib: how the library is organized, how to search it (including #find and library_search), and how to reuse existing lemmas naturally. See applications and next steps: how formal proofs connect to software verification, and how to engage with the community on GitHub and Zulip. Appendices with a selected tactic list, key terminology, and high-level sketches that place large theorems—such as Fermat's Last Theorem and the ABC conjecture—into a long-term “Lean 4 perspective.” Who this book is for : students who want to understand proofs more carefully, programmers curious about type systems and functional programming, educators looking for reliable exercises, and anyone interested in the growing ecosystem around Lean 4 and mathlib.
Prerequisites : comfort with high-school algebra and basic mathematical notation is enough to start. Programming experience helps, but the book is written to be friendly to motivated self-learners.
If you have ever wished proofs were checked as strictly as programs, this book will help you take your first confident steps—one verified line at a time.
Specifications
Frequently asked
Do I need an account to download?
No. After purchase, you can access your ebook directly from the order confirmation or download page.
What if a copy arrives damaged?
Contact us and we’ll help you access the file or provide a replacement download if needed.