Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Requesting vertex iii costs a randomized algorithm at least pip_ipi​ in expectation

Proved
CompetitivePaging.LowerBound.expCost_append_ge_uncoveredProb

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

competitive-analysisonline-algorithmsp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1pagingrandomized-algorithms

Let MMM be a uniform metric space: any two distinct points are at distance 111. Let AAA be a randomized on-line kkk-server algorithm on MMM (a probability space of coin outcomes and a deterministic on-line algorithm for each outcome), let σ\sigmaσ be a request sequence, and let i∈Mi\in Mi∈M be a vertex such that the event "iii is not covered after σ\sigmaσ" is measurable. Write CA(σ)C_A(\sigma)CA​(σ) for the expected cost of AAA on σ\sigmaσ and pip_ipi​ for the probability that iii is not covered after σ\sigmaσ. Then

CA(σ i)  ≥  CA(σ)+pi,C_A(\sigma\, i) \;\ge\; C_A(\sigma) + p_i ,CA​(σi)≥CA​(σ)+pi​,

where σ i\sigma\, iσi is σ\sigmaσ followed by one request to iii.

This is the link between the adversary's probability vector and the cost of the on-line algorithm: every request to a vertex iii adds at least pip_ipi​ to AAA's expected cost.

Formalization Note The paper states that the expected cost of the request "is pip_ipi​"; that is exact for an algorithm that moves one server only when the requested vertex is uncovered. For an arbitrary algorithm, extra movements only add cost, so the statement is the inequality. Expected costs are values in [0,∞][0,\infty][0,∞] (lower Lebesgue integrals), as in the published KServer_randomized definitions.

Preamble
import Mathlib
import Definitions.Def_KServer_model
import Definitions.Def_KServer_randomized
import Definitions.Def_CompetitivePaging_LowerBound_uncoveredProb
Formal statement
namespace CompetitivePaging.LowerBound

theorem expCost_append_ge_uncoveredProb {k : ℕ} (M : Type) [MetricSpace M]
    (hd : ∀ x y : M, x ≠ y → dist x y = 1) (A : KServer.RandomizedAlgorithm k M)
    (σ : List M) (i : M)
    (hmeas : @MeasurableSet A.ι A.ms {ω | i ∉ Set.range ((A.alg ω).conf σ)}) :
    A.expCost σ + ENNReal.ofReal (uncoveredProb A σ i) ≤ A.expCost (σ ++ [i]) := by sorry

end CompetitivePaging.LowerBound
Source
Fiat, Karp, Luby, McGeoch, Sleator, Young, Competitive Paging Algorithms, arXiv:cs/0205038v1, p. 7, §5, proof of Theorem 4 ("If the nemesis sequence requests a vertex i, then the expected cost incurred by A is p_i.")
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

The setting is:

  • kkk is any natural number.
  • MMM is a metric space in which any two distinct points are at distance exactly 111. MMM may be empty, have one point, or be infinite.
  • AAA is a randomized online algorithm with kkk servers on MMM.
  • σ\sigmaσ is a finite request list.
  • iii is a point of MMM.

One hypothesis is assumed: the set {ω:i∉range⁡(confAω(σ))}\{\omega : i \notin \operatorname{range}(\mathrm{conf}_{A_\omega}(\sigma))\}{ω:i∈/range(confAω​​(σ))} is measurable.

The conclusion is an inequality in the extended nonnegative reals [0,∞][0,\infty][0,∞]:

ECostA(σ)  +  pi(A,σ)  ≤  ECostA(σ+ ⁣ ⁣+[i]).\mathbb{E}\mathrm{Cost}_A(\sigma) \;+\; p_i(A,\sigma) \;\le\; \mathbb{E}\mathrm{Cost}_A(\sigma \mathbin{+\!\!+} [i]).ECostA​(σ)+pi​(A,σ)≤ECostA​(σ++[i]).

The pieces are:

  • ECostA\mathbb{E}\mathrm{Cost}_AECostA​ is the expected cost of AAA on a request sequence. It is defined in an imported file that is not shown, and takes values in [0,∞][0,\infty][0,∞].
  • σ+ ⁣ ⁣+[i]\sigma \mathbin{+\!\!+} [i]σ++[i] is σ\sigmaσ followed by one more request, at iii.
  • pi(A,σ)p_i(A,\sigma)pi​(A,σ) is the real number obtained from μA({ω:no server of Aω at i after σ})\mu_A(\{\omega : \text{no server of } A_\omega \text{ at } i \text{ after } \sigma\})μA​({ω:no server of Aω​ at i after σ}). It is carried back into [0,∞][0,\infty][0,∞], with negative values sent to 000; since the value is never negative, it is carried back unchanged.

Degenerate cases:

  • Infinite expected cost: if ECostA(σ)=∞\mathbb{E}\mathrm{Cost}_A(\sigma) = \inftyECostA​(σ)=∞, the claim requires ECostA(σ+ ⁣ ⁣+[i])=∞\mathbb{E}\mathrm{Cost}_A(\sigma \mathbin{+\!\!+} [i]) = \inftyECostA​(σ++[i])=∞.
  • k=0k = 0k=0: iii is never covered, so the added term is μA(ιA)\mu_A(\iota_A)μA​(ιA​), converted to a real number (and 000 if that measure is infinite).
  • One-point MMM: the distance hypothesis holds vacuously.
  • Empty σ\sigmaσ: the claim compares the cost of the empty sequence with the cost of the one-request sequence [i][i][i].
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 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