---
title: Null Spaces, Column Spaces, and Linear Transformations
module: Vector Spaces
moduleNumber: 4
lessonNumber: 2
order: 402
summary: >
  Two subspaces sit inside every matrix. The null space collects all solutions of
  $Ax = 0$ and lives in the domain; the column space collects every attainable
  $Ax$ and lives in the codomain. One is defined implicitly by a condition, the
  other explicitly by a spanning set, and the same pair appears for an abstract
  linear transformation as its kernel and range.
topics: [Vector Spaces]
draft: false
sources:
  - book: Lay
    ref: "§4.2 Null Spaces, Column Spaces, and Linear Transformations"
---

A matrix $A$ carries two subspaces with it. One lives in the domain of the map
$x \mapsto Ax$ and records what gets sent to zero; the other lives in the codomain
and records what can be reached. The two are described in opposite ways. The same
two subspaces reappear, under the names kernel and range, for any linear
transformation between vector spaces.[^lay-nulcol]

## The null space

> **Definition (Null space).** The null space of an $m \times n$ matrix $A$,
> written $\operatorname{Nul} A$, is the set of all solutions of the homogeneous
> equation $Ax = 0$:
> $$
> \operatorname{Nul} A = \{\, x : x \text{ is in } \mathbb{R}^n \text{ and } Ax = 0 \,\}.
> $$

A vector belongs to $\operatorname{Nul} A$ exactly when the linear transformation
$x \mapsto Ax$ sends it to the zero vector of $\mathbb{R}^m$. Testing membership is
a single matrix-vector product.

> **Worked example.** Is $u = (5, 3, -2)$ in $\operatorname{Nul} A$ for
> $A = \begin{bmatrix} 1 & -3 & -2 \\ -5 & 9 & 1 \end{bmatrix}$?
>
> Compute the product:
> $$
> Au = \begin{bmatrix} 1 & -3 & -2 \\ -5 & 9 & 1 \end{bmatrix}
> \begin{bmatrix} 5 \\ 3 \\ -2 \end{bmatrix}
> = \begin{bmatrix} 5 - 9 + 4 \\ -25 + 27 - 2 \end{bmatrix}
> = \begin{bmatrix} 0 \\ 0 \end{bmatrix}.
> $$
>
> The result is the zero vector of $\mathbb{R}^2$, so $u$ is in
> $\operatorname{Nul} A$.

> **Theorem (Null space is a subspace).** The null space of an $m \times n$
> matrix $A$ is a subspace of $\mathbb{R}^n$. Equivalently, the solution set of a
> homogeneous system of $m$ equations in $n$ unknowns is a subspace of
> $\mathbb{R}^n$.

The proof checks the three subspace conditions using one property of matrix
multiplication, that $A$ distributes over sums and scalars. The zero vector
satisfies $A0 = 0$. If $Au = 0$ and $Av = 0$, then $A(u + v) = Au + Av = 0$, and
$A(cu) = c(Au) = 0$. All three hold, so $\operatorname{Nul} A$ is a subspace. The
homogeneity is essential: the solution set of a nonhomogeneous system $Ax = b$
with $b \neq 0$ omits the zero vector and is never a subspace.

The null space is defined **implicitly**. Membership is stated as a condition to
be checked, not as a list. Producing an explicit spanning set means solving $Ax =
0$ and reading the general solution.

### An explicit spanning set from free variables

Row reduction converts the implicit description into a span.

> **Worked example.** Find a spanning set for $\operatorname{Nul} A$, where
> $$
> A = \begin{bmatrix} -3 & 6 & -1 & 1 & -7 \\ 1 & -2 & 2 & 3 & -1 \\ 2 & -4 & 5 & 8 & -4 \end{bmatrix}.
> $$
>
> Row reduce $[\,A \;\; 0\,]$. Swapping the first two rows for a leading $1$ and
> clearing the first column,
> $$
> \left[\begin{array}{ccccc|c} 1 & -2 & 2 & 3 & -1 & 0 \\ 0 & 0 & 5 & 10 & -10 & 0 \\ 0 & 0 & 1 & 2 & -2 & 0 \end{array}\right]
> \sim
> \left[\begin{array}{ccccc|c} 1 & -2 & 0 & -1 & 3 & 0 \\ 0 & 0 & 1 & 2 & -2 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{array}\right].
> $$
>
> The reduced form gives $x_1 = 2x_2 + x_4 - 3x_5$ and $x_3 = -2x_4 + 2x_5$, with
> $x_2, x_4, x_5$ free. Splitting the general solution into one vector per free
> variable,
> $$
> \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \\ x_5 \end{bmatrix}
> = x_2\begin{bmatrix} 2 \\ 1 \\ 0 \\ 0 \\ 0 \end{bmatrix}
> + x_4\begin{bmatrix} 1 \\ 0 \\ -2 \\ 1 \\ 0 \end{bmatrix}
> + x_5\begin{bmatrix} -3 \\ 0 \\ 2 \\ 0 \\ 1 \end{bmatrix}
> = x_2 u + x_4 v + x_5 w,
> $$
> so $\{u, v, w\}$ spans $\operatorname{Nul} A$.

