Erik Peterson

Peterson’s algorithm

exploration

Animated interleavings, atomic memory accesses, and the invariants behind mutual exclusion.

Lean proofs and model assumptions

Each shared read and write is individually atomic under sequential consistency. Both processes use the same fixed read order. These animations show selected valid schedules; the Lean safety proof covers every reachable state in the model.

Safety does not require fairness. Eventual entry additionally requires weak fairness for continuously enabled protocol steps, including exit writes, and completion of critical work. The overtaking bound counts peer entry events, not time or steps. The n-process theorem covers one-passage safety only.

The browser model is a tested TypeScript transcription, not a Lean proof checker. The results do not establish weak-memory or compiled-code correctness.

Erik Peterson initiated and directed the project. AI models generated the research, prose, tooling, and proofs. Lean checked the proofs; separate AI agents reviewed the model and theorem boundaries. These reviews are fallible, and the source interpretation has not received independent human mathematical review.

Source

All explorations