Law of Total Expectation
Statement
Let be an integrable real-valued random variable and any random variable generating a sub--algebra . Then:
More precisely, for any sub--algebra :
This is the tower property (or law of iterated expectation): integrating out conditioning leaves the unconditional mean.
Visualization
Roll a fair six-sided die. Let = face value, .
| Event | Outcomes | contribution | ||
|---|---|---|---|---|
| (even) | ||||
| (odd) |
The conditional expectation is itself a random variable:
- (probability )
- (probability )
Averaging these over recovers .
Proof Sketch
- Definition of conditional expectation. is characterised as the unique -measurable integrable function satisfying for all .
- Take . Since , the defining property gives .
- Rewrite. .
The tower property for follows from the same argument restricted to sets in .
Connections
This is a special case of the iterated conditioning formula condExp_condExp_of_le in Mathlib. It generalises Bayes' TheoremBayes' TheoremReversing conditional probability to update beliefs from evidenceRead more → (which computes conditional probabilities) and is the key step in proving the martingale property — see Martingale DefinitionMartingale DefinitionA stochastic process is a martingale if future conditional expectations equal the current valueRead more →. The tower property also underlies the Chebyshev's InequalityChebyshev's InequalityA random variable rarely deviates from its mean by more than a few standard deviationsRead more → proof strategy of conditioning on a suitable event.
Lean4 Proof
Mathlib provides integral_condExp (total expectation) in Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic.
integral_condExp is proved in Mathlib directly from the defining property of conditional expectation applied to .
Lean4 Proof
import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic
namespace MoonMath
open MeasureTheory
/-- **Law of Total Expectation**.
For a sub-σ-algebra `m ≤ m₀`, integrating the conditional expectation `μ[f | m]`
over the whole space recovers the unconditional integral of `f`. -/
theorem total_expectation {α : Type*} {m₀ m : MeasurableSpace α}
(μ : Measure α) [SigmaFinite (μ.trim (le_refl m₀))]
(hm : m ≤ m₀) [SigmaFinite (μ.trim hm)]
{f : α → ℝ} (hf : Integrable f μ) :
∫ x, (μ[f | m]) x ∂μ = ∫ x, f x ∂μ :=
integral_condExp hm
end MoonMathReferenced by
- Martingale DefinitionProbability
- Law of Total VarianceProbability
- Linearity of Conditional ExpectationProbability