For finite-dimensional subspaces with direct sum, $\dim(U_1\oplus\cdots\oplus U_k)=\sum_i\dim U_i$. Combine bases of the components: they span by definition of the sum and are independent by uniqueness of decomposition. In general, $\dim(U+W)=\dim U+\dim W-\dim(U\cap W)$.