# Proving Fubini’s Theorem

We skipped this in my analysis class, so I’m going to prove Fubini’s theorem in this post. I’m following the proof from Stein and Shakarchi’s Real Analysis with some restructuring. The basic result is that you can compute integrals in ${{\mathbb R}^{m+n}}$ by first integrating in ${{\mathbb R}^m}$, then in ${{\mathbb R}^n}$, and the order in which you do these two integrals doesn’t matter.

To be precise, we can think of points in ${{\mathbb R}^{m+n}}$ as ${(x,y)}$, where ${x\in {\mathbb R}^m}$ and ${y\in {\mathbb R}^n}$. Then, for each ${y\in{\mathbb R}^n}$, we can define the “slices” of a function ${f}$ and a set ${E}$ corresponding to ${y}$ as

$\displaystyle f^y(x): {\mathbb R}^m\rightarrow {\mathbb R}, f^y(x)=f(x,y)\quad\text{and}\quad E^y=\{x\in {\mathbb R}^m\mid (x,y)\in E\}.$

(Of course, we could define slices corresponding to ${x\in {\mathbb R}^m}$ as well, but it’s sufficient to do everything for ${y}$-slices, since the proofs for ${x}$-slices are completely analogous.)

Theorem 1 (Fubini’s Theorem). Let ${\mathcal{F}}$ be the set of functions ${f}$ on ${{\mathbb R}^{m+n}}$ satisfying:

1. The slice ${f^y}$ is integrable on ${{\mathbb R}^m}$ for almost every ${y\in {\mathbb R}^n}$
2. The function ${\displaystyle{\int_{{\mathbb R}^m} f^y(x)\, dx}}$ is integrable on ${{\mathbb R}^n}$
3. ${\displaystyle{\int_{{\mathbb R}^n}\left(\int_{{\mathbb R}^m} f(x,y)\, dx\right)\, dy=\int_{{\mathbb R}^{m+n}} f(x,y)}}$

Then ${L^1({\mathbb R}^{m+n})\subset \mathcal{F}}$ i.e. every integrable function is in ${\mathcal{F}}$.

The idea of the proof is to show that ${\mathcal{F}}$ contains the simple functions, and then approximate ${L^1}$ functions by simple functions. This approach requires two facts: that ${\mathcal{F}}$ is closed under linear combinations, and that ${\mathcal{F}}$ is closed under monotone limits. We start with these two proofs.

Lemma 2. A finite linear combination of functions in ${\mathcal{F}}$ is in ${\mathcal{F}}$.

Proof: Suppose we have ${\{f_n\} \subset \mathcal{F}}$. Then for each ${k}$, ${f_k^y}$ is integrable on ${{\mathbb R}^n}$ except for ${y\in A_k}$, where ${\mu(A_k)=0}$. If we let ${A=\cup A_k}$, then ${\mu(A)=0}$, and if ${g=\sum a_k f_k}$, then ${g^y}$ will be integrable except when ${y\in A}$. It follows that ${g}$ satisfies 1 and 2, and then the linearity of the integral gives 3, so ${g\in \mathcal{F}}$. $\Box$

Lemma 3. A monotone limit of functions in ${\mathcal{F}}$ is in ${\mathcal{F}}$.

Proof: Suppose we have ${\{f_n\} \subset \mathcal{F}}$. We can make two simplifying assumptions: that the convergence is monotonically increasing, and that the ${f_n}$ are non-negative. If either of these is not the case, then following argument can be applied to ${-f_n}$ and ${f_n-f_1}$ to give the result.

The monotone convergence theorem tells us that

$\displaystyle \lim_{n\rightarrow \infty} \int_{{\mathbb R}^{m+n}} f_n(x,y)\, dx\, dy=\int_{{\mathbb R}^{m+n}} f(x,y)\, dx\, dy.$

We know that for every ${k}$, ${f_k^y}$ is integrable except for ${y\in A_k}$ where ${\mu(A_k)=0}$, and if we let ${A=\cup A_k}$, then ${\mu(A)=0}$, and ${f_k^y}$ is integrable on ${{\mathbb R}^m}$ for all ${k}$ except for ${y\in A}$. Using the monotone convergence theorem again gives

