\documentclass[10pt]{article}

\usepackage{systeme}

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

\usepackage{xcolor}
\usepackage{tcolorbox}

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

\usepackage{tikz}
\usetikzlibrary{cd}
\tikzset{
      labr/.style={anchor=north, rotate=90, inner sep=.7mm}
    }
\tikzset{
      labl/.style={anchor=south, rotate=90, inner sep=.7mm}
    }

%\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[shortlabels]{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{\PP}{\mathbb{P}}
\newcommand{\ve}{\varepsilon}
\newcommand{\ips}[2]{\langle{#1}, {#2}\rangle}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\Span}{\mathrm{Span}}
\DeclareMathOperator{\rk}{\mathrm{rank}}
\DeclareMathOperator{\rspace}{\mathrm{rowspace}}
\DeclareMathOperator{\cspace}{\mathrm{colspace}}
\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}

\allowdisplaybreaks

\begin{document}
\centerline{Math 201 lecture for Wednesday, Week 10}
\bigskip

\centerline{\textbf{Eigenspaces}}  
\bigskip
 
Before getting started, we make an observation which should have probably
already been mentioned:
\medskip

\textbf{Proposition.} Let~$A,B$ be~$n\times n$ matrices representing a linear
function $f\colon V\to V$ with respect to different bases. Then their
characteristic polynomials are the same: $p_A(x)=p_B(x)$.
\smallskip

\begin{proof}
  We have~$A=P^{-1}BP$ for some~$n\times n$ matrix~$P$.  Then
  \begin{align*}
    p_A(x)
    &=
    \det(A-x I_n)\\
    &=\det(P^{-1}BP-x I_n)\\
    &=\det(P^{-1}BP-xP^{-1}I_nP)\\
    &=\det(P^{-1}BP-P^{-1}(x I_n)P)\qquad(\text{$x$ is a scalar})\\
    &=\det(P^{-1}(B-xI_n)P)\\
    &=\det(P^{-1})\det(B-xI_n)\det(P)\\
    &=\det(B-xI_n).
  \end{align*}
  For the last step, recall that~$\det(P^{-1})=\det(P)^{-1}$, which follows from
    multiplicativity of the determinant:
    \[
      1=\det(I_n)=\det(P^{-1}P)=\det(P^{-1})\det(P).
  \]
\end{proof}

Thus, it makes sense to talk about the \textbf{characteristic polynomial of a linear
transformation}: it the characteristic polynomial of any matrix representing
the transformation.
\medskip

Last time, we discussed the following algorithm that determines whether a matrix is
diagonalizable and, if it is, shows how to diagonalize it. 
\bigskip

\textbf{Diagonalization Algorithm} 
Let~$A\in M_{n\times n}(F)$.
\begin{enumerate}
  \item Find the eigenvalues of~$A$ as the zeros of its characteristic
    polynomial,~$p_A(x)=\det(A-x I_n)$.
  \item For each eigenvalue~$\lambda$, compute a basis for the
    eigenspace~$E_{\lambda}=\ker(A-\lambda I_n)$.
  \item\label{10mon3} \textbf{The matrix~$A$ is diagonalizable if and only if of the total number of
    eigenvectors in the bases found in the previous step is~$n$.} In other
    words,~$A$ is diagonalizable if and only if~$\sum_{\lambda}\dim
    E_{\lambda}=n$  where the sum is over all eigenvalues~$\lambda$ of~$A$.  If
    so, then the union of these vectors is a basis for~$F^n$.  Create a
    matrix~$P$ whose columns are these vectors. Then~$P^{-1}AP=D$, where~$D$ is
    a diagonal matrix with the eigenvalues along the diagonal, and we get a
    corresponding commutative diagram:
\begin{center}
\begin{tikzpicture}
  \node at (0,0) {
\begin{tikzcd}
  F^n\arrow[d,swap, "P^{-1}","\sim" labr]\arrow[r,"A"]&
  F^n\arrow[d,"P^{-1}","\sim" labl]\\
  F^n\arrow[r,"D"]&F^n.
\end{tikzcd}
};
\end{tikzpicture}
\end{center}
The matrix~$P^{-1}$, considered as a linear function, takes coordinates with respect to the basis
of eigenvalues.
\end{enumerate}

As mentioned last time, Step~\ref{10mon3} of the diagonalization algorithm
depends on the fact that eigenvectors with distinct eigenvalues are linearly
independent. (Thus, when we combine the bases for all of the eigenspaces, we end
up with a linearly independent set.)  We now prove this.
\medskip

\textbf{Proposition.} Let~$V$ be any vector space, and let~$f\colon V\to V$ be a
linear transformation. Let $v_1,\dots,v_k\in V$ be eigenvectors for~$f$ with
corresponding eigenvalues~$\lambda_i$:
\[
  f(v_i)=\lambda_iv_i
\]
for~$i=1,\dots,k$.  Suppose~$\lambda_1,\dots,\lambda_k$ are {\em distinct}.
Then~$v_1,\dots,v_k$ are linearly independent.
\smallskip

\begin{proof}
  We will prove this by induction on~$k$.  The case~$k=1$ is OK since, by
  definition, an eigenvector is a nonzero vector.  Suppose~$v_1,\dots,v_{k-1}$ are
  linearly independent for some~$k>1$ and that
  \[
    a_1v_1+\dots+a_kv_k=0
  \]
  for some~$a_i\in F$. Let $\mathrm{id}_V$ be the identity transformation defined
  by~$\mathrm{id}_V(v)=v$ for all~$v\in V$.  Apply the linear transformation~$f-\lambda_k\mathrm{id}_V$
  to the above dependence relation to get
  \begin{align*}
    &(f-\lambda_k\mathrm{id}_V)(a_1v_1+\dots+a_kv_k)=(f-\lambda_k\mathrm{id}_V)(0)=0\\[5pt]
    &\Rightarrow\qquad f(a_1v_1+\dots+a_kv_k)-\lambda_k\mathrm{id}_V(a_1v_1+\dots+a_kv_k)=0\\
    &\Rightarrow\qquad (a_1\lambda_1v_1+\dots+a_k\lambda_kv_k)-(a_1\lambda_kv_1+\dots+a_k\lambda_kv_k)=0\\
    &\Rightarrow\qquad
    a_1(\lambda_1-\lambda_k)v_1+\dots+a_{k-1}(\lambda_{k-1}-\lambda_{k})v_{k-1}+
    a_{k}(\lambda_{k}-\lambda_{k})v_{k}=0\\
    &\Rightarrow\qquad
    a_1(\lambda_1-\lambda_k)v_1+\dots+a_{k-1}(\lambda_{k-1}-\lambda_{k})v_{k-1}=0
  \end{align*}
  Since~$v_1,\dots,v_{k-1}$ are linearly independent, all the coefficients are
  zero:
  \[
    a_1(\lambda_1-\lambda_k)=\dots=a_{k-1}(\lambda_{k-1}-\lambda_{k})=0.\\
  \]
  Since the~$\lambda_i$ are distinct, this implies~$a_1=\dots=a_{k-1}=0$.
  Therefore, the original equation,~$a_1v_1+\dots+a_k v_k=0$ becomes~$a_kv_k=0$.
  Since~$v_k$ is an eigenvector, it is nonzero.  Hence,~$a_k=0$, as well.  
\end{proof}

\textbf{Corollary.} Suppose~$\dim V=n$ and~$f\colon V\to V$ is a linear
transformation.  Then if~$f$ has~$n$ distinct eigenvalues, it is diagonalizable.
\smallskip

\begin{proof} Each eigenvalue has at least one corresponding eigenvector.  From
  the above proposition, if~$f$ has~$n$ distinct eigenvalues, then it has~$n$
  linearly independent eigenvectors.  Since~$V$ has dimension~$n$, these
  eigenvectors form a basis for~$V$. Let~$\alpha$ be an ordered basis consisting
  of those eigenvectors.  Then~$[f]_{\alpha}^{\alpha}$ is diagonal.
\end{proof}

\textbf{Remark.} The Proposition implies that the union of bases for the
eigenspaces of~$A$ forms a linearly independent sets.  For instance, for
convenience, suppose that~$A$ has three (distinct) eigenvalues~$\lambda_{1}$,
$\lambda_{2}$, and~$\lambda_{3}$, 
and suppose the corresponding eigenspaces have bases $\{u_1,\ldots,u_p\}$,
$\{v_1,\ldots,v_{q}\}$, and~$\{w_{1},\ldots,w_{r}\}$, respectively.
We would like to show that the union of these sets is linearly dependent.  So
suppose we have a relation
\[
 a_{1}u_{1}+\cdots+a_{p}u_{p}+b_{1}v_{1}+\cdots+b_{q}v_{q}+c_{1}w_{1}+\cdots+c_{r}w_{r}=0.
\]
Let~$u=\sum_{i=1}^{p} a_i u_i$, $v=\sum_{i=1}^{q} b_{i}v_{i}$, and
$w=\sum_{i=1}^{r} c_{i}w_{i}$.  Then we have~$u\in E_{\lambda_{1}}$, $v\in
E_{\lambda_{2}}$, and~$w\in E_{\lambda_{3}}$ and
\[
  u+v+w=0.
\]
By the Proposition, must have~$u=v=w=0$.  Otherwise, this relation would be a
nontrivial linear relation among eigenvectors with distinct eigenvalues.  (Note
that the only element of an eigenspace that is not an eigenvector is the zero
vector.)
\medskip

\textbf{Warning.} The converse to the corollary is not true.  For instance,
consider the identity function on~$F^n$.  Its matrix is~$I_n$, which is already
diagonal, and~$1$ is its only eigenvalue:
\[
p_{I_n}(x)=\det(I_n-xI_n)=\det\left( (1-x)I_n \right)=(1-x)^n\det(I_n)=(1-x)^n.
\]
So~$I_n$ is diagonalizable (in fact, it's already diagonal) even though its
eigenvalues are not distinct.
\bigskip

\centerline{\textsc{Cramer's rule}}
\medskip

\textbf{Definition.} Let~$A\in M_{n\times n}(F)$.
For~$i,j\in\left\{1,\ldots,n\right\}$, let~$A^{ij}\in M_{(n-1)\times (n-1)}(F)$
be the matrix formed by removing the $i$-th row and $j$-th column of~$A$.
The \emph{$i,j$-th minor} of~$A$ is $\det(A^{ij})$, and the \emph{$i,j$-th cofactor}
of $A$ is~$(-1)^{i+j}\det(A^{ij})$.  The \emph{adjugate} of~$A$ is the
matrix~$\mathrm{adj}(A)\in M_{n\times n}(F)$ with~$i,j$-th coordinate
\[
  \mathrm{adj}(A)_{ij}=(-1)^{i+j}\det(A^{ji}).
\]
(Note we are using~$A^{ji}$, not~$A^{ij}$.)
\medskip

\textbf{Theorem (Cramer's rule).} Let~$A\in M_{n\times n}(F)$ be an invertible
matrix, and let~$b\in F^{n}$.  Then the solution to the system of linear
equations~$Ax=b$ is given by
\[
  x_{j}=\frac{\det(M_j)}{\det(A)}
\]
for $j=1,\ldots,n$ where~$M_j\in M_{n\times n}(F)$ is the matrix formed by
replacing the~$j$-th column of~$A$ with~$b$.  
\medskip

\textbf{Corollary.} If~$A\in M_{n\times n}(F)$ is invertible, then
\[
  A^{-1}= \frac{1}{\det(A)}\mathrm{adj}(A)
\]
where~$\mathrm{adj}(A)$ is the \emph{adjugate} of~$A$, defined by
\medskip

\textbf{Corollary.} If~$A\in M_{n\times n}(F)$ is invertible and~$F=\R$
of~$F=\C$, then 
\begin{enumerate}
  \item the solution for the system of equations~$Ax=b$ is a continuous
function of the entries of~$A$ and~$b$, and
\item the entries of~$A^{-1}$ are continuous functions of the entries of~$A$.
\end{enumerate}
\begin{proof}
  The entries in the determinant of a matrix~$B$ are polynomials in the entries
  of~$B$.  A quotient~$f/g$ of polynomials~$f$ and~$g$ is a continuous
  function wherever~$g$ is nonzero.
\end{proof}

\textbf{Example.}  Consider the matrix
\[
  A = 
\left(\begin{array}{rrr}
3 & -1 & 6 \\
-7 & 1 & 2 \\
2 & 0 & 2
\end{array}\right).
\]
The adjugate of~$A$ is
\[
  \mathrm{adj}(A)=
  \left(\begin{array}{rrr}
2 & 2 & -8 \\
18 & -6 & -48 \\
-2 & -2 & -4
\end{array}\right).
\]
For instance, to find the $1,2$-entry of~$\mathrm{adj}(A)$ is
\[
  (-1)^{1+2}\det(A^{2,1})=(-1)^{3}
  \det
\left(\begin{array}{rr}
 -1 & 6 \\
 0 & 2
\end{array}\right)
=2.
\]
Using Cramer's rule to compute the inverse of~$A$, we get
\[
  A^{-1}=
  \frac{1}{\det(A)}\mathrm{adj}(A)
  =-\frac{1}{24}
  \left(\begin{array}{rrr}
2 & 2 & -8 \\
18 & -6 & -48 \\
-2 & -2 & -4
\end{array}\right)
=
\left(\begin{array}{rrr}
-\frac{1}{12} & -\frac{1}{12} & \frac{1}{3}\\[5pt]
-\frac{3}{4} & \frac{1}{4} & 2 \\[5pt]
\frac{1}{12} & \frac{1}{12} & \frac{1}{6}
\end{array}\right).
\]
\end{document}  
