\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{xcolor}

%\usepackage{systeme}

%\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]}}
\tikzset{->-/.style={decoration={markings, mark=at position #1 with
  {\arrow{>}}},postaction={decorate}}}
\usetikzlibrary{decorations.pathmorphing}    
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{arrows.meta,calc}
\usetikzlibrary{bending}
\usetikzlibrary{decorations.markings,shapes.geometric}

%\usepackage{graphicx}

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

\usepackage{enumitem}
%\setlist[enumerate]{leftmargin=*}

\allowdisplaybreaks

%\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{\W}{\mathbb{W}}
\newcommand{\sn}{\mathfrak{S}}
\newcommand{\ve}{\varepsilon}
\newcommand{\ips}[2]{\langle{#1}, {#2}\rangle}
\newcommand{\incid}{\mathcal{I}(P)}
\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}}
\DeclareMathOperator{\Pic}{\mathrm{Pic}}
\DeclareMathOperator{\Jac}{\mathrm{Jac}}
\DeclareMathOperator{\cok}{\mathrm{cok}}

\parskip = 0.05in
\parindent = 0.0in

%\pagestyle{empty}

\begin{document}
\centerline{Math 372 lecture for Friday, Week 10}
\bigskip

\centerline{\bf Quick introduction to Smith normal form}
\bigskip

These notes are intended as help with the homework due next Wednesday.  The
complete context for the material presented here will be presented over the next
couple of days.
\medskip

Let~$M$ be an~$m\times n$ matrix with integer coefficients, and consider the {\em
cokernel} of~$M$, defined by
\[
  \cok(M) := \Z^m/\im{M}.
\]
So the cokernel of~$M$ is the set of integer vectors~$(a_1,\dots,a_m)$ for which
we add vectors as usual, but such that any vector that is a column of~$M$ is
thought of as the zero vector.  
\medskip

{\bf Example.}  Let~$M=[5]$, a~$1\times 1$ matrix.  Then~$\cok(M)=\Z/5\Z$.
\medskip

{\bf Example.}  Let~$M=\diag(2,3)$, a~$2\times 2$ diagonal matrix.  Then
\begin{align*}
  \cok(M)=\Z^2/\Span\left\{ 
    \left(\begin{array}{c}
      2\\0
\end{array} \right),
\left(\begin{array}{c}
  0\\3
\end{array} \right)\right\}&\xrightarrow{\sim}\Z/2\Z\oplus\Z/3\Z\\
(a,b)&\mapsto(a\bmod 2,b\bmod 3).
\end{align*}
Setting~$(2,0)$ equal to~$(0,0)$ in~$\Z^2$, just means we can work
modulo~$2$ in the first coordinate.  Similarly, we can work modulo~$3$ in the
second coordinate.
\medskip

{\bf Example.} Let~$M=\diag(0,0,1,2,3)$.  Then
\begin{align*}
  \cok(M)
  \simeq \Z/0\Z\oplus\Z0\Z\oplus\Z/1\Z\oplus\Z/2\Z\oplus\Z/3\Z
  &\xrightarrow{\sim}\Z\oplus\Z\oplus\Z/2\Z\oplus\Z/3\Z\\
  (a,b,c,d,e)&\mapsto(a,b,d,e).
\end{align*}
Here, we use the fact that~$\Z/0\Z=\Z$ and~$\Z/1\Z=\{0\}$.  For instance,
in~$\cok(M)$, the third coordinate is always equivalent to~$0$ modulo~$1$,
hence, we can drop that coordinate in our isomorphism.
\medskip

{\bf Definition.} The {\em integer row (resp., column) operations} on an integer matrix
consist of the following:
\begin{enumerate}[itemsep=-2pt]
  \item swapping two rows (resp., columns);
  \item negating a row (resp., column);
  \item adding one row (resp., column) to a different row (resp., column).
\end{enumerate}

