Tutorials › Linear Algebra › Row Space And Null Space Orthogonality

Orthogonal Complements and Projections · Tutorial 664 of 1000

Row Space And Null Space Orthogonality

Connect the equations defining a matrix’s null space to orthogonality of its rows and row space.

Intermediate 10 min read

What You'll Learn

  • Express each row of a matrix as a column vector in the same space as its inputs.
  • Use the matrix-vector product to test whether a vector lies in the null space.
  • Prove that every row of a matrix is orthogonal to every null-space vector.
  • Show that every linear combination of the rows is also orthogonal to the null space.
  • Find null spaces and verify row-space orthogonality in concrete examples.
  • Spot and correct a common error when solving null-space equations.

Null-Space Equations Are Row Orthogonality Conditions

For a matrix \(\mathbf{A}\), the null space consists of the input vectors \(\mathbf{x}\) satisfying \(\mathbf{A}\mathbf{x}=\mathbf{0}\). Each entry of \(\mathbf{A}\mathbf{x}\) is a dot product of \(\mathbf{x}\) with one row of \(\mathbf{A}\). Thus, a null-space vector must be orthogonal to every row. Because the row space consists of linear combinations of those rows, the same orthogonality holds for every vector in the row space.

Throughout this tutorial, let \(\mathbf{A}\in\mathbb{R}^{m\times n}\), and take all vectors and inner products over \(\mathbb{R}\). The inputs to \(\mathbf{A}\) are columns in \(\mathbb{R}^n\). To use the dot product with a row, we write that row as a column vector by transposing it.

Definition: The null space of \(\mathbf{A}\) is \(\operatorname{Nul}\mathbf{A}=\{\mathbf{x}\in\mathbb{R}^n:\mathbf{A}\mathbf{x}=\mathbf{0}\}\). If the rows of \(\mathbf{A}\), written as columns, are \(\mathbf{r}_1,\dots,\mathbf{r}_m\in\mathbb{R}^n\), then the row space is \(\operatorname{Row}\mathbf{A}=\operatorname{span}\{\mathbf{r}_1,\dots,\mathbf{r}_m\}\). For a subspace \(S\subseteq\mathbb{R}^n\), its orthogonal complement is \(S^\perp=\{\mathbf{x}\in\mathbb{R}^n:\mathbf{x}\cdot\mathbf{s}=0\text{ for every }\mathbf{s}\in S\}\).

In coordinates, if the \(i\)th row of \(\mathbf{A}\) is \((a_{i1},\dots,a_{in})\), then \(\mathbf{r}_i=(a_{i1},\dots,a_{in})^\top\). For any \(\mathbf{x}=(x_1,\dots,x_n)^\top\), the \(i\)th entry of \(\mathbf{A}\mathbf{x}\) is \(a_{i1}x_1+\cdots+a_{in}x_n=\mathbf{r}_i\cdot\mathbf{x}\). The null-space condition therefore requires all \(m\) of these row dot products to be zero.

From Each Row to the Whole Row Space

Proposition: For \(\mathbf{A}\in\mathbb{R}^{m\times n}\), a vector \(\mathbf{x}\in\mathbb{R}^n\) belongs to \(\operatorname{Nul}\mathbf{A}\) if and only if \(\mathbf{r}_i\cdot\mathbf{x}=0\) for every row vector \(\mathbf{r}_i\) of \(\mathbf{A}\), written as a column.

Proof. By the definition of matrix-vector multiplication, the \(i\)th entry of \(\mathbf{A}\mathbf{x}\) is \(\mathbf{r}_i\cdot\mathbf{x}\). A vector belongs to \(\operatorname{Nul}\mathbf{A}\) exactly when every entry of \(\mathbf{A}\mathbf{x}\) is zero. This is equivalent to requiring \(\mathbf{r}_i\cdot\mathbf{x}=0\) for every \(i\). The argument applies to every row, including a zero row, whose dot product is automatically zero. \(\square\)

Theorem: For every real matrix \(\mathbf{A}\in\mathbb{R}^{m\times n}\), \(\operatorname{Row}\mathbf{A}\subseteq(\operatorname{Nul}\mathbf{A})^\perp\).

