The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V20. Probability

Mathlib.Probability.Distributions.Geometric

13 declarations. Mathlib docs · Source

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 * p.

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

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

Main definition

  • geometricMeasure p: a geometric measure on ℕ, parametrized by its success probability p.

Implementation notes

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

def ProbabilityTheory.geometricMeasure E3 #

↑unitInterval → MeasureTheory.Measure ℕ

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

theorem ProbabilityTheory.geometricMeasure_eq E0 #

∀ {p : ↑unitInterval},
  p ≠ 0 →
    ProbabilityTheory.geometricMeasure p =
      MeasureTheory.Measure.sum fun n ↦ ENNReal.ofReal ((1 - ↑p) ^ n * ↑p) • MeasureTheory.Measure.dirac n

theorem ProbabilityTheory.geometricMeasure_nonneg E1 #

∀ (p : ↑unitInterval) (n : ℕ), 0 ≤ (1 - ↑p) ^ n * ↑p

The positivity 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 E1 #

∀ {p : ↑unitInterval}, p ≠ 0 → p ≠ 1 → ∀ (n : ℕ), 0 < (1 - ↑p) ^ n * ↑p

theorem ProbabilityTheory.geometricMeasure_singleton E1 #

∀ {p : ↑unitInterval},
  p ≠ 0 → ∀ (n : ℕ), (ProbabilityTheory.geometricMeasure p) {n} = ENNReal.ofReal ((1 - ↑p) ^ n * ↑p)

theorem ProbabilityTheory.geometricMeasure_real_singleton E1 #

∀ {p : ↑unitInterval}, p ≠ 0 → ∀ (n : ℕ), (ProbabilityTheory.geometricMeasure p).real {n} = (1 - ↑p) ^ n * ↑p

theorem ProbabilityTheory.geometricMeasure_real_singleton_pos E1 #

∀ {p : ↑unitInterval}, p ≠ 0 → p ≠ 1 → ∀ (n : ℕ), 0 < (ProbabilityTheory.geometricMeasure p).real {n}

theorem ProbabilityTheory.hasSum_one_geometricMeasure E1 #

∀ {p : ↑unitInterval}, p ≠ 0 → HasSum (fun n ↦ (1 - ↑p) ^ n * ↑p) 1

instance ProbabilityTheory.isProbabilityMeasure_geometricMeasure E0 #

∀ {p : ↑unitInterval}, MeasureTheory.IsProbabilityMeasure (ProbabilityTheory.geometricMeasure p)

theorem ProbabilityTheory.integrable_geometricMeasure_iff E0 #

∀ {p : ↑unitInterval} {E : Type u_1} [inst : NormedAddCommGroup E] {f : ℕ → E},
  p ≠ 0 →
    (MeasureTheory.Integrable f (ProbabilityTheory.geometricMeasure p) ↔ Summable fun n ↦ (1 - ↑p) ^ n * ↑p * ‖f n‖)

theorem ProbabilityTheory.hasSum_integral_geometricMeasure E1 #

∀ {p : ↑unitInterval} {E : Type u_1} [inst : NormedAddCommGroup E] {f : ℕ → E} [inst_1 : NormedSpace ℝ E]
  [CompleteSpace E],
  p ≠ 0 →
    MeasureTheory.Integrable f (ProbabilityTheory.geometricMeasure p) →
      HasSum (fun n ↦ ((1 - ↑p) ^ n * ↑p) • f n) (∫ (n : ℕ), f n ∂ProbabilityTheory.geometricMeasure p)

theorem ProbabilityTheory.integral_geometricMeasure' E1 #

∀ {p : ↑unitInterval} {E : Type u_1} [inst : NormedAddCommGroup E] {f : ℕ → E} [inst_1 : NormedSpace ℝ E]
  [CompleteSpace E],
  p ≠ 0 →
    MeasureTheory.Integrable f (ProbabilityTheory.geometricMeasure p) →
      ∫ (n : ℕ), f n ∂ProbabilityTheory.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 E1 #

∀ {p : ↑unitInterval} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] [FiniteDimensional ℝ E],
  p ≠ 0 → ∀ (f : ℕ → E), ∫ (n : ℕ), f n ∂ProbabilityTheory.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.