# mathlib3documentation

probability.integration

# Integration in Probability Theory #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

Integration results for independent random variables. Specifically, for two independent random variables X and Y over the extended non-negative reals, E[X * Y] = E[X] * E[Y], and similar results.

## Implementation notes #

Many lemmas in this file take two arguments of the same typeclass. It is worth remembering that lean will always pick the later typeclass in this situation, and does not care whether the arguments are [], {}, or (). All of these use the measurable_space M2 to define μ:

example {M1 : measurable_space Ω} [M2 : measurable_space Ω] {μ : measure Ω} : sorry := sorry
example [M1 : measurable_space Ω] {M2 : measurable_space Ω} {μ : measure Ω} : sorry := sorry

theorem probability_theory.lintegral_mul_indicator_eq_lintegral_mul_lintegral_indicator {Ω : Type u_1} {f : Ω ennreal} {Mf mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} (hMf : Mf mΩ) (c : ennreal) {T : set Ω} (h_meas_T : measurable_set T) (h_ind : probability_theory.indep_sets {s : set Ω | {T} μ) (h_meas_f : measurable f) :
∫⁻ (ω : Ω), f ω * T.indicator (λ (_x : Ω), c) ω μ = ∫⁻ (ω : Ω), f ω μ * ∫⁻ (ω : Ω), T.indicator (λ (_x : Ω), c) ω μ

If a random variable f in ℝ≥0∞ is independent of an event T, then if you restrict the random variable to T, then E[f * indicator T c 0]=E[f] * E[indicator T c 0]. It is useful for lintegral_mul_eq_lintegral_mul_lintegral_of_independent_measurable_space.

theorem probability_theory.lintegral_mul_eq_lintegral_mul_lintegral_of_independent_measurable_space {Ω : Type u_1} {f g : Ω ennreal} {Mf Mg mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} (hMf : Mf mΩ) (hMg : Mg mΩ) (h_ind : μ) (h_meas_f : measurable f) (h_meas_g : measurable g) :
∫⁻ (ω : Ω), f ω * g ω μ = ∫⁻ (ω : Ω), f ω μ * ∫⁻ (ω : Ω), g ω μ

If f and g are independent random variables with values in ℝ≥0∞, then E[f * g] = E[f] * E[g]. However, instead of directly using the independence of the random variables, it uses the independence of measurable spaces for the domains of f and g. This is similar to the sigma-algebra approach to independence. See lintegral_mul_eq_lintegral_mul_lintegral_of_independent_fn for a more common variant of the product of independent variables.

theorem probability_theory.lintegral_mul_eq_lintegral_mul_lintegral_of_indep_fun {Ω : Type u_1} {mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} {f g : Ω ennreal} (h_meas_f : measurable f) (h_meas_g : measurable g) (h_indep_fun : μ) :
∫⁻ (ω : Ω), (f * g) ω μ = ∫⁻ (ω : Ω), f ω μ * ∫⁻ (ω : Ω), g ω μ

If f and g are independent random variables with values in ℝ≥0∞, then E[f * g] = E[f] * E[g].

theorem probability_theory.lintegral_mul_eq_lintegral_mul_lintegral_of_indep_fun' {Ω : Type u_1} {mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} {f g : Ω ennreal} (h_meas_f : μ) (h_meas_g : μ) (h_indep_fun : μ) :
∫⁻ (ω : Ω), (f * g) ω μ = ∫⁻ (ω : Ω), f ω μ * ∫⁻ (ω : Ω), g ω μ

If f and g with values in ℝ≥0∞ are independent and almost everywhere measurable, then E[f * g] = E[f] * E[g] (slightly generalizing lintegral_mul_eq_lintegral_mul_lintegral_of_indep_fun).

theorem probability_theory.lintegral_mul_eq_lintegral_mul_lintegral_of_indep_fun'' {Ω : Type u_1} {mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} {f g : Ω ennreal} (h_meas_f : μ) (h_meas_g : μ) (h_indep_fun : μ) :
∫⁻ (ω : Ω), f ω * g ω μ = ∫⁻ (ω : Ω), f ω μ * ∫⁻ (ω : Ω), g ω μ
theorem probability_theory.indep_fun.integrable_mul {Ω : Type u_1} {mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} {β : Type u_2} {X Y : Ω β} [borel_space β] (hXY : μ) (hX : μ) (hY : μ) :
μ

The product of two independent, integrable, real_valued random variables is integrable.

theorem probability_theory.indep_fun.integrable_left_of_integrable_mul {Ω : Type u_1} {mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} {β : Type u_2} {X Y : Ω β} [borel_space β] (hXY : μ) (h'XY : μ) (h'Y : ¬Y =ᵐ[μ] 0) :

If the product of two independent real_valued random variables is integrable and the second one is not almost everywhere zero, then the first one is integrable.

theorem probability_theory.indep_fun.integrable_right_of_integrable_mul {Ω : Type u_1} {mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} {β : Type u_2} {X Y : Ω β} [borel_space β] (hXY : μ) (h'XY : μ) (h'X : ¬X =ᵐ[μ] 0) :

If the product of two independent real_valued random variables is integrable and the first one is not almost everywhere zero, then the second one is integrable.

theorem probability_theory.indep_fun.integral_mul_of_nonneg {Ω : Type u_1} {mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} {X Y : Ω } (hXY : μ) (hXp : 0 X) (hYp : 0 Y) (hXm : μ) (hYm : μ) :
(X * Y) =

The (Bochner) integral of the product of two independent, nonnegative random variables is the product of their integrals. The proof is just plumbing around lintegral_mul_eq_lintegral_mul_lintegral_of_indep_fun'.

theorem probability_theory.indep_fun.integral_mul_of_integrable {Ω : Type u_1} {mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} {X Y : Ω } (hXY : μ) (hX : μ) (hY : μ) :
(X * Y) =

The (Bochner) integral of the product of two independent, integrable random variables is the product of their integrals. The proof is pedestrian decomposition into their positive and negative parts in order to apply indep_fun.integral_mul_of_nonneg four times.

theorem probability_theory.indep_fun.integral_mul {Ω : Type u_1} {mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} {X Y : Ω } (hXY : μ)  :
(X * Y) =

The (Bochner) integral of the product of two independent random variables is the product of their integrals.

theorem probability_theory.indep_fun.integral_mul' {Ω : Type u_1} {mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} {X Y : Ω } (hXY : μ)  :
(ω : Ω), X ω * Y ω μ =
theorem probability_theory.indep_fun_iff_integral_comp_mul {Ω : Type u_1} {mΩ : measurable_space Ω} {μ : measure_theory.measure Ω} {β : Type u_2} {β' : Type u_3} {mβ : measurable_space β} {mβ' : measurable_space β'} {f : Ω β} {g : Ω β'} {hfm : measurable f} {hgm : measurable g} :
{φ : β } {ψ : β' }, μ μ f * ψ g) = f) * g)

Independence of functions f and g into arbitrary types is characterized by the relation E[(φ ∘ f) * (ψ ∘ g)] = E[φ ∘ f] * E[ψ ∘ g] for all measurable φ and ψ with values in ℝ satisfying appropriate integrability conditions.