Documentation

CslibFrontier.Computability.Distributed.ClockSync.LundeliusLynch

Lockstep drift-free clock-synchronization step bounds #

This module proves a synchronous lockstep, drift-free R-round step towards the ((n - 1) / n) * (d_max - d_min) clock-synchronization bound of Lundelius and Lynch, and is not the cited paper's general asynchronous event-driven lower bound (which remains open in #7202).

Over a complete network of n = Fintype.card P processes with unit-rate drift-free hardware clocks and message transit delays in [d_min, d_max] (d_min ≤ d_max), we show for deterministic fixed-R-round lockstep protocols (LockstepProtocol P K R) that the minimax worst-case clock skew is ((n - 1) / n) * (d_max - d_min) (for n = 1, 0 ≤ γ holds trivially from |x - x| = 0):

Main definitions #

Main results #

References #

Prefix-shifted executions and the lockstep (1 - 1 / n) * (d_max - d_min) lower bound #

theorem Cslib.Distributed.ClockSync.lockstepClockSync_lower_bound {P : Type u} [Fintype P] [Nonempty P] {K : Type v} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {R : ℕ} {π : LockstepProtocol P K R} {d_min d_max γ : K} (hd : d_min ≤ d_max) (hπ : AchievesLockstepSkew π d_min d_max γ) :
(↑(Fintype.card P) - 1) / ↑(Fintype.card P) * (d_max - d_min) ≤ γ

A synchronous lockstep, drift-free R-round step towards Lundelius and Lynch, and not the cited asynchronous event-driven lower bound (#7202): any deterministic R-round LockstepProtocol P K R achieving worst-case skew γ on a nonempty finite complete network P against transit delays in [d_min, d_max] (d_min ≤ d_max) satisfies ((Fintype.card P - 1 : K) / Fintype.card P) * (d_max - d_min) ≤ γ (for Fintype.card P = 1, 0 ≤ γ follows immediately from |x - x| = 0; the prefix-shift telescoping argument applies to 2 ≤ Fintype.card P).

1-round lockstep averaging upper bound and lockstep minimax step #

def Cslib.Distributed.ClockSync.lockstepClockAvg {P : Type u} [Fintype P] [DecidableEq P] {K : Type v} [Field K] (d_min d_max : K) :

1-round lockstep all-to-all midpoint-delay averaging protocol on drift-free clocks (a synchronous lockstep step after Lundelius and Lynch, #7202): every process broadcasts at local clock reading 0 and sets its clock adjustment to (∑ q : P, estDiff d_min d_max p v.lastArrival q) / |P|.

theorem Cslib.Distributed.ClockSync.lockstepClockAvg_achievesSkew {P : Type u} [Fintype P] [DecidableEq P] [Nonempty P] {K : Type v} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {d_min d_max : K} (hd : d_min ≤ d_max) :
AchievesLockstepSkew (lockstepClockAvg d_min d_max) d_min d_max ((↑(Fintype.card P) - 1) / ↑(Fintype.card P) * (d_max - d_min))

A synchronous lockstep, drift-free 1-round step after Lundelius and Lynch, and not the cited asynchronous event-driven result (#7202): lockstepClockAvg achieves worst-case lockstep clock skew ((Fintype.card P - 1 : K) / Fintype.card P) * (d_max - d_min) whenever d_min ≤ d_max.

theorem Cslib.Distributed.ClockSync.exists_achievesLockstepSkew_iff {P : Type u} [Fintype P] [Nonempty P] {K : Type v} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {d_min d_max γ : K} (hd : d_min ≤ d_max) :
(∃ (R : ℕ) (π : LockstepProtocol P K R), AchievesLockstepSkew π d_min d_max γ) ↔ (↑(Fintype.card P) - 1) / ↑(Fintype.card P) * (d_max - d_min) ≤ γ

A synchronous lockstep, drift-free R-round minimax step towards Lundelius and Lynch, and not a characterization over asynchronous event-driven protocols (#7202): there exists a round count R and a deterministic LockstepProtocol P K R achieving worst-case clock skew γ on P against transit delays in [d_min, d_max] (d_min ≤ d_max) if and only if ((Fintype.card P - 1 : K) / Fintype.card P) * (d_max - d_min) ≤ γ (trivial 0 ≤ γ for Fintype.card P = 1; lockstepClockSync_lower_bound and lockstepClockAvg_achievesSkew for 2 ≤ Fintype.card P).