Documentation

TauCeti.Probability.GeneratingFunction

Probability-generating functions #

This file defines the probability-generating function of a natural-number-valued random variable and establishes its basic measure-theoretic API. The central results relate it to Mathlib's moment-generating function and show that it turns sums of independent random variables into products. The file then identifies the generating function of a finite measure on with the sum of the power series carrying its singleton masses, so that the generating function is analytic on (-1, 1) and its Taylor coefficients at the origin recover those masses; consequently a law on is determined by its generating function near 0. Finally it computes the generating functions of the standard discrete families: Bernoulli, binomial, Poisson, and geometric, the last one on its exact integrability domain.

These results implement the definition, the generic API, the coefficient-recovery and uniqueness statements, and the distribution-specific formulas of the probability-generating-function target in TauCetiRoadmap/StandardDistributions/README.md, Layer 1.

The Poisson series calculation follows the proof pattern of Mathlib's ProbabilityTheory.charFun_map_cast_poissonMeasure: both factor the Poisson weights out of the exponential power series. The Bernoulli, binomial, and geometric calculations use Mathlib's corresponding measure-integral formulas directly.

Main declarations #

noncomputable def TauCeti.Probability.pgf {Ω : Type u_1} [MeasurableSpace Ω] (X : Ω) (μ : MeasureTheory.Measure Ω) (t : ) :

The probability-generating function of a natural-number-valued random variable X with respect to a measure μ.

