Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 6.3 — fk(s)−fk(s′)≤d(s′,s)f_k(s)-f_k(s')\le d(s',s)fk​(s)−fk​(s′)≤d(s′,s)

Proved
MetricalTaskSystem.Deterministic.astar_f_sub_le

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 task system with at least two states, s0∈Ss_0\in Ss0​∈S, and let s0,s1,s2,…s_0,s_1,s_2,\dotss0​,s1​,s2​,… be the state sequence and f0,f1,…f_0,f_1,\dotsf0​,f1​,… the functions of the algorithm Ad∗A^*_dAd∗​. Then for every k≥0k\ge0k≥0,

fk(s)−fk(s′)≤d(s′,s)for all s,s′∈S.f_k(s)-f_k(s')\le d(s',s)\qquad\text{for all }s,s'\in S .fk​(s)−fk​(s′)≤d(s′,s)for all s,s′∈S.

It is one of the three lemmas from which the competitive bound of Ad∗A^*_dAd∗​ (Theorem 6.1) is deduced.

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

/-- **Lemma 6.3** (Borodin–Linial–Saks 1992, p. 756). For the functions `f_k` of the algorithm
`A*_d`: `f_k(x) − f_k(y) ≤ d(y, x)` for all states `x, y` and all `k ≥ 0`. -/
theorem astar_f_sub_le {S : Type} [Fintype S] [DecidableEq S] [Nontrivial S]
    (d : S → S → ℝ) (hd : IsTaskSystem d) (s₀ : S) (s : ℕ → S) (hs : IsAstarSeq d s₀ s)
    (k : ℕ) (x y : S) :
    fSeq d s k x - fSeq d s k y ≤ d y x := by sorry

end MetricalTaskSystem.Deterministic
Source
Borodin, Linial, Saks, An Optimal On-Line Algorithm for Metrical Task System, J. ACM 39(4) (1992), p. 756, Lemma 6.3
Read-back

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

Setting. Let SSS be a finite set with at least two elements, and let ddd be a task system:

  • 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).

Let s0∈Ss_0 \in Ss0​∈S and let s0,s1,s2,…s_0, s_1, s_2, \dotss0​,s1​,s2​,… be a sequence of states.

The functions fkf_kfk​. Define f0≡0f_0 \equiv 0f0​≡0 and, for every k≥0k \ge 0k≥0,

fk+1(x)={fk(sk+1)+d(sk+1,sk)x=sk,fk(x)x≠sk.f_{k+1}(x) = \begin{cases} f_k(s_{k+1}) + d(s_{k+1}, s_k) & x = s_k, \\ f_k(x) & x \ne s_k. \end{cases}fk+1​(x)={fk​(sk+1​)+d(sk+1​,sk​)fk​(x)​x=sk​,x=sk​.​

Hypothesis. The sequence starts at s0s_0s0​, and for every k≥0k \ge 0k≥0:

  • sk+1≠sks_{k+1} \ne s_ksk+1​=sk​;
  • fk(sk+1)+d(sk+1,sk)≤fk(x)+d(x,sk)f_k(s_{k+1}) + d(s_{k+1}, s_k) \le f_k(x) + d(x, s_k)fk​(sk+1​)+d(sk+1​,sk​)≤fk​(x)+d(x,sk​) for all x≠skx \ne s_kx=sk​.

Such sequences exist, since a minimizer over the finitely many x≠skx \ne s_kx=sk​ always exists.

Conclusion. For every k≥0k \ge 0k≥0 and all states x,yx, yx,y,

fk(x)−fk(y)≤d(y,x).f_k(x) - f_k(y) \le d(y,x).fk​(x)−fk​(y)≤d(y,x).

Degenerate cases.

  • k=0k = 0k=0. The claim is 0≤d(y,x)0 \le d(y,x)0≤d(y,x).
  • x=yx = yx=y. The claim is 0≤00 \le 00≤0.
  • Excluded cases. One-element or empty SSS is excluded.
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