Hello! In our last lesson, we built a foundational understanding of span and linear independence—the concepts that describe how vectors can combine to create spaces. We saw that the span of a set of vectors is all the points they can "reach," and their linear independence tells us if any of those vectors are redundant.
Today, we will apply this powerful framework directly to matrices. We'll explore two of the most important concepts in linear algebra: the column space and the null space. This lesson will bridge the gap between abstract vector spaces and the concrete behavior of matrix transformations, which is at the heart of how many machine learning algorithms process data. You will learn to identify these two fundamental subspaces and understand what they tell us about a matrix.
1. The Column Space: The Range of a Transformation
Let's start by thinking of a matrix as a transformation that takes an input vector and maps it to an output vector . A natural question arises: what is the set of all possible output vectors? This set is called the column space.
As we saw in the previous lesson, the product is a linear combination of the columns of , with the weights given by the components of . Therefore, the set of all possible outputs is simply the span of the columns of A.
To build a strong visual intuition for this, let's turn to 3Blue1Brown's excellent "Essence of linear algebra" series.
Inverse matrices, column space and null space | Chapter 7, Essence of linear algebra
This video provides a superb geometric interpretation of the column space as the set of all possible outputs of a matrix transformation.
Watch the segment on the column space. Pay close attention to how the transformation's output (a line, a plane, etc.) is directly visualized as the span of the transformed basis vectors, which are the columns of the matrix.
As the video illustrates, the column space is the "landing spot" for all vectors after the transformation. If the columns of a 3x3 matrix are linearly dependent and only span a plane, then no matter what input vector you choose, the output will always be on that plane.
Formal Definition and Rank
Formally, the column space of an matrix , denoted , is the span of its column vectors. It is a subspace of .
An equivalent definition is that the column space is the set of all vectors for which the equation has a solution. If a vector is in the column space of , it means is a possible output of the transformation.
The dimension of the column space is called the rank of the matrix. The rank tells us the number of dimensions in the output space. For a 2x2 matrix, a rank of 2 means the output is the full 2D plane, while a rank of 1 means the output is collapsed onto a line.
2. The Null Space: The Kernel of a Transformation
Now let's look at the flip side. If a transformation squishes space into a lower dimension (i.e., the matrix is not full rank), some input vectors must get mapped to the origin, . The set of all input vectors that get "crushed" or "nullified" by the transformation is called the null space or kernel.
Let's see the geometric intuition first.
Inverse matrices, column space and null space | Chapter 7, Essence of linear algebra
This part of the video beautifully visualizes how, for a transformation that collapses space, a whole line or plane of vectors can be mapped to the single point at the origin.
Now, watch the segment explaining the null space. Notice how a transformation that squishes a 2D plane onto a line has a corresponding line of vectors that all land on the origin.
Formal Definition and Nullity
The null space of an matrix , denoted , is the set of all vectors in that satisfy the homogeneous equation:
The null space is a subspace of the input space . For a full-rank matrix, the only vector that gets mapped to the origin is the zero vector itself, so its null space is just . If the null space contains non-zero vectors, it tells us the transformation is "many-to-one" and collapses the input space.
The dimension of the null space is often called the nullity of the matrix.
The following video provides a concise summary of both the column space and null space, reinforcing their definitions and contrasting where they "live" (in the output space vs. the input space).
The Null Space & Column Space of a Matrix | Algebraically & Geometrically
This video from Dr. Trefor Bazett gives a clear, side-by-side comparison of the two subspaces, connecting them back to solving systems of equations.
Watch the introduction to the column space as the set of targets for A\vec{x}=\vec{b}. Then, watch the introduction to the null space as the solution to A\vec{x}=\vec{0}. Finally, review the excellent side-by-side comparison at the end.
3. Finding the Column Space and Null Space
So far, we have the intuition. Now, let's focus on the practical procedure for identifying these spaces. Given a matrix , how do we find a basis for its column space and null space? The key is a tool you may recall from your engineering studies: reduced row echelon form (RREF).
The following resource provides a clear, step-by-step guide. Since your math is rusty, focusing on a concrete algorithm like this is an excellent way to solidify your understanding.
Matrix Algebra for Engineers - Math.HKUST
This text provides the formal definitions and, more importantly, the computational procedures for finding bases for the null space and column space.
First, read "Lecture 21 | Null space". Focus on the procedure: Bring the matrix A to its reduced row echelon form, rref(A). Identify the "free variables" (columns without pivots). Solve for the "basic variables" (columns with pivots) in terms of the free variables. The vectors associated with each free variable form the basis for the null space. Next, read "Lecture 23 | Column space". Focus on this procedure: Bring the matrix A to rref(A). Identify the pivot columns in rref(A). The corresponding columns in the original matrix A form the basis for the column space. (This is a common point of error, so be mindful!)
This reading also introduces a fundamental relationship known as the Rank-Nullity Theorem:
Or, more simply, rank + nullity = number of columns.
This theorem elegantly states that the number of dimensions in the output space (rank) plus the number of input dimensions that are lost (nullity) must equal the total number of dimensions in the input space.
4. The Big Picture: The Four Fundamental Subspaces
The column space and null space are two of the "Four Fundamental Subspaces" associated with any matrix . The other two are the row space (the span of the rows) and the left null space (the null space of ).
This diagram provides a powerful visual summary of how these spaces relate to one another, their dimensions, and the input/output spaces they reside in.

Conclusion
In this lesson, we attached concrete meaning to the abstract concepts of span and linear independence in the context of matrices. These two subspaces are not just mathematical curiosities; they are essential for understanding everything from whether a system of equations has a solution to how dimensionality reduction techniques like PCA work.
Key Takeaways:
- The Column Space of a matrix is the span of its columns. It represents all possible outputs of the transformation . Its dimension is the rank of the matrix.
- The Null Space of a matrix is the set of all input vectors that are mapped to the zero vector (). Its dimension is the nullity.
- We can find a basis for these spaces by using the reduced row echelon form (RREF) of the matrix.
- The Rank-Nullity Theorem connects the dimensions of these two spaces: .
In our next lesson, we'll dive into another critical property of square matrices: the determinant. You'll see that the determinant gives us a single number that tells us whether a transformation collapses space—in other words, whether its null space is non-trivial and its rank is less than maximal.