Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sources and coverage

This book teaches programming and proofs through a shared account model. It also covers package maintenance, a CLI with a checked contract, integration testing, and debugging, and concludes with an independent transfer exercise.

Primary sources

Use these references for further detail and to identify the versions covered in this book.

Integrated coverage

Source topicWhere it is taught here
Expressions, types, functions, structures, pattern matchingChapters 1–4
Polymorphism, universes, implicit argumentsChapters 2, 9, 12, and 14
Propositions, proofs, quantifiers, equalityChapters 5–7
Tactic proofs, interaction, conversion modeChapters 6–8 and 19
Inductive types, recursion, inductionChapters 3–4 and 8
Overloading, type classes, coercionsChapter 9
Functors, applicatives, monads, and IOChapter 10
Readers, state, exceptions, transformer orderChapter 11
Dependent programming, indices, proof-carrying dataChapter 12
Connecting programs to contractsChapters 8, 13, 16, and 18
Runtime behaviour and efficient representationsChapter 16
Classical reasoning, axioms, erasure, trustChapters 5 and 17
Project structure, dependencies, mathematical librariesChapters 14–15
Practical text handling and syntax extensionsAppendices A–B

The sequence introduces each concept before relying on it. Logical constructors follow the corresponding data constructors. The book introduces induction after recursion, dependent types after proof construction, and optimisation after proving a specification.

Validation and scope

Run nix develop --command make check from the deva repository. The command checks formatting, extracts and checks every lean fence in chapter order within its page, builds the workbook’s native executable, checks its proof file with warnings treated as errors, runs 6 CLI integration cases, and builds every mdBook. The standard-library examples target Lean 4.35.0.

The Mathlib track uses the separate pinned package described in Chapter 15. It requires its own dependency cache and check command.

The shell setup instructions assume an Elan installation. The deva development shell supplies Lean directly.

Successful completion establishes a foundation for ordinary Lean programming and proof development. Advanced mathematical formalisation, substantial tactic implementation, compiler work, concurrent systems, and production persistence require domain-specific practice beyond the examples here. In the transfer assessment, you implement a new operation, state and prove its contract, and connect it to a tested executable.