> [!theorem] Tonelli's Theorem for [[Indicator Function|Indicator Functions]]
>
> Let $(X, \cm, \mu)$ and $(Y, \cn, \nu)$ be $\sigma$-finite [[Measure Space|measure spaces]], and $E \in \cm \otimes \cn$. Then $x \mapsto \nu(E_x)$ and $y \mapsto \mu(E^y)$ are $\cn$ and $\cm$-[[Measurable Function|measurable]]. Moreover, the [[Product Measure|product measure]] can be expressed as [[Integral|integrals]] on the $x$ and $y$-sections of $E$:
> $
> \begin{align*}
> \mu \times \nu(E) &= \int_{X \times Y}\chi_{E}d(\mu \times \nu)\\
> &= \int_X\braks{\int_Y\chi_{E_x}(y)d\nu(y)}d\mu(x) = \int_X\nu(E_x)d\mu(x)\\
> &= \int_Y \braks{\int_X \chi_{E^y}(x)d\mu(x)} d\nu(y) = \int_Y\mu(E^y)d\nu(y)
> \end{align*}
> $
>
> *Proof*. Suppose that $\mu$ and $\nu$ are finite, and let $\cc$ be the collection of sets where the theorem holds true. Then any measurable rectangle $A \times B$ satisfies the theorem, and so does every FDU of measurable rectangles. Therefore $\cc$ contains all FDUs of measurable rectangles.
>
> Now, let $\seq{E_n} \subset \cc$ such that $E_n \upto E$. Then $\nu((E_n)_x) \upto \nu(E_x)$ and $\mu((E_n)^y) \upto \mu((E^y)$ by continuity from below. Therefore
> $
> \begin{align*}
> (x \mapsto \nu((E_n)_x)) &\upto (x \mapsto \nu(E_x)) \\
> (y \mapsto \mu((E_n)^y)) &\upto (y \mapsto \mu(E^y))
> \end{align*}
> $
> [[Pointwise Convergence|pointwise]], and $(x \mapsto \nu(E_x))$, $(y \mapsto \mu(E^y))$ are both measurable. By the [[Monotone Convergence Theorem]],
> $
> \begin{align*}
> \mu \times \nu(E)
> &= \limv{n}\mu \times \nu(E_n) \\
> \limv{n}\int_Y\mu((E_n)^y)d\nu(y)&= \limv{n}\int_X \nu((E_n)_x)d\mu(x) \\
> \int_Y\limv{n}\mu((E_n)^y)d\nu(y)
> &= \int_X \limv{n}\nu((E_n)_x)d\mu(x) \\
> \int_Y\mu(E^y)d\nu(y)
> &= \int_X \nu(E_x)d\mu(x)\\
> \end{align*}
> $
> the result holds for $E \in \cc$.
>
> Let $\seq{E_n} \subset \cc$ such that $E_n \downto E$. Then since $\mu$ and $\nu$ are $\sigma$-finite, $\nu((E_n)_x) \downto \nu(E_x)$ and $\mu((E_n)^y) \downto \mu(E^y)$ by continuity from above. Therefore
> $
> \begin{align*}
> (x \mapsto \nu((E_n)_x)) &\downto (x \mapsto \nu(E_x)) \\
> (y \mapsto \mu((E_n)^y)) &\downto (y \mapsto \mu(E^y))
> \end{align*}
> $
> pointwise, and $(x \mapsto \nu(E_x))$, $(y \mapsto \mu(E^y))$ are both measurable. Since the sequences are decreasing, $x \mapsto \nu((E_n)_x)$ is dominated by $x \mapsto \nu((E_1)_x)$ and $y \mapsto \mu((E_n)^y)$ is dominated by $y \mapsto \mu((E_1)^y)$.
> $
> \int_X \nu((E_1)_x)d\mu(x) = \mu \times \nu (E_1) =
> \int_Y \mu((E_1)^y)d\nu(y)
> $
> As $\mu \times \nu(E_1) \le \mu \times \nu (X \times Y) = \mu(X) \cdot \nu(Y) < \infty$, $x \mapsto \nu((E_1)_x)$ and $y \mapsto \mu((E_1)^y)$ are both [[Integrable Function|integrable]]. By the [[Dominated Convergence Theorem]],
> $
> \begin{align*}
> \mu \times \nu(E) &= \limv{n}\mu \times \nu(E_n) \\
> \limv{n}\int_Y\mu((E_n)^y)d\nu(y)&= \limv{n}\int_X \nu((E_n)_x)d\mu(x) \\
> \int_Y\mu(E^y)d\nu(y)
> &= \int_X \nu(E_x)d\mu(x)\\
> \end{align*}
> $
> the result holds for $E \in \cc$.
>
> Since $\cc$ is closed under countable increasing unions and countable decreasing intersections, $\cc$ is a [[Monotone Class|monotone class]]. By the [[Monotone Class Lemma]], $\cc$ contains the smallest [[Sigma Algebra|sigma algebra]] generated by the collection $\alg$ of FDUs of measurable rectangles, and therefore contains $\cm \otimes \cn$. Therefore the result holds for all sets in $\cm \otimes \cn$.
>
> Now suppose that $\mu$ and $\nu$ are $\sigma$-finite. Let
> $
> \begin{align*}
> X &= \bigcup_{n \in \nat}X_n:
> \seq{X_n} \subset \cm \text{ disjoint}, \mu(X_n) < \infty &\forall n \in \nat \\
> Y &= \bigcup_{n \in \nat}Y_n:
> \seq{Y_n} \subset \cn \text{ disjoint}, \nu(Y_n) < \infty &\forall n \in \nat \\
> \end{align*}
> $
> then the product measure is $\sigma$-finite
> $
> X \times Y = \bigcup_{i \in \nat}\bigcup_{j \in \nat}X_i \times Y_j \quad \mu \times \nu(X_i \times Y_j) < \infty
> $
> Reindex the sets $X_i \times Y_j$ such that
> $
> X \times Y = \bigcup_{n \in \nat}X_n \times Y_n \quad \mu \times \nu(X_n \times Y_n) < \infty
> $
> Then
> $
> \begin{align*}
> \mu \times \nu(E) &=
> \mu \times \nu\paren{E \cap \bigcup_{n \in \nat}X_i \times Y_i}\\
> &= \sum_{n \in \nat}\mu \times \nu(E \cap (X_i \times Y_i))\\
> &= \limv{n}\sum_{i = 1}^{n}\mu \times \nu(E \cap (X_i \times Y_i))
> \end{align*}
> $
> Since $\mu \times \nu$ restricted to any finite union of $X_i \times Y_i$s is finite, the previous result applies on each term of the sum in the form of
> $
> \begin{align*}
> \mu \times \nu(E \cap (X_i \times Y_i)) &= \mu \times \nu(E \cap (X_i \times Y_i))\\
> \int_Y\mu(E^y \cap (X_i \times Y_i)^y)d\nu(y) &= \int_X\nu(E_x \cap (X_i \times Y_i)_x)d\mu(x)\\
> \int_Y\chi_{Y_i} \cdot \mu(E^y \cap X_i)d\nu(y)
> &= \int_X\chi_{X_i} \cdot \nu(E_x \cap Y_i)d\mu(x)\\
> \end{align*}
> $
> where after undoing the reindexing,
> $
> \begin{align*}
> \sum_{i \in \nat}\chi_{X_i} \cdot \nu(E_x \cap Y_i) &=
> \sum_{i \in \nat}\sum_{j \in \nat} \chi_{X_i} \cdot \nu(E_x \cap Y_j) \\
> &= \sum_{i \in \nat}\chi_{X_i}\sum_{j \in \nat} \nu(E_x \cap Y_j) \\
> &= \sum_{i \in \nat}\chi_{X_i}\nu(E_x) \\
> &= \nu(E_x)
> \end{align*}
> $
> and
> $
> \begin{align*}
> \sum_{i \in \nat}\chi_{Y_i} \cdot \mu(E^y \cap X_i) &= \sum_{j \in \nat}\sum_{i \in \nat}\chi_{Y_j} \cdot \mu(E^y \cap X_i) \\
> &= \sum_{j \in \nat}\chi_{Y_j}\sum_{i \in \nat}\mu(E^y \cap X_i) \\
> &= \sum_{j \in \nat}\chi_{Y_j}\mu(E^y) \\
> &= \mu(E^y)
> \end{align*}
> $
> Therefore by the [[Monotone Convergence Theorem]],
> $
> \begin{align*}
> \mu \times \nu(E) &= \limv{n}\sum_{i = 1}^{n}\mu \times \nu(E \cap (X_i \times Y_i)) \\
> &= \limv{n}\sum_{i = 1}^{n}\int_X\chi_{X_i} \cdot \nu(E_x \cap Y_i)d\mu(x) \\
> &= \int_X \sum_{i \in \nat}\chi_{X_i} \cdot \nu(E_x \cap Y_i)d\mu(x) \\
> &= \int_X \nu(E_x)d\mu(x)
> \end{align*}
> $
> and
> $
> \begin{align*}
> \mu \times \nu(E) &= \limv{n}\sum_{i = 1}^{n}\mu \times \nu(E \cap (X_i \times Y_i)) \\
> &= \limv{n}\sum_{i = 1}^{n}\int_Y\chi_{Y_i} \cdot \mu(E^y \cap X_i)d\nu(y) \\
> &= \int_Y\sum_{i \in \nat}\chi_{Y_i} \cdot \mu(E^y \cap X_i)d\nu(y) \\
> &= \int_Y \mu(E^y)d\nu(y)
> \end{align*}
> $
> [!theoremb] Fubini-Tonelli Theorem
>
> Let $(X, \cm, \mu)$ and $(Y, \cn, \nu)$ be $\sigma$-finite [[Measure Space|measure spaces]].
>
> **Tonelli's Theorem:** Let $f \in L^+(X \times Y)$ be a non-negative [[Measurable Function|measurable function]], then the functions $g(x) = \int f_x(y) d\nu(y)$ and $h(y) = \int f^y(x) d\mu(x)$ are in $L^+(X)$ and $L^+(Y)$ respectively. Moreover, the [[Integral|integral]] with respect to the [[Product Measure|product measure]] can be evaluated iteratively, where the order of integration can be interchanged:
> $
> \begin{align*}
> \int_{X \times Y} f d(\mu \times \nu) &= \int_X\braks{\int_Y f(x, y)d \nu(y)} d\mu(x) \\
> &= \int_Y \braks{\int_X f(x, y)d\mu(x)}d\nu(y)
> \end{align*}
> $
>
> **Fubini's Theorem:** Let $f \in L^1(\mu \times \nu)$ be an [[Integrable Function|integrable function]] with respect to the product measure, then $f_x \in L^1(\nu)$ for $\nu$-[[Almost Everywhere|a.e.]] $x \in X$, and $f^y \in L^1(\mu)$ for $\mu$-a.e. $y \in Y$. The a.e. defined functions $g(x) = \int f_x d\nu$ and $h(y) = \int f^y d\mu$ are in $L^1(\mu)$ and $L^1(\nu)$ respectively, and Tonelli's Theorem holds.
>
> *Proof*. Since we have shown Tonelli's theorem for indicator functions, it holds for non-negative [[Simple Function|simple functions]] by linearity.
>
> Let $f \in L^+(\mu \times \nu)$. Let $\seq{f_n}$ be a [[Sequence|sequence]] of simple functions such that $f_n \upto f$, and let $g_n(x) = \int (f_n)_x(y) d\nu(y)$ and $h_n(y) = \int (f_n)^y(x) d\mu(x)$, then by the [[Monotone Convergence Theorem]], $g_n \upto g = \int f_x d\nu$ and $h_n \upto h = \int f^y d\mu$. Since each $g_n$ and $h_n$ are measurable[^1], so are $g$ and $h$.
>
> Applying the Monotone Convergence Theorem again,
> $
> \begin{align*}
> \int f d(\mu \times \nu) &= \limv{n}\int f_n d(\mu \times \nu)\\
> \limv{n}\int h_n d\nu&= \limv{n}\int g_n d\mu \\
> \int h d\nu &= \int g d\mu
> \end{align*}
> $
>
> If $\int f d(\mu \times \nu) < \infty$, then $g < \infty$ $\mu$-a.e. and $h < \infty$ $\mu$-a.e. Therefore $g \in L^1(\mu)$ for a.e. $x \in X$ and $h \in L^1(\nu)$ for a.e. $y \in Y$.
>
> Now suppose that $f \in L^1(\mu \times \nu)$ is real-valued, then $f^+, f^- \in L^1(\mu \times \nu)$, meaning that
> $
> g_+(x) = \int f_x^+ d\nu \quad g_-(x) = \int f^-_x d\nu \quad g = g_+ - g_-
> $
> are integrable for a.e. $x \in X$ by linearity, and
> $
> h_+(y) = \int (f^+)^y d\nu \quad h_-(y) = \int(f^-)^yd\nu \quad h = h_+ - h_-
> $
> are integrable for a.e. $y \in Y$ by linearity. Applying Tonelli's theorem on each part yields
> $
> \begin{align*}
> \int_{X \times Y} f^\pm d(\mu \times \nu) &= \int_{X}g_\pm(x)d\mu(x) = \int_Y h_\pm(y)d\nu(y) \\
> \int_{X \times Y}fd(\mu \times \nu) &= \int_{X}f^+(x)d\mu(x) - \int_{X}f^-(x)d\mu(x) \\
> &= \int_{X}g_+(x)d\mu(x) - \int_X g_-(x)d\mu(x) \\
> &= \int_{X}g(x)d\mu(x) \\
> &= \int_{Y}h_+(y)d\nu(y) - \int_Yh_-(y)d\nu(y) \\
> &= \int_{Y}h(y)d\nu(y)
> \end{align*}
> $
> Lastly, if $f \in L^1(\mu \times \nu)$, then $\re{f}, \im{f} \in L^1(\mu \times \nu)$. Applying Fubini's theorem on each part, then using linearity yields the final result.
[^1]: By Tonelli's Theorem for indicator functions and linearity.
[^2]: This is not the correct decomposition. I'll fix it tomorrow.