# Linear Algebra - (Direct Sum | Union) of vector spaces

Let U and V be two vector spaces consisting of D-vectors over a field F.

Definition: If U and V share only the zero vector then we define the direct sum of U and V to be the set: $$\{u + v : u \in U, v \in V\}$$ written: $$U \oplus V$$ That is, $U \oplus V$ is the set of all sums of a vector in U and a vector in V.

## Computation

In Python, [u+v for u in U for v in V]

## Properties

• $U \oplus V$ is a vector space
• The union of a set of generators of U, and a set of generators of V is a set of generators for $U \oplus V$
• Union of a basis of U and a basis of V is a basis of $U \oplus V$ because the union is linearly independent

## Corollary

### Dimension

$dim U + dimV = dimU \oplus V$

## Example

### over Gf2

Vectors over GF(2):

Let U = Span {1000, 0100} and let V = Span {0010}.

• Every non-zero vector in U has a one in the first or second position (or both) and nowhere else.
• Every non-zero vector in V has a one in the third position and nowhere else. Therefore the only vector in both U and V is the zero vector.

Therefore $U \oplus V$ is defined.

$$\begin{eqnarray*} U \oplus V & = \{& 0000+0000,& 1000+0000, &0100+0000, &1100+0000, &0000+0010, &1000+0010, &0100+0010, &1100+0010\} \\ & = \{&0000,& 1000,& 0100, &1100, &0010, &1010, &0110, &1110\} \end{eqnarray*}$$

### over $\mathbb{R}$

• Let U = Span {[4,−1, 1]}.
• Let V = Span {[0, 1, 1]}.

The only intersection is at the origin, so $U \oplus V$ is defined.

$U \oplus V$ is the set of vectors u + v where $u \in U \text{ and } v \in V$

This is just Span {[4,−1, 1], [0, 1, 1]}, Plane containing the two lines