\documentclass[11pt]{article}

\usepackage{systeme}

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

\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 Wednesday, Week 5}
\bigskip

\centerline{\bf Range and nullspace}
\medskip

Recall the definition of a linear function from last time: a function~$f\colon
V\to W$ between vectors spaces~$V$ and~$W$ over the (same) field~$F$ is a
function~$f\colon V\to W$ that preserves addition and scalar multiplication.  In
detail, this means that for all~$u,v\in V$ and~$\lambda\in F$,
\[
  f(u+v)=f(u)+f(v)\quad\text{ and }\quad f(\lambda v)=\lambda f(v).
\]
\medskip

\textbf{Definition/Proposition 1.} Suppose~$f\colon V\to W$ is linear and~$U\subseteq V$ is a
subspace of~$V$.  Then the {\em image of~$U$ under~$f$} is the set
\[
  f(U) := \left\{ f(u): u\in U \right\}\subseteq W.
\]
The image of~$U$ under~$f$ is a subspace of~$W$.

\begin{proof}
  Since~$U$ is a subspace of~$V$, it follows that~$0_V\in U$, and
  hence, $f(0_V)=0_W\in f(U)$.  Thus,~$f(U)$ is nonempty. Next, let~$x,y\in f(U)$,
  and let~$\lambda\in F$.  By definition of~$f(U)$, there are vectors~$u,v\in U$
  such that~$f(u)=x$ and~$f(v)=y$.  Then since~$f$ is linear, is preserves
  addition and scalar multiplication.  Therefore, 
  \begin{align*}
    x+\lambda y&=f(u)+\lambda f(v)\\
    &=f(u)+f(\lambda v)\\
    &=f(u+\lambda v).
  \end{align*}
  Since~$U$ is a subspace, it is closed under addition and scalar multiplication.
  Therefore,~$u+\lambda v\in U$.  It follows that~$x+\lambda y=f(u+\lambda v)\in f(U)$, as
  required.
\end{proof}

In particular, since~$V$ is a subspace of itself, its image under a
linear function is a subspace of the codomain of the function.
\medskip

\textbf{Definition.} The {\em image} or~{\em range} of a linear function~$f\colon
V\to W$ is the subspace
\[
 \im(f):= \mathcal{R}(f):=f(V):=\left\{ f(v): v\in V
  \right\}\subseteq W.
\]
The dimension of the image of~$f$ is the {\em rank} of~$f$ (provided it is
finite-dimensional) and is denoted~$\rk(f)$ or~$\mathrm{rk}(f)$. 
\medskip

\textbf{Example.} Define a linear function~$f\colon\R^2\to\R^3$ by
letting~$f(1,0)=(2,1,0)$ and~$f(0,1)=(0,-1,1)$ and extending linearly.  Thus,
for all~$x,y\in\R$,
\begin{align*}
  f(x,y)&=f(x(1,0)+y(0,1))\\
  &=x f(1,0)+ y f(0,1)\\
  &= x(2,1,0)+y(0,-1,1).
\end{align*}
We have
\[
  \im(f)=\mathcal{R}(f)=\Span\left\{ (2,1,0),(0,-1,1) \right\}.
\]
Since~$(2,1,0)$ and~$(0,-1,1)$ are linearly independent and span the image, they
are a basis for the image of~$f$, and thus, $\rk(f)=2$.
\medskip

\textbf{Remark.} If~$f\colon V\to W$ is a linear function, and~$B=\left\{
b_1,\dots,b_n \right\}$ is a basis for~$V$, then 
\[
  \im(f)=\Span(f(B)):=\Span\left\{ f(b_1),\dots,f(b_n) \right\}
\]
since~$f(\sum_{i=1}^{n}\alpha_i b_i)=\sum_{i=1}^{n}\alpha_if(b_i)$.
However,~$f(B)$ is not necessarily a basis for~$\im(f)$.
\medskip

\textbf{Definition/Proposition 2.} Let~$f\colon V\to W$ be a linear mapping, and
let~$U$ be a subspace of~$W$.  Then the {\em inverse image of~$U$ under~$f$} is
the set
\[
  f^{-1}(U):=\left\{ v\in V: f(v)\in U \right\}\subseteq V.
\]
The inverse image of~$U$ under~$f$ is a subspace of~$V$.

