# Linear Algebra/Topic: Geometry of Linear Maps

 Linear Algebra ← Topic: Line of Best Fit Topic: Geometry of Linear Maps Topic: Markov Chains →

The pictures below contrast ${\displaystyle f_{1}(x)=e^{x}}$ and ${\displaystyle f_{2}(x)=x^{2}}$, which are nonlinear, with ${\displaystyle h_{1}(x)=2x}$ and ${\displaystyle h_{2}(x)=-x}$, which are linear. Each of the four pictures shows the domain ${\displaystyle \mathbb {R} ^{1}}$ on the left mapped to the codomain ${\displaystyle \mathbb {R} ^{1}}$ on the right. Arrows trace out where each map sends ${\displaystyle x=0}$, ${\displaystyle x=1}$, ${\displaystyle x=2}$, ${\displaystyle x=-1}$, and ${\displaystyle x=-2}$. Note how the nonlinear maps distort the domain in transforming it into the range. For instance, ${\displaystyle f_{1}(1)}$ is further from ${\displaystyle f_{1}(2)}$ than it is from ${\displaystyle f_{1}(0)}$ — the map is spreading the domain out unevenly so that an interval near ${\displaystyle x=2}$ is spread apart more than is an interval near ${\displaystyle x=0}$ when they are carried over to the range.

The linear maps are nicer, more regular, in that for each map all of the domain is spread by the same factor.

The only linear maps from ${\displaystyle \mathbb {R} ^{1}}$ to ${\displaystyle \mathbb {R} ^{1}}$ are multiplications by a scalar. In higher dimensions more can happen. For instance, this linear transformation of ${\displaystyle \mathbb {R} ^{2}}$, rotates vectors counterclockwise, and is not just a scalar multiplication.

The transformation of ${\displaystyle \mathbb {R} ^{3}}$ which projects vectors into the ${\displaystyle xz}$-plane is also not just a rescaling.

Nonetheless, even in higher dimensions the situation isn't too complicated.

Below, we use the standard bases to represent each linear map ${\displaystyle h:\mathbb {R} ^{n}\to \mathbb {R} ^{m}}$ by a matrix ${\displaystyle H}$. Recall that any ${\displaystyle H}$ can be factored ${\displaystyle H=PBQ}$, where ${\displaystyle P}$ and ${\displaystyle Q}$ are nonsingular and ${\displaystyle B}$ is a partial-identity matrix. Further, recall that nonsingular matrices factor into elementary matrices ${\displaystyle PBQ=T_{n}T_{n-1}\cdots T_{j}BT_{j-1}\cdots T_{1}}$, which are matrices that are obtained from the identity ${\displaystyle I}$ with one Gaussian step

${\displaystyle I{\xrightarrow[{}]{k\rho _{i}}}M_{i}(k)\qquad I{\xrightarrow[{}]{\rho _{i}\leftrightarrow \rho _{j}}}P_{i,j}\qquad I{\xrightarrow[{}]{k\rho _{i}+\rho _{j}}}C_{i,j}(k)}$

(${\displaystyle i\neq j}$, ${\displaystyle k\neq 0}$). So if we understand the effect of a linear map described by a partial-identity matrix, and the effect of linear mapss described by the elementary matrices, then we will in some sense understand the effect of any linear map. (The pictures below stick to transformations of ${\displaystyle \mathbb {R} ^{2}}$ for ease of drawing, but the statements hold for maps from any ${\displaystyle \mathbb {R} ^{n}}$ to any ${\displaystyle \mathbb {R} ^{m}}$.)

The geometric effect of the linear transformation represented by a partial-identity matrix is projection.

${\displaystyle {\begin{pmatrix}x\\y\\z\end{pmatrix}}\quad {\xrightarrow {{\begin{pmatrix}1&0&0\\0&1&0\\0&0&0\end{pmatrix}}_{{\mathcal {E}}_{3},{\mathcal {E}}_{3}}}}\quad {\begin{pmatrix}x\\y\\0\end{pmatrix}}}$

