Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Equation (2.6) — the cycle identity behind Little's law

Proved
KellyStochasticNetworks.littles_law_cycle_identity

by naimengye · Sep 18, 2026 · Mathlib 0df444a (Lean v4.33.1)

analysisqueueing-theorystochastic-networks

Little's law, L=λWL = \lambda WL=λW, relates the mean number of customers in a system, the mean arrival rate and the mean time a customer spends in the system. Given the three defining limits, the book's proof reduces it to a single pathwise identity over one regeneration cycle [0,T1][0, T_1][0,T1​], equation (2.6):

∫0T1n(s) ds=∑i=1NWi,\int_0^{T_1} n(s)\,ds = \sum_{i=1}^{N} W_i ,∫0T1​​n(s)ds=i=1∑N​Wi​,

where n(s)n(s)n(s) is the number of customers present at time sss, NNN is the number of customers arriving in the cycle, and WiW_iWi​ is the time customer iii spends in the system. That identity is what is asserted here.

Let NNN customers have arrival times aia_iai​ and departure times did_idi​ satisfying 0≤ai≤di≤T0 \le a_i \le d_i \le T0≤ai​≤di​≤T, and let

n(s)=#{i:ai≤s<di}n(s) = \#\{i : a_i \le s < d_i\}n(s)=#{i:ai​≤s<di​}

be the number present at time sss. Then

∫0Tn(s) ds=∑i=1N(di−ai).\int_0^{T} n(s)\,ds = \sum_{i=1}^{N}(d_i - a_i).∫0T​n(s)ds=i=1∑N​(di​−ai​).

Both sides compute the shaded area of Figure 2.7: the left as an integral over time, the right as a sum over customers. Equivalently, if each customer pays at rate 111 per unit time while in the system, the two sides are the total paid during the cycle, computed in two ways.

Formalization Note The count n(s)n(s)n(s) is written as a finite sum of indicator functions of the half-open intervals [ai,di)[a_i, d_i)[ai​,di​), which is exactly the number of customers present. The hypothesis di≤Td_i \le Tdi​≤T says every customer who arrives in the cycle also departs within it, which is the assumption n(T1)=0n(T_1) = 0n(T1​)=0 of the book's regeneration point; the hypothesis ai≤dia_i \le d_iai​≤di​ excludes a customer departing before arriving. Nothing probabilistic is involved: this is the pathwise half of Little's law, and the three limit statements the book quotes from renewal theory are not part of it.

Preamble
import Mathlib
import Definitions.Def_KellyStochasticNetworks_Migration
Formal statement
namespace KellyStochasticNetworks

theorem littles_law_cycle_identity {N : ℕ} (T : ℝ) (a d : Fin N → ℝ)
    (ha : ∀ i, 0 ≤ a i) (had : ∀ i, a i ≤ d i) (hd : ∀ i, d i ≤ T) :
    (∫ s in (0:ℝ)..T, occupancy a d s) = ∑ i, (d i - a i) := by sorry

end KellyStochasticNetworks
Source
Kelly & Yudovina, Stochastic Networks, CUP 2014, p. 37 (PDF p. 45), Theorem 2.13 (Little's law) and equation (2.6) in its proof: 'Thus, it suffices to show int_0^{T_1} n(s) ds = sum_{i=1}^{N} W_i. (2.6) Figure 2.7 illustrates this equality for a simple queue: the shaded area can be calculated as an integral over time, or as a sum over customers.' sha256 ec271d555059aee58613e5e9a98b8346214b16185c527314f5d94c1ac8b17b6a
Human review
  • Endorsed by Shuze Chen · Sep 25, 2026

    Confirmed by the moderator at approval.

  • Endorsed by naimengye · Sep 25, 2026

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

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