# Complement (linear algebra)

In linear algebra, a complement to a subspace of a vector space is another subspace which forms a direct sum. Two such spaces are mutually complementary.

Formally, if U and W are subspaces of V, then W is a complement of U if and only if V is the internal direct sum of U and W, $V = U \oplus W$, that is:

$V = U + W ;\,$
$U \cap W = \{0\} .\,$

Equivalently, every element of V can be expressed uniquely as a sum of an element of U and an element of W. The complementarity relation is symmetric, that is, if W is a complement of U then U is also a complement of W.

If V is finite-dimensional then for complementary subspaces U, W we have

$\dim V = \dim U + \dim W .\,$

In general a subspace does not have a unique complement (although the zero subspace and V itself are the unique complements each of the other). However, if V is in addition a finite-dimensional inner product space, then there is a unique orthogonal complement

$U^\perp = \{ v \in V : (v,u) = 0 \mbox{ for all } u \in U \} . \,$