Chapter 4: Vector Spaces
4.5 The dimension of a vector space
Study guide for Linear Algebra and Its Applications (David C. Lay, 6th edition)
Independent study guide. Not affiliated with or endorsed by Pearson.
Big idea
A space can have many bases, but they all have the same number of vectors. That number is a property of the space, not of any choice you made, and it is called the dimension. Once it exists, “how big is this space” has a real answer.
Dimension turns into shortcuts. In a space of dimension $n$, any $n$ independent vectors automatically span, and any $n$ vectors that span are automatically independent. So half the work of checking a basis disappears as soon as the count is right. Any set with more than $n$ vectors is dependent, and any set with fewer than $n$ fails to span, both with no computation.
For a matrix, dimension splits the columns in two. The dimension of the column space is the rank, the dimension of the null space is the nullity, and they add up to the number of columns. Each column either carries a pivot and contributes to the rank, or it does not and contributes a free variable. There is nowhere else for a column to go, and that is the whole content of the count.
Decoder
The dimension of a nonzero finite-dimensional vector space is the number of vectors in any basis for it, and the dimension of the zero space is defined to be zero.
The phrase “any basis” is the claim, not a throwaway. It asserts that the count cannot depend on which basis you pick, so the number is safe to attach to the space itself.
The zero space needs its own clause because it has no nonzero vectors at all, so no independent set to count. Its basis is the empty list, and the convention sets its dimension to zero. “Finite-dimensional” excludes spaces like all polynomials with no degree cap, where no finite set spans.
Definitions and results
All bases are the same size. If a vector space has a basis with $n$ vectors, then every basis for that space has exactly $n$ vectors, and every set of more than $n$ vectors in it is dependent.
Dimension. The dimension of $V$, written $\dim V$, is the number of vectors in a basis. $V$ is finite-dimensional when some finite set spans it, and infinite-dimensional otherwise.
Standard dimensions. $\dim \mathbb{R}^n = n$. $\dim \mathbb{P}_n = n + 1$, since the basis is $1, t, \dots, t^n$ and there are $n + 1$ of those. The space of all $m \times n$ matrices has dimension $mn$. The space of all polynomials with no degree bound is infinite-dimensional.
Subspaces are no larger. If $H$ is a subspace of a finite-dimensional $V$, then $H$ is finite-dimensional, $\dim H \le \dim V$, and any independent set in $H$ can be extended to a basis of $H$. If $\dim H = \dim V$ then $H = V$.
Subspaces of $\mathbb{R}^3$. Dimension zero is the origin alone, dimension one is a line through the origin, dimension two is a plane through the origin, dimension three is all of $\mathbb{R}^3$. The list is complete, which is why a subspace question in $\mathbb{R}^3$ has only four possible answers.
The basis shortcut. Let $\dim V = n$ and take any set of exactly $n$ vectors in $V$. If the set is independent, it is a basis. If the set spans $V$, it is a basis. You never need to check both conditions when the count is right.
Rank and nullity. For a matrix $A$, the rank is $\dim \text{Col}\,A$ and the nullity is $\dim \text{Nul}\,A$. Rank equals the number of pivot columns; nullity equals the number of free variables.
The rank and nullity count. For an $m \times n$ matrix,
$$ \text{rank}\,A + \dim \text{Nul}\,A = n $$
the number of columns. Every column is either a pivot column or not, and the two dimensions count the two groups.
Reading the count. Rank is bounded by both dimensions: $\text{rank}\,A \le \min(m, n)$. A matrix with more columns than rows has rank at most $m < n$, so its nullity is positive and $A\mathbf{x} = \mathbf{0}$ has a nonzero solution. That recovers the earlier fact that a wide homogeneous system always has free variables.
Square matrices. For an $n \times n$ matrix, rank $n$, nullity $0$, invertibility, nonzero determinant, columns forming a basis of $\mathbb{R}^n$, and $\text{Col}\,A = \mathbb{R}^n$ are all the same condition stated six ways.
Worked examples
The dimension of a span
Let $H = \text{Span}\{(1,2,0),\; (2,4,0),\; (0,1,1)\}$ inside $\mathbb{R}^3$. Three spanning vectors do not mean dimension three; you have to check independence first.
The second vector is twice the first, so it can be dropped without changing the span. What remains is $(1,2,0)$ and $(0,1,1)$, neither a multiple of the other, so the pair is independent and is a basis. Hence $\dim H = 2$, and $H$ is a plane through the origin.
Check that the dropped vector is still reachable: $2(1,2,0) + 0(0,1,1) = (2,4,0)$, so removing it cost nothing. And $H$ is not all of $\mathbb{R}^3$, since $\dim H = 2 < 3$; concretely, $(0,0,1)$ would need $c_1(1,2,0) + c_2(0,1,1) = (0,0,1)$, forcing $c_1 = 0$ from the first coordinate, then $c_2 = 0$ from the second, then $0 = 1$ from the third.
Rank and nullity of a wide matrix
Take
$$ A = \begin{bmatrix} 1 & 2 & 0 & 1 & 3 \\ 2 & 4 & 1 & 4 & 8 \\ 1 & 2 & 1 & 3 & 5 \end{bmatrix} $$
Subtract twice row one from row two, and row one from row three. Both become $\begin{bmatrix} 0 & 0 & 1 & 2 & 2 \end{bmatrix}$, so subtracting one from the other clears the last row:
$$ \begin{bmatrix} 1 & 2 & 0 & 1 & 3 \\ 0 & 0 & 1 & 2 & 2 \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix} $$
Two pivots, in columns one and three, so $\text{rank}\,A = 2$. There are five columns, so the nullity is $5 - 2 = 3$.
Confirm the nullity by producing the three basis vectors. The free variables are $x_2$, $x_4$, $x_5$, and the equations read $x_1 = -2x_2 - x_4 - 3x_5$ and $x_3 = -2x_4 - 2x_5$. That gives
$$ \begin{bmatrix} -2 \\ 1 \\ 0 \\ 0 \\ 0 \end{bmatrix}, \qquad \begin{bmatrix} -1 \\ 0 \\ -2 \\ 1 \\ 0 \end{bmatrix}, \qquad \begin{bmatrix} -3 \\ 0 \\ -2 \\ 0 \\ 1 \end{bmatrix} $$
Check each against the original $A$. The first: $-2 + 2 = 0$ in row one, $-4 + 4 = 0$ in row two, $-2 + 2 = 0$ in row three. The second: $-1 + 0 + 0 + 1 + 0 = 0$, $-2 + 0 - 2 + 4 + 0 = 0$, $-1 + 0 - 2 + 3 + 0 = 0$. The third: $-3 + 0 + 0 + 0 + 3 = 0$, $-6 + 0 - 2 + 0 + 8 = 0$, $-3 + 0 - 2 + 0 + 5 = 0$. Three vectors, all in the null space, matching the predicted nullity of three.
Also note $\text{Col}\,A$ has dimension $2$ inside $\mathbb{R}^3$, so it is a plane and $A\mathbf{x} = \mathbf{b}$ fails for most $\mathbf{b}$.
Using the count shortcut
Are $(1,0,2)$, $(0,1,3)$ and $(1,1,6)$ a basis of $\mathbb{R}^3$? The count is right, so one check suffices. Test independence with a determinant, expanding along the first row of the matrix of columns:
$$ \det\begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 2 & 3 & 6 \end{bmatrix} = 1(6 - 3) - 0(0 - 2) + 1(0 - 2) = 3 - 2 = 1 $$
Not zero, so the three are independent, and since $\dim \mathbb{R}^3 = 3$ they must also span. They are a basis, and no spanning computation was needed.
Check the spanning claim anyway on one target. Solve $c_1(1,0,2) + c_2(0,1,3) + c_3(1,1,6) = (2,1,7)$. The first two coordinates give $c_1 + c_3 = 2$ and $c_2 + c_3 = 1$; the third gives $2c_1 + 3c_2 + 6c_3 = 7$. Substituting $c_1 = 2 - c_3$ and $c_2 = 1 - c_3$ gives $4 - 2c_3 + 3 - 3c_3 + 6c_3 = 7$, so $c_3 = 0$, then $c_1 = 2$ and $c_2 = 1$. Verify: $2(1,0,2) + (0,1,3) = (2, 1, 7)$.
Practice
First dimension itself: find the dimension of a span, a subspace, or a standard space, and use the count shortcuts.
Practice
Generated problems for this section, graded instantly.
Then the matrix count: rank, nullity, and what they say about solutions.
Practice
Generated problems for this section, graded instantly.
Videos
Watch the discussion of what happens when a third vector lies in the plane spanned by two others. That collapse is exactly a span whose dimension is smaller than the number of vectors you started with.
Linear combinations, span, and basis vectors | Chapter 2, Essence of linear algebra
3Blue1Brown
Quiz
Five items on dimension, bases by count, and the rank and nullity relation.
Quiz
5 problems with a score at the end.