Documentation

CslibFrontier.Computability.Distributed.CausalBroadcast.TotalOrder

One-Shot and Slot-Trace Total-Order Broadcast Steps and Cslib.FLP Reduction #

This module formalizes one-shot initial-broadcast and discrete-time slot-trace steps toward #7297 for asynchronous crash-fault Total-Order (Atomic) Broadcast, its reductions to and from Consensus, and its fault-tolerance contrast against single-group Causal Broadcast (after Hadzilacos and Toueg [HT94], §§3.1, 3.4, 3.8–3.9, 7.1–7.2, and Chandra and Toueg [CT96], §§4, 7, 7.1).

  1. One-Shot Asynchronous Crash-Fault Broadcast Model (TotalOrderBroadcastAlg): Models deterministic event-driven asynchronous broadcast algorithms over process set P in which each process receives one initial broadcast input inp p : V at start, with labelled transition system (TotalOrderBroadcastAlg.lts), schedule fairness (BcastProcFair, BcastFairRun), and crash count (bcastNumProcFaulty) aligned directly with Cslib.FLP.Algorithm. Defines one-shot Validity, Integrity, Agreement, SolvesReliableBroadcast, non-uniform TotalOrder ([HT94], §3.4, p. 13; [CT96], §7, p. 248), UniformTotalOrder ([HT94], §3.8, p. 15), and SolvesTotalOrderBroadcast.

  2. One-Shot Reduction to Cslib.FLP Consensus (consensusOfTotalOrderBroadcast) and f ≥ 1 Impossibility Step (not_exists_oneShotTotalOrderBroadcast_ge_one): Adapts any f-resilient one-shot TotalOrderBroadcastAlg P M S Bool into an f-resilient Cslib.FLP.Algorithm P M S (consensusOfTotalOrderBroadcast_consensus, after [HT94], §7.2.1, Figure 13 & Theorem 13, p. 58; [CT96], §7, p. 249) by deciding the payload of the first delivered message, and invokes Cslib.FLP.Consensus.ge_one_not_exists to rule out f ≥ 1 crash-resilient TotalOrderBroadcastAlg for 2 ≤ Fintype.card P and [Nontrivial V] (not_exists_oneShotTotalOrderBroadcast_ge_one). Paired with the 0-fault deterministic sequencer zeroFaultTotalOrderAlg (zeroFaultTotalOrderAlg_solves), exists_oneShotTotalOrderBroadcast_iff_eq_zero characterizes one-shot solvability as t = 0.

  3. Abstract Slot-Trace Reduction Step from Consensus + Reliable Broadcast (ConsensusSlotExec, totalOrderBroadcast_of_consensusSlotExec): Models the batch-delivery reduction of [CT96], §7.1 (Figure 7, Lemmas 7.1.2–7.1.5 & Theorem 7.1.6, pp. 249–252) and [HT94], §7.2.2 (Figure 14 & Theorem 14, pp. 60–63) over [LinearOrder Msg] (canonicalBatch, runConsensusSlots) at the abstract discrete-time (t : ℕ) subprotocol-execution level (ConsensusSlotExec), proving duplicate freedom, uniform integrity, uniform total order, agreement, and validity.

  4. Single-Group Causal vs. One-Shot Total-Order Fault-Tolerance Dichotomy Step (causal_vs_oneShotTotalOrder_dichotomy): Contrasts ∀ t < Fintype.card P solvability of BSSSolvesAtomicMulticastCausalBroadcast against t = 0-only solvability of one-shot TotalOrderBroadcastAlg for 2 ≤ Fintype.card P and [Nontrivial V].

Model scope relative to primary sources #

  1. Single initial broadcast per process in TotalOrderBroadcastAlg: Following Cslib.FLP.Algorithm, each process p : P receives one initial broadcast input inp p : V at initialization (TotalOrderBroadcastAlg.start) rather than dynamic multi-shot broadcast(m) invocations; dynamic multi-shot TotalOrderBroadcastAlg remains open under #7297.
  2. Discrete-time modular subprotocol interface in ConsensusSlotExec: ConsensusSlotExec and totalOrderBroadcast_of_consensusSlotExec work over an arbitrary multi-shot message type Msg with [LinearOrder Msg] and broadcast sets correctBcast ⊆ bcast : Set Msg, axiomatizing subprotocol execution traces (rDelivered, decidedBatches, Proposed, faulty_eventually_halted) rather than transforming executable network Algorithms (and leaving failure-detector classes of [CT96] §§3, 5–6 out of scope).

Main definitions #

Main results #

References #

Part 1: Asynchronous Crash-Fault Total-Order Broadcast Model #

