# Interchange of Lebesgue integrals and infinite sums

I am self-learning the Analysis II book from Tao [1], and stopped with the following problem (8.2.4): For each $$n=1,2,3...$$ let $$f_n : \mathbb{R} \rightarrow \mathbb{R}$$ be the function $$f_n(x) = \chi(x)_{[n,n+1)} - \chi(x)_{[n+1, n+2)}$$, where $$\chi()$$ denotes the indicator function, i.e., $$f_n(x) = 1, \forall x \in [n,n+1)$$, $$f_n(x) = -1, \forall x \in [n+1,n+2)$$, and zero otherwise. Show that $$\int_{\mathbb{R}}\sum_{n=1}^{\infty}f_n(x) \neq \sum_{n=1}^{\infty}\int_{\mathbb{R}}f_n(x)$$

My attempts:

(1) since $$f_n(x)$$ is not non-negative, then the integrals and sums cannot be exchanged. Period (?)

(2) Defining $$f(x) = \sum_{n=1}^{\infty}f_n(x)$$, then $$\int_{\mathbb{R}}f(x) = sup \{\int_{\mathbb{R}}s\}$$ for $$s$$ being a simple function that minorizes $$f(x)$$. Since $$f(x) \in \{-1,0,1\} \forall x$$, and $$\int_{\mathbb{R}}s = \sum_{n=1}^{\infty}a_nm([n,n+1)-b_nm([n+1,n+2))$$, where $$m()$$ is the Lebesgue measure. Sice $$\lim_{n \rightarrow \infty}f_n(x) = 0$$, at the limit point the measure is zero. This results in $$\int_{\mathbb{R}}s = \sum_{n=1}^{\infty}(-1)^n$$, and so, the integral is not convergent. On the other side, $$\int_{\mathbb{R}}f_n(x) = 0$$, for all $$n=1,2..$$, therefore $$\sum_{n=1}^{\infty}\int_{\mathbb{R}}f_n(x)=0$$.

Do these attempts make any sense? Did I make some mistakes here? Thanks for all the possible hints/explanations.

• Your statement (1) is wrong and not needed. There are plenty of sequences of non-negative and non-positive functions $$f_n$$ for which we can interchange limits and sums with integrals. Hint: Dominated Convergence Theorem.
• The first sentence in paragraph (2) is doubtful: $$\int_\mathbb Rf$$ is the supremum of $$\int_\mathbb R s$$ where $$s\le f,\, s$$ simple, holds for non-negative $$f$$. At this stage we don't know yet if our $$f$$ is non-negative.
• You have correctly observed that, for all $$n$$, $$\int_{\mathbb R}f_n(x)\,dx=0$$ holds, so that $$\sum_{n=1}^\infty \int_{\mathbb R}f_n(x)\,dx=0\,.$$
• On the other hand \begin{align} f_1&=\chi_{[1,2)}-\chi_{[2,3)}\\ f_2&=\chi_{[2,3)}-\chi_{[3,4)}\\ &... \end{align} Therefore, $$f=\sum_{n=1}^\infty f_n=\chi_{[1,2)}\,$$ which has integral one.