Documentation

CslibFrontier.Computability.Distributed.BenOr.Liveness

Pre-coin phase-scheduler termination step for Ben-Or's binary consensus #

This module proves a pre-coin phase-scheduler probabilistic termination step for the quorum-phase transition of CslibFrontier.Computability.Distributed.BenOr.Basic (after [BO83], §3, Protocol A, printed p. 28, toward Theorem 1(i) on printed p. 29; termination in Ben-Or's full asynchronous scheduler model remains open in #7120).

Scheduling restriction (#7120): In [BO83], §2 (printed pp. 27–28), an adversary schedule chooses each primitive process step and message delivery using the current configuration and full execution history, including outcomes of earlier local coin flips by processes that have already completed step 3(c) of a round while slower processes are still collecting that round's n - t messages. Here probRun instead models a pre-coin per-phase state-adaptive scheduler strat : ℕ → (P → ProcState) → PhaseSchedule P that commits the entire phase-r quorum schedule strat r st from the phase-r boundary state st before sampling the entire phase-r coin vector from coinLaw, and bounds the non-decision marginal of that phased Markov process. Neither probRun nor CrashSchedule in Basic.lean extends the probabilistic termination bound to §2 schedulers with arbitrary cross-round step/message interleavings (#7120).

Whenever coinLaw : PMF (P → Bool) places mass at least p on both unanimous coin vectors fun _ => true and fun _ => false:

  1. phaseStep_lucky_coin guarantees at least one of those two constant vectors aligns every process onto a common estimate at the end of phase r, bounding single-phase non-unanimity probability by 1 - p (and by 0 once estimates are already unanimous).
  2. By induction over k phases (probRun_not_unanimous_le), the probability that estimates are not yet unanimous after k phases is at most (1 - p) ^ k.
  3. One additional valid phase deterministically turns unanimous estimates into unanimous decisions (probRun_not_allDecided_le), bounding the probability of ¬ AllDecided after k + 1 phases by (1 - p) ^ k, which converges to 0 as the phase count grows whenever 0 < p (tendsto_probRun_not_allDecided).

Instantiating coinLaw gives two distinct coin regimes under this pre-coin phase-scheduler model:

Main definitions #

Main results #

References #

Sequential probabilistic execution and coin laws #

noncomputable def Cslib.Distributed.BenOr.probRun {P : Type u_1} [Fintype P] (t : ℕ) (coinLaw : PMF (P → Bool)) (strat : ℕ → (P → ProcState) → PhaseSchedule P) (inp : P → Bool) :
ℕ → PMF (P → ProcState)

State distribution after k phases of Ben-Or's protocol from initial inputs inp. At the boundary of each phase r, the pre-coin per-phase state-adaptive scheduler strat r st commits all processes' Stage-1 and Stage-2 quorums from the current global state st, before the phase-r coin vector is sampled from coinLaw.

noncomputable def Cslib.Distributed.BenOr.commonCoinLaw (P : Type u_1) :
PMF (P → Bool)

Separate shared-coin variant (not in [BO83]): sample one uniform bit b : Bool and supply fun _ => b to all processes.

noncomputable def Cslib.Distributed.BenOr.localCoinLaw (P : Type u_1) [Fintype P] :
PMF (P → Bool)

Independent local fair coins (after [BO83], §3, Protocol A, step 3(c), printed p. 28): sample c : P → Bool uniformly from all 2 ^ |P| coin assignments.

theorem Cslib.Distributed.BenOr.half_le_commonCoinLaw (P : Type u_1) (b : Bool) :
1 / 2 ≤ (commonCoinLaw P) fun (x : P) => b

Under commonCoinLaw P, each constant coin vector fun _ => b has mass at least 1 / 2 (including when P is empty, where both constant vectors coincide and have mass 1).

theorem Cslib.Distributed.BenOr.commonCoinLaw_const {P : Type u_1} [Nonempty P] (b : Bool) :
((commonCoinLaw P) fun (x : P) => b) = 1 / 2

On a nonempty process set P, commonCoinLaw P assigns probability 1 / 2 to each constant coin vector fun _ => b.

@[simp]
theorem Cslib.Distributed.BenOr.localCoinLaw_apply {P : Type u_1} [Fintype P] (c : P → Bool) :
(localCoinLaw P) c = (1 / 2) ^ Fintype.card P

Under localCoinLaw P, every coin assignment c : P → Bool has probability (1 / 2) ^ |P|.

Support invariants and single-phase probability bounds #

Parametric multi-phase tail bounds under pre-coin phase schedulers #

theorem Cslib.Distributed.BenOr.probRun_not_unanimous_le {P : Type u_1} [Fintype P] {t : ℕ} (ht : 2 * t < Fintype.card P) {coinLaw : PMF (P → Bool)} {p : ENNReal} (hcoin : ∀ (b : Bool), p ≤ coinLaw fun (x : P) => b) {strat : ℕ → (P → ProcState) → PhaseSchedule P} (inp : P → Bool) (k : ℕ) (hv : ∀ r < k, ∀ (st : P → ProcState), (strat r st).Valid t) :
(probRun t coinLaw strat inp k).toOuterMeasure {st : P → ProcState | ¬IsUnanimous st} ≤ (1 - p) ^ k

Pre-coin phase-scheduler non-unanimity step: when each phase's PhaseSchedule is committed from the phase boundary state before coinLaw is sampled, if coinLaw assigns mass at least p to both constant coin vectors fun _ => true and fun _ => false and 2 * t < |P|, the probability under probRun that process estimates are not unanimous after k phases is at most (1 - p) ^ k.

theorem Cslib.Distributed.BenOr.probRun_not_allDecided_le {P : Type u_1} [Fintype P] {t : ℕ} (ht : 2 * t < Fintype.card P) {coinLaw : PMF (P → Bool)} {p : ENNReal} (hcoin : ∀ (b : Bool), p ≤ coinLaw fun (x : P) => b) {strat : ℕ → (P → ProcState) → PhaseSchedule P} (inp : P → Bool) (k : ℕ) (hv : ∀ r < k + 1, ∀ (st : P → ProcState), (strat r st).Valid t) :
(probRun t coinLaw strat inp (k + 1)).toOuterMeasure {st : P → ProcState | ¬AllDecided st} ≤ (1 - p) ^ k

Pre-coin phase-scheduler non-decision tail step: when each phase's PhaseSchedule is committed from the phase boundary state before coinLaw is sampled, after k + 1 phases (k coin-alignment phases plus one deterministic decision phase) the probability under probRun that processes have not all decided a common value is at most (1 - p) ^ k.

theorem Cslib.Distributed.BenOr.tendsto_probRun_not_allDecided {P : Type u_1} [Fintype P] {t : ℕ} (ht : 2 * t < Fintype.card P) {coinLaw : PMF (P → Bool)} {p : ENNReal} (hp : 0 < p) (hcoin : ∀ (b : Bool), p ≤ coinLaw fun (x : P) => b) {strat : ℕ → (P → ProcState) → PhaseSchedule P} (hv : ∀ (r : ℕ) (st : P → ProcState), (strat r st).Valid t) (inp : P → Bool) :
Filter.Tendsto (fun (m : ℕ) => (probRun t coinLaw strat inp m).toOuterMeasure {st : P → ProcState | ¬AllDecided st}) Filter.atTop (nhds 0)

Pre-coin phase-scheduler convergence step: whenever 0 < p, ∀ b, p ≤ coinLaw (fun _ => b), and strat commits valid n - t phase quorums from each phase boundary state before coinLaw is sampled, the non-decision marginal of probRun after m phases converges to 0 as m → ∞.

Separate common-coin variant (≤ (1 / 2) ^ k) #

theorem Cslib.Distributed.BenOr.probRun_commonCoin_not_allDecided_le {P : Type u_1} [Fintype P] {t : ℕ} (ht : 2 * t < Fintype.card P) {strat : ℕ → (P → ProcState) → PhaseSchedule P} (inp : P → Bool) (k : ℕ) (hv : ∀ r < k + 1, ∀ (st : P → ProcState), (strat r st).Valid t) :
(probRun t (commonCoinLaw P) strat inp (k + 1)).toOuterMeasure {st : P → ProcState | ¬AllDecided st} ≤ (1 / 2) ^ k

Pre-coin phase-scheduler tail bound for the separate common-coin variant (commonCoinLaw P, not in [BO83]): when each phase's quorums are committed from the phase boundary state before sampling the shared coin and 2 * t < |P|, the non-decision probability under probRun after k + 1 phases is at most (1 / 2) ^ k.

theorem Cslib.Distributed.BenOr.tendsto_probRun_commonCoin_not_allDecided {P : Type u_1} [Fintype P] {t : ℕ} (ht : 2 * t < Fintype.card P) {strat : ℕ → (P → ProcState) → PhaseSchedule P} (hv : ∀ (r : ℕ) (st : P → ProcState), (strat r st).Valid t) (inp : P → Bool) :

Pre-coin phase-scheduler convergence for the separate common-coin variant (commonCoinLaw P, not in [BO83]): when each phase's quorums are committed from the phase boundary state before sampling the shared coin and 2 * t < |P|, the non-decision marginal of probRun after m phases tends to 0 as m → ∞.

Independent local fair coins: pre-coin phase-scheduler step (≤ (1 - (1 / 2) ^ |P|) ^ k) #

theorem Cslib.Distributed.BenOr.probRun_localCoin_not_allDecided_le {P : Type u_1} [Fintype P] {t : ℕ} (ht : 2 * t < Fintype.card P) {strat : ℕ → (P → ProcState) → PhaseSchedule P} (inp : P → Bool) (k : ℕ) (hv : ∀ r < k + 1, ∀ (st : P → ProcState), (strat r st).Valid t) :
(probRun t (localCoinLaw P) strat inp (k + 1)).toOuterMeasure {st : P → ProcState | ¬AllDecided st} ≤ (1 - (1 / 2) ^ Fintype.card P) ^ k

Pre-coin phase-scheduler termination step (not the full asynchronous scheduler theorem of [BO83]; see #7120), after [BO83], §3, Protocol A (printed p. 28): when each phase's quorum schedule strat r st is committed from the phase boundary state st before sampling the entire independent local coin vector localCoinLaw P and 2 * t < |P|, the probability under probRun that processes have not all decided a common value after k + 1 phases is at most (1 - (1 / 2) ^ |P|) ^ k.

theorem Cslib.Distributed.BenOr.tendsto_probRun_localCoin_not_allDecided {P : Type u_1} [Fintype P] {t : ℕ} (ht : 2 * t < Fintype.card P) {strat : ℕ → (P → ProcState) → PhaseSchedule P} (hv : ∀ (r : ℕ) (st : P → ProcState), (strat r st).Valid t) (inp : P → Bool) :
Filter.Tendsto (fun (m : ℕ) => (probRun t (localCoinLaw P) strat inp m).toOuterMeasure {st : P → ProcState | ¬AllDecided st}) Filter.atTop (nhds 0)

Pre-coin phase-scheduler convergence step toward Theorem 1(i) of [BO83] (§3, Protocol A, printed pp. 28–29; full history-dependent asynchronous step/delivery schedulers of §2 remain tracked in #7120): when each phase's quorum schedule strat r st is committed from the phase boundary state st before sampling localCoinLaw P and 2 * t < |P|, the non-decision marginal of probRun after m phases tends to 0 as m → ∞.