Unit 4, lesson 22

Linear Maps on Polynomials and Matrices

How evaluating a polynomial at fixed points and taking the trace of a matrix are linear maps, how basis images give their matrices, and how to find their kernel and image and check rank-nullity.

  • Video 22
  • Vector Spaces Beyond Arrows

The curves p(t)=2+3t−t2p(t) = 2 + 3t - t^2 and q(t)=2+2tq(t) = 2 + 2t are different, yet both have height 22 at t=0t = 0 and height 44 at t=1t = 1. A device that records only those two heights cannot tell them apart. What exactly does such a measurement lose, and which readings can it produce? This lesson writes the measurement as a linear map, builds its matrix from basis images, finds its kernel and image, and then does the same for the trace of a matrix.

Key terms

Evaluation map

Definition A map TT from a vector space VV to a vector space WW is linear when T(u+v)=T(u)+T(v)T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v}) and T(cu)=cT(u)T(c\mathbf{u}) = cT(\mathbf{u}) for all u,v\mathbf{u}, \mathbf{v} in VV and all real cc. Fix real numbers s1,…,sks_1, \dots, s_k, called sample points. The evaluation map EE from P2P_2 to Rk\mathbb{R}^k sends a polynomial to its values at these points,

E(p)=[p(s1)⋮p(sk)].E(p) = \begin{bmatrix} p(s_1) \\ \vdots \\ p(s_k) \end{bmatrix}.

It is linear, because (p+q)(si)=p(si)+q(si)(p + q)(s_i) = p(s_i) + q(s_i) and (cp)(si)=c p(si)(cp)(s_i) = c\,p(s_i) at each fixed sis_i. The main example below uses the sample points 00 and 11, so E(p)=(p(0),p(1))E(p) = (p(0), p(1)).

In plain words The map is a measuring device that records the height of the graph at a few fixed inputs. The inputs stay put while the polynomial changes, and at a fixed input the value of a sum is the sum of the values, so the readings of a sum are the sums of the readings.

Example On this page a tuple written inline, such as (2,4)(2, 4), stands for a column vector. For p(t)=2+3t−t2p(t) = 2 + 3t - t^2 the readings are p(0)=2p(0) = 2 and p(1)=2+3−1=4p(1) = 2 + 3 - 1 = 4, so E(p)=(2,4)E(p) = (2, 4), and q(t)=2+2tq(t) = 2 + 2t also gives E(q)=(2,4)E(q) = (2, 4). Linearity then says E(q−p)=(0,0)E(q - p) = (0, 0), and indeed q−p=t2−tq - p = t^2 - t vanishes at 00 and at 11. Not every rule built from values is linear. The rule S(p)=p(0) p(1)S(p) = p(0)\,p(1) gives S(1)=1S(1) = 1 for the constant polynomial 11, but S(2)=4S(2) = 4 for the constant polynomial 22, not 2S(1)=22S(1) = 2, so it fails the scaling condition.

Linear map determined by basis images

Definition Let VV be a finite-dimensional vector space with ordered basis (v1,…,vn)(\mathbf{v}_1, \dots, \mathbf{v}_n), let WW be a vector space, and let w1,…,wn\mathbf{w}_1, \dots, \mathbf{w}_n be any vectors in WW, with repeats and dependence allowed. Then there is exactly one linear map TT from VV to WW with T(vj)=wjT(\mathbf{v}_j) = \mathbf{w}_j for every jj. For all real numbers c1,…,cnc_1, \dots, c_n it is given by

T(c1v1+⋯+cnvn)=c1w1+⋯+cnwn.\begin{aligned} &T(c_1\mathbf{v}_1 + \cdots + c_n\mathbf{v}_n) \\[0.4em] &\quad = c_1\mathbf{w}_1 + \cdots + c_n\mathbf{w}_n. \end{aligned}

Any linear map with these basis images must obey this formula, which gives uniqueness. The formula is well defined because each vector has unique coordinates in the basis, and it is linear because coordinates add and scale, which gives existence.

