Linear maps
So far we have looked at vector spaces, bases, and representing vectors in a vector space with respect to a basis via the use of coordinate vectors. These concepts all occur `inside’ a vector space, so now let us now shift our focus outward, and consider linear maps from one vector space to another. We begin with a definition.
Definition
Let \(V \) and \(W \) be vector spaces over the same field \(\mathbb{F}\) (possibly with different dimensions). Then a linear map, \(T \), from the vector space \(V \) to \(W \) is a map of the underlying sets satisfying the following properties:
- \(T(u + v) = T(u) + T(v)\) for all \(u,v \in V \)
- \(T(\lambda v) = \lambda T(v) \) for all \(\lambda \in \mathbb{F} \) and \(v \in V \).
These conditions are usually described by saying the map \(T\) respects addition and scalar multiplication. Let us see a couple of examples.
Example 1
Let \(V = W = \mathbb{F}[x]_{\leq n}\) be the space of polynomials of degree less than or equal to \(n\), where \(n\) is a fixed natural number. Define a map \(T: V \rightarrow W\) by \(T(p(x)) = p'(x)\) for all polynomials \(p(x) \in V\), that is, \(T\) is the derivative. Then \(T\) is a linear map, as we have:
\(\displaystyle \frac{d}{dx}\big(p(x) + q(x)\big) = \frac{d}{dx}\big(p(x)\big) + \frac{d}{dx}\big(q(x)\big)\) and \(\displaystyle \frac{d}{dx}\big(\lambda p(x)\big) = \lambda \frac{d}{dx}\big(p(x)\big) \).
Example 2
Let \(V = W = \left\{ \begin{pmatrix} a & b \\ c & d \end{pmatrix} : a,b,c,d \in \mathbb{R} \right\}\) be the space of \(2 \times 2\) matrices with entries in the real numbers. Define \(T: V \rightarrow W\) to be the transpose map, i.e. \(T\left(\begin{pmatrix} a & b \\ c & d \end{pmatrix}\right) = \begin{pmatrix} a & c \\ b & d \end{pmatrix}\). Then \(T\) is a linear map. Indeed for \(\begin{pmatrix} a & b \\ c & d \end{pmatrix}, \begin{pmatrix} e & f \\ g & h \end{pmatrix} \in V\) and \(\lambda \in \mathbb{R}\) we have:
A particularly nice feature of considering linear maps between vector spaces (as opposed to considering the maps of the underlying sets) is that they interact very well with bases. In fact, knowing the values of a linear map on a set of basis vectors is all that’s needed to determine the linear map (due to linearity). This is an important observation, so we state it as a result.
Lemma
Let \(V \) and \(W \) be vector spaces and \(T: V \rightarrow W \) a linear map. Fix a basis \(\mathcal{B} = \{b_1,\dots,b_n\}\) of \(V \). Then \(T\) is determined by its values on the basis vectors \(b_i \).
Proof
Firstly, to determine the linear map \(T\) means to know the value \(T(v)\) for all \(v \in V\). So take any vector \(v \in V \). Since \(\mathcal{B} \) is a basis we can write \(v = \lambda_1b_1 + \dots + \lambda_n b_n\) for some scalars \(\lambda_i \in \mathbb{F}\). Then we have
\(T(v) = T(\lambda_1b_1 + \dots + \lambda_n b_n) \) \(= \lambda_1\cdot T(b_1) + \dots + \lambda_n\cdot T(b_n) \).
Therefore, the value of \(T(v) \) is determined by the values \(T(b_i)\), as required.
The relationship between bases and matrices goes even further if we equip both our domain and codomain with an ordered basis, that is, a basis where the order of the vectors in the basis set is fixed. Suppose we have a linear map \(T: V \rightarrow W\), and we equip \(V\) with a basis \(\mathcal{B} = \{b_1,\dots,b_m\}\) and \(W\) with a basis \(\mathcal{D} = \{d_1,\dots,d_n\}\). Then, as we saw in the previous lemma, the linear map \(T\) is determined by the values \(T(b_i)\). However, as we have equipped \(W\) with a basis we can write each \(T(b_i)\) as a coordinate vector with respect to the basis \(\mathcal{D}\) of \(W\). Suppose this coordinate vector is \(\begin{pmatrix} a_{1,i} \\ a_{2,i} \\ \vdots \\ a_{n,i} \end{pmatrix}_{\mathcal{D}}\), that is, \(T(b_i) = a_{1,i}d_1 + \dots + a_{n,i}d_n\). Then we may create a matrix with columns given by these coordinate vectors,
i.e., we can construct the matrix \(\begin{pmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,m} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,m} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n,1} & a_{n,2} & \cdots & a_{n,m} \end{pmatrix}\).
This matrix is known as the matrix associated to the linear map \(T\) with respect to the basis \(\mathcal{B}\) of \(V\) and \(\mathcal{D}\) of \(W\). Indeed, it tells us exactly the same information as \(T\). It works as follows:
Suppose you take a vector \(v \in V\) and want to determine \(T(v) \in W\). This can be achieved by writing \(v\) as a coordinate vector with respect to the basis \(\mathcal{B}\) of \(V\), say \(v = \begin{pmatrix} \lambda_1 \\ \vdots \\ \lambda_m \end{pmatrix}_{\mathcal{B}}\). Observe that the dimensions are compatible for matrix multiplication with our above matrix, doing the calculation yields
The resulting column vector is exactly the coordinate vector for \(T(v)\), i.e., we have \(T(v) = \begin{pmatrix} a_{1,1} \lambda_1 + \dots a_{1,m} \lambda_m \\ \vdots \\ a_{n,1} \lambda_1 + \dots a_{n,m} \lambda_m \end{pmatrix}_{\mathcal{D}}. \)
Note: The entries of the matrix depend on the bases that have been chosen. As we will see in the upcoming examples and in the exercises at the end of the section, changing either of the bases will change the matrix.
Such matrices are very important and so we will formally define them. Then we will give plenty of examples showing how to construct such matrices.
Definition
Let \(V \) and \(W \) be vector spaces, and \(T: V \rightarrow W \) a linear map. Fix bases \(\mathcal{B} = \{b_1,\dots,b_m\}\) of \(V \) and \(\mathcal{D} = \{d_1,\dots,d_m\}\) of \(W \). Suppose that \(T(b_i) = a_{1,i}d_1 + \dots a_{n,i}d_n\). Then the matrix \(\begin{pmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,m} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,m} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n,1} & a_{n,2} & \cdots & a_{n,m} \end{pmatrix}\) is the matrix associated to the linear map \(T\) with respect to the bases \(\mathcal{B}\) and \(\mathcal{D}\). We will usually denote it by \(A_{T}\).
Note: Take care regarding the last sentence of the definition, “We will usually denote it by \(A_{T} \)”. As previously mentioned, the matrix depends on the basis chosen, so if we are being very particular we should really denote the matrix by something like \(A_{T,\mathcal{B},\mathcal{D}}\). But this is cumbersome, and in many cases, bases are fixed once and for all, and so the labelling of \(\mathcal{B}\) and \(\mathcal{D}\) is implicit.
Admittedly, what we have just seen is tough to digest, especially on a first reading. To hopefully remedy this, let’s see some examples of constructing these matrices to see how it all works in practice.
Example 3
Let \(V = W = \mathbb{R}^n\). Let both \(V\) and \(W\) have (ordered) basis \(\mathcal{B} = \{b_1,\dots,b_n\}\) (that is, the spaces \(V\) and \(W\) have the same basis). Consider the identity linear map \(\text{id}:V \rightarrow V\) given by \(\text{id}(v) = v\) for all vectors \(v \in V\). Let’s compute the associated matrix \(A_{\text{id}}\). Recall that in order to compute the matrix we need to know where each basis vector goes under the linear map.
We have \(\text{id}(b_i) = b_i\) for each basis vector, that is, \(\text{id}(b_i) = \begin{pmatrix} 0 \\ \vdots \\ 1 \\ \vdots \\ 0 \end{pmatrix}_{\mathcal{B}}\) where the \(1\) is in the ith position. Therefore the associated matrix is \(A_{\text{id}} = \begin{pmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 1 \end{pmatrix}.\) Perhaps this is the matrix you expected we would get.
But now, let’s see what happens when we choose different bases for our domain and codomain, for this we will take a concrete example. Let \(V = W = \mathbb{R}^2\). Let \(V\) have basis \(\mathcal{B} = \left\{\begin{pmatrix} 1 \\ 1 \end{pmatrix} , \begin{pmatrix} 1 \\ 2 \end{pmatrix} \right\}\) and let \(W\) have basis \(\mathcal{E} = \left\{\begin{pmatrix} 1 \\ 0 \end{pmatrix}, \begin{pmatrix} 0 \\ 1 \end{pmatrix}\right\}\) (i.e. the elemenary/standard basis). Let’s compute the associated matrix \(A_T\).
Following the construction we have \(\text{id}\left(b_1\right) = \text{id}\left(\begin{pmatrix} 1 \\ 1 \end{pmatrix}\right) = \begin{pmatrix} 1 \\ 1 \end{pmatrix}_{\mathcal{E}}\). We also have \(\text{id}(b_2) = \begin{pmatrix} 1 \\ 2 \end{pmatrix}_\mathcal{E}\). Therefore the associated matrix is \(A_{\text{id}} = \begin{pmatrix} 1 & 1 \\ 1 & 2 \end{pmatrix}\) … That doesn’t look much like an identity mapping…
But in fact it is! As a sanity check let us check that this associated matrix sends \(e_1\) to \(e_1\). To do so we need to write \(e_1\) as a coordinate vector with respect to the basis \(\mathcal{B}\). A small calculation shows that \(e_1 = \begin{pmatrix} 2 \\ -1 \end{pmatrix}_{\mathcal{B}}\). Now doing the matrix multiplication gives \(\displaystyle \begin{pmatrix} 1 & 1 \\ 1 & 2 \end{pmatrix} \begin{pmatrix} 2 \\ – 1 \end{pmatrix}_\mathcal{B} = \begin{pmatrix} 1 \\ 0 \end{pmatrix}_\mathcal{E}\) so indeed \(e_1\) goes to \(e_1\). Phew!
Note: The matrices associated to the identity linear map are extremely important. So important in fact that they have their own name (and we will spend a whole section on them). They are known as the “change of basis matrices”, if we feed a coordinate vector with respect to the basis of the domain into the matrix, it will tell us how to write the vector as a coordinate vector with respect to the basis of the codomain. To see this in action, check at what happens when you plug \(\begin{pmatrix} 1 \\ 0 \end{pmatrix}_{\mathcal{B}}\) and \(\begin{pmatrix} 0 \\ 1 \end{pmatrix}_{\mathcal{B}}\) into the matrix from our previous example. Do the resulting vectors look familiar?
For our next example, let us revisit the linear map we saw in Example 1.
Example 4
Let us first revisit Example 1 with \(n=3\). That is, let’s consider \(V = W = \mathbb{F}[x]_{\leq 3}\), the space of polynomials of degree less than or equal to \(3\) and the linear map \(T: V \rightarrow W\); \(T(p(x)) = p'(x)\). Let us equip both \(V\) and \(W\) with the standard basis for polynomials \(\mathcal{E} = \{1,x,x^2,x^3\}\). Let’s now calculate the associated matrix \(A_T\).
We have \(T(1) = 0 = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \end{pmatrix}_{\mathcal{E}}\), \(T(x) = 1 = \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \end{pmatrix}_{\mathcal{E}}\), \(T(x^2) = 2x = \begin{pmatrix} 0 \\ 2 \\ 0 \\ 0 \end{pmatrix}_{\mathcal{E}}\), \(T(x^3) = 3x^2 = \begin{pmatrix} 0 \\ 0 \\ 3 \\ 0 \end{pmatrix}_{\mathcal{E}}\) and so the associated matrix is \(A_T = \begin{pmatrix} 0 & 1 & 0 & 0 \\ 0 & 0 & 2 & 0 \\ 0 & 0 & 0 & 3 \\ 0 & 0 & 0 & 0\end{pmatrix}\) with respect to the basis \(\mathcal{E}\) of \(V\) and \(\mathcal{E}\) of \(W\).
What makes this construction very useful is that we can now differentiate any polynomial (with degree less than or equal to 3) via matrix multiplication. For example, let \(p(x) = 3x^2 + 5\). Writing this as a coordinate vector gives \(p(x) = \begin{pmatrix} 5 \\ 0 \\ 3 \\ 0 \end{pmatrix}_\mathcal{E}\). Doing the matrix multiplication gives \(\begin{pmatrix} 0 & 1 & 0 & 0 \\ 0 & 0 & 2 & 0 \\ 0 & 0 & 0 & 3 \\ 0 & 0 & 0 & 0\end{pmatrix} \begin{pmatrix} 5 \\ 0 \\ 3 \\ 0 \end{pmatrix}_\mathcal{E} = \begin{pmatrix} 0 \\ 6 \\ 0 \\ 0 \end{pmatrix}_\mathcal{E}\) which when expanded out as a polynomial gives \(6x\), as we expected since \(p'(x) = 6x\).
We have now seen that if we have a linear map between two vector spaces, we can equip our spaces with bases and produce an associated matrix. Such a procedure is helpful as it reduces linear maps to working with matrices, which are well-understood objects. In fact, the relationship between linear maps and matrices gets even better, if we are happy to equip all our vector spaces with bases then linear maps and matrices are the “same thing”. We make this precise in the next theorem.
Theorem
Let \(V \) and \(W \) be vector spaces. Equip them with bases \(\mathcal{B} = \{b_1,\dots,b_m\}\) and \(\mathcal{D} = \{d_1,\dots,d_m\}\) respectively. If \(T: V \rightarrow W\) is a linear map then there exists a matrix \(A \) such that \(A = A_T \) is the associated matrix with respect to the bases \(\mathcal{B}\) and \(\mathcal{D}\).
Conversely, if \(A \) is any \(n \times m \) matrix, then there exists a linear map \(T: V \rightarrow W \) such that \(A \) is the associated matrix.
Proof
We have already seen how to construct an associated matrix from a linear map between two vector spaces with fixed, ordered bases, this proves the first direction.
For the converse, let \(A = \begin{pmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,m} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n,1} & a_{n,2} & \cdots & a_{n,m} \end{pmatrix}\) be any matrix. Define a linear map \(T: V \rightarrow W\) by
and use that \(\mathcal{B}\) is a basis and linearity to extend \(T \) to all vectors \(v \in V\) .
Two very important questions to ask of any map between spaces is whether or not it is injective, and whether or not it is surjective. We begin by recalling what it means for a map to be injective or surjective.
Definition
Let \(V \) and \(W \) be vector spaces, and let \(T: V \rightarrow W\) be a linear map. Then \(T \) is surjective if for all vectors \(w \in W \), there exists a \(v \in V \) such that \(T(v) = w \). We say \(T \) is injective if for any \(v,v’ \in V\), \(T(v) = T(v’) \; \Longrightarrow \; v = v’ \).
Note: For a linear map \(T \), injectivity is equivalent to showing that \(T(v) = 0 \; \Longrightarrow \; v = 0\). (Just consider \(v – v’ \) where \(T(v) = T(v’) \).)
The rank and nullity of a linear map
Of course, in general we shouldn’t expect a linear map to be either injective or surjective, and so we want to introduce some sort of measure for how much the map fails to satisfy these properties. This brings us to our next definition.
Definition
Let \(V \) and \(W \) be vector spaces, and let \(T: V \rightarrow W\) be a linear map. Let \(\text{Im}(T) = \{w \in W : T(v) = w\,\)\(\text{for some }v \in V \}\) denote the image of the linear map and let \(\text{Ker}(T) = \{v \in V : T(v) = 0\}\) denote the kernel of the linear map. Define the rank of the linear map by \(\text{rk}(T) = \text{rank}(T) = \dim(\text{Im}(T))\). Define the nullity of the map by \(\text{null}(T) = \dim(\text{Ker}(T))\).
Note: The dimension being a well-defined notion relies on the kernel and image of a linear map being subspaces of the domain and codomain respectively, we will see in the exercises at the end of the section that this is the case.
Note: The image and kernel of a linear map are subspaces (see exercises) and can therefore be equipped with bases. Moreover, we know that their dimensions will be independent of the bases we choose. Thus, all definitions and results regarding the rank and nullity of linear maps can be equivalently stated using an associated matrix instead. This is useful as in upcoming sections we will discuss methods to calculate both the rank of a matrix and the nullity of a matrix.
Let’s state some basic properties of the rank and nullity as a lemma. These properties will require no proof, but ensure that you believe them.
Lemma
Let \(V \) and \(W \) be vector spaces of dimensions \(m \) and \(n \) respectively, and let \(T: V \rightarrow W\) be a linear map. Then:
- \(\text{rank}(T) \leq n \)
- \(\text{null}(T) \leq m \)
- \(\text{rank}(T) = n \) iff \(T \) is surjective
- \(\text{null}(T) = 0 \) iff \(T \) is injective.
Now, let’s give a slightly less obvious result on the rank and nullity of a linear map. It turns out that if you know the value of one, you can easily deduce the value of the other, thanks to the Rank-Nullity Theorem.
Theorem (Rank-Nullity Theorem)
Let \(V \) and \(W \) be vector spaces of dimensions \(m \) and \(n \) respectively, and let \(T: V \rightarrow W\) be a linear map. Then \(\text{rank}(T) + \text{null}(T) = \dim(V) = m \).
Proof
The most concrete way to prove this result is using Gaussian elimination and matrices, and by the end of the course we will almost always compute ranks and nullities using matrices and associated techniques. However we have not seen any of this yet and so we will give an alternative proof, without the use of matrices and/or operations on matrices. We will need the fact that the image and kernel are subspaces of the codomain and domain, respectively. We prove this as an exercise at the end of the section. (For a proof using Gaussian elimination see here.)
Consider the subspace \(\text{Ker}(T) \subset V\), choose a basis of it, say \(\mathcal{B} = \{b_1,\dots,b_r \}\) (note that this says that \(\text{null}(T) = \dim(\text{Ker}(T)) = r\)). Then by the Steinitz exchange lemma (in particular, by one of its corollaries), we may extend this basis to a basis of the domain, \(V \). Denote this basis by \(\mathcal{C} = \{b_1,\dots,b_r,c_{r+1},\dots,c_m\}\). Now, since \(V = \text{span}(\mathcal{C})\) we have
since \(T(b_i) = 0\). This shows that \(\{ T(c_{r+1}),\dots,T(c_m) \}\) span the image, it remains to show that they are linearly independent.
To this end, let \(\lambda_{r+1},\dots,\lambda_m \in \mathbb{F}\) such that \(\displaystyle \sum_{i=r+1}^m \lambda_i T(c_i) = 0\). Then by linearity we have \(\displaystyle T \left(\sum_{i=r+1}^m \lambda_i c_i \right) = 0\), that is, \(\displaystyle \sum_{i=r+1}^m \lambda_i c_i \in \text{Ker}(T) =\)\(\text{span}(b_1,\dots,b_r) \). Therefore, there exists scalars \(\lambda_{1},\dots,\lambda_r \in \mathbb{F}\) such that \(\displaystyle \sum_{i=r+1}^m \lambda_i c_i = \displaystyle \sum_{i=1}^r \lambda_i b_i\). But since \(\mathcal{C} = \{b_1,\dots,b_r,c_{r+1},\dots,c_m \} \) is a basis of \(V \) we must have all \(\lambda_i = 0 \) and so the \(T(c_i) \) are linearity independent.
Concluding, then, we have that \(\text{Im}(T)\) has basis \(\{T(c_{r+1}),\dots,T(c_m) \} \). Therefore, \(\text{rank}(T) = \dim(\text{Im}(T)) = m-r\) and so \(\text{rank}(T) + \text{null}(T) \)\(= (m-r) + r = m \), as required.
Recall that if have a vector space of dimension \(n\), and we equip it with a basis, then we can write all vectors in the space as coordinate vectors, which take the form of a \(n \times 1\) column vector. These column vectors look just like the elements in \(\mathbb{F}^n\). You may have wondered, then, whether all vector spaces of a given dimension are “the same” in some sense. In fact, this is the case! If we have two vector spaces \(V\) and \(W\) and a bijective (i.e. injective and surjective) linear map \(T: V \rightarrow W\) then we say these vector spaces are isomorphic. For all intents and purposes, \(V\) and \(W\) are the same vector space. Let’s make this a theorem.
Theorem
For each natural number \(n \in \mathbb{N} \) there is exactly one vector space of dimension \(n\), up to isomorphism.
Proof
The existence of a vector space is obvious, take \(\mathbb{F}^n\) for example. For uniqueness, let \(V\) and \(W\) be two vector spaces of dimension \(n\). Fix bases \(\mathcal{B} = \{b_1,\dots,b_n\}\) and \(\mathcal{D} = \{d_1,\dots,d_n\}\) of \(V\) and \(W\) respectively. Define a linear map \(T:V \rightarrow W \) by \(T(b_i) = d_i \) for all \(1 \leq i \leq n \). Then it’s straightforward to see that \(T \) is both injective and surjective, and so \(V \) and \(W \) are isomorphic.
Note: It may be tempting at this point to mentally discard all examples of vector spaces which are not \(\mathbb{F}^n \) (e.g. polynomials, matrices, etc). However, it is still useful to be able to work with vector spaces of all forms, for example, when considering the differentiation map between polynomials, it is not always useful to think of polynomials as \(\mathbb{F}^n\) with differentiation given by a matrix, as in Example 4.
Exercises
Exercise 1
Let \(f: \mathbb{R} \rightarrow \mathbb{R} \) be the map of sets given by \(f(x) = x^n \) for all \(x \in \mathbb{R} \), where \(n \in \mathbb{R} \). Show that \(f \) is linear if and only if \(n = 1\).
Solution
Recall that for the map \(f\) to be linear we must have \(f(\lambda x) = \lambda f(x) \) for all \(\lambda, x \in \mathbb{R} \). However we have \(f(\lambda x) = (\lambda x)^n = \lambda^n x^n = \lambda^n f(x) \). Therefore we need \(\lambda^n = \lambda \) for all \(\lambda \in \mathbb{R} \) and this occurs if and only if \(n=1\). Finally, it’s obvious that \(f(x) = x \) (i.e. the identity map) is linear.
Exercise 2
Let \(T: V \rightarrow W \) be a linear map (between vector spaces). Show that \(\text{Ker}(T) \) and \(\text{Im}(T)\) are subspaces of \(V \) and \(W \) respectively.
Solution
We begin with the kernel. Recall that \(\text{Ker}(T) = \{v \in V : T(v) = 0 \} \). Suppose \(u,v \in \text{Ker}(T) \) and \(\alpha, \beta \in \mathbb{F} \). Then, as \(T \) is linear we have \(T(\alpha u + \beta v) = \alpha T(u) + \beta T(v)\) \(= \alpha \cdot 0 + \beta \cdot 0 = 0 \) and so \(\alpha u + \beta v \in \text{Ker}(T) \), this shows that the kernel is a subspace.
Now we move onto the image, suppose \(w,w’ \in \text{Im}(T)\). Then there exists \(u,v \in V \) with \(T(u) = w, T(v) = w’\). Now consider \(\alpha w + \beta w’ \in W \), we have \(\alpha w + \beta w’ = \alpha T(u) + \beta T(v) \)\(= T(\alpha u + \beta v) \) and so \(\alpha w + \beta w’ \in \text{Im}(T) \) and therefore \(\text{Im}(T)\) is a subspace.
Exercise 3
Calculate the associated matrices of the following linear maps with respect to the standard basis (i.e. the standard basis chosen for both the domain and codomain):
- \(f: \mathbb{R}[x]_{\leq 3} \rightarrow \mathbb{R}[x]_{\leq 2} \) given by \(f(p(x)) = p”(x) \).
- \(g: \mathbb{R}[x]_{\leq 2} \rightarrow \mathbb{R} \) given by \(g(p(x)) = \int_{-1}^1 p(x) dx \).
Solution
- As the domain is of dimension \(4 \) and the codomain is of dimension \(3 \) we know that matrix is of the form \(A_f = \begin{pmatrix} * & * & * & * \\ * &*&*&* \\ *&*&*&* \end{pmatrix} \). Furthermore, we know that each of the columns is given by the coordinate vector of the image of each basis vector of the domain. Let us now calculate these columns.
We have \(f(1) = \frac{d^2}{dx^2}(1) = 0 = \begin{pmatrix} 0 \\ 0 \\ 0\end{pmatrix}_\mathcal{E} \). Similarly, \(f(1) = \frac{d^2}{dx^2}(x) = 0 = \begin{pmatrix} 0 \\ 0 \\ 0\end{pmatrix}_\mathcal{E} \). We have \(f(x^2) = \frac{d^2}{dx^2}(1) = 2 = \begin{pmatrix} 2 \\ 0 \\ 0\end{pmatrix}_\mathcal{E} \), and finally we have \(f(1) = \frac{d^2}{dx^2}(x^3) = 6x = \begin{pmatrix} 0 \\ 6 \\ 0\end{pmatrix}_\mathcal{E} \) and so the associated matrix is \(A_f = \begin{pmatrix} 0 & 0 & 2 & 0 \\ 0 &0&0&6 \\ 0&0&0&0 \end{pmatrix} \). - In this case, the domain has dimension \(3 \) and the codomain has dimension \(1 \) so the associated matrix takes the form \(A_g = \begin{pmatrix} *&*&* \end{pmatrix} \). Let’s calculate the image of each basis vector.
We have \(g(1) = \int_{-1}^1 1 dx = 2\), \(g(x) = \int_{-1}^1 x dx = 0\) and \(g(x^2) = \int_{-1}^1 x^2 dx = \frac{2}{3}\). Therefore the associated matrix is \(A_g = \begin{pmatrix} 2&0&\frac{2}{3} \end{pmatrix} \).
Exercise 4
Calculate the rank and nullity of the linear maps from Exercise 3.
Solution
As we mentioned in the note following the definition of rank and nullity, we may compute the kernel and image of any linear map by doing so on an associated matrix. Let us then compute the rank and nullity of the linear map using the matrices with respect to the standard bases, as computed in the previous exercise.
- We had associated matrix \(A_f = \begin{pmatrix} 0 & 0 & 2 & 0 \\ 0 &0&0&6 \\ 0&0&0&0 \end{pmatrix}\). Let \(v = \begin{pmatrix} a \\ b \\ c \\ d \end{pmatrix}_{\mathcal{E}} \in \mathbb{R}[x]_{\leq 3}\) be an element of the domain expressed in terms of the standard basis. We can compute its image under the linear map via matrix multiplication. Explicitly we have \(f(v) = \begin{pmatrix} 0 & 0 & 2 & 0 \\ 0 &0&0&6 \\ 0&0&0&0 \end{pmatrix} \cdot \begin{pmatrix} a \\ b \\ c \\ d \end{pmatrix} = \begin{pmatrix} 2c \\ 6d \\ 0 \end{pmatrix}_{\mathcal{E}}.\) Thus, in order for \(v \) to be in the kernel we require \(c = d = 0 \), notice that \(a, b\) can be whatever we want. In other words, the kernel of \(f \) is given by \(\text{span}\left( \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \end{pmatrix}_{\mathcal{E}} , \begin{pmatrix} 0 \\ 1 \\ 0 \\ 0 \end{pmatrix}_{\mathcal{E}} \right) \). Therefore the nullity is \(2 \). Finally, the dimension of the domain, \(\mathbb{R}[x]_{\leq 3}\) is \(4 \) and so by the rank nullity theorem, we must have that the rank is \(4 – 2 = 2\).
However, let us (for sanity reasons) check that the rank really is \(2 \). We have computed that \(f(v) = \begin{pmatrix} 2c \\ 6d \\ 0 \end{pmatrix}_{\mathcal{E}} \). Therefore we see that the image is given by \(\text{span} \left( \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}_{\mathcal{E}} , \begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix}_{\mathcal{E}} \right)\) and so indeed the rank of the linear map is \(2 \).
As a final remark, just observe that this map is neither injective or surjective – and so you can never assume that a map always satisfies one of these properties. - For this part let us only calculate one of the rank or nullity and use the rank nullity theorem. Looking at the linear map and associated matrix it appears much easier to determine the rank. Recall that we have associated matrix \(A_g = \begin{pmatrix} 2&0&\frac{2}{3} \end{pmatrix} \). This is a non-zero matrix from a \(3 \) dimensional vector space (just count the number of columns) into a \(1 \) dimensional vector space (count the number of rows) and so it must have rank \(1 \). For example, consider the image of \(\begin{pmatrix} 0.5 \\ 0 \\ 0 \end{pmatrix}_\mathcal{E} \). Therefore, by the rank nullity theorem we have \(\text{nullity}(g) = 3 – 1 = 2 \).
Finally, if you wish to check, a basis for the kernel is \(\{x, 1-3x^2\} \) (others do exist).
Exercise 5
For each of the following associated matrices of linear maps from \(\mathbb{R}^3 \) to \(\mathbb{R}^2 \), where both are equipped with the standard basis, new bases \(\mathcal{B} \) of the domain \(\mathbb{R}^3 \) and \(\mathcal{D} \) of the codomain \(\mathbb{R}^2 \) have been given. Calculate the new associated matrices with respect to \(\mathcal{B} \) and \(\mathcal{D} \).
- \(A = \begin{pmatrix} 0 & 1 & 1 \\ 4 & 3 & 3 \end{pmatrix} \), \( \mathcal{B} = \left\{ \begin{pmatrix} 1 \\ 0 \\ 0\end{pmatrix},\begin{pmatrix} 1 \\ 1 \\ 0 \end{pmatrix},\begin{pmatrix} 1 \\ 1 \\ 1\end{pmatrix} \right\} \), \( \mathcal{D} = \left\{ \begin{pmatrix} -1 \\ 1\end{pmatrix},\begin{pmatrix}1 \\ 3 \end{pmatrix} \right\} \)
- \(A = \begin{pmatrix} 3 & -1 & 0 \\ 0 & 1 & 0 \end{pmatrix} \), \( \mathcal{B} = \left\{ \begin{pmatrix} 1 \\ 2 \\ 0 \end{pmatrix},\begin{pmatrix} -1 \\ 0 \\ 0\end{pmatrix},\begin{pmatrix} 0 \\ 0 \\ 1\end{pmatrix} \right\} \), \( \mathcal{D} = \left\{ \begin{pmatrix} 1 \\ 2 \end{pmatrix},\begin{pmatrix} -1 \\ 0 \end{pmatrix} \right\} \)
Solution
1. We must compute the image of each of the vectors in \(\mathcal{B} \), expressed as coordinate vectors with respect to \(\mathcal{D} \). We have:
Therefore, the associated matrix is \(\begin{pmatrix} 1 & 1 & 1 \\ 1 & 2 & 3 \end{pmatrix} \) with respect to bases \(\mathcal{B} \) and \(\mathcal{D} \).
2. Once again we compute the image of each of the vectors in \(\mathcal{B} \) expressed as coordinate vectors with respect to \(\mathcal{D} \):
Therefore, the associated matrix is \(\begin{pmatrix} 1 & 0 & 0 \\ 0 & 3 & 0 \end{pmatrix} \) with respect to bases \(\mathcal{B} \) and \(\mathcal{D} \).