The marking algorithm's expected cost in a phase is at most
ProvedCompetitivePaging.Marking.phase_expected_cost_leonline-algorithmsp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1pagingrandomized-algorithms
Let be a set of vertices enumerated as , let , and run the marking algorithm with servers from on a request sequence . Let requests form a complete phase, let be the number of requests to clean vertices in the phase, and let be the expected cost of the marking algorithm on the requests of the phase (the sum of their fault probabilities). With the -th harmonic number,
Together with the adversary's amortized cost of at least per phase, this gives the competitive factor of Theorem 1.
Preamble
import Mathlib import Definitions.Def_KServer_model import Definitions.Def_CompetitivePaging_Marking_markingAlgorithm
Formal statement
namespace CompetitivePaging.Marking
/-- §3, proof of Theorem 1 (pp. 4–5): in a complete phase with `l` requests to clean vertices,
the expected cost of the marking algorithm is at most `l (H_k - H_l + 1) ≤ l H_k`. -/
theorem phase_expected_cost_le {n k : ℕ} {M : Type*} [DecidableEq M]
(e : Fin n ≃ M) (hk : 1 ≤ k) (hkn : k ≤ n) (σ : List M) (i i' : ℕ)
(hphase : IsCompletePhase k (initVertices e hkn) σ i i') :
markingPhaseCost k (initVertices e hkn) σ i i'
≤ ((phaseRequested σ i i' \ marksAt k (initVertices e hkn) σ i).card : ℝ)
* ((harmonic k : ℝ)
- (harmonic (phaseRequested σ i i' \ marksAt k (initVertices e hkn) σ i).card : ℝ)
+ 1) ∧
((phaseRequested σ i i' \ marksAt k (initVertices e hkn) σ i).card : ℝ)
* ((harmonic k : ℝ)
- (harmonic (phaseRequested σ i i' \ marksAt k (initVertices e hkn) σ i).card : ℝ)
+ 1)
≤ ((phaseRequested σ i i' \ marksAt k (initVertices e hkn) σ i).card : ℝ)
* (harmonic k : ℝ) := by sorry
end CompetitivePaging.Marking
Source
Fiat, Karp, Luby, McGeoch, Sleator, Young, Competitive Paging Algorithms, arXiv:cs/0205038v1, p. 5, §3, proof of Theorem 1 (displayed bound)
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting.
- is a bijection onto a type with decidable equality, and .
- .
- is a request sequence.
- is a complete phase: are both phase starts, so , with none strictly between. Here is the deterministic marked set just before request (started at , rule "insert the request; if exactly marked, keep only the request"), and is a phase start iff .
Quantities.
- .
- , with .
- is the sum, over , of the probability that is uncovered just before it is served. The randomized marking process starts from (covered, marked) at the beginning of , not at index .
Claim.
The second inequality is equivalent to , which holds for every natural number .
Degenerate cases.
- If , both bounds are , so the claim says (it is a sum of nonnegative terms).
- is not required to be at most , so may be negative.
- When , no phase start exists and the statement is vacuous.
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.