\documentclass[11pt]{article}

\usepackage{precalc}

\newcommand{\iv}{\ensuremath{\vec{\imath}}}
\newcommand{\jv}{\ensuremath{\vec{\jmath}}}

\begin{document}

\assigntitle{19}{Linear Transformations}

\topic{matrices as functions}
Last week, you saw that we can think of $2 \times 2$ matrices as
\emph{functions} of the Cartesian plane---that is, matrix
multiplication represents some sort of two-dimensional
transformation.  The obvious question is: what \emph{sorts} of
two-dimensional transformations can we represent with matrices in this
way? 

Another important question is, given some matrix, how can we tell what
transformation it represents?  Last week, you looked at a few
examples---but how do we know we can tell what transformation a matrix
represents just by looking at its action on a few points?  For
example, one of the matrices you looked transformed four points making
up the vertices of a square into a slightly rotated square---but how
do we know this matrix would have the same effect on other points?
Perhaps it only rotates points near the origin, and leaves some
farther-away points alone, or maybe it rotates some points clockwise
and some points counterclockwise, or maybe\dots there are endless
possibilities.

\topic{matrix functions are simple}
It turns out that we \emph{can} actually tell what transformation a
matrix represents by looking at only a few examples, and that there
are really only a few fundamental sorts of transformations that can be
represented by matrices (fortunately, they're very useful ones!). The
fundamental result we will show is this:

\begin{quote}
  \emph{If we know what a matrix does to the special points $(1,0)$
    and $(0,1)$, then we know everything there is to know about it!}
\end{quote}

Intuitively, this says that transformations represented by matrices
can't do anything very ``strange''.  They are so orderly and regular
that we can know everything there is to know about them by just
looking at what they do to two specific points.  Let's see why this is
true!

\section{Linear transformations}
\label{sec:lin-transf}

\topic{scalar multiplication} Suppose $s$ is a real number.  If $B$ is
a matrix, then $sB$ represents the matrix you get when you multiply
each of its entries by $s$.  For example, \[ 3 \begin{pmatrix} 2 & 5
  \\ 7 & -1 \end{pmatrix} = \begin{pmatrix} 6 & 15 \\ 21 &
  -3 \end{pmatrix}. \] This is known as \term{scalar multiplication}.
(A ``scalar'' is another name for the familiar sorts of numbers you
are used to, like $3$, $\pi$, $\sqrt{6}$---scalars are
``zero-dimensional'' numbers, vectors are one-dimensional, and
matrices are two-dimensional. (Numbers with dimensions higher than
that are called ``tensors''.))

Suppose $A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$ is a $2
\times 2$ matrix and that $X = \begin{pmatrix} x \\ y \end{pmatrix}$
is a $2 \times 1$ matrix representing the point $(x,y)$.

\begin{problem}
  What is the matrix product $AX$? Write your answer as a matrix in
  terms of $a$, $b$, $c$, $d$, $x$, and $y$.    
\end{problem}

\begin{problem}
  Write $sX$ as a matrix in terms of $s$, $x$, and $y$.
\end{problem}

\begin{problem} \label{prob:matrix-scalar-product}
  Compute the matrix product $A(sX)$. (Write your answer as a matrix
  in terms of \dots yada yada.)
\end{problem}

\begin{problem}
  Compute the product $s(AX)$.  Show that it is equal to your answer
  to \pref{prob:matrix-scalar-product}.
\end{problem}

You have just shown that for any scalar $s$ and matrices $A$ and $X$,
\begin{equation}
  \label{eq:scalar-mult-assoc}
  A(sX) = s(AX).
\end{equation}
(Actually, you only showed this when $A$ is a $2 \times 2$ matrix and
$X$ is $2 \times 1$---but it is not hard to generalize the proof to
cover any matrices which can be multiplied.)

Let's prove one more property of matrices.  In addition to $A$ and
$X$, suppose we also now have the matrix $Y = \begin{pmatrix} w \\
  z \end{pmatrix}$.

\begin{problem}
  Compute $A(X + Y)$.
\end{problem}

\begin{problem}
  Compute $AX + AY$, and show that it is equal to your answer from the
  previous problem.
\end{problem}

This is a nice result---matrix multiplication distributes over matrix
addition, just like with normal (scalar) arithmetic!
\begin{equation}
  \label{eq:matrix-mult-distrib}
  A(X+Y) = AX + AY
\end{equation}

\topic{linear transformations}
The above two properties (\eqref{eq:scalar-mult-assoc} and
\eqref{eq:matrix-mult-distrib}) together have a special name: we say
that multiplying by a matrix is a \emph{linear transformation}.  Why
is it so special?  

\section{Unit vectors}
\label{sec:unit-vectors}

\topic{unit vectors and \LaTeX}
The vectors $(1,0)$ and $(0,1)$ are special---so special, that we
usually give them special names, $\iv$ and $\jv$.  (You can
write them in \LaTeX\ as \verb|\vec{\imath}| and \verb|\vec{\jmath}|.
\verb|\vec| adds the little arrow on top; note
that you should use \verb|\imath| and \verb|\jmath| inside the \verb|\vec|
instead of just \verb|i| and \verb|j|.  Can you spot the difference
between $\vec{i}$ (\verb|\vec{i}|, wrong) and $\vec{\imath}$
(\verb|\vec{\i}|, right)? Can you guess what \verb|\imath| and \verb|\jmath|
do?)

$\iv$ and $\jv$ are called ``unit'' vectors since they are one unit
long.  There are two of them since we are dealing with two dimensions
(in three dimensions, there are three unit vectors: $\iv = (1,0,0)$,
$\jv = (0,1,0)$, and $\vec{k} = (0,0,1)$).

\diagram{unit-vectors}{The unit vectors $\iv$ and $\jv$}

\topic{decomposing vectors with unit vectors}
$\iv$ and $\jv$ are special because any other vector can be written in
terms of them. (Actually, it turns out that this \emph{isn't}
particularly special about $\iv$ and $\jv$; you can do this with
almost any two vectors, as long as they don't point in the same
direction.  But at least with $\iv$ and $\jv$ it's easy to see why.)
For example, the vector $(3,5)$ can be written as $3\iv + 5\jv$, as
shown in \pref{fig:threefive}.

\diagram{threefive}{Expressing the vector $(3,5)$ in terms of $\iv$
  and $\jv$}

In matrix notation, we could also write this as \[ \begin{pmatrix} 3
  \\ 5 \end{pmatrix} = 3 \begin{pmatrix} 1 \\ 0 \end{pmatrix} +
5 \begin{pmatrix} 0 \\ 1 \end{pmatrix}. \] Do you see why this is
true?

In general, of course,
\begin{equation}
  \label{eq:unit-decomp}
  \begin{pmatrix} x
  \\ y \end{pmatrix} = x \begin{pmatrix} 1 \\ 0 \end{pmatrix} +
y \begin{pmatrix} 0 \\ 1 \end{pmatrix} = x\iv + y\jv.
\end{equation}

\section{Matrix transformations, revealed}
\label{sec:matrix-revealed}

But now we are almost done!

\begin{problem}
  Given the matrix $A$ from \pref{sec:lin-transf}, what is $A\iv$?
  What is $A\jv$?
\end{problem}

\begin{problem}
  Show that if $X = \begin{pmatrix} x \\ y \end{pmatrix}$, then $AX =
  x(A\iv) + y(A\jv)$. (\emph{Hint}: use \pref{eq:unit-decomp} to
  decompose $X$ in terms of $\iv$ and $\jv$; then use
  \pref{eq:scalar-mult-assoc} and \pref{eq:matrix-mult-distrib} to simplify.)
\end{problem}

\topic{matrix transformations are determined by unit vectors}
But this means that no matter what $X$ is, the transformation that $A$
performs on $X$ can be expressed in terms of what $A$ does to the unit
vectors $\iv$ and $\jv$---so if we know $A\iv$ and $A\jv$, then we
know what $A$ does to \emph{any} point!

\section{Basic linear transformations}
\label{sec:basic-lin-transf}

Meet Mr.\ Elephant, a happy critter who lives at the origin of a
Cartesian plane.

\diagram{mr-elephant}{Mr. Elephant.}

Sometimes for fun, Mr. Elephant likes to transform himself with
matrices.  (By ``transform himself with matrices,'' I simply mean
``multiply every point in his body by a matrix.'') Can you help him?

\begin{problem}
  Write down a $2 \times 2$ matrix which would transform Mr. Elephant
  into Tiny Mr. Elephant, shown in \pref{fig:mr-elephant-tiny}.  Tiny
  Mr. Elephant is exactly $1/3$ the size of regular Mr. Elephant.
  (\emph{Hint:} think about what such a matrix would have to do to
  $\iv$ and $\jv$.)  This type of transformation is called a \term{scale}.
\end{problem}

\diagram{mr-elephant-tiny}{Tiny Mr. Elephant.}

\begin{problem}
  Write down a $2 \times 2$ matrix which would transform Mr. Elephant
  into each of the forms listed below.  Think about what each
  transformation would do to the unit vectors $\iv$ and $\jv$.
  \begin{subproblems}
    \item Fat Mr. Elephant, who is twice as wide as Mr. Elephant but
      the same height (\pref{fig:mr-elephant-fat}).  This is also a
      \term{scale}. 

      \diagram{mr-elephant-fat}{Fat Mr. Elephant.}

    \item Upside-down Mr. Elephant (\pref{fig:mr-elephant-flip}).
      this transformation is a \term{reflection}---although you can
      also think of it as a kind of scale.

      \diagram{mr-elephant-flip}{Upside-down Mr. Elephant.}

    \item Amazing Mr. Elephant, who is so amazing that he can balance
      on his tail (\pref{fig:mr-elephant-90}).  This transformation,
      of course, is a \term{rotation}.

      \diagram{mr-elephant-90}{Amazing Mr. Elephant.}

    \item Lazy Mr. Elephant (\pref{fig:mr-elephant-120}), who is
      rotated $120^\circ$ in order to lie on his back.

      \diagram{mr-elephant-120}{Lazy Mr. Elephant.}

    \item Frightened Mr. Elephant (\pref{fig:mr-elephant-skew}).  This
      sort of transformation is called a \term{skew} or \term{shear}.

      \diagram{mr-elephant-skew}{Frightened Mr. Elephant!}

    \item Crazy Mr. Elephant (\pref{fig:mr-elephant-compose}).
      (\emph{Hint:} this is the hardest one.  It might help to think
      about how you could make Crazy Mr. Elephant by combining some of
      the other transformations.)

      \diagram{mr-elephant-compose}{Crazy Mr. Elephant.}
  \end{subproblems}
\end{problem}


\begin{problem}
  Is it possible to make a matrix which transforms Mr. Elephant as
  shown in \pref{fig:mr-elephant-translate}?  If so, write down such a
  matrix.  If not, explain why. (\emph{Hint:} think about what a
  linear transformation can do to the point $(0,0)$.)

  \diagram{mr-elephant-translate}{Translated Mr. Elephant.}
\end{problem}

Next week, the exciting conclusion---we'll see how to represent
translations with matrices using so-called \term{affine
  transformations}, and then use these affine transformations to make
ferns, sierpinski triangles, and other fantastic shapes!

\end{document}