MATH1231 5,254 words·27 min read

Linear Transformations

7.1 Introduction to linear maps#

Recall that a function f:X→Yf: X \to Y is a rule which assigns exactly one element y=f(x)y = f(x) of the codomain YY to each element xx of the domain XX. The element xx is called an argument of the function, and y=f(x)y = f(x) is called the image of xx under ff.

Linear maps are a special class of functions where both the domain and the codomain are vector spaces, and where the function "preserves" the two fundamental vector space operations; adding two vectors then applying the map gives the same result as applying the map first and then adding, and the same goes for scalar multiplication.

Note

Definition 1
Let VV and WW be two vector spaces over the same field F\mathbb{F}. A function T:V→WT : V \to W is called a linear map or linear transformation if the following two conditions are satisfied.

  1. Addition Condition. T(v+v′)=T(v)+T(v′)T(\mathbf{v} + \mathbf{v}') = T(\mathbf{v}) + T(\mathbf{v}') for all v,v′∈V\mathbf{v}, \mathbf{v}' \in V, and
  2. Scalar Multiplication Condition. T(λv)=λT(v)T(\lambda \mathbf{v}) = \lambda T(\mathbf{v}) for all λ∈F\lambda \in \mathbb{F} and v∈V\mathbf{v} \in V.

Basically, a linear map is a function where the order of operations does not matter; you can "add then map" or "map then add", "scale then map" or "map then scale", and you always land in the same place. The vector space operations pass straight through the function untouched. Geometric operations like rotating, reflecting and projecting behave exactly like this, and so do calculus operations like differentiating and integrating, which is why linear maps show up everywhere.

Example. Show that the function T:R→RT: \mathbb{R} \to \mathbb{R} defined by T(x)=a0+a1xT(x) = a_0 + a_1x, where a0,a1∈Ra_0, a_1 \in \mathbb{R} are constants, is a linear map if and only if a0=0a_0 = 0.

The domain and codomain are both R\mathbb{R}, which is a vector space, so we check the two conditions. For x,x′∈Rx, x' \in \mathbb{R},

T(x+x′)=a0+a1(x+x′),\begin{align*} T(x + x') &= a_0 + a_1(x + x'), \end{align*}

whereas

T(x)+T(x′)=(a0+a1x)+(a0+a1x′)=2a0+a1(x+x′).\begin{align*} T(x) + T(x') &= (a_0 + a_1x) + (a_0 + a_1x') \\ &= 2a_0 + a_1(x + x'). \end{align*}

The two expressions are equal if and only if a0=2a0a_0 = 2a_0, that is, if and only if a0=0a_0 = 0. In that case we check the scalar multiplication condition:

T(λx)=a1(λx)=λ(a1x)=λT(x).\begin{align*} T(\lambda x) &= a_1(\lambda x) \\ &= \lambda(a_1 x) \\ &= \lambda T(x). \end{align*}

Therefore, TT is a linear map if and only if a0=0a_0 = 0.

Notice how y=a0+a1xy = a_0 + a_1x is the equation of a line in R2\mathbb{R}^2; the equation of a line defines a linear map if and only if the line passes through the origin. It is important to remember that a "linear polynomial" like T(x)=3x+2T(x) = 3x + 2 is NOT a linear map; the constant term must be zero.

Example. Show that the function T:R3→R2T: \mathbb{R}^3 \to \mathbb{R}^2 defined by

T(x)=(−5x2+4x3x1+2x3)forx=(x1x2x3)∈R3,T(\mathbf{x}) = \begin{pmatrix} -5x_2 + 4x_3 \\ x_1 + 2x_3 \end{pmatrix} \quad \text{for} \quad \mathbf{x} = \begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix} \in \mathbb{R}^3,

is a linear map.

Both R3\mathbb{R}^3 and R2\mathbb{R}^2 are vector spaces, so we just check the two conditions.

Addition condition. For x,x′∈R3\mathbf{x}, \mathbf{x}' \in \mathbb{R}^3,

T(x+x′)=(−5(x2+x2′)+4(x3+x3′)(x1+x1′)+2(x3+x3′))=(−5x2+4x3x1+2x3)+(−5x2′+4x3′x1′+2x3′)=T(x)+T(x′).\begin{align*} T(\mathbf{x} + \mathbf{x}') &= \begin{pmatrix} -5(x_2 + x_2') + 4(x_3 + x_3') \\ (x_1 + x_1') + 2(x_3 + x_3') \end{pmatrix} \\ &= \begin{pmatrix} -5x_2 + 4x_3 \\ x_1 + 2x_3 \end{pmatrix} + \begin{pmatrix} -5x_2' + 4x_3' \\ x_1' + 2x_3' \end{pmatrix} \\ &= T(\mathbf{x}) + T(\mathbf{x}'). \end{align*}

Scalar multiplication condition. For x∈R3\mathbf{x} \in \mathbb{R}^3 and λ∈R\lambda \in \mathbb{R},

T(λx)=(−5(λx2)+4(λx3)λx1+2(λx3))=λ(−5x2+4x3x1+2x3)=λT(x).\begin{align*} T(\lambda \mathbf{x}) &= \begin{pmatrix} -5(\lambda x_2) + 4(\lambda x_3) \\ \lambda x_1 + 2(\lambda x_3) \end{pmatrix} \\ &= \lambda \begin{pmatrix} -5x_2 + 4x_3 \\ x_1 + 2x_3 \end{pmatrix} \\ &= \lambda T(\mathbf{x}). \end{align*}

Both conditions hold, and therefore TT is a linear map.

Quick ways to show a map is NOT linear#

Every linear map is forced to behave nicely on the zero vector and on negatives.

Note

Proposition 1
If T:V→WT: V \to W is a linear map, then

  1. T(0)=0T(\mathbf{0}) = \mathbf{0}, and
  2. T(−v)=−T(v)T(-\mathbf{v}) = -T(\mathbf{v}) for all v∈V\mathbf{v} \in V.

Proof. Since 0v=00\mathbf{v} = \mathbf{0} in any vector space, the scalar multiplication condition gives

T(0)=T(0v)=0 T(v)=0.\begin{align*} T(\mathbf{0}) &= T(0\mathbf{v}) \\ &= 0\,T(\mathbf{v}) \\ &= \mathbf{0}. \end{align*}

Similarly, since −v=(−1)v-\mathbf{v} = (-1)\mathbf{v},

T(−v)=T((−1)v)=(−1)T(v)=−T(v).■\begin{align*} T(-\mathbf{v}) &= T\big((-1)\mathbf{v}\big) \\ &= (-1)T(\mathbf{v}) \\ &= -T(\mathbf{v}). \quad \blacksquare \end{align*}

Basically, a linear map must send the zero vector of the domain to the zero vector of the codomain. This gives you the fastest possible "not linear" test: plug in 0\mathbf{0} first, and if you do not get 0\mathbf{0} out, you are done. If T(0)=0T(\mathbf{0}) = \mathbf{0} does hold, hunt for a specific numerical counterexample to one of the two conditions instead (same idea as disproving closure in subspace questions).

Example. Show that the function T:R2→RT: \mathbb{R}^2 \to \mathbb{R} defined by T(x1x2)=4x1+3(x2−6)T\begin{pmatrix} x_1 \\ x_2 \end{pmatrix} = 4x_1 + 3(x_2 - 6) is not linear.

We have

T(00)=4(0)+3(0−6)=−18≠0.\begin{align*} T\begin{pmatrix} 0 \\ 0 \end{pmatrix} &= 4(0) + 3(0 - 6) \\ &= -18 \\ &\neq 0. \end{align*}

Since T(0)≠0T(\mathbf{0}) \neq \mathbf{0}, TT is not a linear map.

Example. Show that the function T:R→RT: \mathbb{R} \to \mathbb{R} defined by T(x)=x2T(x) = x^2 is not linear.

Here T(0)=0T(0) = 0, so the quick test tells us nothing; we look for a numerical counterexample to the scalar multiplication condition:

T(2×3)=36,2 T(3)=2×9=18.\begin{align*} T(2 \times 3) &= 36, \\ 2\,T(3) &= 2 \times 9 = 18. \end{align*}

Since T(2×3)≠2 T(3)T(2 \times 3) \neq 2\,T(3), TT is not a linear map.

The converse of Proposition 1 is NOT true; a function can pass both the T(0)=0T(\mathbf{0}) = \mathbf{0} and T(−v)=−T(v)T(-\mathbf{v}) = -T(\mathbf{v}) tests and still fail to be linear.

Example. The function T(x)=x3T(x) = x^3 satisfies T(0)=0T(0) = 0 and T(−x)=−T(x)T(-x) = -T(x), but

T(2×1)=8,2 T(1)=2,\begin{align*} T(2 \times 1) &= 8, \\ 2\,T(1) &= 2, \end{align*}

so TT is not a linear map. Passing the quick tests is necessary but never sufficient.

The one-condition test and linear combinations#

The two conditions in the definition can be merged into a single condition, which halves the amount of algebra you have to do in a "show that TT is linear" question.

Note

Theorem 2
A function T:V→WT: V \to W is a linear map if and only if for all λ1,λ2∈F\lambda_1, \lambda_2 \in \mathbb{F} and v1,v2∈V\mathbf{v}_1, \mathbf{v}_2 \in V,

T(λ1v1+λ2v2)=λ1T(v1)+λ2T(v2).T(\lambda_1 \mathbf{v}_1 + \lambda_2 \mathbf{v}_2) = \lambda_1 T(\mathbf{v}_1) + \lambda_2 T(\mathbf{v}_2).

Proof. If TT is linear, then by the addition condition followed by the scalar multiplication condition (used twice),

T(λ1v1+λ2v2)=T(λ1v1)+T(λ2v2)=λ1T(v1)+λ2T(v2).\begin{align*} T(\lambda_1 \mathbf{v}_1 + \lambda_2 \mathbf{v}_2) &= T(\lambda_1 \mathbf{v}_1) + T(\lambda_2 \mathbf{v}_2) \\ &= \lambda_1 T(\mathbf{v}_1) + \lambda_2 T(\mathbf{v}_2). \end{align*}

Conversely, if the combined condition holds, then choosing λ1=λ2=1\lambda_1 = \lambda_2 = 1 recovers the addition condition, and choosing λ2=0\lambda_2 = 0 recovers the scalar multiplication condition. ■\blacksquare

Example. Show that the function T:R2→R3T: \mathbb{R}^2 \to \mathbb{R}^3 defined by

T(x)=(3x1−x24x25x1+6x2)forx=(x1x2)∈R2,T(\mathbf{x}) = \begin{pmatrix} 3x_1 - x_2 \\ 4x_2 \\ 5x_1 + 6x_2 \end{pmatrix} \quad \text{for} \quad \mathbf{x} = \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} \in \mathbb{R}^2,

is a linear map.

For x,x′∈R2\mathbf{x}, \mathbf{x}' \in \mathbb{R}^2 and λ,μ∈R\lambda, \mu \in \mathbb{R}, we have λx+μx′=(λx1+μx1′λx2+μx2′)\lambda\mathbf{x} + \mu\mathbf{x}' = \begin{pmatrix} \lambda x_1 + \mu x_1' \\ \lambda x_2 + \mu x_2' \end{pmatrix}, and hence

T(λx+μx′)=(3(λx1+μx1′)−(λx2+μx2′)4(λx2+μx2′)5(λx1+μx1′)+6(λx2+μx2′))=λ(3x1−x24x25x1+6x2)+μ(3x1′−x2′4x2′5x1′+6x2′)=λT(x)+μT(x′).\begin{align*} T(\lambda\mathbf{x} + \mu\mathbf{x}') &= \begin{pmatrix} 3(\lambda x_1 + \mu x_1') - (\lambda x_2 + \mu x_2') \\ 4(\lambda x_2 + \mu x_2') \\ 5(\lambda x_1 + \mu x_1') + 6(\lambda x_2 + \mu x_2') \end{pmatrix} \\ &= \lambda \begin{pmatrix} 3x_1 - x_2 \\ 4x_2 \\ 5x_1 + 6x_2 \end{pmatrix} + \mu \begin{pmatrix} 3x_1' - x_2' \\ 4x_2' \\ 5x_1' + 6x_2' \end{pmatrix} \\ &= \lambda T(\mathbf{x}) + \mu T(\mathbf{x}'). \end{align*}