{\bf Claim.} By performing integer row and column operations, the
matrix~$M$ can be transformed into a diagonal matrix~$D$, i.e.,~$D_{ij}=0$
for~$i\neq j$.  To make the final form unique, one may insist that the diagonal
elements satisfy~$D_{i,i}|D_{i+1,i+1}$ for all~$i$.  Start with the
the identity matrix~$I_m$ and perform all of the same row operations
on~$I_m$ as used in the reduction of~$M$ to~$D$ to create a matrix~$U$.
Similarly, start with~$I_n$ and perform the same column operations on it as
used in the reduction of~$M$ to~$D$ to create a matrix~$V$.  Then
both~$U$ and~$V$ have inverses that are integer matrices
(equivalently,~$\det(U)=\pm1$ and~$\det(V)=\pm1$), and
\[
  UMV = D.
\]
Roughly, the algorithm for reduction to a diagonal matrix goes like this: Use
column operations to put the gcd of the elements in the first row into
the~$1,1$-position of the matrix.  Then use the first column to make the other
entries in the first row equal to~$0$.  Continuing, use row operations to put
the gcd of the first column into the~$1,1$-position,  Then use row operations to
make the other entries in the first column equal to~$0$.  By this time, you may
have put nonzero entries in the first row again.  Repeat.  Eventually, every
entry in the first row and column besides the~$1,1$-entry will be~$0$.  Proceed
inductively: now only use row and column operations not involving the first row
and column.
\medskip

{\bf Example.}  Let's figure out the structure of~$\Pic(G)$ for the graph
pictured below:
\begin{center}
  \begin{tikzpicture}
    \node[ball,label={below:$v_1$}] at (0,-1.732) (1) {};
    \node[ball,label={left:$v_2$}] at (-1,0) (2) {};
    \node[ball,label={right:$v_3$}] at (1,0) (3) {};
    \node[ball,label={above:$v_4$}] at (0,1.732) (4) {};
    \draw (1)--(2)--(3)--(1);
    \draw (3)--(4);
    \draw (2) to[bend right] (4);
    \draw (2) to[bend left] (4);
  \end{tikzpicture}
\end{center}

The Laplacian matrix is
\[
L=
\left(\begin{array}{rrrr}
    2&-1&-1&0\\
    -1&4&-1&-2\\
    -1&-1&3&-1\\
    0&-2&-1&3
\end{array} \right).
\]
Perform integer row and column operations to diagonalize~$L$:
\begin{align*}
\left(\begin{array}{rrrr}
    2&-1&-1&0\\
    -1&4&-1&-2\\
    -1&-1&3&-1\\
    0&-2&-1&3
\end{array} \right)
&\xrightarrow{c_1\to c_1+c_2}
\left(\begin{array}{rrrr}
    1&-1&-1&0\\
    3&4&-1&-2\\
    -2&-1&3&-1\\
    -2&-2&-1&3
\end{array} \right)\\[10pt]
&\xrightarrow[c_3\to c_3+c_1]{c_2\to c_2+c_1}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    3&7&2&-2\\
    -2&-3&1&-1\\
    -2&-4&-3&3
\end{array} \right)\\[10pt]
&\xrightarrow[r_3\to r_3+2r_1,r_4\to r_4+2r_1]{r_2\to r_2-3r_1}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    0&7&2&-2\\
    0&-3&1&-1\\
    0&-4&-3&3
\end{array} \right)\\[10pt]
&\xrightarrow{c_2\to c_2-3c_3}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    0&1&2&-2\\
    0&-6&1&-1\\
    0&5&-3&3
\end{array} \right)\\[10pt]
&\xrightarrow[c_4\to c_4+2c_2]{c_3\to c_3-2c_2}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    0&1&0&0\\
    0&-6&13&-13\\
    0&5&-13&13
\end{array} \right)\\[10pt]
&\xrightarrow[r_4\to r_4-5r_2]{r_3\to r_3+6r_2}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    0&1&0&0\\
    0&0&13&-13\\
    0&0&-13&13
\end{array} \right)\\[10pt]
&\xrightarrow{c_4\to c_4+c_3}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    0&1&0&0\\
    0&0&13&0\\
    0&0&-13&0\end{array} \right)\\[10pt]
&\xrightarrow{r_4\to r_4+r_3}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    0&1&0&0\\
    0&0&13&0\\
    0&0&0&0
\end{array} \right).
\end{align*}
Apply the row operations above to~$I_4$ to get~$U$ and apply the column
operations to~$I_4$ to get~$V$:
\begin{align*}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    0&1&0&0\\
    0&0&1&0\\
    0&0&0&1
\end{array} \right)
&\xrightarrow[r_3\to r_3+2r_1,r_4\to r_4+2r_1]{r_2\to r_2-3r_1}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    -3&1&0&0\\
    2&0&1&0\\
    2&0&0&1
\end{array} \right)\\[10pt]
&\xrightarrow[r_4\to r_4-5r_2]{r_3\to r_3+6r_2}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    -3&1&0&0\\
    -16&6&1&0\\
    17&-5&0&1
\end{array} \right)\\[10pt]
&\xrightarrow{r_4\to r_4+r_3}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    -3&1&0&0\\
    -16&6&1&0\\
    1&1&1&1
\end{array} \right)=U.
\end{align*}
\begin{align*}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    0&1&0&0\\
    0&0&1&0\\
    0&0&0&1
\end{array} \right)
&\xrightarrow{c_1\to c_1+c_2}
\left(\begin{array}{rrrr}
    1&0&0&0\\
    1&1&0&0\\
    0&0&1&0\\
    0&0&0&1
\end{array} \right)\\[10pt]
&\xrightarrow[c_3\to c_3+c_1]{c_2\to c_2+c_1}
\left(\begin{array}{rrrr}
    1&1&1&0\\
    1&2&1&0\\
    0&0&1&0\\
    0&0&0&1
\end{array} \right)\\[10pt]
&\xrightarrow{c_2\to c_2-3c_3}
\left(\begin{array}{rrrr}
    1&-2&1&0\\
    1&-1&1&0\\
    0&-3&1&0\\
    0&0&0&1
\end{array} \right)\\[10pt]
&\xrightarrow[c_4\to c_4+2c_2]{c_3\to c_3-2c_2}
\left(\begin{array}{rrrr}
    1&-2&5&-4\\
    1&-1&3&-2\\
    0&-3&7&-6\\
    0&0&0&1
\end{array} \right)\\[10pt]
&\xrightarrow{c_4\to c_4+c_3}
\left(\begin{array}{rrrr}
    1&-2&5&1\\
    1&-1&3&1\\
    0&-3&7&1\\
    0&0&0&1
\end{array} \right)=V.
\end{align*}
We then have
\begin{align*}
ULV&= 
\left(\begin{array}{rrrr}
    1&0&0&0\\
    -3&1&0&0\\
    -16&6&1&0\\
    1&1&1&1
\end{array} \right)
\left(\begin{array}{rrrr}
    2&-1&-1&0\\
    -1&4&-1&-2\\
    -1&-1&3&-1\\
    0&-2&-1&3
\end{array} \right)
\left(\begin{array}{rrrr}
    1&-2&5&1\\
    1&-1&3&1\\
    0&-3&7&1\\
    0&0&0&1
\end{array} \right)\\[10pt]
&= 
\left(\begin{array}{cccc}
    1&0&0&0\\
    0&1&0&0\\
    0&0&13&0\\
    0&0&0&0
\end{array} \right)
\end{align*}
Therefore,
\[
  \Pic(G)=\cok(L)\simeq\Z/1\Z\oplus\Z/1\Z\oplus\Z/13\Z\oplus\Z
  \simeq\Z\oplus\Z/13\Z.
\]
The explicit isomorphism would be essentially given by the matrix~$U$ (as we
will see) and goes like this
\begin{align*}
  \Pic(G)=\Z^4/\im(L)&\to\Z/1\Z\oplus\Z/1\Z\oplus\Z/13\Z\oplus\Z\qquad\to\qquad\Z/13\Z\oplus\Z\\
  (a,b,c,d)
  &\mapsto U
  \left(\begin{array}{c}
      a\\b\\c\\d
  \end{array} \right)
  =
  \left(\begin{array}{c}
      a\\-3a+b\\-16a+6b+c\\a+b+c+d
  \end{array} \right)
  \mapsto
  (-16a+6b+c,a+b+c+d).
\end{align*}
You can check that each column of~$L$ is sent to~$(0,0)$ under this mapping, and
thus the mapping is well-defined.

To find the structure of~$\Jac(G)$, first take the reduced Laplacian with
respect to any vertex, then apply the procedure illustrated above.  For instance, the reduced
Laplacian with respect to~$v_1$ is
\[
  \tilde{L}=
\left(\begin{array}{rrr}
    4&-1&-2\\
    -1&3&-1\\
    -2&-1&3
\end{array} \right).
\]
The diagonalized version of~$\tilde{L}$ will be
\[
  \left(\begin{array}{ccc}
      1&0&0\\
      0&1&0\\
      0&0&13
  \end{array} \right),
\]
and so~$\Jac(G)\simeq\Z/13\Z$.
\end{document}