Two features of this construction hold whenever the null space contains nonzero
vectors:

- **The spanning set is automatically linearly independent.** Each free variable
  is the weight on exactly one vector, and it appears as a $1$ in that vector's
  slot with $0$ there in the others. The combination $x_2 u + x_4 v + x_5 w$ can
  equal $0$ only if every weight is $0$.
- **The number of vectors equals the number of free variables.** This count is
  the dimension of the null space, developed under
  [dimension and rank](/linear-algebra/vector-spaces/dimension-and-rank).

$$
% caption: Each free variable contributes one basis vector of the null space; the
% $1$'s sit in the free-variable slots, forcing linear independence.
\begin{tikzpicture}[font=\footnotesize]
\definecolor{acc}{HTML}{2F6DB5}
\foreach \c/\lab in {0/x_2, 2.4/x_4, 4.8/x_5} {
  \node[acc, font=\small] at (\c+0.55,2.5) {$\lab$};
}
\node[black, anchor=east, font=\scriptsize] at (-0.3,1.9) {$x_2$};
\node[black, anchor=east, font=\scriptsize] at (-0.3,0.7) {$x_4$};
\node[black, anchor=east, font=\scriptsize] at (-0.3,-0.5) {$x_5$};
% three columns as small grids, highlighting the free-variable rows
\foreach \c/\rowone/\rowtwo/\rowthree in {0/1/0/0, 2.4/0/1/0, 4.8/0/0/1} {
  \draw[black] (\c,-1.7) rectangle (\c+1.1,2.3);
}
% mark the identity 1's
\node[acc] at (0.55,1.9) {$1$};
\node[acc] at (2.95,0.7) {$1$};
\node[acc] at (5.35,-0.5) {$1$};
\node[black] at (0.55,0.7) {$0$}; \node[black] at (0.55,-0.5) {$0$};
\node[black] at (2.95,1.9) {$0$}; \node[black] at (2.95,-0.5) {$0$};
\node[black] at (5.35,1.9) {$0$}; \node[black] at (5.35,0.7) {$0$};
\node[black, font=\scriptsize] at (0.55,1.3) {$\vdots$};
\node[font=\small] at (2.95,-2.4) {each free variable gives one independent vector};
\end{tikzpicture}
$$

## The column space

> **Definition (Column space).** The column space of an $m \times n$ matrix
> $A = [\,a_1 \;\; \cdots \;\; a_n\,]$, written $\operatorname{Col} A$, is the set
> of all linear combinations of its columns:
> $$
> \operatorname{Col} A = \operatorname{Span}\{a_1, \dots, a_n\}.
> $$

Because a product $Ax$ is by definition a linear combination of the columns of
$A$, the column space collects the attainable outputs:

$$
\operatorname{Col} A = \{\, b : b = Ax \text{ for some } x \text{ in } \mathbb{R}^n \,\}.
$$

This is the **range** of the map $x \mapsto Ax$. Since it is a span, the
span-subspace theorem applies directly.

> **Theorem (Column space is a subspace).** The column space of an $m \times n$
> matrix $A$ is a subspace of $\mathbb{R}^m$.

The column space is defined **explicitly**: the columns of $A$ are given directly
as a spanning set, and any vector in $\operatorname{Col} A$ is built from them. The solvability criterion from the matrix-equation theory restates as a
statement about $\operatorname{Col} A$:

$$
\operatorname{Col} A = \mathbb{R}^m \iff Ax = b \text{ has a solution for every } b \text{ in } \mathbb{R}^m.
$$

Building a matrix with a prescribed column space is immediate: to realize
$W = \operatorname{Span}\{(6, 1, 7),\, (-1, -1, 0)\}$ as a column space, use those
two vectors as the columns of $A$, and then $W = \operatorname{Col} A$.

