TITLE: Example of product space isomorphic to sum of subspaces
QUESTION [12 upvotes]: Here is the problem statement (from chapter $3$ of Axler's Linear Algebra Done Right).

Give an example of a vector space $V$ and subspaces $U_1,U_2$ of $V$ such that $U_1 \times U_2$ is isomorphic to $U_1 + U_2$, but $U_1 + U_2$ is not a direct sum.
Hint:  the vector space $V$ must be infinite-dimensional.

The only infinite-dimensional vector spaces mentioned in the book up to this point are $\mathbb{F}^{\infty}$ and $P(\mathbb{R})$.
I tried to construct an example using $\mathbb{F}^{\infty}$ by letting $U_1$ be the span of the standard bases $\{e_{2n}\}$ and $U_2$ the span of $\{e_{2n-1}\}$. It seems that at least one of the $U_i$ must be infinite dimensional, or else the example could be constructed with $V$ finite dimensional.
There is an isomorphism between $U_1 \times U_2$ and $U_1 + U_2$, but $U_1 \cap U_2 = \{0\}$ so we have a direct sum, which is what we're trying to avoid. I'm not sure how to proceed from here.

REPLY [9 votes]: Modify your example to make the subspaces intersect. For example, we can take $U_1 = \operatorname{span} \{ e_1 \}$ and $U_2 = \operatorname{span} \{ e_i \}_{i \in \mathbb{N}}$. Then $U_1 \cap U_2 = U_1$ so $U_1 + U_2$ is not a direct sum. In addition, $U_1 \times U_2$ is isomorphic to $U_1 + U_2 = U_2$ via the linear map sending
$$ (e_1,0) \mapsto e_1, (0,e_i) \mapsto e_{i + 1}. $$