Lay's Linear Algebra

Chapter 1: Linear Equations in Linear Algebra

1.8 Introduction to linear transformations

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

Up to now a matrix has been a table you row reduce. Here it becomes a machine. Feed it a vector $\mathbf{x}$ and it returns the vector $A\mathbf{x}$. The same equation $A\mathbf{x} = \mathbf{b}$ now reads as a question about a function: which inputs does this machine send to $\mathbf{b}$?

The shape of $A$ fixes the shape of the machine. An $m \times n$ matrix eats vectors with $n$ entries and returns vectors with $m$ entries, so it moves $\mathbb{R}^n$ into $\mathbb{R}^m$. The two spaces need not match. A $3 \times 2$ matrix turns plane vectors into space vectors.

Two rules single out the functions worth studying. Adding two inputs and then transforming gives the same result as transforming each and then adding. Scaling an input and then transforming gives the same result as transforming and then scaling. Functions with those two properties are the linear ones, and every matrix gives one.

Decoder

Specifying a transformation takes three things: the space its inputs come from, the space its outputs are permitted to occupy, and the rule pairing one with the other.

That is the word “function” in vector clothing. The first space is the domain, the set of legal inputs. The second is the codomain. One output is an image, and the set of all outputs is the range. Codomain and range are different things: the codomain is where outputs are allowed to land, the range is where they do land, and the range can be a thin slice of the codomain.

Definitions and results

A transformation (equivalently a map or a function) $T$ from $\mathbb{R}^n$ to $\mathbb{R}^m$ takes each vector $\mathbf{x}$ in $\mathbb{R}^n$ to exactly one vector $T(\mathbf{x})$ in $\mathbb{R}^m$. Here $\mathbb{R}^n$ is the domain, $\mathbb{R}^m$ is the codomain, $T(\mathbf{x})$ is the image of $\mathbf{x}$, and the set of all images is the range.

A matrix transformation is the map $\mathbf{x} \mapsto A\mathbf{x}$ for a fixed $m \times n$ matrix $A$. Its range is the set of all linear combinations of the columns of $A$, because $A\mathbf{x}$ is exactly such a combination. Asking whether $\mathbf{b}$ is in the range is asking whether $A\mathbf{x} = \mathbf{b}$ is consistent, which is a row reduction you already know how to do.

$T$ is linear when both of these hold for every $\mathbf{u}$ and $\mathbf{v}$ in the domain and every scalar $c$:

$$ T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v}) \\ T(c\mathbf{u}) = c\,T(\mathbf{u}) $$

Every matrix transformation is linear. This follows from the algebra rules for matrix-vector products: $A(\mathbf{u} + \mathbf{v}) = A\mathbf{u} + A\mathbf{v}$ and $A(c\mathbf{u}) = c(A\mathbf{u})$.

Three consequences follow from the two rules, and they are the fastest tools you have.

  • $T(\mathbf{0}) = \mathbf{0}$. Take $c = 0$ in the second rule. Any map that moves the origin is not linear, and you can check that in one line.
  • $T(c\mathbf{u} + d\mathbf{v}) = c\,T(\mathbf{u}) + d\,T(\mathbf{v})$ for all scalars $c$ and $d$. The two rules combine into one.
  • The same extends to any number of terms: $T$ sends a linear combination of inputs to the same linear combination of their images. This is the superposition rule, and it is why linear models are so useful in physics and engineering. Break an input into pieces, transform the pieces, add the results.

To prove a map is linear, verify both rules with symbols, or exhibit a matrix that produces it. To prove a map is not linear, produce one concrete pair of numbers where a rule fails. One counterexample is enough.

The payoff of the definition is that it never mentions a matrix. A rule can be stated in words, in geometry, or by a physical process, and the two tests still apply. Rotating the plane, projecting onto a line, and differentiating a polynomial all pass, without anyone writing an array of numbers first. The next section closes the loop by showing that any rule which passes the tests was a matrix all along.

Worked examples

A matrix as a machine from the plane into space

Let

$$ A = \begin{bmatrix} 1 & -2 \\ 0 & 3 \\ 2 & 1 \end{bmatrix} $$

