Skip to main content
Mathematics
LINEAR ALGEBRA · BEGIN WITH Ax = b

Four fundamental subspaces

Solving the linear system Ax=bAx = b asks which input vector xx is mapped by the matrix AA to a specified output bb. When a matrix collapses space, as in the zero-determinant cases of determinants, two difficulties occur together: some targets bb cannot be reached at all, while reachable targets correspond to multiple distinct inputs. Organizing both solvability and non-uniqueness is the role of the four fundamental subspaces.

Keeping linear transformations and row-by-row dot products from matrix multiplication in view, we introduce the column space, row space, null space, and left null space in response to the questions of which outputs are reachable and which inputs map to zero, prove their pairwise orthogonality, and show how every solution to Ax=bAx = b decomposes into a row-space component plus a null-space component.

After this page, you should be able to solve

  • Determine whether Ax=bAx = b has a solution for a given matrix AA and target bb by testing membership in the column space or orthogonality to the left null space.
  • Use the null space to explain why distinct inputs such as (1,3)(1, 3) and (3,2)(3, 2) produce the same output, and write the complete solution set of Ax=bAx = b as one particular solution plus a null-space vector.
  • Decompose any input vector xx uniquely into a row space component and a null space component, and prove the orthogonal pairings among the four subspaces.
  • Trace from the four-subspace diagram how AA maps the row space one-to-one onto the column space while mapping the entire null space to the zero vector.

Recall: matrices and linear transformations · Recall: the dot product

01What are we solving?

Recall what a matrix does in the linear-transformation page. We begin with a vector x, apply A, and get a new vector b. The equation Ax = b writes this process in one line. Here A is fixed. We will use the same matrix throughout the main explanation.

A=(1224),x=(13),Ax=(714)A=\begin{pmatrix}1&2\\2&4\end{pmatrix},\qquad x=\begin{pmatrix}1\\3\end{pmatrix},\qquad Ax=\begin{pmatrix}7\\14\end{pmatrix}

In the left picture, the dark arrow is the original x. Play the transformation to follow its endpoint to Ax. The right picture shows the output separately. Both pictures use the same coordinate scale; the right-hand axes are called b₁ and b₂ because we are reading the output there.

Choose a step when you are ready. The explanation will wait while you inspect the diagram.

Start with an input

x-20-20-10-1010102020x₁x₂0

Read the output

b = Ax-20-20-10-1010102020b₁b₂0
1
3
0%

The animation joins the starting and final positions to show the change. A itself is the rule giving the final position, not a claim that a vector physically travels along that path.

02What are the four spaces called?

The same matrix A sends inputs to outputs. Four sets of vectors appear in this process, and each has a name. The table describes what belongs to each set and gives its dimension. The following sections explain what each set tells us about the transformation.

Let mm count the rows of AA and nn count its columns. Inputs therefore have nn components and outputs have mm. A space’s dimension counts how many independent directions are needed to build all its vectors: a line through zero needs one, a plane needs two. We call the dimension of the column space the rank, written rr. In our example, the second column is twice the first, so every output lies on the line through (1,2)(1,2); every point of that line is reached by an input (t,0)(t,0). Thus m=n=2m=n=2 and r=1r=1. The table previews the four counts. We will derive the counts n−rn-r and m−rm-r, and the relations below, after constructing the spaces; they are not new rules to memorize now.

The four spaces, their definitions and their dimensions
NameWhat it containsWhere it livesDimension
Row⁡(A)\operatorname{Row}(A)Row spaceEach row of A is a vector in the input space. The row space is every linear combination of those rows.Rn\mathbb R^nrr
Col⁡(A)\operatorname{Col}(A)Column spaceEach column of A is a vector in the output space. The column space is every linear combination of those columns, so it is exactly the set of reachable outputs.Rm\mathbb R^mrr
Null⁡(A)\operatorname{Null}(A)Null spaceEvery input x that A sends to zero: all solutions of Ax = 0.Rn\mathbb R^nn−rn-r
Null⁡(AT)\operatorname{Null}(A^{T})Left null spaceEvery vector y in the output-side space that Aᵀ sends to zero: all solutions of Aᵀy = 0. Such a y need not be a reachable output Ax. Transposing Aᵀy = 0 gives yᵀA = 0, so yᵀ stands on the left of A; that is where the name comes from.Rm\mathbb R^mm−rm-r

How do these spaces relate to A itself? A sends every vector in the row space into the column space, and this mapping loses no information: different row-space vectors have different outputs. A sends every vector in the null space to zero. On the output side, Aᵀ sends every vector in the left null space to zero.

