Reading the Lean Infoview Like a Debugger Frame
Every time you click inside a by ... block, Lean's Infoview shows your live stack frame: Objects (req : Request, n : Nat) are function arguments in scope; Hypotheses (h1 : Valid req, h2 : n < 100) are local immutable bindings holding proofs you already possess; and ⊢ Goal is the return type your remaining block must construct.
Every logical connective has two moves: how to build it when it sits in the ⊢ Goal, and how to unpack it when it sits in a hypothesis h.
The Six Core Connectives Cheat-Sheet
P → Q and ∀ x, P x: build with intro, use by calling h x (apply / exact). P ∧ Q: build with constructor (or ⟨hp, hq⟩), unpack with rcases h with ⟨hp, hq⟩. P ∨ Q: build with left or right, unpack with rcases h with hp | hq (must handle both cases!). ∃ x, P x: build by supplying a concrete witness ⟨witness, proof⟩ (refine ⟨w, ?_⟩), unpack with rcases h with ⟨x, hx⟩. And ¬P is defined as P → False—a function showing P leads to contradiction!