Fubini's Theorem

lean4-proofanalysisvisualizationmeasure-theory
fd(μν)= ⁣f(x,y)dν(y)dμ(x)\iint f \, d(\mu \otimes \nu) = \int\!\int f(x,y) \, d\nu(y) \, d\mu(x)

Fubini's theorem justifies the everyday manipulation of swapping the order of integration. The price: integrability of ff on the product space. Tonelli's theorem is the nonneg­ative version that requires no integrability hypothesis.

Statement

Let (X,M,μ)(X, \mathcal{M}, \mu) and (Y,N,ν)(Y, \mathcal{N}, \nu) be sigma-finite measure spaces, and let f:X×YRf : X \times Y \to \mathbb{R} be integrable with respect to the product measure μν\mu \otimes \nu. Then:

  1. For μ\mu-almost every xx, the slice yf(x,y)y \mapsto f(x,y) is ν\nu-integrable.
  2. The function xYf(x,y)dν(y)x \mapsto \int_Y f(x,y)\,d\nu(y) is μ\mu-integrable.
  3. The iterated integrals agree with the product integral:
X×Yfd(μν)=X(Yf(x,y)dν(y))dμ(x)=Y(Xf(x,y)dμ(x))dν(y).\int_{X \times Y} f \, d(\mu \otimes \nu) = \int_X \left(\int_Y f(x,y)\,d\nu(y)\right) d\mu(x) = \int_Y \left(\int_X f(x,y)\,d\mu(x)\right) d\nu(y).

Visualization

Compute [0,1]2xydA\iint_{[0,1]^2} xy \, dA both ways.

Order 1 — integrate yy first:

01(01xydy)dx=01x[y22]01dx=01x2dx=14.\int_0^1 \left(\int_0^1 xy \, dy\right) dx = \int_0^1 x \cdot \left[\frac{y^2}{2}\right]_0^1 dx = \int_0^1 \frac{x}{2}\,dx = \frac{1}{4}.

Order 2 — integrate xx first:

01(01xydx)dy=01y[x22]01dy=01y2dy=14.\int_0^1 \left(\int_0^1 xy \, dx\right) dy = \int_0^1 y \cdot \left[\frac{x^2}{2}\right]_0^1 dy = \int_0^1 \frac{y}{2}\,dy = \frac{1}{4}.

Both equal 14\tfrac{1}{4}, confirming Fubini for this case.

Slice picture for f(x,y)=xyf(x,y) = xy:

y
1 |  (higher f here)
  |  **
  | * *
  |*   *
0 +--------> x
  0         1

Each horizontal slice (fixed y) gives integral = y/2.
Integrating y/2 over [0,1] gives 1/4.

When Fubini fails (warning): For f(x,y)=(x2y2)/(x2+y2)2f(x,y) = (x^2 - y^2)/(x^2+y^2)^2 on [0,1]2[0,1]^2 the two iterated integrals give +π/4+\pi/4 and π/4-\pi/4: ff is not integrable on the product, violating the hypothesis.

ComputationValue
0101xydydx\int_0^1 \int_0^1 xy\,dy\,dx1/41/4
0101xydxdy\int_0^1 \int_0^1 xy\,dx\,dy1/41/4
0101x2y2(x2+y2)2dydx\int_0^1 \int_0^1 \frac{x^2-y^2}{(x^2+y^2)^2}\,dy\,dxπ/4\pi/4
0101x2y2(x2+y2)2dxdy\int_0^1 \int_0^1 \frac{x^2-y^2}{(x^2+y^2)^2}\,dx\,dyπ/4-\pi/4

Proof Sketch

  1. Verify for indicator functions f=1A×Bf = \mathbf{1}_{A \times B} where AA is μ\mu-measurable and BB is ν\nu-measurable — iterated integrals both give μ(A)ν(B)\mu(A)\nu(B).

  2. Extend by linearity to simple functions (finite linear combinations of such indicators).

  3. Use Monotone Convergence TheoremMonotone Convergence Theoremf monotone,  supnf(n)<    f(n)supnf(n)f \text{ monotone},\; \sup_n f(n) < \infty \implies f(n) \to \sup_n f(n)A bounded monotone sequence of reals always converges — the supremum is the limitRead more → to extend to nonneg­ative measurable functions (Tonelli's theorem).

  4. Split f=f+ff = f^+ - f^- and apply Tonelli to each part. Integrability ensures both parts are finite, allowing subtraction.

Connections

Fubini's theorem is used constantly in probability (joint distributions, conditional expectations) and in analysis wherever a two-parameter family of integrals appears. It underlies the convolution formula (fg)(x)dx=fg\int (f * g)(x) \, dx = \int f \cdot \int g and the proof of the Fundamental Theorem of CalculusFundamental Theorem of Calculusabf(x)dx=f(b)f(a)\int_a^b f'(x)\,dx = f(b) - f(a)Integration and differentiation are inverse operationsRead more → for Lebesgue integrals via slicing. The Dominated Convergence TheoremDominated Convergence Theoremfnf a.e.,  fngL1fnff_n \to f \text{ a.e.},\; |f_n| \leq g \in L^1 \Rightarrow \int f_n \to \int fPointwise convergence plus a uniform integrable dominating bound lets you pass the limit inside the integralRead more → is typically used in its proof to justify limit interchanges on slice integrals.

Lean4 Proof

import Mathlib.MeasureTheory.Integral.Prod

open MeasureTheory

/-- Fubini's theorem: the Bochner integral over a product measure equals
    the iterated integral, integrating the second variable first. -/
theorem fubini {α β E : Type*} [MeasurableSpace α] [MeasurableSpace β]
    {μ : Measure α} {ν : Measure β} [SFinite ν]
    [NormedAddCommGroup E] [NormedSpace  E] [CompleteSpace E]
    (f : α × β  E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ :=
  integral_prod f hf