For the ${\displaystyle M_{i}(k)}$ matrices, the geometric action of a transformation represented by such a matrix (with respect to the standard basis) is to stretch vectors by a factor of ${\displaystyle k}$ along the ${\displaystyle i}$-th axis. This map stretches by a factor of ${\displaystyle 3}$ along the ${\displaystyle x}$-axis.

Note that if ${\displaystyle 0\leq k<1}$ or if ${\displaystyle k<0}$ then the ${\displaystyle i}$-th component goes the other way; here, toward the left.

Either of these is a dilation.

The action of a transformation represented by a ${\displaystyle P_{i,j}}$ permutation matrix is to interchange the ${\displaystyle i}$-th and ${\displaystyle j}$-th axes; this is a particular kind of reflection.

In higher dimensions, permutations involving many axes can be decomposed into a combination of swaps of pairs of axes— see Problem 5.

The remaining case is that of matrices of the form ${\displaystyle C_{i,j}(k)}$. Recall that, for instance, that ${\displaystyle C_{1,2}(2)}$ performs ${\displaystyle 2\rho _{1}+\rho _{2}}$.

${\displaystyle {\begin{pmatrix}x\\y\end{pmatrix}}{\xrightarrow {{\begin{pmatrix}1&0\\2&1\end{pmatrix}}_{{\mathcal {E}}_{2},{\mathcal {E}}_{2}}}}\qquad {\begin{pmatrix}x\\2x+y\end{pmatrix}}}$

In the picture below, the vector ${\displaystyle {\vec {u}}}$ with the first component of ${\displaystyle 1}$ is affected less than the vector ${\displaystyle {\vec {v}}}$ with the first component of ${\displaystyle 2}$${\displaystyle h({\vec {u}})}$ is only ${\displaystyle 2}$ higher than ${\displaystyle {\vec {u}}}$ while ${\displaystyle h({\vec {v}})}$ is ${\displaystyle 4}$ higher than ${\displaystyle {\vec {v}}}$.

Any vector with a first component of ${\displaystyle 1}$ would be affected as is ${\displaystyle {\vec {u}}}$; it would be slid up by ${\displaystyle 2}$. And any vector with a first component of ${\displaystyle 2}$ would be slid up ${\displaystyle 4}$, as was ${\displaystyle {\vec {v}}}$. That is, the transformation represented by ${\displaystyle C_{i,j}(k)}$ affects vectors depending on their ${\displaystyle i}$-th component.

Another way to see this same point is to consider the action of this map on the unit square. In the next picture, vectors with a first component of ${\displaystyle 0}$, like the origin, are not pushed vertically at all but vectors with a positive first component are slid up. Here, all vectors with a first component of ${\displaystyle 1}$— the entire right side of the square— is affected to the same extent. More generally, vectors on the same vertical line are slid up the same amount, namely, they are slid up by twice their first component. The resulting shape, a rhombus, has the same base and height as the square (and thus the same area) but the right angles are gone.

For contrast the next picture shows the effect of the map represented by ${\displaystyle C_{2,1}(1)}$. In this case, vectors are affected according to their second component. The vector ${\displaystyle {\binom {x}{y}}}$ is slid horozontally by twice ${\displaystyle y}$.

Because of this action, this kind of map is called a shear.

With that, we have covered the geometric effect of the four types of components in the expansion ${\displaystyle H=T_{n}T_{n-1}\cdots T_{j}BT_{j-1}\cdots T_{1}}$, the partial-identity projection ${\displaystyle B}$ and the elementary ${\displaystyle T_{i}}$'s. Since we understand its components, we in some sense understand the action of any ${\displaystyle H}$. As an illustration of this assertion, recall that under a linear map, the image of a subspace is a subspace and thus the linear transformation ${\displaystyle h}$ represented by ${\displaystyle H}$ maps lines through the origin to lines through the origin. (The dimension of the image space cannot be greater than the dimension of the domain space, so a line can't map onto, say, a plane.) We will extend that to show that any line, not just those through the origin, is mapped by ${\displaystyle h}$ to a line. The proof is simply that the partial-identity projection ${\displaystyle B}$ and the elementary ${\displaystyle T_{i}}$'s each turn a line input into a line output (verifying the four cases is Problem 6), and therefore their composition also preserves lines. Thus, by understanding its components we can understand arbitrary square matrices ${\displaystyle H}$, in the sense that we can prove things about them.