structure Cslib.Distributed.CausalBroadcast.BcastMsg (P : Type u_1) (V : Type u_2) :
Type (max u_1 u_2)

A broadcast message (sender, payload) initiated by sender with body payload.

  • sender : P

    Originating broadcaster process.

  • payload : V

    Broadcast message payload.

theorem Cslib.Distributed.CausalBroadcast.BcastMsg.ext {P : Type u_1} {V : Type u_2} {x y : BcastMsg P V} (sender : x.sender = y.sender) (payload : x.payload = y.payload) :
x = y
def Cslib.Distributed.CausalBroadcast.instDecidableEqBcastMsg.decEq {P✝ : Type u_1} {V✝ : Type u_2} [DecidableEq P✝] [DecidableEq V✝] (x✝ x✝¹ : BcastMsg P✝ V✝) :
Decidable (x✝ = x✝¹)
@[instance_reducible]
structure Cslib.Distributed.CausalBroadcast.NetEnvelope (P : Type u_1) (M : Type u_2) :
Type (max u_1 u_2)

An outgoing network message addressed to dest carrying protocol payload body.

  • dest : P

    Recipient process identity.

  • body : M

    Protocol message content.

theorem Cslib.Distributed.CausalBroadcast.NetEnvelope.ext {P : Type u_1} {M : Type u_2} {x y : NetEnvelope P M} (dest : x.dest = y.dest) (body : x.body = y.body) :
x = y
@[instance_reducible]
def Cslib.Distributed.CausalBroadcast.instDecidableEqNetEnvelope.decEq {P✝ : Type u_1} {M✝ : Type u_2} [DecidableEq P✝] [DecidableEq M✝] (x✝ x✝¹ : NetEnvelope P✝ M✝) :
Decidable (x✝ = x✝¹)
structure Cslib.Distributed.CausalBroadcast.BcastEvent (P : Type u_1) (M : Type u_2) (V : Type u_3) :
Type (max (max u_1 u_2) u_3)

An event delivered to dest in a TotalOrderBroadcastAlg: Sum.inl v delivers dest's initial broadcast input v : V, and Sum.inr m delivers an in-flight protocol message m : M.

  • dest : P

    Recipient process identity.

  • evt : V ⊕ M

    Either initial broadcast value Sum.inl v or protocol message Sum.inr m.

theorem Cslib.Distributed.CausalBroadcast.BcastEvent.ext {P : Type u_1} {M : Type u_2} {V : Type u_3} {x y : BcastEvent P M V} (dest : x.dest = y.dest) (evt : x.evt = y.evt) :
x = y
theorem Cslib.Distributed.CausalBroadcast.BcastEvent.ext_iff {P : Type u_1} {M : Type u_2} {V : Type u_3} {x y : BcastEvent P M V} :
x = y ↔ x.dest = y.dest ∧ x.evt = y.evt
@[instance_reducible]
instance Cslib.Distributed.CausalBroadcast.instDecidableEqBcastEvent {P✝ : Type u_1} {M✝ : Type u_2} {V✝ : Type u_3} [DecidableEq P✝] [DecidableEq M✝] [DecidableEq V✝] :
DecidableEq (BcastEvent P✝ M✝ V✝)
def Cslib.Distributed.CausalBroadcast.instDecidableEqBcastEvent.decEq {P✝ : Type u_1} {M✝ : Type u_2} {V✝ : Type u_3} [DecidableEq P✝] [DecidableEq M✝] [DecidableEq V✝] (x✝ x✝¹ : BcastEvent P✝ M✝ V✝) :
Decidable (x✝ = x✝¹)
structure Cslib.Distributed.CausalBroadcast.BcastProcState (P : Type u_1) (S : Type u_2) (V : Type u_3) :
Type (max (max u_1 u_2) u_3)

Per-process configuration in a TotalOrderBroadcastAlg, pairing internal protocol state state with the append-only chronological list delivered of A-delivered broadcast messages.

  • state : S

    Internal protocol state of the process.

  • delivered : List (BcastMsg P V)

    Chronological sequence of broadcast messages delivered at this process so far.

theorem Cslib.Distributed.CausalBroadcast.BcastProcState.ext {P : Type u_1} {S : Type u_2} {V : Type u_3} {x y : BcastProcState P S V} (state : x.state = y.state) (delivered : x.delivered = y.delivered) :
x = y
@[instance_reducible]
instance Cslib.Distributed.CausalBroadcast.instDecidableEqBcastProcState {P✝ : Type u_1} {S✝ : Type u_2} {V✝ : Type u_3} [DecidableEq P✝] [DecidableEq S✝] [DecidableEq V✝] :
DecidableEq (BcastProcState P✝ S✝ V✝)
def Cslib.Distributed.CausalBroadcast.instDecidableEqBcastProcState.decEq {P✝ : Type u_1} {S✝ : Type u_2} {V✝ : Type u_3} [DecidableEq P✝] [DecidableEq S✝] [DecidableEq V✝] (x✝ x✝¹ : BcastProcState P✝ S✝ V✝) :
Decidable (x✝ = x✝¹)
structure Cslib.Distributed.CausalBroadcast.BcastState (P : Type u_1) (M : Type u_2) (S : Type u_3) (V : Type u_4) :
Type (max (max (max u_1 u_2) u_3) u_4)