In plain words A linear map is known as soon as you know what it does to a basis. Those images can be chosen freely, and linearity fills in everything else.

Example The evaluation map is pinned down by E(1)=(1,1)E(1) = (1, 1), E(t)=(0,1)E(t) = (0, 1) and E(t2)=(0,1)E(t^2) = (0, 1), since then

E(a+bt+ct2)=a[11]+b[01]+c[01]=[aa+b+c].\begin{aligned} &E(a + bt + ct^2) \\[0.4em] &\quad = a\begin{bmatrix} 1 \\ 1 \end{bmatrix} + b\begin{bmatrix} 0 \\ 1 \end{bmatrix} + c\begin{bmatrix} 0 \\ 1 \end{bmatrix} \\[0.4em] &\quad = \begin{bmatrix} a \\ a + b + c \end{bmatrix}. \end{aligned}

Two basis vectors may share an image, as tt and t2t^2 do here. For a second example, choose T(1)=0T(1) = 0, T(t)=1T(t) = 1 and T(t2)=2tT(t^2) = 2t in P2P_2. The only linear map from P2P_2 to P2P_2 with these images is T(a+bt+ct2)=b+2ctT(a + bt + ct^2) = b + 2ct, so T(2+3t−t2)=3−2tT(2 + 3t - t^2) = 3 - 2t. This happens to be the derivative, but the construction uses only the three chosen images.

Matrix of a map in a polynomial basis

Definition Let TT be a linear map from VV to WW, let B=(v1,…,vn)\mathcal{B} = (\mathbf{v}_1, \dots, \mathbf{v}_n) be an ordered basis of VV, and let C\mathcal{C} be an ordered basis of WW, where dim⁡W=m\dim W = m. The matrix of TT relative to B\mathcal{B} and C\mathcal{C} is the m×nm \times n matrix whose jjth column is the coordinate column of T(vj)T(\mathbf{v}_j) in C\mathcal{C},

[T]C←B=[[T(v1)]C⋯[T(vn)]C].\begin{aligned} &[T]_{\mathcal{C} \leftarrow \mathcal{B}} \\[0.4em] &= \begin{bmatrix} [T(\mathbf{v}_1)]_{\mathcal{C}} & \cdots & [T(\mathbf{v}_n)]_{\mathcal{C}} \end{bmatrix}. \end{aligned}

It is the only matrix that satisfies

[T(v)]C=[T]C←B [v]B[T(\mathbf{v})]_{\mathcal{C}} = [T]_{\mathcal{C} \leftarrow \mathcal{B}}\,[\mathbf{v}]_{\mathcal{B}}

for every v\mathbf{v} in VV. When V=P2V = P_2 with the basis (1,t,t2)(1, t, t^2), the columns record the images of 11, tt and t2t^2 in output coordinates.

In plain words Push each input basis vector through the map, describe each result in the output basis, and place those descriptions side by side in the order of the input basis. Multiplying by the matrix then does the work of the map on coordinates.

Example For E(p)=(p(0),p(1))E(p) = (p(0), p(1)), with input basis (1,t,t2)(1, t, t^2) and the standard basis of R2\mathbb{R}^2, the columns are E(1)=(1,1)E(1) = (1, 1), E(t)=(0,1)E(t) = (0, 1) and E(t2)=(0,1)E(t^2) = (0, 1). Calling this matrix AA,

A=[100111],A[abc]=[aa+b+c],\begin{gathered} A = \begin{bmatrix} 1 & 0 & 0 \\ 1 & 1 & 1 \end{bmatrix}, \\[0.4em] A\begin{bmatrix} a \\ b \\ c \end{bmatrix} = \begin{bmatrix} a \\ a + b + c \end{bmatrix}, \end{gathered}

which matches substituting 00 and 11 into a+bt+ct2a + bt + ct^2. For p(t)=2+3t−t2p(t) = 2 + 3t - t^2, the coordinate column (2,3,−1)(2, 3, -1) gives (2,2+3−1)=(2,4)(2, 2 + 3 - 1) = (2, 4), the same as direct substitution.

