Linear Algebra › Section D · Vector spaces › Topic D.5

The dimension of a vector space

A space can have many bases, but every basis of it has the same number of vectors. That number, the dimension, measures how many independent directions the space has, and it makes many questions about bases almost automatic.

Counting independent directions

A line through the origin needs one number to locate a point on it; a plane needs two; space needs three. "Dimension and rank" made this precise for subspaces of \(\mathbb{R}^n\). This topic extends it to every vector space, including \(\mathbb{P}_n\), matrix spaces and function spaces. The plan is to show that the size of a basis does not depend on which basis you choose, so that it can serve as a property of the space itself. Coordinate systems, from the previous topic, do the heavy lifting by translating every question into \(\mathbb{R}^n\).

Too many vectors means dependence

Theorem: if a vector space \(V\) has a basis \(\mathcal{B}\) of n vectors, then any set in \(V\) with more than n vectors is linearly dependent. The reason uses coordinates. Take \(\mathbf{u}_1, \ldots, \mathbf{u}_p\) in \(V\) with \(p > n\). Their coordinate vectors are p vectors in \(\mathbb{R}^n\), and more vectors than entries are always dependent, so some non-trivial combination of the coordinate vectors is \(\mathbf{0}\). Because the coordinate mapping is linear and one-to-one, the same combination of the \(\mathbf{u}_i\) is the zero vector of \(V\). So the \(\mathbf{u}_i\) are dependent too.

Every basis has the same size

Suppose \(V\) has a basis of n vectors and another basis of m vectors. The second basis is independent, so by the last theorem \(m \le n\). Swapping the roles gives \(n \le m\). So \(m = n\): every basis of \(V\) has the same number of vectors. If \(V\) is spanned by a finite set, it is finite-dimensional, and its dimension, \(\dim V\), is the number of vectors in any basis. The zero space \(\{\mathbf{0}\}\) has dimension 0, since it has no non-zero vectors to put in a basis. If \(V\) is not spanned by any finite set, it is infinite-dimensional.

Dimensions of familiar spaces

\(\dim \mathbb{R}^n = n\), using the standard basis \(\mathbf{e}_1, \ldots, \mathbf{e}_n\). \(\dim \mathbb{P}_n = n + 1\), using \(1, t, \ldots, t^n\): the constant polynomial 1 is easy to forget, so \(\mathbb{P}_2\) has dimension 3, not 2. The space \(M_{m \times n}\) has dimension \(mn\), using the matrices with a single entry 1 and all others 0; so 2 x 2 matrices form a 4-dimensional space. The space \(\mathbb{P}\) of all polynomials is infinite-dimensional, because a finite set of polynomials has a highest degree and cannot span anything beyond it. The space of continuous functions on \(\mathbb{R}\) contains \(\mathbb{P}\), so it is infinite-dimensional as well.

Worked example: the dimension of a subspace

Find the dimension of \(H\), the set of all vectors

(a + 2b, \; b - c, \; a + 2c, \; 3a + 6c)

with \(a, b, c\) real. 1. Split by parameter: each vector equals \(a\mathbf{v}_1 + b\mathbf{v}_2 + c\mathbf{v}_3\) with \(\mathbf{v}_1 = (1, 0, 1, 3)\), \(\mathbf{v}_2 = (2, 1, 0, 0)\) and \(\mathbf{v}_3 = (0, -1, 2, 6)\). So \(H = \operatorname{Span}\{\mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3\}\). 2. Look for dependence: \(2\mathbf{v}_1 - \mathbf{v}_3 = (2, 1, 0, 0) = \mathbf{v}_2\). 3. By the spanning set theorem, drop \(\mathbf{v}_2\). 4. \(\mathbf{v}_1\) and \(\mathbf{v}_3\) are not multiples of each other, so they are independent and form a basis. 5. So \(\dim H = 2\), even though three parameters appeared.

Subspaces of a finite-dimensional space

