Documentation

CslibFrontier.Computability.Distributed.VectorClock.LowerBound

Crown-execution clock-dimension lower-bound step for unicast executions #

This module proves a self-contained crown-execution dimension lower-bound step over finite unicast message-passing executions Execution P toward #7203 (after [CB91], whose primary journal text was not inspected, so this module does not claim its cited endpoint): characterizing Execution.HappensBeforeLe across Execution P via coordinatewise order-embeddings into Fin d → α (for any LinearOrder α) requires dimension Fintype.card P ≤ d.

Construction and proof outline #

For n ≥ 2 processes Fin n with cyclic derangement crownShift hn p = (p + 1) % n, crownFin n hn constructs an explicit causally well-formed execution in four blocks of total length 2 * n + 2 * (n * n):

  1. Phase 1 initial events (crownPhase1 hn p): one internal event a_p on each process p.
  2. Phase 1 point-to-point sends: for each pair (p, q) with q ≠ p and q ≠ crownShift hn p, process p sends a message to q (using an internal step on p for excluded pairs so block offsets stay uniform).
  3. Message deliveries: each process q receives those n - 2 messages sent to it in Block 2.
  4. Phase 2 terminal events (crownPhase2 hn q): one internal event b_q on each process q.

Because no send step ever occurs at or after any recv step, causal paths cross at most one message hop, giving the exact crown characterization (crownFin_happensBeforeLe_iff): a_p ≼ b_q ↔ q ≠ crownShift hn p.

Any order-embedding f : E.Event → (Fin d → α) into a d-fold product of a LinearOrder α must separate each incomparable pair (a_p, b_{crownShift p}) at some coordinate coord p : Fin d where f (b_{crownShift p}) (coord p) < f (a_p) (coord p). If coord p₁ = coord p₂ = i for p₁ ≠ p₂, then crownShift p₂ ≠ crownShift p₁ yields a_{p₁} ≼ b_{crownShift p₂} and a_{p₂} ≼ b_{crownShift p₁}, producing the strict cycle f (a_{p₁}) i ≤ f (b_{crownShift p₂}) i < f (a_{p₂}) i ≤ f (b_{crownShift p₁}) i < f (a_{p₁}) i. Hence coord : Fin n → Fin d is injective, proving n ≤ d.

For arbitrary finite P, exists_unicast_execution_dim_lower_bound and unicast_clock_dim_lower_bound handle Fintype.card P = 0 (Execution.empty, 0 ≤ d) and Fintype.card P = 1 (two sequential internal events on the unique process forcing 1 ≤ d) directly, and transport crownFin along Fin (Fintype.card P) ≃ P when 2 ≤ Fintype.card P. Combining with Mattern vector clocks (Execution.vc, [Mat89]) yields exists_unicast_orderEmbedding_clock_iff: every unicast execution on P admits a d-coordinate ℕ-vector clock iff Fintype.card P ≤ d.

Main definitions #

Main results #

References #

Cyclic derangement and explicit crown execution on Fin n (2 ≤ n) #

def Cslib.Distributed.VectorClock.crownShift {n : ℕ} (hn : 2 ≤ n) (p : Fin n) :
Fin n

Cyclic shift (p + 1) mod n on Fin n (2 ≤ n), used as the fixed-point-free bijection in the crown execution crownFin.

crownShift hn has no fixed points when 2 ≤ n.

def Cslib.Distributed.VectorClock.crownStep (n : ℕ) (hn : 2 ≤ n) (i : Fin (2 * n + 2 * (n * n))) :
Step (Fin n)

Step i (0 ≤ i < 2 * n + 2 * (n * n)) of the 4-block crown execution crownFin on Fin n:

  • [0, n): Phase-1 initial internal step a_p on each p,
  • [n, n + n²): send from p = (i - n) / n to q = (i - n) % n if q ∉ {p, crownShift p}, else internal step on p,
  • [n + n², n + 2n²): matching receive at q of step i - n² if q ∉ {p, crownShift p}, else internal step on q,
  • [n + 2n², 2n + 2n²): Phase-2 terminal internal step b_q on each q.

