Prove or give a counterexample: if $U_1, U_2, W$ are subspaces of $V$ such that $V= U_1\oplus W$ and $V= U_2\oplus W$ then $U_1=U_2$. I've read some proofs about this problem in the Mathstack, but I could not understand them all. I probably need some more time to digest Direct Sum completely.
So, I want to share my approach to show my level of understanding.
My Approach:
Suppose $U_1=\{(x,0) \in F^2: x \in F\}$, $U_2=\{(0,y) \in F^2: y \in F\}$, $W=\{(x,y) \in F^2: x,y \in F\}$, $V=F^2$.
Note that, $U_1 + W$, $U_2 + W$ are direct sum. And, $U_1 \neq U_2$.
If the statement is true, this contrapositive statement should give us $V \neq U_1 \oplus W$ or $ V \neq U_2 \oplus W$.
However, $U_1 \oplus W = F^2 = V = U_2 \oplus W$.
This is a contradiction.
Thus, the contrapositive statement is false. Hence, the statement is false.
End of Proof.
But, I am not confident with this proof since I think I am missing some important things about Direct Sum.
I hope my approach could show which part I need to focus on more, or which part I should not forget about Direct Sum.
 A: Consider the following particular case:
\begin{align*}
\begin{cases}
V = \mathbb{R}^{2}\\
W = \{(x,y)\in\mathbb{R}^{2}\mid y = 0\}\\
U_{1} = \{(x,y)\in\mathbb{R}^{2}\mid x = 0\}\\
U_{2} = \{(x,y)\in\mathbb{R}^{2}\mid y = x\}
\end{cases}
\end{align*}
Then we have that $V = U_{1}\oplus W = U_{2}\oplus W$, but $U_{1}\neq U_{2}$.
Hopefully this helps!
A: Counterexample:
$\mathbb R^2 =\begin{align*}\begin{cases} \operatorname{span}\{(1,0)\}\oplus \operatorname{span}\{(0,1)\}\\
 \operatorname{span}\{(1,1)\}\oplus \operatorname{span}\{(0,1)\} \end{cases}\end{align*}
$
A: This isn't an answer but in the textbook this question comes from "Linear Algebra Done Right" the Author defines the direct sum differently than on wikipedia.
According to the author, a direct sum is:
Suppose $U_1, \dots, U_m$ are subspaces of V.

*

*The sum $U_1+ \dots+ U_m$ is called a direct sum if each element of $U_1+ \dots+ U_m$ can be written in only one way as a sum $u_1 + \dots + u_m$, where each $u_j$ is in $U_J$.

*If $U_1 + \dots + U_m$ is a direct sum, then $U_1 \oplus \dots \oplus U_m$ denotes $U_1 + \dots + U_m$, with the $\oplus$ notation serving as an indication that this is a direct sum.

Under this definition, the counter example provided in other answers don't satisfy our assumptions that $U_1 \oplus W$ and $U_2 \oplus W$.

Here's the solution I came up with:
By definition of direct sum we know that $0 = a_1 \pmb u_1 + \dots + a_m \pmb u_m + b_1 \pmb w_1 + \dots + b_w \pmb w_w$ can only be satisfied if $a_i =0$ for all $i$ and $b_j=0$ for all $j$. We also know that these vectors form a basis for vector space $V$.
WLOG we know the same thing for $U_2 \oplus V$, $0 = a_1 \pmb u_1 + \dots + a_n \pmb u_n + b_1 \pmb w_1 + \dots + b_w \pmb w_w$
By the uniqueness theorem we know that if $a_1 \pmb u_1 + \dots + a_m \pmb u_m + b_1 \pmb w_1 + \dots + b_w \pmb w_w = a_1 \pmb u_1 + \dots + a_n \pmb u_n + b_1 \pmb w_1 + \dots + b_w \pmb w_w$ it's because the coefficients $a$ and $b$ equal $0$. By theorem $2.7$ "Span is the smallest containing subspace" we know that for these sets to span $V$ and be linearly independent (as claimedby definition of direct sum), that $m=n$.
Since 1) the number of vectors that for a basis in $U_1$ and $U_2$ are the same and 2) are linearly independent from $W$ yet span $V$, it follows that $U_1$ and $U_2$ necessarily span the same space. If they didn't then there exists $\pmb x \in V$ outside the span of $U$.