$\displaystyle \underbrace{\int_{{\mathbb R}^m} f_k^y(x)\, dx}_{g_k(y)} \nearrow \underbrace{\int_{{\mathbb R}^{m}} f^y(x)\, dx}_{g(y)},$

as ${k\rightarrow \infty}$.

A third application of monotone convergence gives that

$\displaystyle \int_{{\mathbb R}^n} g_k(y)\, dy\xrightarrow{k\rightarrow\infty} \int_{{\mathbb R}^n} g(y)\, dy.$

Now, because ${f_k\in \mathcal{F}}$, we know that

$\displaystyle \int_{{\mathbb R}^n} g_k(y)\, dy=\int_{{\mathbb R}^{m+n}} f_k(x,y)\, dx\, dy,$

and this together with our previous work gives that

$\displaystyle \int_{{\mathbb R}^n} g(y)\, dy=\int_{{\mathbb R}^{m+n}} f(x,y)\, dx\, dy.$

The RHS is finite because ${f}$ is integrable, so ${g}$ is integrable as well. Thus ${g(y)<\infty}$ almost everywhere, and so ${f^y}$ is integrable for almost every ${y}$, and

$\displaystyle \int_{{\mathbb R}^n}\left(\int_{{\mathbb R}^m} f(x,y)\, dx\right)\, dy=\int_{{\mathbb R}^{m+n}} f(x,y).$

It follows that ${f\in \mathcal{F}}$. $\Box$

Next, we show that ${\mathcal{F}}$ contains the simple functions. The idea here is to start with the characteristic functions of ${G_{\delta}}$ sets and null sets, and then use our previous work to get to simple functions.

Lemma 4. If ${f}$ is a simple function, then ${f\in\mathcal{F}}$.

Proof: We build this up in steps.

1. If ${E}$ is a ${G_{\delta}}$ set of finite measure, then ${\chi_{E}\in \mathcal{F}}$.
1. If ${E}$ is a bounded open cube, then ${\chi_E\in\mathcal{F}}$.

Let ${E=Q_1\times Q_2}$ be such an open cube, where ${Q_1, Q_2}$ are cubes in ${{\mathbb R}^m}$ and ${{\mathbb R}^n}$ respectively. It’s clear that ${\chi_E}$ satisfies 1 and 2, so we need to do the computation to verify 3.

For each ${y}$, the function ${\chi_E(x,y)}$ is measurable in ${x}$ and integrable with

$\displaystyle g(y)=\int_{{\mathbb R}^m} \chi_E(x,y)\, dx=\begin{cases} |Q_1|\quad \text{if }y\in Q_1,\\ 0\quad \text{otherwise}\end{cases}.$

Thus ${g=|Q_1|\chi_{Q_2}}$ is also measurable and integrable, and

$\displaystyle \int_{{\mathbb R}^n} g(y)\, dy= |Q_1||Q_2|.$

But of course,

$\displaystyle \int_{{\mathbb R}^{m+n}} \chi_E(x,y)\, dx\, dy=|E|=|Q_1||Q_2|,$

so ${\chi_E\in \mathcal{F}}$.

2. If ${E}$ is a subset of the boundary of a closed cube, then ${\chi_E\in\mathcal{F}}$.

Let this set be ${E}$. It’s still easy to check 1 and 2, so we verify 3. Because the boundary of the cube has measure zero in ${{\mathbb R}^d}$, we always have

$\displaystyle \int_{{\mathbb R}^{m+n}} \chi_E(x,y)\, dx\, dy=0.$

On the other hand, for almost every ${y}$, the slice ${E^y}$ has measure zero in ${{\mathbb R}^m}$, and so the iterated integral is also zero. It follows that ${\chi_E\in \mathcal{F}}$.

3. If ${E}$ is the finite union of closed cubes with disjoint interior, then ${\chi_E\in\mathcal{F}}$.

