Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Per phase, EATR's expected cost is at most 3/23/23/2 times any lazy algorithm's amortized cost

Proved
CompetitivePaging.EATR.phase_ratio

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

competitive-analysisp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1pagingrandomized-algorithms

Consider the uniform 222-server problem on a metric space MMM in which any two distinct points are at distance 111, and algorithm EATR started with its servers on two distinct vertices a,ba,ba,b. Let σ\sigmaσ be a request sequence, let the requests with indices i,…,i′−1i,\dots,i'-1i,…,i′−1 form a complete EATR phase, and let AAA be a lazy deterministic on-line algorithm with two servers. With CAC_ACA​ the cost of AAA on the requests of the phase and d,d′d,d'd,d′ the numbers of servers of AAA not coinciding with EATR's servers at the beginning and at the end of the phase,

CEATR(phase) ≤ 32 (CA+d−d′).C_{\mathrm{EATR}}(\text{phase})\ \le\ \frac32\,\bigl(C_A+d-d'\bigr).CEATR​(phase) ≤ 23​(CA​+d−d′).

The quantity CA+d−d′C_A+d-d'CA​+d−d′ is the amortized cost of AAA for the phase, at least lll; EATR's expected cost is l+l/(l+1)l+l/(l+1)l+l/(l+1), and (l+l/(l+1))/l=1+1/(l+1)≤3/2(l+l/(l+1))/l=1+1/(l+1)\le 3/2(l+l/(l+1))/l=1+1/(l+1)≤3/2. Summed over the phases, the ddd and d′d'd′ terms telescope, which yields Theorem 3.

Preamble
import Mathlib
import Definitions.Def_KServer_model
import Definitions.Def_CompetitivePaging_EATR_eatr

open scoped ENNReal
Formal statement
namespace CompetitivePaging.EATR

theorem phase_ratio {M : Type*} [MetricSpace M] [DecidableEq M]
    (hunif : ∀ x y : M, x ≠ y → dist x y = 1) (a b : M) (hab : a ≠ b)
    (A : KServer.OnlineAlgorithm 2 M) (hA : IsLazy A) (σ : List M) (i i' : ℕ)
    (hph : IsCompletePhase a b σ i i') :
    eatrPhaseCost a b σ i i'
      ≤ (3 / 2 : ℝ) * (algPhaseCost A σ i i' + (mismatch a b A σ i : ℝ)
          - (mismatch a b A σ i' : ℝ)) := by sorry

end CompetitivePaging.EATR
Source
Fiat, Karp, Luby, McGeoch, Sleator, Young, Competitive Paging Algorithms, arXiv:cs/0205038v1, p. 6, §4, proof of Theorem 3
Read-back

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

Setting.

  • MMM is a metric space with decidable equality, and dist(x,y)=1\mathrm{dist}(x,y) = 1dist(x,y)=1 for all x≠yx \neq yx=y.
  • a,b∈Ma, b \in Ma,b∈M with a≠ba \neq ba=b.
  • AAA is any lazy 2-server online algorithm on MMM. A request to a point where one of AAA's servers sits changes nothing. Otherwise the configuration changes in at most one coordinate, which becomes the requested point.
  • σ,i,i′\sigma, i, i'σ,i,i′ are such that σi,…,σi′−1\sigma_i, \dots, \sigma_{i'-1}σi​,…,σi′−1​ form a complete phase of EATR's bookkeeping started from {a,b}\{a,b\}{a,b} (as defined in the bundle above).

Notation.

  • CEATR=∑t=ii′−1ctC_{\mathrm{EATR}} = \sum_{t=i}^{i'-1} c_tCEATR​=∑t=ii′−1​ct​ is EATR's expected cost on these requests. It counts expected newly covered vertices per request.
  • CA=∑j=ii′−1moveCost(A.conf(σ<j),A.conf(σ<j+1))C_A = \sum_{j=i}^{i'-1} \mathrm{moveCost}(A.\mathrm{conf}(\sigma_{<j}), A.\mathrm{conf}(\sigma_{<j+1}))CA​=∑j=ii′−1​moveCost(A.conf(σ<j​),A.conf(σ<j+1​)) is AAA's cost. moveCost\mathrm{moveCost}moveCost comes from an imported definition that is not shown here.
  • ddd is the number of AAA's servers (counted by index) outside prev(Bi)\mathrm{prev}(B_i)prev(Bi​) after σ<i\sigma_{<i}σ<i​.
  • d′d'd′ is the same count at i′i'i′.

Claim. The statement asserts, in the real numbers,

CEATR  ≤  32(CA+d−d′).C_{\mathrm{EATR}} \;\le\; \frac{3}{2}\bigl(C_A + d - d'\bigr).CEATR​≤23​(CA​+d−d′).

Degenerate cases.

  • If MMM has at most two points, no phase can start, and the statement is vacuous.
  • A complete phase forces i+2≤i′≤ni+2 \le i' \le ni+2≤i′≤n, so no out-of-range default values enter either sum.
  • Nothing constrains AAA's initial configuration to be {a,b}\{a,b\}{a,b}. The quantity CA+d−d′C_A + d - d'CA​+d−d′ is not required to be nonnegative by any hypothesis beyond what the conclusion itself implies.
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