Linearity of Conditional Expectation

lean4-proofprobabilityvisualization
E[aX+bYG]=aE[XG]+bE[YG]E[aX + bY \mid \mathcal{G}] = a\,E[X \mid \mathcal{G}] + b\,E[Y \mid \mathcal{G}]

Statement

Let GF\mathcal{G} \subseteq \mathcal{F} be a sub-σ\sigma-algebra, and let XX, YY be integrable real random variables. For constants a,bRa, b \in \mathbb{R}:

E[aX+bYG]=aE[XG]+bE[YG]a.s.E[aX + bY \mid \mathcal{G}] = a\,E[X \mid \mathcal{G}] + b\,E[Y \mid \mathcal{G}] \quad \text{a.s.}

This follows from two atomic properties:

  • Additivity: E[X+YG]=E[XG]+E[YG]E[X + Y \mid \mathcal{G}] = E[X \mid \mathcal{G}] + E[Y \mid \mathcal{G}] a.s.
  • Scalar multiplication: E[cXG]=cE[XG]E[cX \mid \mathcal{G}] = c\,E[X \mid \mathcal{G}] a.s.

Visualization

Two dice experiment. Roll dice AA and BB independently. Let X=AX = A, Y=BY = B, and G=σ(A)\mathcal{G} = \sigma(A) (information from die AA only).

Outcome A=aA=aE[XA=a]E[X \mid A=a]E[YA=a]E[Y \mid A=a]E[2X+3YA=a]E[2X + 3Y \mid A=a]Direct: 2a+33.52a + 3 \cdot 3.5
a=1a = 1113.53.52+10.5=12.52 + 10.5 = 12.52(1)+10.5=12.52(1) + 10.5 = 12.5
a=3a = 3333.53.56+10.5=16.56 + 10.5 = 16.52(3)+10.5=16.52(3) + 10.5 = 16.5
a=6a = 6663.53.512+10.5=22.512 + 10.5 = 22.52(6)+10.5=22.52(6) + 10.5 = 22.5

Since BB is independent of AA, E[YA=a]=E[Y]=3.5E[Y \mid A=a] = E[Y] = 3.5 for all aa. Linearity gives E[2X+3YA]=2A+10.5E[2X + 3Y \mid A] = 2A + 10.5 a.s., matching direct computation.

Proof Sketch

  1. Additivity. Show that E[XG]+E[YG]E[X \mid \mathcal{G}] + E[Y \mid \mathcal{G}] satisfies the defining property of E[X+YG]E[X+Y \mid \mathcal{G}]: it is G\mathcal{G}-measurable and for all AGA \in \mathcal{G}, A(E[XG]+E[YG])dP=AXdP+AYdP=A(X+Y)dP\int_A (E[X|\mathcal{G}] + E[Y|\mathcal{G}]) \, dP = \int_A X \, dP + \int_A Y \, dP = \int_A (X+Y) \, dP.
  2. Uniqueness. Conditional expectation is defined up to a.s. equality by the defining property, so additivity holds a.s.
  3. Scalar. cE[XG]c \cdot E[X \mid \mathcal{G}] is G\mathcal{G}-measurable and AcE[XG]dP=cAXdP\int_A c \cdot E[X|\mathcal{G}] \, dP = c \int_A X \, dP by linearity of integration.

Connections

Linearity of conditional expectation is the key structural property underpinning the Law of Total ExpectationLaw of Total ExpectationE[X]=E[E[XY]]E[X] = E[E[X \mid Y]]The expectation of X equals the expectation of its conditional expectation: E[X] = E[E[X|Y]]Read more → and the martingale property in Martingale DefinitionMartingale DefinitionE[Mn+1Fn]=Mn a.s.E[M_{n+1} \mid \mathcal{F}_n] = M_n \text{ a.s.}A stochastic process is a martingale if future conditional expectations equal the current valueRead more →. Combined with Jensen's InequalityJensen's Inequalityφ(E[X])E[φ(X)]\varphi(E[X]) \leq E[\varphi(X)]For a convex function phi, phi(E[X]) <= E[phi(X)] — the image of the mean is at most the mean of imagesRead more → (for convex φ\varphi: φ(E[XG])E[φ(X)G]\varphi(E[X|\mathcal{G}]) \leq E[\varphi(X)|\mathcal{G}] a.s.), it characterises the relationship between conditional and unconditional moments.

Lean4 Proof

Mathlib provides condExp_add and condExp_smul in Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic.

condExp_add is proved in Mathlib by showing the sum satisfies the defining characterisation of conditional expectation; condExp_smul follows from linearity of the Bochner integral.

Lean4 Proof

import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic

namespace MoonMath

open MeasureTheory

/-- **Additivity of conditional expectation**.
    `μ[f + g | m] =ᵐ[μ] μ[f | m] + μ[g | m]`. -/
theorem condExp_add_ae {α : Type*} {m₀ m : MeasurableSpace α} (μ : Measure α)
    {f g : α  } (hf : Integrable f μ) (hg : Integrable g μ) :
    μ[fun x => f x + g x | m] =ᵐ[μ] fun x => (μ[f | m]) x + (μ[g | m]) x :=
  condExp_add hf hg m

/-- **Homogeneity of conditional expectation**.
    `μ[c • f | m] =ᵐ[μ] c • μ[f | m]`. -/
theorem condExp_smul_ae {α : Type*} {m₀ m : MeasurableSpace α} (μ : Measure α)
    (c : ) (f : α  ) :
    μ[fun x => c * f x | m] =ᵐ[μ] fun x => c * (μ[f | m]) x := by
  have := condExp_smul (𝕜 := ) c f m (α := α) (μ := μ)
  simpa [smul_eq_mul] using this

end MoonMath