Equations
Instances For
    theorem TauCeti.Probability.pgf_def {Ω : Type u_1} [MeasurableSpace Ω] (X : Ω) (μ : MeasureTheory.Measure Ω) (t : ) :
    pgf X μ t = (ω : Ω), t ^ X ω μ

    The defining integral formula for the probability-generating function. This is the canonical way to unfold pgf, which is otherwise sealed.

    theorem TauCeti.Probability.pgf_congr_ae {Ω : Type u_1} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} {X Y : Ω} (hXY : X =ᵐ[μ] Y) :
    pgf X μ = pgf Y μ

    The probability-generating function is unchanged by replacing the random variable almost everywhere.

    @[simp]
    theorem TauCeti.Probability.pgf_zero_measure {Ω : Type u_1} [MeasurableSpace Ω] (X : Ω) :
    pgf X 0 = 0

    The probability-generating function of the zero measure vanishes.

    @[simp]
    theorem TauCeti.Probability.pgf_one {Ω : Type u_1} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} (X : Ω) :
    pgf X μ 1 = μ.real Set.univ

    Evaluation of a probability-generating function at one gives the total mass.

    @[simp]
    theorem TauCeti.Probability.pgf_const {Ω : Type u_1} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} (n : ) (t : ) :
    pgf (fun (x : Ω) => n) μ t = μ.real Set.univ * t ^ n

    A constant natural-number-valued random variable has the expected monomial generating function.

    theorem TauCeti.Probability.pgf_map {Ω : Type u_1} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} {X : Ω} (hX : AEMeasurable X μ) (t : ) :

    The probability-generating function can be computed on the law of the random variable.

    theorem TauCeti.Probability.HasLaw.pgf_eq {Ω : Type u_1} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} {X : Ω} {ν : MeasureTheory.Measure } (hX : ProbabilityTheory.HasLaw X ν μ) (t : ) :
    pgf X μ t = pgf id ν t

    Random variables with a given law have the same probability-generating function as that law.

    theorem TauCeti.Probability.pgf_exp {Ω : Type u_1} [MeasurableSpace Ω] (X : Ω) (μ : MeasureTheory.Measure Ω) (t : ) :
    pgf X μ (Real.exp t) = ProbabilityTheory.mgf (fun (ω : Ω) => (X ω)) μ t

    Evaluating the probability-generating function at exp t recovers the moment-generating function of the real-valued cast of the random variable.

    theorem TauCeti.Probability.integrable_pow_of_abs_le_one {Ω : Type u_1} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure μ] {X : Ω} (hX : AEMeasurable X μ) {t : } (ht : |t| 1) :
    MeasureTheory.Integrable (fun (ω : Ω) => t ^ X ω) μ

    For a finite measure, the integrand of a probability-generating function is integrable on [-1, 1].

    theorem TauCeti.Probability.IndepFun.pgf_add {Ω : Type u_1} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} {X Y : Ω} (hXY : ProbabilityTheory.IndepFun X Y μ) (t : ) (hXt : MeasureTheory.Integrable (fun (ω : Ω) => t ^ X ω) μ) (hYt : MeasureTheory.Integrable (fun (ω : Ω) => t ^ Y ω) μ) :
    pgf (X + Y) μ t = pgf X μ t * pgf Y μ t

    The probability-generating function of a sum of two independent natural-number-valued random variables is the product of their generating functions whenever both factor integrands are integrable.

    The integrability hypotheses deliberately restrict the public statement so that it expresses a product of genuine expectations. Mathlib's totalized integral gives the same equality without these hypotheses, but in the non-integrable cases it is merely an artifact of totalization.

    theorem TauCeti.Probability.IndepFun.pgf_add_of_abs_le_one {Ω : Type u_1} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure μ] {X Y : Ω} (hXY : ProbabilityTheory.IndepFun X Y μ) (hX : AEMeasurable X μ) (hY : AEMeasurable Y μ) {t : } (ht : |t| 1) :
    pgf (X + Y) μ t = pgf X μ t * pgf Y μ t

    Under a finite measure, on [-1, 1] the probability-generating function of a sum of two independent natural-number-valued random variables is the product of their generating functions.

    theorem MeasureTheory.Measure.pgf_conv (μ ν : Measure ) [SFinite μ] [SFinite ν] (t : ) ( : Integrable (fun (k : ) => t ^ k) μ) ( : Integrable (fun (k : ) => t ^ k) ν) :

    The probability-generating function sends convolution to multiplication whenever both factor integrands are integrable.

    On [-1, 1], the probability-generating function sends convolution of finite measures to multiplication.

    theorem TauCeti.Probability.iIndepFun.pgf_sum {Ω : Type u_1} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} (h_indep : ProbabilityTheory.iIndepFun X μ) (s : Finset ι) (t : ) (h_int : is, MeasureTheory.Integrable (fun (ω : Ω) => t ^ X i ω) μ) :
    pgf (∑ is, X i) μ t = is, pgf (X i) μ t

    A probability-generating function turns a finite sum of independent random variables into the product of their generating functions whenever every factor integrand is integrable.

    theorem TauCeti.Probability.iIndepFun.pgf_sum_of_abs_le_one {Ω : Type u_1} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} (h_indep : ProbabilityTheory.iIndepFun X μ) (s : Finset ι) (h_meas : is, AEMeasurable (X i) μ) {t : } (ht : |t| 1) :
    pgf (∑ is, X i) μ t = is, pgf (X i) μ t

    On [-1, 1], a probability-generating function turns a finite sum of independent random variables into the product of their generating functions.

    Coefficient recovery and uniqueness #

    A finite measure on is the weighted sum of Dirac masses ∑ ν {n} • δ n, so its generating function is the sum of the power series ∑ ν.real {n} * t ^ n. The masses are bounded by the total mass, so that series converges on the whole open unit ball and the generating function is analytic there. Reading its Taylor coefficients at the origin returns the masses, and hence a finite measure on , in particular a probability measure, is determined by its generating function near 0.

    theorem TauCeti.Probability.hasSum_pgf (ν : MeasureTheory.Measure ) [MeasureTheory.IsFiniteMeasure ν] {t : } (ht : |t| 1) :
    HasSum (fun (n : ) => ν.real {n} * t ^ n) (pgf id ν t)

    Under a finite measure on , the probability-generating function is the sum of the power series whose coefficients are the singleton masses, on [-1, 1].

    The power-series expansion of the probability-generating function of a finite measure on on [-1, 1].

    The probability-generating function of a finite measure on has, at the origin, the formal power series whose coefficients are the singleton masses, and that series converges on the open unit ball.

    The probability-generating function of a finite measure on is analytic on (-1, 1).

    @[simp]

    The Taylor coefficients at the origin of the probability-generating function of a finite measure on are its singleton masses.

    @[simp]

    Evaluating at the origin the probability-generating function of a finite measure on gives the mass of {0}. This is the n = 0 case of iteratedDeriv_pgf_zero, which simp normalises away from iteratedDeriv.

    @[simp]

    The derivative at the origin of the probability-generating function of a finite measure on is the mass of {1}. This is the n = 1 case of iteratedDeriv_pgf_zero, which simp normalises away from iteratedDeriv.

    A finite measure on , in particular a probability measure, is determined by the germ at the origin of its probability-generating function.

    A finite measure on , in particular a probability measure, is determined by its probability-generating function on (-1, 1).

    Two natural-number-valued random variables whose probability-generating functions agree near the origin are identically distributed.

    Two natural-number-valued random variables whose probability-generating functions agree on (-1, 1) are identically distributed.

    The probability-generating function of a Bernoulli distribution.

    theorem TauCeti.Probability.pgf_binomial (n : ) (p : unitInterval) (t : ) :
    pgf id (ProbabilityTheory.binomial n p) t = (1 - p + p * t) ^ n

    The probability-generating function of a binomial distribution.

    The probability-generating function of a Poisson distribution.

    @[simp]

    At the zero parameter, Mathlib's geometric distribution is a Dirac mass at zero, so its probability-generating function is identically one.

    For a nonzero success probability, the geometric probability-generating-function integrand is integrable exactly on the open interval determined by the geometric-series ratio.

    theorem TauCeti.Probability.pgf_geometricMeasure {p : unitInterval} (hp : p 0) {t : } (ht : |(1 - p) * t| < 1) :
    pgf id (ProbabilityTheory.geometricMeasure p) t = p / (1 - (1 - p) * t)

    The probability-generating function of a geometric distribution with nonzero parameter, on its exact integrability domain. The boundary case p = 1, whose law is a Dirac mass at zero, is included.