The idea is to write ${\chi_E=\sum \chi_{A_k}}$, where each ${A_k}$ is either the interior of an open cube, or a subset of the boundary of a closed cube. From 1.1 and 1.2, each ${\chi_{A_k}\in\mathcal{F}}$, and now Lemma 2 gives that ${\chi_E\in\mathcal{F}}$.

4. If ${E}$ is open and of finite measure, then ${\chi_E\in\mathcal{F}}$.

Such an open set ${E}$ can be written as the countable union of almost disjoint (i.e. their intersection is null) closed cubes ${Q_j}$, so we define

$\displaystyle E=\bigcup_{j=1}^{\infty} Q_j\quad\text{and}\quad f_k=\sum_{j=1}^k \chi_{Q_j}.$

Then, ${f_k\nearrow \chi_E}$, which is integrable because ${E}$ has finite measure, and Lemma 3 allows us to conclude that ${\chi_E \in \mathcal{F}}$.

5. If ${E}$ is ${G_{\delta}}$ and of finite measure, then ${\chi_E\in\mathcal{F}}$.

Because ${E}$ is ${G_{\delta}}$, there are open sets ${G_i}$ such that

$\displaystyle E=\bigcap_{n=1}^{\infty} G_n$

and because ${E}$ is measurable there is an open set ${G\supset E}$. Then, let

$\displaystyle \tilde{G}_k=G\cap \bigcap_{n=1}^{k} G_n,$

and we have a decreasing sequence of open sets

$\displaystyle \tilde{G}_1\supset \tilde{G}_2\supset\cdots,\quad\text{and}\quad E=\bigcap_{k=1}^{\infty} \tilde{G}_k.$

Now, ${\chi_{\tilde{G}_k}\searrow \chi_E,}$ and by 1.4, ${\chi_{\tilde{G}_k}\in\mathcal{F}}$, so Lemma 3 shows that ${\chi_{E}\in \mathcal{F}}$.

2. If ${\mu(E)=0}$, then ${\chi_E\in\mathcal{F}}$.

Because a null set ${E}$ is measurable, we can find a ${G_{\delta}}$ set ${G\supset E}$ such that ${\mu(G)=0}$. From Step 1, we know that ${\chi_G\in \mathcal{F}}$, so

$\displaystyle \int_{{\mathbb R}^n}\left(\int_{{\mathbb R}^m} \chi_G(x,y)\, dx\right)\, dy=\int_{{\mathbb R}^{m+n}} \chi_G=0\implies \int_{{\mathbb R}^m} \chi_G(x,y)=0,$

for almost every ${y}$. This means that ${\mu(G^y)=0}$ and ${E^y\subset G^y}$, so we have that ${\mu(E^y)=0}$ for almost every ${y}$, and so

$\displaystyle \int_{{\mathbb R}^n}\left(\int_{{\mathbb R}^m} \chi_E(x,y)\, dx\right)\, dy =0\int_{{\mathbb R}^d}\chi_E\implies \chi_E\in\mathcal{F}.$

3. If ${E}$ is measurable with finite measure, then ${\chi_E\in\mathcal{F}}$.

Recall that we can find a ${G_{\delta}}$ set ${G\supset E}$ such that ${\mu(G\setminus E)=0}$, and now writing ${\chi_E=\chi_G-\chi_{G\setminus E}}$ and Lemma 2 gives that ${\chi_E\in\mathcal{F}}$.

Now, any simple function ${f}$ is a linear combination of characteristic functions of measurable sets with finite measure, so Lemma 2 shows that ${f\in\mathcal{F}}$. $\Box$

With these three lemmas in hand, we can prove Fubini’s theorem.

Proof of Fubini’s Theorem: Suppose ${f}$ is an integrable function. We can write ${f}$ as the sum of a positive and negative part, so it is sufficient by Lemma 2 to consider the case where ${f}$ is non-negative. Because ${f}$ is integrable, there are simple functions ${f_k}$ that converge monotonically to ${f}$. By Lemma 4, each ${f_k\in\mathcal{F}}$, and now Lemma 3 allows us to conclude that ${f\in\mathcal{F}}$. $\Box$