Lemma 5.7 — Keeping
ProvedChangingCache.UpperBound.lemma_5_7cachingcompetitive-analysislrup2o-batch-stoc27ap2o-gran-per-chapterp2o-plan-paperp2o-v1pagingresource-augmentation
Let be positions of a reduced run under augmentation with
Then there is a reduced run of length on the requests , with a profile satisfying for and an OPT, written with primes, in which
- LRU has the same cache after every request;
- OPT hits and misses at the same requests as before;
- after every request with , OPT holds the pages of together with the pages it loaded in .
In particular, for all ,
The lemma raises the profile beyond LRU's reach to a ramp so that OPT can keep every page it loads; it is applied twice in the earliest-failure argument.
Differences from the source:
- encoding: a page is an identifier; a request sequence is a finite list → pages are elements of an arbitrary type with decidable equality; the sequence is a
List, request is the 0-based entryσ[i]and position is the moment after the first requests; reason: Lean convention; same instances - encoding: a legal policy may discard pages at any time; on its -th miss the loaded page must fit capacity → a policy is the family of pages held after the first requests, including the discards made before request : , , and at its -th miss; reason: moving a discard earlier, to just after the previous request, changes no hit, miss or capacity check; this is the placement the source itself uses in (R3) and Eq. (5)
- encoding: (Eq. (3)) →
augCap 2 3 m kwith the real speed ; reason: the same capacity law as Section 4 at ; it equals - encoding: a reduced run of OPT and LRU on a memory profile →
IsReduced 2 3 m σ S: is a memory profile, is an optimal legal policy for on , and (R1)–(R3) hold; reason: Definition 4.1 transcribed; OPT is a designated optimal policy of the run - encoding: LRU has the same cache after every request; OPT hits and misses at the same requests → for LRU's ordered cache after is the same list on as on ; for each request (0-based) the new OPT misses iff the old one does; reason: Lean convention; the cache as a list also fixes the recency order, which is determined by the requests
- encoding: OPT holds the pages of together with the pages it loaded in →
loadedIn σ S r' u; reason: the cardinality clause of the source shows that it holds exactly these pages - encoding: → in ; reason: the subtraction moved across;
Preamble
import Mathlib import Definitions.Def_ChangingCache_UpperBound_Bank
Formal statement
namespace ChangingCache.UpperBound
/-- **Lemma 5.7 (Keeping)**, p. 14. Let `r' < r` be positions of a reduced run `(m, σ, S)` under
`(2, 3)` augmentation with `r ≤ 3 F_OPT(r' + 1) + 2`. Then there is a reduced run of length `r` on
the requests `σ₁, …, σ_r`, with a profile `m'` satisfying `m'(j) = m(j)` for `j ≤ F_OPT(r' + 1)`
and an OPT `S'`, in which
* LRU has the same cache after every request,
* OPT hits and misses at the same requests as before, and
* after every request `σ_u` with `r' ≤ u ≤ r`, OPT holds the pages of `P_OPT(r')` together with the
pages it loaded in `(r', u]`.
In particular, for all `r' ≤ u ≤ r`: `B₃'(u) = B₃(u)`, `P_OPT(u) ⊆ P'_OPT(u)` and
`|P'_OPT(u)| = |P_OPT(r')| + F_OPT(u) - F_OPT(r')`. -/
theorem lemma_5_7 {α : Type*} [DecidableEq α] (m : ℕ → ℕ) (σ : List α) (S : ℕ → Finset α)
(hred : IsReduced 2 3 m σ S) (r' r : ℕ) (hrr : r' < r) (hr : r ≤ σ.length)
(hcond : r ≤ 3 * policyMisses σ S (r' + 1) + 2) :
∃ (m' : ℕ → ℕ) (S' : ℕ → Finset α),
IsReduced 2 3 m' (σ.take r) S' ∧
(∀ j ≤ policyMisses σ S (r' + 1), m' j = m j) ∧
(∀ u ≤ r, (lruRun (augCap 2 3 m') (σ.take u)).cache =
(lruRun (augCap 2 3 m) (σ.take u)).cache) ∧
(∀ i < r, missB (σ.take r) S' i = missB σ S i) ∧
(∀ u, r' ≤ u → u ≤ r → S' u = S r' ∪ loadedIn σ S r' u) ∧
(∀ u, r' ≤ u → u ≤ r →
bank3 m' (σ.take r) S' u = bank3 m σ S u ∧
S u ⊆ S' u ∧
(S' u).card + policyMisses σ S r' = (S r').card + policyMisses σ S u) := by sorry
end ChangingCache.UpperBound
Source
Michael A. Bender, Daniel DeLayo, Pritom Kundu, Charlie McGuffey, Zofia Stefankovic, Zhonglue Wang, STOC 2027 submission #93 (October 2026), Caching with a Changing Cache Size, SHA-256 9d5334fdae9f69a8802bcb33b61c3699463aa88862a32b7bb8d17bd3efdf533d, Lemma 5.7, p. 14
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.