\documentclass{article}
\usepackage{amsmath}
\newcommand{\myline}{\vspace{-0.2in}\begin{center}\underline{\hspace{3in}}\end{center}}
\newcommand{\R}{\mathbf{R}}
\newcommand{\basis}[1]{\{#1\}}
\newcommand{\suchthat}{\,\,\vert\,\,}
\setlength{\parindent}{0in}
\setlength{\parskip}{0.04in}
\setlength{\topmargin}{-0.5in}
\addtolength{\textheight}{1.2in}
\addtolength{\textwidth}{1in}
\addtolength{\oddsidemargin}{-0.5in}
\begin{document}

\begin{center}
\textbf{Mathematics 468} \\
\textbf{Linear algebra primer}
\end{center}

(I will use the words ``point'' and ``vector'' interchangeably to
refer to elements of $\R^{n}$.)

\textbf{Definition}.  A \emph{vector subspace} of $\R^{n}$ is a
set $V$ of points of $\R^{n}$ so that
\begin{itemize}
\item For all $\vec{v}_{1}$ and $\vec{v}_{2}$ in $V$, $\vec{v}_{1} +
\vec{v}_{2}$ is in $V$ (``vector addition''), and
\item For all $\vec{v} \in V$ and $c \in \R$, $c\vec{v}$ is in $V$
(``scalar multiplication'').
\end{itemize}
These conditions imply that $V$ contains the origin $\vec{0}$, for
example.

\textbf{Examples}.  Any line through the origin is a vector subspace
of $\R^{n}$, as is any plane through the origin, etc.

\textbf{Theorem}.  $V$ is a vector subspace of $\R^{n}$ if and only
if there are vectors $\vec{v}_{1}$, \dots, $\vec{v}_{k}$ in $\R^{n}$ so that 
\[
V = \{c_{1}\vec{v}_{1} + \dots + c_{k}\vec{v}_{k} \suchthat c_{i} \in \R \}.
\]

The sum $c_{1} \vec{v}_{1} + \dots + c_{k} \vec{v}_{k}$ is called a
\emph{linear combination} of the vectors $\vec{v}_{1}$, \dots,
$\vec{v}_{k}$.

\textbf{Examples}. 
\begin{itemize}
\item If $\vec{v}_{1}$ is any nonzero vector, then the set $\{c_{1}
\vec{v}_{1} \suchthat c_{1} \in \R\}$ is the set of all scalar multiples of
$\vec{v}_{1}$: all points on the line in the $\vec{v}_{1}$ direction
through the origin.
\item If $\vec{v}_{1}$ and $\vec{v}_{2}$ are two vectors that don't
point in the same direction (i.e., if neither one is a scalar multiple
of the other), then the set $\{c_{1}\vec{v}_{1} + c_{2}\vec{v}_{2} \suchthat
c_{1}, c_{2} \in \R\}$ is the plane determined by $\vec{v}_{1}$ and
$\vec{v}_{2}$.
\item If $\vec{v}_{1} = (1,0,0)$ and $\vec{v}_{2} = (0,0,1)$, then
\[
\{c_{1} \vec{v}_{1} + c_{2} \vec{v}_{2} \suchthat c_{i} \in \R \} =
\{(c_{1}, 0, c_{2}) \suchthat c_{i} \in \R \}
\]
is the $xz$-plane.
\end{itemize}

\textbf{Definition}.  If $V = \{c_{1} \vec{v}_{1} + \dots + c_{k}
\vec{v}_{k} \}$, then we say that $V$ is \emph{spanned} by the vectors
$\vec{v}_{1}$, \dots, $\vec{v}_{k}$.  If $V$ can be spanned by $k$
vectors but not by fewer than $k$, then $V$ has \emph{dimension} $k$.

\textbf{Examples}.  The dimension of a line is one.  The dimension of
a plane is two.  The $xz$-plane in $\R^{3}$ is spanned by the vectors 
\[
(1, 0, 0), (0, 0, 1), (1, 0, 2),
\]
and also by the vectors 
\[
(1, 0, 0), (0, 0, 1).
\]
It can't be spanned by fewer than two vectors, so its dimension is
two.

\textbf{Definition}.  Let $V$ be a vector subspace of $\R^{n}$, of
dimension $k$.  A \emph{basis} for $V$ is any set of $k$ vectors which
spans $V$.  If $\basis{\vec{v}_{1}, \dots, \vec{v}_{k}}$ is a basis
for $V$, then every vector in $V$ can be written uniquely as a linear
combination of the $\vec{v}_{i}$'s.

\textbf{Examples}.  Consider the line in $\R^{2}$ through the origin
with slope $2$.  It is one-dimensional, so any single vector that
spans it will form a basis.  Here are several bases:
\[
\basis{(1,2)}, \  \basis{(2,4)}, \  \basis{(-1,-2)}, \ \basis{(\pi, 2\pi)}.
\]
For instance, every point on the line can be written in the form $(t
\pi, 2 t \pi)$ for some number $t$.  Any two of the vectors $(1,0,0)$,
$(0,0,1)$, $(1,0,2)$ form a basis for the $xz$-plane.

\myline 

\textbf{Definition}.  Given two vector spaces $V$ and $W$, a function
$f: V \rightarrow W$ is \emph{linear} if
\begin{itemize}
\item $f(\vec{v}_{1} + \vec{v}_{2}) = f(\vec{v}_{1}) +
f(\vec{v}_{2})$, and
\item $f(c \vec{v}_{1}) = c f(\vec{v}_{1})$, for all vectors
$\vec{v}_{1}, \vec{v}_{2} \in V$ and all scalars $c \in \R$.
\end{itemize}

\textbf{Example}.  If $V=\R^{n}$ and $W=R^{k}$, then a good example of
a linear function is multiplication by a $k \times n$ matrix $A$: if I
write an element $\vec{v}$ of $V$ as an $n$-dimensional column vector
$\vec{v} = \begin{bmatrix} a_{1} \\ \vdots \\ a_{n} \end{bmatrix}$,
then $A \vec{v}$ is a $k$-dimensional column vector.  It is pretty
easy to check that this defines a linear function.

This example says that every matrix determines a linear function; to
some extent, the converse is true.  Given vector spaces $V$ and $W$
with $\dim V = n$ and $\dim W = k$, and given a linear function $f : V
\rightarrow W$, then choosing bases for $V$ and for $W$ lets me find a
matrix corresponding to $f$.  Choosing different bases will, in
general, result in a different matrix.  (This is why it's best to
think of linear functions as linear functions, and not as determined
by matrices.)

In detail: if $\basis{\vec{v}_{1}, \dots \vec{v}_{n}}$ is a basis for
$V$, then for each $j$, $f(\vec{v}_{j})$ is a vector in $W$.  If
$\basis{\vec{w}_{1}, \dots, \vec{w}_{k}}$ is a basis for $W$, then
$f(\vec{v}_{j})$ can be expressed uniquely as a linear combination of
the vectors $\vec{w}_{i}$: write
\[
f(\vec{v}_{j}) = a_{1j} \vec{w}_{1} + \dots + a_{kj} \vec{w}_{k}.
\]
Then the function $f$ corresponds to the matrix $A$ with $(i,j)$-entry
$a_{ij}$.  $f$ sends the vector $\vec{v}_{j}$ to the ``$j$th column of
$A$'', and it sends a linear combination of the $\vec{v}_{j}$'s to a
linear combination of the columns of $A$.

\textbf{Example}. Let $V$ be the line of slope 2 through the origin in
$\R^{2}$: all points of the form $(t,2t)$.  Let $W$ be the real line.
Define $f:V \rightarrow W$ by $f(t,2t) = t$ (take a point on the line
$V$ and send it to the point on $W$ with the same $x$-coordinate).  If
I want to write this as a matrix, I have to choose bases for $V$ and
$W$.  Depending on this choice, I'll get a different matrix:
\begin{itemize}
\item Basis for $V$: $\basis{(1,2)}$.  Basis for $W$: $\basis{1}$.
Then to find the matrix for $f$, I see where the basis for $V$ goes,
and write this in terms of the basis for $W$: $f(1,2) = 1$.  So the
matrix is $[1]$.  (The matrix in this case is $1 \times 1$, so it's
just a number.)
\item Basis for $V$: $\basis{(-1,-2)}$.  Basis for $W$: $\basis{1}$.
Then $f(-1,-2) = -1 = -1 (1)$.  So the matrix is $[-1]$.
\item Basis for $V$: $\basis{(2,4)}$.  Basis for $W$: $\basis{1}$.
Then $f(2,4) = 2 = 2 (1)$.  So the matrix is $[2]$.
\item Basis for $V$: $\basis{(2,4)}$.  Basis for $W$: $\basis{3}$.
Then $f(2,4) = 2 = \frac{2}{3} (3)$.  So the matrix is $[\frac{2}{3}]$.
\end{itemize}
These matrices all correspond to the same function, just parametrized
differently.  There is often no ``best'' way to choose bases for $V$
and $W$, so there is no canonical choice of a matrix to represent a
linear function.  So, as I said earlier, it is best to think of linear
functions as linear functions, not as matrices.

\myline 

\textbf{Definition}.  Given a linear function $f: V \rightarrow W$
\begin{itemize}
\item the \emph{null space} of $f$, also known as the \emph{kernel}
of $f$, is the set $\{\vec{v} \in V \suchthat f(\vec{v}) = \vec{0} \}$.  This
is a vector subspace of $V$.
\item The \emph{nullity} of $f$ is the dimension of the null space.
\item The \emph{image} of $f$ is the set $\{\vec{w} \in W \suchthat \vec{w} =
f(\vec{v}) \ \text{for some} \ \vec{v} \in V \}$.  This is a vector
subspace of $W$.
\item The \emph{rank} of $f$ is the dimension of the image.
\end{itemize}

\textbf{Theorem}. Given a linear function $f: V \rightarrow W$, 
$\text{rank}(f) + \text{nullity}(f) = \dim V$.

\textbf{Examples}. 
\begin{itemize}
\item If you define $f : \R^{n} \rightarrow \R^{k}$ as multiplication
by some $k \times n$ matrix $A$, then the dimension of $V$ is the
number of column of $A$.  You can figure out the rank of $A$ by
row-reducing $A$ to get a matrix in row-echelon form; then the rank is
the number of nonzero rows.  The nullity of $A$ is the difference
between these numbers.
\item Define $f: \R^{2} \rightarrow \R$ by $f(x,y) = 2x-y$.  Then the
image of $f$ is all of $\R$: for every $t \in \R$, I can easily find
$x$ and $y$ so that $2x-y=t$ (e.g., let $x=t/2$ and let $t=0$).  So
the rank of $f$ is one, the dimension of its image, $\R$.  By the
theorem, the nullity must be one.  Indeed, the null space of $A$ is
all points $(x,y)$ with $2x-y=0$, or all points $(x,y)$ with $2x=y$.
This is the line through the origin with slope 2, a one-dimensional
subspace of $\R^{2}$.
\item If I use the ``standard'' bases for $\R^{2}$ and
$\R$---$\basis{(1,0), (0,1)}$ and $\basis{1}$, respectively---then the
function $f$ that I just defined is given by the matrix
$\begin{bmatrix} 2 & -1 \end{bmatrix}$: $f$ sends $(1,0)$ to $2$ (the
first column of the matrix), and $f$ sends $(0,1)$ to $-1$ (the second
column).  This is already row-reduced, essentially, and has one
nonzero row, so has rank 1.
\end{itemize}

\myline 

\textbf{Theorem}.  Suppose $f: V \rightarrow W$ is a linear function,
with $\dim V = n$ and $\dim W = k$.
\begin{itemize}
\item [(a)] $\text{rank}(f)$ is no larger than either $n$ or $k$.
\item [(b)] $f$ is one-to-one (also known as ``injective'')
$\Leftrightarrow$ the kernel of $f$ equals $\{\vec{0}\}$
$\Leftrightarrow$ the nullity of $f$ is zero.
\item [(c)] $f$ is onto (also known as ``surjective'') $\Leftrightarrow$
the image of $f$ equals $W$  the rank of $f$ is $k$.
\item [(d)] $f$ is bijective $\Leftrightarrow$ $n=k=\text{rank}(f)$
$\Leftrightarrow$ $n=k$ and $\text{nullity}(f) = 0$.
\end{itemize}

If $f$ is a bijection, then there is an inverse function $g : W
\rightarrow V$; it turns out that if $f$ is linear, then so is $g$.
In this case, $f$ is called an \emph{isomorphism} (of vector spaces).
Two vector spaces $V$ and $W$ are \emph{isomorphic} if there is an
isomorphism from one to the other.

\textbf{Theorem}.  Two vector spaces $V$ and $W$ are isomorphic if and
only if they have the same dimension.  If $\dim V = \dim W$ = n, then $f:
V \rightarrow W$ is an isomorphism $\Leftrightarrow$ $\text{rank}(f) = n$
$\Leftrightarrow$ $\text{nullity}(f) = 0$.  

\textbf{Theorem}.  If $\dim V = \dim W = n$, then a linear function
$f$ from $V$ to $W$ can be represented by an $n \times n$ matrix $A$.
Then $f$ is an isomorphism $\Leftrightarrow$ the matrix $A$ is invertible
$\Leftrightarrow$ $\text{det} (A) \neq 0$.

So if the dimensions of $V$ and $W$ are equal, you can tell whether a
linear function is an isomorphism by computing a single number: the
determinant of the matrix $A$.

\end{document}



