Documentation

Mathlib.Probability.Distributions.Geometric

Geometric distributions #

We define the geometric distributions over natural numbers. For 0 < p ≤ 1, geometricMeasure p is the measure which to {n} associates (1 - p) ^ n * n.

As the parameter p needs to lie between 0 and 1, we define geometricMeasure p with p : unitInterval.

Imagine a certain experience which has success probability p. If you repeat this experience infintely many times and independently, the number of failures before the first success follows a geometric distribution with parameter p.

Main definition #

Implementation note #

To avoid having to carry around a hypothesis p ≠ 0, we define geometricMeasure 0 := Measure.dirac 0. That way IsProbabilityMeasure (geometricMeasure p) can be automatically inferred.

Tags #

geometric distribution

The geometric measure with success probability p as a measure over .

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem ProbabilityTheory.geometricMeasure_nonneg (p : unitInterval) (n : ) :
    0 (1 - p) ^ n * p

    The positivty tactic does not work for this goal. Use this lemma to rewrite (ENNReal.ofReal ((1 - p) ^ n * p)).toReal = (1 - p) ^ n * p.

    theorem ProbabilityTheory.geometricMeasure_pos {p : unitInterval} (h1 : p 0) (h2 : p 1) (n : ) :
    0 < (1 - p) ^ n * p
    theorem ProbabilityTheory.geometricMeasure_real_singleton {p : unitInterval} (hp : p 0) (n : ) :
    (geometricMeasure p).real {n} = (1 - p) ^ n * p
    theorem ProbabilityTheory.hasSum_one_geometricMeasure {p : unitInterval} (hp : p 0) :
    HasSum (fun (n : ) => (1 - p) ^ n * p) 1
    theorem ProbabilityTheory.integrable_geometricMeasure_iff {p : unitInterval} {E : Type u_1} [NormedAddCommGroup E] {f : E} (hp : p 0) :
    MeasureTheory.Integrable f (geometricMeasure p) Summable fun (n : ) => (1 - p) ^ n * p * f n
    theorem ProbabilityTheory.hasSum_integral_geometricMeasure {p : unitInterval} {E : Type u_1} [NormedAddCommGroup E] {f : E} [NormedSpace E] [CompleteSpace E] (hp : p 0) (hf : MeasureTheory.Integrable f (geometricMeasure p)) :
    HasSum (fun (n : ) => ((1 - p) ^ n * p) f n) ( (n : ), f n geometricMeasure p)
    theorem ProbabilityTheory.integral_geometricMeasure' {p : unitInterval} {E : Type u_1} [NormedAddCommGroup E] {f : E} [NormedSpace E] [CompleteSpace E] (hp : p 0) (hf : MeasureTheory.Integrable f (geometricMeasure p)) :
    (n : ), f n geometricMeasure p = ∑' (n : ), ((1 - p) ^ n * p) f n

    If a function is integrable with respect to geometricMeasure p, then its integral against this measure is given by its sum weighted by (1 - p) ^ n * p.

    See integral_geometricMeasure for a version where the codomain is finite-dimensional and does not require the integrability hypothesis.

    theorem ProbabilityTheory.integral_geometricMeasure {p : unitInterval} {E : Type u_1} [NormedAddCommGroup E] [NormedSpace E] [FiniteDimensional E] (hp : p 0) (f : E) :
    (n : ), f n geometricMeasure p = ∑' (n : ), ((1 - p) ^ n * p) f n

    The integral of a function taking values in a finite-dimensional space against geometricMeasure p is given by its sum weighted by (1 - p) ^ n * p. This version does not require integrability, as the integral exists if and only if the sum exists, and otherwise they are both defined to be zero.

    See integral_geometricMeasure' with a general codomain which assumes integrability.

    @[deprecated ProbabilityTheory.geometricMeasure (since := "2026-03-08")]
    noncomputable def ProbabilityTheory.geometricPMFReal (p : ) (n : ) :

    The pmf of the geometric distribution depending on its success probability.

    Equations
    Instances For
      @[deprecated ProbabilityTheory.hasSum_one_geometricMeasure (since := "2026-03-08")]
      theorem ProbabilityTheory.geometricPMFRealSum {p : } (hp_pos : 0 < p) (hp_le_one : p 1) :
      HasSum (fun (n : ) => geometricPMFReal p n) 1
      @[deprecated ProbabilityTheory.geometricMeasure_real_singleton_pos (since := "2026-03-08")]
      theorem ProbabilityTheory.geometricPMFReal_pos {p : } {n : } (hp_pos : 0 < p) (hp_lt_one : p < 1) :
      @[deprecated MeasureTheory.measureReal_nonneg (since := "2026-03-08")]
      theorem ProbabilityTheory.geometricPMFReal_nonneg {p : } {n : } (hp_pos : 0 < p) (hp_le_one : p 1) :
      @[deprecated ProbabilityTheory.geometricMeasure (since := "2026-03-08")]
      noncomputable def ProbabilityTheory.geometricPMF {p : } (hp_pos : 0 < p) (hp_le_one : p 1) :

      Geometric distribution with success probability p.

      Equations
      Instances For
        @[deprecated Measurable.of_discrete (since := "2026-03-08")]
        @[deprecated MeasureTheory.StronglyMeasurable.of_discrete (since := "2026-03-08")]