TITLE: Completeness of a finite direct sum of closed subspaces of $L^2$
QUESTION [10 upvotes]: Let $X_1$ and $X_2$ be  real-valued square-integrable random variables defined on a probability space $(\Omega, {\cal F},P)$. For $i=1,2$, set $$ A_i := \{g(X_i)\in L^2 \mid g \text{ is some Borel measurable function with } \mathbb{E}g(X_i)=0  \} .$$
 Note that $A_i$ forms a Hilbert subspace of $L^2(\Omega, {\cal F},P)$ for each $i$. 
My question: does $$A_1 + A_2 := \{g_1(X_1) + g_2(X_2): g_i(X_i)\in A_i, \; i=1,2\}$$ equipped with the norm $||\cdot||_{L^2}$ also form a Hilbert subspace of $L^2(\Omega, {\cal F},P)$?

REPLY [4 votes]: Building on my other answer, we can construct a counterexample to the original question.
Let $\{I_n \mid n\geq 3\}$, $\{I'_n \mid n\geq 3\}$, $\{J_n \mid n\geq 3\}$, and $\{J'_n\mid n\geq 3\}$ be mutually exclusive events satisfying
$$
P(I_n) = P(I'_n) = \frac{1}{2n^2}\qquad\text{and}\qquad P(J_n) = P(J'_n)=\frac{1}{2n^4}.
$$
Let $X_1$ and $X_2$ be the random variables
$$
X_1(\omega) =\begin{cases}1/n & \text{if }\,\omega\in I_n \\ -1/n & \text{if }\,\omega\in I'_n, \\ 0 & \text{otherwise},\end{cases}
\qquad\text{and}\qquad
X_2(\omega) =\begin{cases}1/n & \text{if }\,\omega\in I_n\cup J_n, \\ -1/n & \text{if }\,\omega\in I'_n\cup J'_n, \\ 0 & \text{otherwise},\end{cases}
$$
For each $n$, let $Y_n$ and $Z_n$ be the random variables
$$
Y_n(\omega)=\begin{cases}n & \text{if }\,\omega\in I_n \\ -n & \text{if } \,\omega\in I'_n \\ 0 & \text{otherwise}\end{cases}
\qquad\text{and}\qquad
Z_n(\omega)=\begin{cases}n^2 & \text{if }\,\omega\in J_n \\ -n^2 & \text{if } \,\omega\in J'_n \\ 0 & \text{otherwise}\end{cases}
$$
Then the functions $\{Y_n\mid n\geq 3\}$ and $\{Z_n \mid n\geq 3\}$ are orthonormal.  Moreover, $Y_n \in A_1$ for each $n$, and $Y_n + \frac{1}{n} Z_n \in A_2$ for each $n$.  It follows that $Z_n\in A_1+A_2$ for each $n$.  However, the sum
$$
\sum_{n=3}^\infty \frac{1}{n}Z_n
$$
does not lie in $A_1+A_2$.