Therefore, by Theorem 2, TT is a linear map.

An induction argument extends the one-condition test from two vectors to any finite linear combination.

Note

Theorem 3
If TT is a linear map with domain VV and S={v1,…,vn}S = \{\mathbf{v}_1, \dots, \mathbf{v}_n\} is a set of vectors in VV, then for all scalars λ1,…,λn\lambda_1, \dots, \lambda_n,

T(λ1v1+⋯+λnvn)=λ1T(v1)+⋯+λnT(vn).T(\lambda_1\mathbf{v}_1 + \cdots + \lambda_n\mathbf{v}_n) = \lambda_1 T(\mathbf{v}_1) + \cdots + \lambda_n T(\mathbf{v}_n).

In other words, linear maps preserve linear combinations. This has a very useful consequence: if you know what TT does to a basis, you know what TT does to everything, because every vector is a unique linear combination of the basis vectors.

Note

Theorem 4
For a linear map T:V→WT: V \to W, the function values for every vector in the domain are known if and only if the function values for a basis of the domain are known. Further, if B={v1,…,vn}B = \{\mathbf{v}_1, \dots, \mathbf{v}_n\} is a basis for VV, then for all v∈V\mathbf{v} \in V,

T(v)=x1T(v1)+⋯+xnT(vn),T(\mathbf{v}) = x_1 T(\mathbf{v}_1) + \cdots + x_n T(\mathbf{v}_n),

where x1,…,xnx_1, \dots, x_n are the scalars in the unique linear combination v=x1v1+⋯+xnvn\mathbf{v} = x_1\mathbf{v}_1 + \cdots + x_n\mathbf{v}_n.

Example. Let T:R3→R2T: \mathbb{R}^3 \to \mathbb{R}^2 be a linear map with

T(100)=(37),T(010)=(−56),T(001)=(−28).T\begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 3 \\ 7 \end{pmatrix}, \quad T\begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix} = \begin{pmatrix} -5 \\ 6 \end{pmatrix}, \quad T\begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} = \begin{pmatrix} -2 \\ 8 \end{pmatrix}.

Find the function value at x=(x1x2x3)\mathbf{x} = \begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix}.

Since x=x1e1+x2e2+x3e3\mathbf{x} = x_1\mathbf{e}_1 + x_2\mathbf{e}_2 + x_3\mathbf{e}_3, Theorem 3 gives

T(x)=x1T(e1)+x2T(e2)+x3T(e3)=x1(37)+x2(−56)+x3(−28)=(3x1−5x2−2x37x1+6x2+8x3).\begin{align*} T(\mathbf{x}) &= x_1 T(\mathbf{e}_1) + x_2 T(\mathbf{e}_2) + x_3 T(\mathbf{e}_3) \\ &= x_1 \begin{pmatrix} 3 \\ 7 \end{pmatrix} + x_2 \begin{pmatrix} -5 \\ 6 \end{pmatrix} + x_3 \begin{pmatrix} -2 \\ 8 \end{pmatrix} \\ &= \begin{pmatrix} 3x_1 - 5x_2 - 2x_3 \\ 7x_1 + 6x_2 + 8x_3 \end{pmatrix}. \end{align*}

Therefore, three function values were enough to pin down the whole map.

Example. Show that the function T:R3→R2T: \mathbb{R}^3 \to \mathbb{R}^2 with the same three values as above, but which also satisfies T(111)=(−420)T\begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix} = \begin{pmatrix} -4 \\ 20 \end{pmatrix}, is not a linear map.

If TT were linear, then since (111)=e1+e2+e3\begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix} = \mathbf{e}_1 + \mathbf{e}_2 + \mathbf{e}_3, Theorem 3 would force

T(111)=T(e1)+T(e2)+T(e3)=(37)+(−56)+(−28)=(−421).\begin{align*} T\begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix} &= T(\mathbf{e}_1) + T(\mathbf{e}_2) + T(\mathbf{e}_3) \\ &= \begin{pmatrix} 3 \\ 7 \end{pmatrix} + \begin{pmatrix} -5 \\ 6 \end{pmatrix} + \begin{pmatrix} -2 \\ 8 \end{pmatrix} \\ &= \begin{pmatrix} -4 \\ 21 \end{pmatrix}. \end{align*}

But we are told T(111)=(−420)≠(−421)T\begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix} = \begin{pmatrix} -4 \\ 20 \end{pmatrix} \neq \begin{pmatrix} -4 \\ 21 \end{pmatrix}, and hence TT is not a linear map.

Common exam traps#

The strategy for "is TT linear?" questions: first check the domain and codomain are actually vector spaces, then check T(0)=0T(\mathbf{0}) = \mathbf{0}, then try small specific vectors (especially λ=−1\lambda = -1), and only commit to the general algebra of Theorem 2 once nothing has broken.

Example (trap: translation). Is T:R2→R2T: \mathbb{R}^2 \to \mathbb{R}^2 defined by T(x)=x+(11)T(\mathbf{x}) = \mathbf{x} + \begin{pmatrix} 1 \\ 1 \end{pmatrix} a linear map?

No;

T(00)=(11)≠(00).\begin{align*} T\begin{pmatrix} 0 \\ 0 \end{pmatrix} &= \begin{pmatrix} 1 \\ 1 \end{pmatrix} \\ &\neq \begin{pmatrix} 0 \\ 0 \end{pmatrix}. \end{align*}

Therefore a translation is never a linear map (unless you translate by 0\mathbf{0}), even though sliding the plane around feels like the most "linear" thing imaginable.

Example (trap: absolute value). Is T:R→RT: \mathbb{R} \to \mathbb{R} defined by T(x)=∣x∣T(x) = |x| a linear map?

Here T(0)=0T(0) = 0, so the quick test passes. Try λ=−1\lambda = -1:

T((−1)×1)=∣−1∣=1,(−1) T(1)=−1.\begin{align*} T\big((-1) \times 1\big) &= |-1| = 1, \\ (-1)\,T(1) &= -1. \end{align*}

Since 1≠−11 \neq -1, the scalar multiplication condition fails and TT is not linear. Whenever a formula folds negatives back onto positives, λ=−1\lambda = -1 is the counterexample to reach for.

Example (trap: determinant). Is T:M22(R)→RT: M_{22}(\mathbb{R}) \to \mathbb{R} defined by T(A)=det⁡(A)T(A) = \det(A) a linear map?

The domain and codomain are vector spaces and det⁡(O)=0\det(O) = 0, so we test the conditions on the identity matrix II:

T(2I)=det⁡(2002)=4,2 T(I)=2×1=2.\begin{align*} T(2I) &= \det \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix} = 4, \\ 2\,T(I) &= 2 \times 1 = 2. \end{align*}

Since 4≠24 \neq 2, TT is not linear. In fact det⁡(λA)=λ2det⁡(A)\det(\lambda A) = \lambda^2 \det(A) for 2×22 \times 2 matrices, so the determinant scales quadratically, not linearly.

Example (trap: the domain matters). Is S:[−1,1]→RS: [-1, 1] \to \mathbb{R} defined by S(x)=5xS(x) = 5x a linear map?

No, and not because of the formula; the domain [−1,1][-1,1] is not a vector space (it is not closed under addition or scalar multiplication), so SS is disqualified before we even check the conditions. The function T:R→RT: \mathbb{R} \to \mathbb{R} with the same rule T(x)=5xT(x) = 5x is linear. Always check that the domain and codomain are vector spaces before checking the two conditions.

7.2 Linear maps from Rn\mathbb{R}^n to Rm\mathbb{R}^m and m×nm \times n matrices#

If you look back at the examples in the previous section, every linear map from Rn\mathbb{R}^n to Rm\mathbb{R}^m we wrote down could have been written as T(x)=AxT(\mathbf{x}) = A\mathbf{x} for some m×nm \times n matrix AA. This is no accident; in this section we show that every matrix defines a linear map and, conversely, every linear map from Rn\mathbb{R}^n to Rm\mathbb{R}^m is a matrix map.

Note

Theorem 1
For each m×nm \times n matrix AA, the function TA:Rn→RmT_A : \mathbb{R}^n \to \mathbb{R}^m defined by

TA(x)=Axforx∈Rn,T_A(\mathbf{x}) = A\mathbf{x} \quad \text{for} \quad \mathbf{x} \in \mathbb{R}^n,

is a linear map.

Proof. This follows straight from the matrix arithmetic rules of 1131. For all x,x′∈Rn\mathbf{x}, \mathbf{x}' \in \mathbb{R}^n and λ∈R\lambda \in \mathbb{R},

TA(x+x′)=A(x+x′)=Ax+Ax′=TA(x)+TA(x′),\begin{align*} T_A(\mathbf{x} + \mathbf{x}') &= A(\mathbf{x} + \mathbf{x}') \\ &= A\mathbf{x} + A\mathbf{x}' \\ &= T_A(\mathbf{x}) + T_A(\mathbf{x}'), \end{align*}

and

TA(λx)=A(λx)=λ(Ax)=λTA(x).■\begin{align*} T_A(\lambda\mathbf{x}) &= A(\lambda\mathbf{x}) \\ &= \lambda(A\mathbf{x}) \\ &= \lambda T_A(\mathbf{x}). \quad \blacksquare \end{align*}

Example. Describe the linear map TAT_A such that TA(x)=AxT_A(\mathbf{x}) = A\mathbf{x} for the matrix

A=(34−10−56).A = \begin{pmatrix} 3 & 4 \\ -1 & 0 \\ -5 & 6 \end{pmatrix}.

Since AA has 33 rows and 22 columns, the domain is R2\mathbb{R}^2 and the codomain is R3\mathbb{R}^3 (an m×nm \times n matrix eats vectors of length nn and spits out vectors of length mm), and

TA(x1x2)=Ax=(3x1+4x2−x1−5x1+6x2).T_A \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} = A\mathbf{x} = \begin{pmatrix} 3x_1 + 4x_2 \\ -x_1 \\ -5x_1 + 6x_2 \end{pmatrix}.

Therefore every matrix defines a linear map just by multiplication.

The converse direction is the important one.

Note

Matrix Representation Theorem
Let T:Rn→RmT: \mathbb{R}^n \to \mathbb{R}^m be a linear map and let ej\mathbf{e}_j for 1⩽j⩽n1 \leqslant j \leqslant n be the standard basis vectors of Rn\mathbb{R}^n. Then the m×nm \times n matrix AA whose columns are given by

aj=T(ej)for1⩽j⩽n,\mathbf{a}_j = T(\mathbf{e}_j) \quad \text{for} \quad 1 \leqslant j \leqslant n,

has the property that T(x)=AxT(\mathbf{x}) = A\mathbf{x} for all x∈Rn\mathbf{x} \in \mathbb{R}^n.

Proof. Every x∈Rn\mathbf{x} \in \mathbb{R}^n can be written uniquely as x=x1e1+⋯+xnen\mathbf{x} = x_1\mathbf{e}_1 + \cdots + x_n\mathbf{e}_n. By Theorem 3 of Section 7.1,

T(x)=T(x1e1+⋯+xnen)=x1T(e1)+⋯+xnT(en)=x1a1+⋯+xnan=Ax,\begin{align*} T(\mathbf{x}) &= T(x_1\mathbf{e}_1 + \cdots + x_n\mathbf{e}_n) \\ &= x_1 T(\mathbf{e}_1) + \cdots + x_n T(\mathbf{e}_n) \\ &= x_1\mathbf{a}_1 + \cdots + x_n\mathbf{a}_n \\ &= A\mathbf{x}, \end{align*}

