Lecture 30 · Week 8· 15:33
The rank–nullity theorem
Injective, surjective, bijective maps.
Saved in this browser only. No account needed.
TranscriptThe full text of the lecture. Click any sentence to play the video from there.
Today: counting dimensions
Welcome back. In the last lecture we met linear maps. A map T from a vector space V to a vector space W, over the same field, is linear when it respects sums and scalar multiples. Its kernel is the set of vectors that T sends to zero, a subspace of V. Its image is the set of all outputs T of v, a subspace of W. For matrices, we already know how these two subspaces are related. In lecture twenty seven we proved the rank nullity theorem for matrices: for an m by n matrix A, the rank of A, plus the dimension of the null space of A, is n, the number of columns. Here the null space of A plays the role of the kernel, and the column space, whose dimension is the rank, plays the role of the image. Today we prove the same count for every linear map on a finite dimensional space. And we use it to answer two basic questions about a map: does it ever send two different vectors to the same output, and does it reach every vector of W?
Here is the plan. We define injective, surjective and bijective maps, and test injectivity with the kernel. Then we state and prove the rank nullity theorem, draw its consequences, and finish with two applications: matrices of trace zero, and polynomials through three given points.
Injective, surjective, bijective
Let T be a map from V to W. We call T injective, or one to one, if different inputs always have different outputs. In symbols: whenever T of u equals T of v, then u equals v. We call T surjective, or onto, if every vector of W is an output: for every w in W, there is a v in V with T of v equal to w. For a linear map, this says that the image of T is all of W. And T is bijective if it is both injective and surjective. Then every w in W is the output of exactly one v in V.
Here are three linear maps. The first, T one, goes from R two to R, and keeps the first entry: T one of the vector (x, y), is x. T one is surjective: every number x is T one of the vector (x, zero). But it is not injective: all the vectors on a vertical line have the same first entry, so they all land on the same number. For example, T one of the vector (zero, one), is zero, and so is T one of the zero vector. The second map, T two, goes from R to R two, and sends x to the vector (x, zero). T two is injective: if the vector (x, zero), equals the vector (y, zero), then x equals y. But it is not surjective: its outputs fill only the horizontal axis, and the vector (zero, one), is never reached.
The third is the rotation of the plane by a quarter turn. It is bijective: every vector of the plane is the rotation of exactly one vector, namely the one we get by turning it back a quarter turn.
Injectivity and the kernel
Look again at T one. The vectors it sends to zero form its kernel: the vertical axis. And the vectors that share an output are exactly the vertical lines, each one a copy of the kernel, shifted. So the kernel decides whether a map is injective. This holds for every linear map. Here is the theorem. Let V and W be vector spaces over a field F, and let T, from V to W, be linear. Then T is injective if and only if its kernel is just the zero vector. Let's prove it. First suppose T is injective, and let v be in the kernel. Then T of v is zero. But T of the zero vector is also zero, because T is linear. So v and the zero vector have the same output, and since T is injective, v is the zero vector. The zero vector always lies in the kernel, so the kernel is exactly the zero vector.
Conversely, suppose the kernel is just the zero vector, and suppose T of u equals T of v. By linearity, T of u minus v is T of u minus T of v, which is zero. So u minus v lies in the kernel. So u minus v is the zero vector, and u equals v. So T is injective. Notice how much this saves. Injectivity is a statement about all pairs of vectors. The theorem lets us check a single equation instead: which vectors go to zero. For example, recall differentiation D, from P three to P two, from the last lecture. It sends a zero, plus a one x, plus a two x squared, plus a three x cubed, to a one, plus two a two x, plus three a three x squared.
D of p is zero exactly when a one, a two and a three are zero, that is, when p is a constant. So the kernel of D is the constants, which is more than the zero polynomial, and D is not injective. Indeed, p and p plus one always have the same derivative: their graphs differ by a shift, and they have the same slope at every point.
The rank-nullity theorem
Now suppose V is finite dimensional, with a basis v one up to v n. Then the kernel of T is a subspace of a finite dimensional space, so it is finite dimensional too, by lecture twenty three. And the image is spanned by the n vectors T of v one up to T of v n, as we saw in the last lecture. Indeed, every v is a combination c one v one, plus and so on up to c n v n, and by linearity, T of v is c one T of v one, plus and so on up to c n T of v n. So the image is finite dimensional as well. So we can give their dimensions names. The rank of T is the dimension of its image. The nullity of T is the dimension of its kernel.
Here is the main theorem of today, the rank nullity theorem. Let V be a finite dimensional vector space and W any vector space over the same field, and let T, from V to W, be linear. Then the dimension of V is the rank of T plus the nullity of T. Think of it as a balance. Each dimension of V is either crushed to zero, and counted by the nullity, or it survives, and is counted by the rank. The more T crushes, the smaller its image. The proof will show exactly how the dimensions split. Let's test it on differentiation. A basis of P three is one, x, x squared and x cubed, so P three has dimension four. D sends these four polynomials to zero, one, two x and three x squared.
The kernel is the constants, with basis the polynomial one, so the nullity is one. The image is spanned by one, two x and three x squared, which is a basis of P two, so the rank is three. And indeed, four is three plus one.
Proof of rank-nullity
The proof is the most important argument of today, so take it slowly, and pause if you need to. The idea is to build a basis of V that starts with a basis of the kernel. The kernel is finite dimensional, so it has a basis: u one up to u k, where k is the nullity. This list is independent in V, so by lecture twenty three, we can extend it to a basis of V: u one up to u k, followed by w one up to w l. Then the dimension of V is k plus l. Now apply T. Each u i lies in the kernel, so it goes to zero. The vectors w one up to w l go to T of w one up to T of w l. We claim that these l vectors form a basis of the image. Then the rank is l, and the dimension of V, k plus l, is the nullity plus the rank.
First, they span the image. Take any output T of v. Write v in our basis: a one u one, plus and so on up to a k u k, plus b one w one, plus and so on up to b l w l. By linearity, T of v is the same combination of the images. Every T of u i is zero, so T of v is b one T of w one, plus and so on up to b l T of w l. Second, they are independent. Suppose c one T of w one, plus and so on up to c l T of w l, is zero. By linearity, this is T of c one w one, plus and so on up to c l w l. So that vector lies in the kernel. So it is a combination of the kernel's basis: c one w one, plus up to c l w l, equals d one u one, plus up to d k u k, for some scalars d. Move everything to one side. We get a combination of the basis of V that equals zero, so all its weights are zero. In particular, every c j is zero.
So T of w one up to T of w l is an independent list that spans the image: a basis. The rank is l, and the dimension of V is k plus l, the nullity plus the rank. That completes the proof. The proof also covers the extreme cases. If the kernel is just zero, then k is zero and the kernel's basis is the empty list. If the kernel is all of V, then l is zero, and the image is the zero space, with the empty list as its basis.
Consequences
The theorem has quick consequences when both spaces are finite dimensional. First, a linear map into a smaller space cannot be injective: if the dimension of V is bigger than the dimension of W, then T is not injective. Here is why. The image is a subspace of W, so the rank is at most the dimension of W, which is less than the dimension of V. So the nullity, the dimension of V minus the rank, is positive. The kernel is not just zero, so by today's first theorem, T is not injective. Second, a linear map into a bigger space cannot be surjective: if the dimension of V is less than the dimension of W, then T is not surjective. Indeed, the rank is the dimension of V minus the nullity, so it is at most the dimension of V, which is less than the dimension of W. So the image cannot be all of W.
Third, and most useful: when the two dimensions are equal, the two properties come together. If V and W have the same finite dimension n, then T is injective, if and only if it is surjective, if and only if it is bijective. The proof is a chain of equivalences. T is injective exactly when its kernel is zero, that is, when the nullity is zero. By the rank nullity theorem, that happens exactly when the rank is n. A subspace of W of dimension n is all of W, by lecture twenty three. So the rank is n exactly when the image is W, that is, when T is surjective. And bijective means both, so each property gives the other two.
So between spaces of the same finite dimension, one property is enough. To show that such a map reaches everything, it is enough to show that its kernel is zero. For matrices, this is familiar. An m by n matrix A gives the map T A, from F n to F m. Its kernel is the null space of A, and its image is the column space. So for T A, the rank nullity theorem is exactly the theorem of lecture twenty seven. And for a square matrix, the third consequence is part of the invertible matrix theorem from lecture seventeen: A x equals zero has only the zero solution exactly when A x equals b has a solution for every b.
The word finite matters. On the space of all real polynomials, differentiation is surjective, since every polynomial is the derivative of another one, but it is not injective. And multiplication by x is injective, since x times p is zero only when p is zero. But it is not surjective: x times p always has constant term zero, so the constant one is never reached. This space has no finite dimension.
Two applications
First, the trace. The trace sends a two by two matrix to the sum of its diagonal entries, as in lecture fifteen. It is a linear map from the space of two by two matrices, which has dimension four, to the field F, which has dimension one. It is surjective: for every scalar c, the matrix with c in the top left corner and zeros elsewhere has trace c. So the rank is one, and by the rank nullity theorem, the nullity is four minus one, which is three. The matrices of trace zero form a subspace of dimension three, and we found that without computing a basis. To check, here are three matrices of trace zero: the one with one and minus one on the diagonal, and the two with a single one off the diagonal. Their combination with weights a, b and c is the matrix with rows a, b, and c, minus a. It is zero only when all three weights are zero, so they are independent, and three independent vectors in a space of dimension three form a basis.
Second, polynomials through given points. In the last lecture, we took the values of a polynomial at zero and one. Now add a third point: let E send a real polynomial p of degree at most two to its three values, p of zero, p of one, and p of two, as a vector of R three. Values add and scale with the polynomial, so E is a linear map from P two to R three. What is its kernel? If E of p is zero, then p has the three roots zero, one and two. But a nonzero polynomial of degree at most two has at most two roots, as we saw in lecture twenty one. So p is the zero polynomial, and the kernel is zero: E is injective. Both spaces have dimension three. So by the third consequence, E is also surjective. That is: for any three values, there is exactly one polynomial of degree at most two that takes them at zero, one and two. Existence came for free from uniqueness.
For example, take the values one, zero and three. Write p as a plus b x plus c x squared. At zero, a is one. At one, one plus b plus c is zero, so b plus c is minus one. At two, one plus two b plus four c is three, so b plus two c is one. Subtracting the first of these from the second, c is two, and then b is minus three. So p is one, minus three x, plus two x squared. Check: at one, one minus three plus two is zero, and at two, one minus six plus eight is three. Its graph passes through all three points.
Summary
Let's summarise. A linear map is injective exactly when its kernel is zero, and surjective exactly when its image is the whole target space. For a linear map on a finite dimensional space V, the dimension of V is the rank plus the nullity: every dimension is either crushed or kept. Between spaces of the same finite dimension, injective, surjective and bijective all mean the same thing. And a bijective linear map is an isomorphism, as in lecture twenty five.
Before the next lecture, read section six point two of the course book, try the problems on sheet eight about rank and nullity, and do the lecture check on this lecture's page at Open Semester dot com. Next time, we study isomorphisms and inverse maps, and the space of all linear maps from V to W. See you there.
In this lecture
Materials
Check yourself
3 questions, from warm-up to stretch
Work each one out on paper, type your answer and press Check. Stuck? Open a hint; the worked solution is there when you need it.
- Question 1 of 3 Warm-up
is linear and onto: find . is linear with : find , and say whether is onto. Can a linear map be one-to-one?
Hint 1 of 2
Rank–nullity (Theorem 6.2.6) counts in the domain: . You need and (Example 4.5.14).
Hint 2 of 2
Onto means that the image is the whole codomain, so the rank equals the dimension of the codomain. For the last question, compare the two dimensions (Corollary 6.2.7).
Worked solution
- . Since is onto, and . By Theorem 6.2.6, .
- , so .
- , and has dimension , so : is not onto.
- A linear map has rank at most , hence nullity at least . Its kernel is not , so it is not one-to-one (Theorem 6.2.3 and Corollary 6.2.7(a)).
- Question 2 of 3 Core
Let , . Find and . Is onto? Find such that lies in .
Hint 1 of 2
for , so and (Example 6.1.7). Compare the third row with the first two.
Hint 2 of 2
Call the entries of the output , and . Then for every input. Notice also that appears in no entry.
Worked solution
- Row reduce : gives , and then gives a zero row. Two pivots remain, so .
- By Theorem 6.2.6, . Directly: gives and , with and free, so .
- , so and is not onto.
- Every output has . The vectors with form a plane of dimension that contains , so it is (Theorem 4.5.17). So exactly when . Indeed .
- Question 3 of 3 Stretch
Use rank–nullity to find, without computing a basis, and . Is , , onto? Let have : find the coefficient of in .
Hint 1 of 2
The first set is the kernel of , , and and already span . Treat the second set the same way, with values at three points: by Example 6.2.11, the polynomials of degree at most already take every triple of values.
Hint 2 of 2
A nonzero polynomial of degree at most has at most roots, so ; then use Corollary 6.2.8. For , try , which is at , and , and choose from .
Worked solution
- is linear from to , since each entry is the value at a point. and are independent, so and . By Theorem 6.2.6, . (Indeed and form a basis of it.)
- maps to . By Example 6.2.11, a polynomial of degree at most already takes any three values at , and , so is onto and . Since , .
- If , then has the four roots . A nonzero polynomial of degree at most has at most roots, so : and is one-to-one (Theorem 6.2.3). As , is onto (Corollary 6.2.8).
- is at , and , and its value at is , so gives . Since is one-to-one, this is the only such : , and .
How did it go?