Proof. Let \(\mathbf{y}\in\operatorname{Row}\mathbf{A}\) and \(\mathbf{x}\in\operatorname{Nul}\mathbf{A}\). By the definition of row space, there are scalars \(c_1,\dots,c_m\in\mathbb{R}\) such that \(\mathbf{y}=c_1\mathbf{r}_1+\cdots+c_m\mathbf{r}_m\). The proposition gives \(\mathbf{r}_i\cdot\mathbf{x}=0\) for every \(i\). By linearity of the dot product in its first argument, \[ \mathbf{y}\cdot\mathbf{x} =(c_1\mathbf{r}_1+\cdots+c_m\mathbf{r}_m)\cdot\mathbf{x} =c_1(\mathbf{r}_1\cdot\mathbf{x})+\cdots+c_m(\mathbf{r}_m\cdot\mathbf{x})=0. \] This holds for every \(\mathbf{x}\in\operatorname{Nul}\mathbf{A}\), so \(\mathbf{y}\in(\operatorname{Nul}\mathbf{A})^\perp\). Since \(\mathbf{y}\) was arbitrary in the row space, the stated inclusion follows. \(\square\)

The theorem says that every vector built from the rows remains orthogonal to every null-space vector. The coefficients in a row-space combination can be any real numbers; there is no requirement that the rows be independent. Even if some rows are redundant or zero, the argument still applies.

Worked Examples

Worked Example: Proportional Rows

Let \(\mathbf{A}=\begin{bmatrix}1&2&-1\\2&4&-2\end{bmatrix}\). Find its null space and verify that its row space lies in the orthogonal complement of that null space.

Writing the rows as columns gives \(\mathbf{r}_1=(1,2,-1)^\top\) and \(\mathbf{r}_2=(2,4,-2)^\top\). For \(\mathbf{x}=(x_1,x_2,x_3)^\top\), the equation \(\mathbf{A}\mathbf{x}=\mathbf{0}\) is \(x_1+2x_2-x_3=0\) and \(2x_1+4x_2-2x_3=0\). The second equation is twice the first, so the null space is determined by \(x_1=-2x_2+x_3\). Setting \(x_2=s\) and \(x_3=t\) gives \(\mathbf{x}=(-2s+t,s,t)^\top=s(-2,1,0)^\top+t(1,0,1)^\top\).

Check the null-space calculation by multiplying:

$$ \mathbf{A}\begin{bmatrix}-2s+t\\s\\t\end{bmatrix} = \begin{bmatrix} (-2s+t)+2s-t\\ 2(-2s+t)+4s-2t \end{bmatrix} = \begin{bmatrix}0\\0\end{bmatrix}. $$

Every vector in the row space has the form \(\mathbf{y}=c_1\mathbf{r}_1+c_2\mathbf{r}_2=(c_1+2c_2,2c_1+4c_2,-c_1-2c_2)^\top\). Its dot product with a general null-space vector is

$$ \mathbf{y}\cdot\mathbf{x} =(c_1+2c_2)(-2s+t)+(2c_1+4c_2)s+(-c_1-2c_2)t=0. $$

Indeed, the coefficient of \(s\) is \(-2c_1-4c_2+2c_1+4c_2=0\), and the coefficient of \(t\) is \(c_1+2c_2-c_1-2c_2=0\). This verifies the orthogonality for arbitrary row-space coefficients and arbitrary null-space parameters.

Worked Example: Two Independent Row Conditions

Let \(\mathbf{B}=\begin{bmatrix}1&1&0\\0&1&1\end{bmatrix}\). Find \(\operatorname{Nul}\mathbf{B}\) and check the row-space inclusion directly.

The equations for \(\mathbf{x}=(x_1,x_2,x_3)^\top\) are \(x_1+x_2=0\) and \(x_2+x_3=0\). Taking \(x_2=t\) gives \(x_1=-t\) and \(x_3=-t\), hence \(\mathbf{x}=t(-1,1,-1)^\top\). Multiplication confirms the answer:

$$ \mathbf{B}\begin{bmatrix}-t\\t\\-t\end{bmatrix} = \begin{bmatrix}-t+t\\t-t\end{bmatrix} = \begin{bmatrix}0\\0\end{bmatrix}. $$

The rows, written as columns, are \(\mathbf{r}_1=(1,1,0)^\top\) and \(\mathbf{r}_2=(0,1,1)^\top\). For any \(\mathbf{y}=a\mathbf{r}_1+b\mathbf{r}_2=(a,a+b,b)^\top\) in the row space,

$$ \mathbf{y}\cdot\begin{bmatrix}-t\\t\\-t\end{bmatrix} =-at+(a+b)t-bt=0. $$

The cancellation holds for all real \(a,b,t\). Thus every vector in the row space is orthogonal to every vector in the null space, not only to the particular null-space generator shown.

Worked Example: A Redundant Third Row

Consider \(\mathbf{C}=\begin{bmatrix}1&1&0&0\\0&1&1&0\\1&2&1&0\end{bmatrix}\). The third row is the sum of the first two. Find the null space and verify orthogonality for a general vector in the row space.