where the last step uses the fact (Proposition 3 of Section 6.4) that a linear combination of the columns of AA is exactly the matrix product AxA\mathbf{x}. ■\blacksquare

The take-away formula is

A=(T(e1)  ∣  T(e2)  ∣  ⋯  ∣  T(en)),\boxed{A = \Big( T(\mathbf{e}_1) \;\Big|\; T(\mathbf{e}_2) \;\Big|\; \cdots \;\Big|\; T(\mathbf{e}_n) \Big)},

i.e. the jjth column of the matrix is the image of the jjth standard basis vector. This is worth internalising; it is how you will construct every geometric matrix in Section 7.3.

Example. Find a matrix AA such that T(x)=AxT(\mathbf{x}) = A\mathbf{x} for the linear map T:R3→R2T: \mathbb{R}^3 \to \mathbb{R}^2 defined by

T(x1x2x3)=(3x1−5x2+6x35x2+31x3).T\begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix} = \begin{pmatrix} 3x_1 - 5x_2 + 6x_3 \\ 5x_2 + 31x_3 \end{pmatrix}.

We compute the images of the standard basis vectors:

T(e1)=(30),T(e2)=(−55),T(e3)=(631).\begin{align*} T(\mathbf{e}_1) &= \begin{pmatrix} 3 \\ 0 \end{pmatrix}, \\ T(\mathbf{e}_2) &= \begin{pmatrix} -5 \\ 5 \end{pmatrix}, \\ T(\mathbf{e}_3) &= \begin{pmatrix} 6 \\ 31 \end{pmatrix}. \end{align*}

Therefore, placing these as columns,

A=(3−560531).A = \begin{pmatrix} 3 & -5 & 6 \\ 0 & 5 & 31 \end{pmatrix}.

An alternative (often faster) method is to notice that the components of T(x)T(\mathbf{x}) look like the left-hand side of a system of linear equations, and simply read off the coefficient matrix.

Example. Find a matrix AA such that T(x)=AxT(\mathbf{x}) = A\mathbf{x} for the linear map T:R4→R3T: \mathbb{R}^4 \to \mathbb{R}^3 defined by

T(x1x2x3x4)=(2x1−3x2+4x3−5x4−2x1+3x4x1−5x2+6x3−8x4).T\begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{pmatrix} = \begin{pmatrix} 2x_1 - 3x_2 + 4x_3 - 5x_4 \\ -2x_1 + 3x_4 \\ x_1 - 5x_2 + 6x_3 - 8x_4 \end{pmatrix}.

Reading off the coefficients row by row (remembering to put a 00 wherever a variable is missing),

A=(2−34−5−20031−56−8).A = \begin{pmatrix} 2 & -3 & 4 & -5 \\ -2 & 0 & 0 & 3 \\ 1 & -5 & 6 & -8 \end{pmatrix}.

Therefore T(x)=AxT(\mathbf{x}) = A\mathbf{x} for all x∈R4\mathbf{x} \in \mathbb{R}^4; both methods must always give the same matrix.

Example (images of non-standard vectors). A linear map T:R2→R2T: \mathbb{R}^2 \to \mathbb{R}^2 satisfies

T(11)=(20)andT(1−1)=(04).T\begin{pmatrix} 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 2 \\ 0 \end{pmatrix} \quad \text{and} \quad T\begin{pmatrix} 1 \\ -1 \end{pmatrix} = \begin{pmatrix} 0 \\ 4 \end{pmatrix}.

Find the matrix of TT with respect to the standard basis.

The trap here is that we were not given T(e1)T(\mathbf{e}_1) and T(e2)T(\mathbf{e}_2); we have to build them, using the fact that TT preserves linear combinations. Since e1=12(11)+12(1−1)\mathbf{e}_1 = \frac{1}{2}\begin{pmatrix} 1 \\ 1 \end{pmatrix} + \frac{1}{2}\begin{pmatrix} 1 \\ -1 \end{pmatrix},

T(e1)=12 T(11)+12 T(1−1)=12(20)+12(04)=(12).\begin{align*} T(\mathbf{e}_1) &= \frac{1}{2}\,T\begin{pmatrix} 1 \\ 1 \end{pmatrix} + \frac{1}{2}\,T\begin{pmatrix} 1 \\ -1 \end{pmatrix} \\ &= \frac{1}{2}\begin{pmatrix} 2 \\ 0 \end{pmatrix} + \frac{1}{2}\begin{pmatrix} 0 \\ 4 \end{pmatrix} \\ &= \begin{pmatrix} 1 \\ 2 \end{pmatrix}. \end{align*}

Similarly, e2=12(11)−12(1−1)\mathbf{e}_2 = \frac{1}{2}\begin{pmatrix} 1 \\ 1 \end{pmatrix} - \frac{1}{2}\begin{pmatrix} 1 \\ -1 \end{pmatrix}, and hence

T(e2)=12(20)−12(04)=(1−2).\begin{align*} T(\mathbf{e}_2) &= \frac{1}{2}\begin{pmatrix} 2 \\ 0 \end{pmatrix} - \frac{1}{2}\begin{pmatrix} 0 \\ 4 \end{pmatrix} \\ &= \begin{pmatrix} 1 \\ -2 \end{pmatrix}. \end{align*}

Therefore

A=(112−2),A = \begin{pmatrix} 1 & 1 \\ 2 & -2 \end{pmatrix},

and a quick sanity check confirms A(11)=(20)A\begin{pmatrix} 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 2 \\ 0 \end{pmatrix} as required. This works because {(11),(1−1)}\left\{ \begin{pmatrix} 1 \\ 1 \end{pmatrix}, \begin{pmatrix} 1 \\ -1 \end{pmatrix} \right\} is a basis of R2\mathbb{R}^2; by Theorem 4, values on a basis determine the map completely.

7.3 Geometric examples of linear transformations#

Many of the standard geometric operations on R2\mathbb{R}^2 and R3\mathbb{R}^3 are linear maps: stretching, compressing, reflecting, rotating and projecting. For each of them, the Matrix Representation Theorem gives a mechanical recipe for the matrix: work out where e1\mathbf{e}_1 and e2\mathbf{e}_2 land, and make those the columns.

A useful general fact first: linear maps send lines to lines (or squash them to points).

Note

Proposition 1
Suppose that T:Rn→RmT: \mathbb{R}^n \to \mathbb{R}^m is a linear map. Then TT maps a line in Rn\mathbb{R}^n to either a line or a point in Rm\mathbb{R}^m.

Proof. A line is the set {x∈Rn:x=a+λv, λ∈R}\{\mathbf{x} \in \mathbb{R}^n : \mathbf{x} = \mathbf{a} + \lambda\mathbf{v},\ \lambda \in \mathbb{R}\} with v≠0\mathbf{v} \neq \mathbf{0}. By Theorem 2 of Section 7.1, T(a+λv)=T(a)+λT(v)T(\mathbf{a} + \lambda\mathbf{v}) = T(\mathbf{a}) + \lambda T(\mathbf{v}), so the image is {y∈Rm:y=T(a)+λT(v), λ∈R}\{\mathbf{y} \in \mathbb{R}^m : \mathbf{y} = T(\mathbf{a}) + \lambda T(\mathbf{v}),\ \lambda \in \mathbb{R}\}; this is a line when T(v)≠0T(\mathbf{v}) \neq \mathbf{0} and the single point T(a)T(\mathbf{a}) otherwise. ■\blacksquare

The same argument shows a line segment maps to the segment between the images of the endpoints, which is why it is enough to transform the vertices of a shape and then reconnect them.

Stretching and dilation#

A 2×22 \times 2 diagonal matrix with positive entries,

A=(λ100λ2)withλ1,λ2>0,A = \begin{pmatrix} \lambda_1 & 0 \\ 0 & \lambda_2 \end{pmatrix} \quad \text{with} \quad \lambda_1, \lambda_2 > 0,

multiplies the first component by λ1\lambda_1 and the second by λ2\lambda_2; each axis direction is stretched (if λi>1\lambda_i > 1) or compressed (if λi<1\lambda_i < 1) independently. When λ1=λ2=λ\lambda_1 = \lambda_2 = \lambda the whole plane is scaled uniformly by λ\lambda (a dilation).

Example. Apply A=(20012)A = \begin{pmatrix} 2 & 0 \\ 0 & \frac{1}{2} \end{pmatrix} to the point (3,4)(3, 4).

A(34)=(2(3)+0(4)0(3)+12(4))=(62).\begin{align*} A\begin{pmatrix} 3 \\ 4 \end{pmatrix} &= \begin{pmatrix} 2(3) + 0(4) \\ 0(3) + \tfrac{1}{2}(4) \end{pmatrix} \\ &= \begin{pmatrix} 6 \\ 2 \end{pmatrix}. \end{align*}

Therefore the point is pushed out to twice the horizontal distance and squashed to half the vertical distance.

Reflections#

Example. Reflection in the x1x_1-axis sends x=(x1x2)\mathbf{x} = \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} to x′=(x1−x2)\mathbf{x}' = \begin{pmatrix} x_1 \\ -x_2 \end{pmatrix}, and is represented by

A=(100−1),A = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},

since Ax=(x1−x2)=x′A\mathbf{x} = \begin{pmatrix} x_1 \\ -x_2 \end{pmatrix} = \mathbf{x}'. Note that finding a matrix which performs the transformation is itself the proof that the transformation is linear. Similarly, reflection in the x2x_2-axis has matrix (−1001)\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}.

Example (matrix from a geometric description). Find the matrix of the reflection in the line x2=x1x_2 = x_1 in R2\mathbb{R}^2.

We only need the images of the standard basis vectors. Reflecting in the line x2=x1x_2 = x_1 swaps the two coordinate axes, so

T(e1)=(01),T(e2)=(10).\begin{align*} T(\mathbf{e}_1) &= \begin{pmatrix} 0 \\ 1 \end{pmatrix}, \\ T(\mathbf{e}_2) &= \begin{pmatrix} 1 \\ 0 \end{pmatrix}. \end{align*}

Therefore

A=(0110),A = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix},

and as a check, A(31)=(13)A\begin{pmatrix} 3 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 3 \end{pmatrix}, which is exactly the mirror image of (3,1)(3,1) in that line. This "track e1\mathbf{e}_1 and e2\mathbf{e}_2, then check on one extra point" routine handles basically every geometric matrix question.

Rotations#

Example. Let Rα:R2→R2R_\alpha: \mathbb{R}^2 \to \mathbb{R}^2 rotate every point anticlockwise about the origin by an angle α\alpha. Rotation is linear; rotating a+b\mathbf{a} + \mathbf{b} gives the same result as rotating a\mathbf{a} and b\mathbf{b} separately and then adding (the whole parallelogram rotates rigidly), and the same for scaling. To find the matrix, rotate the standard basis vectors: e1\mathbf{e}_1 sits at angle 00 on the unit circle and moves to angle α\alpha, while e2\mathbf{e}_2 sits at angle π2\frac{\pi}{2} and moves to angle π2+α\frac{\pi}{2} + \alpha, so

Rα(e1)=(cos⁡αsin⁡α)andRα(e2)=(−sin⁡αcos⁡α).R_\alpha(\mathbf{e}_1) = \begin{pmatrix} \cos\alpha \\ \sin\alpha \end{pmatrix} \quad \text{and} \quad R_\alpha(\mathbf{e}_2) = \begin{pmatrix} -\sin\alpha \\ \cos\alpha \end{pmatrix}.

Therefore the rotation matrix for angle α\alpha is

