โ† Contents

Epilogue

What you built, and where it goes from here.

Eight chapters ago the pitch was that formal verification only sounds like specialist work. If you made it here, you've now done it โ€” on arithmetic you've known since primary school, but done properly.

What you actually did

You took the algorithms everyone learns by hand and wrote each one as a Lean program: the carry in addition, the borrow in subtraction, partial products in multiplication, the trial-digit search in division, the digit tests for divisibility, Euclid's rectangle-carving gcd, and two mental "tricks" that turned out to have real theorems hiding inside them.

Then, for every one, you did the thing that makes it verification rather than programming: you proved it correct โ€” not checked it on a few examples, but showed it gives the right answer for every input there is. And these aren't proofs you have to take on trust. Lean's kernel checked each one, and it would have rejected a single wrong step. The green checkmark means the machine agrees.

Along the way you met the ideas that carry all of formal verification โ€” each introduced in one chapter, then used again and again:

None of these change when the programs get serious.

Where this goes

The same move โ€” state a specification, prove the implementation meets it โ€” scales a very long way:

The distance between what you did and those projects is size and stamina, not kind. The omega and induction you called are the same tactics; the rectangle only got bigger.

Carrying on with Lean

If the folded-away Lean proofs pulled at you rather than put you off, these are the routes that fit best coming from this book:

The best next step is small: clone this book's repo, open a chapter's worksheet in VS Code, and change one proof to see what breaks. Watching the goal state move under your own edits is where it starts to click.

Thanks for reading. You came for a party trick or a curiosity about proofs, and you leave able to read โ€” and write โ€” a statement that a program is correct, and to know the difference between believing it and proving it. That's the whole game.

The Lean community keeps a fuller, always-current catalogue of tutorials, games and books at leanprover-community.github.io/learn โ€” start there whenever you want the complete map.

โ† Square Roots by Hand Contents fin.