Videos
Talks and demos relevant to the course, grouped by topic. Videos marked Core cover each strand of the course once (about three and a half hours in all, in the parts given); the rest go deeper on one topic or overlap with a core video. Times are video running times, and “watch 0:20–0:50” gives the part worth watching. Each summary is written from a full reading of the talk’s transcript; speakers, venues and dates are given only where the talk or its title states them. All links checked November 2026.
Foundations
Propositions as Types 43 min; watch 0:00–28:30. Core. Philip Wadler. Why proofs are programs, told as history. Church, Gödel and Turing gave three definitions of computability within a few years that turned out to be equivalent, which Wadler takes as evidence of discovery rather than invention. Gentzen’s natural deduction pairs introduction and elimination rules, and an introduction followed by an elimination can be simplified away. Church’s simply typed λ-calculus has the same rules once the terms are erased, and β-reduction is exactly proof simplification; typed terms without a fixpoint operator always terminate. Curry and Howard named the correspondence (propositions as types, proofs as programs, simplification as evaluation); Howard’s extension to ∀ and ∃ gave dependent types, and proof assistants from de Bruijn’s Automath to Coq and Agda represent proofs as λ-terms. Further pairs: Hindley–Milner, and Girard’s System F with Reynolds’ polymorphic λ-calculus. The talk shows the actual inference rules side by side, useful before writing inductive typing relations in Lean, and explains why Lean checks a proof by type-checking a term. The aliens section (28:30–33:54) and the questions (linear logic, session types) are optional.
Creator of OCaml: Functional Programming, Formal Verification, Programming Languages 1 hour 24 min; watch 22:14–39:15 and 57:36–1:05:39. Xavier Leroy, podcast interview. A long, informal interview. The PL parts: why OCaml found systems and finance users (Cornell’s Ensemble, then Jane Street), garbage collection versus Rust’s ownership (“manual memory management is not always faster”), type inference as collecting and solving constraints, and the memory model added for multicore OCaml. The two marked parts bear directly on this course. In the first, Leroy describes CompCert and seL4, then verifies a function that averages three numbers: decide the rounding, add a precondition against overflow, execute symbolically, and treat the result as a contract; semantics is “that kind of bridge between programs and their mathematical meaning”. In the second, on AI, he says AIs sometimes “change the statement or the definitions to make the proof easier”, that it is “fairly easy to come up with specifications that are inconsistent”, and that an unsatisfiable precondition makes any body verify, giving “a false sense of confidence”; he suggests testing specifications. That is the audit students do on their own projects. Skip the sponsor segment (39:15), the C interface (49:29–57:36) and the outro.
Type systems
Type inference as constraint solving: how GHC’s type inference engine actually works 1 hour 2 min; watch 0:00–53:56. Core.
Simon Peyton Jones.
How a real type checker is built. Inference both checks and elaborates: GHC
inserts type applications, type abstractions and dictionary arguments, and
keeps its intermediate language typed. Inference then generates constraints
over unification variables (on \xs -> (reverse xs, and xs)) and solves them
separately by rewriting, building a substitution that is applied to the
elaborated term. Solving as you go, as classic ML implementations do, breaks
down for type classes and type families, whose constraints can only be
solved later, and makes checking depend on the order of subterms. Following
Pottier and Rémy, constraint generation has many simple cases and the solver
handles a small constraint language. Implication constraints, introduced with
an existential type, handle pattern matches that bind types and dictionaries,
and GADTs; level numbers stop an existential type escaping its scope.
Payoffs include error messages reported from the residual constraints with
their provenance. Haskell-specific, but the clearest talk here on the gap
between typing rules and an inference engine, and the architecture a
type-inference project in Lean would use. The questions are optional.
RustBelt: Logical Foundations for the Future of Safe Systems Programming 1 hour 6 min; watch 0:00–33:00, the rest with a Hoare-logic project.
Derek Dreyer, MPI for Software Systems.
Rust’s rule is that an object may be aliased or mutable but not both; a short
demo shows the borrow checker rejecting a push onto a vector inside a loop
over it. Dreyer then calls this story “kind of a lie”: Arc, Mutex and
other library types mutate shared state inside unsafe blocks behind safe
APIs, and one such API (scoped threads) turned out unsound in combination
with Rc just before Rust 1.0. Progress and preservation say nothing once
any code is outside the typed fragment, so RustBelt proves semantic
soundness: each type is given a meaning as a contract in separation logic,
safe code meets its contract by construction, and each unsafe library is
proved once, independently, in Coq, for a core calculus called λRust. From
0:33 it becomes a tutorial: Hoare triples, separating conjunction, the
parallel-composition and invariant rules with a spin-lock proof, then Iris,
which adds user-defined ghost state, illustrated by a proof of Arc’s
reference count. Questions are interleaved. Advanced and not in Lean, but the
clearest talk here on what a type-soundness theorem does and does not
guarantee.
Program analysis
Lessons from Building an Auto-Active Verifier in Lean 19 min. George Pîrlea, Dafny 2026 workshop (POPL). Veil, a verifier for distributed protocols built inside Lean. Pîrlea places existing tools on an effort/benefit chart: TLA+ for cheap model checking, Ivy for automatic proofs in a decidable fragment of first-order logic (stable, with concrete counterexamples), Dafny for general SMT verification at the cost of instability, and interactive provers for everything else. Rather than adding an interactive escape hatch to an automatic verifier, Veil builds the automatic verifier inside Lean. The demo (7:07–12:30), on a leader-election protocol, runs explicit-state model checking with a counterexample, a symbolic trace query to check that the specification is not vacuous, bounded model checking, and an inductive-invariant check that reports a counterexample to induction; proofs from the SMT solver (cvc5) are reconstructed in Lean. Lessons: metaprograms need tests and structure, the first all-in-one design was unmaintainable and was rebuilt, and Veil is about 10 times slower than Ivy, mostly from translating higher-order to first-order logic. Model checking in the tool we use.
Specification
Developing Bug-Free Machine Learning Systems Using Formal Mathematics 51 min; watch 0:40–36:37.
Daniel Selsam (Stanford), talk at Microsoft Research.
Verifying software in Lean, with real analysis and probability in the
specification. Selsam motivates it with cases where a bug looked like a bad
model: a Theano issue nobody could localise, and a statistical method
abandoned in 2002 that turned out to work once a bug was fixed. His method:
state the specification formally, leave the program as a placeholder, and let
the stuck proof state tell you what each branch must return, adding
preconditions when the proof needs them. A softplus gradient shows the idea in
two minutes; then Certigrad, whose specification says the expected value of
stochastic backpropagation is the gradient of the expected loss. An efficient
memoised version is proved equal to the naive one, which is where his real
bug (a missing prime) showed up; a KL-divergence lemma needed the
precondition σ > 0. The proofs are about reals; floating point is treated as a
separate problem. His principle: “the more precisely you state your goal, the
more the computer can help”, and most of the benefit came from the
specification with sorrys, before the proofs. The questions are a sceptical
audience asking whether this matters for machine learning.
Lean
Machine-Checked Proofs and the Rise of Formal Methods in Mathematics 1 hour 25 min; watch 0:03–59:00. Core.
Leonardo de Moura, Simons Institute “Theoretically Speaking”, 2023.
Lean’s creator on what Lean is and why it can be trusted. He opens with a
specification of max (the result is at least a and b and equals one of
them), an implementation and a proof, and says you can test a specification
by proving properties about it. Proofs are programs checked by a small
kernel, and exported proofs can be rechecked by independent checkers written
in Haskell, Scala and Rust. Extensibility is the most important design goal:
users write automation in Lean itself, and buggy automation cannot make Lean
unsound because the kernel rejects bad proofs (“you can hack without fear”).
Then Mathlib and its projects (perfectoid spaces, the Liquid Tensor
Experiment, whose formal version is 20 times longer than the lecture notes,
sphere eversion, the port to Lean 4), Lean 4 as an efficient programming
language with do notation and hygienic macros (from about 0:31), and AI,
where formal proofs are “an antidote to hallucinations” (from about 0:50).
In the questions: Lean barely supports finding counterexamples, and how
sorry works. The best single introduction to the system we use.
Lean: Machine-Checked Mathematics and Verified Programming, Past and Future 1 hour 8 min; watch 27:00–52:00.
Leonardo de Moura, PLDI 2025.
The first half covers why Lean exists (Z3 and the limits of push-button
verification), extensibility, and the small trusted kernel, which matters
more with AI because a model “will exploit any soundness bug”; apart from a
short example in which grind proves the invariants of a hash-map structure,
it repeats the 2023 talk. The second half is the best tour here of software
verification in Lean: Cedar, AWS’s authorization language, modeled in Lean
and compared with the Rust implementation by differential testing; SampCert;
Rust code translated to Lean with Aeneas; Veil for protocols; bv_decide,
which proves Hacker’s Delight popcount correct against a recursive
specification using checkable SAT certificates; hammers that reconstruct
proofs from external provers; and grind, an SMT-style procedure that works
in dependent type theory, with its diagnostics and a clear statement of what
it is not for. It ends with AI, the Lean FRO and CSLib, “the math lib for
computer science”. Watch the marked part after the 2023 talk.
Software Verification in Lean 59 min; watch from 0:04 for a VC-generator project, 42:00–53:00 otherwise.
Leonardo de Moura.
The most technical talk here: how to make verification-condition generation
in Lean scale. De Moura defines a small imperative language with an
inductive semantics, proves a straight-line program correct by applying one
rule per statement, and shows that Lean’s standard tactic framework takes
about 2 seconds for 200 statements and grows superlinearly. Since Aeneas,
Velvet and mvcgen all work this way, he builds a new framework, SymM:
maximally shared terms, syntactic unification with “no unfolding in the hot
path”, precompiled apply, a simplifier with persistent caches (500 nested
haves in 14 ms), and grind state carried from goal to goal. Velvet on SymM
beats Dafny on 24 of 27 benchmarks. He prefers the proof-producing cbv
tactic to native_decide, which puts the compiler in the trusted base. On AI
(from 0:42): Claude Code ported zlib to Lean and proved that decompression
inverts compression; in his own experiment the model’s specification was
wrong at first and it skipped the soundness proof. He closes on trust: AI
users are adversarial, and “the specifications are important”.
Tutorial on the Lean theorem prover 1 hour 34 min; watch 0:00–1:15:00.
Jeremy Avigad, Harvard CMSA.
Hands-on beginner Lean from one of the authors of Mathematics in Lean,
which he recommends, with the Natural Number Game and Zulip, as the way to
learn. Then the foundations: every expression has a type; data, propositions
(of type Prop) and proofs, where a proof is an expression whose type is the
statement; #eval and Lean as a programming language, and what is not
computable (real division). From about 0:32 he proves that the sum of the
first n odd numbers is n² by induction with rw and ring, and #prints the
proof term the tactics built. Then a group in which every element squares to
1 is abelian, and a modular-arithmetic exercise that introduces apply and
reading theorems as backward rules. It ends with how to find theorem names:
guessing, apply?, and search engines such as Loogle. The last 20 minutes
are inaudible one-to-one help. For students new to Lean in the first weeks;
it uses Mathlib, while our projects use core Lean only.
AI and verification
Formalizing a proof in Lean using Claude Code 26 min. Core.
Terence Tao.
Tao redoes his Copilot video’s formalization with Claude Code: equation 1689
implies the singleton law, from a one-page human proof. Before recording,
asking for the whole proof at once ran about 45 minutes, crashed his computer
and ran out of tokens without producing anything. What works is a
step-by-step recipe written as a comment in the Lean file: first the
notation, then a skeleton stating the three lemmas with sorry, then each
line of the informal proof as a Lean step justified by sorry, then the
gaps. The agent struggles most with the lowest-level steps, writing
five-line proofs where he expected two. Tao fixes one step by hand
(congruence works where a rewrite did not) while the agent works on the
next lemma, and has it pull out a shared lemma. His conclusions: keeping the
formal proof aligned with the informal one makes it “a lot easier to read and
debug”; given the whole task, an agent may throw away your informal proof and
do its own thing; and it is “very tempting to just turn your brain off”,
which he warns against. This is our projects’ workflow.
A benchmark for vericoding: formally verified program synthesis 15 min. Core. Dafny 2026 workshop (POPL); the speaker is not introduced. “Vericoding”: given a formal specification, an LLM writes both the code and its proof. The team collected about 10,000 tasks in Dafny, Verus and Lean, from DafnyBench, HumanEval and APPS problems translated by an LLM (checked only by an LLM judge and spot checks), Lean benchmarks translated to the other two languages, and NumPy functions specified as Hoare triples. The lesson for this course is that the specifications are the weak point. DafnyBench had “lots of Fibonacci problems repeated like 10 times”, and cleaning is still “work in progress”. A specification of big-number addition, stated through a function from bit strings to mathematical integers, lets a solution convert to integers, add and convert back instead of doing real addition, and the speaker did not know how to rule that out. Results were best in Dafny and weak in Lean; the speaker suspects the pipeline (five rounds of verifier error messages, no interactive proof state). Adding a natural-language description made results worse. The experiments cost “at least $20,000”. Halting delivery, but short and on topic.
Where is Mathematics Going? 48 min; watch from 18:30. Core. Kevin Buzzard, Simons Foundation Presidential Lecture, 2025. The first part argues that research mathematics has outgrown its methods: hundreds of new pages a day in number theory alone, 100-page papers, referees told not to check details, errata passed privately between experts, and the classification of finite simple groups still not properly written down. From 18:30, two technologies. Language models make “confabulations” and try to please: ask for a proof of Pythagoras’s theorem by induction and you get “plausible looking crap”. Interactive theorem provers are, in his experience, always right when they disagree with a human, but write nothing themselves. So combine them: the model proposes Lean, Lean returns the first error, repeat. Of his two obstacles, too little Lean training data no longer seems to matter, he says; the other remains: thousands of modern definitions are missing, and when a model translates definitions “there’s no guardrails anymore”, since a definition that drops an axiom still compiles. That is the specification-auditing problem in our projects. He also shows the Fermat’s Last Theorem blueprint, Mathlib’s backlog of about 2,000 pull requests, and Math Inc’s formalization of the prime number theorem.
Concrete Problems in Proof Automation 47 min; watch 0:40–41:27. Talia Ringer (University of Illinois), AITP 2022. Ringer argues that AI-for-proofs research targets the wrong tasks. Most work predicts the next tactic or proves a fixed theorem, but in a month-long study of eight Coq proof engineers, about 75% of the time a proof would not go through they went back and changed something else, such as the program or the specification. She proposes five tasks instead: conjecture testing (is the goal even true? property-based testing and counterexamples), lemma discovery, discovering relations between data types (unary versus binary naturals), proof reuse and repair after a change, and semantic search for lemmas. The lemma-discovery section explains why a proof about a recursive function with an accumulator needs a generalized lemma of the same shape, with a recording of her taking 25 minutes over two list-reverse functions before finding the lemma that gave a two-line proof. She also describes “death loops”, where students and language models retry the same impossible step. Each task is one students meet when Claude Code stalls on a proof.
Formal Reasoning Meets LLMs: Toward AI for Mathematics and Verification 1 hour 5 min. Kaiyu Yang (Meta FAIR, author of LeanDojo). How math language models are trained: supervised fine-tuning needs expensive step-by-step solutions, and reinforcement learning needs answers that can be checked. Proofs fail both; models guess answers well but prove badly (about 5% on USAMO when humans check the proofs). His answer is Lean as the checker. From about 0:14, theorem proving: tactics proposed by a language model, proof search, retrieving lemmas from the library, and expert iteration, which levels off. Then LIPS, a prover for olympiad inequalities that enumerates lemma applications symbolically, lets the model propose rewritings, and filters with an SMT solver; on 20 hand-checked problems o1 solved none, o3 and R1 three or four, a trained human at least 15, and LIPS 16. From about 0:31, autoformalization: how do you know a formal statement means what the informal one does? In Euclidean geometry an SMT solver checks equivalence, but it has to be “good enough but not too good”; formalizing Euclid turned up a missing case in Proposition I.24. In the questions: models trained on human ratings learn to write plausible-looking proofs. A research survey; the autoformalization part bears most on owning a specification.
AlphaProof: when reinforcement learning meets formal mathematics 1 hour 26 min; watch from 0:26. Thomas Hubert (Google DeepMind), Harvard CMSA, his first public talk on AlphaProof. The first 20 minutes motivate formal mathematics and Lean for a general audience. The method, from about 0:26: Lean’s verdict is the reward, search is AlphaZero’s, and problems come from autoformalizing about a million informal problems, about 100 translations each. Translations may be approximate or trivial, but a well-formed statement is either true or false, so it can still be trained on. After supervised training on Mathlib comes reinforcement learning, and at test time, training on generated variants of the target problem. The IMO 2024 story (from about 0:37): Lean experts formalized the problems by hand, Gemini proposed answers to “find all” problems, P1, P2 and P6 were solved, both combinatorics problems were not (P5 could not be formalized on the day), and with AlphaGeometry’s P4 the score was silver, one point short of gold, using “many orders of magnitude more compute” than the contestants. A point in the questions bears on this course: checking an autoformalization seems as hard as producing it, and errors (a forgotten “strictly bigger than zero”) surface while proving.
Terence Tao at IMO 2024: AI and Mathematics 57 min; watch 23:50–47:46. Terence Tao, IMO 2024. The first half is history: human computers and tables, SAT solvers (the Boolean Pythagorean triples problem, a 200-terabyte certificate), the four colour theorem (checked in Coq in 2005), and the Kepler conjecture, whose referees were “99% certain” and whose formalization took 21 collaborators 12 years. From 23:50: Scholze’s vanishing theorem formalized in Lean in 18 months, and the blueprint workflow that splits a proof into small statements many people formalize in parallel, as in Tao’s PFR project (a 33-page paper, about 20 people, 3 weeks). Formalizing takes “maybe 10 times longer” than writing a proof, but changing a constant from 12 to 11 took a few days, because Lean pointed at the places that broke. Then knot theory (a neural network predicts a knot invariant) and LLMs: GPT-4 solved about 1% of IMO-level problems tried, Copilot suggests a usable next Lean line about 20% of the time, and compile-and-retry loops manage proofs “4 or 5 lines long”. Dated relative to the Claude Code demo; overlaps with Buzzard.
Formalizing a proof in Lean using GitHub Copilot and canonical 34 min; watch 0:00–3:20 and from 32:54.
Terence Tao, nine months before the Claude Code video.
The same theorem as the Claude Code video. Tao has split the proof into
atomic steps and formalizes them “line by line blindly”, accepting GitHub
Copilot completions and calling the canonical tactic, which needs help with
an existential. Copilot proposes a wrong intermediate claim, which he finds
only when he cannot prove it (“when you rely on GitHub copilot to provide the
statement of your proof you actually have to check”). It takes about 33
minutes, against 48 in an earlier unrecorded attempt, and he warns the
experiment is not controlled: he has done it before, and the tools may
already know the proof. His verdict: every step became easier, but “I lost a
sense of what was going on”, hoping the tools would justify each step, which
they did about half the time; it suits tedious, non-conceptual proofs. A
contrast with the agentic workflow; the middle is mostly unnarrated.
Reviewed and not recommended
- Machine Assisted Proof (Terence Tao, AMS Colloquium Lecture, Joint Mathematics Meetings, 55 min): the same ground and often the same slides as his IMO talk; watch one of the two. This one adds an LLM-plus-Lean loop that solves “undergraduate math homework level problems” and, in the questions (from 50:54), the point that blueprints are “for the humans”.
- Verified Collaboration: How Lean is Transforming Mathematics (Leonardo de Moura, March 2025, 54 min): repeats his 2023 talk. Only a beginner walk-through of a tactic proof (0:04–0:07) and an answer on how to check that a formal statement says what you meant (0:46–0:48) are new.
- Benjamin Pierce about the Deep Specification project (SPLASH 2016, 10 min): a short interview, not his keynote. “Begin with the specifications”, verify the critical layers, and use property-based testing, but no examples or technical content; Ringer and Selsam make the case better.
- Abstraction and Evolution with Large Language Models (Swarat Chaudhuri, IPAM, 51 min): LaSR, LLM-guided evolutionary search for scientific equations, with a library of natural-language concepts; only 48:48–50:49 mentions Lean, speculatively.
- Neurosymbolic programming (Swarat Chaudhuri, INSAIT, 59 min): a general-audience talk on programs with neural parts (a PID controller plus a learned term, programs over mouse trajectories) and a sketch of neural-guided search over a DSL. No semantics, types or verification.
- Lecture Series in AI: Byron Cook (Amazon Web Services, 1 hour 14 min): not evaluated, because no captions could be downloaded.