I am working on Linear Algebra done Rights 1.15 which states:
Prove or give a counterexample: If U1, U2, W subspaces of V such that U1 ⊕ W = U2 ⊕ W = V then U1 = U2.
I thought it was trivial that U1=U2 because of 1.9:
Suppose U and W are subspaces of V. Then V=U ⊕ W is a direct sum if and only if U ∩ W = {0}
However in the solutions it seems my understanding on intersection is incorrect:

I understand U1 ∩ W = {0} but how can U2 ∩ W = {0}, dont they have in common the entire x-axis? What am I missing about intersections of spaces?
No, they don't:$$U_2=\{(x,x)\,|\,x\in\mathbb R\}\text{ whereas }W=\{(x,0)\,|\,x\in\mathbb R\}.$$So, yes, $U_2\cap W=\{(0,0)\}$.