Definition 1. Let $W_1, ..., W_k \leq V$. We define the sum of these subspaces to be the set $\{v_1 + \cdots + v_k \,|\, v_i \in W_i \text{ for } 1 \leq i \leq k\}$, which we denote by $$\sum_{i=1}^k W_i.$$
Direct Sum
Definition 2. Let $W_1, ..., W_k \leq V$. We call $V$ the direct sum of $W_1, ..., W_k$ and write $$V = \bigoplus_{i=1}^k W_i,$$ if $V = \sum_{i=1}^k W_i$ and $W_j \cap \sum_{i \neq j} W_i = \{ \mathbf{0} \}$ for each $j (1 \leq j \leq k)$.
Theorem 1
Theorem 1. Let $W_1, ..., W_k \leq V$ where $V$ is finite-dimensional. The following conditions are equivalent. (a) $V = \bigoplus_{i=1}^k W_i$. (b) $V = \sum_{i=1}^k W_i$ and for any $v_1, ..., v_k$ such that $v_i \in W_i (1 \leq i \leq k)$, if $v_1 + \cdots + v_k = \mathbf{0}$, then $v_i = \mathbf{0}, \forall i$. (c) $\forall v \in V, v$ can be uniquely written as $v = v_1 + \cdots + v_k,$ where $v_i \in W_i (1 \leq i \leq k)$. (d) If $\gamma_i$ is an ordered basis for $W_i (1 \leq i \leq k)$, then $\cup_{i=1}^k \gamma_i$ is an ordered basis for $V$. (e) $\forall i \in \{1, ..., k\}$, $\exists$ an ordered basis $\gamma_i$ for $W_i$ such that $\cup_{i=1}^k \gamma_i$ is an ordered basis for $V$.
Proof.(a) $\Longrightarrow$ (b) Clearly $V = \sum_{i=1}^k W_i$. Suppose that $\forall v_i \in W_i (1 \leq i \leq k)$, $v_1 + \cdots + v_k = \mathbf{0}$. Then $-v_j = v_1 + \cdots + v_{j-1} + v_{j+1} + \cdots + v_k$. Note that $-v_j \in W_j \cap \sum_{i \neq j} W_i$. Then $v_j = \mathbf{0}, \forall j$. (b) $\Longrightarrow$ (c) Suppose that there is two representation of $v$: $v = v_1 + \cdots + v_k = u_1 + \cdots + u_k$. Then $(v_1 - u_1) + \cdots + (v_k - u_k) = \mathbf{0}$, and we have each $v_i - u_i = \mathbf{0}$, so $v_i = u_i$ for each $i (1 \leq i \leq k)$. Thus $v$ can be uniquely written as $v = v_1 + \cdots + v_k$. (c) $\Longrightarrow$ (d) $\gamma = \sum_{i=1}^k \gamma_i$ generates $V$ from (c). Suppose that $$\sum_{i=1}^k \sum_{j=1}^{n_i} a_{ij}v_{ij} \text{ for some } a_{ij} \in F,$$ where $n_i = |\gamma_i|$. Denote $w_i = \sum_{j=1}^{n_i} a_{ij}v_{ij}$. Then $\sum_{i=1}^k w_i = \mathbf{0}$. Since $\mathbf{0} = \mathbf{0} + \cdots + \mathbf{0}$, each $w_i = \mathbf{0} = \sum_{j=1}^{n_i} a_{ij}v_{ij}$. Then $a_{ij} = 0, \forall i, \forall j$, because $\gamma_i$ is linearly independent. Thus $\gamma$ is an ordered basis for $V$. (d) $\Longrightarrow$ (e) Trivial. (e) $\Longrightarrow$ (a) Let $\gamma_i$ be an ordered basis for $W_i (1 \leq i \leq k)$ such that $\gamma := \cup_{i=1}^k \gamma_i$ is an ordered basis for $V$. Then $$V = \langle \cup_{i=1}^k \gamma_i \rangle = \langle \gamma_i \rangle + \cdots \langle \gamma_k \rangle = \sum_{i=1}^k W_i.$$ Suppose that for some $v \in W_j \cap \sum_{i \neq j} W_i$, $v$ is nonzero. Then $v \in W_j = \langle \gamma_j \rangle$ and $v \in \sum_{i \neq j} W_i = \langle \cup_{i \neq j} \gamma_i \rangle$. Thus $v$ can be expressed as a linear combination of $\gamma$ in more than one way. $\bigotimes$ Thus $v = \mathbf{0}$. Hence for each $j (1 \leq j \leq k)$, $W_j \cap \sum_{i \neq j} W_i = \{ \mathbf{0}\}$ , i.e., $V = \bigoplus_{i=1}^k W_i$. $\blacksquare$
Remark
Remark. If $V = \bigoplus_{i=1}^k W_i$, then $W_i \cap W_j = \{ \mathbf{0}\}$ for all $i \neq j$.
Theorem 2
Theorem 2. Let $W_1, W_2 \leq V$ be finite-dimensional. Then $W_1 + W_2$ is finite-dimensional, and $\dim(W_1 + W_2) = \dim(W_1) + \dim(W_2) - \dim(W_1 \cap W_2)$.
Proof. Let $\gamma = \{u_1, ..., u_k\}$ be a basis for $W_1 \cap W_2$. Extend $\gamma$ to a basis $\beta_1 = \{u_1, ..., u_k, v_1, ..., v_m\}$ for $W_1$ and $\beta_2 = \{u_1, ..., u_k, w_1, ..., w_p\}$ for $W_2$. Let $\beta := \beta_1 \cup \beta_2 = \{u_1, ..., u_k, v_1, ..., v_m, w_1, ..., w_p\}$. Clearly, $\langle \beta \rangle = W_1 + W_2$. Thus $\beta$ generates $W_1 + W_2$. Suppose that $\beta_1 \cup \{w_1\}$ is linearly dependent. Then $w_1 \in \langle \beta_1 \rangle$. Then $w_1 = \sum_{i=1}^k a_kw_k + \sum_{j=1}^m b_jv_j$ for some $a_i, b_j \in F$. Note that $w_1 \in W_1 \cap W_2$. Then $w_1 = \sum_{i=1}^k c_iu_i$ for some $c_i \in F$. Thus $\sum_{i=1}^k (c_i - a_i)u_i + \sum_{j=1}^m b_jv_j = \mathbf{0}$, so $c_i = a_i$ and $b_j = 0$ for all $i, j$. By Theorem 2, $w_1 \in \langle \gamma \rangle$, so $\gamma \cup \{w_1\}$ is linearly dependent. $\bigotimes$ In similar manner, we can show that $S_i = \{u_1, ..., u_k, v_1, ..., v_m, w_1, ..., w_i\}$ is linearly independent for $1 \leq i \leq p$. Since $\beta = S_p$ is linaerly independent, $\beta$ is a basis for $W_1 + W_2$. Hence $W_1 + W_2$ is finite-dimensional, and $\dim(W_1) + \dim(W_2) - \dim(W_1 \cap W_2)$ = $k + m + k + p- k$ = $k+m+p = \dim(W_1 + W_2)$. $\blacksquare$
Corollary
Corollary. Let $W_1, W_2 \leq V$ be finite-dimensional, and let $V = W_1 + W_2$. Then $V = W_1 \bigoplus W_2$ $\iff$ $\dim(V) = \dim(W_1) + \dim(W_2)$.
Direct Sum of Matrices
Definition 3. Let $B_1 \in M_{m \times m}(F)$, and let $B_2 \in M_{n \times n}(F)$. We define the direct sum of $B_1$ and $B_2$, denoted $B_1 \bigoplus B_2$, as the $(m+n) \times (m + n)$ matrix $A$ such that $$A_{ij} = \begin{cases} (B_1)_{ij} & \text{for } 1 \leq i, j \leq m \\ (B_2)_{(i - m), (j - m)} & \text{for } m+1 \leq i, j \leq n+m \\ 0 & \text{otherwise} \end{cases}.$$ If $B_1, ..., B_k$ are square matrices with entries from $F$, then we define the direct sum of $B_1, ..., B_k$ recursively by $$\bigoplus_{i=1}^k B_i = (\bigoplus_{i=1}^{k-1} B_i) \bigoplus B_k.$$ If $A = \bigoplus_{i=1}^k B_i,$ then we often write $A = \begin{pmatrix} B_1 & \cdots & O \\ \vdots & \ddots & \vdots \\ O & \cdots & B_k \end{pmatrix}$.
Theorem 3
Theorem 3. Let $T \in \mathcal{L}(V)$ where $V$ is finite-dimensional, and let $W_1, ..., W_k$ be $T$-invariant subspaces of $V$ such that $V = \bigoplus_{i=1}^k W_i$. For each $i$, let $\beta_i$ be an ordered basis for $W_i$, and let $\beta = \cup_{i=1}^k \beta_i$. Let $A = [T]_{\beta}$ and $B_i = [T_{W_i}]_{\beta_i}$ for $i = 1, ..., k$. Then $A = \bigoplus_{i=1}^k B_i$.