\documentclass[11pt]{article}

\usepackage{systeme}

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
%\usepackage{palatino}

\usepackage{xcolor}

%\usepackage[textheight=8.5in, margin=1.6in]{geometry}
\usepackage[total={6in,8in}]{geometry}

\usepackage{tikz}
%\usepackage{pgfplots}
%\tikzstyle{ball} = [circle,shading=ball, ball color=black,
%    minimum size=1mm,inner sep=1.3pt]
%\usetikzlibrary{arrows.meta}
%\tikzset{>={Latex[length=2mm,width=1.5mm]}}

%\usepackage{graphicx}

\usepackage{needspace}  % <-- to prevent bad pagebreak over environment titles
% Use:  \Needspace{3\baselineskip} before opening an environment

\usepackage{enumitem}
\setlist[enumerate]{leftmargin=*,label=(\alph*)}

%\usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=blue]{hyperref}

\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\sn}{\mathfrak{S}}
\newcommand{\ve}{\varepsilon}
\newcommand{\ips}[2]{\langle{#1}, {#2}\rangle}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\Span}{\mathrm{Span}}
\DeclareMathOperator{\rk}{\mathrm{rank}}
\DeclareMathOperator{\trace}{\mathrm{tr}}
\DeclareMathOperator{\im}{\mathrm{im}}
\DeclareMathOperator{\Sym}{\mathrm{Sym}}
\DeclareMathOperator{\Hom}{\mathrm{Hom}}
\DeclareMathOperator{\diag}{\mathrm{diag}}
\DeclareMathOperator{\glb}{\mathrm{glb}}
\DeclareMathOperator{\lub}{\mathrm{lub}}

\parskip = 0.05in
\parindent = 0.0in

%\pagestyle{empty}

\begin{document}
\centerline{Math 201 lecture for Monday, Week 5}
\bigskip

\centerline{\bf Linear transformations}
\medskip

\textbf{Linear transformations.}  We have now defined the objects of
study---vector spaces.  Next, we need to consider the appropriate mappings
between those objects---those that preserve the linear structure.  
\medskip

\textbf{Definition.} Let~$V$ and~$W$ be vector spaces over a field~$F$.  A
\emph{linear transformation} from~$V$ to~$W$ is a function
\[
f\colon V\to W
\]
satisfying, for all~$v,v'\in V$ and~$\lambda\in F$,
\[
  f(v+v')=f(v)+f(v')\quad\text{and}\quad f(\lambda v)=\lambda f(v).
\]

\textbf{Remarks.}  Using the notation from the definition:
\begin{itemize}
  \item  If~$f(v+v')=f(v)+f(v')$, we say~$f$ \emph{preserves addition}.  Note
    that the addition on the left side is in~$V$ and the addition on the right
    side is in~$W$.  Thus, if ~$V\neq W$, they are two different operations
    (with the same name).  Similarly, if~$f(\lambda v)=\lambda f(v)$, we say~$f$
    \emph{preserves scalar multiplication}.
  \item One may combine the two conditions, above, for linearity into one:
    for~$f$ to be linear, we require
    \[
      f(v+\lambda v')=f(v)+\lambda f(v')
    \]
    for all~$v,v'\in V$ and~$\lambda\in F$.
  \item Synonyms for ``linear transformation'' are: ``linear mapping'' and
    ``linear homomorphism'', often with the word ``linear'' dropped when clear
    from context (and it will be since this is a course in linear algebra!).
  \item Our book restricts ``linear transformation'' to mean a linear
    transformation of the form $f\colon V\to V$, where the domain and codomain
    are equal.  That is non-standard, and we won't use that terminology.  Linear
    mappings from a vector space to itself are called linear \emph{endomorphisms}
    or linear \emph{self-mappings}.
\end{itemize}

\emph{Template for a proof that a mapping is linear.}  Consider the function
\begin{align*}
  f\colon \R^3&\to\R^2\\
  (x,y,z)&\mapsto (2x+3y,x+y-3z).
\end{align*}
Claim:~$f$ is linear.

\begin{proof}
  Let~$(x,y,z),(x',y',z')\in\R^3$ and~$\lambda\in R$.
  \begin{align*}
    f( (x,y,z)+(x',y',z'))
    &=f(x+x',y+ y',z+ z')\\
    &=( 2(x+ x')+3(y+ y'),(x+ x')+(y+ y')-3(z+ z'))\\
    &=( (2x+3y)+(2x'+3y'),(x+y-3z)+(x'+y'-3z'))\\
    &=(2x+3y,x+y-3z)+(2x'+3y',x'+y'-3z')\\
    &=f(x,y,z)+ f(x',y',z').
  \end{align*}
  Thus,~$f$ preserves addition.  Next,
  \begin{align*}
    f(\lambda(x,y,z))
    &=f(\lambda x,\lambda y,\lambda z)\\
  &=(2(\lambda x)+3(\lambda y),(\lambda x+\lambda y-(3\lambda z))))\\
  &=(\lambda(2x+3y),\lambda(x+y-3z))\\
  &=\lambda(2x+3y,x+y-3z)\\
  &=\lambda f(x,y,z).
  \end{align*}
  Thus,~$f$ preserves scalar multiplication.
\end{proof}

\textbf{Note:} People sometimes confuse proofs that subsets are subspaces with
proofs that mappings are linear.  To prove that~$W\subseteq V$ is a subspace, we
show that~$W$ is \emph{closed under} addition and scalar multiplication by
taking~$u,v\in W$ and~$\lambda\in F$ and showing~$u+\lambda v\in W$.  To
prove~$f\colon V\to W$ is linear, we show that~$f$ \emph{preserves} addition and
scalar multiplication.  Be careful not to confuse the words ``closed under'' 
with ``preserves''.
\medskip

\textbf{Example.}  Rotation about the origin in the plane $\R^{2}$ is a linear transformation:
\begin{center}
  \begin{tikzpicture}
    \begin{scope}
      \draw[->] (-2,0)--(3,0);
      \draw[->] (0,-1)--(0,3);
      \draw[->,thick,cyan] (0,0)--(2,1) node[below right] {$u$};
      \draw[->,thick] (0,0)--(0.5,2) node[left] {$v$};
      \draw[densely dashed,opacity=0.8] (2,1)--(2.5,3);
      \draw[densely dashed,cyan,opacity=0.8] (0.5,2)--(2.5,3);
      \draw[-stealth] (0,0)--(2.5,3) node[midway,above,rotate=49] {$u+v$};
    \end{scope}
    \draw (3.8cm,1.7) edge[->,bend left=10] (5cm,1.7);
    \begin{scope}[xshift=9cm]
      \draw[->] (-2,0)--(3,0);
      \draw[->] (0,-1)--(0,3);
      \begin{scope}[rotate=90]
        \draw[->,thick,cyan] (0,0)--(2,1) node[right] {};
	\draw[->,thick] (0,0)--(0.5,2) node[left] {};
	\draw[densely dashed,thick,opacity=0.8] (2,1)--(2.5,3);
	\draw[densely dashed,thick,cyan,opacity=0.8] (0.5,2)--(2.5,3);
	\draw[-stealth] (0,0)--(2.5,3) node[midway,above,rotate=-40] {};
      \end{scope}
    \end{scope}
  \end{tikzpicture}
\end{center}

{\sc Exercise.}  Show that~$f\colon\R\to\R$ defined by $f(x)=x^2$ is not linear.
\smallskip

\textbf{Proof.} We have~$f(1+1)=f(2)=4\neq f(1)+f(1)=1+1=2$.
\hfill$\Box$

The following proposition is often useful for showing a function is not linear.
\medskip

\textbf{Proposition 1.} If~$f\colon V\to W$ is linear,
then~$f(\vec{0}_V)=\vec{0}_W$.
\smallskip

{\sc Proof.} Since~$f$ is linear,
\[
  f(\vec{0}_V)=f(0\cdot\vec{0}_V)=0\cdot f(\vec{0}_V)=\vec{0}_W.
\]

Thus, for instance,
\begin{align*}
  f\colon \R^2&\to \R\\
  (x,y)&\mapsto x+2y+5
\end{align*}
is not linear since~$f(0,0)=5\neq 0$.
\medskip

\textbf{Proposition 2.} (A linear mapping is determined by its action on a basis.)
Let~$V$ and~$W$ be vector spaces over~$F$, and let~$B$ be a basis for~$V$. For
each~$b\in B$, let~$w_b\in W$.  Then there exists a unique linear
function~$f\colon V\to W$ such that~$f(b)=w_b$.
\smallskip

\textbf{Proof.} We define~$f$ as follows: Given~$v\in V$, since~$B$ is a basis, we
can write~$v=\alpha_1b_1+\dots+\alpha_k b_k$ for some~$\alpha_i\in F$, $b_i\in B$,
and~$k\in\Z_{\geq0}$.  Define
\[
  f(v):= \alpha_1f(b_1)+\dots \alpha_k f(b_k)=\alpha_1w_{b_1}+\cdots+\alpha_kw_{b_k}.
\]
Since~$B$ is a basis, the expression for~$v$ as a linear combination of elements
in~$B$ is unique.  Hence,~$f$ is well-defined. Further, linearity of~$f$ forces
us to define~$f(v)$ as we have. To see that~$f$ is linear, let $v,w\in V$ and
$\lambda\in\R$.  Write~$v$ and~$w$ as linear combinations of the basis vectors: 
\begin{align*}
v&=\alpha_1b_1+\dots+\alpha_k b_k\\
w&=\beta_1b_1+\dots+\beta_k b_k
\end{align*}
for some scalars~$\alpha_i$ and~$\beta_i$.  It follows that
\[
  v+\lambda w = 
  (\alpha_1+\lambda \beta_1)b_1+\dots+(\alpha_k+\lambda\beta_k) b_k.
\]
Using the definition of $f$, we see
\begin{align*}
  f(v+\lambda
  w)&=(\alpha_1+\lambda\beta_1)w_{b_1}+\cdots+(\alpha_k+\lambda\beta_k)w_{b_k}\\
    &=(\alpha_1 w_{b_1}+\cdots+\alpha_k w_{b_k})+
  \lambda(\beta_1 w_{b_1}+\cdots+\beta_k w_{b_k})\\
    &=f(v)+\lambda f(w).
\end{align*}
\hfill$\Box$

\textbf{Terminology.} We say the function~$f$ as in Proposition~2 has been defined
on~$B$ then \emph{extended linearly} to all of~$V$.
\medskip

\textbf{Example.} Define a linear function $f\colon\R^{2}\to M_{2\times 3}(\R)$
by
\[
  f(1,0)=
  \left(\begin{array}{ccc}
  1 & 0 & 2 \\
3 & -1 & 2
  \end{array}\right)
  \quad\text{and}\quad
  f(0,1)=
  \left(\begin{array}{ccc}
  2 & 1 & 0 \\
0 & 3 & 1
  \end{array}\right).
\]
What is~$f(2,-1)$?
\smallskip

\emph{Solution.} In general, we have
\begin{align*}
  f(x,y)&=f\left(x(1,0)+y(0,1)\right)\\
	&=xf(1,0)+yf(0,1)\\
	&=x
  \left(\begin{array}{ccc}
  1 & 0 & 2 \\
3 & -1 & 2
  \end{array}\right)
  +
  y
  \left(\begin{array}{ccc}
  2 & 1 & 0 \\
0 & 3 & 1
  \end{array}\right)\\[8pt]
  &=
  \left(\begin{array}{ccc}
  x+2y & y & 2x \\
3x & -x+3y &2x+y 
  \end{array}\right).
\end{align*}
In particular,
\[
  f(2,-1) = 
  2
  \left(\begin{array}{ccc}
  1 & 0 & 2 \\
3 & -1 & 2
  \end{array}\right)
  -
  \left(\begin{array}{ccc}
  2 & 1 & 0 \\
0 & 3 & 1
  \end{array}\right)
  =
  \left(\begin{array}{ccc}
  0 & -1 & 4 \\
 6&-5  & 3
  \end{array}\right).
\]

\textbf{Question.}  What goes wrong if we try to define a linear function by
specifying its values on a non-basis?  For instance, what happens if we try to
define a linear function $f\colon \R^{2}\to\R^{2}$ by specifying the values for
the non-basis $\left\{(1,0),(2,0)\right\}$ as follows:
\[
  f(1,0) = (3,2)\quad\text{and}\quad f(2,0)=(1,1).
\]

\textbf{Note.}  Let~$V$ and~$W$ be vector spaces over~$F$, and let~$X$ be a
linearly subset of~$V$.  For each~$x\in X$, let~$w_x\in W$.  Then there exists a
linear function~$f\colon V\to W$ such that~$f(x)=w_x$ for all $x\in W$.  To see
this, let~$B$ be any completion of~$X$ to a basis for $V$, and apply
Proposition~2.  The map created this way is not unique: we are free to choose
any values for elements of $B\setminus X$ (the value~$\vec{0}$ might be a
natural choice).
\medskip

Here is something interesting that we will talk more about later:
\smallskip

\textbf{Definition.}  Let~$V$ and~$W$ be vector spaces over~$F$.  The collection
of all linear functions from~$V$ to~$W$ is denoted~$\Hom(V,W)$
or~$\mathcal{L}(V,W)$.  It is a vector space over~$F$ under addition and scalar
multiplication of functions: for linear~$f,g\colon V\to W$,
\begin{align*}
  f+\lambda g\colon V&\to W\\
  v&\mapsto f(v)+\lambda g(v).
\end{align*}
\end{document}