Global network configuration of a TotalOrderBroadcastAlg: unordered multiset msgs of pending events/messages in transit and per-process local states proc.

  • msgs : Multiset (BcastEvent P M V)

    Unordered multiset of pending input triggers and in-flight network messages.

  • proc : P → BcastProcState P S V

    Local state of each process.

structure Cslib.Distributed.CausalBroadcast.TotalOrderBroadcastAlg (P : Type u_1) (M : Type u_2) (S : Type u_3) (V : Type u_4) :
Type (max (max (max u_1 u_2) u_3) u_4)

Specification of a deterministic asynchronous message-passing broadcast algorithm over process set P, network message type M, local state type S, and broadcast payload type V.

Mirrors Cslib.FLP.Algorithm: protocol transitions depend only on the incoming BcastEvent and the recipient's internal state : S, never on the specification log delivered.

  • init : P → S

    Initial internal state of each process p : P.

  • next : BcastEvent P M V → S → S

    Updated internal state of e.dest upon receiving event e.

  • send : BcastEvent P M V → S → Multiset (NetEnvelope P M)

    Network messages emitted by e.dest upon receiving event e.

  • deliver : BcastEvent P M V → S → List (BcastMsg P V)

    Broadcast messages newly delivered to e.dest upon receiving event e.

@[reducible, inline]
abbrev Cslib.Distributed.CausalBroadcast.BcastAction (P : Type u_1) (M : Type u_2) (V : Type u_3) :
Type (max (max u_3 u_2) u_1)

Action label of TotalOrderBroadcastAlg.lts: some e processes event e, and none is a stuttering step (matching Cslib.FLP.Action).

def Cslib.Distributed.CausalBroadcast.TotalOrderBroadcastAlg.start {P : Type u_1} {M : Type u_2} {S : Type u_3} {V : Type u_4} [Fintype P] (π : TotalOrderBroadcastAlg P M S V) (inp : P → V) :
BcastState P M S V

Initial global configuration for input assignment inp : P → V: one initial trigger ⟨p, Sum.inl (inp p)⟩ per process p : P and empty delivery logs.

def Cslib.Distributed.CausalBroadcast.TotalOrderBroadcastAlg.recvEvent {P : Type u_1} {M : Type u_2} {S : Type u_3} {V : Type u_4} [DecidableEq P] [DecidableEq M] [DecidableEq V] (π : TotalOrderBroadcastAlg P M S V) (e : BcastEvent P M V) (s : BcastState P M S V) :
BcastState P M S V

Global state transition when e.dest receives e in state s.

Labelled transition system of π, with stuttering step none matching Cslib.FLP.Algorithm.

def Cslib.Distributed.CausalBroadcast.TotalOrderBroadcastAlg.Reachable {P : Type u_1} {M : Type u_2} {S : Type u_3} {V : Type u_4} [Fintype P] [DecidableEq P] [DecidableEq M] [DecidableEq V] (π : TotalOrderBroadcastAlg P M S V) (inp : P → V) (s : BcastState P M S V) :

Reachability from π.start inp.

def Cslib.Distributed.CausalBroadcast.TotalOrderBroadcastAlg.BcastProcFaulty {P : Type u_1} {M : Type u_2} {S : Type u_3} {V : Type u_4} (p : P) (ss : ωSequence (BcastState P M S V)) (xs : ωSequence (BcastAction P M V)) :

Process p crashes (BcastProcFaulty) in (ss, xs) iff from some time k onward there is an undelivered event addressed to p while p never processes another event (matching Cslib.FLP.ProcFaulty).

def Cslib.Distributed.CausalBroadcast.TotalOrderBroadcastAlg.BcastProcFair {P : Type u_1} {M : Type u_2} {S : Type u_3} {V : Type u_4} (p : P) (ss : ωSequence (BcastState P M S V)) (xs : ωSequence (BcastAction P M V)) :

Process p is fair/correct (BcastProcFair) in (ss, xs) iff every event in msgs addressed to p is eventually processed by p (matching Cslib.FLP.ProcFair).

An infinite run is fair iff every process is either crash-faulty or fair (matching Cslib.FLP.FairRun).

