[Math] How to construct orthogonal complement subspace of any subspace

linear algebraorthogonalityvector-spaces

If I have one subspace $V$ belong to $\mathbb{R}^{n}$, the subspace has basis $v_{1},v_{2},\cdot\cdot\cdot,v_{k}$,where $k<n$. I want to find the orthogonal complement subspace $V^{\perp}$ of $V$.
$$V^{\perp}=span(u_{1},u_2,\cdot\cdot\cdot,u_{n-k})$$
Could anyone tell me how to construct the $V^{\perp}$?

Best Answer

What you want is the kernel (null-space) of the matrix $$ \pmatrix{ -&v_1^T&-\\ -&v_2^T&-\\ &\vdots\\ -&v_k^T&- } $$ this may be found by row-reduction. If each of the $v_i$ are mutually orthogonal, however, using the Gram Schmidt process is faster.


Gram-Schmidt process: let $e_1,\dots,e_n$ denote the standard basis vectors of $\Bbb R^n$. Begin by row-reducing the matrix $$ \pmatrix{ v_1 & \cdots & v_k & e_1 & \cdots & e_n } $$ there will be $n$ pivot columns once this matrix is row-reduced. $k$ of them will be in the first $k$ columns, and the rest fall in the last $n$ positions.

Let $x_1,\dots,x_{n-k}$ be the vectors $e_i$ such that $e_i$ became a pivot.

Apply the Gram Schmidt process to $\{v_1,\dots,v_k,x_1,\dots,x_{n-k}\}$.