Aα=(cos⁡α−sin⁡αsin⁡αcos⁡α).\boxed{A_\alpha = \begin{pmatrix} \cos\alpha & -\sin\alpha \\ \sin\alpha & \cos\alpha \end{pmatrix}}.

Example. Find the matrix for rotation by π3\frac{\pi}{3} anticlockwise, and rotate the point (2,0)(2, 0).

Aπ/3=(cos⁡π3−sin⁡π3sin⁡π3cos⁡π3)=(12−323212).A_{\pi/3} = \begin{pmatrix} \cos\frac{\pi}{3} & -\sin\frac{\pi}{3} \\ \sin\frac{\pi}{3} & \cos\frac{\pi}{3} \end{pmatrix} = \begin{pmatrix} \frac{1}{2} & -\frac{\sqrt{3}}{2} \\ \frac{\sqrt{3}}{2} & \frac{1}{2} \end{pmatrix}.

Then

Aπ/3(20)=(12(2)−32(0)32(2)+12(0))=(13).\begin{align*} A_{\pi/3}\begin{pmatrix} 2 \\ 0 \end{pmatrix} &= \begin{pmatrix} \frac{1}{2}(2) - \frac{\sqrt{3}}{2}(0) \\ \frac{\sqrt{3}}{2}(2) + \frac{1}{2}(0) \end{pmatrix} \\ &= \begin{pmatrix} 1 \\ \sqrt{3} \end{pmatrix}. \end{align*}

Therefore (2,0)(2,0) rotates to (1,3)(1, \sqrt{3}), which still has length 22, as a rotation should preserve.

Projections and the dot product#

Example. Recall from 1131 that the projection of x∈Rn\mathbf{x} \in \mathbb{R}^n onto a fixed non-zero vector b∈Rn\mathbf{b} \in \mathbb{R}^n is

projb x=x⋅b∣b∣2 b.\text{proj}_{\mathbf{b}}\,\mathbf{x} = \frac{\mathbf{x} \cdot \mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b}.

Show that T(x)=projb xT(\mathbf{x}) = \text{proj}_{\mathbf{b}}\,\mathbf{x} is a linear map.

Rather than arguing geometrically, we use the algebraic properties of the dot product. For all x,x′∈Rn\mathbf{x}, \mathbf{x}' \in \mathbb{R}^n,

T(x+x′)=(x+x′)⋅b∣b∣2 b=x⋅b+x′⋅b∣b∣2 b=T(x)+T(x′),\begin{align*} T(\mathbf{x} + \mathbf{x}') &= \frac{(\mathbf{x} + \mathbf{x}') \cdot \mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b} \\ &= \frac{\mathbf{x} \cdot \mathbf{b} + \mathbf{x}' \cdot \mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b} \\ &= T(\mathbf{x}) + T(\mathbf{x}'), \end{align*}

and for all λ∈R\lambda \in \mathbb{R},

T(λx)=(λx)⋅b∣b∣2 b=λ(x⋅b∣b∣2 b)=λT(x).\begin{align*} T(\lambda\mathbf{x}) &= \frac{(\lambda\mathbf{x}) \cdot \mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b} \\ &= \lambda\left( \frac{\mathbf{x} \cdot \mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b} \right) \\ &= \lambda T(\mathbf{x}). \end{align*}

Therefore TT is a linear map.

Example. Find the matrix of the projection onto b=(12)\mathbf{b} = \begin{pmatrix} 1 \\ 2 \end{pmatrix} in R2\mathbb{R}^2.

Here ∣b∣2=12+22=5|\mathbf{b}|^2 = 1^2 + 2^2 = 5. The columns of the matrix are the projections of e1\mathbf{e}_1 and e2\mathbf{e}_2:

T(e1)=e1⋅b5 b=15(12),T(e2)=e2⋅b5 b=25(12).\begin{align*} T(\mathbf{e}_1) &= \frac{\mathbf{e}_1 \cdot \mathbf{b}}{5}\,\mathbf{b} = \frac{1}{5}\begin{pmatrix} 1 \\ 2 \end{pmatrix}, \\ T(\mathbf{e}_2) &= \frac{\mathbf{e}_2 \cdot \mathbf{b}}{5}\,\mathbf{b} = \frac{2}{5}\begin{pmatrix} 1 \\ 2 \end{pmatrix}. \end{align*}

Therefore

A=15(1224),A = \frac{1}{5}\begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix},

and as a check, for x=(31)\mathbf{x} = \begin{pmatrix} 3 \\ 1 \end{pmatrix} we have x⋅b=5\mathbf{x} \cdot \mathbf{b} = 5, so projb x=(12)\text{proj}_{\mathbf{b}}\,\mathbf{x} = \begin{pmatrix} 1 \\ 2 \end{pmatrix}, and indeed

A(31)=15(3+26+4)=(12).\begin{align*} A\begin{pmatrix} 3 \\ 1 \end{pmatrix} &= \frac{1}{5}\begin{pmatrix} 3 + 2 \\ 6 + 4 \end{pmatrix} \\ &= \begin{pmatrix} 1 \\ 2 \end{pmatrix}. \end{align*}

Therefore the matrix reproduces the projection formula exactly.

Example. For a fixed b∈Rn\mathbf{b} \in \mathbb{R}^n, the function T:Rn→RT: \mathbb{R}^n \to \mathbb{R} defined by T(x)=b⋅xT(\mathbf{x}) = \mathbf{b} \cdot \mathbf{x} is a linear map; the proof is the same dot-product algebra as for the projection. Taking b=ei\mathbf{b} = \mathbf{e}_i gives the map which picks out the iith component of x\mathbf{x}, so "read off a coordinate" is itself a linear map.

7.4 Subspaces associated with linear maps#

There are two important subspaces attached to every linear map: the kernel (the set of vectors squashed to zero, living in the domain) and the image (the set of all function values, living in the codomain). Informally, the kernel measures what the map destroys and the image measures what the map can actually reach.

7.4.1 The kernel of a map#

Note

Definition 1
Let T:V→WT: V \to W be a linear map. Then the kernel of TT (written ker⁡(T)\ker(T)) is the set of all zeroes of TT, that is, the subset of the domain VV defined by

ker⁡(T)={v∈V:T(v)=0}.\ker(T) = \{\mathbf{v} \in V : T(\mathbf{v}) = \mathbf{0}\}.

For matrix maps the definition specialises to something very familiar.

Note

Definition 2
For an m×nm \times n matrix AA, the kernel of AA is the subset of Rn\mathbb{R}^n defined by

ker⁡(A)={x∈Rn:Ax=0},\ker(A) = \{\mathbf{x} \in \mathbb{R}^n : A\mathbf{x} = \mathbf{0}\},

that is, the set of all solutions of the homogeneous equation Ax=0A\mathbf{x} = \mathbf{0}.

Basically, finding the kernel of a matrix is nothing new; it is just solving Ax=0A\mathbf{x} = \mathbf{0} by Gaussian elimination like in 1131. Showing a specific vector lies in the kernel is even easier: multiply and see if you get 0\mathbf{0}.

Example. Let A=(1236)A = \begin{pmatrix} 1 & 2 \\ 3 & 6 \end{pmatrix} and x=(2−1)\mathbf{x} = \begin{pmatrix} 2 \\ -1 \end{pmatrix}. Then

Ax=(1(2)+2(−1)3(2)+6(−1))=(00),\begin{align*} A\mathbf{x} &= \begin{pmatrix} 1(2) + 2(-1) \\ 3(2) + 6(-1) \end{pmatrix} \\ &= \begin{pmatrix} 0 \\ 0 \end{pmatrix}, \end{align*}

and hence x∈ker⁡(A)\mathbf{x} \in \ker(A). Also, 0∈ker⁡(T)\mathbf{0} \in \ker(T) for every linear map TT, since T(0)=0T(\mathbf{0}) = \mathbf{0}; the kernel is never empty.

Example. Find the kernel of

A=(1427360152−4−82).A = \begin{pmatrix} 1 & 4 & 2 & 7 \\ 3 & 6 & 0 & 15 \\ 2 & -4 & -8 & 2 \end{pmatrix}.

We solve Ax=0A\mathbf{x} = \mathbf{0}. Row reducing,

(1427360152−4−82)∼(14270−6−6−60−12−12−12)(R2→R2−3R1, R3→R3−2R1)∼(14270−6−6−60000)=U(R3→R3−2R2).\begin{align*} \begin{pmatrix} 1 & 4 & 2 & 7 \\ 3 & 6 & 0 & 15 \\ 2 & -4 & -8 & 2 \end{pmatrix} &\sim \begin{pmatrix} 1 & 4 & 2 & 7 \\ 0 & -6 & -6 & -6 \\ 0 & -12 & -12 & -12 \end{pmatrix} && (R_2 \to R_2 - 3R_1,\ R_3 \to R_3 - 2R_1) \\ &\sim \begin{pmatrix} 1 & 4 & 2 & 7 \\ 0 & -6 & -6 & -6 \\ 0 & 0 & 0 & 0 \end{pmatrix} = U && (R_3 \to R_3 - 2R_2). \end{align*}

Columns 33 and 44 are non-leading, so set x3=λ1x_3 = \lambda_1 and x4=λ2x_4 = \lambda_2. Back substitution into row 22 gives

−6x2−6λ1−6λ2=0x2=−λ1−λ2,\begin{align*} -6x_2 - 6\lambda_1 - 6\lambda_2 &= 0 \\ x_2 &= -\lambda_1 - \lambda_2, \end{align*}

and then row 11 gives

x1=−4x2−2x3−7x4=4λ1+4λ2−2λ1−7λ2=2λ1−3λ2.\begin{align*} x_1 &= -4x_2 - 2x_3 - 7x_4 \\ &= 4\lambda_1 + 4\lambda_2 - 2\lambda_1 - 7\lambda_2 \\ &= 2\lambda_1 - 3\lambda_2. \end{align*}

Hence

x=(2λ1−3λ2−λ1−λ2λ1λ2)=λ1(2−110)+λ2(−3−101),\begin{align*} \mathbf{x} &= \begin{pmatrix} 2\lambda_1 - 3\lambda_2 \\ -\lambda_1 - \lambda_2 \\ \lambda_1 \\ \lambda_2 \end{pmatrix} \\ &= \lambda_1 \begin{pmatrix} 2 \\ -1 \\ 1 \\ 0 \end{pmatrix} + \lambda_2 \begin{pmatrix} -3 \\ -1 \\ 0 \\ 1 \end{pmatrix}, \end{align*}

and therefore

ker⁡(A)={x∈R4:x=λ1(2−110)+λ2(−3−101) for λ1,λ2∈R}.\ker(A) = \left\{ \mathbf{x} \in \mathbb{R}^4 : \mathbf{x} = \lambda_1 \begin{pmatrix} 2 \\ -1 \\ 1 \\ 0 \end{pmatrix} + \lambda_2 \begin{pmatrix} -3 \\ -1 \\ 0 \\ 1 \end{pmatrix} \text{ for } \lambda_1, \lambda_2 \in \mathbb{R} \right\}.

Geometrically, the kernel is a plane through the origin in R4\mathbb{R}^4.

The word "subspace" in the section title is justified by the following theorem.

Note

Theorem 1
If T:V→WT: V \to W is a linear map, then ker⁡(T)\ker(T) is a subspace of the domain VV.

Proof. We use the Subspace Theorem. The kernel contains 0\mathbf{0}, since T(0)=0T(\mathbf{0}) = \mathbf{0}. Suppose v,v′∈ker⁡(T)\mathbf{v}, \mathbf{v}' \in \ker(T) and λ∈F\lambda \in \mathbb{F}. Then

T(v+v′)=T(v)+T(v′)=0+0=0,\begin{align*} T(\mathbf{v} + \mathbf{v}') &= T(\mathbf{v}) + T(\mathbf{v}') \\ &= \mathbf{0} + \mathbf{0} \\ &= \mathbf{0}, \end{align*}

