The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
> Dependent types for beginners, taught the way *The Little Schemer* taught recursion. > Start with a pond. End with a compiler that is proved to keep its meaning. > A proposition is a type. A proof is a thing of that type.
Minimum price
$15.00
$25.00
About the Book
A small pond: algae, snails and flies, frogs and fish, a duck, a heron and an otter. Eleven short lines say who eats whom. Ask a program whether the heron is above the algae and it may say yes. This book asks for more: a reason you can hold, check, and pass to another program. In Lean 4, the claim "the heron is above the algae" is a type, and a proof of it is a thing of that type. Lean checks the proof the way it checks any program, before anything runs and without trusting anyone.
That idea has a second half, and it is the one in the title. In Lean, a type can mention a value. A list can carry its length in its type, so asking for the first element of an empty list is not a crash at run time but a mistake Lean refuses to accept. Types like that are called dependent types. With them, a program can say what it promises, and a proof can show that it keeps the promise.
This little book teaches both ideas from zero, in the question-and-answer style of The Little Schemer. Each page has two columns, a short question on the left and a short answer on the right. Cover the answers with a card, try, then look. The question you will answer most often is "What is the goal now?", because proofs are written with Lean's tactics from the very first one, and the goal is the best teacher a beginner has. Now and then a box states a Maxim, a short rule the questions above it have earned, from "Every thing has a type. Ask #check before you guess." to "Make wrong programs impossible to write. Then prove the rest."
What you will learn
False and "not", "for every" and "there is": nothing eats the heron, and here is why.rfl can see, and rewriting when computing is not enough.Who it is for
Students and programmers who have never taken a logic course and never written a proof. You need some programming in any language, a pencil, and patience. No mathematics, no Mathlib and no prior Lean are assumed. You do not need to know what ∀ or Π means; by Chapter 8 you will have written both. The Little Elpier, the book this one follows, helps but is not required. A chapter is an evening's work.
What you get
Every example is checked
Everything runs on core Lean 4 (version 4.35.0), with no libraries to install beyond Lean itself. One lake build sets up the pond on macOS, Linux and Windows. Open the companion code in VS Code with the Lean 4 extension and every goal in the book appears beside the proof as you move through it.
About the Author
Hey I am Volodymyr
Seasoned Developer's Journey from COBOL to Web 3.0, SSI, Privacy First Edge AI, and Beyond
As a seasoned developer with over 20 years of experience, I have worked with various programming languages, including some that are considered "dead," such as COBOL and Smalltalk. However, my passion for innovation and embracing cutting-edge technology has led me to focus on the emerging fields of Web 5.0, Self-Sovereign Identity (SSI),AI Agents, Knowledge Graphs, Agentiic memory systems, and the architecture of a decentralized world that empowers data democratization.
A firm believer in the potential of agent systems and the concept of a "soft" internet, I am dedicated to exploring and promoting these transformative ideas. In addition to writing, I also enjoy sharing my knowledge and insights through videoblogging. Most of my Medium posts serve as supplementary content to the videos on my YouTube channel, which you can explore here: https://www.youtube.com/c/VolodymyrPavlyshyn.
Join me on this exciting journey as we delve into the future of technology and the possibilities it holds.
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
Learn more about writing on Leanpub
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.