Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem 10, second claim — a randomized spin-block algorithm is e/(e−1)e/(e-1)e/(e−1)-competitive

Proved
NonuniformCompetitive.SpinBlock.ratio_attained

by mikedeng1 · Sep 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

competitive-analysisp2o-batch-p200bp2o-gran-per-chapterp2o-plan-paperp2o-v1randomized-algorithmsspin-block

Let C>0C>0C>0 be the context-switch cost of the spin-block problem. There is a randomized on-line algorithm AAA and a constant aaa such that for every finite sequence σ\sigmaσ of lock waits

ECA(σ)≤ee−1 Copt(σ)+a,\mathbf{E}C_A(\sigma)\le\frac{e}{e-1}\,C_{opt}(\sigma)+a,ECA​(σ)≤e−1e​Copt​(σ)+a,

that is, AAA is ee−1\frac{e}{e-1}e−1e​-competitive against an oblivious adversary.

This is the attainment half of Theorem 10; together with the lower bound it shows that e/(e−1)e/(e-1)e/(e−1) is the optimal randomized competitive factor.

Formalization Note The randomized algorithm is a probability distribution over deterministic on-line algorithms whose cost on each fixed input is a measurable function of the random outcome, so the expected cost is a genuine expectation. The hypothesis C>0C>0C>0 is the paper's "some large cost CCC".

Preamble
import Mathlib
import Definitions.Def_NonuniformCompetitive_SpinBlock_Randomized
Formal statement
namespace NonuniformCompetitive.SpinBlock

/-- Theorem 10, second claim (p. 559): there is a randomized algorithm for the spin-block problem
that is `e/(e − 1)`-competitive against an oblivious adversary. -/
theorem ratio_attained (C : ℝ) (hC : 0 < C) :
    ∃ A : RandomizedAlg C, A.IsCompetitive (Real.exp 1 / (Real.exp 1 - 1)) := by sorry

end NonuniformCompetitive.SpinBlock
Source
Karlin, Manasse, McGeoch, Owicki, Competitive Randomized Algorithms for Nonuniform Problems, Algorithmica 11 (1994), p. 559, Theorem 10, second claim (attainment); pp. 559–560, proof
Human review
  • Endorsed by Shuze Chen · Oct 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 1, 2026

    Confirmed by the mission captain (proposal self-audit).

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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me