and

T(λv)=λT(v)=λ0=0,\begin{align*} T(\lambda\mathbf{v}) &= \lambda T(\mathbf{v}) \\ &= \lambda\mathbf{0} \\ &= \mathbf{0}, \end{align*}

so ker⁡(T)\ker(T) is closed under addition and scalar multiplication, and is therefore a subspace of VV. ■\blacksquare

Since the kernel is a subspace, it has a dimension, and that dimension gets a special name.

Note

Definition 3
The nullity of a linear map TT is the dimension of ker⁡(T)\ker(T). The nullity of a matrix AA is the dimension of ker⁡(A)\ker(A).

For a matrix map TAT_A we have ker⁡(TA)=ker⁡(A)\ker(T_A) = \ker(A) (the conditions TA(x)=0T_A(\mathbf{x}) = \mathbf{0} and Ax=0A\mathbf{x} = \mathbf{0} are literally the same equation), and the nullity can be read off from the row-echelon form.

Note

Proposition 3
For a matrix AA,

nullity(A)=number of parameters in the solution of Ax=0=number of non-leading columns in a row-echelon form U of A.\text{nullity}(A) = \text{number of parameters in the solution of } A\mathbf{x} = \mathbf{0} = \text{number of non-leading columns in a row-echelon form } U \text{ of } A.

Example (continued). For the 3×43 \times 4 matrix AA above, the two vectors

{(2−110),(−3−101)}\left\{ \begin{pmatrix} 2 \\ -1 \\ 1 \\ 0 \end{pmatrix}, \begin{pmatrix} -3 \\ -1 \\ 0 \\ 1 \end{pmatrix} \right\}

span ker⁡(A)\ker(A), and they are linearly independent (look at the third and fourth entries; the only combination giving 0\mathbf{0} there is λ1=λ2=0\lambda_1 = \lambda_2 = 0). Therefore they form a basis for ker⁡(A)\ker(A), and nullity(A)=2\text{nullity}(A) = 2, matching the two non-leading columns of UU.

Note

Proposition 4
The columns of a matrix AA are linearly independent if and only if nullity(A)=0\text{nullity}(A) = 0.

This follows because the columns are independent exactly when Ax=0A\mathbf{x} = \mathbf{0} has only the zero solution, i.e. when ker⁡(A)={0}\ker(A) = \{\mathbf{0}\}.

7.4.2 Image#

Note

Definition 4
Let T:V→WT: V \to W be a linear map. Then the image of TT is the set of all function values of TT, that is, the subset of the codomain WW defined by

im(T)={w∈W:w=T(v) for some v∈V}.\text{im}(T) = \{\mathbf{w} \in W : \mathbf{w} = T(\mathbf{v}) \text{ for some } \mathbf{v} \in V\}.

Note

Definition 5
The image of an m×nm \times n matrix AA is the subset of Rm\mathbb{R}^m defined by

im(A)={b∈Rm:b=Ax for some x∈Rn}.\text{im}(A) = \{\mathbf{b} \in \mathbb{R}^m : \mathbf{b} = A\mathbf{x} \text{ for some } \mathbf{x} \in \mathbb{R}^n\}.

We have met this set several times before in disguise. Since AxA\mathbf{x} is a linear combination of the columns of AA, the image is exactly the span of the columns, and it is also the set of right-hand sides b\mathbf{b} for which Ax=bA\mathbf{x} = \mathbf{b} is solvable:

im(A)=col(A)=span(columns of A)={b∈Rm:Ax=b has a solution}.\boxed{\text{im}(A) = \text{col}(A) = \text{span}(\text{columns of } A) = \{\mathbf{b} \in \mathbb{R}^m : A\mathbf{x} = \mathbf{b} \text{ has a solution}\}}.

Basically, every question about the image of a matrix is secretly a linear equations question you already know how to solve.

Example (continued). Find conditions on b\mathbf{b} for b∈im(A)\mathbf{b} \in \text{im}(A), where AA is the same 3×43 \times 4 matrix as before.

We ask when Ax=bA\mathbf{x} = \mathbf{b} has a solution for b=(b1b2b3)\mathbf{b} = \begin{pmatrix} b_1 \\ b_2 \\ b_3 \end{pmatrix}. Reducing the augmented matrix with a general right-hand side,

(1427b136015b22−4−82b3)∼(1427b10−6−6−6b2−3b10−12−12−12b3−2b1)∼(1427b10−6−6−6b2−3b100004b1−2b2+b3).\begin{align*} \left(\begin{array}{cccc|c} 1 & 4 & 2 & 7 & b_1 \\ 3 & 6 & 0 & 15 & b_2 \\ 2 & -4 & -8 & 2 & b_3 \end{array}\right) &\sim \left(\begin{array}{cccc|c} 1 & 4 & 2 & 7 & b_1 \\ 0 & -6 & -6 & -6 & b_2 - 3b_1 \\ 0 & -12 & -12 & -12 & b_3 - 2b_1 \end{array}\right) \\ &\sim \left(\begin{array}{cccc|c} 1 & 4 & 2 & 7 & b_1 \\ 0 & -6 & -6 & -6 & b_2 - 3b_1 \\ 0 & 0 & 0 & 0 & 4b_1 - 2b_2 + b_3 \end{array}\right). \end{align*}

The system has a solution if and only if the last row is consistent, that is, if and only if

4b1−2b2+b3=0.4b_1 - 2b_2 + b_3 = 0.

Therefore im(A)\text{im}(A) is the plane through the origin in R3\mathbb{R}^3 with normal (4−21)\begin{pmatrix} 4 \\ -2 \\ 1 \end{pmatrix}; a two-dimensional subspace of R3\mathbb{R}^3.

Note

Theorem 5
Let T:V→WT: V \to W be a linear map. Then im(T)\text{im}(T) is a subspace of the codomain WW.

Proof. We have 0=T(0)∈im(T)\mathbf{0} = T(\mathbf{0}) \in \text{im}(T). If w=T(v)\mathbf{w} = T(\mathbf{v}) and w′=T(v′)\mathbf{w}' = T(\mathbf{v}') are in the image and λ∈F\lambda \in \mathbb{F}, then

w+w′=T(v)+T(v′)=T(v+v′),\begin{align*} \mathbf{w} + \mathbf{w}' &= T(\mathbf{v}) + T(\mathbf{v}') \\ &= T(\mathbf{v} + \mathbf{v}'), \end{align*}

which is a function value of the vector v+v′∈V\mathbf{v} + \mathbf{v}' \in V, and

λw=λT(v)=T(λv),\begin{align*} \lambda\mathbf{w} &= \lambda T(\mathbf{v}) \\ &= T(\lambda\mathbf{v}), \end{align*}

which is a function value of λv∈V\lambda\mathbf{v} \in V. Hence the image is closed under both operations, and by the Subspace Theorem it is a subspace of WW. ■\blacksquare

Note

Definition 6
The rank of a linear map TT is the dimension of im(T)\text{im}(T). The rank of a matrix AA is the dimension of im(A)\text{im}(A).

Note

Proposition 7
For a matrix AA,

rank(A)=maximal number of linearly independent columns of A=number of leading columns in a row-echelon form U of A.\text{rank}(A) = \text{maximal number of linearly independent columns of } A = \text{number of leading columns in a row-echelon form } U \text{ of } A.

Example (continued). Find rank(A)\text{rank}(A) and a basis for im(A)\text{im}(A).

The row-echelon form UU has leading entries in columns 11 and 22, so rank(A)=2\text{rank}(A) = 2, and a basis for im(A)\text{im}(A) is given by columns 11 and 22 of the original matrix AA:

{(132),(46−4)}.\left\{ \begin{pmatrix} 1 \\ 3 \\ 2 \end{pmatrix}, \begin{pmatrix} 4 \\ 6 \\ -4 \end{pmatrix} \right\}.

When writing down a basis for the image, you must take the leading columns of the original matrix AA, not the columns of the row-echelon form UU; row operations change the column space. As a sanity check, both basis vectors satisfy 4b1−2b2+b3=04b_1 - 2b_2 + b_3 = 0 from before.

7.4.3 Rank, nullity and solutions of Ax=bA\mathbf{x} = \mathbf{b}#

In the running example, rank(A)+nullity(A)=2+2=4\text{rank}(A) + \text{nullity}(A) = 2 + 2 = 4, the number of columns of AA. This is no coincidence; every column of a row-echelon form is either leading (counted by the rank) or non-leading (counted by the nullity).

Note

Rank-Nullity Theorem for Matrices
For any matrix AA,

rank(A)+nullity(A)=number of columns of A.\text{rank}(A) + \text{nullity}(A) = \text{number of columns of } A.

Note

Rank-Nullity Theorem
Suppose VV and WW are finite dimensional vector spaces and T:V→WT: V \to W is linear. Then

rank(T)+nullity(T)=dim⁡(V).\text{rank}(T) + \text{nullity}(T) = \dim(V).

A proof of the general version is given in Section 7.9 below. The rough idea: the domain has dim⁡(V)\dim(V) dimensions to spend; every dimension is either flattened to zero (nullity) or survives into the image (rank), and nothing is created or lost. This one line answers a surprising number of exam questions instantly, as we will see below.

Rank and nullity together classify the solutions of any linear system.

Note

Theorem 10
The equation Ax=bA\mathbf{x} = \mathbf{b} has:

  1. no solution if rank(A)≠rank([A∣b])\text{rank}(A) \neq \text{rank}([A|\mathbf{b}]), and
  2. at least one solution if rank(A)=rank([A∣b])\text{rank}(A) = \text{rank}([A|\mathbf{b}]). Further,
    i) if nullity(A)=0\text{nullity}(A) = 0 the solution is unique, whereas,
    ii) if nullity(A)=ν>0\text{nullity}(A) = \nu > 0, then the general solution is of the form

x=xp+λ1k1+⋯+λνkνforλ1,…,λν∈R,\mathbf{x} = \mathbf{x}_p + \lambda_1\mathbf{k}_1 + \cdots + \lambda_\nu \mathbf{k}_\nu \quad \text{for} \quad \lambda_1, \dots, \lambda_\nu \in \mathbb{R},

where xp\mathbf{x}_p is any particular solution of Ax=bA\mathbf{x} = \mathbf{b} and {k1,…,kν}\{\mathbf{k}_1, \dots, \mathbf{k}_\nu\} is a basis for ker⁡(A)\ker(A).

Basically, the full solution set is one particular solution plus the entire kernel; the same "particular solution plus homogeneous solution" structure you will meet again with linear ODEs in the calculus half, and for the same underlying reason (both problems are linear).

Example. Find the general solution of Ax=bA\mathbf{x} = \mathbf{b}, where

A=(121243),b=(13),A = \begin{pmatrix} 1 & 2 & 1 \\ 2 & 4 & 3 \end{pmatrix}, \quad \mathbf{b} = \begin{pmatrix} 1 \\ 3 \end{pmatrix},

and identify xp\mathbf{x}_p and the kernel part.

Row reducing the augmented matrix,

(12112433)∼(12110011)(R2→R2−2R1).\left(\begin{array}{ccc|c} 1 & 2 & 1 & 1 \\ 2 & 4 & 3 & 3 \end{array}\right) \sim \left(\begin{array}{ccc|c} 1 & 2 & 1 & 1 \\ 0 & 0 & 1 & 1 \end{array}\right) \quad (R_2 \to R_2 - 2R_1).

The right-hand column is non-leading, so a solution exists; rank(A)=rank([A∣b])=2\text{rank}(A) = \text{rank}([A|\mathbf{b}]) = 2 and nullity(A)=3−2=1\text{nullity}(A) = 3 - 2 = 1, so we expect one parameter. Setting x2=λx_2 = \lambda, back substitution gives