$$
% caption: The column space is the span of the columns of $A$: every output $Ax$ is
% a linear combination of $a_1, \dots, a_n$, so $\operatorname{Col} A$ is the flat
% they sweep out through the origin.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{2F6DB5}
\fill[acc!10] (-2.4,-0.9) -- (2.6,-0.2) -- (2.6,1.6) -- (-2.4,0.9) -- cycle;
\draw[acc, thick] (-2.4,-0.9) -- (2.6,-0.2) -- (2.6,1.6) -- (-2.4,0.9) -- cycle;
\draw[->, black, thick] (0,0) -- (1.3,0.15) node[below right] {$a_1$};
\draw[->, black, thick] (0,0) -- (0.35,0.8) node[above] {$a_2$};
\draw[->, black, thick] (0,0) -- (-1.3,0.4) node[above left] {$a_3$};
\draw[->, acc, thick] (0,0) -- (1.55,0.78);
\node[acc, anchor=south west] at (1.55,0.78) {$Ax$};
\fill[black] (0,0) circle (1.4pt);
\node[acc, font=\small] at (-1.85,-0.4) {$\operatorname{Col}A$};
\end{tikzpicture}
$$

## Contrasting the two subspaces

For a non-square $A$ the two subspaces live in different spaces entirely:
$\operatorname{Nul} A \subseteq \mathbb{R}^n$ (the domain) while
$\operatorname{Col} A \subseteq \mathbb{R}^m$ (the codomain). A vector in
$\mathbb{R}^4$ cannot even be compared with a vector in $\mathbb{R}^3$. When $A$ is
square the two share the zero vector, and in special cases they can share more.

$$
% caption: For an $m\times n$ matrix, the null space sits in the domain
% $\mathbb{R}^n$ and the column space is the image inside the codomain
% $\mathbb{R}^m$; the map $x\mapsto Ax$ sends $\operatorname{Nul}A$ to $0$.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{2F6DB5}
% domain
\draw[black] (-0.3,-1.7) rectangle (3.0,1.7);
\node[anchor=south, font=\small] at (1.35,1.7) {$\mathbb{R}^n$ (domain)};
\draw[acc, thick] (0.2,-1.0) -- (2.5,0.6);
\node[acc, font=\scriptsize] at (0.55,-1.25) {$\operatorname{Nul}A$};
\fill[black] (1.35,-0.2) circle (1.4pt);
% codomain
\begin{scope}[xshift=6.5cm]
  \draw[black] (-0.3,-1.7) rectangle (3.0,1.7);
  \node[anchor=south, font=\small] at (1.35,1.7) {$\mathbb{R}^m$ (codomain)};
  \fill[acc!12] (0.4,-0.9) -- (2.5,-0.5) -- (2.2,1.1) -- (0.2,0.6) -- cycle;
  \draw[acc, thick] (0.4,-0.9) -- (2.5,-0.5) -- (2.2,1.1) -- (0.2,0.6) -- cycle;
  \node[acc, font=\scriptsize] at (1.3,0.1) {$\operatorname{Col}A$};
  \fill[black] (2.0,-1.1) circle (1.4pt) node[below] {$0$};
\end{scope}
% arrow
\draw[->, acc, very thick] (3.3,0) -- (6.0,0) node[midway, above] {$x$ to $Ax$};
\end{tikzpicture}
$$

| | $\operatorname{Nul} A$ | $\operatorname{Col} A$ |
| --- | --- | --- |
| Ambient space | subspace of $\mathbb{R}^n$ | subspace of $\mathbb{R}^m$ |
| How defined | implicitly, by the condition $Ax = 0$ | explicitly, as a span of the columns |
| Finding vectors in it | row-reduce $[\,A \;\; 0\,]$ | read off the columns of $A$ |
| Relation to entries of $A$ | none obvious | each column is in it |
| Test $v$ for membership | compute $Av$; check $=0$ | row-reduce $[\,A \;\; v\,]$; check consistency |
| Whole space when | $\operatorname{Nul} A = \{0\}$ iff $x \mapsto Ax$ is one-to-one | $\operatorname{Col} A = \mathbb{R}^m$ iff $x \mapsto Ax$ is onto |

The last row connects the two subspaces to the injectivity and surjectivity of the
underlying map, a link that
[linear transformations](/linear-algebra/linear-systems/linear-transformations)
established for matrices and that the kernel-and-range view below carries to
abstract spaces.

The two membership tests differ because the two subspaces are described in opposite
ways.

