Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Generalized election-timer round: fire times and uncontested rounds for arbitrary delays

Definition
OpenSearchLivenessAbstract

by pitimespi · Nov 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

cluster-coordinationconsensusformal-verificationlivenessopensearchzen2

For a round of an election-timer competition, each candidate iii has an integer offset and a delay function over all 2642^{64}264 draws. The fire time of candidate iii on draw xxx is its offset plus its delay for xix_ixi​. A round is uncontested with margin δ\deltaδ when some candidate fires at least δ\deltaδ before every other candidate.

Definition code
import Mathlib.Data.Finset.Basic
import Mathlib.Data.Finset.Card
import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Fintype.Card
import Mathlib.Logic.Equiv.Prod
import Mathlib.Order.Interval.Finset.Basic
import Mathlib.Tactic

namespace OpenSearchLivenessAbstract

/-- Fire time of candidate `i`: its offset plus its delay for draw `x i`. -/
def fireTime {n : Nat} (offset : Fin n → Int) (delay : Fin n → Fin (2 ^ 64) → Int)
    (x : Fin n → Fin (2 ^ 64)) (i : Fin n) : Int :=
  offset i + delay i (x i)

/-- A round is uncontested with margin `δ`: some candidate fires at least `δ`
before every other candidate. -/
def Uncontested {n : Nat} (offset : Fin n → Int) (delay : Fin n → Fin (2 ^ 64) → Int)
    (δ : Nat) (x : Fin n → Fin (2 ^ 64)) : Prop :=
  ∃ i, ∀ j, j ≠ i → fireTime offset delay x i + δ ≤ fireTime offset delay x j

instance {n : Nat} (offset : Fin n → Int) (delay : Fin n → Fin (2 ^ 64) → Int)
    (δ : Nat) : DecidablePred (Uncontested offset delay δ) := fun x => by
  unfold Uncontested; infer_instance

end OpenSearchLivenessAbstract
Source
OpenSearch cluster coordination, pinned revision b2a54ba5c0defba3d1d20423e911d4bf920bab19 (org.opensearch.cluster.coordination); liveness/timer gap-closure analysis, new theorems mechanized from the branch's OpenSearchCoordination/OpenSearchPreVote/OpenSearchSafety/OpenSearchProgress missions.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me