Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eq. (56), App. B.3, p. 41 — strong law of large numbers: E(n)/n → λ, V_p(N)/N → m_p, V_d(N)/N → m_d almost surely

Proved
LLMThroughput.TokenBudget.eq_56

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

arrival-processiidp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1strong-law

Strong law for arrivals and token sizes. Work in the i.i.d. arrival model of §3.1. On a probability space (Ω,F,P)(\Omega,\mathcal F,\mathbb P)(Ω,F,P) the following hold:

  • the arrival counts ana_nan​ are i.i.d. with λ=E[a1]<∞\lambda=E[a_1]<\inftyλ=E[a1​]<∞;
  • the sizes (vp(i),vd(i))(v_p(i),v_d(i))(vp​(i),vd​(i)) are i.i.d. with 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​;
  • the two sequences are independent.

Let mp=E[vp(1)]m_p=E[v_p(1)]mp​=E[vp​(1)] and md=E[vd(1)]m_d=E[v_d(1)]md​=E[vd​(1)]. Let E(n)E(n)E(n) be the number of requests arrived in the first nnn slots, and let Vf(N)=∑i≤Nvf(i)V_f(N)=\sum_{i\le N}v_f(i)Vf​(N)=∑i≤N​vf​(i) for f∈{p,d}f\in\{p,d\}f∈{p,d}. Then

P{ω: lim⁡n→∞1nE(n,ω)=λ,  lim⁡N→∞1NVp(N,ω)=mp,  lim⁡N→∞1NVd(N,ω)=md}=1.\mathbb P\Big\{\omega:\ \lim_{n\to\infty}\tfrac1n E(n,\omega)=\lambda,\ \ \lim_{N\to\infty}\tfrac1N V_p(N,\omega)=m_p,\ \ \lim_{N\to\infty}\tfrac1N V_d(N,\omega)=m_d\Big\}=1 .P{ω: n→∞lim​n1​E(n,ω)=λ,  N→∞lim​N1​Vp​(N,ω)=mp​,  N→∞lim​N1​Vd​(N,ω)=md​}=1.

These limits are the long-run arrival rates of requests and of prefill and decode work. The proof of Theorem 2(a) uses them, and so does the construction of fluid limits.

Formalization Note The first nnn slots are slots 0,…,n−10,\dots,n-10,…,n−1, and Vf(N)V_f(N)Vf​(N) sums requests 0,…,N−10,\dots,N-10,…,N−1. At n=0n=0n=0 the quotient is Lean's 0/0=00/0=00/0=0, which does not affect the limit. The random variables are measurable, and finiteness of λ\lambdaλ is integrability of a1a_1a1​.

Differences from the source:

  • encoding: two i.i.d. sequences {an}\{a_n\}{an​} and {(vp(i),vd(i))}\{(v_p(i),v_d(i))\}{(vp​(i),vd​(i))}, independent of each other, with λ=E[a1]\lambda=E[a_1]λ=E[a1​] → measurable maps, mutually independent (iIndepFun) and identically distributed (IdentDistrib) within each sequence, the two sequences independent as random elements of NN\mathbb N^{\mathbb N}NN and (N2)N(\mathbb N^2)^{\mathbb N}(N2)N, and a1a_1a1​ integrable; reason: the same assumptions in Lean's vocabulary. The paper's λ\lambdaλ is finite (p. 42, "the first moment assumption on ana_nan​")
  • encoding: E(n)=∑ℓ=1naℓE(n)=\sum_{\ell=1}^n a_\ellE(n)=∑ℓ=1n​aℓ​, Vf(N)=∑i=1Nvf(i)V_f(N)=\sum_{i=1}^N v_f(i)Vf​(N)=∑i=1N​vf​(i) → sums over the 0-based indices m<nm<nm<n and i<Ni<Ni<N; reason: Lean convention; same quantities
Preamble
import Mathlib
import Definitions.Def_LLMThroughput_TokenBudget_Model
Formal statement
namespace LLMThroughput.TokenBudget

open MeasureTheory ProbabilityTheory Filter Topology

theorem eq_56 {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ]
    (vpmax vdmax : ℕ) (a : ℕ → Ω → ℕ) (v : ℕ → Ω → ℕ × ℕ)
    (hA : IIDArrivals μ a v vpmax vdmax) :
    ∀ᵐ ω ∂μ,
      Tendsto (fun n : ℕ => (arrivalsBefore (fun m => a m ω) n : ℝ) / n) atTop
          (𝓝 (arrivalRate μ a)) ∧
        Tendsto (fun N : ℕ => (∑ i ∈ Finset.range N, ((v i ω).1 : ℝ)) / N) atTop
          (𝓝 (meanPrefill μ v)) ∧
        Tendsto (fun N : ℕ => (∑ i ∈ Finset.range N, ((v i ω).2 : ℝ)) / N) atTop
          (𝓝 (meanDecode μ v)) := by sorry

end LLMThroughput.TokenBudget
Source
Dai, Deng, Li & Peng, Throughput-Optimal Scheduling Algorithms for LLM Inference and AI Agents, arXiv:2504.07347v3, p. 41, eq. (56), App. B.3 (E(n), V_f(N) defined on p. 37, eq. (38); arrival model pp. 12–13)
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