Each problem set has three parts:
- A page here. It states each problem in words and gives an optional hint. A collapsed solution sits under each problem; open it only after you have tried.
- A Lean file with
sorrys, inlean/LeanFV/Homework/. You replace eachsorrywith a proof. The file builds as you work, with a warning on everysorrythat is still open. - A sorry-free solution file in
lean/LeanFV/Solutions/. The site build compiles it, so every solution shown here is known to check.
| # | Problem set | After | You practise |
|---|---|---|---|
| 1 | Homework 1: Tactics | Lecture 3, Lecture 4 | propositional logic, quantifiers and a first induction, with tactics |
| 2 | Homework 2: Formalization | Lecture 5 | finding misformalized statements and junk values, and writing a faithful statement |
| 3 | Homework 3: Quantum information | Lecture 7 | Pauli identities, normalisation, and a lemma on the way to no-cloning |
| 4 | Homework 4: Semantics and compilers | Lecture 9 | extending a language and its compiler, then re-proving the compiler correct |
| 5 | Homework 5: Metaprogramming | Lecture 11 | writing a macro, a small tactic and simp lemmas |
| 6 | Homework 6: Capstone proposal | Lecture 14 | planning a formalization of your own, with a blueprint |
| 7 | Homework 7: Theoretical computer science | Lecture 15 | codes and their bounds, RSA, the cost of sorting, and a reduction |
How to work on a problem set
Open the lean/ folder (not the course root) in VS Code with the Lean 4 extension, then open
LeanFV/Homework/HW01.lean. Put the cursor inside a proof: the infoview shows the goal. When
the file has no sorry warnings left, you are done. Then compare with the solution on the
page. Many proofs are correct, and yours need not match.
You can also work in a notebook cell. Start the notebook with
leanmagic.setup("import LeanFV.Homework.HW01"), then copy a statement into a %%lean cell.