Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eq. (43), App. B.1, p. 38 (corrected: one extra b_max for the batch straddling n_1 t_{b_max}) — cumulative processed tokens grow by at most (n_2 − n_1 + 1) b_max

Proved
LLMThroughput.TokenBudget.eq_43

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

batch-servicellm-inferencep2o-batch-pfp2ap2o-correctedp2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1sample-paththroughput

Cumulative processing bound. Consider the basic LLM queueing model under any scheduling algorithm π\piπ and from any admissible initial state. Let the arrival counts and the request sizes be arbitrary, with every size at least 111. For a phase f∈{p,d}f\in\{p,d\}f∈{p,d}, let Bf(n)B_f(n)Bf​(n) be the number of phase-fff tokens in the batches that the algorithm formed and that completed by time nnn. Then for all n1<n2n_1<n_2n1​<n2​,

Bf(n2tbmax⁡)−Bf(n1tbmax⁡)≤(n2−n1+1) bmax⁡,f∈{p,d}.B_f\big(n_2 t_{b_{\max}}\big)-B_f\big(n_1 t_{b_{\max}}\big)\le (n_2-n_1+1)\,b_{\max},\qquad f\in\{p,d\}.Bf​(n2​tbmax​​)−Bf​(n1​tbmax​​)≤(n2​−n1​+1)bmax​,f∈{p,d}.

The bound makes precise that no schedule processes more than bmax⁡b_{\max}bmax​ tokens per tbmax⁡t_{b_{\max}}tbmax​​ slots, apart from one batch straddling the left end of the window. It gives the Lipschitz bound of the fluid model (eq. (47)) after fluid scaling.

Formalization Note Slots are 0-based, and "by time nnn" means by the end of slot n−1n-1n−1, which is the paper's slot nnn. A batch formed in slot mmm with processing time tb>0t_b>0tb​>0 is counted in Bf(n)B_f(n)Bf​(n) once m+tb≤nm+t_b\le nm+tb​≤n. The bound is written as Bf(n2tbmax⁡)≤Bf(n1tbmax⁡)+(n2−n1+1)bmax⁡B_f(n_2t_{b_{\max}})\le B_f(n_1t_{b_{\max}})+(n_2-n_1+1)b_{\max}Bf​(n2​tbmax​​)≤Bf​(n1​tbmax​​)+(n2​−n1​+1)bmax​, which avoids natural-number subtraction.

Differences from the source:

  • correction: (n2−n1) bmax⁡(n_2-n_1)\,b_{\max}(n2​−n1​)bmax​ → (n2−n1+1) bmax⁡(n_2-n_1+1)\,b_{\max}(n2​−n1​+1)bmax​; reason: the printed bound is false. Take c=1c=1c=1, a=1a=1a=1, b0=1b_0=1b0​=1, bmax⁡=2b_{\max}=2bmax​=2 (so t1=2t_1=2t1​=2, t2=tbmax⁡=3t_2=t_{b_{\max}}=3t2​=tbmax​​=3), no arrivals, and an initial state with R=1R=1R=1 and one request with 333 prefill tokens and 111 decode token. A work-conserving run forms a full batch of 222 tokens in the paper's slot 222, which completes at the end of slot 444, and then a 1-token batch, which completes at the end of slot 666. So Bp(6)−Bp(3)=3>2B_p(6)-B_p(3)=3>2Bp​(6)−Bp​(3)=3>2
  • reading: Bf(n)B_f(n)Bf​(n), "the cumulative number of tokens that have been completed phase fff processing by time nnn" → phase-fff tokens of batches formed during the run and completed by time nnn; reason: the composition of a batch already in progress in the initial state is not part of the state (5), so its tokens cannot be counted
  • generalization: n1,n2∈{1,2,… }n_1,n_2\in\{1,2,\dots\}n1​,n2​∈{1,2,…} → n1,n2∈{0,1,… }n_1,n_2\in\{0,1,\dots\}n1​,n2​∈{0,1,…}; reason: covers more instances and specializes to the source's
  • generalization: initial state in the paper's state space X\mathcal XX → any admissible state, with feasibility required at every admissible state; reason: X\mathcal XX consists of admissible states. A scheduling algorithm defined on X\mathcal XX extends feasibly to all admissible states (e.g. greedy oldest-first off X\mathcal XX), and a run from a state of X\mathcal XX never leaves X\mathcal XX
  • generalization: the policy is a function of the labelled state (5) → a function of the state (5) together with the next arrival label; reason: more policies are covered, and the paper's policies are those that ignore the extra field
  • generalization: random i.i.d. sizes bounded by vmax⁡v^{\max}vmax → arbitrary deterministic arrival counts and sizes ≥1\ge 1≥1, no upper bound; reason: the statement holds pathwise, so it specializes to every sample path of the paper's model
  • encoding: feasibility (6a)–(6d) → (6a)–(6d) plus δid≤Di\delta^d_i\le D_iδid​≤Di​; reason: a request has no decode token left to contribute when Di=0D_i=0Di​=0, which is 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
  • encoding: slots 1,2,…1,2,\dots1,2,… → slots 0,1,…0,1,\dots0,1,…; reason: Lean convention; same instances
Preamble
import Mathlib
import Definitions.Def_LLMThroughput_TokenBudget_Model
Formal statement
namespace LLMThroughput.TokenBudget

theorem eq_43 (P : Params) (hP : P.Valid) (π : Policy) (hπ : IsScheduler P π)
    (x : State) (hx : Admissible P.bmax x) (a : ℕ → ℕ) (v : ℕ → ℕ × ℕ)
    (hv : ∀ i, 1 ≤ (v i).1 ∧ 1 ≤ (v i).2) (n₁ n₂ : ℕ) (hn : n₁ < n₂) :
    completedTokens P π x a v prefillLoad (n₂ * P.t P.bmax)
        ≤ completedTokens P π x a v prefillLoad (n₁ * P.t P.bmax) + (n₂ - n₁ + 1) * P.bmax ∧
      completedTokens P π x a v decodeLoad (n₂ * P.t P.bmax)
        ≤ completedTokens P π x a v decodeLoad (n₁ * P.t P.bmax) + (n₂ - n₁ + 1) * P.bmax := 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, eq. (43), App. B.1 (B_f defined on p. 37)
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