shuttle algorithms on vertices whose total cost never exceeds the number of requests
ProvedCompetitivePaging.Combining.exists_shuttle_algorithmsLet , let be a set of vertices with the uniform metric, and number its vertices so that vertex and vertex form the -th pair, . Consider servers. There are deterministic on-line algorithms such that
- keeps every vertex other than and covered at all times, and
- at every step of every request sequence the movement costs of add up to at most : no two of them move a server at the same step, and each moves at most one server; and
- consequently, for every request sequence ,
These are the shuttle algorithms of the necessity half of Theorem 6: moves its one free server between and , and no two of them ever have to move at the same step.
Formalization Note The pairing is given by a bijection e : Fin m × Fin 2 ≃ M: e (i, 0) and e (i, 1) are the paper's vertices and . The number of servers is a natural-number subtraction, which is exact because .
import Mathlib import Definitions.Def_KServer_model
namespace CompetitivePaging.Combining
/-- Fiat et al. 1991, §6, proof of Theorem 6 (necessity), pp. 9–10. Vertex set `M` of size
`2m`, enumerated by `e : Fin m × Fin 2 ≃ M` (`e (i, 0)` and `e (i, 1)` are the paper's
vertices `i` and `i + m`), with the uniform metric; `2m − 1` servers. There are deterministic
on-line algorithms `B(1), …, B(m)` such that `B(i)` keeps every vertex other than `e (i, 0)`,
`e (i, 1)` covered at all times; at every step of every request sequence the movement costs of
all of them add up to at most `1` (no two of them ever move a server at the same step, and each
moves at most one server); hence on every request sequence `σ` their total cost is at most the
length of `σ`. -/
theorem exists_shuttle_algorithms {m : ℕ} (hm : 0 < m) {M : Type} [MetricSpace M]
(hM : ∀ x y : M, x ≠ y → dist x y = 1) (e : Fin m × Fin 2 ≃ M) :
∃ B : Fin m → KServer.OnlineAlgorithm (2 * m - 1) M,
(∀ (i : Fin m) (l : List M) (x : M), x ≠ e (i, 0) → x ≠ e (i, 1) →
∃ j, (B i).conf l j = x) ∧
(∀ (σ : List M) (s : ℕ), s < σ.length →
∑ i, KServer.moveCost ((B i).conf (σ.take s)) ((B i).conf (σ.take (s + 1))) ≤ 1) ∧
∀ σ : List M, ∑ i, (B i).cost σ ≤ (σ.length : ℝ) := by sorry
end CompetitivePaging.Combining
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
The setting is:
- a natural number with ;
- a type with a metric , in which any two distinct points are at distance exactly : for ;
- a bijection , so has exactly points. Write and .
The statement uses several notions from an external definitions file (KServer) whose text is not shown here, so this read-back cannot unfold them. By their names alone:
- "on-line algorithm with servers on ";
- the configuration map , which gives a configuration for each finite request list and assigns a point of to each server index ;
- a movement cost between two configurations;
- a total cost of an algorithm on a request list .
What these require is whatever the external definitions say. For example, whether an algorithm must place a server on each requested point, and in what sense it is "on-line", cannot be seen from this statement.
Claim: there exist algorithms , each an on-line algorithm with servers on , such that all three of the following hold. (With , is the ordinary value, at least .)
- Coverage: for every , every finite list of points of (including the empty list), and every point with and , some server index has .
- Per-step movement bound: for every finite list and every with ,
The statement bounds only this sum. It does not separately say that at most one moves at a step, or that each moves at most one server. Those would follow only if the movement costs are non-negative and suitably quantized, which depends on the unseen definition of . 3. Total cost bound: for every finite list ,
where is the length of , taken as a real number. This is asserted as its own conjunct, not derived from item 2 within the statement.
Degenerate cases.
- : excluded by the hypothesis .
- : has exactly two points, and , and there is one server. The coverage condition is vacuous, because every point is or . The claim then reduces to one algorithm whose per-step movement cost is at most and whose total cost on any is at most .
- Empty request list : item 2 is vacuous, and item 3 says the summed costs are at most .
- Empty list : the coverage condition applies to of the empty list as well, which is presumably the initial configuration.
- The metric: the hypothesis for fixes as the uniform metric, whatever metric structure carries.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.