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.SetBernoulli

20 declarations. Mathlib docs · Source

Product of bernoulli distributions on a set

This file defines the product of bernoulli distributions on a set as a measure on sets. For a set u : Set ι and p between 0 and 1, this is the measure on Set ι such that each i ∈ u belongs to the random set with probability p, and each i ∉ u doesn't belong to it.

Notation

setBer(u, p) is the product of p-Bernoulli distributions on u.

TODO

It is painful to convert from unitInterval to ENNReal. Should we introduce a coercion or explicit operation (like unitInterval.toNNReal, note the lack of dot notation!)?

Bernoulli random variables

def ProbabilityTheory.setBernoulli E1 #

{ι : Type u_1} → Set ι → ↑unitInterval → MeasureTheory.Measure (Set ι)

The product of bernoulli distributions with parameter p on the set u : Set V is the measure on Set V such that each element of u is taken with probability p, and the elements outside of u are never taken.

def ProbabilityTheory.«termSetBer(_,_)» E1 #

Lean.ParserDescr

The product of bernoulli distributions with parameter p on the set u : Set V is the measure on Set V such that each element of u is taken with probability p, and the elements outside of u are never taken.

instance ProbabilityTheory.instIsProbabilityMeasureSetSetBernoulli E0 #

∀ {ι : Type u_1} {u : Set ι} {p : ↑unitInterval},
  MeasureTheory.IsProbabilityMeasure (ProbabilityTheory.setBernoulli u p)

theorem ProbabilityTheory.setBernoulli_eq_map E1 #

∀ {ι : Type u_1} (u : Set ι) (p : ↑unitInterval),
  ProbabilityTheory.setBernoulli u p =
    MeasureTheory.Measure.map (fun p ↦ {i | p i})
      (MeasureTheory.Measure.infinitePi fun i ↦ ProbabilityTheory.bernoulliMeasure (i ∈ u) False p)

theorem ProbabilityTheory.setBernoulli_apply E0 #

∀ {ι : Type u_1} {u : Set ι} {p : ↑unitInterval} (S : Set (Set ι)),
  (ProbabilityTheory.setBernoulli u p) S =
    (MeasureTheory.Measure.infinitePi fun i ↦ ProbabilityTheory.bernoulliMeasure (i ∈ u) False p)
      ((fun t i ↦ i ∈ t) '' S)

theorem ProbabilityTheory.setBernoulli_apply' E1 #