x3=1,x1=1−2λ−x3=−2λ.\begin{align*} x_3 &= 1, \\ x_1 &= 1 - 2\lambda - x_3 \\ &= -2\lambda. \end{align*}

Hence

x=(−2λλ1)=(001)+λ(−210).\begin{align*} \mathbf{x} &= \begin{pmatrix} -2\lambda \\ \lambda \\ 1 \end{pmatrix} \\ &= \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} + \lambda\begin{pmatrix} -2 \\ 1 \\ 0 \end{pmatrix}. \end{align*}

Therefore xp=(001)\mathbf{x}_p = \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} is a particular solution and {(−210)}\left\{\begin{pmatrix} -2 \\ 1 \\ 0 \end{pmatrix}\right\} is a basis for ker⁡(A)\ker(A), exactly matching Theorem 10 with ν=1\nu = 1.

Example. Show that Ax=bA\mathbf{x} = \mathbf{b} has no solution for A=(1224)A = \begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix} and b=(13)\mathbf{b} = \begin{pmatrix} 1 \\ 3 \end{pmatrix}.

(121243)∼(121001)(R2→R2−2R1).\left(\begin{array}{cc|c} 1 & 2 & 1 \\ 2 & 4 & 3 \end{array}\right) \sim \left(\begin{array}{cc|c} 1 & 2 & 1 \\ 0 & 0 & 1 \end{array}\right) \quad (R_2 \to R_2 - 2R_1).

Here rank(A)=1\text{rank}(A) = 1 but rank([A∣b])=2\text{rank}([A|\mathbf{b}]) = 2, so by Theorem 10 there is no solution; geometrically, b\mathbf{b} lies outside the line im(A)=span(12)\text{im}(A) = \text{span}\begin{pmatrix} 1 \\ 2 \end{pmatrix}.

Example (instant answers with rank-nullity). These come up constantly in exams and need almost no working.

a) Can a linear map T:R3→R4T: \mathbb{R}^3 \to \mathbb{R}^4 be onto (i.e. have im(T)=R4\text{im}(T) = \mathbb{R}^4)?

rank(T)=dim⁡(R3)−nullity(T)≤3<4=dim⁡(R4).\begin{align*} \text{rank}(T) &= \dim(\mathbb{R}^3) - \text{nullity}(T) \\ &\leq 3 \\ &< 4 = \dim(\mathbb{R}^4). \end{align*}

Therefore no; the image is at most 33-dimensional and can never fill R4\mathbb{R}^4, no matter how the map is defined.

b) AA is a 3×53 \times 5 matrix. Can the columns of AA be linearly independent?

nullity(A)=5−rank(A)≥5−3=2>0.\begin{align*} \text{nullity}(A) &= 5 - \text{rank}(A) \\ &\geq 5 - 3 \\ &= 2 > 0. \end{align*}

Therefore no; by Proposition 4 the columns are dependent, since the nullity cannot be zero.

c) A linear map T:R5→R3T: \mathbb{R}^5 \to \mathbb{R}^3 is known to be onto. Find nullity(T)\text{nullity}(T).

nullity(T)=dim⁡(R5)−rank(T)=5−3=2.\begin{align*} \text{nullity}(T) &= \dim(\mathbb{R}^5) - \text{rank}(T) \\ &= 5 - 3 \\ &= 2. \end{align*}

Therefore the nullity is exactly 22; onto forces rank(T)=3\text{rank}(T) = 3, and rank-nullity does the rest.

7.5 Further applications and examples of linear maps#

So far most of our examples have had domain Rn\mathbb{R}^n and codomain Rm\mathbb{R}^m, but the theory applies to any vector spaces; polynomials, matrices and functions included.

Example. The identity map idV:V→V\text{id}_V : V \to V, defined by idV(v)=v\text{id}_V(\mathbf{v}) = \mathbf{v} for all v∈V\mathbf{v} \in V, is linear. This one is self explanatory so I'm not gonna write much; idV(v+v′)=v+v′\text{id}_V(\mathbf{v} + \mathbf{v}') = \mathbf{v} + \mathbf{v}' and idV(λv)=λv\text{id}_V(\lambda\mathbf{v}) = \lambda\mathbf{v} by definition.

Example. Let B={v1,…,vn}B = \{\mathbf{v}_1, \dots, \mathbf{v}_n\} be an ordered basis of a real vector space VV. The map T:V→RnT: V \to \mathbb{R}^n which sends each v=x1v1+⋯+xnvn\mathbf{v} = x_1\mathbf{v}_1 + \cdots + x_n\mathbf{v}_n to its coordinate vector (x1⋮xn)\begin{pmatrix} x_1 \\ \vdots \\ x_n \end{pmatrix} is a linear map, because adding vectors adds their (unique) coordinates and scaling a vector scales its coordinates. This innocent-looking fact is what makes Section 7.6 below work: it lets us translate any finite-dimensional problem into a column-vector problem.

Example. Show that the function T:R3→P2(R)T: \mathbb{R}^3 \to \mathbb{P}_2(\mathbb{R}) defined by T(a)=pT(\mathbf{a}) = p, where

p(x)=(a1+a2)+(a3+3a1)x+a2x2fora=(a1a2a3)∈R3,p(x) = (a_1 + a_2) + (a_3 + 3a_1)x + a_2x^2 \quad \text{for} \quad \mathbf{a} = \begin{pmatrix} a_1 \\ a_2 \\ a_3 \end{pmatrix} \in \mathbb{R}^3,

is a linear map.

First, to get a feel for the map: T(123)T\begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} is the polynomial p(x)=3+6x+2x2p(x) = 3 + 6x + 2x^2, and T(0)T(\mathbf{0}) is the zero polynomial, as required. Now let λ,μ∈R\lambda, \mu \in \mathbb{R} and a,a′∈R3\mathbf{a}, \mathbf{a}' \in \mathbb{R}^3, and let s=T(λa+μa′)s = T(\lambda\mathbf{a} + \mu\mathbf{a}'), p=T(a)p = T(\mathbf{a}), q=T(a′)q = T(\mathbf{a}'). Then

s(x)=(λa1+μa1′+λa2+μa2′)+(λa3+μa3′+3(λa1+μa1′))x+(λa2+μa2′)x2=λ[(a1+a2)+(a3+3a1)x+a2x2]+μ[(a1′+a2′)+(a3′+3a1′)x+a2′x2]=λp(x)+μq(x).\begin{align*} s(x) &= \big(\lambda a_1 + \mu a_1' + \lambda a_2 + \mu a_2'\big) + \big(\lambda a_3 + \mu a_3' + 3(\lambda a_1 + \mu a_1')\big)x + (\lambda a_2 + \mu a_2')x^2 \\ &= \lambda\big[(a_1 + a_2) + (a_3 + 3a_1)x + a_2x^2\big] + \mu\big[(a_1' + a_2') + (a_3' + 3a_1')x + a_2'x^2\big] \\ &= \lambda p(x) + \mu q(x). \end{align*}

Thus T(λa+μa′)=λT(a)+μT(a′)T(\lambda\mathbf{a} + \mu\mathbf{a}') = \lambda T(\mathbf{a}) + \mu T(\mathbf{a}'), and by Theorem 2 of Section 7.1, TT is a linear map.

Differentiation and integration as linear maps#

Calculus supplies the most important non-Rn\mathbb{R}^n examples: both differentiation and integration preserve sums and scalar multiples.

Example (differentiation). Show that the function D:Pn(R)→Pn−1(R)D: \mathbb{P}_n(\mathbb{R}) \to \mathbb{P}_{n-1}(\mathbb{R}), defined by D(p)=p′D(p) = p', is a linear map.

First, DD really is a function into Pn−1(R)\mathbb{P}_{n-1}(\mathbb{R}); differentiating a polynomial of degree at most nn gives a polynomial of degree at most n−1n - 1. From the properties of derivatives, for all p,q∈Pn(R)p, q \in \mathbb{P}_n(\mathbb{R}) and λ∈R\lambda \in \mathbb{R},

(p+q)′(x)=p′(x)+q′(x),(λp)′(x)=λ p′(x),\begin{align*} (p + q)'(x) &= p'(x) + q'(x), \\ (\lambda p)'(x) &= \lambda\,p'(x), \end{align*}

so D(p+q)=D(p)+D(q)D(p + q) = D(p) + D(q) and D(λp)=λD(p)D(\lambda p) = \lambda D(p). Therefore DD is a linear map. All the standard derivative rules you memorised for 1131 ("derivative of a sum is the sum of the derivatives") were secretly the statement that DD is linear.

Example (integration). Show that the function I:Pn(R)→Pn+1(R)I: \mathbb{P}_n(\mathbb{R}) \to \mathbb{P}_{n+1}(\mathbb{R}) defined by I(p)=qI(p) = q, where

q(x)=∫0xp(t) dt,q(x) = \int_0^x p(t)\,dt,

is a linear map.

For a concrete function value first: if p(x)=1−3x+4x2p(x) = 1 - 3x + 4x^2, then

I(p)(x)=∫0x(1−3t+4t2) dt=x−32x2+43x3,\begin{align*} I(p)(x) &= \int_0^x (1 - 3t + 4t^2)\,dt \\ &= x - \frac{3}{2}x^2 + \frac{4}{3}x^3, \end{align*}

a polynomial of degree 33, as expected. For linearity, let p1,p2∈Pn(R)p_1, p_2 \in \mathbb{P}_n(\mathbb{R}) and λ1,λ2∈R\lambda_1, \lambda_2 \in \mathbb{R}, and let q=I(λ1p1+λ2p2)q = I(\lambda_1p_1 + \lambda_2p_2). From the properties of integration,

q(x)=∫0x(λ1p1(t)+λ2p2(t)) dt=λ1∫0xp1(t) dt+λ2∫0xp2(t) dt=λ1I(p1)(x)+λ2I(p2)(x).\begin{align*} q(x) &= \int_0^x \big(\lambda_1p_1(t) + \lambda_2p_2(t)\big)\,dt \\ &= \lambda_1\int_0^x p_1(t)\,dt + \lambda_2\int_0^x p_2(t)\,dt \\ &= \lambda_1 I(p_1)(x) + \lambda_2 I(p_2)(x). \end{align*}

Hence I(λ1p1+λ2p2)=λ1I(p1)+λ2I(p2)I(\lambda_1p_1 + \lambda_2p_2) = \lambda_1 I(p_1) + \lambda_2 I(p_2), and II is a linear map.

Example (kernel and image of the derivative on P3\mathbb{P}_3). Find ker⁡(D)\ker(D), nullity(D)\text{nullity}(D), im(D)\text{im}(D) and rank(D)\text{rank}(D) for D:P3(R)→P2(R)D: \mathbb{P}_3(\mathbb{R}) \to \mathbb{P}_2(\mathbb{R}), and verify the Rank-Nullity Theorem.

Write p(x)=a0+a1x+a2x2+a3x3p(x) = a_0 + a_1x + a_2x^2 + a_3x^3, so that

D(p)(x)=a1+2a2x+3a3x2.D(p)(x) = a_1 + 2a_2x + 3a_3x^2.

Kernel. D(p)=0D(p) = 0 requires

a1=0,2a2=0,3a3=0,\begin{align*} a_1 &= 0, \\ 2a_2 &= 0, \\ 3a_3 &= 0, \end{align*}

with a0a_0 free. Hence ker⁡(D)={constant polynomials}=span(1)\ker(D) = \{\text{constant polynomials}\} = \text{span}(1), and nullity(D)=1\text{nullity}(D) = 1; the derivative destroys exactly the constant information.

Image. Given any target q(x)=b0+b1x+b2x2∈P2(R)q(x) = b_0 + b_1x + b_2x^2 \in \mathbb{P}_2(\mathbb{R}), choose

a1=b0,a2=b12,a3=b23,a_1 = b_0, \quad a_2 = \frac{b_1}{2}, \quad a_3 = \frac{b_2}{3},

