Documentation

CslibFrontier.DataStructure.Paging.RandomizedLowerBound

The H_k randomized paging lower bound and (k + 1)-page tightness #

This file formalizes the randomized lower bound and sharpness results of Fiat, Karp, Luby, McGeoch, Sleator, and Young, Competitive Paging Algorithms (arXiv:cs/0205038v1, numbering verified against marking.tex):

  1. Section 5, Theorem 4 and Corollary 5 (H_k lower bound against an oblivious adversary): Over any page universe containing a (k + 1)-element subset S (0 < k), no randomized online paging algorithm — whether formulated as a behavioural strategy (Online.BehavioralStrategy, covering markingStrategy) or as a discrete mixture of deterministic strategies (Online.RandStrategy) — is (c, b)-competitive for any c < H_k and finite additive constant b ≠ ⊤, even from a fixed admissible initial cache such as ∅ (not_isCompetitiveFrom_behavioral_of_lt, not_isCompetitiveFrom_rand_of_lt). Following Section 5 of the source, an oblivious nemesis maintains a marked subset of S and constructs subphases (exists_subphase) whose expected online cost is at least 1 / u when u pages of S are unmarked, accumulating at least H_k expected faults per phase while a capacity-k offline schedule faults only once per phase (exists_phase, exists_phases).
  2. Section 3, Theorem 2 (markingthm2, H_k-competitiveness on k + 1 pages): When all requests and the initial cache lie in a set U of at most k + 1 pages (in particular on any [Fintype α] with Fintype.card α ≤ k + 1), each phase of markingStrategy contains at most one clean request and #clean ≤ OPT with zero additive slack (cleanCount_le_scheduleCost_of_subset), making markingStrategy (H_k, 0)-competitive (markingStrategy_isCompetitive_of_card_le) and matching the H_k lower bound on Fin (k + 1) (markingStrategy_tight_on_fin_succ).
  3. Section 3 separation for n ≥ k + 2 (markingStrategy_not_isCompetitive_harmonic_two_fin_four): Even at k = 2 on four pages (Fin 4), repeating the 8-request cycle [2, 3, 0, 1, 3, 2, 1, 0] from {0, 1} forces markingStrategy to incur 8 m expected faults against 4 m + 1 offline faults, refuting (c, b)-competitiveness for every c < 2 (in particular c = H_2 = 3 / 2) and every b ≠ ⊤.

Main definitions #

Main results #

References #

Oblivious nemesis sequence construction (FKLMSY Section 5) #

structure Cslib.DataStructure.Paging.ObliviousPagingCost {α : Type} (S : Finset α) (cost : List α → ℝ) :

Abstract oblivious expected-cost functional over a (k + 1)-page set S: starting at zero on [], appending a single request x incurs nonnegative expected step cost cost (σ ++ [x]) - cost σ, and because any valid capacity-k cache misses at least one page of S, the sum of expected step costs over S is at least 1 after every prefix σ.

  • cost_nil : cost [] = 0

    Empty request sequence incurs zero expected cost.

  • step_nonneg (σ : List α) (x : α) : 0 ≤ cost (σ ++ [x]) - cost σ

    Appending any single request never decreases expected cost.

  • one_le_sum_step (σ : List α) : 1 ≤ ∑ x ∈ S, (cost (σ ++ [x]) - cost σ)

    Across S, expected miss probabilities sum to at least 1 after every prefix σ.

theorem Cslib.DataStructure.Paging.exists_subphase {α : Type} [DecidableEq α] {S M : Finset α} {cost : List α → ℝ} (hcost : ObliviousPagingCost S cost) (hMS : M ⊆ S) (hM_ne : M.Nonempty) (hU_ne : (S \ M).Nonempty) (σ : List α) :
∃ (mid : List α), ∃ j ∈ S \ M, (∀ x ∈ mid, x ∈ M) ∧ (↑(S \ M).card)⁻¹ ≤ cost (σ ++ (mid ++ [j])) - cost σ

