Claim: Let $U_1, U_2$ and $W$ be subspaces of a vector space $V$. Suppose $V = U_1 \oplus W$ and $V = U_2 \oplus W$. Then $U_1 = U_2$.
"Proof"
Let $v \in V$.
Then $\exists \space u_1 \in U_1 $ and $w_1 \in W$ such that $v=u_1+w_1 \space \space \space (1)$
Also, $\exists \space u_2 \in U_2$ and $w_2 \in W$ such that $v=u_2+w_2 \space \space \space (2)$
$(1) - (2) \implies 0 = (u_1 - u_2) + (w_1 - w_2)$. Here, $(u_1 - u_2) \in U_1 \cup U_2$ and $w = (w_1 - w_2) \in W$.
Under a direct sum, the only representation for $0$ is, $0 = 0 + 0$, where the first $0 \in U_1 \cup U_2$ and the second $0 \in W$.
Therefore, $u_1 - u_2 = 0 \implies u_1 = u_2 \implies u_1 \in U_2 \implies U_1 \subset U_2$. Similarly, $u_2 \in U_1 \implies U_2 \subset U_1$. Hence, $U_1 = U_2$.
Q.E.D
But I'm aware of counterexamples in which $U_1 \neq U_2$. So can anyone tell me where the above "proof" breaks down?
The first problem in this proof is assuming that
In vector spaces, $u_1 \in U_1$ and $u_2 \in U_2$ do not imply $u_1 - u_2 \in U_1 \cup U_2$. In fact, it is more likely that $u_1 - u_2 \notin U_1 \cup U_2$.
There is another minor flaw:
This is true if it holds for every $u_1 \in U_1$, but in this case you cannot pick $u_1$ freely since $u_1$ is determined as $v$ is picked. In this case, you can prove that every vector in $U_1$ can be $u_1$, but that is not written in your proof.