Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

App. B, pp. 18–19 — exchange step: evicting a token of strictly smaller ranking score is no worse for the optimal cost-to-go

Disproved
TailOptCaching.ETLRU.exchange_inequality

by mikedeng1 · Oct 22, 2026 · Mathlib 0df444a (Lean v4.33.1)

cachingdynamic-programmingexchange-argumentp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let ξ\xiξ be a natural number and let z=(λ,L,X)z = (\lambda, L, X)z=(λ,L,X) be a post-decision state with nnn arrived conversations. Let i,j<ni, j < ni,j<n be two conversations with at least one cached token each, and write z(i)z^{(i)}z(i), z(j)z^{(j)}z(j) for the states obtained from zzz by evicting one token of iii, respectively of jjj; assume both are well formed, and that the cache of zzz exceeds the capacity by exactly one token, ∑l<nXl=C+1\sum_{l<n} X_l = C + 1∑l<n​Xl​=C+1, so that one token must be evicted. If the ranking scores satisfy

λi P(Li+Qi−ξ≥Xi)<λj P(Lj+Qj−ξ≥Xj),\lambda_i\, \mathbb P(L_i + Q_i - \xi \ge X_i) < \lambda_j\, \mathbb P(L_j + Q_j - \xi \ge X_j),λi​P(Li​+Qi​−ξ≥Xi​)<λj​P(Lj​+Qj​−ξ≥Xj​),

then for every number rrr of remaining arrivals the Bellman optimum satisfies

Vr⋆(z(i))≤Vr⋆(z(j)).V^\star_r\big(z^{(i)}\big) \le V^\star_r\big(z^{(j)}\big).Vr⋆​(z(i))≤Vr⋆​(z(j)).

This is the exchange argument of the proof of Theorem 2: in the paper's notation, Jk+1(λ~,L~,X(1))≤Jk+1(λ~,L~,X(k))J_{k+1}(\tilde\lambda, \tilde L, X(1)) \le J_{k+1}(\tilde\lambda, \tilde L, X(k))Jk+1​(λ~,L~,X(1))≤Jk+1​(λ~,L~,X(k)), where X(1)X(1)X(1) evicts from the conversation of lowest score.

Formalization Note. The inequality between the scores is strict: with equal scores the two evictions can have different future costs (exact dynamic-programming checks found such pairs), and the paper's "ascending order" does not address ties. The hypothesis ξ∈N\xi \in \mathbb Nξ∈N is added as for Lemma 1. Well-formedness of the two post-eviction states carries the invariant 0<λl≤λˉl0 < \lambda_l \le \bar\lambda_l0<λl​≤λˉl​ that every reachable state satisfies. The capacity hypothesis ∑l<nXl=C+1\sum_{l<n} X_l = C + 1∑l<n​Xl​=C+1 is the page's setting (the exchange is made among the tokens that must be evicted to restore the capacity constraint); it cannot be dropped: with slack capacity the deficit of the evicted token is never pushed out, its future cost is (probability that its conversation returns within the horizon) × (its tail probability), which is not linear in the rate, and an exact computation (C = 5, ξ = 1, λ_conv = 1, rates 1 and 2 with λ̄ = λ, L = X = 1, Q_0 ≡ 1, P(Q_1 = 1) = 11/20, A ≡ 0, decay factor 1, two arrivals) gives V2⋆(z(0))=17/40>319/800=V2⋆(z(1))V^\star_2(z^{(0)}) = 17/40 > 319/800 = V^\star_2(z^{(1)})V2⋆​(z(0))=17/40>319/800=V2⋆​(z(1)) although the score of 0 is 1 < 11/10.

Preamble
import Mathlib
import Definitions.Def_TailOptCaching_ETLRU_Model

open scoped ENNReal
Formal statement
namespace TailOptCaching.ETLRU

theorem exchange_inequality (P : Params) (hξ : ∃ m : ℕ, P.ξ = m) (r : ℕ) (z : State)
    (i j : ℕ) (hi : i < z.n) (hj : j < z.n) (hXi : 1 ≤ z.X i) (hXj : 1 ≤ z.X j)
    (hwi : WellFormed P (evict z i)) (hwj : WellFormed P (evict z j))
    (hcap : ∑ l ∈ Finset.range z.n, z.X l = P.C + 1)
    (hscore : score P z i < score P z j) :
    optValue P r (evict z i) ≤ optValue P r (evict z j) := by sorry

end TailOptCaching.ETLRU
Source
Zhang, Li, Moallemi & Peng, Tail-Optimized Caching for LLM Inference, arXiv:2510.15152v1, pp. 18–19, App. B (exchange argument and its three cases)
Human review
  • Endorsed by Shuze Chen · Oct 22, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 22, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me