Decomposition of vector with respect to direct sum of vector subspaces $U$ and $W$ are two subspaces of vector space $V$.
If $U \oplus W = V$, then $\forall v \in V$, there exist two unique vectors $u \in U$ and $w \in W$ such that $v = u + w$.
Is the reverse true? That is, if any vector can has such unique decomposition, do we have $U \oplus W = V$? 
Can the above statements be generalized to finite number of subspaces $U_1,...,U_n$ instead of just two $U$ and $W$?
Thanks for your help!
 A: To add to Gerben's answer:
If every vector $v$ in $V$ has at least one expression of the form $v=u+w$ with $u\in U$ and $w\in W$ ($U$ and $W$ subspaces of $V$), then $V=U+W$.
If every vector $v$ in $V$ has at most one (but possibly none) expression of the form $v=u+w$ with $u\in U$ and $w\in W$, then $U\cap W = \{0\}$.
So if every vector $v$ in $V$ has exactly one expression of the form $v=u+w$ with $u\in U$ and $w\in W$, then $V=U\oplus W$. 
For more than two spaces you have to be a bit careful: it is no longer enough for the $U_i$ to be pairwise disjoint (that is, for $U_i\cap U_j$ to equal $\{0\}$ for $i\neq j$). For an example, take $V=\mathbb{R}^2$, $U_1$ the $x$-axis, $U_2$ the $y$-axis, and $U_3$ the line $x=y$. Then $U_1\cap U_2 = U_1\cap U_3 = U_2\cap U_3 = \{0\}$, but $V$ is not the direct sum of $U_1$ and $U_2$. Instead, you have that given subspaces $U_1,\ldots,U_m$ of $V$,


*

*Each vector $v\in V$ has at least one expression of the form $v=u_1+\cdots + u_m$ with $u_i\in U_i$ if and only if $V=U_1+\cdots+U_m$ (the span of $U_1,\ldots,U_m$).

*Each vector $v\in V$ has at most one (but possibly no) expression of the form $v=u_1+\cdots + u_m$ with $u_i\in U_i$ if and only if for each $i\in\{1,\ldots,m\}$, $U_i\cap(\mathop{\sum}_{i\neq j}U_j) = \{0\}$.
A: Yes. In fact it suffices to verify that the uniqueness of the decomposition implies that $U$ and $W$ are disjoint. Together, they also span $V$, since each vector possesses such a decomposition. To make the proof explicit, consider the mapping $V \rightarrow U \times W$, sending each vector $v$ to its decomposition $(u,w)$; then you can verify the axioms for the direct sum.
For the general case, you can do this by recurrence, using the basic properties of direct sums (in particular associativity).
A: Examples[edit]
For example, the xy-plane, a two-dimensional vector space, can be thought of as the direct sum of two one-dimensional vector spaces, namely the x and y axes. In this direct sum, the x and y axes intersect only at the origin (the zero vector). Addition is defined coordinate-wise, that is (x_1,y_1) + (x_2,y_2) = (x_1+x_2, y_1 + y_2), which is the same as vector addition.
Given two objects A and B, their direct sum is written as A\oplus B. Given an indexed family of objects A_i, indexed with i \in I, the direct sum may be written \textstyle A=\bigoplus_{i\in I}A_i. Each Ai is called a direct summand of A. If the index set is finite, the direct sum is the same as the direct product. In the case of groups, if the group operation is written as + the phrase "direct sum" is used, while if the group operation is written * the phrase "direct product" is used. When the index set is infinite, the direct sum is not the same as the direct product. In the direct sum, all but finitely many coordinates must be zero.
Internal and external direct sums[edit]
A distinction is made between internal and external direct sums, though the two are isomorphic. If the factors are defined first, and then the direct sum is defined in terms of the factors, we have an external direct sum. For example, if we define the real numbers R and then define R \oplus R the direct sum is said to be external. If, on the other hand, we first define some set, S and then write S as the direct sum of two of its proper subsets, then the direct sum is said to be internal. For an example of an internal direct sum, consider Z_6, the integers modulo six, whose elements are {0, 1, 2, 3, 4, 5}.  Z_6 ={0, 3} \oplus {0, 2, 4}.