Explicit 4-block unicast crown execution on Fin n (2 ≤ n), containing 2 * n + 2 * (n * n) events (a crown-poset step after [CB91] toward #7203).

def Cslib.Distributed.VectorClock.crownPhase1 {n : ℕ} (hn : 2 ≤ n) (p : Fin n) :

Phase-1 event a_p on process p in crownFin n hn (at trace index p.val).

def Cslib.Distributed.VectorClock.crownPhase2 {n : ℕ} (hn : 2 ≤ n) (q : Fin n) :

Phase-2 event b_q on process q in crownFin n hn (at trace index n + 2n² + q.val).

Crown-poset causality step in crownFin (toward #7203, after [CB91], not the uninspected paper endpoint): Phase-1 event a_p causally precedes or equals Phase-2 event b_q iff q ≠ crownShift hn p.

Dimension lower bound and sharp characterization #

theorem Cslib.Distributed.VectorClock.crownFin_dim_lower_bound {n : ℕ} (hn : 2 ≤ n) {α : Type v} [LinearOrder α] {d : ℕ} (f : (crownFin n hn).Event → Fin d → α) (hf : ∀ (e₁ e₂ : (crownFin n hn).Event), (crownFin n hn).HappensBeforeLe e₁ e₂ ↔ f e₁ ≤ f e₂) :
n ≤ d

Crown-execution dimension step on Fin n (toward #7203, after [CB91], not the uninspected paper endpoint): any coordinatewise order-embedding of crownFin n hn into Fin d → α (for any LinearOrder α) satisfies n ≤ d.

theorem Cslib.Distributed.VectorClock.exists_unicast_execution_dim_lower_bound (P : Type u) [Fintype P] :
∃ (E : Execution P), ∀ {α : Type v} [inst : LinearOrder α] {d : ℕ} (f : E.Event → Fin d → α), (∀ (e₁ e₂ : E.Event), E.HappensBeforeLe e₁ e₂ ↔ f e₁ ≤ f e₂) → Fintype.card P ≤ d

Single-execution dimension lower-bound step over finite unicast traces Execution P (toward #7203, after [CB91], whose primary text was not inspected; not the cited endpoint): for every finite P, there exists E : Execution P such that any order-embedding of E.Event into Fin d → α (for any LinearOrder α) forces Fintype.card P ≤ d (via Execution.empty at |P| = 0, two sequential internal events at |P| = 1, and crownFin for 2 ≤ |P|).

theorem Cslib.Distributed.VectorClock.unicast_clock_dim_lower_bound {P : Type u} [Fintype P] {α : Type v} [LinearOrder α] {d : ℕ} (h : ∀ (E : Execution P), ∃ (f : E.Event → Fin d → α), ∀ (e₁ e₂ : E.Event), E.HappensBeforeLe e₁ e₂ ↔ f e₁ ≤ f e₂) :

Clock-dimension lower-bound step over finite unicast executions Execution P (toward #7203, after [CB91], whose primary text was not inspected; not the cited endpoint): if every E : Execution P admits an order-embedding into Fin d → α (for a LinearOrder α) characterizing HappensBeforeLe, then Fintype.card P ≤ d.

theorem Cslib.Distributed.VectorClock.exists_unicast_orderEmbedding_clock_iff {P : Type u} [Fintype P] {d : ℕ} :
(∀ (E : Execution P), ∃ (f : E.Event → Fin d → ℕ), ∀ (e₁ e₂ : E.Event), E.HappensBeforeLe e₁ e₂ ↔ f e₁ ≤ f e₂) ↔ Fintype.card P ≤ d

Sharp Fin d → ℕ clock-dimension step over finite unicast executions Execution P (toward #7203, combining unicast_clock_dim_lower_bound after [CB91] with Mattern's Execution.vc [Mat89]; not claiming [CB91]'s uninspected endpoint): every E : Execution P admits an order-embedding into Fin d → ℕ iff Fintype.card P ≤ d.