∀ {ι : Type u_1} {u : Set ι} {p : ↑unitInterval} (S : Set (Set ι)),
  (ProbabilityTheory.setBernoulli u p) S =
    (MeasureTheory.Measure.infinitePi fun i ↦ ProbabilityTheory.bernoulliMeasure (i ∈ u) False p)
      ((fun p ↦ {i | p i}) ⁻¹' S)

theorem ProbabilityTheory.setBernoulli_zero E0 #

∀ {ι : Type u_1} (u : Set ι), ProbabilityTheory.setBernoulli u 0 = MeasureTheory.Measure.dirac ∅

theorem ProbabilityTheory.setBernoulli_one E0 #

∀ {ι : Type u_1} (u : Set ι), ProbabilityTheory.setBernoulli u 1 = MeasureTheory.Measure.dirac u

theorem ProbabilityTheory.setBernoulli_ae_subset E1 #

∀ {ι : Type u_1} {u : Set ι} {p : ↑unitInterval} [Countable ι],
  ∀ᵐ (s : Set ι) ∂ProbabilityTheory.setBernoulli u p, s ⊆ u

theorem ProbabilityTheory.setBernoulli_singleton_of_not_subset E0 #

∀ {ι : Type u_1} {u : Set ι} [Countable ι] {s : Set ι} (p : ↑unitInterval),
  ¬s ⊆ u → (ProbabilityTheory.setBernoulli u p) {s} = 0

theorem ProbabilityTheory.setBernoulli_apply_eq_apply_subsets E1 #

∀ {ι : Type u_1} [Countable ι] (u : Set ι) (p : ↑unitInterval) (S : Set (Set ι)),
  (ProbabilityTheory.setBernoulli u p) S = (ProbabilityTheory.setBernoulli u p) {s | s ∈ S ∧ s ⊆ u}

setBer(u, p) only gives mass to families of sets contained in u.

theorem ProbabilityTheory.map_ncard_setBernoulli_apply E0 #

∀ {ι : Type u_1} [Countable ι] (u : Set ι) (p : ↑unitInterval) (s : Set ℕ),
  (MeasureTheory.Measure.map Set.ncard (ProbabilityTheory.setBernoulli u p)) s =
    (ProbabilityTheory.setBernoulli u p) {t | t ⊆ u ∧ t.ncard ∈ s}

theorem ProbabilityTheory.setBernoulli_singleton E0 #

∀ {ι : Type u_1} {s u : Set ι} (p : ↑unitInterval) [Countable ι],
  s ⊆ u →
    u.Finite →
      (ProbabilityTheory.setBernoulli u p) {s} =
        ↑(unitInterval.toNNReal p) ^ s.ncard * ↑(unitInterval.toNNReal (unitInterval.symm p)) ^ (u \ s).ncard

theorem ProbabilityTheory.setBernoulli_real_singleton E0 #

∀ {ι : Type u_1} {s u : Set ι} [Countable ι] (p : ↑unitInterval),
  s ⊆ u → u.Finite → (ProbabilityTheory.setBernoulli u p).real {s} = ↑p ^ s.ncard * (1 - ↑p) ^ (u \ s).ncard

theorem ProbabilityTheory.map_ncard_setBernoulli_real_singleton E0 #

∀ {ι : Type u_1} [Countable ι] {u : Set ι},
  u.Finite →
    ∀ (p : ↑unitInterval) (k : ℕ),
      (MeasureTheory.Measure.map Set.ncard (ProbabilityTheory.setBernoulli u p)).real {k} =
        ↑(u.ncard.choose k) * ↑p ^ k * (1 - ↑p) ^ (u.ncard - k)

theorem ProbabilityTheory.map_ncard_setBernoulli_singleton E0 #

∀ {ι : Type u_1} [Countable ι] {u : Set ι},
  u.Finite →
    ∀ (p : ↑unitInterval) (k : ℕ),
      (MeasureTheory.Measure.map Set.ncard (ProbabilityTheory.setBernoulli u p)) {k} =
        ENNReal.ofReal (↑(u.ncard.choose k) * ↑p ^ k * (1 - ↑p) ^ (u.ncard - k))

theorem ProbabilityTheory.setBernoulli_empty E0 #

∀ {ι : Type u_1} {p : ↑unitInterval} [Countable ι], ProbabilityTheory.setBernoulli ∅ p = MeasureTheory.Measure.dirac ∅

abbrev ProbabilityTheory.IsSetBernoulli E1 #

{ι : Type u_1} →
  {Ω : Type u_2} → {m : MeasurableSpace Ω} → (Ω → Set ι) → Set ι → ↑unitInterval → MeasureTheory.Measure Ω → Prop

A random variable X : Ω → Set ι is p-bernoulli on a set u : Set ι if its distribution is the product over u of p-bernoulli distributions.

theorem ProbabilityTheory.isSetBernoulli_congr E1 #

∀ {ι : Type u_1} {Ω : Type u_2} {m : MeasurableSpace Ω} {X Y : Ω → Set ι} {u : Set ι} {p : ↑unitInterval}
  {P : MeasureTheory.Measure Ω},
  X =ᵐ[P] Y → (ProbabilityTheory.IsSetBernoulli X u p P ↔ ProbabilityTheory.IsSetBernoulli Y u p P)

theorem ProbabilityTheory.IsSetBernoulli.ae_subset E1 #

∀ {ι : Type u_1} {Ω : Type u_2} {m : MeasurableSpace Ω} {X : Ω → Set ι} {u : Set ι} {p : ↑unitInterval}
  {P : MeasureTheory.Measure Ω} [Countable ι], ProbabilityTheory.IsSetBernoulli X u p P → ∀ᵐ (ω : Ω) ∂P, X ω ⊆ u