The first two null-space equations are \(x_1+x_2=0\) and \(x_2+x_3=0\). The third equation, \(x_1+2x_2+x_3=0\), is their sum, so it adds no further condition. Let \(x_2=t\) and \(x_4=s\). Then \(x_1=-t\), \(x_3=-t\), and \(\mathbf{x}=(-t,t,-t,s)^\top\). Direct multiplication checks all three equations:

$$ \mathbf{C}\begin{bmatrix}-t\\t\\-t\\s\end{bmatrix} = \begin{bmatrix} -t+t\\ t-t\\ -t+2t-t \end{bmatrix} = \begin{bmatrix}0\\0\\0\end{bmatrix}. $$

Write the rows as \(\mathbf{r}_1=(1,1,0,0)^\top\), \(\mathbf{r}_2=(0,1,1,0)^\top\), and \(\mathbf{r}_3=(1,2,1,0)^\top\). A general row-space vector is \(\mathbf{y}=a\mathbf{r}_1+b\mathbf{r}_2+c\mathbf{r}_3=(a+c,a+b+2c,b+c,0)^\top\). Its dot product with the general null-space vector is

$$ \mathbf{y}\cdot\mathbf{x} =-(a+c)t+(a+b+2c)t-(b+c)t+0\cdot s=0. $$

The \(t\)-coefficient simplifies to \(-a-c+a+b+2c-b-c=0\), while \(s\) contributes zero because the last coordinate of every row-space vector here is zero. This check includes the redundant third row without assuming that the rows are independent.

A Common Mistake: Solving the Wrong Equations

When solving \(\mathbf{A}\mathbf{x}=\mathbf{0}\), each row gives one equation, and every coefficient must be retained. For \(\mathbf{B}\) in the second example, a tempting error is to read the first row \((1,1,0)\) as if its equation were \(x_1+2x_2=0\). That mistaken equation, together with \(x_2+x_3=0\), would suggest \(\mathbf{x}=(-2,1,-1)^\top\) when \(x_2=1\). But multiplication exposes the error:

$$ \mathbf{B}\begin{bmatrix}-2\\1\\-1\end{bmatrix} = \begin{bmatrix}-2+1\\1-1\end{bmatrix} = \begin{bmatrix}-1\\0\end{bmatrix} \ne\mathbf{0}. $$

So that vector is not in the null space and cannot be used to test the claimed orthogonality. The correct first equation is \(x_1+x_2=0\), which gives \(\mathbf{x}=(-1,1,-1)^\top\) when \(x_2=1\). Checking it gives \(\mathbf{B}\mathbf{x}=(0,0)^\top\), and the row dot products are \(1\cdot(-1)+1\cdot1+0\cdot(-1)=0\) and \(0\cdot(-1)+1\cdot1+1\cdot(-1)=0\).

A reliable order is to write the matrix equation as one scalar equation per row, solve those equations, and then multiply the proposed null-space vector by the original matrix. The multiplication checks membership in the null space; the row dot products then check the orthogonality statement.

Why the Inclusion Is Useful

The result links two different ways of describing vectors in \(\mathbb{R}^n\). The null space is described by equations involving \(\mathbf{A}\mathbf{x}\), while the row space is described by combinations of the rows. Orthogonality connects the descriptions: any null-space vector has zero dot product with each row, and therefore with every row-space combination.

Keep the direction of the inclusion precise: the result proved here is \(\operatorname{Row}\mathbf{A}\subseteq(\operatorname{Nul}\mathbf{A})^\perp\). It says that row-space vectors satisfy the defining orthogonality condition. It does not, by itself, establish the reverse inclusion. When checking a particular matrix, use the definitions: find vectors in the null space, write a general row-space vector, and evaluate their dot product.

Check Your Understanding

Use the row equations and dot products to justify each answer.

  1. For \(\mathbf{A}=\begin{bmatrix}1&0&2\\0&1&-1\end{bmatrix}\), find a spanning vector for \(\operatorname{Nul}\mathbf{A}\), then check its dot product with each row.
  2. Explain why a linear combination of rows remains orthogonal to every vector in \(\operatorname{Nul}\mathbf{A}\).
  3. For \(\mathbf{D}=\begin{bmatrix}1&2\\2&4\end{bmatrix}\), solve \(\mathbf{D}\mathbf{x}=\mathbf{0}\) and verify the row dot products.
  4. State the difference between \(\operatorname{Row}\mathbf{A}\) and \(\operatorname{Nul}\mathbf{A}\) in terms of how each is defined.
  5. For the incorrect proposed vector \((-2,1,-1)^\top\) in the common-mistake example, compute \(\mathbf{B}\mathbf{x}\) and identify which row equation fails.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon