Mathlib.Probability.Distributions.Bernoulli
23 declarations. Mathlib docs · Source
Bernoulli distribution
We define the Bernoulli distribution over an arbitrary measurable space X. Given x y : X
and p : I (I is the unitInterval),
Ber(x, y, p) := toNNReal p • dirac x + toNNReal (σ p) • dirac y.
It is the measure which gives mass p to {x} and 1 - p to {y}.
Main definition
bernoulliMeasure x y p: The measureBer(x, y, p)which gives masspto{x}and1 - pto{y}.
Notation
Ber(x, y, p): notation forbernoulliMeasure x y p.
Tags
Bernoulli distribution
Bernoulli random variables
def ProbabilityTheory.bernoulliMeasure E3 #
{X : Type u_1} → [inst : MeasurableSpace X] → X → X → ↑unitInterval → MeasureTheory.Measure X
The Bernoulli distribution over an arbitrary measurable space X.
Given x y : X and p : I (I is the unitInterval),
it is the measure which gives mass p to {x} and 1 - p to {y}.
def ProbabilityTheory.«termBer(_,_,_)» E1 #
Lean.ParserDescr
The Bernoulli distribution over an arbitrary measurable space X.
Given x y : X and p : I (I is the unitInterval),
it is the measure which gives mass p to {x} and 1 - p to {y}.
theorem ProbabilityTheory.bernoulliMeasure_def E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] (x y : X) (p : ↑unitInterval),
ProbabilityTheory.bernoulliMeasure x y p =
unitInterval.toNNReal p • MeasureTheory.Measure.dirac x +
unitInterval.toNNReal (unitInterval.symm p) • MeasureTheory.Measure.dirac y
theorem ProbabilityTheory.bernoulliMeasure_zero E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] (x y : X),
ProbabilityTheory.bernoulliMeasure x y 0 = MeasureTheory.Measure.dirac y
theorem ProbabilityTheory.bernoulliMeasure_one E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] (x y : X),
ProbabilityTheory.bernoulliMeasure x y 1 = MeasureTheory.Measure.dirac x
theorem ProbabilityTheory.bernoulliMeasure_apply E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {x y : X} (p : ↑unitInterval) {s : Set X},
MeasurableSet s →
∀ [inst_1 : DecidablePred fun x ↦ x ∈ s],
(ProbabilityTheory.bernoulliMeasure x y p) s =
if x ∈ s then if y ∈ s then 1 else ↑(unitInterval.toNNReal p)
else if y ∈ s then ↑(unitInterval.toNNReal (unitInterval.symm p)) else 0
theorem ProbabilityTheory.bernoulliMeasure_real_apply E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {x y : X} (p : ↑unitInterval) {s : Set X},
MeasurableSet s →
∀ [inst_1 : DecidablePred fun x ↦ x ∈ s],
(ProbabilityTheory.bernoulliMeasure x y p).real s =
if x ∈ s then if y ∈ s then 1 else ↑(unitInterval.toNNReal p)
else if y ∈ s then ↑(unitInterval.toNNReal (unitInterval.symm p)) else 0
theorem ProbabilityTheory.bernoulliMeasure_apply_of_mem_of_mem E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {x y : X} (p : ↑unitInterval) {s : Set X},
MeasurableSet s → x ∈ s → y ∈ s → (ProbabilityTheory.bernoulliMeasure x y p) s = 1
theorem ProbabilityTheory.bernoulliMeasure_real_apply_of_mem_of_mem E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {x y : X} (p : ↑unitInterval) {s : Set X},
MeasurableSet s → x ∈ s → y ∈ s → (ProbabilityTheory.bernoulliMeasure x y p).real s = 1
theorem ProbabilityTheory.bernoulliMeasure_apply_of_mem_of_notMem E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {x y : X} (p : ↑unitInterval) {s : Set X},
MeasurableSet s → x ∈ s → y ∉ s → (ProbabilityTheory.bernoulliMeasure x y p) s = ↑(unitInterval.toNNReal p)
theorem ProbabilityTheory.bernoulliMeasure_real_apply_of_mem_of_notMem E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {x y : X} (p : ↑unitInterval) {s : Set X},
MeasurableSet s → x ∈ s → y ∉ s → (ProbabilityTheory.bernoulliMeasure x y p).real s = ↑p
theorem ProbabilityTheory.bernoulliMeasure_apply_of_notMem_of_mem E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {x y : X} (p : ↑unitInterval) {s : Set X},
MeasurableSet s →
x ∉ s → y ∈ s → (ProbabilityTheory.bernoulliMeasure x y p) s = ↑(unitInterval.toNNReal (unitInterval.symm p))
theorem ProbabilityTheory.bernoulliMeasure_real_apply_of_notMem_of_mem E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {x y : X} (p : ↑unitInterval) {s : Set X},
MeasurableSet s → x ∉ s → y ∈ s → (ProbabilityTheory.bernoulliMeasure x y p).real s = 1 - ↑p
theorem ProbabilityTheory.bernoulliMeasure_apply_of_notMem_of_notMem E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {x y : X} (p : ↑unitInterval) {s : Set X},
MeasurableSet s → x ∉ s → y ∉ s → (ProbabilityTheory.bernoulliMeasure x y p) s = 0
theorem ProbabilityTheory.bernoulliMeasure_real_apply_of_notMem_of_notMem E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {x y : X} (p : ↑unitInterval) {s : Set X},
MeasurableSet s → x ∉ s → y ∉ s → (ProbabilityTheory.bernoulliMeasure x y p).real s = 0
instance ProbabilityTheory.instIsProbabilityMeasureBernoulliMeasure E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {x y : X} {p : ↑unitInterval},
MeasureTheory.IsProbabilityMeasure (ProbabilityTheory.bernoulliMeasure x y p)
theorem ProbabilityTheory.bernoulliMeasure_self_eq_dirac E0 #
∀ {X : Type u_1} [inst : MeasurableSpace X] (x : X) (p : ↑unitInterval),
ProbabilityTheory.bernoulliMeasure x x p = MeasureTheory.Measure.dirac x
theorem ProbabilityTheory.map_bernoulliMeasure E0 #
∀ {X : Type u_1} {Y : Type u_2} [inst : MeasurableSpace X] [inst_1 : MeasurableSpace Y] [MeasurableSingletonClass X]
[MeasurableSingletonClass Y] (x y : X) (f : X → Y) (p : ↑unitInterval),
MeasureTheory.Measure.map f (ProbabilityTheory.bernoulliMeasure x y p) =
ProbabilityTheory.bernoulliMeasure (f x) (f y) p
theorem ProbabilityTheory.map_bernoulliMeasure' E0 #
∀ {X : Type u_1} {Y : Type u_2} [inst : MeasurableSpace X] [inst_1 : MeasurableSpace Y] (x y : X) {f : X → Y},
Measurable f →
∀ (p : ↑unitInterval),
MeasureTheory.Measure.map f (ProbabilityTheory.bernoulliMeasure x y p) =
ProbabilityTheory.bernoulliMeasure (f x) (f y) p
theorem ProbabilityTheory.integrable_bernoulliMeasure E1 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {E : Type u_3} [inst_1 : NormedAddCommGroup E] [MeasurableSingletonClass X]
(x y : X) (p : ↑unitInterval) (f : X → E), MeasureTheory.Integrable f (ProbabilityTheory.bernoulliMeasure x y p)
theorem ProbabilityTheory.integral_bernoulliMeasure E1 #
∀ {X : Type u_1} [inst : MeasurableSpace X] {E : Type u_3} [inst_1 : NormedAddCommGroup E] [inst_2 : NormedSpace ℝ E]
[CompleteSpace E] [MeasurableSingletonClass X] (x y : X) (p : ↑unitInterval) (f : X → E),
∫ (z : X), f z ∂ProbabilityTheory.bernoulliMeasure x y p = ↑p • f x + (1 - ↑p) • f y
theorem ProbabilityTheory.hasLaw_indicator_bernoulliMeasure E1 #
∀ {Ω : Type u_3} {mΩ : MeasurableSpace Ω} {P : MeasureTheory.Measure Ω} [inst : MeasureTheory.IsProbabilityMeasure P]
{M : Type u_4} [inst_1 : Zero M] [inst_2 : MeasurableSpace M] (c : M) {s : Set Ω},
MeasureTheory.NullMeasurableSet s P →
ProbabilityTheory.HasLaw (s.indicator fun x ↦ c) (ProbabilityTheory.bernoulliMeasure c 0 ⟨P.real s, ⋯⟩) P
The constant indicator of a set follows a Bernoulli distribution.
theorem ProbabilityTheory.hasLaw_indicator_one_bernoulliMeasure E1 #
∀ {Ω : Type u_3} {mΩ : MeasurableSpace Ω} {P : MeasureTheory.Measure Ω} [inst : MeasureTheory.IsProbabilityMeasure P]
{M : Type u_4} [inst_1 : Zero M] [inst_2 : One M] [inst_3 : MeasurableSpace M] {s : Set Ω},
MeasureTheory.NullMeasurableSet s P →
ProbabilityTheory.HasLaw (s.indicator 1) (ProbabilityTheory.bernoulliMeasure 1 0 ⟨P.real s, ⋯⟩) P
The constant indicator of a set follows a Bernoulli distribution.