An understanding of the geometric effect of linear transformations on ${\displaystyle \mathbb {R} ^{n}}$ is very important in mathematics. Here is a familiar application from calculus. On the left is a picture of the action of the nonlinear function ${\displaystyle y(x)=x^{2}+x}$. As at that start of this Topic, overall the geometric effect of this map is irregular in that at different domain points it has different effects (e.g., as the domain point ${\displaystyle x}$ goes from ${\displaystyle 2}$ to ${\displaystyle -2}$, the associated range point ${\displaystyle f(x)}$ at first decreases, then pauses instantaneously, and then increases).

But in calculus we don't focus on the map overall, we focus instead on the local effect of the map.

At ${\displaystyle x=1}$ the derivative is ${\displaystyle y^{\prime }(1)=3}$, so that near ${\displaystyle x=1}$ we have ${\displaystyle \Delta y\approx 3\cdot \Delta x}$.

That is, in a neighborhood of ${\displaystyle x=1}$, in carrying the domain to the codomain this map causes it to grow by a factor of ${\displaystyle 3}$ — it is, locally, approximately, a dilation.

The picture below shows a small interval in the domain ${\displaystyle (x-\Delta x\,..\,x+\Delta x)}$ carried over to an interval in the codomain ${\displaystyle (y-\Delta y\,..\,y+\Delta y)}$ that is three times as wide: ${\displaystyle \Delta y\approx 3\cdot \Delta x}$.

(When the above picture is drawn in the traditional cartesian way then the prior sentence about the rate of growth of ${\displaystyle y(x)}$ is usually stated: the derivative ${\displaystyle y^{\prime }(1)=3}$ gives the slope of the line tangent to the graph at the point ${\displaystyle (1,2)}$.)

In higher dimensions, the idea is the same but the approximation is not just the ${\displaystyle \mathbb {R} ^{1}}$-to-${\displaystyle \mathbb {R} ^{1}}$ scalar multiplication case. Instead, for a function ${\displaystyle y:\mathbb {R} ^{n}\to \mathbb {R} ^{m}}$ and a point ${\displaystyle {\vec {x}}\in \mathbb {R} ^{n}}$, the derivative is defined to be the linear map ${\displaystyle h:\mathbb {R} ^{n}\to \mathbb {R} ^{m}}$ best approximating how ${\displaystyle y}$ changes near ${\displaystyle y({\vec {x}})}$. So the geometry studied above applies.

We will close this Topic by remarking how this point of view makes clear an often-misunderstood, but very important, result about derivatives: the derivative of the composition of two functions is computed by using the Chain Rule for combining their derivatives. Recall that (with suitable conditions on the two functions)

${\displaystyle {\frac {d\,(g\circ f)}{dx}}(x)={\frac {dg}{dx}}(f(x))\cdot {\frac {df}{dx}}(x)}$

so that, for instance, the derivative of ${\displaystyle \sin(x^{2}+3x)}$ is ${\displaystyle \cos(x^{2}+3x)\cdot (2x+3)}$. How does this combination arise? From this picture of the action of the composition.

The first map ${\displaystyle f}$ dilates the neighborhood of ${\displaystyle x}$ by a factor of

${\displaystyle {\frac {df}{dx}}(x)}$

and the second map ${\displaystyle g}$ dilates some more, this time dilating a neighborhood of ${\displaystyle f(x)}$ by a factor of

${\displaystyle {\frac {dg}{dx}}(\,f(x)\,)}$

and as a result, the composition dilates by the product of these two.

In higher dimensions the map expressing how a function changes near a point is a linear map, and is expressed as a matrix. (So we understand the basic geometry of higher-dimensional derivatives; they are compositions of dilations, interchanges of axes, shears, and a projection). And, the Chain Rule just multiplies the matrices.