The two pairs are perpendicular. In the input space, every row-space vector is perpendicular to every null-space vector. In the output space, every column-space vector is perpendicular to every left-null-space vector. The right-angle marks in the diagram below show these two pairs.

ℝnℝmINPUT · n = 2OUTPUT · m = 2ARow spaceRow(A)dim = r = 1Null spaceNull(A)dim = n − r = 1Column spaceCol(A)dim = r = 1Left null spaceNull(Aᵀ)dim = m − r = 1Axr = bAx = bAxn = 000xrbxnx = xr + xnSchematic geometry · right-angle marks denote orthogonal subspaces · read dimensions from the labels

The coloured regions name the four subspaces: Row(A) and Null(A) on the input side, Col(A) and Null(Aᵀ) on the output side. The shapes are only a diagram of the relations; in this example every subspace is a line.

03The column space: which outputs can we reach?

Before using the columns of A, return to ordinary coordinates. The vector (a, b) means a copies of (1, 0) plus b copies of (0, 1). These two basic vectors are the columns of the identity matrix I. Multiplying by I therefore leaves the vector unchanged.

Choose a step when you are ready. The explanation will wait while you inspect the diagram.

Ix=1(10)+(1)(01)=(11)Ix=1\begin{pmatrix}1\\0\end{pmatrix}+(1)\begin{pmatrix}0\\1\end{pmatrix}=\begin{pmatrix}1\\1\end{pmatrix}

The column vectors

e₁e₂-4-4-2-22244b₁b₂0

Scale, then add

x₁e₁x₂e₂b-4-4-2-22244b₁b₂0
1
1

Change one coefficient at a time. The second arrow begins at the end of the first: following both arrows gives their sum. Negative coefficients reverse an arrow.

04The row space: what can we put in?

We have used columns to build the output. Now read the same multiplication one row at a time. Each output component is the dot product of one whole row with the whole input vector. A dot product multiplies corresponding components and adds the results.

Ax=(r1⋅xr2⋅x)=(1x1+2x22x1+4x2)Ax=\begin{pmatrix}r_1\cdot x\\r_2\cdot x\end{pmatrix}=\begin{pmatrix}1x_1+2x_2\\2x_1+4x_2\end{pmatrix}

For an m by n matrix, there are n numbers in each row. The input must also have n components for these dot products to make sense. There are m rows, so there are m output components. This gives A: ℝⁿ → ℝᵐ. Every vector in ℝⁿ is allowed as input; it does not have to be a combination of the rows.

The rows do span a subspace of the input space. We call it Row(A). In our example r₂ = 2r₁, so the row space is the gold line in the left picture. Try x = (1, 3): it is off that line, yet the multiplication still gives (7, 14). The full input space and the row space are therefore different things.

Row⁡(A)=span⁡{r1,…,rm}⊆Rn\operatorname{Row}(A)=\operatorname{span}\{r_1,\ldots,r_m\}\subseteq\mathbb R^n

Input: every point of ℝ² is allowed

r₁x-5-5-2.5-2.52.52.555x₁x₂0

Output: two row dot products

Ax-20-20-10-1010102020b₁b₂0
1
3
r1⋅x=1+2(3)=7r_1\cdot x=1+2(3)=7
r2⋅x=2(1)+4(3)=14r_2\cdot x=2(1)+4(3)=14

The right picture has a wider numerical scale so its output fits. These are separate copies of ℝ². Row(A) and Col(A) happen to have the same direction here because our matrix is symmetric; that is not true of every matrix.

THE NEXT QUESTION

Some different inputs might give the same row dot products. Can a nonzero input even give zero in every row?

05The null space: which inputs become zero?

Zero certainly goes to zero under A. But is it the only input that does? Use the same matrix and try x = (2, −1). The first row gives 2 − 2 = 0, and the second gives 4 − 4 = 0. We have found a nonzero input which A sends to zero.

A(2−1)=(2−24−4)=(00)A\begin{pmatrix}2\\-1\end{pmatrix}=\begin{pmatrix}2-2\\4-4\end{pmatrix}=\begin{pmatrix}0\\0\end{pmatrix}

Choose a step when you are ready. The explanation will wait while you inspect the diagram.

Input: c(2, −1)

xₙ-6-6-3-33366x₁x₂0

Output: the column contributions cancel

x₁a₁x₂a₂Ax = 0-10-10-5-5551010b₁b₂0
1
xn=(2−1),Axn=(00)x_n=\begin{pmatrix}2\\-1\end{pmatrix},\qquad Ax_n=\begin{pmatrix}0\\0\end{pmatrix}

