# mathlibdocumentation

probability.integration

# Integration in Probability Theory #

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) :
∫⁻ (a : α), f a * T.indicator (λ (_x : α), c) a μ = ∫⁻ (a : α), f a μ * ∫⁻ (a : α), T.indicator (λ (_x : α), c) a μ

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) :
∫⁻ (a : α), f a * g a μ = ∫⁻ (a : α), f a μ * ∫⁻ (a : α), g a μ

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 : μ) :
∫⁻ (a : α), (f * g) a μ = ∫⁻ (a : α), f a μ * ∫⁻ (a : α), g a μ

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 : μ) :
∫⁻ (a : α), (f * g) a μ = ∫⁻ (a : α), f a μ * ∫⁻ (a : α), g a μ

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.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.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_of_integrable' {α : Type u_1} {mα : measurable_space α} {μ : measure_theory.measure α} {X Y : α → } (hXY : μ) (hX : μ) (hY : μ) :
(x : α), X x * Y x μ =
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.