TITLE: Proving that $\mathbf{W}$+$\mathbf{W^{\perp}}$=$\mathbb{R^{n}}$
QUESTION [11 upvotes]: I am trying to prove that given a subspace $\mathbf{W}$ in $\mathbb{R^{n}}$, the subspace and its orthogonal complement 'cover' whole of $\mathbb{R^{n}}$ through '+' where we define $\mathbf{W}$+$\mathbf{W^{\perp}}$ as linear combinations of vectors both in the subspace and in its orthogonal complement. It seems intuitively right, and I can prove that the sum of their dimensions adds up to n, but I am not sure how to prove the question I am looking at. Thanks!

REPLY [5 votes]: Suppose $W$ has dimension $k$, and start with a basis $v_1,\ldots,v_k$ of $W$.  This is a linearly independent subset of $\mathbb{R}^n$, so it may be extended to a basis $v_1,\ldots,v_n$ of $\mathbb{R}^n$.
Apply the Gram-Schmidt process to $v_1,\ldots,v_n$ to obtain an orthonormal basis $w_1,\ldots,w_n$ for $\mathbb{R}^n$ such that $w_1,\ldots,w_k$ is an orthonormal basis for $W$.  Now take any vector $z = a_1 w_1 + \ldots + a_k w_k + a_{k+1} w_{k+1} + \ldots + a_n w_n$ of $\mathbb{R}^n$.  The conditions for $z \in W^{\perp}$ are 
precisely   
$\langle z,w_1 \rangle = \ldots = \langle z,w_k \rangle= 0$,  
i.e., 
$a_1 = \ldots = a_k = 0$.  
Thus $W^{\perp}$ is the span of $w_{k+1},\ldots,w_n$ and 
$\mathbb{R}^n = W \oplus W^{\perp}$.  

In the above argument, the key is showing that $\dim W + \dim W^{\perp} = \dim \mathbb{R}^n$ (as Jonas Meyer says in his answer).  Another argument for this, valid for any nondegenerate symmetric bilinear form $(u,v) \mapsto B(u,v)$ on a vector space $V$ (not necessarily finite-dimensional) over a field $K$ is given in $\S 4$ of these notes on quadratic forms.  Note that a general nondegenerate bilinear form could be isotropic: that is, one may have nonzero vectors $v$ with $B(v,v) = 0$ and thus $Kv \cap (Kv)^{\perp} \neq 0$.  But by definition an inner product is anisotropic, which forces $W \cap W^{\perp} = 0$ for all subspaces $W$.