Each example below is carried out in full and verbalised, as the guide does. They are disjoint from the exercises, and Lean checks every line when the notes are built.
4.7.1. Distributing a conjunction over a disjunction🔗
The statement a ∧ (b ∨ c) → (a ∧ b) ∨ (a ∧ c) uses only intro, apply, exact and bullets. The elimination rule of ∨ drives the proof, and juxtaposition instantiates it with the right conjunct of the hypothesis.
In words. Assume a ∧ (b ∨ c). Its right conjunct is a disjunction, and it suffices to prove the conclusion from each disjunct. If b holds, it suffices to prove the left disjunct a ∧ b, whose parts are the left conjunct of the hypothesis and b itself. If c holds, the right disjunct a ∧ c follows the same way. Each bullet closes one branch, and the proof reads exactly like its pen-and-paper counterpart.
The disjunction of the statement a ∧ b → a ∨ c admits two introduction rules, and only one leads to a proof. Or.inl and Or.inr can turn a provable goal into an unprovable one. The first attempt commits to the right disjunct, and the trace shows a conclusion c that no hypothesis proves, so only sorry closes the block.
The remedy is to remember the choice point and backtrack. The second attempt commits to the left disjunct, and the left conjunct of the hypothesis closes it.
Given f and the equation hf : ∀ x, f x = x + 1, either tactic proves the conclusion f (f 0) = 2, in different ways. rw [hf] rewrites the occurrences of the first matching subterm, here the outer application, and needs a second invocation for the inner one, after which the rfl it tries closes the goal. simp [hf] rewrites exhaustively and needs one invocation.
The final worked example of Lecture 3 stated reverse (x :: xs) = snoc (reverse xs) x and left it with sorry. Unfolding reverse turns the left side into appendPretty (reverse xs) [x], so the statement mixes appendPretty and snoc, and the missing piece is the theorem that relates them. This is the guide's hint in action: a hard case usually signals a missing auxiliary theorem.
The auxiliary theorem inducts on the list that the recursion of appendPretty consumes, and the main theorem is then one simp away, using the defining equations of reverse and the auxiliary theorem as rewrite rules.