Let \(H\) be a subspace of a finite-dimensional space \(V\). Then \(H\) is finite-dimensional and \(\dim H \le \dim V\). Moreover, any linearly independent set in \(H\) can be extended, if necessary, to a basis for \(H\): keep adding vectors of \(H\) outside the current span, and the set stays independent; it cannot grow beyond \(\dim V\) vectors, so the process stops at a basis. Dimension sorts the subspaces of \(\mathbb{R}^3\) neatly: dimension 0 is the origin, 1 is a line through the origin, 2 is a plane through the origin, and 3 is \(\mathbb{R}^3\) itself.

The basis theorem

Let \(V\) be a vector space of dimension \(p \ge 1\). Then: 1. any linearly independent set of exactly p vectors in \(V\) is a basis, and 2. any set of exactly p vectors that spans \(V\) is a basis. In other words, once the count is right, you need to check only one of the two basis conditions. This saves real work. To show that three vectors form a basis of \(\mathbb{R}^3\), it is enough to show they are independent, for instance with a non-zero determinant. The count must be exactly p: four independent-looking vectors in \(\mathbb{R}^3\) are never a basis.

Worked example: a basis of quadratics

Is \(\{1 + t, \; t + t^2, \; 1 + t^2\}\) a basis for \(\mathbb{P}_2\)? 1. \(\dim \mathbb{P}_2 = 3\) and there are three polynomials, so by the basis theorem independence is enough. 2. Use standard coordinates: the vectors are \((1, 1, 0)\), \((0, 1, 1)\) and \((1, 0, 1)\). 3. Put them in the columns of a matrix and expand along row 1:

\det\begin{bmatrix} 1 & 0 & 1 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \end{bmatrix} = 1(1 - 0) - 0 + 1(1 - 0) = 2

4. The determinant is not zero, so the coordinate vectors are independent, and so are the polynomials. 5. Therefore the set is a basis of \(\mathbb{P}_2\).

Dimensions of Nul A and Col A

For a matrix \(A\), the bases found in "Linearly independent sets and bases" give the dimensions directly. \(\dim \operatorname{Nul} A\) is the number of free variables in \(A\mathbf{x} = \mathbf{0}\), since the parametric form gives one basis vector per free variable. \(\dim \operatorname{Col} A\) is the number of pivot columns. For the matrix with rows (1, 2, 0, 3), (2, 4, -1, 4) and (-1, -2, 3, 3), there are two pivots and two free variables, so both spaces have dimension 2. Dimension also counts degrees of freedom: data scientists look for low-dimensional subspaces that capture most of the variation in high-dimensional data.

Common mistakes to avoid

Forgetting the constant term gives \(\dim \mathbb{P}_n = n\); the correct value is \(n + 1\). Counting parameters is not counting dimension: the worked example had three parameters but dimension 2, because the spanning vectors were dependent. The basis theorem needs exactly the right number of vectors; with fewer, independence does not give spanning, and with more, spanning does not give independence. The zero space has dimension 0, not 1. And a plane through the origin in \(\mathbb{R}^3\) has dimension 2, even though its vectors have three entries.

Key takeaways

In a space with an n-vector basis, any set of more than n vectors is dependent, so every basis has the same size, the dimension. \(\dim \mathbb{R}^n = n\), \(\dim \mathbb{P}_n = n + 1\), \(\dim M_{m \times n} = mn\), and \(\dim\{\mathbf{0}\} = 0\); \(\mathbb{P}\) and the continuous functions are infinite-dimensional. A subspace has dimension at most that of the whole space, and independent sets extend to bases. In a p-dimensional space, p independent vectors or p spanning vectors form a basis. \(\dim \operatorname{Nul} A\) counts free variables and \(\dim \operatorname{Col} A\) counts pivots.

Flashcards

Flashcard

More than n vectors

Always dependent in a space with an n-vector basis

Their coordinate vectors are dependent in ℝⁿ.

Test your understanding

Question 1 of 5

What is the dimension of P₄, the polynomials of degree at most 4?

Question 2 of 5

H is the set of all (a + 2b, b - c, a + 2c, 3a + 6c). Why is dim H equal to 2 and not 3?

Question 3 of 5

V has dimension 5. Which statement must be true?

Question 4 of 5

Three vectors in R³ have a 3 x 3 matrix with determinant -4. What follows?

Question 5 of 5

A 4 x 6 matrix A has 3 pivot columns. What are dim Col A and dim Nul A?

← Previous topicNext topic →