verifying-crypto-with-lean/main.tex

228 lines
10 KiB
TeX
Raw Normal View History

\documentclass[11pt]{report}
\input{preamble}
\begin{document}
% ===================== TITLE PAGE =====================
\begin{titlepage}
\pagecolor{ink}\color{paper}
\begin{tikzpicture}[remember picture,overlay]
% The proof pyramid the book climbs. Cover-design law, learned twice:
% an unlabeled near-invisible shape on a dark ground reads as a printing
% artifact, not a motif. So the pyramid declares itself — visible fills,
% named floors, a caption. Solid mixed colors only (transparency on dark
% renders as smudge and varies by viewer).
\foreach \i/\w/\layer in {0/5.4/Field, 1/4.2/Group law, 2/3.0/Scalars, 3/1.8/Signature}{
\draw[paper!45!ink, line width=0.6pt, fill=paper!12!ink]
print-quality pass: the book gets looked at, and the looking becomes a gate The operator caught what no check had ever tested: nobody had LOOKED at the rendered pages. A ten-inspector visual audit of all 129 pages (every page opened as an image) found 40 defects, including didactic correctness bugs invisible to the text layer: BAD, fixed: - ch03 printed WRONG Lean operators: \lean{P /\ Q} lost its backslash ('P / Q') and \lean{P \/ Q} lost the operator entirely ('P Q') — TeX ate them inside the non-verbatim macro. Now the unicode ∧/∨ the book uses everywhere else. - ch12: the doubling display overflowed its box border, slicing the math; stacked on two lines. - toolkit Card 6: the headroom-audit display was clipped by the page edge; now an align* stack. UGLY, fixed: - title page: the 'pyramid motif' at 5% white opacity on near-black rendered as smudge artifacts, plus a clipped ∀ glyph in the corner — redrawn with solid mixed colors (no transparency), glyph removed; the footer's mid-word paragraph gap was a \vspace landing inside horizontal mode; fixed with \par - ch06: both clock diagrams' wrap-around arrows ran counterclockwise, retracing over earlier arcs — target position expressed as 12 (one revolution) so the arc continues clockwise, landing on 0 (mod 12) and 1 (mod 11) correctly - ch04: two_mul'' printed as two_mul" (quote ligature) - one-line orphaned box fragments and stranded solution headings throughout: bigidea/tryit/pitfall/aha/checkpoint are now unbreakable (none exceeds half a page), worked boxes announce '(continued)' after a break, \solhead keeps four lines with \Needspace - --all/--receipt flags printed as one merged dash: \ddash macro - inline code no longer hyphen-breaks at underscores (codeguards) - ch09's 2^{...} smudge, glossary margin overflow, ch08 orphaned listing line, ch13 command-line layout, three >10pt overfulls THE STRUCTURAL LESSON, encoded: the two worst clipping bugs had been announced as 80pt/73pt overfull warnings in every build log and ignored. check-book.sh now FAILS on any overfull box past 10pt — the machine was telling us; now it is allowed to stop us. 132 pages; publication-history and README counts synced; every fixed page re-rendered and verified by eye. Button: ALL GREEN (96 checks). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-08 17:11:09 +00:00
($(current page.center)+(-\w/2,{-3.0+\i*0.95})$) rectangle ++(\w,0.8);
\node[paper!80!ink, font=\footnotesize\scshape]
at ($(current page.center)+(0,{-2.6+\i*0.95})$) {\layer};
}
\node[paper!55!ink, font=\small\itshape, anchor=north]
at ($(current page.center)+(0,-3.35)$)
{the proof pyramid this book climbs};
\end{tikzpicture}
\vspace*{3.2cm}
{\fontsize{15}{18}\selectfont\scshape\color{accent} a hands-on course in\par}
\vspace{0.5cm}
{\fontsize{40}{44}\selectfont\bfseries Verifying Cryptography\\[2pt] with Lean 4\par}
\vspace{0.8cm}
{\fontsize{15}{20}\selectfont\color{paper}
print-quality pass: the book gets looked at, and the looking becomes a gate The operator caught what no check had ever tested: nobody had LOOKED at the rendered pages. A ten-inspector visual audit of all 129 pages (every page opened as an image) found 40 defects, including didactic correctness bugs invisible to the text layer: BAD, fixed: - ch03 printed WRONG Lean operators: \lean{P /\ Q} lost its backslash ('P / Q') and \lean{P \/ Q} lost the operator entirely ('P Q') — TeX ate them inside the non-verbatim macro. Now the unicode ∧/∨ the book uses everywhere else. - ch12: the doubling display overflowed its box border, slicing the math; stacked on two lines. - toolkit Card 6: the headroom-audit display was clipped by the page edge; now an align* stack. UGLY, fixed: - title page: the 'pyramid motif' at 5% white opacity on near-black rendered as smudge artifacts, plus a clipped ∀ glyph in the corner — redrawn with solid mixed colors (no transparency), glyph removed; the footer's mid-word paragraph gap was a \vspace landing inside horizontal mode; fixed with \par - ch06: both clock diagrams' wrap-around arrows ran counterclockwise, retracing over earlier arcs — target position expressed as 12 (one revolution) so the arc continues clockwise, landing on 0 (mod 12) and 1 (mod 11) correctly - ch04: two_mul'' printed as two_mul" (quote ligature) - one-line orphaned box fragments and stranded solution headings throughout: bigidea/tryit/pitfall/aha/checkpoint are now unbreakable (none exceeds half a page), worked boxes announce '(continued)' after a break, \solhead keeps four lines with \Needspace - --all/--receipt flags printed as one merged dash: \ddash macro - inline code no longer hyphen-breaks at underscores (codeguards) - ch09's 2^{...} smudge, glossary margin overflow, ch08 orphaned listing line, ch13 command-line layout, three >10pt overfulls THE STRUCTURAL LESSON, encoded: the two worst clipping bugs had been announced as 80pt/73pt overfull warnings in every build log and ignored. check-book.sh now FAILS on any overfull box past 10pt — the machine was telling us; now it is allowed to stop us. 132 pages; publication-history and README counts synced; every fixed page re-rendered and verified by eye. Button: ALL GREEN (96 checks). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-08 17:11:09 +00:00
From {\ttfamily 1+1=2} to a machine-checked proof that\\ real elliptic-curve code is correct.\par}
\vfill
{\large\color{paper} A curriculum for the curious undergraduate ---\\
no prior formal-verification or Lean experience assumed.\par}
\vspace{0.8cm}
print-quality pass: the book gets looked at, and the looking becomes a gate The operator caught what no check had ever tested: nobody had LOOKED at the rendered pages. A ten-inspector visual audit of all 129 pages (every page opened as an image) found 40 defects, including didactic correctness bugs invisible to the text layer: BAD, fixed: - ch03 printed WRONG Lean operators: \lean{P /\ Q} lost its backslash ('P / Q') and \lean{P \/ Q} lost the operator entirely ('P Q') — TeX ate them inside the non-verbatim macro. Now the unicode ∧/∨ the book uses everywhere else. - ch12: the doubling display overflowed its box border, slicing the math; stacked on two lines. - toolkit Card 6: the headroom-audit display was clipped by the page edge; now an align* stack. UGLY, fixed: - title page: the 'pyramid motif' at 5% white opacity on near-black rendered as smudge artifacts, plus a clipped ∀ glyph in the corner — redrawn with solid mixed colors (no transparency), glyph removed; the footer's mid-word paragraph gap was a \vspace landing inside horizontal mode; fixed with \par - ch06: both clock diagrams' wrap-around arrows ran counterclockwise, retracing over earlier arcs — target position expressed as 12 (one revolution) so the arc continues clockwise, landing on 0 (mod 12) and 1 (mod 11) correctly - ch04: two_mul'' printed as two_mul" (quote ligature) - one-line orphaned box fragments and stranded solution headings throughout: bigidea/tryit/pitfall/aha/checkpoint are now unbreakable (none exceeds half a page), worked boxes announce '(continued)' after a break, \solhead keeps four lines with \Needspace - --all/--receipt flags printed as one merged dash: \ddash macro - inline code no longer hyphen-breaks at underscores (codeguards) - ch09's 2^{...} smudge, glossary margin overflow, ch08 orphaned listing line, ch13 command-line layout, three >10pt overfulls THE STRUCTURAL LESSON, encoded: the two worst clipping bugs had been announced as 80pt/73pt overfull warnings in every build log and ignored. check-book.sh now FAILS on any overfull box past 10pt — the machine was telling us; now it is allowed to stop us. 132 pages; publication-history and README counts synced; every fixed page re-rendered and verified by eye. Button: ALL GREEN (96 checks). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-08 17:11:09 +00:00
{\color{paper!40!ink}\rule{\linewidth}{0.6pt}\par}
\vspace{0.15cm}
{\small\color{paper}\raggedright
Companion to a public transparency log of machine-checked proofs ---
\textbf{\code{ltl.zkdefi.org}}, 19 entries and counting, one of them
post-quantum. Open it on your phone now; by the last chapter you will be
able to verify every entry yourself.\par
\smallskip
Every code snippet in this book runs. Every claim it makes about a proof,
a proof assistant has checked.\par}
\end{titlepage}
\restoregeometry
\pagecolor{paper}\color{ink}
% BEGIN PUBHIST ==================== publication history =====================
% The current-edition line is machine-checked by check-book.sh: its chapter
% count and page count must match the built book, and the committed PDF must
% contain it. Historical lines are frozen and exempt from the claim checks.
\thispagestyle{empty}
\vspace*{2cm}
{\small
\noindent\textbf{Second edition} --- published August 8, 2026: fourteen
print-quality pass: the book gets looked at, and the looking becomes a gate The operator caught what no check had ever tested: nobody had LOOKED at the rendered pages. A ten-inspector visual audit of all 129 pages (every page opened as an image) found 40 defects, including didactic correctness bugs invisible to the text layer: BAD, fixed: - ch03 printed WRONG Lean operators: \lean{P /\ Q} lost its backslash ('P / Q') and \lean{P \/ Q} lost the operator entirely ('P Q') — TeX ate them inside the non-verbatim macro. Now the unicode ∧/∨ the book uses everywhere else. - ch12: the doubling display overflowed its box border, slicing the math; stacked on two lines. - toolkit Card 6: the headroom-audit display was clipped by the page edge; now an align* stack. UGLY, fixed: - title page: the 'pyramid motif' at 5% white opacity on near-black rendered as smudge artifacts, plus a clipped ∀ glyph in the corner — redrawn with solid mixed colors (no transparency), glyph removed; the footer's mid-word paragraph gap was a \vspace landing inside horizontal mode; fixed with \par - ch06: both clock diagrams' wrap-around arrows ran counterclockwise, retracing over earlier arcs — target position expressed as 12 (one revolution) so the arc continues clockwise, landing on 0 (mod 12) and 1 (mod 11) correctly - ch04: two_mul'' printed as two_mul" (quote ligature) - one-line orphaned box fragments and stranded solution headings throughout: bigidea/tryit/pitfall/aha/checkpoint are now unbreakable (none exceeds half a page), worked boxes announce '(continued)' after a break, \solhead keeps four lines with \Needspace - --all/--receipt flags printed as one merged dash: \ddash macro - inline code no longer hyphen-breaks at underscores (codeguards) - ch09's 2^{...} smudge, glossary margin overflow, ch08 orphaned listing line, ch13 command-line layout, three >10pt overfulls THE STRUCTURAL LESSON, encoded: the two worst clipping bugs had been announced as 80pt/73pt overfull warnings in every build log and ignored. check-book.sh now FAILS on any overfull box past 10pt — the machine was telling us; now it is allowed to stop us. 132 pages; publication-history and README counts synced; every fixed page re-rendered and verified by eye. Button: ALL GREEN (96 checks). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-08 17:11:09 +00:00
chapters, 132 pages.
\smallskip
\noindent The estate's companion paper: DOI
\href{https://doi.org/10.5281/zenodo.22057482}{10.5281/zenodo.22057482}.
\medskip
\noindent\emph{Publication history}
\begin{itemize}[leftmargin=1.4em]
\item \textbf{First edition}, July 3, 2026 --- twelve chapters and the
Interlude; expanded the same day with the pen-and-paper program and
in-book solution pathways (53 to 106 pages).
\item July 28, 2026 --- the Attestation Protocol added as a thirteenth
chapter.
\item \textbf{Second edition}, August 8, 2026 --- full didactic overhaul
(seven moves, from a seven-reader audit); new Chapter~13, \emph{The
Second Summit} (SLH-DSA, post-quantum); the Attestation Protocol becomes
the fourteen-chapter book's single finale; \code{check-book.sh} added ---
the script that verifies every countable claim in this book, including
the line at the top of this page, against measured reality.
\end{itemize}
\medskip
\noindent The complete revision record is the git history of
\code{github.com/saymrwulf/verifying-crypto-with-lean}.
}
\clearpage
% END PUBHIST ================================================================
% ===================== HOW TO READ =====================
\chapter*{How to read this book}
\markboth{How to read this book}{}
\addcontentsline{toc}{chapter}{How to read this book}
book overhaul moves 1+2: the minute-one artifact, and cold-open surgery on ch1 From the 7-reader didactic audit (control/BOOK-OVERHAUL-PLAN.md). The two highest-leverage moves per the cold-open reader and the panel's most-repeated finding. MOVE 1 — the reader touches the real thing in minute one. The panel's single loudest note: a book that teaches "demand verification" gave the reader nothing to verify for twelve chapters. Now: the title page names ltl.zkdefi.org (19 entries, one post-quantum, "verify every entry yourself by the last chapter"); the preface opens on that page instead of a generic power claim; ch1 gains a try-it box after the pyramid pointing at entries 13-16 and 18. And ch7's broken promise is honored — it invited "check one leaf" while never printing the 71-digit Q; the exact Q from P25519.lean is now on the page, no hidden digits (render-verified against the repo). MOVE 2 — ch1 cold open. Per the cold reader who hooked at line 13 and wobbled by line 31: the first worked box (a log10 re-derivation of a punch the prose already landed) collapses to four lines, the mechanics pushed to Exercise 1.1 — getting the reader ~30 lines sooner to the headroom box, the genuinely novel bit. The vague "In 2014, researchers…" opener becomes the actual bug: a two-line diff captioned as the entire defect, anchored to the real Fiat-Crypto S&P 2019 lineage (no fabricated CVE). Competitor roll-call → footnote. Syllabus roadmap → a second-person promise ("by Chapter 7 you will have handed a kernel a certificate…"). "Why Lean" vendor bullets → reader-inheritance voice ("you start on a million lines of proved mathematics"). Builds here: tectonic, 116 pages, zero errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-07 22:14:43 +00:00
There is a public web page --- \code{ltl.zkdefi.org} --- that lists nineteen
pieces of software, each stamped with a machine-checked proof that it does what
it claims. One of those stamps was earned two days before the writer of that
book overhaul move 6: the Second Summit chapter + the book ends once New Chapter 13, 'The Second Summit: A Hash-Based Pyramid' — SLH-DSA (FIPS 205) as the transfer experiment for the whole method: - opens on leaf 18 as the anomaly; correctness-vs-security across the quantum divide ('a correct implementation of a broken lock is still a broken lock') - Lamport -> Winternitz chains with the checksum see-saw run twice on real w=16 numbers, including a concrete failed forgery (480 -> 479, digit 14 -> 13) - FORS worked at napkin scale (k=2, a=2, one reuse = one forgery) and real scale (28 of 57,344, exponent 14) - the virtual hypertree: digest split 21/7/2 to the bit, the 54-bit meter peeled 9 bits per layer, verification priced exactly (254 fixed oracle calls; the see-saw itself caps a layer at 510, so worst case 3,824 — the naive 525*35 bound is unreachable, and the chapter says why); ~2^72 to build vs ~2^12 to check - the eleven certificates, the loop-to-fold bridges, the honest 'visible, not correct' boundary (no second semantics — and why the natural move fails), the cone-growth table, the t_l/t_len naming inversion told as the war story it was, the apex as an audit invitation with the verbatim theorem named - 'The leaf, live': leaf-vs-head precision ('plausible, and wrong twice'), the three-clause self-reference ledger (attested machinery / attested scheme / honest gap), one-command tryit - six exercises with pathway'd solutions; checkpoint hands the who-checks-them question to the finale Structural: attestation renamed ch14 and now carries the book's single ending (where-to-go, further reading, final reframe, prospective checkpoint — moved from ch12); its two interior checkpoints demoted to bigidea/tryit so the terminal checkpoint stands alone; opening now receives ch13's baton. ch12 ends as a chapter. Front matter: three-summit arc, fourteen-week plan, honest discussion-exercise count; ch01 promise ladder extended to Chapters 13/14; glossary +5 entries (and the pre-existing Hasse-bound misordering fixed); README fourteen chapters + build.sh recipe. Every constant verified against fips205-slhdsa-verified and lean-transparency-log by four adversarial checkers; arithmetic independently recomputed; didactic panel scored the chapter 9/8 — the book's high-water mark. Build: 128 pages, zero unresolved refs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-08 08:39:08 +00:00
proof could make anyone else believe it; another belongs to a signature scheme
built to survive a quantum computer. This book is the road from not
understanding a single word on that page to being able to verify every entry on
it yourself, and to add your own.
book overhaul moves 1+2: the minute-one artifact, and cold-open surgery on ch1 From the 7-reader didactic audit (control/BOOK-OVERHAUL-PLAN.md). The two highest-leverage moves per the cold-open reader and the panel's most-repeated finding. MOVE 1 — the reader touches the real thing in minute one. The panel's single loudest note: a book that teaches "demand verification" gave the reader nothing to verify for twelve chapters. Now: the title page names ltl.zkdefi.org (19 entries, one post-quantum, "verify every entry yourself by the last chapter"); the preface opens on that page instead of a generic power claim; ch1 gains a try-it box after the pyramid pointing at entries 13-16 and 18. And ch7's broken promise is honored — it invited "check one leaf" while never printing the 71-digit Q; the exact Q from P25519.lean is now on the page, no hidden digits (render-verified against the repo). MOVE 2 — ch1 cold open. Per the cold reader who hooked at line 13 and wobbled by line 31: the first worked box (a log10 re-derivation of a punch the prose already landed) collapses to four lines, the mechanics pushed to Exercise 1.1 — getting the reader ~30 lines sooner to the headroom box, the genuinely novel bit. The vague "In 2014, researchers…" opener becomes the actual bug: a two-line diff captioned as the entire defect, anchored to the real Fiat-Crypto S&P 2019 lineage (no fabricated CVE). Competitor roll-call → footnote. Syllabus roadmap → a second-person promise ("by Chapter 7 you will have handed a kernel a certificate…"). "Why Lean" vendor bullets → reader-inheritance voice ("you start on a million lines of proved mathematics"). Builds here: tectonic, 116 pages, zero errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-07 22:14:43 +00:00
You are about to learn one of the most powerful ideas in computer science: how
to make a computer \emph{prove} that a program is correct --- not test it on a
few inputs and hope, but establish, with the certainty of mathematics, that it
does the right thing on \emph{every} input. We will aim that power at
cryptography, where a single overlooked carry bit can quietly compromise every
key a system ever generates.
This book assumes you can program a little and remember a little high-school
algebra. It assumes \textbf{nothing} about formal methods, proof assistants, or
book overhaul move 6: the Second Summit chapter + the book ends once New Chapter 13, 'The Second Summit: A Hash-Based Pyramid' — SLH-DSA (FIPS 205) as the transfer experiment for the whole method: - opens on leaf 18 as the anomaly; correctness-vs-security across the quantum divide ('a correct implementation of a broken lock is still a broken lock') - Lamport -> Winternitz chains with the checksum see-saw run twice on real w=16 numbers, including a concrete failed forgery (480 -> 479, digit 14 -> 13) - FORS worked at napkin scale (k=2, a=2, one reuse = one forgery) and real scale (28 of 57,344, exponent 14) - the virtual hypertree: digest split 21/7/2 to the bit, the 54-bit meter peeled 9 bits per layer, verification priced exactly (254 fixed oracle calls; the see-saw itself caps a layer at 510, so worst case 3,824 — the naive 525*35 bound is unreachable, and the chapter says why); ~2^72 to build vs ~2^12 to check - the eleven certificates, the loop-to-fold bridges, the honest 'visible, not correct' boundary (no second semantics — and why the natural move fails), the cone-growth table, the t_l/t_len naming inversion told as the war story it was, the apex as an audit invitation with the verbatim theorem named - 'The leaf, live': leaf-vs-head precision ('plausible, and wrong twice'), the three-clause self-reference ledger (attested machinery / attested scheme / honest gap), one-command tryit - six exercises with pathway'd solutions; checkpoint hands the who-checks-them question to the finale Structural: attestation renamed ch14 and now carries the book's single ending (where-to-go, further reading, final reframe, prospective checkpoint — moved from ch12); its two interior checkpoints demoted to bigidea/tryit so the terminal checkpoint stands alone; opening now receives ch13's baton. ch12 ends as a chapter. Front matter: three-summit arc, fourteen-week plan, honest discussion-exercise count; ch01 promise ladder extended to Chapters 13/14; glossary +5 entries (and the pre-existing Hasse-bound misordering fixed); README fourteen chapters + build.sh recipe. Every constant verified against fips205-slhdsa-verified and lean-transparency-log by four adversarial checkers; arithmetic independently recomputed; didactic panel scored the chapter 9/8 — the book's high-water mark. Build: 128 pages, zero unresolved refs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-08 08:39:08 +00:00
Lean. We start from \code{1 + 1 = 2} and end three summits later: real,
published, machine-checked theorems about Ed25519 --- the signature scheme in
your SSH client, your phone, and half the internet --- then about a hash-based
scheme built for the quantum era, and finally about the public log that lets a
stranger check all of it without trusting anyone.
\begin{itemize}[leftmargin=1.4em]
\item \textbf{Do the exercises.} Reading a proof is like watching someone
swim. You learn by getting in the water. Solutions are in the \code{solutions/}
folder, but consult them only after a real attempt.
\item \textbf{Everything runs.} The \code{exercises/} folder has Lean files you
can open and check. When the book says ``Lean accepts this,'' you can watch it
happen.
\end{itemize}
\begin{aha}
The secret this book reveals: a proof is not a wall of Greek symbols meant to
intimidate. A proof is a \emph{program} --- and a proof assistant is a very
strict compiler for it. Once you see proofs as programs, the fear evaporates and
the fun begins.
\end{aha}
book overhaul moves 3-5: hook transplants, suspense mechanics, voice unification Per the 7-reader didactic panel and BOOK-OVERHAUL-PLAN.md: - front matter: box legend demoted below a lived example (the aha box becomes its own legend entry) - ch04: open on the stake (proof the size of a compiler), new section 'When you get stuck --- and you will' promoting the debugging session, checkpoint now carries the omega cliffhanger forward - ch06: open on the dare (invert 19 mod a 77-digit prime, two-digit numbers only), machine-referee #eval after the Euclid box, checkpoint distills the constant-time trade into one quotable sentence - ch10: cold-open on the 12 GB crash, spec vocabulary re-armed at the summit statement, falsification tryit after the 16p box (the -151 #eval), wall dispatch tied to the cold open, closing paragraph places the certificate in the live log - ch12: opening pyramid figure now carries question marks resolved layer by layer through the chapter (suspense instead of spoiler), kernel-wall rendered as a scene, 'Where you come in' promoted to its own subsection, false 'closing chapter' removed - appendix-toolkit: opens in the design-review room, Drill 7b (parity argument), street assignment close - appendix-walkthroughs: opens at the reader's low point, one-hole-one- paragraph contract, counts replaced by 'trust the folder' - appendix-repo-tour: active three-promise opener, sabotage-the-button tryit, final tour stop at the transparency log Build verified: tectonic clean, 118 pages, zero unresolved refs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-07 22:38:44 +00:00
\noindent\emph{(That green box you just read is an ``aha'' --- an intuition
meant to click. You will also meet coral \emph{big idea} boxes for
load-bearing concepts, grey \emph{try it} boxes that ask you to run something,
amber \emph{pitfall} boxes marking traps, and a framed \emph{checkpoint} at
each chapter's end. That is the whole legend; you have now seen one in the
wild.)}
\subsection*{Working the pen-and-paper material}
The notebook-ruled \emph{Pen and paper} boxes are not optional
enrichment; they are half the course. Each one performs a computation
with the \emph{real} constants of the systems under study ---
$2^{255}-19$, radix $2^{51}$, the fold constant $19$, the actual
inversion chain --- because the numbers themselves carry the arguments:
a headroom margin of $17$ bits, a design constant that fails at $8$ and
works at $16$, a certificate that beats trial division by a factor of
$10^{34}$. Copy each one out by hand at least once --- transcription is
where the steps become yours. Every chapter's exercises are followed
immediately by \emph{Solutions and pathways}: the pathway (how a person
finds the answer) before the answer, because the pathway is the
transferable part. The honest protocol: attempt, struggle a little,
then read --- in that order.
\subsection*{For instructors}
The book is engineered for self-study, which makes it easy to teach
from: every exercise carries an immediate pathway-then-answer solution,
so contact hours can go to the parts that need a human --- discussing
book overhaul move 6: the Second Summit chapter + the book ends once New Chapter 13, 'The Second Summit: A Hash-Based Pyramid' — SLH-DSA (FIPS 205) as the transfer experiment for the whole method: - opens on leaf 18 as the anomaly; correctness-vs-security across the quantum divide ('a correct implementation of a broken lock is still a broken lock') - Lamport -> Winternitz chains with the checksum see-saw run twice on real w=16 numbers, including a concrete failed forgery (480 -> 479, digit 14 -> 13) - FORS worked at napkin scale (k=2, a=2, one reuse = one forgery) and real scale (28 of 57,344, exponent 14) - the virtual hypertree: digest split 21/7/2 to the bit, the 54-bit meter peeled 9 bits per layer, verification priced exactly (254 fixed oracle calls; the see-saw itself caps a layer at 510, so worst case 3,824 — the naive 525*35 bound is unreachable, and the chapter says why); ~2^72 to build vs ~2^12 to check - the eleven certificates, the loop-to-fold bridges, the honest 'visible, not correct' boundary (no second semantics — and why the natural move fails), the cone-growth table, the t_l/t_len naming inversion told as the war story it was, the apex as an audit invitation with the verbatim theorem named - 'The leaf, live': leaf-vs-head precision ('plausible, and wrong twice'), the three-clause self-reference ledger (attested machinery / attested scheme / honest gap), one-command tryit - six exercises with pathway'd solutions; checkpoint hands the who-checks-them question to the finale Structural: attestation renamed ch14 and now carries the book's single ending (where-to-go, further reading, final reframe, prospective checkpoint — moved from ch12); its two interior checkpoints demoted to bigidea/tryit so the terminal checkpoint stands alone; opening now receives ch13's baton. ch12 ends as a chapter. Front matter: three-summit arc, fourteen-week plan, honest discussion-exercise count; ch01 promise ladder extended to Chapters 13/14; glossary +5 entries (and the pre-existing Hasse-bound misordering fixed); README fourteen chapters + build.sh recipe. Every constant verified against fips205-slhdsa-verified and lean-transparency-log by four adversarial checkers; arithmetic independently recomputed; didactic panel scored the chapter 9/8 — the book's high-water mark. Build: 128 pages, zero unresolved refs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-08 08:39:08 +00:00
the discussion exercises (Chapters 1, 7, 10, 11, and 13 carry one; they
are the seminar seeds), pair-debugging the Lean files, and auditing real repositories
together (Appendix~\ref{app:tour} is a ready-made lab session). Grading
suggestion: collect the pen-and-paper worked examples \emph{reproduced
from memory} rather than problem sets --- the book's bet is that a
student who can re-derive the $16p$ audit or the certificate cost
ledger unprompted has the durable skill, and that bet is testable. The
Lean solution files compile against the pinned toolchain in the repo;
\code{lake build Solutions} is your answer key's answer key. Prerequisites
in practice: one programming course (any language) and comfort with
high-school algebra; no number theory, no logic, no Rust. The
book overhaul move 6: the Second Summit chapter + the book ends once New Chapter 13, 'The Second Summit: A Hash-Based Pyramid' — SLH-DSA (FIPS 205) as the transfer experiment for the whole method: - opens on leaf 18 as the anomaly; correctness-vs-security across the quantum divide ('a correct implementation of a broken lock is still a broken lock') - Lamport -> Winternitz chains with the checksum see-saw run twice on real w=16 numbers, including a concrete failed forgery (480 -> 479, digit 14 -> 13) - FORS worked at napkin scale (k=2, a=2, one reuse = one forgery) and real scale (28 of 57,344, exponent 14) - the virtual hypertree: digest split 21/7/2 to the bit, the 54-bit meter peeled 9 bits per layer, verification priced exactly (254 fixed oracle calls; the see-saw itself caps a layer at 510, so worst case 3,824 — the naive 525*35 bound is unreachable, and the chapter says why); ~2^72 to build vs ~2^12 to check - the eleven certificates, the loop-to-fold bridges, the honest 'visible, not correct' boundary (no second semantics — and why the natural move fails), the cone-growth table, the t_l/t_len naming inversion told as the war story it was, the apex as an audit invitation with the verbatim theorem named - 'The leaf, live': leaf-vs-head precision ('plausible, and wrong twice'), the three-clause self-reference ledger (attested machinery / attested scheme / honest gap), one-command tryit - six exercises with pathway'd solutions; checkpoint hands the who-checks-them question to the finale Structural: attestation renamed ch14 and now carries the book's single ending (where-to-go, further reading, final reframe, prospective checkpoint — moved from ch12); its two interior checkpoints demoted to bigidea/tryit so the terminal checkpoint stands alone; opening now receives ch13's baton. ch12 ends as a chapter. Front matter: three-summit arc, fourteen-week plan, honest discussion-exercise count; ch01 promise ladder extended to Chapters 13/14; glossary +5 entries (and the pre-existing Hasse-bound misordering fixed); README fourteen chapters + build.sh recipe. Every constant verified against fips205-slhdsa-verified and lean-transparency-log by four adversarial checkers; arithmetic independently recomputed; didactic panel scored the chapter 9/8 — the book's high-water mark. Build: 128 pages, zero unresolved refs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-08 08:39:08 +00:00
fourteen-week plan below has been paced so the two hard climbs ---
Chapter~9 and the Interlude --- each get a full week with nothing else
competing.
book overhaul move 6: the Second Summit chapter + the book ends once New Chapter 13, 'The Second Summit: A Hash-Based Pyramid' — SLH-DSA (FIPS 205) as the transfer experiment for the whole method: - opens on leaf 18 as the anomaly; correctness-vs-security across the quantum divide ('a correct implementation of a broken lock is still a broken lock') - Lamport -> Winternitz chains with the checksum see-saw run twice on real w=16 numbers, including a concrete failed forgery (480 -> 479, digit 14 -> 13) - FORS worked at napkin scale (k=2, a=2, one reuse = one forgery) and real scale (28 of 57,344, exponent 14) - the virtual hypertree: digest split 21/7/2 to the bit, the 54-bit meter peeled 9 bits per layer, verification priced exactly (254 fixed oracle calls; the see-saw itself caps a layer at 510, so worst case 3,824 — the naive 525*35 bound is unreachable, and the chapter says why); ~2^72 to build vs ~2^12 to check - the eleven certificates, the loop-to-fold bridges, the honest 'visible, not correct' boundary (no second semantics — and why the natural move fails), the cone-growth table, the t_l/t_len naming inversion told as the war story it was, the apex as an audit invitation with the verbatim theorem named - 'The leaf, live': leaf-vs-head precision ('plausible, and wrong twice'), the three-clause self-reference ledger (attested machinery / attested scheme / honest gap), one-command tryit - six exercises with pathway'd solutions; checkpoint hands the who-checks-them question to the finale Structural: attestation renamed ch14 and now carries the book's single ending (where-to-go, further reading, final reframe, prospective checkpoint — moved from ch12); its two interior checkpoints demoted to bigidea/tryit so the terminal checkpoint stands alone; opening now receives ch13's baton. ch12 ends as a chapter. Front matter: three-summit arc, fourteen-week plan, honest discussion-exercise count; ch01 promise ladder extended to Chapters 13/14; glossary +5 entries (and the pre-existing Hasse-bound misordering fixed); README fourteen chapters + build.sh recipe. Every constant verified against fips205-slhdsa-verified and lean-transparency-log by four adversarial checkers; arithmetic independently recomputed; didactic panel scored the chapter 9/8 — the book's high-water mark. Build: 128 pages, zero unresolved refs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-08 08:39:08 +00:00
\subsection*{A fourteen-week plan}
For self-study or a seminar, the book paces naturally as a semester:
\begin{center}
\small
\begin{tabular}{@{}lll@{}}
\toprule
\textbf{Weeks} & \textbf{Material} & \textbf{Deliverable} \\
\midrule
1 & Ch.~1 + toolkit Cards 1--2 & the two Ch.~1 audits, by hand \\
2--3 & Ch.~2--3 + \code{Ch02/Ch03.lean} & term-mode proof portfolio \\
4 & Ch.~4 + \code{Ch04.lean} & the \code{zero\_add} board trace, from memory \\
5 & Ch.~5 + \code{Ch05.lean} & ten goals, right tool each \\
6 & Ch.~6 + \code{Ch06.lean} & the Euclid inversion, reproduced \\
7 & Ch.~7 + \code{Ch07.lean} & hand-checked certificate for 97 \\
8 & Ch.~8 + repo reading (App.~C) & annotated extract of \code{gen/} \\
9 & Ch.~9 + \code{Ch09.lean} & the miniature bridge, proved \\
10 & Interlude & the complete by-hand verification \\
11 & Ch.~10--11 & audit drill on a stranger's repo \\
12 & Ch.~12 + \code{Ch12.lean} & graduation: spec--refusal--fix--certificate \\
book overhaul move 6: the Second Summit chapter + the book ends once New Chapter 13, 'The Second Summit: A Hash-Based Pyramid' — SLH-DSA (FIPS 205) as the transfer experiment for the whole method: - opens on leaf 18 as the anomaly; correctness-vs-security across the quantum divide ('a correct implementation of a broken lock is still a broken lock') - Lamport -> Winternitz chains with the checksum see-saw run twice on real w=16 numbers, including a concrete failed forgery (480 -> 479, digit 14 -> 13) - FORS worked at napkin scale (k=2, a=2, one reuse = one forgery) and real scale (28 of 57,344, exponent 14) - the virtual hypertree: digest split 21/7/2 to the bit, the 54-bit meter peeled 9 bits per layer, verification priced exactly (254 fixed oracle calls; the see-saw itself caps a layer at 510, so worst case 3,824 — the naive 525*35 bound is unreachable, and the chapter says why); ~2^72 to build vs ~2^12 to check - the eleven certificates, the loop-to-fold bridges, the honest 'visible, not correct' boundary (no second semantics — and why the natural move fails), the cone-growth table, the t_l/t_len naming inversion told as the war story it was, the apex as an audit invitation with the verbatim theorem named - 'The leaf, live': leaf-vs-head precision ('plausible, and wrong twice'), the three-clause self-reference ledger (attested machinery / attested scheme / honest gap), one-command tryit - six exercises with pathway'd solutions; checkpoint hands the who-checks-them question to the finale Structural: attestation renamed ch14 and now carries the book's single ending (where-to-go, further reading, final reframe, prospective checkpoint — moved from ch12); its two interior checkpoints demoted to bigidea/tryit so the terminal checkpoint stands alone; opening now receives ch13's baton. ch12 ends as a chapter. Front matter: three-summit arc, fourteen-week plan, honest discussion-exercise count; ch01 promise ladder extended to Chapters 13/14; glossary +5 entries (and the pre-existing Hasse-bound misordering fixed); README fourteen chapters + build.sh recipe. Every constant verified against fips205-slhdsa-verified and lean-transparency-log by four adversarial checkers; arithmetic independently recomputed; didactic panel scored the chapter 9/8 — the book's high-water mark. Build: 128 pages, zero unresolved refs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-08 08:39:08 +00:00
13 & Ch.~13 & the checksum see-saw + the cone table, from memory \\
14 & Ch.~14 + project & a fifteen-minute independent log verification;\\
& & then one open lemma or one solo bridge \\
\bottomrule
\end{tabular}
\end{center}
\tableofcontents
% ===================== CHAPTERS =====================
\input{chapters/ch01-why-verify}
\input{chapters/ch02-meet-lean}
\input{chapters/ch03-propositions-as-types}
\input{chapters/ch04-tactics}
\input{chapters/ch05-numbers-and-automation}
\input{chapters/ch06-modular-arithmetic}
\input{chapters/ch07-primality-certificates}
\input{chapters/ch08-rust-to-lean}
\input{chapters/ch09-denotation-bridge}
\input{chapters/interlude-by-hand}
\input{chapters/ch10-verifying-a-field}
\input{chapters/ch11-honesty-and-axioms}
\input{chapters/ch12-the-pyramid}
book overhaul move 6: the Second Summit chapter + the book ends once New Chapter 13, 'The Second Summit: A Hash-Based Pyramid' — SLH-DSA (FIPS 205) as the transfer experiment for the whole method: - opens on leaf 18 as the anomaly; correctness-vs-security across the quantum divide ('a correct implementation of a broken lock is still a broken lock') - Lamport -> Winternitz chains with the checksum see-saw run twice on real w=16 numbers, including a concrete failed forgery (480 -> 479, digit 14 -> 13) - FORS worked at napkin scale (k=2, a=2, one reuse = one forgery) and real scale (28 of 57,344, exponent 14) - the virtual hypertree: digest split 21/7/2 to the bit, the 54-bit meter peeled 9 bits per layer, verification priced exactly (254 fixed oracle calls; the see-saw itself caps a layer at 510, so worst case 3,824 — the naive 525*35 bound is unreachable, and the chapter says why); ~2^72 to build vs ~2^12 to check - the eleven certificates, the loop-to-fold bridges, the honest 'visible, not correct' boundary (no second semantics — and why the natural move fails), the cone-growth table, the t_l/t_len naming inversion told as the war story it was, the apex as an audit invitation with the verbatim theorem named - 'The leaf, live': leaf-vs-head precision ('plausible, and wrong twice'), the three-clause self-reference ledger (attested machinery / attested scheme / honest gap), one-command tryit - six exercises with pathway'd solutions; checkpoint hands the who-checks-them question to the finale Structural: attestation renamed ch14 and now carries the book's single ending (where-to-go, further reading, final reframe, prospective checkpoint — moved from ch12); its two interior checkpoints demoted to bigidea/tryit so the terminal checkpoint stands alone; opening now receives ch13's baton. ch12 ends as a chapter. Front matter: three-summit arc, fourteen-week plan, honest discussion-exercise count; ch01 promise ladder extended to Chapters 13/14; glossary +5 entries (and the pre-existing Hasse-bound misordering fixed); README fourteen chapters + build.sh recipe. Every constant verified against fips205-slhdsa-verified and lean-transparency-log by four adversarial checkers; arithmetic independently recomputed; didactic panel scored the chapter 9/8 — the book's high-water mark. Build: 128 pages, zero unresolved refs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-08 08:39:08 +00:00
\input{chapters/ch13-second-summit}
\input{chapters/ch14-attestation-protocol}
\appendix
\input{chapters/appendix-toolkit}
\input{chapters/appendix-walkthroughs}
\input{chapters/appendix-repo-tour}
\input{chapters/glossary}
\end{document}