Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 11, p. 38 (corrected: departure order only; the prefill-completion clause is false) — under work-conserving K-FCFS, a request departs only after every request at least K′ older

Proved
LLMThroughput.TokenBudget.lemma_11

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

bounded-overtakingk-fcfsp2o-batch-pfp2ap2o-correctedp2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1queueingscheduling

Bounded overtaking in departure order. Fix KKK, the size bounds vpmax⁡,vdmax⁡v_p^{\max}, v_d^{\max}vpmax​,vdmax​ and the token budget bmax⁡b_{\max}bmax​. Then there is a finite constant K′K'K′, depending only on these four numbers, with the following property. Take any batch-time parameters c,a,b0c,a,b_0c,a,b0​ satisfying Assumption 1 and any work-conserving K-FCFS scheduling algorithm. Let requests arrive in arbitrary numbers with sizes 1≤vp(i)≤vpmax⁡1\le v_p(i)\le v_p^{\max}1≤vp​(i)≤vpmax​ and 1≤vd(i)≤vdmax⁡1\le v_d(i)\le v_d^{\max}1≤vd​(i)≤vdmax​, into a system that starts empty, with requests labelled 0,1,2,…0,1,2,\dots0,1,2,… in arrival order. Then for all labels i,ji, ji,j with

i+K′≤j,i + K' \le j,i+K′≤j,

if request jjj is in the system at the beginning of slot nnn and departs at the end of slot nnn, then request iii departed before slot nnn.

In words: a request cannot leave the system before every request that arrived at least K′K'K′ positions earlier has left. Bounded overtaking couples the cumulative token counts with the cumulative completed requests (eq. (44)), which is what the fluid-limit argument needs.

Formalization Note "Departed" means the label has been issued and is no longer in the state. The claim holds for every deterministic sequence of arrival counts and sizes within the bounds, and so for every sample path of the random model. The constant K′K'K′ is chosen before the batch-time parameters, the algorithm and the sample path.

Differences from the source:

  • correction: for each phase f∈{p,d}f\in\{p,d\}f∈{p,d} → only f=df=df=d (departure order); reason: the prefill clause is false. Take K=1K=1K=1, bmax⁡=b0=1b_{\max}=b_0=1bmax​=b0​=1, c=0c=0c=0, a=1a=1a=1 and all sizes (1,1)(1,1)(1,1), with MMM requests arriving in the first slot. The policy "one prefill token of the newest request still in prefill, otherwise one decode token of the oldest request" is a work-conserving K-FCFS scheduling algorithm, and it completes prefill in the order M,M−1,…,1M,M-1,\dots,1M,M−1,…,1, so for every K′K'K′ some request completes prefill before one K′K'K′ positions older
  • reading: "request jjj can complete phase fff only if every request i≤j−K′i\le j-K'i≤j−K′ has already completed phase fff" → if jjj is present at the start of slot nnn and gone at the start of slot n+1n+1n+1, then iii is gone at the start of slot nnn; reason: the strict reading of "already" (before jjj, not in the same batch), which implies the non-strict one
  • reading: requests indexed i=1,2,…i=1,2,\dotsi=1,2,… by global arrival time, initial state unspecified → the run starts from the empty system and labels its arrivals 0,1,2,…0,1,2,\dots0,1,2,…; reason: every state of the paper's state space is reached from the empty system, and a run from such a state continues a run from empty with the arrival sequences concatenated, so the two statements are equivalent. From an arbitrary state with a large gap between the labels of present requests, the conclusion fails
  • generalization: random i.i.d. arrival counts and sizes → every deterministic sequence of arrival counts and of sizes within the bounds; reason: the statement is pathwise and specializes to every sample path
  • generalization: the policy is a function of the labelled state (5) → a function of the state (5) together with the next arrival label, with the defining conditions required at every admissible state; reason: more policies are covered, and the paper's policies ignore the extra field and extend from the reachable states
  • encoding: i≤j−Ki\le j-Ki≤j−K in the K-FCFS condition and i≤j−K′i\le j-K'i≤j−K′ → i+K≤ji+K\le ji+K≤j and i+K′≤ji+K'\le ji+K′≤j on 0-based labels; reason: avoids natural-number subtraction; same instances
  • encoding: feasibility (6a)–(6d) → (6a)–(6d) plus δid≤Di\delta^d_i\le D_iδid​≤Di​; reason: implicit in "unprocessed decode tokens"
  • encoding: a,c≥0a,c\ge 0a,c≥0 real, b0∣bmax⁡b_0\mid b_{\max}b0​∣bmax​ → a,c∈Na,c\in\mathbb Na,c∈N and 1≤b01\le b_01≤b0​, 1≤bmax⁡1\le b_{\max}1≤bmax​, 1≤tbmax⁡1\le t_{b_{\max}}1≤tbmax​​; reason: integer slots force integer a,ca,ca,c, and the other conditions only exclude undefined cases
Preamble
import Mathlib
import Definitions.Def_LLMThroughput_TokenBudget_Model
Formal statement
namespace LLMThroughput.TokenBudget

theorem lemma_11 (K vpmax vdmax bmax : ℕ) :
    ∃ K' : ℕ, ∀ (P : Params), P.bmax = bmax → P.Valid →
      ∀ π : Policy, IsScheduler P π → IsWorkConserving P π → IsKFCFS P K π →
      ∀ (a : ℕ → ℕ) (v : ℕ → ℕ × ℕ),
        (∀ i, 1 ≤ (v i).1 ∧ (v i).1 ≤ vpmax ∧ 1 ≤ (v i).2 ∧ (v i).2 ≤ vdmax) →
      ∀ (n i j : ℕ), i + K' ≤ j →
        Present (run P π State.empty a v n) j →
        Departed (run P π State.empty a v (n + 1)) j →
        Departed (run P π State.empty a v n) i := by sorry

end LLMThroughput.TokenBudget
Source
Dai, Deng, Li & Peng, Throughput-Optimal Scheduling Algorithms for LLM Inference and AI Agents, arXiv:2504.07347v3, p. 38, Lemma 11 (App. B.1); K-FCFS condition p. 15
Human review
  • Endorsed by Shuze Chen · Oct 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 24, 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