Linear AlgebraOrthogonality and Least Squares

Orthogonal Complements

Row space and null space are perpendicular.

Not started Jump to practice

A vector can be orthogonal to a whole subspace: perpendicular to every vector in it. Collecting all such vectors gives another subspace, and for a matrix this links the row space to the null space.

For a subspace $W$ of $\mathbb{R}^n$, the orthogonal complement $W^{\perp}$ is the set of all $\mathbf{z}$ with $\mathbf{z}\cdot\mathbf{w} = 0$ for every $\mathbf{w}$ in $W$. To test membership it is enough to check a spanning set of $W$: if $\mathbf{z}$ is orthogonal to each $\mathbf{w}_i$, it is orthogonal to every combination of them.

Key idea

$(\operatorname{Row} A)^{\perp} = \operatorname{Nul} A$ and $(\operatorname{Col} A)^{\perp} = \operatorname{Nul} A^{T}$. Also $\dim W + \dim W^{\perp} = n$.

Why it works

$A\mathbf{x} = \mathbf{0}$ says, row by row, that (row $i$ of $A$)$\cdot\mathbf{x} = 0$ for each $i$. So $\mathbf{x}$ solves $A\mathbf{x} = \mathbf{0}$ exactly when it is orthogonal to every row, and so to every combination of rows: $\operatorname{Nul} A = (\operatorname{Row} A)^{\perp}$. Applying this to $A^{T}$, whose rows are the columns of $A$, gives the second statement. The dimension count is rank–nullity: if $W = \operatorname{Row} A$ has dimension $r$, then $\dim \operatorname{Nul} A = n - r$.

Worked example: Complement of a line

Describe $W^{\perp}$ for $W = \operatorname{Span}\{(1, 1, 1)\}$ in $\mathbb{R}^3$, and give a basis.
  1. $\mathbf{z} = (x, y, z)$ is in $W^{\perp}$ when $x + y + z = 0$: a plane through the origin.
  2. Solve: $x = -y - z$; with $y = s$, $z = t$: $\mathbf{z} = s(-1, 1, 0) + t(-1, 0, 1)$.
  3. Dimensions: $1 + 2 = 3$. ✓

Answer: The plane $x + y + z = 0$, basis $\{(-1, 1, 0), (-1, 0, 1)\}$.

Worked example: Complement of a plane

Find $W^{\perp}$ for $W$ $= \operatorname{Span}\{(1, 0, 1), (0, 1, 2)\}$.
  1. Put the spanning vectors in the rows of $A = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 2 \end{bmatrix}$; then $W^{\perp} = \operatorname{Nul} A$.
  2. $A$ is already reduced: $x = -z$, $y = -2z$, $z$ free.
  3. $W^{\perp} = \operatorname{Span}\{(-1, -2, 1)\}$, a line. Check: $(-1, -2, 1)\cdot(1, 0, 1) = 0$ and $(-1, -2, 1)\cdot(0, 1, 2) = 0$. ✓

Answer: The line through $(-1, -2, 1)$.

In $\mathbb{R}^3$, the cross product $\mathbf{u} \times \mathbf{v} = (-1, -2, 1)$ points along $W^{\perp}$, perpendicular to the whole plane spanned by $\mathbf{u}$ and $\mathbf{v}$.

Two more facts: $W \cap W^{\perp} = \{\mathbf{0}\}$ (a vector orthogonal to itself has $\mathbf{z}\cdot\mathbf{z} = 0$, so it is $\mathbf{0}$), and $(W^{\perp})^{\perp} = W$. Together with the dimension count they say that $\mathbb{R}^n$ splits cleanly into $W$ and $W^{\perp}$: every vector is a piece in $W$ plus a piece in $W^{\perp}$, which is the next topic.

The four fundamental subspaces come in perpendicular pairs.
Subspace ofOrthogonal complement of
$\operatorname{Nul} A$$\mathbb{R}^n$$\operatorname{Row} A$
$\operatorname{Nul} A^{T}$$\mathbb{R}^m$$\operatorname{Col} A$

Orthogonal complements turn "solve a system" into geometry. Every row of $A$ is a normal vector to the solution set of $A\mathbf{x} = \mathbf{0}$. For one equation in $\mathbb{R}^3$, that is the familiar fact that $(a, b, c)$ is perpendicular to the plane $ax + by + cz = 0$.

Common mistake

Checking orthogonality against only one vector of $W$ when $W$ is a plane. $\mathbf{z}$ must be orthogonal to every vector in a spanning set, here both $\mathbf{w}_1$ and $\mathbf{w}_2$.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • Margalit and Rabinoff, Interactive Linear Algebra (Georgia Tech), §6.2 Orthogonal Complements
  • MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang, Spring 2010), Lecture 14: Orthogonal Vectors and Subspaces
@teddyrookbook GitHub