Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 2.2 — the cruel taskmaster forces wT(ε)(A)≥(2n−1)/(1+ε/min⁡i≠jd(i,j))w_{\mathbf T(\varepsilon)}(A)\ge(2n-1)/(1+\varepsilon/\min_{i\ne j}d(i,j))wT(ε)​(A)≥(2n−1)/(1+ε/mini=j​d(i,j))

Proved
MetricalTaskSystem.Deterministic.cruel_taskmaster_lower_bound

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

competitive-analysismetrical-task-systemsonline-algorithmsp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let (S,d)(S,d)(S,d) be a metrical task system with n≥2n\ge2n≥2 states, let AAA be any on-line algorithm, s0s_0s0​ an initial state and ε>0\varepsilon>0ε>0. Let T(ε)\mathbf T(\varepsilon)T(ε) be the infinite task sequence produced by the cruel taskmaster M(ε)M(\varepsilon)M(ε) in response to AAA (each task costs ε\varepsilonε in the state AAA currently occupies and 000 elsewhere). Then

wT(ε)(A) ≥ 2n−11+ε/min⁡i≠jd(i,j).w_{\mathbf T(\varepsilon)}(A)\ \ge\ \frac{2n-1}{1+\varepsilon/\min_{i\neq j}d(i,j)} .wT(ε)​(A) ≥ 1+ε/mini=j​d(i,j)2n−1​.

Together with Lemma 2.1, letting ε→0\varepsilon\to0ε→0 gives w(A)≥2n−1w(A)\ge 2n-1w(A)≥2n−1 for every on-line algorithm, i.e. the lower bound in Theorem 1.1.

Formalization Note The hypothesis n≥2n\ge2n≥2 (Nontrivial S) is needed for min⁡i≠jd(i,j)\min_{i\neq j}d(i,j)mini=j​d(i,j) to be defined; at n=1n=1n=1 the paper's minimum ranges over the empty set.

Preamble
import Mathlib
import Definitions.Def_MetricalTaskSystem_Deterministic_Model
import Definitions.Def_MetricalTaskSystem_Deterministic_CruelTaskmaster
Formal statement
namespace MetricalTaskSystem.Deterministic

/-- **Theorem 2.2** (Borodin–Linial–Saks 1992, p. 749). Let `A` be any on-line algorithm for a
metrical task system `(S, d)` with `n ≥ 2` states, and let `T(ε)` be the infinite task sequence
produced by the cruel taskmaster `M(ε)` in response to `A`. Then
`w_{T(ε)}(A) ≥ (2n − 1) / (1 + ε / min_{i ≠ j} d(i, j))`. -/
theorem cruel_taskmaster_lower_bound {S : Type} [Fintype S] [DecidableEq S] [Nontrivial S]
    (d : S → S → ℝ) (hd : IsMetrical d) (A : OnlineAlgorithm S) (s₀ : S)
    (ε : ℝ) (hε : 0 < ε) :
    ((((2 * (Fintype.card S : ℝ) - 1) / (1 + ε / minOffDiag d)) : ℝ) : EReal) ≤
      ratioLimsup d A s₀ (cruelSeq A s₀ ε) := by sorry

end MetricalTaskSystem.Deterministic
Source
Borodin, Linial, Saks, An Optimal On-Line Algorithm for Metrical Task System, J. ACM 39(4) (1992), p. 749, Theorem 2.2 (strategy M(ε), p. 748)
Read-back

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

Setting. Let SSS be a finite set with n≥2n \ge 2n≥2 elements. Let ddd be metrical:

  • d(i,i)=0d(i,i) = 0d(i,i)=0;
  • d(i,j)>0d(i,j) > 0d(i,j)>0 for i≠ji \ne ji=j;
  • d(i,k)≤d(i,j)+d(j,k)d(i,k) \le d(i,j) + d(j,k)d(i,k)≤d(i,j)+d(j,k);
  • d(i,j)=d(j,i)d(i,j) = d(j,i)d(i,j)=d(j,i).

Let AAA be an arbitrary on-line algorithm (any function mapping (s0,finite list of tasks)(s_0, \text{finite list of tasks})(s0​,finite list of tasks) to a state). Fix s0∈Ss_0 \in Ss0​∈S and a real ε>0\varepsilon > 0ε>0.

Cruel sequence. Define states recursively:

  • σ(0)=s0\sigma(0) = s_0σ(0)=s0​;
  • σ(j+1)=A(s0,[eσ(0),…,eσ(j)])\sigma(j+1) = A\big(s_0, [e_{\sigma(0)}, \dots, e_{\sigma(j)}]\big)σ(j+1)=A(s0​,[eσ(0)​,…,eσ(j)​]).

Here eu(s)=εe_u(s) = \varepsiloneu​(s)=ε if s=us = us=u and eu(s)=0e_u(s) = 0eu​(s)=0 otherwise. The cruel sequence is Ti=eσ(i)T_i = e_{\sigma(i)}Ti​=eσ(i)​: each task costs ε\varepsilonε exactly at the algorithm's current state.

Costs. For prefixes T<mT_{<m}T<m​ of this sequence:

  • c(T;σ′)=∑i<m(d(σ′(i),σ′(i+1))+Ti(σ′(i+1)))c(T;\sigma') = \sum_{i<m} \big( d(\sigma'(i),\sigma'(i+1)) + T_i(\sigma'(i+1)) \big)c(T;σ′)=∑i<m​(d(σ′(i),σ′(i+1))+Ti​(σ′(i+1)));
  • c0c_0c0​ is the minimum of ccc over all σ′\sigma'σ′ with σ′(0)=s0\sigma'(0) = s_0σ′(0)=s0​;
  • cAc_AcA​ is ccc evaluated on AAA's schedule σA(0)=s0\sigma_A(0) = s_0σA​(0)=s0​, σA(i)=A(s0,[T0,…,Ti−1])\sigma_A(i) = A(s_0, [T_0, \dots, T_{i-1}])σA​(i)=A(s0​,[T0​,…,Ti−1​]).

Conclusion. Let δ=min⁡i≠jd(i,j)\delta = \min_{i \ne j} d(i,j)δ=mini=j​d(i,j). The theorem asserts, in the extended reals,

2n−11+ε/δ≤lim sup⁡m→∞cA(T<m)c0(T<m).\frac{2n - 1}{1 + \varepsilon/\delta} \le \limsup_{m \to \infty} \frac{c_A(T_{<m})}{c_0(T_{<m})}.1+ε/δ2n−1​≤m→∞limsup​c0​(T<m​)cA​(T<m​)​.

The quotients are real quotients with x/0=0x/0 = 0x/0=0, and the right side may be +∞+\infty+∞. The theorem does not assume that c0(T<m)→∞c_0(T_{<m}) \to \inftyc0​(T<m​)→∞.

Degenerate cases.

  • Left side. Since δ>0\delta > 0δ>0 and ε>0\varepsilon > 0ε>0, the denominator exceeds 111, so the left side is an ordinary positive real. For n=2n = 2n=2 it equals 3/(1+ε/δ)3/(1+\varepsilon/\delta)3/(1+ε/δ).
  • Zero denominators. The prefix m=0m = 0m=0 gives 0/00/00/0, read as 000; one term does not affect the limsup. For m≥1m \ge 1m≥1, the first task already forces c0>0c_0 > 0c0​>0: staying at s0s_0s0​ costs ε\varepsilonε, and moving costs at least δ\deltaδ.
  • Excluded cases. One-element or empty SSS is excluded by the hypotheses.
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