The purple input can move along its whole line. On the right, the second contribution brings us back to the origin.

06The left null space: what happens on the output side?

Transpose a matrix by turning its columns into rows. We write the result as Aᵀ. If A has m rows and n columns, Aᵀ has n rows and m columns. It therefore takes an m-component input, which we will call y to keep it separate from our original x.

A:Rn→Rm,AT:Rm→RnA:\mathbb R^n\to\mathbb R^m,\qquad A^T:\mathbb R^m\to\mathbb R^n

Choose a step when you are ready. The explanation will wait while you inspect the diagram.

We now ask which y satisfy Aᵀy = 0. This defines Null(Aᵀ), a subspace on the output side of the original A. Our example happens to satisfy Aᵀ = A, so y = c(2, −1) works again. These are vectors in the output copy of ℝ², even though their coordinates match the earlier null vectors.

Null⁡(AT)={y∈Rm:ATy=0}\operatorname{Null}(A^T)=\{y\in\mathbb R^m:A^Ty=0\}

Transposing is not undoing the transformation. In particular, Aᵀ is not generally A⁻¹. We are forming a new matrix and asking a new zero-output question.

07How do the spaces fit together?

We have four sets of vectors now. Before putting them into one diagram, we need to explain their relations. Begin on the input side: why is every null-space vector perpendicular to every row-space vector?

Choose a step when you are ready. The explanation will wait while you inspect the diagram.

Choose any xₙ in Null(A). The definition says Axₙ = 0. Reading the product by rows tells us that each rᵢ · xₙ is zero. Notice that rᵢ is dotted with the whole vector xₙ, not just one of its components. For two nonzero vectors, a zero dot product means they are perpendicular; the zero vector is orthogonal to every vector as well.

Axn=(r1⋅xn⋮rm⋅xn)=0⟹ri⋅xn=0(1≤i≤m)Ax_n=\begin{pmatrix}r_1\cdot x_n\\\vdots\\r_m\cdot x_n\end{pmatrix}=0\quad\Longrightarrow\quad r_i\cdot x_n=0\quad(1\le i\le m)

A vector in Row(A) is a linear combination of the rows. Dot that combination with xₙ and distribute the dot product. Every term is zero, so the whole result is zero. This proves the relation for the entire row space, not only for the rows we drew.

(c1r1+⋯+cmrm)⋅xn=c1(r1⋅xn)+⋯+cm(rm⋅xn)=0(c_1r_1+\cdots+c_mr_m)\cdot x_n=c_1(r_1\cdot x_n)+\cdots+c_m(r_m\cdot x_n)=0

Conversely, if x is perpendicular to every row, every component of Ax is zero, so x belongs to Null(A). Therefore Null(A) is exactly the set of vectors perpendicular to Row(A). Applying the same argument to Aᵀ gives the corresponding relation on the output side.

Null⁡(A)=Row⁡(A)⊥,Null⁡(AT)=Col⁡(A)⊥\operatorname{Null}(A)=\operatorname{Row}(A)^\perp,\qquad\operatorname{Null}(A^T)=\operatorname{Col}(A)^\perp

The superscript ⊥ means the set of all vectors perpendicular to the named space, in the same input or output space.

08Why can different inputs agree?

Return to the input (1, 3), which gives (7, 14). We also found that (2, −1) gives zero. What happens if we add these two inputs before multiplying by A? Distribute A across the addition and keep each result visible.

A[(13)+(2−1)]=(714)+(00)=(714)A\left[\begin{pmatrix}1\\3\end{pmatrix}+\begin{pmatrix}2\\-1\end{pmatrix}\right]=\begin{pmatrix}7\\14\end{pmatrix}+\begin{pmatrix}0\\0\end{pmatrix}=\begin{pmatrix}7\\14\end{pmatrix}

The new input is (3, 2), and its output is unchanged. This part of the example works even though (1, 3) is not in Row(A). We call it x₀, a particular solution, rather than xᵣ. We will find the actual row-space solution next.

Choose a step when you are ready. The explanation will wait while you inspect the diagram.

Inputs with the same output

x₀cxₙx-7-7-3.5-3.53.53.577x₁x₂0

The output stays at (7, 14)

b = Ax-18-18-9-9991818b₁b₂0
1
x=(13)+1(2−1)=(32)x=\begin{pmatrix}1\\3\end{pmatrix}+1\begin{pmatrix}2\\-1\end{pmatrix}=\begin{pmatrix}3\\2\end{pmatrix}
Ax = (7, 14)

The dashed solution line is parallel to Null(A), but it does not pass through zero for this nonzero b. The solution set is therefore not itself a vector subspace. The right plot uses a larger numerical scale.

