Product measures make integration over several variables precise. Tonelli and Fubini are the theorems that justify iterated integration.
Product sigma-algebras
Rectangles generate the measurable structure on products.
Definition. For measurable spaces \((X,\mathcal A)\) and \((Y,\mathcal B)\), the product sigma-algebra \(\mathcal A\otimes\mathcal B\) is generated by measurable rectangles \(A\times B\).
Proposition. If \(E\in\mathcal A\otimes\mathcal B\), then sections \(E_x=\{y:(x,y)\in E\}\) and \(E^y=\{x:(x,y)\in E\}\) are measurable.
Proof. The class of sets with measurable sections is a sigma-algebra. It contains rectangles because rectangle sections are either \(B\) or \(\varnothing\), and either \(A\) or \(\varnothing\). Hence it contains the generated sigma-algebra.
Existence of product measure
A product measure is determined by its values on rectangles.
Theorem. If \(\mu\) and \(\nu\) are sigma-finite measures, there is a unique measure \(\mu\otimes\nu\) on \(\mathcal A\otimes\mathcal B\) such that \((\mu\otimes\nu)(A\times B)=\mu(A)\nu(B)\).
Proof. First assume \(\mu(X),\nu(Y)<\infty\). On a rectangle set \[ \rho_0(A\times B)=\mu(A)\nu(B), \] and extend to finite disjoint unions by summation. To see that the value is representation-independent, refine two rectangle representations by all intersections of their \(X\)- and \(Y\)-sides; finite additivity of \(\mu\) and \(\nu\) gives the same sum on the common grid. If a disjoint union of algebra sets remains in the algebra, countable additivity follows by taking vertical sections, applying countable additivity of \(\nu\), and then monotone convergence for \(\mu\). Thus \(\rho_0\) is a premeasure. Carath?odory's extension theorem produces \(\mu\otimes\nu\).
For sigma-finite measures, choose disjoint decompositions \(X=\bigsqcup_iX_i\), \(Y=\bigsqcup_jY_j\) with finite measures. Construct the finite product measure on each \(X_i\times Y_j\) and sum these mutually singular pieces. Rectangles have the required product mass by countable distributivity. Finally, rectangles form a \(\pi\)-system and the product is sigma-finite on the rectangles \(X_i\times Y_j\); the sigma-finite uniqueness theorem gives uniqueness on \(\mathcal A\otimes\mathcal B\).
Tonelli theorem
Nonnegative functions can always be integrated in either order.
Theorem. If \(f\ge0\) is \(\mathcal A\otimes\mathcal B\)-measurable, then \[ \int f\,\mathrm{d}(\mu\otimes\nu)=\int\left(\int f(x,y)\,\mathrm{d}\nu(y)\right)\mathrm{d}\mu(x) \] with values in \([0,\infty]\), and similarly with the order reversed.
Proof. For a rectangle \(E=A\times B\), \[ \int_X\nu(E_x)\,\mathrm{d}\mu(x) =\int_X\mathbf1_A(x)\nu(B)\,\mathrm{d}\mu(x) =\mu(A)\nu(B) =(\mu\otimes\nu)(E). \] Let \(\mathcal C\) be the sets \(E\) for which \(x\mapsto\nu(E_x)\) is measurable and the displayed section formula holds. On finite-measure product pieces, \(\mathcal C\) is a Dynkin system: complements and disjoint unions follow from measure continuity and monotone convergence. It contains the rectangle \(\pi\)-system, hence all product-measurable sets. Sigma-finite exhaustion removes the finite-total-mass restriction.
The indicator formula extends by linearity to nonnegative simple functions. If \(s_n\uparrow f\), then \(s_n(x,\cdot)\uparrow f(x,\cdot)\); monotone convergence first in \(y\), then in \(x\), and also on the product gives \[ \int f\,\mathrm{d}(\mu\otimes\nu) =\int_X\left(\int_Yf(x,y)\,\mathrm{d}\nu(y)\right)\mathrm{d}\mu(x). \] The reversed order is identical.
Fubini theorem
Integrable functions have finite iterated integrals almost everywhere and matching values.
Theorem. If \(f\in L^1(\mu\otimes\nu)\), then for almost every \(x\), \(f(x,\cdot)\in L^1(\nu)\), the function \(x\mapsto\int f(x,y)\,\mathrm{d}\nu(y)\) is integrable, and the product integral equals the iterated integral.
Proof. Apply Tonelli to \(|f|\) to see that the iterated integral of \(|f|\) is finite. Hence the sections are integrable almost everywhere. Apply Tonelli separately to \(f^+\) and \(f^-\), both having finite total integral, and subtract.
Failure without absolute integrability
Conditional cancellation can make the two iterated integrals disagree.
Example. On \((0,1)^2\), set \[ f(x,y)=\frac{x^2-y^2}{(x^2+y^2)^2}. \] Since \[ f=-\frac{\partial}{\partial x}\frac{x}{x^2+y^2} =\frac{\partial}{\partial y}\frac{y}{x^2+y^2}, \] direct calculation gives \[ \int_0^1\!\left(\int_0^1f(x,y)\,\mathrm{d}x\right)\mathrm{d}y =-\int_0^1\frac{\mathrm{d}y}{1+y^2} =-\frac\pi4, \] whereas \[ \int_0^1\!\left(\int_0^1f(x,y)\,\mathrm{d}y\right)\mathrm{d}x =\int_0^1\frac{\mathrm{d}x}{1+x^2} =\frac\pi4. \] The absolute integral diverges near \((0,0)\), so Fubini's hypothesis fails exactly where the order dependence enters.