Theorem 6.1 (= Theorem 1.2) — has competitive ratio at most
ProvedMetricalTaskSystem.Deterministic.astar_competitiveLet be a task system with states (the triangle inequality holds, need not be symmetric), and let be its cycle offset ratio. The on-line continuous-time algorithm has competitive ratio at most : for every
there is a constant such that
for every finite sequence of nonnegative tasks and every initial state , where is the continuous-time cost of and the discrete off-line optimum.
For metrical task systems , so combined with Lemma 3.1 this gives the upper bound of Theorem 1.1.
Formalization Note The algorithm is taken with any tie-breaking rule, supplied as a state sequence for each initial state. Its cost lies in , so the bound also asserts that only finitely many transitions occur before time ; the right-hand side is truncated at , which is harmless since may be taken nonnegative. "Competitive ratio at most " is rendered as "-competitive for every ". The requirement keeps and defined.
import Mathlib import Definitions.Def_MetricalTaskSystem_Deterministic_Model import Definitions.Def_MetricalTaskSystem_Deterministic_ContinuousTime import Definitions.Def_MetricalTaskSystem_Deterministic_AstarD
namespace MetricalTaskSystem.Deterministic
/-- **Theorem 6.1 = Theorem 1.2** (Borodin–Linial–Saks 1992, pp. 755 and 747). For any task
system `(S, d)` with `n ≥ 2` states (not necessarily symmetric), the continuous-time on-line
algorithm `A*_d` (with any tie-breaking, given for each initial state `s₀` by a state sequence
`seq s₀` satisfying `IsAstarSeq`) has competitive ratio at most `(2n − 1) ψ(d)`: for every
`w > (2n − 1) ψ(d)` there is a constant `K` with `c_{A*_d}(T) ≤ w · c₀(T) + K` for every
finite nonnegative task sequence `T` and every initial state `s₀`. -/
theorem astar_competitive {S : Type} [Fintype S] [DecidableEq S] [Nontrivial S]
(d : S → S → ℝ) (hd : IsTaskSystem d)
(seq : S → ℕ → S) (hseq : ∀ s₀, IsAstarSeq d s₀ (seq s₀))
(w : ℝ) (hw : (2 * (Fintype.card S : ℝ) - 1) * cycleOffsetRatio d < w) :
∃ K : ℝ, ∀ (s₀ : S) (m : ℕ) (T : Fin m → S → ℝ), (∀ i s, 0 ≤ T i s) →
astarCost d (seq s₀) T ≤ ENNReal.ofReal (w * offlineOpt d s₀ T + K) := by sorry
end MetricalTaskSystem.Deterministic
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Let be a finite set with elements, and let be a task system; symmetry is not required:
- ;
- for ;
- .
sequences. Suppose that for each initial state a sequence is fixed that is an sequence from :
- it starts at ;
- ;
- minimizes over .
Here , , and otherwise.
Cycle offset ratio. is the real supremum of
over closed walks with positive denominator. For such this set is nonempty (take ) and bounded above by , so is its genuine supremum.
Hypothesis on . is real and .
Cost of . For , nonnegative tasks and the sequence :
- Budgets: .
- Processing cost: .
- Entry times: . The time is if some such is ; otherwise and all later entry times are undefined.
- Stage costs:
- if is undefined;
- if only is defined;
- otherwise.
- The cost is the sum of all stage costs.
Conclusion. There is a real constant , depending only on , the fixed sequences and , such that
for every , every , and every with all . Here is the discrete off-line optimum:
In particular is finite. The conclusion is not stated through the definition of -competitiveness.
Degenerate cases.
- . and , so the inequality reads . It holds for any , and so does not force .
- Negative right side. Whenever , the right side is , and the claim demands .
- Excluded cases. One-element or empty is excluded. No sequence would exist there.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.