Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 5

Dimension of Vector Spaces and Subspaces

Recommended resources

Hello! Welcome to the fifth lesson in your linear algebra course.

In our last lesson, we established the concept of a basis: a linearly independent set of vectors that spans a space. We saw it as the most efficient "recipe" for building a vector space. You might have noticed a pattern: the standard basis for has two vectors, the basis for has three, and the basis we found for a plane within had two vectors.

Is this just a coincidence? Or does every basis for a given vector space have the same number of vectors? Today, we'll answer this question definitively and explore one of the most fundamental properties of a vector space: its dimension.

Our learning outcome is to compute the dimension of a vector space and its subspaces. This concept will give us a precise way to talk about the "size" of a space, a tool that is indispensable in both deep learning (e.g., dimensionality reduction) and quantum mechanics (e.g., the size of a system's state space).

1. What is Dimension?

Intuitively, we understand that a line is one-dimensional, a plane is two-dimensional, and the world around us is three-dimensional. Linear algebra makes this intuition precise. The "dimension" of a vector space is simply the number of vectors in its basis.

But for this definition to be meaningful, we must be certain that any basis we choose for a given space will have the same number of vectors. Thankfully, this is true.

Theorem: All bases for a vector space have the same length.

The reasoning behind this is elegant. Let's say we have two different bases for the same space, call them and .

  • Since is linearly independent and spans the space, the number of vectors in must be less than or equal to the number in . (A key theorem states that an independent set cannot be larger than a spanning set).
  • Flipping this around, since is linearly independent and spans the space, the number of vectors in must be less than or equal to the number in .

The only way both of these statements can be true is if the number of vectors in is equal to the number of vectors in .

This consistency allows us to make a formal definition.

Linear Algebra Done Right Ch2: Finite-Dimensional Vector ...

The following blog post, which discusses concepts from the textbook 'Linear Algebra Done Right', formalizes this idea. We'll focus on the section that makes the crucial connection between the length of bases and the definition of dimension.

Please read the first part of section '2.C Dimension', down to just before '2.38: linearly independent list of the right length is a basis'. This short reading formally proves that all bases have the same length and then defines dimension.

As the reading confirms:

Definition: Dimension
The dimension of a finite-dimensional vector space , denoted , is the number of vectors in any basis for . The dimension of the zero vector space is defined to be 0.

Let's watch a short video clip that grounds this definition with familiar examples.

Basis and Dimension

Professor Dave provides a clear, concise summary of the definition of dimension and gives examples for different types of vector spaces.

Watch the clip from 7:49 to 8:50. He directly defines dimension and applies it to the examples of R³ and the space of 2x2 matrices, reinforcing that the concept is general.

So, for example:

  • dim() = , because the standard basis has vectors.
  • The dimension of a plane through the origin in is 2.
  • The dimension of a line through the origin in is 1.
2D Subspace in 3D Space
This image shows a plane H passing through the origin in \(\mathbb{R}^3\). A plane like this is a subspace of \(\mathbb{R}^3\). Since any basis for this plane will consist of two linearly independent vectors (like V1 and V2, if they are not collinear), we say that \(\text{dim}(H) = 2\).

2. Computing Dimension

To find the dimension of a subspace, you simply need to find a basis for it and count the number of vectors in that basis.

In the last lesson, we learned how to find a basis for the column space of a matrix , denoted . We did this by row reducing and taking the original columns that correspond to pivot columns. Therefore:

The dimension of the column space is the number of pivot columns.

This number is so important that it has its own name: the rank of the matrix.

Definition: Rank
The rank of a matrix , denoted , is the dimension of its column space.

What about the row space, , which is spanned by the rows of ? It turns out there's a beautiful symmetry here. The following video demonstrates two practical methods for finding the dimension of a subspace spanned by a set of vectors.

Basis and Dimension

This MIT OpenCourseWare video shows two common techniques for finding the basis and dimension of a subspace spanned by a given set of vectors. Pay close attention to how Gaussian elimination is used in both cases and what the result means for the dimension.

Watch from 1:19 to 8:00. The first method (until 6:09) places the vectors as rows and performs elimination. The resulting non-zero rows form a basis for the row space. The second method (from 6:09) places them as columns and performs elimination. The original vectors corresponding to the pivot columns form a basis for the column space. Notice that the number of basis vectors—the dimension—is the same in both cases!

The video highlights two crucial points:

  1. To find a basis for the row space of : Row reduce . The non-zero rows of the echelon form are a basis for . The dimension is the number of non-zero rows, which is the number of pivots.
  2. To find a basis for the column space of : Row reduce . The columns of the original matrix that correspond to the pivot columns form a basis for . The dimension is the number of pivot columns.

This leads to one of the first major theorems of linear algebra:
The Row Rank Equals the Column Rank.
For any matrix , the dimension of the row space is equal to the dimension of the column space.

This is why we can just say "the rank of " without specifying rows or columns—they are always the same.


3. The Four Fundamental Subspaces

We've now encountered the row space and column space. Two other subspaces are critical to understanding the full picture of a linear transformation: the null space, , and the left null space, .

The dimensions of these four subspaces are elegantly connected through the rank of the matrix. This relationship is often called the Fundamental Theorem of Linear Algebra, Part 1.

3.5 Dimensions of the Four Subspaces

The textbook 'Linear Algebra' by Gilbert Strang provides a masterful summary of the dimensions of these four fundamental subspaces. Let's read the section that lays out this theorem.

First, read the introductory section '3.5 Dimensions of the Four Subspaces' (section 0), which presents a table summarizing the dimensions. Then, skip to the subsection 'The Four Subspaces for A' (section 2) and read up to the end of the statement of the 'Fundamental Theorem of Linear Algebra, Part 1'. This reading explains why the dimensions are what they are.

Let's consolidate these incredible results for an matrix with :

  1. Column Space, :

    • This is a subspace of .
    • (the number of pivots).
  2. Row Space, :

    • This is a subspace of .
    • (the number of pivots).
  3. Null Space, :

    • This is the set of solutions to , a subspace of .
    • A basis for the null space is found from the parametric vector form of the general solution.
    • The number of vectors in this basis equals the number of free variables in the system.
    • (number of columns - rank).
  4. Left Null Space, :

    • This is the null space of the transpose matrix , a subspace of .
    • Applying the null space rule to (which is an matrix with the same rank ), we get:
    • .

The relationship for the subspaces of is particularly famous and is known as the Rank-Nullity Theorem:

In words: rank + nullity = number of columns. This is a powerful accounting equation for any matrix.

Test your understanding!

Let be a matrix with . Determine the dimensions of its four fundamental subspaces.

Show answer

Here, , , and .

  • . (The column space is a 4D subspace of ).
  • . (The row space is a 4D subspace of ).
  • . (The null space is a 5D subspace of ).
  • . (The left null space is a 1D subspace (a line) in ).

Notice that for the spaces inside , the dimensions add up: . For the spaces inside , the dimensions add up: . Everything is accounted for!


Conclusion

Today, we've moved from the building blocks (bases) to a fundamental property of the entire structure (dimension). Dimension gives us a solid, quantitative way to describe vector spaces and subspaces.

Key Takeaways:

  • Any two bases for a given vector space have the same number of vectors.
  • The dimension of a vector space is the number of vectors in any of its bases.
  • The rank of a matrix is the dimension of its column space, which is equal to the dimension of its row space. rank(A) = dim(Col(A)) = dim(Row(A)).
  • The rank corresponds to the number of pivots in the echelon form of .
  • The dimensions of the four fundamental subspaces of an matrix with rank are:
    • (This is the Rank-Nullity Theorem)

Preview of Next Lesson:

So far, we've focused heavily on vector spaces and subspaces, which always contain the zero vector. But what about solution sets to equations like where ? These sets are not subspaces, but they have a very close relationship to them. In the next lesson, we will use the concepts of span and dimension to describe the geometric structure of these solution sets, introducing the idea of affine subspaces.