Subphase lemma ([FKL+91], Section 5): for any prefix σ and nonempty marked subset M ⊂ S (M ⊆ S, (S \ M).Nonempty), there is a finite sequence of marked requests mid followed by an unmarked request j ∈ S \ M increasing expected cost by at least 1 / |S \ M|.

theorem Cslib.DataStructure.Paging.exists_phase {α : Type} [DecidableEq α] {k : ℕ} (hk : 0 < k) {S M_prev : Finset α} {cost : List α → ℝ} (hcost : ObliviousPagingCost S cost) (hS : S.card = k + 1) (hM_sub : M_prev ⊆ S) (hM_card : M_prev.card = k) (σ : List α) :
∃ (phase : List α) (M_next : Finset α) (offStates : List (Finset α)), M_next ⊆ S ∧ M_next.card = k ∧ (problem α k).ValidSchedule M_prev phase offStates ∧ (problem α k).finalState M_prev offStates = M_next ∧ (problem α k).scheduleCost M_prev phase offStates = 1 ∧ ↑(harmonic k) ≤ cost (σ ++ phase) - cost σ

Single-phase nemesis lemma ([FKL+91], Section 5): from any prefix σ and full offline cache M_prev ⊆ S (M_prev.card = k, 0 < k), there exist a phase request sequence phase, a next cache M_next ⊆ S (M_next.card = k), and a valid 1-fault offline schedule moving M_prev ↦ M_next such that the online expected cost increases by at least H_k.

theorem Cslib.DataStructure.Paging.exists_phases {α : Type} [DecidableEq α] {k : ℕ} (hk : 0 < k) {S M₀ : Finset α} {cost : List α → ℝ} (hcost : ObliviousPagingCost S cost) (hS : S.card = k + 1) (hM₀_sub : M₀ ⊆ S) (hM₀_card : M₀.card = k) (m : ℕ) (σ : List α) :
∃ (reqs : List α) (offStates : List (Finset α)), (problem α k).ValidSchedule M₀ reqs offStates ∧ (problem α k).scheduleCost M₀ reqs offStates = m ∧ ↑m * ↑(harmonic k) ≤ cost (σ ++ reqs) - cost σ

Iterating exists_phase across m phases produces a sequence on which online expected cost increases by at least m * H_k while the offline schedule incurs exactly m faults.

ObliviousPagingCost instances for BehavioralStrategy and RandStrategy #

theorem Cslib.DataStructure.Paging.obliviousPagingCost_behavioral {α : Type} [DecidableEq α] {k : ℕ} (B : Online.BehavioralStrategy (problem α k)) {s₀ S : Finset α} (hs₀ : ValidCache k s₀) (hS : S.card = k + 1) :
ObliviousPagingCost S fun (σ : List α) => (B.expectedCost s₀ σ).toReal

Every BehavioralStrategy (problem α k) satisfies ObliviousPagingCost on any (k + 1)-page subset S from any admissible initial cache s₀.

theorem Cslib.DataStructure.Paging.obliviousPagingCost_rand {α : Type} [DecidableEq α] {k : ℕ} (μ : Online.RandStrategy (problem α k)) {s₀ S : Finset α} (hs₀ : ValidCache k s₀) (hS : S.card = k + 1) :
ObliviousPagingCost S fun (σ : List α) => (μ.expectedCost s₀ σ).toReal

Every RandStrategy (problem α k) satisfies ObliviousPagingCost on any (k + 1)-page subset S from any admissible initial cache s₀.

Main H_k lower-bound theorems (FKLMSY Theorem 4 & Corollary 5) #

theorem Cslib.DataStructure.Paging.exists_witness_behavioral_of_card_eq {α : Type} [DecidableEq α] {k : ℕ} (hk : 0 < k) (B : Online.BehavioralStrategy (problem α k)) {s₀ S : Finset α} (hs₀_sub : s₀ ⊆ S) (hs₀_card : s₀.card = k) (hS : S.card = k + 1) (m : ℕ) :
∃ (reqs : List (problem α k).Req) (offStates : List (problem α k).State), (problem α k).ValidSchedule s₀ reqs offStates ∧ (problem α k).scheduleCost s₀ reqs offStates = m ∧ ↑m * ENNReal.ofReal ↑(harmonic k) ≤ B.expectedCost s₀ reqs