(and a0a_0 anything); then D(p)=qD(p) = q. Hence im(D)=P2(R)\text{im}(D) = \mathbb{P}_2(\mathbb{R}), so DD is onto and rank(D)=dim⁡(P2(R))=3\text{rank}(D) = \dim(\mathbb{P}_2(\mathbb{R})) = 3.

Check. rank(D)+nullity(D)=3+1=4=dim⁡(P3(R))\text{rank}(D) + \text{nullity}(D) = 3 + 1 = 4 = \dim(\mathbb{P}_3(\mathbb{R})), exactly as the Rank-Nullity Theorem demands. Therefore antidifferentiation being "unique up to +C+C" is precisely the statement nullity(D)=1\text{nullity}(D) = 1.

Example (evaluation map). Let E:P2(R)→RE: \mathbb{P}_2(\mathbb{R}) \to \mathbb{R} be defined by E(p)=p(2)E(p) = p(2). Show that EE is linear, and find its rank and a basis for its kernel.

Linearity. For p,q∈P2(R)p, q \in \mathbb{P}_2(\mathbb{R}) and λ,μ∈R\lambda, \mu \in \mathbb{R},

E(λp+μq)=(λp+μq)(2)=λp(2)+μq(2)=λE(p)+μE(q),\begin{align*} E(\lambda p + \mu q) &= (\lambda p + \mu q)(2) \\ &= \lambda p(2) + \mu q(2) \\ &= \lambda E(p) + \mu E(q), \end{align*}

so EE is linear by Theorem 2 of Section 7.1.

Rank. E(1)=1≠0E(1) = 1 \neq 0, so the image contains a non-zero number, and since im(E)\text{im}(E) is a subspace of the one-dimensional space R\mathbb{R}, we must have im(E)=R\text{im}(E) = \mathbb{R} and rank(E)=1\text{rank}(E) = 1; EE is onto.

Kernel. By rank-nullity,

nullity(E)=dim⁡(P2(R))−rank(E)=3−1=2,\begin{align*} \text{nullity}(E) &= \dim(\mathbb{P}_2(\mathbb{R})) - \text{rank}(E) \\ &= 3 - 1 \\ &= 2, \end{align*}

so we need two linearly independent polynomials vanishing at x=2x = 2. Both x−2x - 2 and x2−2x=x(x−2)x^2 - 2x = x(x-2) evaluate to 00 at x=2x = 2, and they are independent (different degrees). Therefore {x−2, x2−2x}\{x - 2,\ x^2 - 2x\} is a basis for ker⁡(E)\ker(E). Notice how rank-nullity told us in advance exactly how many kernel vectors to hunt for; that is the standard trick for kernel questions on polynomial spaces.

[X] For interest: the Laplace transform L(f)=fLL(f) = f_L, where fL(s)=∫0∞e−stf(t) dtf_L(s) = \int_0^\infty e^{-st}f(t)\,dt, is a linear map on a suitable space of functions, by the same integration argument as above; its linearity is the whole reason it is useful for solving linear ODEs (transform each term separately, solve algebraically, transform back).

7.6 [X] Representation of linear maps by matrices#

This section is 1241/extension content.

Section 7.2 showed that linear maps Rn→Rm\mathbb{R}^n \to \mathbb{R}^m are matrix maps. The generalisation: every linear map between finite-dimensional vector spaces can be represented by a matrix, once you fix a basis at each end and work with coordinate vectors.

Note

General Matrix Representation Theorem
Let T:V→WT: V \to W be a linear map from an nn-dimensional vector space VV to an mm-dimensional vector space WW, and let BV={v1,…,vn}B_V = \{\mathbf{v}_1, \dots, \mathbf{v}_n\} and BW={w1,…,wm}B_W = \{\mathbf{w}_1, \dots, \mathbf{w}_m\} be ordered bases for VV and WW. Then there is a unique m×nm \times n matrix AA such that

[T(v)]BW=A[v]BV,[T(\mathbf{v})]_{B_W} = A[\mathbf{v}]_{B_V},

where AA is the matrix whose columns are aj=[T(vj)]BW\mathbf{a}_j = [T(\mathbf{v}_j)]_{B_W} for 1⩽j⩽n1 \leqslant j \leqslant n.

The matrix depends on TT and the two chosen bases, but not on the particular vector being mapped. The recipe:

  1. Choose a basis BVB_V for the domain and BWB_W for the codomain.
  2. Compute the function values T(vj)T(\mathbf{v}_j) of the domain basis vectors.
  3. Write each T(vj)T(\mathbf{v}_j) as a coordinate vector with respect to BWB_W.
  4. Assemble those coordinate vectors as the columns of AA.

Example. Construct the matrix of the derivative map D:P3(R)→P2(R)D: \mathbb{P}_3(\mathbb{R}) \to \mathbb{P}_2(\mathbb{R}) with respect to the standard bases {1,x,x2,x3}\{1, x, x^2, x^3\} and {1,x,x2}\{1, x, x^2\}, and use it to differentiate p(x)=1−3x+4x2+7x3p(x) = 1 - 3x + 4x^2 + 7x^3.

The images of the domain basis vectors are

D(1)=0,D(x)=1,D(x2)=2x,D(x3)=3x2,D(1) = 0, \quad D(x) = 1, \quad D(x^2) = 2x, \quad D(x^3) = 3x^2,

whose coordinate vectors with respect to {1,x,x2}\{1, x, x^2\} are

(000),(100),(020),(003),\begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}, \quad \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}, \quad \begin{pmatrix} 0 \\ 2 \\ 0 \end{pmatrix}, \quad \begin{pmatrix} 0 \\ 0 \\ 3 \end{pmatrix},

respectively. Hence

A=(010000200003).A = \begin{pmatrix} 0 & 1 & 0 & 0 \\ 0 & 0 & 2 & 0 \\ 0 & 0 & 0 & 3 \end{pmatrix}.

The coordinate vector of pp is (1−347)\begin{pmatrix} 1 \\ -3 \\ 4 \\ 7 \end{pmatrix}, and

A(1−347)=(−3821),\begin{align*} A\begin{pmatrix} 1 \\ -3 \\ 4 \\ 7 \end{pmatrix} &= \begin{pmatrix} -3 \\ 8 \\ 21 \end{pmatrix}, \end{align*}

so D(p)(x)=−3+8x+21x2D(p)(x) = -3 + 8x + 21x^2, which is indeed the derivative of pp. Therefore differentiating polynomials is literally a matrix multiplication once you pass to coordinates.

It is often possible to simplify a problem enormously by choosing non-standard bases; with the right basis in domain and codomain, the representing matrix can come out diagonal or triangular, from which the behaviour of the map can be read off instantly. This idea is developed properly in Chapter 8.

7.7 [X] Matrix arithmetic and linear maps#

This section is 1241/extension content.

Since matrices and linear maps are two views of the same objects, matrix arithmetic must correspond to operations on maps. Indeed, for matrices AA (m×nm \times n) and BB of matching sizes:

  • Addition. TA+TB=TA+BT_A + T_B = T_{A+B}; adding maps adds their matrices.
  • Scalar multiplication. λTA=TλA\lambda T_A = T_{\lambda A}.
  • Composition. The interesting one:

Note

Proposition 3 (Multiplication and Composition)
Let AA be a real m×nm \times n matrix and BB be a real n×pn \times p matrix. Then the composite TA∘TBT_A \circ T_B is the linear map T:Rp→RmT: \mathbb{R}^p \to \mathbb{R}^m defined by

T(x)=(TA∘TB)(x)=A(Bx)=(AB)xfor allx∈Rp.T(\mathbf{x}) = (T_A \circ T_B)(\mathbf{x}) = A(B\mathbf{x}) = (AB)\mathbf{x} \quad \text{for all} \quad \mathbf{x} \in \mathbb{R}^p.

So composition of linear maps is matrix multiplication; this is arguably the real reason matrix multiplication is defined the weird way it is. Note the order carefully: in TA∘TB=TABT_A \circ T_B = T_{AB}, the map TBT_B acts first, i.e. the matrix nearest the vector acts first.

Example. Show that rotating the plane by φ\varphi and then by θ\theta is the same as rotating by θ+φ\theta + \varphi, i.e. AθAφ=Aθ+φA_\theta A_\varphi = A_{\theta + \varphi}.

AθAφ=(cos⁡θ−sin⁡θsin⁡θcos⁡θ)(cos⁡φ−sin⁡φsin⁡φcos⁡φ)=(cos⁡θcos⁡φ−sin⁡θsin⁡φ−cos⁡θsin⁡φ−sin⁡θcos⁡φsin⁡θcos⁡φ+cos⁡θsin⁡φcos⁡θcos⁡φ−sin⁡θsin⁡φ)=(cos⁡(θ+φ)−sin⁡(θ+φ)sin⁡(θ+φ)cos⁡(θ+φ))=Aθ+φ,\begin{align*} A_\theta A_\varphi &= \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix} \begin{pmatrix} \cos\varphi & -\sin\varphi \\ \sin\varphi & \cos\varphi \end{pmatrix} \\ &= \begin{pmatrix} \cos\theta\cos\varphi - \sin\theta\sin\varphi & -\cos\theta\sin\varphi - \sin\theta\cos\varphi \\ \sin\theta\cos\varphi + \cos\theta\sin\varphi & \cos\theta\cos\varphi - \sin\theta\sin\varphi \end{pmatrix} \\ &= \begin{pmatrix} \cos(\theta + \varphi) & -\sin(\theta + \varphi) \\ \sin(\theta + \varphi) & \cos(\theta + \varphi) \end{pmatrix} \\ &= A_{\theta + \varphi}, \end{align*}

using the trig addition formulas. Therefore the matrix identity is just the geometric fact that consecutive rotations add their angles; as a bonus, the trig addition formulas fall out of matrix multiplication for free.

Example (order matters). Let R=(0−110)R = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} (rotation by π2\frac{\pi}{2}) and M=(100−1)M = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} (reflection in the x1x_1-axis). Compare "rotate then reflect" with "reflect then rotate".

Rotate first, then reflect (rotation acts first, so it sits on the right):

MR=(100−1)(0−110)=(0−1−10).\begin{align*} MR &= \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \\ &= \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}. \end{align*}

Reflect first, then rotate:

RM=(0−110)(100−1)=(0110).\begin{align*} RM &= \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \\ &= \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}. \end{align*}

The results differ; testing on e1\mathbf{e}_1, the first sends (1,0)↦(0,−1)(1,0) \mapsto (0,-1) while the second sends (1,0)↦(0,1)(1,0) \mapsto (0,1). Therefore composition of linear maps (like matrix multiplication) is not commutative, and when you translate a worded geometric sequence into matrices you must write the transformations from right to left.

7.8 [X] One-to-one, onto and invertible linear maps and matrices#

This section is 1241/extension content; the general function versions of these definitions are in Section 7.10.

Note

Definition 1
A linear map T:V→WT: V \to W is said to be:
a) one-to-one if for all v1,v2∈V\mathbf{v}_1, \mathbf{v}_2 \in V, T(v1)=T(v2)T(\mathbf{v}_1) = T(\mathbf{v}_2) only if v1=v2\mathbf{v}_1 = \mathbf{v}_2;
b) onto if for all w∈W\mathbf{w} \in W there exists v∈V\mathbf{v} \in V such that w=T(v)\mathbf{w} = T(\mathbf{v}), that is, if im(T)=W\text{im}(T) = W.

For linear maps (and only for linear maps) being one-to-one collapses to a single check at zero.

Note

Proposition 1
A linear map T:V→WT: V \to W is one-to-one if and only if ker⁡(T)={0}\ker(T) = \{\mathbf{0}\}, that is, if and only if nullity(T)=0.\text{nullity}(T) = 0.