> **Worked example.** For
> $$
> A = \begin{bmatrix} 2 & 4 & -2 & 1 \\ -2 & -5 & 7 & 3 \\ 3 & 7 & -8 & 6 \end{bmatrix},
> $$
> is $u = (3, -2, -1, 0)$ in $\operatorname{Nul} A$, and is $v = (3, -1, 3)$ in
> $\operatorname{Col} A$?
>
> For $\operatorname{Nul} A$, compute $Au$ directly:
> $$
> Au = \begin{bmatrix} 2 & 4 & -2 & 1 \\ -2 & -5 & 7 & 3 \\ 3 & 7 & -8 & 6 \end{bmatrix}
> \begin{bmatrix} 3 \\ -2 \\ -1 \\ 0 \end{bmatrix}
> = \begin{bmatrix} 0 \\ -3 \\ 3 \end{bmatrix} \neq 0,
> $$
> so $u$ is not in $\operatorname{Nul} A$. With four entries $u$ cannot be in
> $\operatorname{Col} A \subseteq \mathbb{R}^3$ either.
>
> For $\operatorname{Col} A$, row reduce $[\,A \;\; v\,]$ to test consistency of
> $Ax = v$:
> $$
> \left[\begin{array}{cccc|c} 2 & 4 & -2 & 1 & 3 \\ -2 & -5 & 7 & 3 & -1 \\ 3 & 7 & -8 & 6 & 3 \end{array}\right]
> \sim
> \left[\begin{array}{cccc|c} 2 & 4 & -2 & 1 & 3 \\ 0 & -1 & 5 & 4 & 2 \\ 0 & 0 & 0 & 17 & 1 \end{array}\right].
> $$
> No row reads $0 = \text{nonzero}$, so $Ax = v$ is consistent and $v$ is in
> $\operatorname{Col} A$. With three entries $v$ cannot be in
> $\operatorname{Nul} A \subseteq \mathbb{R}^4$.

## Kernel and range of a linear transformation

Subspaces of abstract vector spaces are often described through a linear map
rather than a matrix. The definition of a linear transformation carries over
unchanged from $\mathbb{R}^n$.

> **Definition (Linear transformation).** A linear transformation $T$ from a
> vector space $V$ into a vector space $W$ is a rule assigning to each $x$ in $V$ a
> unique $T(x)$ in $W$ such that
> $$
> T(u + v) = T(u) + T(v) \quad\text{and}\quad T(cu) = cT(u)
> $$
> for all $u, v$ in $V$ and all scalars $c$.

> **Definition (Kernel and range).** The kernel (or null space) of $T$ is the set
> of all $u$ in $V$ with $T(u) = 0$. The range of $T$ is the set of all vectors in
> $W$ of the form $T(x)$ for some $x$ in $V$.

When $T(x) = Ax$ is a matrix transformation, its kernel is
$\operatorname{Nul} A$ and its range $\operatorname{Col} A$. In general
the kernel is a subspace of the domain $V$ and the range is a subspace of the
codomain $W$; the proofs mirror the null-space and column-space subspace
theorems.

$$
% caption: A linear map $T:V\to W$ collapses its kernel onto the zero vector of
% $W$ and fills out its range; the kernel is a subspace of $V$ and the range a
% subspace of $W$.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{2F6DB5}
\draw[black] (-0.3,-1.8) rectangle (3.1,1.8);
\node[anchor=south, font=\small] at (1.4,1.8) {$V$};
\draw[acc, thick] (0.3,-1.1) -- (2.4,0.7);
\node[acc, font=\scriptsize, anchor=west] at (0.2,-1.35) {kernel};
\begin{scope}[xshift=6.5cm]
  \draw[black] (-0.3,-1.8) rectangle (3.1,1.8);
  \node[anchor=south, font=\small] at (1.4,1.8) {$W$};
  \fill[acc!12] (0.5,-0.8) -- (2.5,-0.4) -- (2.2,1.2) -- (0.3,0.7) -- cycle;
  \draw[acc, thick] (0.5,-0.8) -- (2.5,-0.4) -- (2.2,1.2) -- (0.3,0.7) -- cycle;
  \node[acc, font=\scriptsize] at (1.35,0.2) {range};
  \fill[black] (1.9,-1.2) circle (1.4pt) node[below] {$0$};
\end{scope}
\draw[->, acc, very thick] (3.4,0) -- (6.0,0) node[midway, above] {$T$};
\end{tikzpicture}
$$

Differentiation is a linear transformation on function spaces. Let $V$ be the
space of functions on $[a, b]$ with continuous derivatives, let $W = C[a, b]$ be
the continuous functions, and let $D(f) = f'$. The rules $D(f + g) = D(f) + D(g)$
and $D(cf) = cD(f)$ are the linearity conditions, so $D$ is linear. Its kernel is
the set of constant functions — those with zero derivative — which is a subspace
of $V$. This is the mechanism behind
[difference equations](/linear-algebra/vector-spaces/difference-equations-and-markov):
a solution set of a homogeneous linear equation is the kernel of a linear
transformation, hence a subspace, and much of its structure follows from that fact
alone.

[^lay-nulcol]: **Lay**, _Linear Algebra and Its Applications_, §4.2 — Null Spaces, Column Spaces, and Linear Transformations: Theorem 2 ($\operatorname{Nul} A$ a subspace), Theorem 3 ($\operatorname{Col} A$ a subspace), the implicit/explicit contrast, and the kernel and range of $T : V \to W$.