\begin{proof}
  Since~$U$ is a subspace of~$W$, we know~$0_W\in U$.  Then,
  since~$f(0_V)=0_W$, it follows that~$0_V\in f^{-1}(U)$.  So~$f^{-1}(U)$ is
  nonempty.  Next, let~$v,v'\in f^{-1}(U)$, and let~$\lambda\in F$.  It follows
  that~$f(v)\in U$ and~$f(v')\in U$.  Since~$U$ is a subspace, it follows
  that~$f(v)+\lambda f(v')\in U$.  Since~$f$ is linear,
  \[
    f(v+\lambda v')=f(v)+\lambda f(v')\in U.
  \]
  It follows that~$v+\lambda v'\in f^{-1}(U)$.
\end{proof}

\textbf{Definition.} Let~$f\colon V\to W$ be a linear mapping. The
{\em kernel} or {\em nullspace} of~$f$, denoted~$\ker f$ or~$\mathcal{N}(f)$,
respectively, is the inverse image of~$\{0_W\}$:
\[
  \ker(f):=\mathcal{N}(f):=f^{-1}(\left\{0_W\right\}):=\left\{ v\in V: f(v)=0 \right\}.
\]
It is a subspace of~$V$ (by Proposition 2).  The dimension of the kernel is
called the {\em nullity} of~$f$ (provided it is finite-dimensional) and is
denoted~$\mathrm{nullity}(f)$.
\medskip

\textbf{Example.} Consider the linear mapping
\begin{align*}
  f\colon\R^2&\to\R^3\\
  (x,y)&\mapsto (2x,x-y,y).
\end{align*}
To find the kernel of~$f$, we look for vectors~$(x,y)$ such
that
\[
  f(x,y)=(2x,x-y,y)=(0,0,0).
\]
Comparing vector components, we see that~$x=y=0$ is the only possibility.
Therefore,
\[
  \ker(f)=\left\{ (0,0) \right\},
\]
and~$\mathrm{nullity}(f)=0$.
\medskip

\textbf{Example.} Let~~$\R[x]_{\leq 2}$ denote polynomials in~$x$ of degree at most
two and with real
coefficients. Consider the linear mapping
\begin{align*}
  f\colon \R[x]_{\leq 2}&\xrightarrow{\hphantom{\ \ \ \ \ }}\R^2\\
  \ \quad a+bx+cx^2&\mapsto (a+b,a+c).
\end{align*}
To find the kernel of~$f$, we need to find~$a,b,c$ such
that~$f(a+bx+cx^2)=(0,0)$.  This amounts to solving the system of equations
\begin{align*}
  a+b&=0\\
  a+c&=0.
\end{align*}
Apply our algorithm:
\begin{equation}\label{eqn:05wed1}
  \left(\begin{array}{ccc|c}
       1&1&0&0\\
       1&0&1&0
   \end{array} \right)
   \rightsquigarrow
   \left(\begin{array}{rrr|r}
       1&0&1&0\\
       0&1&-1&0
   \end{array} \right).\tag{$\star$}
\end{equation}
Solving for the pivot variables, we get
\begin{align*}
  a&=-c\\
  b&=c.
\end{align*}
Therefore,
\[
  \ker(f)=\left\{ -c+cx+cx^2: c\in\R \right\}=\Span\left\{ -1+x+x^2 \right\}.
\]
Therefore, the nullity of~$f$ is~$\dim(\ker(f)=1$.  A basis for~$\R[x]_{\leq 2}$
is the set~$\left\{ 1,x,x^2 \right\}$, and the image of these vectors forms a
basis for the image of~$f$:
\[
  f(1) = (1,1),\quad f(x)=(1,0),\quad f(x^2)=(0,1).
\]
So the image of~$f$ is the column space of the matrix for the linear system we
solved to find the kernel (cf.\ Equation~\eqref{eqn:05wed1}).  Using our algorithm
for finding the basis of the column space, we get the basis
$\left\{(1,1),(1,0)\right\}$.  Another basis is~$\left\{ (1,0), (0,1) \right\}$.
Therefore, the rank of~$f$ is~$\rk(f)=2$.
\smallskip

Our main goal next time will to prove the following: 
\medskip

\textbf{Theorem.} (Rank-nullity theorem) Let~$f\colon V\to W$ be a linear mapping,
and suppose that~$V$ is finite-dimensional.  Then
\[
  \rk(f)+\mathrm{nullity}(f)=\dim V.
\]
In other words, $\dim(\im(f))+\dim(\ker(f))=\dim V$.
\medskip

\textbf{Example.}  In the previous example, we found
\[
  \rk(f)+\mathrm{nullity}(f)=2+1=3=\dim \R[x]_{\leq2}.
\]
\end{document}