Proof. If TT is one-to-one, then since T(0)=0T(\mathbf{0}) = \mathbf{0}, no other vector can also map to 0\mathbf{0}, so ker⁡(T)={0}\ker(T) = \{\mathbf{0}\}. Conversely, if ker⁡(T)={0}\ker(T) = \{\mathbf{0}\} and T(v1)=T(v2)T(\mathbf{v}_1) = T(\mathbf{v}_2), then by linearity

T(v1−v2)=T(v1)−T(v2)=0,\begin{align*} T(\mathbf{v}_1 - \mathbf{v}_2) &= T(\mathbf{v}_1) - T(\mathbf{v}_2) \\ &= \mathbf{0}, \end{align*}

so v1−v2∈ker⁡(T)={0}\mathbf{v}_1 - \mathbf{v}_2 \in \ker(T) = \{\mathbf{0}\}, forcing v1=v2\mathbf{v}_1 = \mathbf{v}_2. ■\blacksquare

This shortcut is only valid for linear maps; f(x)=x2f(x) = x^2 has f(x)=0f(x) = 0 only at x=0x = 0, yet it is not one-to-one.

Note

Proposition 2
If the codomain WW of a linear map T:V→WT: V \to W is finite dimensional, then TT is onto if and only if rank(T)=dim⁡(W)\text{rank}(T) = \dim(W).

Combining these with rank-nullity gives the dimension facts you can quote instantly:

  • If TT is one-to-one and onto, then dim⁡(V)=dim⁡(W)\dim(V) = \dim(W).
  • If dim⁡(V)=dim⁡(W)\dim(V) = \dim(W), then TT is one-to-one   ⟺  \iff TT is onto (each forces the other).
  • If dim⁡(V)>dim⁡(W)\dim(V) > \dim(W) (e.g. R3→R2\mathbb{R}^3 \to \mathbb{R}^2), TT can never be one-to-one; if dim⁡(V)<dim⁡(W)\dim(V) < \dim(W) (e.g. R2→R3\mathbb{R}^2 \to \mathbb{R}^3), TT can never be onto.

Note

Theorem 5
If VV and WW are finite-dimensional vector spaces and T:V→WT: V \to W is a linear map, then the following statements are equivalent:

  1. TT is invertible, i.e. there exists a linear map S:W→VS: W \to V with S∘T=idVS \circ T = \text{id}_V and T∘S=idWT \circ S = \text{id}_W;
  2. TT is one-to-one and onto;
  3. dim⁡(V)=dim⁡(W)\dim(V) = \dim(W) and there exists S:W→VS: W \to V with T∘S=idWT \circ S = \text{id}_W;
  4. dim⁡(V)=dim⁡(W)\dim(V) = \dim(W) and there exists S:W→VS: W \to V with S∘T=idVS \circ T = \text{id}_V.

Further, if a linear map has an inverse, the inverse is unique and is itself a linear map.

Example. Determine whether the maps TAT_A and TBT_B are one-to-one, onto and invertible, where

A=(1224),B=(1234).A = \begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}.

For AA: row reducing,

(1224)∼(1200)(R2→R2−2R1),\begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix} \sim \begin{pmatrix} 1 & 2 \\ 0 & 0 \end{pmatrix} \quad (R_2 \to R_2 - 2R_1),

so rank(A)=1\text{rank}(A) = 1 and nullity(A)=2−1=1\text{nullity}(A) = 2 - 1 = 1. Since nullity(A)≠0\text{nullity}(A) \neq 0, TAT_A is not one-to-one (indeed ker⁡(A)=span(−21)\ker(A) = \text{span}\begin{pmatrix} -2 \\ 1 \end{pmatrix}, so the whole line gets crushed to 0\mathbf{0}), and since rank(A)=1<2\text{rank}(A) = 1 < 2, TAT_A is not onto. Hence TAT_A is not invertible.

For BB: row reducing,

(1234)∼(120−2)(R2→R2−3R1),\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \sim \begin{pmatrix} 1 & 2 \\ 0 & -2 \end{pmatrix} \quad (R_2 \to R_2 - 3R_1),

so rank(B)=2\text{rank}(B) = 2 and nullity(B)=0\text{nullity}(B) = 0. Hence TBT_B is one-to-one and onto, and therefore invertible; its inverse is the matrix map given by the usual 2×22 \times 2 inverse formula from 1131,

B−1=1det⁡(B)(4−2−31)=−12(4−2−31)=(−2132−12),B^{-1} = \frac{1}{\det(B)}\begin{pmatrix} 4 & -2 \\ -3 & 1 \end{pmatrix} = -\frac{1}{2}\begin{pmatrix} 4 & -2 \\ -3 & 1 \end{pmatrix} = \begin{pmatrix} -2 & 1 \\ \frac{3}{2} & -\frac{1}{2} \end{pmatrix},

and a quick check gives BB−1=IBB^{-1} = I. Therefore invertibility of the map and invertibility of the matrix are the same thing.

7.9 [X] Proof of the Rank-Nullity Theorem#

This section is 1241/extension content; a sketch of the proof is enough here.

We want to show that if VV is finite dimensional and T:V→WT: V \to W is linear, then rank(T)+nullity(T)=dim⁡(V)\text{rank}(T) + \text{nullity}(T) = \dim(V). The idea is to build one basis of VV out of a kernel part and an image part, and count.

Proof (sketch). Let {w1,…,wr}\{\mathbf{w}_1, \dots, \mathbf{w}_r\} be a basis for im(T)\text{im}(T), where r=rank(T)r = \text{rank}(T), and pick preimages v1,…,vr∈V\mathbf{v}_1, \dots, \mathbf{v}_r \in V with T(vj)=wjT(\mathbf{v}_j) = \mathbf{w}_j. Let {vr+1,…,vr+ν}\{\mathbf{v}_{r+1}, \dots, \mathbf{v}_{r+\nu}\} be a basis for ker⁡(T)\ker(T), where ν=nullity(T)\nu = \text{nullity}(T). We claim S={v1,…,vr+ν}S = \{\mathbf{v}_1, \dots, \mathbf{v}_{r+\nu}\} is a basis for VV; then dim⁡(V)=r+ν\dim(V) = r + \nu and we are done.

Linear independence. Suppose λ1v1+⋯+λr+νvr+ν=0\lambda_1\mathbf{v}_1 + \cdots + \lambda_{r+\nu}\mathbf{v}_{r+\nu} = \mathbf{0}. Applying TT kills the kernel vectors and turns the rest into the wj\mathbf{w}_j, leaving

λ1w1+⋯+λrwr=0,\lambda_1\mathbf{w}_1 + \cdots + \lambda_r\mathbf{w}_r = \mathbf{0},

so λ1=⋯=λr=0\lambda_1 = \cdots = \lambda_r = 0 by independence of the wj\mathbf{w}_j. The original relation then collapses to a combination of the kernel basis alone, forcing the remaining λj=0\lambda_j = 0 too.

Spanning. Take any v∈V\mathbf{v} \in V. Then T(v)∈im(T)T(\mathbf{v}) \in \text{im}(T), so T(v)=λ1w1+⋯+λrwrT(\mathbf{v}) = \lambda_1\mathbf{w}_1 + \cdots + \lambda_r\mathbf{w}_r for some scalars. Set vI=λ1v1+⋯+λrvr\mathbf{v}_I = \lambda_1\mathbf{v}_1 + \cdots + \lambda_r\mathbf{v}_r; by construction T(vI)=T(v)T(\mathbf{v}_I) = T(\mathbf{v}), and hence

T(v−vI)=T(v)−T(vI)=0,\begin{align*} T(\mathbf{v} - \mathbf{v}_I) &= T(\mathbf{v}) - T(\mathbf{v}_I) \\ &= \mathbf{0}, \end{align*}

so the "remainder" v−vI\mathbf{v} - \mathbf{v}_I lies in ker⁡(T)\ker(T) and is a combination of the kernel basis vectors. Adding the two pieces back together expresses v\mathbf{v} as a linear combination of SS.

Therefore SS is a linearly independent spanning set for VV, and dim⁡(V)=r+ν=rank(T)+nullity(T)\dim(V) = r + \nu = \text{rank}(T) + \text{nullity}(T). ■\blacksquare

Basically, every vector in the domain splits into a part the map remembers (spanned by the rr preimage vectors) and a part the map forgets (the kernel), and the two parts share no overlap.

7.10 One-to-one, onto and inverses for functions#

This appendix collects the general function definitions used in Section 7.8; they apply to all functions, not just linear maps. For a point in the codomain of a function there are three possibilities: it is hit by no point of the domain, by exactly one, or by more than one.

Note

Definition 1
The range or image of a function f:X→Yf: X \to Y is the set of all function values,

im(f)={y∈Y:y=f(x) for some x∈X}.\text{im}(f) = \{y \in Y : y = f(x) \text{ for some } x \in X\}.

Note

Definition 2
A function f:X→Yf: X \to Y is said to be onto (or surjective) if the codomain is equal to the image, that is, if for all y∈Yy \in Y there exists an x∈Xx \in X such that y=f(x)y = f(x).

Note

Definition 3
A function f:X→Yf: X \to Y is said to be one-to-one (or injective) if no point of the codomain is the value of more than one point of the domain, that is, if f(x1)=f(x2)f(x_1) = f(x_2) implies x1=x2x_1 = x_2.

Basically, onto means "everything in the codomain gets hit" and one-to-one means "nothing gets hit twice". A function which is both hits everything exactly once. Notice how the same formula can be both, either or neither depending on the choice of domain and codomain, as the next three examples show.

Example. The function f:R→Rf: \mathbb{R} \to \mathbb{R}, f(x)=x2f(x) = x^2, is neither one-to-one nor onto. It is not one-to-one since f(3)=f(−3)=9f(3) = f(-3) = 9 with 3≠−33 \neq -3, and it is not onto since no x∈Rx \in \mathbb{R} satisfies x2=−1x^2 = -1.

Example. The function f:[0,∞)→Rf: [0, \infty) \to \mathbb{R}, f(x)=x2f(x) = x^2, is one-to-one but not onto. Restricting the domain removed the negative twin of each square root, but the negative half of the codomain is still never reached.

Example. The function f:[0,∞)→[0,∞)f: [0, \infty) \to [0, \infty), f(x)=x2f(x) = x^2, is both one-to-one and onto; every y≥0y \geq 0 is f(y)f(\sqrt{y}) and of nothing else in the domain. Therefore "is ff one-to-one/onto?" is a question about the whole package (f,X,Y)(f, X, Y), not just the formula.

Note

Definition 4
Let f:X→Yf: X \to Y be a function. Then a function g:Y→Xg: Y \to X is called an inverse of ff if it satisfies the two conditions:
a) g∘f=idXg \circ f = \text{id}_X, i.e. g(f(x))=xg(f(x)) = x for all x∈Xx \in X, and
b) f∘g=idYf \circ g = \text{id}_Y, i.e. f(g(y))=yf(g(y)) = y for all y∈Yy \in Y.

Note

Theorem 1
A function has an inverse if and only if the function is both one-to-one and onto.

The idea of the proof: if ff is one-to-one and onto, then every y∈Yy \in Y is hit by exactly one x∈Xx \in X, so "send yy back to that unique xx" is a well-defined function, and it undoes ff in both directions; conversely, an inverse forces every point to be hit (onto) and forbids two points sharing a value (one-to-one, since gg could not undo it). For the third example above, the inverse is g(y)=yg(y) = \sqrt{y}, and indeed x2=x\sqrt{x^2} = x on [0,∞)[0, \infty) and (y)2=y(\sqrt{y})^2 = y; for the first two examples no inverse exists. Combined with Section 7.8, this is exactly why a linear map is invertible if and only if nullity(T)=0\text{nullity}(T) = 0 and rank(T)=dim⁡(W)\text{rank}(T) = \dim(W); those two conditions are one-to-one and onto in linear-algebra clothing.