
\documentclass[12pt]{amsart}

\usepackage{241}
\usepackage{tikz}

\title{21-241 Matrices and Linear Transformations \\
       Summer 1 2012 \\
       Course notes \\
       Day 3}
\author{Paul McKenney}


\begin{document}

\maketitle

  \begin{defn}
    A \emph{linear transformation} is a function $T : \RR^n\to\RR^m$ such that for all $x,y\in\RR^n$ and $\lambda\in\RR$,
    \begin{enumerate}
      \item  $T(x+y) = T(x) + T(y)$, and
      \item  $T(\lambda x) = \lambda T(x)$.
    \end{enumerate}
  \end{defn}

  \begin{fact}
    \label{transformations.basics}
    \begin{enumerate}[(a)]
      \item  If $T : \RR^n\to\RR^m$ is a linear transformation, $x_1,\ldots,x_k\in\RR^n$, and $\lambda_1,\ldots,\lambda_k\in\RR$, then
      \[
        T(\lambda_1 x_1 + \cdots + \lambda_k x_k) = \lambda_1 T(x_1) + \cdots + \lambda_k T(x_k)
      \]
      \item  If $T : \RR^n\to\RR^m$ is a linear transformation, then $T(0) = 0$.
      \item  If $\lambda\in\RR$ and $S, T : \RR^n\to\RR^m$ are linear transformations, then so are the functions $S + T$ and $\lambda T$ defined by
      \[
        (S + T)(x) = S(x) + T(x)\qquad (\lambda T)(x) = \lambda (T(x))\qquad x\in\RR^n
      \]
    \end{enumerate}
  \end{fact}

  \begin{example*}
    The following are all linear transformations.
    \begin{enumerate}
      \item  The \emph{identity map} $\id : \RR^n\to\RR^n$ which takes $x\in\RR^n$ to itself.
      \item  The map which rotates a point $x$ in the plane $\RR^2$ around the origin by a fixed angle $\theta$.
      \item  The map which takes a given $x\in\RR^n$ to $Ax\in\RR^m$, where $A$ is a fixed $m\times n$ matrix.
    \end{enumerate}
  \end{example*}

  It is an important fact that the last example is completely representative of all linear transformations.
  \begin{thm}
    If $T : \RR^n\to\RR^m$ is a linear transformation, then there is some $m\times n$ matrix $A$ such that for all $x\in\RR^n$,
    \[
      T(x) = Ax
    \]
    Moreover such an $A$ is unique; ie, there is \emph{exactly one} $m\times n$ matrix $A$ such that the above holds for all $x\in\RR^n$.
  \end{thm}
  \begin{proof}
    We will make use of the following vectors in $\RR^n$, which you will get to know very well over the course of the semester;
    \[
      e_1 = \begin{pmatrix} 1 \\ 0 \\ \vdots \\ 0 \\ \end{pmatrix} \qquad
      e_2 = \begin{pmatrix} 0 \\ 1 \\ \vdots \\ 0 \\ \end{pmatrix} \qquad
      \cdots \qquad
      e_n = \begin{pmatrix} 0 \\ 0 \\ \vdots \\ 1 \\ \end{pmatrix}
    \]
    These are called the \emph{standard basis vectors for $\RR^n$}.  Now let $a_i = T(e_i)$ for each $i\le n$.  Then each $a_i$ is a column vector in $\RR^m$.  Let $A$ be the $m\times n$ matrix whose $i$th column (from left to right) is $a_i$.  We'll show that this $A$ works, ie,
    \[
      \forall x\in\RR^n\quad T(x) = Ax
    \]
    To see this, let $x\in\RR^n$ be given.  Then
    \begin{align*}
      x & = \begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \\ \end{pmatrix} \\
        & = \begin{pmatrix} x_1 \\ 0 \\ \vdots \\ 0 \\ \end{pmatrix} + \begin{pmatrix} 0 \\ x_2 \\ \vdots \\ 0 \\ \end{pmatrix} + \begin{pmatrix} 0 \\ 0 \\ \vdots \\ x_n \\ \end{pmatrix} \\
        & = x_1 e_1 + x_2 e_2 + \cdots + x_n e_n \\
    \end{align*}
    Hence, by Fact~\ref{transformations.basics},
    \[
      T(x) = T(x_1 e_1 + \cdots + x_n e_n) = x_1 T(e_1) + \cdots + x_n T(e_n) = x_1 a_1 + \cdots + x_n a_n = Ax
    \]
    Since $x\in\RR^n$ was given, this proves that there is a matrix $A$ which implements $T$.  To show uniqueness, ie that there is \emph{at most one} such $A$, suppose both $A$ and $B$ are $m\times n$ matrices which implement $T$.  Then,
    \[
      \forall x\in\RR^n\quad Ax = T(x) = Bx
    \]
    Now we look again at the standard basis vectors; we have $Ae_i = T(e_i) = Be_i$ for each $i \le n$.  Notice that $Ae_i$ and $Be_i$ are the $i$th columns of $A$ and $B$ respectively.  Hence the $i$th column of $A$ is equal to the $i$th column of $B$, for each $i\le n$; it follows then that $A = B$.
  \end{proof}

  \begin{defn}
    The \emph{standard matrix} of a linear transformation $T : \RR^n\to \RR^m$ is the unique $m\times n$ matrix $A$ such that $T(x) = Ax$ for all $x\in\RR^n$.
  \end{defn}


  \begin{example*}
    Let's work out the standard matrix of the linear transformation $R_\theta$ which rotates a point $x\in\RR^2$ around the origin (counterclockwise) by a fixed angle $\theta$.  By the proof of the above theorem, to find the columns of this matrix we need only find $R_\theta(e_1)$ and $R_\theta(e_2)$, where $e_1 = \smat{1 \\ 0}$ and $e_2 = \smat{0 \\ 1}$.  In this case $e_1$ is the unit vector in the $x$ direction; so by trigonometry, rotation by the angle $\theta$ brings us to the point $\smat{\cos\theta \\ \sin\theta}$.
  \begin{center}
    \begin{tikzpicture}[scale=2]
      \draw[step=.5cm,style=help lines] (-1.4,-1.4) grid (1.4,1.4);
      \draw (-1.5,0) -- (1.5,0);
      \draw (0,-1.5) -- (0,1.5);
      \draw[->] (3mm,0mm) arc (0:60:3mm);
      \draw[->, very thick,red] (0,0) -- (1,0);
      \draw[->, very thick,red] (0,0) -- (60:1);
      \draw[->] (0mm,3mm) arc (90:150:3mm);
      \draw[->, very thick,blue] (0,0) -- (0,1);
      \draw[->, very thick,blue] (0,0) -- (150:1);
   \end{tikzpicture}
  \end{center}
    Some geometric pondering also shows that rotating $e_2$, the unit vector in the $y$ direction, by the angle $\theta$ brings us to $\smat{-\sin\theta \\ \cos\theta}$.  Hence the standard matrix for $T$ is
    \[
      \begin{pmatrix}
        \cos\theta & -\sin\theta \\
        \sin\theta & \cos\theta \\
      \end{pmatrix}
    \]
 \end{example*}

\end{document}