Thus, the geometry of linear maps ${\displaystyle h:\mathbb {R} ^{n}\to \mathbb {R} ^{m}}$ is appealing both for its simplicity and for its usefulness.

## Exercises

Problem 1

Let ${\displaystyle h:\mathbb {R} ^{2}\to \mathbb {R} ^{2}}$  be the transformation that rotates vectors clockwise by ${\displaystyle \pi /4}$  radians.

1. Find the matrix ${\displaystyle H}$  representing ${\displaystyle h}$  with respect to the standard bases. Use Gauss' method to reduce ${\displaystyle H}$  to the identity.
2. Translate the row reduction to to a matrix equation ${\displaystyle T_{j}T_{j-1}\cdots T_{1}H=I}$  (the prior item shows both that ${\displaystyle H}$  is similar to ${\displaystyle I}$ , and that no column operations are needed to derive ${\displaystyle I}$  from ${\displaystyle H}$ ).
3. Solve this matrix equation for ${\displaystyle H}$ .
4. Sketch the geometric effect matrix, that is, sketch how ${\displaystyle H}$  is expressed as a combination of dilations, flips, skews, and projections (the identity is a trivial projection).
Problem 2

What combination of dilations, flips, skews, and projections produces a rotation counterclockwise by ${\displaystyle 2\pi /3}$  radians?

Problem 3

What combination of dilations, flips, skews, and projections produces the map ${\displaystyle h:\mathbb {R} ^{3}\to \mathbb {R} ^{3}}$  represented with respect to the standard bases by this matrix?

${\displaystyle {\begin{pmatrix}1&2&1\\3&6&0\\1&2&2\end{pmatrix}}}$
Problem 4

Show that any linear transformation of ${\displaystyle \mathbb {R} ^{1}}$  is the map that multiplies by a scalar ${\displaystyle x\mapsto kx}$ .

Problem 5

Show that for any permutation (that is, reordering) ${\displaystyle p}$  of the numbers ${\displaystyle 1}$ , ..., ${\displaystyle n}$ , the map

${\displaystyle {\begin{pmatrix}x_{1}\\x_{2}\\\vdots \\x_{n}\end{pmatrix}}\mapsto {\begin{pmatrix}x_{p(1)}\\x_{p(2)}\\\vdots \\x_{p(n)}\end{pmatrix}}}$

can be accomplished with a composition of maps, each of which only swaps a single pair of coordinates. Hint: it can be done by induction on ${\displaystyle n}$ . (Remark: in the fourth chapter we will show this and we will also show that the parity of the number of swaps used is determined by ${\displaystyle p}$ . That is, although a particular permutation could be accomplished in two different ways with two different numbers of swaps, either both ways use an even number of swaps, or both use an odd number.)

Problem 6

Show that linear maps preserve the linear structures of a space.

1. Show that for any linear map from ${\displaystyle \mathbb {R} ^{n}}$  to ${\displaystyle \mathbb {R} ^{m}}$ , the image of any line is a line. The image may be a degenerate line, that is, a single point.
2. Show that the image of any linear surface is a linear surface. This generalizes the result that under a linear map the image of a subspace is a subspace.
3. Linear maps preserve other linear ideas. Show that linear maps preserve "betweeness": if the point ${\displaystyle B}$  is between ${\displaystyle A}$  and ${\displaystyle C}$  then the image of ${\displaystyle B}$  is between the image of ${\displaystyle A}$  and the image of ${\displaystyle C}$ .
Problem 7

Use a picture like the one that appears in the discussion of the Chain Rule to answer: if a function ${\displaystyle f:\mathbb {R} \to \mathbb {R} }$  has an inverse, what's the relationship between how the function — locally, approximately — dilates space, and how its inverse dilates space (assuming, of course, that it has an inverse)?

 Linear Algebra ← Topic: Line of Best Fit Topic: Geometry of Linear Maps Topic: Markov Chains →