and let $T(\mathbf{x}) = A\mathbf{x}$. The matrix is $3 \times 2$, so $T$ maps $\mathbb{R}^2$ into $\mathbb{R}^3$.

Find the image of $\mathbf{u} = (2, 1)$:

$$ T(\mathbf{u}) = 2\begin{bmatrix} 1 \\ 0 \\ 2 \end{bmatrix} + 1\begin{bmatrix} -2 \\ 3 \\ 1 \end{bmatrix} = \begin{bmatrix} 0 \\ 3 \\ 5 \end{bmatrix} $$

Now go the other way. Is $\mathbf{b} = (1, 3, 7)$ in the range? Solve $A\mathbf{x} = \mathbf{b}$. The second row gives $3x_2 = 3$, so $x_2 = 1$. The first row gives $x_1 - 2 = 1$, so $x_1 = 3$. The third row must agree: $2(3) + 1 = 7$. It does, so $\mathbf{b}$ is in the range with preimage $(3, 1)$.

Try $\mathbf{c} = (1, 3, 0)$ instead. The first two rows force $x_2 = 1$ and $x_1 = 3$ again, but then the third row gives $2(3) + 1 = 7 \ne 0$. The system is inconsistent, so $\mathbf{c}$ is not in the range. The codomain is $\mathbb{R}^3$, but the range is only a plane inside it.

Checking the two rules directly

Define $T(x_1, x_2) = (x_1 + 2x_2, \; 3x_1 - x_2)$. Take $\mathbf{u} = (u_1, u_2)$ and $\mathbf{v} = (v_1, v_2)$.

Additivity:

$$ T(\mathbf{u} + \mathbf{v}) = \big((u_1 + v_1) + 2(u_2 + v_2), \; 3(u_1 + v_1) - (u_2 + v_2)\big) $$

Regroup the entries by which vector they came from and you get $(u_1 + 2u_2, \; 3u_1 - u_2) + (v_1 + 2v_2, \; 3v_1 - v_2)$, which is $T(\mathbf{u}) + T(\mathbf{v})$.

Homogeneity: $T(c\mathbf{u}) = (cu_1 + 2cu_2, \; 3cu_1 - cu_2)$, and factoring $c$ out of both entries gives $c\,T(\mathbf{u})$.

Both rules hold, so $T$ is linear. The check also shows what the matrix must be:

$$ A = \begin{bmatrix} 1 & 2 \\ 3 & -1 \end{bmatrix} $$

Verify on one input. $T(2, 1) = (2 + 2, \; 6 - 1) = (4, 5)$, and $A(2,1) = (1 \cdot 2 + 2 \cdot 1, \; 3 \cdot 2 - 1 \cdot 1) = (4, 5)$. They agree.

Two maps that are not linear

First, $F(x_1, x_2) = (x_1 + 1, \; x_2)$, a shift one unit to the right. Test the origin: $F(0, 0) = (1, 0)$, which is not the zero vector. A linear map cannot move the origin, so $F$ is not linear. Sliding the whole plane is a useful operation, but it is not this kind of operation.

Second, $G(x_1, x_2) = (x_1 x_2, \; x_2)$. The origin survives, since $G(0,0) = (0,0)$, so test scaling instead. With $\mathbf{u} = (1, 1)$:

$$ G(2\mathbf{u}) = G(2, 2) = (4, 2), \qquad 2\,G(\mathbf{u}) = 2(1, 1) = (2, 2) $$

These differ, so homogeneity fails and $G$ is not linear. The counterexample cost one input and two evaluations.

Practice

Decide whether a given map obeys both rules, and read off domain, codomain and range for a matrix transformation.

Practice

Generated problems for this section, graded instantly.

Videos

Watch the part where a grid of lines stays straight, evenly spaced, and pinned at the origin. That picture is the geometry behind the two algebraic rules.

Linear transformations and matrices | Chapter 3, Essence of linear algebra

3Blue1Brown

Quiz

Five questions on the linearity rules, images, and membership in the range.

Quiz

5 problems with a score at the end.