Exact m-phase randomized lower-bound witness (BehavioralStrategy): from any full initial cache s₀ ⊆ S (s₀.card = k, S.card = k + 1, 0 < k), there is a request sequence on which B.expectedCost is at least m * H_k while a valid offline schedule incurs exactly m faults.

theorem Cslib.DataStructure.Paging.not_isCompetitiveFrom_behavioral_of_lt {α : Type} [DecidableEq α] {k : ℕ} (hk : 0 < k) (B : Online.BehavioralStrategy (problem α k)) {s₀ S : Finset α} (hs₀ : ValidCache k s₀) (hS : S.card = k + 1) {c b : ENNReal} (hc : c < ENNReal.ofReal ↑(harmonic k)) (hb : b ≠ ⊤) :

FKLMSY Theorem 4 & Corollary 5 (BehavioralStrategy.IsCompetitiveFrom) [FKL+91]: over any universe containing a (k + 1)-element subset S (0 < k), no behavioural randomized paging strategy is (c, b)-competitive from any admissible initial cache s₀ (including ∅) for c < H_k and finite b ≠ ⊤.

theorem Cslib.DataStructure.Paging.not_isCompetitive_behavioral_of_lt {α : Type} [DecidableEq α] {k : ℕ} (hk : 0 < k) (B : Online.BehavioralStrategy (problem α k)) {S : Finset α} (hS : S.card = k + 1) {c b : ENNReal} (hc : c < ENNReal.ofReal ↑(harmonic k)) (hb : b ≠ ⊤) :

FKLMSY Corollary 5 (BehavioralStrategy.IsCompetitive) [FKL+91]: over ≥ k + 1 pages (0 < k), no behavioural randomized paging strategy is (c, b)-competitive for c < H_k and b ≠ ⊤.

theorem Cslib.DataStructure.Paging.not_isCompetitiveAnyInit_behavioral_of_lt {α : Type} [DecidableEq α] {k : ℕ} (hk : 0 < k) (B : Online.BehavioralStrategy (problem α k)) {S : Finset α} (hS : S.card = k + 1) {c b : ENNReal} (hc : c < ENNReal.ofReal ↑(harmonic k)) (hb : b ≠ ⊤) :

Over ≥ k + 1 pages (0 < k), no behavioural randomized paging strategy is (c, b)-competitive across arbitrary initial caches for c < H_k and b ≠ ⊤.

Canonical BehavioralStrategy lower bound on Fin n (0 < k < n): no behavioural strategy is (c, b)-competitive from ∅ for c < H_k and b ≠ ⊤.

theorem Cslib.DataStructure.Paging.not_isCompetitiveFrom_rand_of_lt {α : Type} [DecidableEq α] {k : ℕ} (hk : 0 < k) (μ : Online.RandStrategy (problem α k)) {s₀ S : Finset α} (hs₀ : ValidCache k s₀) (hS : S.card = k + 1) {c b : ENNReal} (hc : c < ENNReal.ofReal ↑(harmonic k)) (hb : b ≠ ⊤) :

FKLMSY Theorem 4 & Corollary 5 (RandStrategy.IsCompetitiveFrom) [FKL+91]: over any universe containing a (k + 1)-element subset S (0 < k), no discrete-mixture randomized paging strategy is (c, b)-competitive from any admissible initial cache s₀ for c < H_k and b ≠ ⊤.

theorem Cslib.DataStructure.Paging.not_isCompetitive_rand_of_lt {α : Type} [DecidableEq α] {k : ℕ} (hk : 0 < k) (μ : Online.RandStrategy (problem α k)) {S : Finset α} (hS : S.card = k + 1) {c b : ENNReal} (hc : c < ENNReal.ofReal ↑(harmonic k)) (hb : b ≠ ⊤) :