noncomputable def Cslib.Distributed.CausalBroadcast.TotalOrderBroadcastAlg.bcastNumProcFaulty {P : Type u_1} {M : Type u_2} {S : Type u_3} {V : Type u_4} (ss : ωSequence (BcastState P M S V)) (xs : ωSequence (BcastAction P M V)) :

Number of crash-faulty processes in (ss, xs) (matching Cslib.FLP.numProcFaulty).

def Cslib.Distributed.CausalBroadcast.TotalOrderBroadcastAlg.AdmissibleRun {P : Type u_1} {M : Type u_2} {S : Type u_3} {V : Type u_4} [Fintype P] [DecidableEq P] [DecidableEq M] [DecidableEq V] (π : TotalOrderBroadcastAlg P M S V) (inp : P → V) (f : ℕ) (ss : ωSequence (BcastState P M S V)) (xs : ωSequence (BcastAction P M V)) :

An infinite execution (ss, xs) of π on input inp is f-admissible iff it starts at π.start inp, follows π.lts, is fair, and has at most f crash-faulty processes (matching Cslib.FLP.Algorithm.AdmissibleRun).

One-shot broadcast validity on TotalOrderBroadcastAlg (after [HT94], §3.1, p. 10; [CT96], §4, p. 238): in every f-admissible run, every correct (BcastProcFair) process p eventually delivers its own initial broadcast ⟨p, inp p⟩.

One-shot broadcast integrity on TotalOrderBroadcastAlg (after [HT94], §3.1, p. 10; [CT96], §4, p. 238): in every f-admissible run, every correct process delivers each message at most once (Nodup), and every delivered message m equals the initial broadcast ⟨m.sender, inp m.sender⟩ of its sender.

One-shot broadcast agreement on TotalOrderBroadcastAlg (after [HT94], §3.1, p. 10; [CT96], §4, p. 238): in every f-admissible run, if a correct process p delivers m, then every correct process q eventually delivers m.

Non-uniform total-order delivery on one-shot TotalOrderBroadcastAlg (after [HT94], §3.4, p. 13; [CT96], §7, p. 248): in every f-admissible run, if two correct processes p and q both deliver m₁ and m₂, then p delivers m₁ before m₂ iff q delivers m₁ before m₂.

Uniform total-order delivery on one-shot TotalOrderBroadcastAlg (after [HT94], §3.8, p. 15): in every reachable global configuration s, for any two processes p and q (faulty or correct) that have both delivered m₁ and m₂, p delivered m₁ before m₂ iff q delivered m₁ before m₂.

One-shot f-resilient reliable broadcast specification on TotalOrderBroadcastAlg (after [HT94], §3.1).

One-shot f-resilient total-order (atomic) broadcast specification on TotalOrderBroadcastAlg (after [HT94], §3.4; [CT96], §7).

Part 2: Reduction 1 — Total-Order Broadcast → Cslib.FLP Consensus & Impossibility #