Kernel and image of an evaluation map

Definition For a linear map TT from VV to WW, the kernel ker⁡T\ker T is the set of all v\mathbf{v} in VV with T(v)=0T(\mathbf{v}) = \mathbf{0}, and the image im⁡T\operatorname{im} T is the set of all outputs T(v)T(\mathbf{v}). The kernel is a subspace of VV and the image is a subspace of WW. When VV is finite-dimensional, the rank-nullity theorem says

dim⁡ker⁡T+dim⁡im⁡T=dim⁡V.\dim \ker T + \dim \operatorname{im} T = \dim V.

For an evaluation map EE on P2P_2, the kernel consists of the polynomials in P2P_2 that are zero at every sample point, and the image is the set of value lists that some polynomial in P2P_2 attains. If E(p0)=yE(p_0) = \mathbf{y}, then the polynomials pp with E(p)=yE(p) = \mathbf{y} are exactly those of the form p0+hp_0 + h with hh in ker⁡E\ker E.

In plain words The kernel holds the changes to a polynomial that the readings cannot see, and the image holds every list of readings that can occur. A kernel polynomial need not be the zero function. It is invisible to these readings, and a reading at any point where it is nonzero detects it.

Example For E(p)=(p(0),p(1))E(p) = (p(0), p(1)) and p=a+bt+ct2p = a + bt + ct^2, the kernel requires a=0a = 0 and a+b+c=0a + b + c = 0, so b=−cb = -c and p=c(t2−t)p = c(t^2 - t). Thus ker⁡E=span⁡{t2−t}\ker E = \operatorname{span}\{t^2 - t\} and the nullity is 11. The polynomial t2−tt^2 - t is not the zero function, since its value at t=12t = \frac{1}{2} is −14-\frac{1}{4}. Every pair (y0,y1)(y_0, y_1) is reached, by the polynomial y0+(y1−y0)ty_0 + (y_1 - y_0)t, so im⁡E=R2\operatorname{im} E = \mathbb{R}^2 and the rank is 22. The count 1+2=3=dim⁡P21 + 2 = 3 = \dim P_2 agrees with rank-nullity. The polynomials with readings (2,4)(2, 4) are 2+2t+c(t2−t)2 + 2t + c(t^2 - t), and c=−1c = -1 gives back 2+3t−t22 + 3t - t^2. So EE is surjective but not injective. Restricted to polynomials of degree at most one it becomes injective, since a=y0a = y_0 and b=y1−y0b = y_1 - y_0 are then forced.

Trace of a matrix

Definition The trace of an n×nn \times n matrix XX with entries xijx_{ij} is the sum of its diagonal entries,

tr⁡X=x11+x22+⋯+xnn.\operatorname{tr} X = x_{11} + x_{22} + \cdots + x_{nn}.

The trace map from Mn×nM_{n \times n} to R\mathbb{R} is linear, because the diagonal entries of X+YX + Y are the sums of those of XX and YY, and the diagonal entries of cXcX are cc times those of XX. On M2×2M_{2 \times 2},

tr⁡[abcd]=a+d,\operatorname{tr}\begin{bmatrix} a & b \\ c & d \end{bmatrix} = a + d,

so in the ordered basis (E11,E12,E21,E22)(E_{11}, E_{12}, E_{21}, E_{22}) of M2×2M_{2 \times 2} and the basis (1)(1) of R\mathbb{R} the trace has the 1×41 \times 4 matrix [1001]\begin{bmatrix} 1 & 0 & 0 & 1 \end{bmatrix}.

In plain words The trace reads only the diagonal. It is a one-number measurement of a matrix, and every off-diagonal entry is invisible to it.

Example For

X=[2−134]X = \begin{bmatrix} 2 & -1 \\ 3 & 4 \end{bmatrix}

the trace is 2+4=62 + 4 = 6. A matrix in M2×2M_{2 \times 2} has trace zero exactly when d=−ad = -a, and then

