Chapter 1: Linear Equations in Linear Algebra
1.9 The matrix of a linear transformation
Study guide for Linear Algebra and Its Applications (David C. Lay, 6th edition)
Independent study guide. Not affiliated with or endorsed by Pearson.
Big idea
A linear transformation is defined by a rule, which could be anything. The result of this section is that it cannot be anything: every linear map from $\mathbb{R}^n$ to $\mathbb{R}^m$ is multiplication by one specific matrix, and you can write that matrix down from very little information.
The reason is the superposition rule. Split an input into its coordinates, $\mathbf{x} = x_1\mathbf{e}_1 + \cdots + x_n\mathbf{e}_n$, where $\mathbf{e}_j$ is the vector with a $1$ in position $j$ and zeros elsewhere. Linearity carries the split through the map: $T(\mathbf{x}) = x_1 T(\mathbf{e}_1) + \cdots + x_n T(\mathbf{e}_n)$. Once you know where the $n$ standard vectors go, you know where everything goes.
Collect those $n$ images as columns and you have the matrix. In the plane this turns geometry into arithmetic. Rotations, reflections, shears and projections all become $2 \times 2$ matrices, and you find each one by asking where the two unit arrows end up.
Decoder
Because a linear map carries linear combinations through unchanged, its values on the standard vectors already determine it everywhere.
Column $j$ of the matrix answers one question: where does $T$ send the vector with a $1$ in slot $j$ and zeros everywhere else? Answer that question $n$ times, stack the answers as columns in order, and the matrix is finished. Every other input is a combination of the standard vectors, so its image is the same combination of the columns.
Definitions and results
The standard vectors of $\mathbb{R}^n$ are $\mathbf{e}_1, \dots, \mathbf{e}_n$, the columns of the $n \times n$ identity matrix. In the plane they are $\mathbf{e}_1 = (1, 0)$ and $\mathbf{e}_2 = (0, 1)$.
The standard matrix rule. Every linear $T$ from $\mathbb{R}^n$ to $\mathbb{R}^m$ equals $\mathbf{x} \mapsto A\mathbf{x}$ for exactly one $m \times n$ matrix $A$, namely
$$ A = \begin{bmatrix} T(\mathbf{e}_1) & T(\mathbf{e}_2) & \cdots & T(\mathbf{e}_n) \end{bmatrix} $$
“Exactly one” matters. Two different matrices cannot produce the same linear map, because the columns are recoverable from the map.
Geometry in the plane. Each of these is a $2 \times 2$ matrix you can rebuild by tracking $\mathbf{e}_1$ and $\mathbf{e}_2$.
- Reflection across the horizontal axis sends $(1,0)$ to $(1,0)$ and $(0,1)$ to $(0,-1)$, giving columns $(1,0)$ and $(0,-1)$. Reflection across the line $y = x$ swaps the two standard vectors.
- Scaling by $r$ in both directions has columns $(r, 0)$ and $(0, r)$. The map is a stretch when $r > 1$ and a shrink when $0 < r < 1$. Scaling one axis only changes one column.
- A horizontal shear leaves $\mathbf{e}_1$ alone and slides $\mathbf{e}_2$ sideways, giving columns $(1,0)$ and $(k, 1)$. Horizontal lines slide by an amount proportional to their height.
- Projection onto the horizontal axis flattens $\mathbf{e}_2$ to zero, giving columns $(1,0)$ and $(0,0)$. Information is destroyed, which is a hint that this map is not one-to-one.
- Counterclockwise rotation by $\theta$ sends $\mathbf{e}_1$ to $(\cos\theta, \sin\theta)$ and $\mathbf{e}_2$ to $(-\sin\theta, \cos\theta)$:
$$ A = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix} $$
Onto. $T$ is onto $\mathbb{R}^m$ when every vector in the codomain is an image of something, that is, when the range fills the codomain. For a matrix transformation this says $A\mathbf{x} = \mathbf{b}$ is consistent for every $\mathbf{b}$, which says the columns of $A$ span $\mathbb{R}^m$, which says the echelon form of $A$ has a pivot in every row.
One-to-one. $T$ is one-to-one when no two different inputs share an image, that is, when $A\mathbf{x} = \mathbf{b}$ has at most one solution for every $\mathbf{b}$. For a linear map this is decided at the origin alone: $T$ is one-to-one exactly when $A\mathbf{x} = \mathbf{0}$ has only the zero solution. Equivalently the columns of $A$ are independent, equivalently the echelon form has a pivot in every column.
Two counting facts fall out. A map from $\mathbb{R}^n$ to $\mathbb{R}^m$ cannot be onto when $n < m$, since a matrix with fewer columns than rows cannot have a pivot in every row. It cannot be one-to-one when $n > m$, since more columns than rows leaves a free variable. Pivots per row decides onto; pivots per column decides one-to-one.
Worked examples
Building a matrix from a two-step description
Let $T$ reflect the plane across the line $y = x$ and then scale the result by $3$. Track the two standard vectors.
$\mathbf{e}_1 = (1,0)$ reflects to $(0,1)$ and scales to $(0,3)$. $\mathbf{e}_2 = (0,1)$ reflects to $(1,0)$ and scales to $(3,0)$. Stack those as columns:
$$ A = \begin{bmatrix} 0 & 3 \\ 3 & 0 \end{bmatrix} $$
Check on an input the columns did not cover. Take $(1, 2)$. The matrix gives $A(1,2) = (0 \cdot 1 + 3 \cdot 2, \; 3 \cdot 1 + 0 \cdot 2) = (6, 3)$. Doing the two geometric steps by hand: $(1,2)$ reflects to $(2,1)$, and scaling by $3$ gives $(6,3)$. Same answer.
What a shear does to the unit square
Let
$$ A = \begin{bmatrix} 1 & 3 \\ 0 & 1 \end{bmatrix} $$
Apply it to the four corners of the unit square. The origin stays at the origin. $(1,0)$ goes to $(1,0)$, since the first column is unchanged. $(0,1)$ goes to $(3,1)$. $(1,1)$ goes to $(1 + 3, \; 0 + 1) = (4,1)$.
The square becomes a parallelogram with corners $(0,0)$, $(1,0)$, $(4,1)$ and $(3,1)$. The bottom edge never moved and the top edge slid three units right, which is what a horizontal shear does. Check that the image is still a parallelogram: the vector from $(0,0)$ to $(1,0)$ is $(1,0)$, and the vector from $(3,1)$ to $(4,1)$ is also $(1,0)$, so those two sides stay parallel and equal in length.
Testing one-to-one and onto
Take the $3 \times 2$ matrix
$$ A = \begin{bmatrix} 1 & 2 \\ 0 & 1 \\ 2 & 1 \end{bmatrix} $$
Reduce it. Subtract twice row one from row three to get $(0, -3)$, then add three times row two to that row to get $(0,0)$. Pivots sit in both columns and in only two of the three rows.
Pivot in every column, so the map from $\mathbb{R}^2$ to $\mathbb{R}^3$ is one-to-one. No pivot in row three, so it is not onto. That matches the counting fact: two columns cannot produce three pivots.
Now take the $2 \times 3$ matrix
$$ B = \begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & 3 \end{bmatrix} $$
It is already reduced, with pivots in both rows, so the map from $\mathbb{R}^3$ to $\mathbb{R}^2$ is onto. The third column has no pivot, so $x_3$ is free and the map is not one-to-one. Produce a witness: set $x_3 = 1$, then $x_1 = -2$ and $x_2 = -3$. Check that $B(-2,-3,1) = (-2 + 0 + 2, \; 0 - 3 + 3) = (0,0)$. A nonzero input lands on the zero vector, so two different inputs share an image.
Practice
Turn a described map into its standard matrix by tracking the standard vectors.
Practice
Generated problems for this section, graded instantly.
Identify and apply the plane transformations: reflections, rotations, scalings, shears and projections.
Practice
Generated problems for this section, graded instantly.
Decide one-to-one and onto from pivot positions, and produce a witness when a map fails one of them.
Practice
Generated problems for this section, graded instantly.
Videos
In the first video, watch how knowing the landing spots of two arrows determines the whole grid. In the second, watch how doing one transformation after another corresponds to a product of their matrices, which is where the next chapter starts.
Linear transformations and matrices | Chapter 3, Essence of linear algebra
3Blue1Brown
Matrix multiplication as composition | Chapter 4, Essence of linear algebra
3Blue1Brown
Quiz
Six questions mixing standard matrices, plane geometry, and the pivot tests.
Quiz
6 problems with a score at the end.