One-shot initial-broadcast reduction adapter from TotalOrderBroadcastAlg P M S Bool to Cslib.FLP.Algorithm P M S (toward #7297, after [HT94], §7.2.1, Figure 13, p. 58 and [CT96], §7, p. 249): each process p broadcasts its initial boolean input inp p upon receiving ⟨p, Sum.inl (inp p)⟩ and decides the payload of the first message delivered in its local delivery log (latched write-once by Cslib.FLP.Algorithm.recvMsg).

One-shot initial-broadcast reduction step from TotalOrderBroadcastAlg to binary Consensus in Cslib.FLP (toward #7297, after [HT94], §7.2.1, Figure 13 & Theorem 13, p. 58 and [CT96], §7, p. 249): for every fault bound f : ℕ, if π solves f-resilient one-shot SolvesTotalOrderBroadcast over Bool, then consensusOfTotalOrderBroadcast π solves f-resilient Cslib.FLP.Algorithm.Consensus.

One-shot initial-broadcast impossibility step for f ≥ 1 crash faults (toward #7297, after [HT94], §7.2.1, Corollary 2, p. 58 and [CT96], §7, observation (1), p. 249): for any finite process set P with 2 ≤ Fintype.card P, any nontrivial payload type V, and any fault bound 1 ≤ f, there is no deterministic asynchronous f-resilient one-shot TotalOrderBroadcastAlg.

Proved by reducing binary Consensus to one-shot TotalOrderBroadcastAlg via consensusOfTotalOrderBroadcast and applying Cslib.FLP.Consensus.ge_one_not_exists directly.

One-shot initial-broadcast uniformity step via Cslib.FLP.FairScheduler (toward #7297): in purely asynchronous crash-stop message passing, non-uniform SolvesTotalOrderBroadcast f on a one-shot TotalOrderBroadcastAlg implies UniformTotalOrder on all reachable configurations, because any finite reachable prefix extends to a 0-fault admissible run in which every process is BcastProcFair.

Part 3: Zero-Fault Deterministic Sequencer Algorithm (f = 0) #

structure Cslib.Distributed.CausalBroadcast.SlotEntry (P : Type u_1) (V : Type u_2) :
Type (max u_1 u_2)

Entry in a process's sequencer reorder buffer pairing sequence slot with item.

  • slot : ℕ

    Assigned sequence number.

  • item : BcastMsg P V

    Broadcast message assigned to slot.

theorem Cslib.Distributed.CausalBroadcast.SlotEntry.ext {P : Type u_1} {V : Type u_2} {x y : SlotEntry P V} (slot : x.slot = y.slot) (item : x.item = y.item) :
x = y
def Cslib.Distributed.CausalBroadcast.instDecidableEqSlotEntry.decEq {P✝ : Type u_1} {V✝ : Type u_2} [DecidableEq P✝] [DecidableEq V✝] (x✝ x✝¹ : SlotEntry P✝ V✝) :
Decidable (x✝ = x✝¹)
@[instance_reducible]
structure Cslib.Distributed.CausalBroadcast.DrainResult (P : Type u_1) (V : Type u_2) :
Type (max u_1 u_2)

Result of draining consecutive available slots from a sequencer reorder buffer.

  • nextDeliver : ℕ

    Updated next-undelivered slot index.

  • delivered : List (BcastMsg P V)

    Broadcast messages newly drained in slot order.

theorem Cslib.Distributed.CausalBroadcast.DrainResult.ext {P : Type u_1} {V : Type u_2} {x y : DrainResult P V} (nextDeliver : x.nextDeliver = y.nextDeliver) (delivered : x.delivered = y.delivered) :
x = y
def Cslib.Distributed.CausalBroadcast.instDecidableEqDrainResult.decEq {P✝ : Type u_1} {V✝ : Type u_2} [DecidableEq P✝] [DecidableEq V✝] (x✝ x✝¹ : DrainResult P✝ V✝) :
Decidable (x✝ = x✝¹)
@[instance_reducible]
inductive Cslib.Distributed.CausalBroadcast.SeqMsg (P : Type u_1) (V : Type u_2) :
Type (max u_1 u_2)

Protocol message type of zeroFaultTotalOrderAlg: processes send propose item to the fixed leader, and leader broadcasts ordered slot item to all processes.

@[instance_reducible]
instance Cslib.Distributed.CausalBroadcast.instDecidableEqSeqMsg {P✝ : Type u_1} {V✝ : Type u_2} [DecidableEq P✝] [DecidableEq V✝] :
DecidableEq (SeqMsg P✝ V✝)
def Cslib.Distributed.CausalBroadcast.instDecidableEqSeqMsg.decEq {P✝ : Type u_1} {V✝ : Type u_2} [DecidableEq P✝] [DecidableEq V✝] (x✝ x✝¹ : SeqMsg P✝ V✝) :
Decidable (x✝ = x✝¹)
structure Cslib.Distributed.CausalBroadcast.SeqState (P : Type u_1) (V : Type u_2) :
Type (max u_1 u_2)

Local state of each process in zeroFaultTotalOrderAlg.

  • nextSlot : ℕ

    Next sequence number to be assigned by leader (unused at non-leaders).

  • nextDeliver : ℕ

    Next consecutive slot index this process is waiting to deliver.

  • buf : List (SlotEntry P V)

    Buffer of received SlotEntry records from leader.

theorem Cslib.Distributed.CausalBroadcast.SeqState.ext {P : Type u_1} {V : Type u_2} {x y : SeqState P V} (nextSlot : x.nextSlot = y.nextSlot) (nextDeliver : x.nextDeliver = y.nextDeliver) (buf : x.buf = y.buf) :
x = y
@[instance_reducible]
def Cslib.Distributed.CausalBroadcast.instDecidableEqSeqState.decEq {P✝ : Type u_1} {V✝ : Type u_2} [DecidableEq P✝] [DecidableEq V✝] (x✝ x✝¹ : SeqState P✝ V✝) :
Decidable (x✝ = x✝¹)

Look up the first item assigned to slot in buf.

Drain consecutive slots k, k + 1, … available in buf for up to fuel steps.

One-shot deterministic 0-fault fixed-sequencer algorithm (leader : P) on TotalOrderBroadcastAlg (toward #7297):

  1. Upon receiving initial input Sum.inl v at p, p sends SeqMsg.propose ⟨p, v⟩ to leader.
  2. Upon receiving SeqMsg.propose item at leader, leader assigns slot := st.nextSlot, increments nextSlot, and sends SeqMsg.ordered slot item to every q : P.
  3. Upon receiving SeqMsg.ordered slot item at q, q buffers ⟨slot, item⟩ and delivers all consecutive available slots starting at st.nextDeliver.

Reorder-buffer drain lemmas #

Sequencer invariant and shadow log #

Per-action preservation of SeqInv #

Fairness, buffer monotonicity, and eventual slot delivery #

Broadcast specification properties for zeroFaultTotalOrderAlg #

One-shot 0-fault solvability step (toward #7297): zeroFaultTotalOrderAlg leader satisfies SolvesTotalOrderBroadcast 0 on any finite process set P.

theorem Cslib.Distributed.CausalBroadcast.exists_oneShotTotalOrderBroadcast_iff_eq_zero {P : Type u} {V : Type v} [Fintype P] [DecidableEq P] [DecidableEq V] [Nontrivial V] (hc : 2 ≤ Fintype.card P) (t : ℕ) :
(∃ (M : Type (max u v)) (S : Type (max u v)) (x : DecidableEq M) (π : TotalOrderBroadcastAlg P M S V), π.SolvesTotalOrderBroadcast t) ↔ t = 0

Exact t = 0 crash-fault solvability characterization step for one-shot TotalOrderBroadcastAlg (toward #7297): on any finite process set P with 2 ≤ Fintype.card P and any nontrivial payload type V, a deterministic asynchronous t-resilient one-shot TotalOrderBroadcastAlg exists if and only if t = 0.

Part 4: Reduction 2 — Sequential Consensus Slots → Total-Order Broadcast #

def Cslib.Distributed.CausalBroadcast.canonicalBatch {Msg : Type u_1} [LinearOrder Msg] (alreadyDelivered : List Msg) :
List Msg → List Msg

Given the list alreadyDelivered of previously A-delivered messages and a raw Consensus-decided batch rawBatch, filter out already-delivered messages, deduplicate, and sort into canonical strictly increasing [LinearOrder Msg] order ([CT96], §7.1, Figure 7, Task 3, p. 249; [HT94], §7.2.2, Figure 14, p. 60).

Fold a finite list of Consensus-decided batches into the resulting chronological A-delivery log, appending canonicalBatch acc batch at each sequential slot.

theorem Cslib.Distributed.CausalBroadcast.canonicalBatch_ext {Msg : Type u_1} [LinearOrder Msg] {deliv raw₁ raw₂ : List Msg} (hext : ∀ (m : Msg), m ∈ raw₁ ∧ m ∉ deliv ↔ m ∈ raw₂ ∧ m ∉ deliv) :
canonicalBatch deliv raw₁ = canonicalBatch deliv raw₂

Extensionality of canonicalBatch on undelivered elements: two raw Consensus-decided batches with the same undelivered elements produce the identical canonical sequence canonicalBatch deliv raw₁ = canonicalBatch deliv raw₂, regardless of duplicates or internal list ordering.

runConsensusSlots batches never delivers duplicate messages (Nodup).

structure Cslib.Distributed.CausalBroadcast.ConsensusSlotExec (P : Type u_1) (Msg : Type u_2) [LinearOrder Msg] (F : Set P) :
Type (max u_1 u_2)

Abstract discrete-time (t : ℕ) slot-execution specification step toward #7297 (after [CT96], §7.1, Figure 7, pp. 249–252; [HT94], §7.2.2, Figure 14, pp. 60–63) over finite process set P, static crash-fault set F : Set P, and message type Msg equipped with [LinearOrder Msg], axiomatizing the execution traces of an underlying Reliable Broadcast and sequential per-slot Consensus instances (k = 0, 1, …).

Each process p maintains:

  • rDelivered p t : Finset Msg — messages R-delivered by the underlying Reliable Broadcast up to time t;
  • decidedBatches p t : List (List Msg) — raw Consensus batches sequentially decided by p in slots 0, 1, …, (decidedBatches p t).length - 1 up to time t, from which p's chronological A-delivery log is computed by aDelivered p t := runConsensusSlots (decidedBatches p t).
  • bcast : Set Msg

    All messages submitted to Atomic Broadcast during the execution.

  • correctBcast : Set Msg

    Subset of bcast initiated by non-faulty (∉ F) broadcasters.

  • correctBcast_sub : self.correctBcast ⊆ self.bcast

    Every message in correctBcast was submitted to bcast.

  • rDelivered : P → ℕ → Finset Msg

    Local set R_delivered_p of Reliable-Broadcast-delivered messages at p at time t.

  • decidedBatches : P → ℕ → List (List Msg)

    Sequential Consensus batches msgSet^0, …, msgSet^{k-1} decided at p by time t.

  • Proposed : P → ℕ → ℕ → List Msg → Prop

    Proposed p k t batch holds when p executes propose(k, batch) at time t.

  • rDelivered_mono (p : P) {t₁ t₂ : ℕ} : t₁ ≤ t₂ → self.rDelivered p t₁ ⊆ self.rDelivered p t₂

    R_delivered_p grows monotonically with time.

  • rb_integrity (p : P) (t : ℕ) (m : Msg) : m ∈ self.rDelivered p t → m ∈ self.bcast

    Reliable Broadcast Uniform Integrity: every R-delivered message was broadcast.

  • rb_validity (m : Msg) : m ∈ self.correctBcast → ∀ q ∉ F, ∃ (t : ℕ), m ∈ self.rDelivered q t

    Reliable Broadcast Validity: every message broadcast by a correct process is eventually R-delivered by every correct process q ∉ F.

  • rb_agreement (p : P) : p ∉ F → ∀ q ∉ F, ∀ (m : Msg) (t : ℕ), m ∈ self.rDelivered p t → ∃ (t' : ℕ), m ∈ self.rDelivered q t'

    Reliable Broadcast Agreement: every message R-delivered by a correct process p ∉ F is eventually R-delivered by every correct process q ∉ F.

  • decidedBatches_prefix (p : P) {t₁ t₂ : ℕ} : t₁ ≤ t₂ → self.decidedBatches p t₁ <+: self.decidedBatches p t₂

    Sequential slot decisions at each process only extend by appending new slots.

  • propose_spec (p : P) (k t : ℕ) (batch : List Msg) : self.Proposed p k t batch → (self.decidedBatches p t).length = k ∧ batch ≠ [] ∧ ∀ (m : Msg), m ∈ batch ↔ m ∈ self.rDelivered p t ∧ m ∉ runConsensusSlots (self.decidedBatches p t)

    Task 3 proposal rule ([CT96], Figure 7, p. 249): when p proposes batch in slot k at time t, p has completed slots < k, batch is nonempty, and batch consists of R_delivered_p \ A_delivered_p.

  • decide_requires_propose (p : P) (t k : ℕ) : k < (self.decidedBatches p t).length → ∃ t₀ ≤ t, ∃ (batch : List Msg), self.Proposed p k t₀ batch

    A process enters decide(k, -) only after executing propose(k, -) in Task 3.

  • task3_fair (p : P) : p ∉ F → ∀ (t k : ℕ), (self.decidedBatches p t).length = k → (∃ m ∈ self.rDelivered p t, m ∉ runConsensusSlots (self.decidedBatches p t)) → ∃ (t' : ℕ) (batch : List Msg), self.Proposed p k t' batch

    Task 3 fairness at correct processes p ∉ F: whenever p is at slot k with an undelivered R-delivered message, p eventually executes propose(k, -).

  • faulty_eventually_halted (r : P) : r ∈ F → ∃ (K_r : ℕ), ∀ (k : ℕ), K_r ≤ k → ∀ (t : ℕ) (batch : List Msg), ¬self.Proposed r k t batch

    Crash-stop bound on faulty proposers ([CT96], Lemma 7.1.4, p. 251): each faulty process r ∈ F crashes after finitely many steps and therefore proposes in only finitely many Consensus slots.

  • cons_agreement (p q : P) (t₁ t₂ k : ℕ) (hk₁ : k < (self.decidedBatches p t₁).length) (hk₂ : k < (self.decidedBatches q t₂).length) (m : Msg) : m ∈ (self.decidedBatches p t₁)[k] ↔ m ∈ (self.decidedBatches q t₂)[k]

    Consensus Uniform Agreement per slot k: any two processes that decide slot k decide extensionally equal message sets msgSet^k.

  • cons_validity (p : P) (t k : ℕ) (hk : k < (self.decidedBatches p t).length) : ∃ (r : P) (t_r : ℕ) (batch : List Msg), self.Proposed r k t_r batch ∧ ∀ (m : Msg), m ∈ (self.decidedBatches p t)[k] ↔ m ∈ batch

    Consensus Uniform Validity per slot k: any decided batch in slot k was proposed by some process r in slot k.

  • cons_termination (k : ℕ) : (∀ q ∉ F, ∃ (t : ℕ) (batch : List Msg), self.Proposed q k t batch) → ∀ q ∉ F, ∃ (t : ℕ), k < (self.decidedBatches q t).length

    Consensus Termination per slot k: if all correct processes q ∉ F propose in slot k, then all correct processes eventually decide slot k.

def Cslib.Distributed.CausalBroadcast.ConsensusSlotExec.aDelivered {P : Type u_1} {Msg : Type u_2} [LinearOrder Msg] {F : Set P} (E : ConsensusSlotExec P Msg F) (p : P) (t : ℕ) :
List Msg

Chronological A-delivery log of process p at time t in E, obtained by running runConsensusSlots on E.decidedBatches p t.

theorem Cslib.Distributed.CausalBroadcast.totalOrderBroadcast_of_consensusSlotExec {P : Type u_1} {Msg : Type u_2} [Finite P] [LinearOrder Msg] {F : Set P} (E : ConsensusSlotExec P Msg F) :
(∀ (p : P) (t : ℕ), (E.aDelivered p t).Nodup) ∧ (∀ (p : P) (t : ℕ), ∀ m ∈ E.aDelivered p t, m ∈ E.bcast) ∧ (∀ (p q : P) (t₁ t₂ : ℕ) (m₁ m₂ : Msg), m₁ ∈ E.aDelivered p t₁ → m₂ ∈ E.aDelivered p t₁ → m₁ ∈ E.aDelivered q t₂ → m₂ ∈ E.aDelivered q t₂ → (List.idxOf m₁ (E.aDelivered p t₁) < List.idxOf m₂ (E.aDelivered p t₁) ↔ List.idxOf m₁ (E.aDelivered q t₂) < List.idxOf m₂ (E.aDelivered q t₂))) ∧ (∀ p ∉ F, ∀ q ∉ F, ∀ (m : Msg) (t₁ : ℕ), m ∈ E.aDelivered p t₁ → ∃ (t₂ : ℕ), m ∈ E.aDelivered q t₂) ∧ ∀ m ∈ E.correctBcast, ∀ p ∉ F, ∃ (t : ℕ), m ∈ E.aDelivered p t

Abstract discrete-time (t : ℕ) slot-trace reduction step from Reliable Broadcast and sequential Consensus slot specifications (ConsensusSlotExec) to Total-Order Broadcast properties (toward #7297, after [CT96], §7.1, Figure 7 & Theorem 7.1.6, pp. 249–252 and [HT94], §7.2.2, Figure 14 & Theorem 14, pp. 60–63):

For any finite process set P, any crash-fault set F : Set P, and any [LinearOrder Msg], every abstract slot execution E : ConsensusSlotExec P Msg F satisfies:

  1. Uniform No Duplicates: (E.aDelivered p t).Nodup for all p : P (faulty or correct);
  2. Uniform Integrity: m ∈ E.aDelivered p t → m ∈ E.bcast for all p : P;
  3. Uniform Total Order: for all p, q : P (faulty or correct) and t₁, t₂ : ℕ, if m₁, m₂ have been A-delivered at both (p, t₁) and (q, t₂), then p delivered m₁ before m₂ iff q delivered m₁ before m₂;
  4. Agreement: if p ∉ F A-delivers m at t₁, then every q ∉ F eventually A-delivers m;
  5. Validity: for every m ∈ E.correctBcast and every p ∉ F, p eventually A-delivers m.

Part 5: Single-Group Causal vs. One-Shot Total-Order Fault-Tolerance Dichotomy Step #

theorem Cslib.Distributed.CausalBroadcast.causal_vs_oneShotTotalOrder_dichotomy {P : Type u} {V : Type v} [Fintype P] [DecidableEq P] [DecidableEq V] [Nontrivial V] (hc : 2 ≤ Fintype.card P) {t : ℕ} (ht : t < Fintype.card P) :
(∀ (F : Set P), F.ncard ≤ t → (∃ (q : P), q ∉ F) ∧ BSSSolvesAtomicMulticastCausalBroadcast P V F) ∧ ((∃ (M : Type (max u v)) (S : Type (max u v)) (x : DecidableEq M) (π : TotalOrderBroadcastAlg P M S V), π.SolvesTotalOrderBroadcast t) ↔ t = 0)

Fault-tolerance dichotomy step between single-group atomic-multicast CBCAST and one-shot TotalOrderBroadcastAlg (toward #7297, after [BSS91], §5.1; [HT94], §3.3, §3.4 & Corollary 2; [CT96], §7):

Over any finite process set P with 2 ≤ Fintype.card P and any nontrivial payload type V, for every crash-fault threshold t < Fintype.card P:

  1. Single-group atomic-multicast causal broadcast (bssLTS) is deterministically solvable for all t < Fintype.card P: for every fault set F : Set P with F.ncard ≤ t, non-faulty processes exist (∃ q, q ∉ F) and bssLTS F satisfies BSSSolvesAtomicMulticastCausalBroadcast P V F;
  2. One-shot total-order broadcast (TotalOrderBroadcastAlg) is deterministically solvable iff t = 0 (impossible for t ≥ 1 by reduction to Cslib.FLP).