FKLMSY Corollary 5 (RandStrategy.IsCompetitive) [FKL+91]: over ≥ k + 1 pages (0 < k), no RandStrategy is (c, b)-competitive for c < H_k and b ≠ ⊤.

theorem Cslib.DataStructure.Paging.fin_not_isCompetitiveFrom_empty_rand_of_lt {k n : ℕ} (hk : 0 < k) (hkn : k < n) (μ : Online.RandStrategy (problem (Fin n) k)) {c b : ENNReal} (hc : c < ENNReal.ofReal ↑(harmonic k)) (hb : b ≠ ⊤) :

Canonical RandStrategy lower bound on Fin n (0 < k < n): no RandStrategy is (c, b)-competitive from ∅ for c < H_k and b ≠ ⊤.

FKLMSY Theorem 2: markingStrategy is (H_k, 0)-competitive on ≤ k + 1 pages #

theorem Cslib.DataStructure.Paging.cleanCount_le_scheduleCost_of_subset {α : Type} [DecidableEq α] {k : ℕ} (hk : 0 < k) {U s₀ : Finset α} (hU : U.card ≤ k + 1) (hs₀ : ValidCache k s₀) (hs₀U : s₀ ⊆ U) {reqs : List α} (hreqs : ∀ p ∈ reqs, p ∈ U) {offStates : List (Finset α)} (hv : (problem α k).ValidSchedule s₀ reqs offStates) :
cleanCount k (initTracker s₀) reqs ≤ (problem α k).scheduleCost s₀ reqs offStates

One-window clean-request bound on ≤ k + 1 pages ([FKL+91], Section 3, proof of Theorem 2): when the initial cache s₀ and all requested pages lie in a set U of size at most k + 1, cleanCount never exceeds the fault cost of any valid offline schedule from s₀ (factor 1 instead of 2).

theorem Cslib.DataStructure.Paging.markingStrategy_expectedCost_le_of_subset {α : Type} [DecidableEq α] {k : ℕ} (hk : 0 < k) {U s₀ : Finset α} (hU : U.card ≤ k + 1) (hs₀ : ValidCache k s₀) (hs₀U : s₀ ⊆ U) {reqs : List α} (hreqs : ∀ p ∈ reqs, p ∈ U) {offStates : List (Finset α)} (hv : (problem α k).ValidSchedule s₀ reqs offStates) :
(markingStrategy k hk).expectedCost s₀ reqs ≤ ENNReal.ofReal ↑(harmonic k) * ↑((problem α k).scheduleCost s₀ reqs offStates)

Expected-cost bound of markingStrategy when s₀ and reqs lie in U with U.card ≤ k + 1: E[MARK] ≤ H_k · OPT.

FKLMSY Theorem 2 (markingthm2) [FKL+91]: on any page universe of size at most k + 1 (0 < k), markingStrategy is (H_k, 0)-competitive against an oblivious adversary.

Exact H_k randomized minimax value on Fin (k + 1) (combining FKLMSY Theorem 2 and Theorem 4): markingStrategy achieves (H_k, 0)-competitiveness on Fin (k + 1), while no behavioural randomized strategy achieves (c, b)-competitiveness from ∅ for any c < H_k and b ≠ ⊤.

FKLMSY Section 3 separation: markingStrategy is not H_2-competitive on Fin 4 #

FKLMSY Section 3 (k = 2, n = 4 separation) [FKL+91]: on Fin 4, markingStrategy 2 from {0, 1} is not (c, b)-competitive for any c < 2 and b ≠ ⊤.

FKLMSY Section 3 (markingStrategy is not H_2-competitive on four pages) [FKL+91]: on Fin 4 at k = 2, markingStrategy is not (H_2, b)-competitive (H_2 = 3 / 2) for any finite additive constant b ≠ ⊤.