Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

In a complete EATR phase any lazy algorithm pays at least l−d+d′l-d+d'l−d+d′

Proved
CompetitivePaging.EATR.adversary_phase_bound

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

competitive-analysisk-serverp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1paging

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 and let the requests with indices i,…,i′−1i,\dots,i'-1i,…,i′−1 form a complete EATR phase in which lll clean vertices are requested. Let AAA be a lazy deterministic on-line algorithm with two servers. Let ddd be the number of servers of AAA that do not coincide with any of EATR's servers at the beginning of the phase, and d′d'd′ this number at the end of the phase. Then the cost CAC_ACA​ incurred by AAA on the requests of the phase satisfies

CA ≥ l−d+d′.C_A\ \ge\ l-d+d'.CA​ ≥ l−d+d′.

EATR phases have the structure singled out in the paper after the proof of Theorem 2: after the last request to a clean vertex, the other vertex used during the phase is requested. This is the lower bound on the adversary's cost that, summed over phases, makes the ddd and d′d'd′ terms telescope, so that the amortized cost of any algorithm per phase is at least lll.

Formalization Note EATR's servers at the beginning and at the end of a phase are deterministic (the set PPP of the definition file), so ddd and d′d'd′ are deterministic too. AAA is a KServer.OnlineAlgorithm 2 M; laziness is the property IsLazy of the definition file.

Preamble
import Mathlib
import Definitions.Def_KServer_model
import Definitions.Def_CompetitivePaging_EATR_eatr

open scoped ENNReal
Formal statement
namespace CompetitivePaging.EATR

theorem adversary_phase_bound {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') :
    (numClean a b σ i i' : ℝ) - (mismatch a b A σ i : ℝ) + (mismatch a b A σ i' : ℝ)
      ≤ algPhaseCost A σ i i' := by sorry

end CompetitivePaging.EATR
Source
Fiat, Karp, Luby, McGeoch, Sleator, Young, Competitive Paging Algorithms, arXiv:cs/0205038v1, p. 5, §3, paragraph after the proof of Theorem 2 (with d, d′ from p. 4), applied to EATR's phases as on p. 6, 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 whenever x≠yx \neq yx=y. This is the uniform metric; distance 000 holds only for equal points.
  • a,b∈Ma, b \in Ma,b∈M with a≠ba \neq ba=b.
  • AAA is any 2-server online algorithm on MMM that is lazy. Lazy means two things. A request to a point where some server of AAA already sits leaves the configuration unchanged. After any request rrr, the new configuration equals the old one with at most one coordinate replaced by rrr.
  • σ\sigmaσ is a request list, and i,i′i, i'i,i′ are natural numbers such that σi,…,σi′−1\sigma_i, \dots, \sigma_{i'-1}σi​,…,σi′−1​ form a complete phase of the bookkeeping started from prev={a,b}\mathrm{prev} = \{a,b\}prev={a,b} (as defined in the bundle above). Concretely:
    • i<i′i < i'i<i′;
    • request iii starts a phase: no phase is in progress and σi∉prev\sigma_i \notin \mathrm{prev}σi​∈/prev;
    • request i′−1i'-1i′−1 ends one: a phase is in progress and σi′−1\sigma_{i'-1}σi′−1​ is stale;
    • no request strictly before i′−1i'-1i′−1 in that range ends a phase.

Notation.

  • ℓ\ellℓ is the number of indices t∈[i,i′)t \in [i, i')t∈[i,i′) for which σt\sigma_tσt​ is clean, meaning σt∉prev∪req\sigma_t \notin \mathrm{prev} \cup \mathrm{req}σt​∈/prev∪req of the bookkeeping just before request ttt.
  • ddd is the number of AAA's two servers (counted by index) that are not in prev(Bi)\mathrm{prev}(B_i)prev(Bi​) in AAA's configuration after σ<i\sigma_{<i}σ<i​.
  • d′d'd′ is the same count at i′i'i′: AAA's configuration after σ<i′\sigma_{<i'}σ<i′​, compared with prev(Bi′)\mathrm{prev}(B_{i'})prev(Bi′​).

Claim. The statement asserts

ℓ−d+d′  ≤  ∑j=ii′−1moveCost(A.conf(σ<j), A.conf(σ<j+1)),\ell - d + d' \;\le\; \sum_{j=i}^{i'-1} \mathrm{moveCost}\bigl(A.\mathrm{conf}(\sigma_{<j}),\, A.\mathrm{conf}(\sigma_{<j+1})\bigr),ℓ−d+d′≤j=i∑i′−1​moveCost(A.conf(σ<j​),A.conf(σ<j+1​)),

with the left side computed in the real numbers. moveCost\mathrm{moveCost}moveCost comes from an imported definition that is not shown here.

Degenerate cases.

  • If MMM has exactly two points, prev={a,b}=M\mathrm{prev} = \{a,b\} = Mprev={a,b}=M from the start. No request can then start a phase, so the complete-phase hypothesis cannot be met and the statement is vacuous. The same applies to any MMM with at most two points.
  • With three or more points the hypothesis can be met. For example, request a third point ccc, then aaa: this gives i=0i = 0i=0, i′=2i' = 2i′=2.
  • A complete phase forces i′≥i+2i' \ge i+2i′≥i+2 and i′≤ni' \le ni′≤n, so every index involved is within range.
  • Nothing ties AAA's initial configuration to {a,b}\{a, b\}{a,b}. Any such difference enters only through ddd and d′d'd′.
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