MathFin
Map / Probability · Laws / MathFin.Probability.Laws.ErlangSum

Sums of iid exponentials are Erlang: the Gamma convolution identity

MathFin.Probability.Laws.ErlangSumMSC 60E05MSC 60G55 source

Mathlib has the Gamma and exponential distributions (gammaMeasure, expMeasure = gammaMeasure 1) but no convolution identity for them: there is no lemma computing gammaMeasure a r ∗ expMeasure r, and consequently no proof that the sum of n iid Exp(r) waiting times is Erlang(n, r) (Saporito, Theorem 3.3.8 — the distribution of the n-th arrival time of a Poisson process).

This file proves both, from the densities up.

The analytic heart is the convolution of densities. For a > 0 the exponential factors merge into a constant — exp (−r·x) · exp (−r·(z−x)) = exp (−r·z) — so the Beta-type integral degenerates to the elementary ∫_0^z x^(a−1) dx = z^a / a, and Γ(a+1) = a·Γ(a) turns the constant into exactly the Gamma (a+1, r) normalisation. No Beta function, no special-function machinery: the identity holds for every real a > 0 by completing the constant.

Main results

  • ErlangSum.gammaMeasure_conv_expMeasure — gammaMeasure a r ∗ expMeasure r = gammaMeasure (a+1) r for a, r > 0.
  • ErlangSum.map_sum_iidExp — for iid Exp(r) variables indexed by a nonempty finset s, the law of ∑ i ∈ s, X i is gammaMeasure s.card r.
  • sum_iidExp_law_gammaMeasure — the textbook form: the sum of all n ≥ 1 coordinates has law Erlang(n, r) = gammaMeasure n r.

References

  • Y. F. Saporito, Stochastic Processes [Saporito], Theorem 3.3.8

Tags

Erlang distribution, Gamma convolution, exponential waiting times, Poisson process arrival time, sum of exponentials, MSC 60E05, MSC 60G55

Import neighbourhood

Above: what it imports. Below: what imports it.

Corpus entries

pp-thm-3.3.8 · poisson_processes.json · full statement
Sum of n Exponentials is Erlang(n, λ)

The n-th arrival time of a Poisson(rate) process — the sum of n iid Exp(rate) interarrival times — has the Erlang(n, rate) = Gamma(n, rate) distribution. Proved from the densities up via the Gamma convolution identity (absent from Mathlib).

Declarations 6

theoremMathFin.ErlangSum.gammaPDF_mul_exponentialPDF_sub_of_ne_zerosource
∀ {a r : ℝ}, 0 < a → 0 < r → ∀ {z x : ℝ}, x ≠ 0 → gammaPDF a r x * exponentialPDF r (z - x) = ENNReal.ofReal ((Set.Ioc 0 z).indicator (fun t => r ^ (a + 1) / Real.Gamma a * Real.exp (-(r * z)) * t ^ (a - 1)) x)

Pointwise (away from x = 0): the product of the Gamma(a,r) density at x and the Exp(r) density at z − x collapses, after the exponentials merge, to a constant multiple of x^(a−1) supported on (0, z].

theoremMathFin.ErlangSum.setIntegral_rpow_sub_one_Iocsource
∀ {a : ℝ}, 0 < a → ∀ {z : ℝ}, 0 ≤ z → ∫ (x : ℝ) in Set.Ioc 0 z, x ^ (a - 1) = z ^ a / a

The elementary Beta-degenerate integral: ∫_{(0,z]} x^(a−1) dx = z^a / a.

theoremMathFin.ErlangSum.lintegral_gammaPDF_mul_exponentialPDFsource
∀ {a r : ℝ}, 0 < a → 0 < r → ∀ (z : ℝ), ∫⁻ (x : ℝ), gammaPDF a r x * exponentialPDF r (z - x) = gammaPDF (a + 1) r z

Density convolution identity. For a, r > 0 and every z, ∫ gammaPDF a r x · exponentialPDF r (z−x) dx = gammaPDF (a+1) r z.

theoremMathFin.ErlangSum.gammaMeasure_conv_expMeasuresource
∀ {a r : ℝ}, 0 < a → 0 < r → (gammaMeasure a r).conv (expMeasure r) = gammaMeasure (a + 1) r

Gamma–exponential convolution: for a, r > 0, gammaMeasure a r ∗ expMeasure r = gammaMeasure (a + 1) r.

This identity (and any Gamma convolution) is absent from Mathlib; it is the measure-level packaging of lintegral_gammaPDF_mul_exponentialPDF via Tonelli and translation invariance of Lebesgue measure.

used by 1: map_sum_iidExp
theoremMathFin.ErlangSum.map_sum_iidExpsource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} [IsProbabilityMeasure μ] {r : ℝ}, 0 < r → ∀ {ι : Type u_2} {X : ι → Ω → ℝ}, (∀ (i : ι), Measurable (X i)) → (∀ (i : ι), Measure.map (X i) μ = expMeasure r) → iIndepFun X μ → ∀ (s : Finset ι), s.Nonempty → Measure.map (∑ i ∈ s, X i) μ = gammaMeasure (↑s.card) r

Erlang from iid exponentials, finset form. If the X i are iid Exp(r) and s is a nonempty finset (over any index type — Fin n for the textbook statement, ℕ for the arrival times of a Poisson process), the law of ∑ i ∈ s, X i is gammaMeasure s.card r. Induction on s: the base case is expMeasure = gammaMeasure 1 (definitional), the step is gammaMeasure_conv_expMeasure via IndepFun.map_add_eq_map_conv_map.

theoremMathFin.ErlangSum.sum_iidExp_law_gammaMeasuresource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} [IsProbabilityMeasure μ] {r : ℝ}, 0 < r → ∀ {n : ℕ}, n ≠ 0 → ∀ {X : Fin n → Ω → ℝ}, (∀ (i : Fin n), Measurable (X i)) → (∀ (i : Fin n), Measure.map (X i) μ = expMeasure r) → iIndepFun X μ → Measure.map (fun ω => ∑ i, X i ω) μ = gammaMeasure (↑n) r

Theorem 3.3.8 (sum of n iid exponentials is Erlang). The n-th arrival time of a Poisson(r) process — the sum of n ≥ 1 iid Exp(r) interarrival times — has the Erlang(n, r) = gammaMeasure n r law. Proved from the densities up via the Gamma convolution identity; no part of the conclusion is assumed.