Strange use of Fubini for infinite sum Let $k(n)$ be a sequence of natural numbers and $y_m$ a sequence of non-negative numbers. I encountered this line I don't understand:
$$ \sum_{n=1}^{\infty} \frac{1}{k(n)^2} \sum_{m=1}^{k(n)} y_m = \sum_{m=1}^{\infty} y_m \sum_{k(n)\geq m} \frac{1}{k(n)^2}$$
justified as an application of Fubini's theorem. I am aware of this analogue of Fubini but I don't see how this equality could be true because the "integration interval" changes too. Can someone help me see how this would work out?
 A: This is also known as ... "inverting the order the sums" ...
\begin{eqnarray*}
\{ (m,n) \mid  n=1,2, \cdots \infty , m=1,\cdots k(n) \} = \{ (m,n) \mid  m=1,2, \cdots \infty , n=k(m),\cdots \infty \}.
\end{eqnarray*}
Thus
\begin{eqnarray*}
\sum_{n=1}^{ \infty} \sum_{  m=1}^{ k(n) }\cdots = \sum_{m=1}^{ \infty }\sum_{n=k(m)}^{ \infty }\cdots.
\end{eqnarray*}
A: A convenient way to think through this (whether its exchanging sums or exchanging integrals) is to replace bounds of integration by characteristic/indicator functions.
In your case, let's replace the upper bound by an indicator function and use (standard) Fubini:
\begin{align*}
\sum_{n = 1}^{\infty} \frac{1}{k(n)^{2}} \sum_{m = 1}^{k(n)} y_{m} = \sum_{n = 1}^{\infty} \frac{1}{k(n)^{2}} \sum_{m = 1}^{\infty} y_{m} 1_{\{m \leq k(n)\}} = \sum_{n = 1}^{\infty} \sum_{m = 1}^{\infty} \frac{1}{k(n)^{2}} y_{m} 1_{\{m \leq k(n)\}}.
\end{align*}
Now that there are no $m$- or $n$-dependent bounds in the sums, we can interchange them at will and then impose a bound on $n$ instead of $m$:
\begin{align*}
\sum_{n = 1}^{\infty} \frac{1}{k(n)^{2}} \sum_{m = 1}^{k(n)} y_{m} = \sum_{n = 1}^{\infty} \sum_{m = 1}^{\infty} \frac{1}{k(n)^{2}} y_{m} 1_{\{m \leq k(n)\}} = \sum_{m = 1}^{\infty} \sum_{n = 1}^{\infty} \frac{1}{k(n)^{2}} y_{m} 1_{\{m \leq k(n)\}} = \sum_{m = 1}^{\infty} y_{m} \sum_{k(n) \geq m} \frac{1}{k(n)^{2}}.
\end{align*}
The same principle applies to integrals.  For instance,
\begin{equation*}
\int_{0}^{1} \int_{x^{2}}^{1} f(x,y) \, dy \, dx = \int_{0}^{1} \int_{0}^{1} f(x,y) 1_{\{x^{2} \leq y\}} \, dx \, dy = \int_{0}^{1} \int_{0}^{1} f(x,y) 1_{\{x \leq \sqrt{y}\}} \, dx \, dy.
\end{equation*}
Thus, instead of integrating first in $y$ and then in $x$, we can write
\begin{equation*}
\int_{0}^{1} \int_{x^{2}}^{1} f(x,y) \, dy \, dx = \int_{0}^{1} \int_{0}^{\sqrt{y}} f(x,y) \, dx \, dy.
\end{equation*}
