Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 6.2 — hk(s)≥fk(s)h_k(s)\ge f_k(s)hk​(s)≥fk​(s): the off-line cost at the transition times dominates fkf_kfk​

Proved
MetricalTaskSystem.Deterministic.astar_f_le_offline

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 T1⋯TmT^1\cdots T^mT1⋯Tm a sequence of nonnegative tasks. Let tkt_ktk​ be the time at which the algorithm Ad∗A^*_dAd∗​ enters its kkk-th state sks_ksk​ (t0=1t_0=1t0​=1), and let

hk(s)=φtk(s)h_k(s)=\varphi_{t_k}(s)hk​(s)=φtk​​(s)

be the minimum cost of an off-line continuous-time schedule up to time tkt_ktk​ subject to being in state sss at time tkt_ktk​. Then

hk(s)≥fk(s)for all s∈S,h_k(s)\ge f_k(s)\qquad\text{for all }s\in S,hk​(s)≥fk​(s)for all s∈S,

for every kkk such that the transition time tkt_ktk​ occurs.

The functions fkf_kfk​ are thus lower bounds on the off-line cost, which is the first step in comparing Ad∗A^*_dAd∗​ with the optimum.

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

/-- **Lemma 6.2** (Borodin–Linial–Saks 1992, p. 756). Let `t_k` be the time at which `A*_d`
enters `s_k` on the (nonnegative) task sequence `T¹ ⋯ Tᵐ` (`t₀ = 1`), and let
`h_k(x) = φ_{t_k}(x)` be the optimal off-line (continuous-time) cost up to time `t_k` subject
to being in state `x` at time `t_k`. Then `h_k(x) ≥ f_k(x)` for all states `x`. -/
theorem astar_f_le_offline {S : Type} [Fintype S] [DecidableEq S] [Nontrivial S]
    (d : S → S → ℝ) (hd : IsTaskSystem d) (s₀ : S) (s : ℕ → S) (hs : IsAstarSeq d s₀ s)
    (m : ℕ) (T : Fin m → S → ℝ) (hT : ∀ i x, 0 ≤ T i x)
    (k : ℕ) (tk : ℝ) (htk : entryTime s (cSeq d s) T k = some tk) (x : S) :
    fSeq d s k x ≤ offlineCostTo d s₀ T tk 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.2 (h_k defined on p. 755, φ_t on p. 754)
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,s1,…s_0, s_1, \dotss0​,s1​,… satisfy the Ad∗A^*_dAd∗​ conditions from s0s_0s0​:

  • s(0)=s0s(0) = s_0s(0)=s0​;
  • sk+1≠sks_{k+1} \ne s_ksk+1​=sk​;
  • sk+1s_{k+1}sk+1​ minimizes fk(x)+d(x,sk)f_k(x) + d(x,s_k)fk​(x)+d(x,sk​) over x≠skx \ne s_kx=sk​.

Here f0≡0f_0 \equiv 0f0​≡0, fk+1(sk)=fk(sk+1)+d(sk+1,sk)f_{k+1}(s_k) = f_k(s_{k+1}) + d(s_{k+1}, s_k)fk+1​(sk​)=fk​(sk+1​)+d(sk+1​,sk​), and fk+1(x)=fk(x)f_{k+1}(x) = f_k(x)fk+1​(x)=fk​(x) for x≠skx \ne s_kx=sk​. The budgets are cj=fj+1(sj)−fj(sj)c_j = f_{j+1}(s_j) - f_j(s_j)cj​=fj+1​(sj​)−fj​(sj​).

Tasks and processing cost. Let T0,…,Tm−1T_0, \dots, T_{m-1}T0​,…,Tm−1​ satisfy Ti(x)≥0T_i(x) \ge 0Ti​(x)≥0, where TiT_iTi​ occupies time [i+1,i+2][i+1, i+2][i+1,i+2]. Define

Px(a,b)=∑iTi(x)max⁡(0,min⁡(b,i+2)−max⁡(a,i+1)).P_x(a,b) = \sum_i T_i(x)\max\big(0, \min(b,i+2) - \max(a,i+1)\big).Px​(a,b)=i∑​Ti​(x)max(0,min(b,i+2)−max(a,i+1)).

Entry times. Define t0=1t_0 = 1t0​=1. If tjt_jtj​ is defined and some u∈[tj,m+1)u \in [t_j, m+1)u∈[tj​,m+1) has Psj(tj,u)≥cjP_{s_j}(t_j,u) \ge c_jPsj​​(tj​,u)≥cj​, then

tj+1=inf⁡{u≥tj:Psj(tj,u)≥cj}.t_{j+1} = \inf\{u \ge t_j : P_{s_j}(t_j,u) \ge c_j\}.tj+1​=inf{u≥tj​:Psj​​(tj​,u)≥cj​}.

Otherwise tj+1t_{j+1}tj+1​ and all later entry times are undefined.

Hypothesis on kkk. k≥0k \ge 0k≥0, tkt_ktk​ is defined, and its value is the real number tkt_ktk​.

Off-line cost function. φtk(x)\varphi_{t_k}(x)φtk​​(x) is the infimum over lists of pieces (x1,ℓ1),…,(xr,ℓr)(x_1,\ell_1), \dots, (x_r,\ell_r)(x1​,ℓ1​),…,(xr​,ℓr​) such that:

  • every ℓj≥0\ell_j \ge 0ℓj​≥0;
  • ∑jℓj=tk−1\sum_j \ell_j = t_k - 1∑j​ℓj​=tk​−1;
  • the last state is xxx, or r=0r = 0r=0 and x=s0x = s_0x=s0​.

The quantity minimized is

∑d(consecutive states of s0,x1,…,xr)+∑jPxj(aj−1,aj),\sum d(\text{consecutive states of } s_0, x_1, \dots, x_r) + \sum_j P_{x_j}(a_{j-1}, a_j),∑d(consecutive states of s0​,x1​,…,xr​)+j∑​Pxj​​(aj−1​,aj​),

with a0=1a_0 = 1a0​=1 and aj=aj−1+ℓja_j = a_{j-1} + \ell_jaj​=aj−1​+ℓj​.

Conclusion. For every state xxx,

fk(x)≤φtk(x).f_k(x) \le \varphi_{t_k}(x).fk​(x)≤φtk​​(x).

Degenerate cases.

  • The infimum is genuine. By construction tk≥1t_k \ge 1tk​≥1. With d≥0d \ge 0d≥0 and T≥0T \ge 0T≥0, the index set is nonempty (a single piece (x,tk−1)(x, t_k - 1)(x,tk​−1)) and the costs are bounded below by 000. So the real-infimum convention (value 000 for an empty or unbounded set) is not triggered.
  • k=0k = 0k=0. The claim is 0≤φ1(x)0 \le \varphi_1(x)0≤φ1​(x).
  • Undefined tkt_ktk​. For kkk with tkt_ktk​ undefined, nothing is asserted.
  • m=0m = 0m=0. Only k=0k = 0k=0 qualifies.
  • Budget cj≤0c_j \le 0cj​≤0. This would give tj+1=tjt_{j+1} = t_jtj+1​=tj​ when tj<m+1t_j < m+1tj​<m+1.
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