[abc−a]=a(E11−E22)+bE12+cE21.\begin{aligned} \begin{bmatrix} a & b \\ c & -a \end{bmatrix} &= a(E_{11} - E_{22}) \\[0.4em] &\quad + bE_{12} + cE_{21}. \end{aligned}

The matrices E11−E22E_{11} - E_{22}, E12E_{12} and E21E_{21} have trace zero and span the kernel. They are independent, because the (1,1)(1,1), (1,2)(1,2) and (2,1)(2,1) entries of the combination are aa, bb and cc. So the nullity is 33. Every real number rr is a trace, for example of rE11rE_{11}, so the image is R\mathbb{R} and the rank is 11. Again 3+1=4=dim⁡M2×23 + 1 = 4 = \dim M_{2 \times 2}.

Check yourself

  1. For E(p)=(p(0),p(1))E(p) = (p(0), p(1)) on P2P_2, find the coordinates of t−t2t - t^2 in the basis (1,t,t2)(1, t, t^2) and compute E(t−t2)E(t - t^2). Does the result mean that t−t2t - t^2 is the zero polynomial?
Show the answer

The coordinate column is (0,1,−1)(0, 1, -1), and the matrix AA gives (0,0+1−1)=(0,0)(0, 0 + 1 - 1) = (0, 0). So t−t2t - t^2 lies in ker⁡E\ker E. It is not the zero polynomial, since its coefficients are not all zero, and at t=12t = \frac{1}{2} its value is 14\frac{1}{4}. The two readings simply cannot tell it apart from 00.

  1. Let F(p)=(p(−1),p(1))F(p) = (p(-1), p(1)) on P2P_2. Find the matrix of FF in the basis (1,t,t2)(1, t, t^2) and the standard basis of R2\mathbb{R}^2, a basis of ker⁡F\ker F, and every pp with F(p)=(2,6)F(p) = (2, 6).
Show the answer

For p=a+bt+ct2p = a + bt + ct^2 the readings are p(−1)=a−b+cp(-1) = a - b + c and p(1)=a+b+cp(1) = a + b + c. The images of 11, tt and t2t^2 are (1,1)(1, 1), (−1,1)(-1, 1) and (1,1)(1, 1), so the matrix is

[1−11111].\begin{bmatrix} 1 & -1 & 1 \\ 1 & 1 & 1 \end{bmatrix}.

For the kernel, subtracting the two equations gives 2b=02b = 0, so b=0b = 0 and a=−ca = -c. Every kernel polynomial is c(t2−1)c(t^2 - 1), so t2−1t^2 - 1 is a basis and the nullity is 11. For the target, subtracting gives 2b=42b = 4, so b=2b = 2, and adding gives 2a+2c=82a + 2c = 8, so a=4−ca = 4 - c. The solutions are the polynomials

p(t)=4+2t+c(t2−1)p(t) = 4 + 2t + c(t^2 - 1)

with cc any real number. Check that 4+2t4 + 2t gives 22 at −1-1 and 66 at 11, and that t2−1t^2 - 1 is zero at both points.

  1. Let H(p)=(p(0),p(0))H(p) = (p(0), p(0)), which measures at 00 twice. Find its matrix in the same bases, its rank, a basis of its kernel, and decide whether some pp in P2P_2 has H(p)=(2,6)H(p) = (2, 6).
Show the answer

For p=a+bt+ct2p = a + bt + ct^2 we get H(p)=(a,a)H(p) = (a, a), so the matrix is

[100100].\begin{bmatrix} 1 & 0 & 0 \\ 1 & 0 & 0 \end{bmatrix}.

The image is the line of pairs with equal entries, so the rank is 11. The kernel is given by a=0a = 0, with basis (t,t2)(t, t^2), so the nullity is 22, and 1+2=31 + 2 = 3 as rank-nullity requires. No polynomial gives (2,6)(2, 6), because every output has equal entries. Two readings at the same point carry only one independent piece of information.

How this lesson connects