09Put the four spaces together

Read the left half as the input space and the right half as the output space. Gold and purple split the input; teal and rose split the output. The right-angle marks show the orthogonal pairs. The arrows through A show three results: xᵣ goes to b, xₙ goes to zero, and xᵣ + xₙ goes to that same b.

This is a diagram of relations, not a single coordinate plot. In our 2 by 2 example, all four subspaces are lines, so each has dimension 1. The coloured regions below stand for subspaces; their drawn width does not make them two-dimensional. Play to follow the three mappings together, or use the progress control to stop anywhere.

ℝnℝmINPUT · n = 2OUTPUT · m = 2ARow spaceRow(A)dim = r = 1Null spaceNull(A)dim = n − r = 1Column spaceCol(A)dim = r = 1Left null spaceNull(Aᵀ)dim = m − r = 1Axr = bAx = bAxn = 000xrbxnx = xr + xnSchematic geometry · right-angle marks denote orthogonal subspaces · read dimensions from the labels
0%

For an m by n real matrix, let r be the dimension of Col(A), called its rank. The table below lists the dimensions of all four spaces. Before using those counts, let us see why the correspondence we proved gives equal dimensions, and why the remaining dimensions can be subtracted.

Dimension counts how many vectors a basis needs. A basis must do two jobs: its combinations reach every vector in the space, and no vector in it can be made from the others. The second condition is called linear independence. Equivalently, a combination can equal zero only when every coefficient is zero.

Why does the correspondence through A preserve this count? Choose a basis of Row⁡(A)\operatorname{Row}(A) u1,…,uku_1,\dots,u_k. Since every column-space output has a row-space input, it can be written as A(c1u1+⋯+ckuk)A(c_1u_1+\dots+c_ku_k). Linearity moves the coefficients outside, so Au1,…,AukAu_1,\dots,Au_k span Col⁡(A)\operatorname{Col}(A). We still need to check that none of these new directions is redundant.

c1Au1+⋯+ckAuk=0⟹A(c1u1+⋯+ckuk)=0c_1Au_1+\cdots+c_kAu_k=0\quad\Longrightarrow\quad A(c_1u_1+\cdots+c_ku_k)=0

The vector inside the brackets is in Row⁡(A)\operatorname{Row}(A). If A sends it to zero, it is also in Null⁡(A)\operatorname{Null}(A). We proved that these perpendicular spaces share only zero, so the vector itself is zero. Since the u vectors were independent, every c must be zero. Their images therefore form a basis too. Both spaces have k basis vectors, so k equals the rank r.

Now join a basis of Row⁡(A)\operatorname{Row}(A) to a basis of Null⁡(A)\operatorname{Null}(A). Together they reach every input because every input has the decomposition we constructed. They are also independent: if a row-space combination plus a null-space combination is zero, one is the negative of the other and belongs to both spaces. Both combinations must therefore be zero, forcing all coefficients to be zero. Their total number is the input dimension n. This gives r+dim⁡Null⁡(A)=nr+\dim\operatorname{Null}(A)=n. Repeat for the output space of dimension m to obtain the second count.

dim⁡Null⁡(A)=n−r,dim⁡Null⁡(AT)=m−r\dim\operatorname{Null}(A)=n-r,\qquad\dim\operatorname{Null}(A^T)=m-r
The four definitions, with their ambient spaces
SubspaceDefinitionLives inDimension
Row(A)span⁡{r1,…,rm}\operatorname{span}\{r_1,\ldots,r_m\}Rn\mathbb R^nrr
Null(A){x:Ax=0}\{x:Ax=0\}Rn\mathbb R^nn−rn-r
Col(A)span⁡{a1,…,an}\operatorname{span}\{a_1,\ldots,a_n\}Rm\mathbb R^mrr
Null(Aᵀ){y:ATy=0}\{y:A^Ty=0\}Rm\mathbb R^mm−rm-r
Try the original question once more

For our matrix, can b = (3, 6) be reached? What about (3, 5)? For the reachable one, find a particular solution and describe all solutions.

Read the worked answer

(3, 6) = 3(1, 2), so it belongs to Col(A). One input is (3, 0), because A(3, 0) = (3, 6). Every solution is (3, 0) + c(2, −1), where c is any real number. The unique row-space solution is (3/5, 6/5). The target (3, 5) is not a multiple of (1, 2), and 2 × 3 − 5 = 1 ≠ 0, so it has no solution.

Continue: use the same reasoning in three dimensions

Sign in to see more

Sign in to continue the rest of this lesson and keep your progress in sync.