Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eqs. (3.1)–(3.4): generating function, idle probability and mean queue length of the M^[X]/M/1 queue

Proved
QueueingFundamentals.AdvMarkov.bulk_input_steady_state

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

bulk-arrivalgenerating-functionp2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1queueing

Consider the M[X]/M/1M^{[X]}/M/1M[X]/M/1 queue: batches arrive at rate λ>0\lambda > 0λ>0, each batch brings XXX customers with Pr⁡{X=n}=cn\Pr\{X = n\} = c_nPr{X=n}=cn​ (n≥1n \ge 1n≥1), and one server serves at rate μ>0\mu > 0μ>0. Assume E[X]=∑nncn<∞\mathrm E[X] = \sum_n n c_n < \inftyE[X]=∑n​ncn​<∞, write E[X2]=∑nn2cn\mathrm E[X^2] = \sum_n n^2 c_nE[X2]=∑n​n2cn​, r=λ/μr = \lambda/\mur=λ/μ and ρ=λE[X]/μ\rho = \lambda\mathrm E[X]/\muρ=λE[X]/μ, and assume ρ<1\rho < 1ρ<1. Let C(z)=∑n≥1cnznC(z) = \sum_{n\ge 1} c_n z^nC(z)=∑n≥1​cn​zn. Then:

  1. the balance equations (3.1) have a steady-state solution {pn}\{p_n\}{pn​};
  2. every steady-state solution {pn}\{p_n\}{pn​} of (3.1) has generating function
P(z)=∑n≥0pnzn=μp0(1−z)μ(1−z)−λz[1−C(z)](∣z∣≤1, z≠1),(3.3)P(z) = \sum_{n\ge 0}p_n z^n = \frac{\mu p_0(1-z)}{\mu(1-z) - \lambda z[1 - C(z)]} \qquad (|z| \le 1,\ z \ne 1), \qquad (3.3)P(z)=n≥0∑​pn​zn=μ(1−z)−λz[1−C(z)]μp0​(1−z)​(∣z∣≤1, z=1),(3.3)

and idle probability p0=1−rE[X]=1−ρp_0 = 1 - r\mathrm E[X] = 1 - \rhop0​=1−rE[X]=1−ρ; 3. if moreover E[X2]<∞\mathrm E[X^2] < \inftyE[X2]<∞, every steady-state solution has mean number in system

L=∑n≥0npn=r(E[X]+E[X2])2(1−ρ)=ρ+rE[X2]2(1−ρ).(3.4)L = \sum_{n\ge 0} n p_n = \frac{r(\mathrm E[X] + \mathrm E[X^2])}{2(1-\rho)} = \frac{\rho + r\mathrm E[X^2]}{2(1-\rho)}. \qquad (3.4)L=n≥0∑​npn​=2(1−ρ)r(E[X]+E[X2])​=2(1−ρ)ρ+rE[X2]​.(3.4)

For single arrivals (X≡1X \equiv 1X≡1) this reduces to the M/M/1M/M/1M/M/1 results p0=1−ρp_0 = 1-\rhop0​=1−ρ and L=ρ/(1−ρ)L = \rho/(1-\rho)L=ρ/(1−ρ).

Formalization Note zzz ranges over complex numbers with ∣z∣≤1|z| \le 1∣z∣≤1. The point z=1z = 1z=1 is excluded from (3.3), where the right-hand side is 0/00/00/0 and the book passes to the limit P(1)=1P(1) = 1P(1)=1 instead. The existence of a steady state under ρ<1\rho < 1ρ<1 is the chapter's standing assumption (footnote on p.118) and is part of the statement. The mean LLL is stated with HasSum, which also asserts that the series converges.

Preamble
import Mathlib
import Definitions.Def_QueueingFundamentals_AdvMarkov_BulkInput
Formal statement
namespace QueueingFundamentals.AdvMarkov

/-- Eqs. (3.1), (3.3), (3.4), pp.118–119: the `M^[X]/M/1` bulk-input queue with batch arrival rate
`λ`, service rate `μ`, batch sizes `X` with `E[X] < ∞`, `r = λ/μ` and `ρ = λE[X]/μ < 1` has a
steady-state solution, and every steady-state solution has generating function
`P(z) = μp_0(1 − z)/(μ(1 − z) − λz[1 − C(z)])` for `|z| ≤ 1`, `z ≠ 1` (3.3), and
`p_0 = 1 − rE[X] = 1 − ρ`; if moreover `E[X²] < ∞`, its mean is
`L = r(E[X] + E[X²])/(2(1 − ρ)) = (ρ + rE[X²])/(2(1 − ρ))` (3.4). -/
theorem bulk_input_steady_state (lam mu : ℝ) (hlam : 0 < lam) (hmu : 0 < mu)
    (c : ℕ → ℝ) (hc : IsBatchSizeDist c) (hc1 : Summable (fun n : ℕ => (n : ℝ) * c n))
    (EX EX2 r ρ : ℝ) (hEX : EX = ∑' n : ℕ, (n : ℝ) * c n)
    (hEX2 : EX2 = ∑' n : ℕ, (n : ℝ) ^ 2 * c n)
    (hr : r = lam / mu) (hρ : ρ = lam * EX / mu) (hρ1 : ρ < 1) :
    (∃ p : ℕ → ℝ, IsBulkInputSteadyState lam mu c p) ∧
      ∀ p : ℕ → ℝ, IsBulkInputSteadyState lam mu c p →
        (∀ z : ℂ, ‖z‖ ≤ 1 → z ≠ 1 →
          cpgf p z = (mu : ℂ) * (p 0 : ℂ) * (1 - z) /
            ((mu : ℂ) * (1 - z) - (lam : ℂ) * z * (1 - cpgf c z))) ∧
        p 0 = 1 - r * EX ∧ p 0 = 1 - ρ ∧
        (Summable (fun n : ℕ => (n : ℝ) ^ 2 * c n) →
          HasSum (fun n : ℕ => (n : ℝ) * p n) (r * (EX + EX2) / (2 * (1 - ρ))) ∧
          HasSum (fun n : ℕ => (n : ℝ) * p n) ((ρ + r * EX2) / (2 * (1 - ρ)))) := by sorry

end QueueingFundamentals.AdvMarkov
Source
Gross, Shortle, Thompson & Harris, Fundamentals of Queueing Theory, 4th ed., Wiley 2008, DOI 10.1002/9781118625651, pp.118–119, Eqs. (3.1), (3.3), (3.4) and p_0 = 1 − rE[X] = 1 − ρ
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

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