Leader election on a three-cycle
Lax755887.LeaderElection · concepts/Lax755887/LeaderElection.lean · lax-755887
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
A protocol selects a unique position. Equivariance means that rotating the input rotates the output by the same amount. A uniform input cannot support both properties.
Concept map
Lean source view on GitHub
| 1 | import Mathlib |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Leader election on a three-cycle |
| 6 | type: definition |
| 7 | --- |
| 8 | A protocol selects a unique position. Equivariance means that rotating the input rotates the output by the same amount. A uniform input cannot support both properties. |
| 9 | -/ |
| 10 | |
| 11 | namespace Lax755887.LeaderElection |
| 12 | |
| 13 | abbrev State := Fin 3 → Bool |
| 14 | |
| 15 | def next (i : Fin 3) : Fin 3 := ⟨(i.val + 1) % 3, Nat.mod_lt _ (by decide)⟩ |
| 16 | def rotate (s : State) : State := fun i => s (next i) |
| 17 | def UniqueLeader (run : State → State) : Prop := ∀ s, ∃! i, run s i = true |
| 18 | def Equivariant (run : State → State) : Prop := ∀ s, run (rotate s) = rotate (run s) |
| 19 | |
| 20 | structure Protocol where |
| 21 | run : State → State |
| 22 | elects : UniqueLeader run |
| 23 | |
| 24 | end Lax755887.LeaderElection |
| 25 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments