Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4 — randomized block snoopy caching is optimally ep/(ep−1)e_p/(e_p-1)ep​/(ep​−1)-competitive

Proved
NonuniformCompetitive.Snoopy.optimal_ratio

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

competitive-analysisonline-algorithmsp2o-batch-p200bp2o-gran-per-chapterp2o-plan-paperp2o-v1randomized-algorithmssnoopy-caching

Consider a block snoopy-caching multiprocessor system with block size p−1p-1p−1, reduced to a single block BBB: n≥2n \ge 2n≥2 processors, block-transfer cost p≥1p \ge 1p≥1, and any initial state s0s_0s0​ (BBB shared, or private to one cache). Let

ep=(1+1p)p.e_p = \left(1 + \frac1p\right)^p .ep​=(1+p1​)p.

Then:

  1. no randomized on-line algorithm is ccc-competitive against an oblivious adversary from s0s_0s0​ for any c<ep/(ep−1)c < e_p/(e_p-1)c<ep​/(ep​−1);
  2. some randomized on-line algorithm is ep/(ep−1)e_p/(e_p-1)ep​/(ep​−1)-competitive against an oblivious adversary from s0s_0s0​.

Here ccc-competitive means that for some constant aaa and every admissible request sequence σ\sigmaσ, ECA(σ)≤c⋅Copt(s0,σ)+a\mathbf{E}C_A(\sigma) \le c\cdot C_{opt}(s_0,\sigma) + aECA​(σ)≤c⋅Copt​(s0​,σ)+a. The optimal deterministic ratio for the same problem is 222 (Karlin, Manasse, Rudolph, Sleator 1988), so randomization gives a strictly better ratio for every p≥2p \ge 2p≥2, tending to e/(e−1)≈1.582e/(e-1) \approx 1.582e/(e−1)≈1.582 as p→∞p \to \inftyp→∞.

Formalization Note Three conventions are added relative to the printed statement, all from the paper's own setting. (i) n≥2n \ge 2n≥2: the lower bound needs a second processor. (ii) One block: the proof of Theorem 4 reduces a multi-block system to independent single-block problems (p. 551). (iii) Admissible sequences: every write of processor iii directly follows a read or write of iii, the form of "every write is preceded by a read to the same block" (p. 550) that the proof uses. Both claims are stated for every initial state; the additive constant may depend on nnn, ppp and s0s_0s0​.

Preamble
import Mathlib
import Definitions.Def_NonuniformCompetitive_Snoopy_ep
import Definitions.Def_NonuniformCompetitive_Snoopy_model
import Definitions.Def_NonuniformCompetitive_Snoopy_randomized
Formal statement
namespace NonuniformCompetitive.Snoopy

/-- Theorem 4 (Karlin, Manasse, McGeoch, Owicki, Algorithmica 11 (1994), p. 551), for the
single-block snoopy-caching task system of §3.1 (p. 550) with `n ≥ 2` processors and block size
`p − 1` (block-transfer cost `p ≥ 1`), from every initial state `s₀`:
1. no randomized on-line algorithm is `c`-competitive against an oblivious adversary for any
   `c < e_p / (e_p − 1)`;
2. some randomized on-line algorithm is `e_p / (e_p − 1)`-competitive.
Competitiveness is over admissible request sequences (every write of processor `i` directly
follows a read or write of `i`). -/
theorem optimal_ratio (n p : ℕ) (hn : 2 ≤ n) (hp : 1 ≤ p) (s₀ : State n) :
    (∀ (A : RandomizedAlgorithm n p) (c : ℝ), A.IsCompetitiveFrom s₀ c → ep p / (ep p - 1) ≤ c) ∧
      ∃ A : RandomizedAlgorithm n p, A.IsCompetitiveFrom s₀ (ep p / (ep p - 1)) := by sorry

end NonuniformCompetitive.Snoopy
Source
Karlin, Manasse, McGeoch, Owicki, Competitive Randomized Algorithms for Nonuniform Problems, Algorithmica 11 (1994), p. 551, Theorem 4 (single-block task system of §3.1, p. 550)
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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me