TLA+ Without the Mystery: `init`, `nextStates`, `safe`
Leslie Lamport's TLA+ taught systems engineers to view any distributed protocol, cache coherence controller, or WAL engine as a state machine: an initial state init : S, a transition function nextStates : S → List (Action × S) returning all enabled next steps, and an invariant safe : S → Bool.
Because Lean 4 is simultaneously a fast functional programming language and an interactive theorem prover, you can write a generic TLA+-style BFS model checker in 35 lines of pure Lean—and execute it directly at compile time with #eval or #guard!
Why Two Gears Beat Either Gear Alone
Model checking (Gear 1) finds shallow protocol bugs automatically with concrete traces, yet must cap integer bounds and queue lengths so the search terminates. Deductive proof (Gear 2) handles infinite integers and unbounded message histories, yet requires human/AI invariant insight. Running Gear 1 first inside the same Lean file gives you instant falsification before investing in proofs.