\documentclass[11pt]{article}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{verbatim}
\usepackage{cancel}
\usepackage[pdftex]{graphicx}
\usepackage{url}
\usepackage[table]{xcolor}
\usepackage{multicol}
\usepackage[all,arc]{xy}
\usepackage{color, colortbl}
\usepackage{mathrsfs}
\usepackage{hhline}
\usepackage{hyperref}
\hypersetup{colorlinks=true}
\setlength{\oddsidemargin}{.25in}
\setlength{\evensidemargin}{.25in}
\setlength{\textwidth}{6in}
\setlength{\topmargin}{-0.4in}
\setlength{\textheight}{8.5in}

\newcolumntype{x}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{tikz}
\newcommand\diag[4]{%
  \multicolumn{1}{p{#2}|}{\hskip-\tabcolsep
  $\vcenter{\begin{tikzpicture}[baseline=0,anchor=south west,inner sep=#1]
  \path[use as bounding box] (0,0) rectangle (#2+2\tabcolsep,\baselineskip);
  \node[minimum width={#2+2\tabcolsep-\pgflinewidth},
        minimum  height=\baselineskip+\extrarowheight-\pgflinewidth] (box) {};
  \draw[line cap=round] (box.north west) -- (box.south east);
  \node[anchor=south west] at (box.south west) {#3};
  \node[anchor=north east] at (box.north east) {#4};
 \end{tikzpicture}}$\hskip-\tabcolsep}}

\input{preamble.tex}

\begin{document}

\lecture{4: Finite Groups}{Week 4}

Over the first three weeks of this course, we've considered combinatorial questions about \textbf{sets}: that is, collections of static objects, which we've focused on enumerating in various ways.  However, these are not the only sorts of objects combinatorialists study!  Instead, we can study what happens when we equip sets with \textbf{operations}: that is, various ways to act on and manipulate elements of our set!  When we do this in certain ways, this gives us access to questions that demand stronger techniques than we've developed so far: we can enumerate elements of sets, but what happens when we add functions into the mix?  How do we study sets that can change?  

This, in a sense, is going to be the focus of the rest of the course.  Over the next seven weeks, we're going to examine three specific ways to add structure to sets: \textbf{groups}, \textbf{fields} and \textbf{vector spaces}.  In particular, we're going to study \textbf{finite} examples of all of these objects, and look at how combinatorialists use all of these objects to solve problems in the field!

The first such concept we study here is the idea of a \textbf{group}:

\section{Groups}

\subsection{Basic definitions / examples.}
\begin{defn}
A \textbf{group} is a set $G$ along with some operation $\cdot$ that takes in two elements and outputs another element of our group, such that we satisfy the following properties:
\begin{itemize}
\item \textbf{Identity}: there is a unique identity element $e \in G$ such that for any other $g \in G$, we have $e \cdot g = g \cdot e = g$.  

In other words, combining any group element $g$ with the identity via our group operation does not change $g$!  You know many objects like this: if we work with the real numbers $\mathbb{R}$ and think of addition as our group operation, then 0 is our identity, as $0+x = x$ for any $x$.  Similarly, if we consider the real numbers again but take our operation to be multiplication, then 1 is our identity, as $1 \cdot x = x$ for any $x$.

\item \textbf{Inverses}: for any $g \in G$, there is a unique $g^{-1}$ such that $g \cdot g^{-1} = g^{-1} g = e$. 

In other words, if we start at any group element $g$, we can always find something to combine with $g$ using our group operation to get back to the identity!  Again, you know several objects like this: with $\mathbb{R}$ and addition, the inverse of any number $x$ is just its negative $-x$, while if we consider the set of nonzero real numbers and multiplication, the inverse for any $x$ is just $1/x$.

\item \textbf{Associativity}: for any three $a,b,c \in G$, $a \cdot (b \cdot c) = (a \cdot b) \cdot c.$  

In other words, the order in which we group combinations together doesn't matter, as long as the sequence that we have those objects grouped together in does not change!  I.e.\ we can combine $a$ with $b \cdot c$, or first find $a \cdot b$ and then combine that with $c$.  Again, most of the natural operations you're familiar with (addition, multiplication) are associative: it is perhaps more interesting to point out some things that are nonassociative.  For example, exponentiation is a nonassociative operation:  $2^{\left(3^4\right)} = 2^{81} \approx 2.41 \cdot 10^{24} $, while $(2^3)^4 = 8^4 = 4096$.
\end{itemize}
\end{defn}
It bears noting that this does not say that $a\cdot b = b \cdot a$: that is a different property, called \textbf{commutativity}, and is not a property that groups need to have (as we will show in the examples!)  Groups that are commutative are called \textbf{abelian groups}, after the mathematician Niels Henrik Abel.  

We list a number of examples of groups, as well as some nonexamples.  Here, we don't give formal proofs that any of these objects are groups; instead, we list them rapid-fire to give you a list of examples to think about in your head!  (If you're interested, you can prove that any of these objects satisfy the claimed properties, though!  For some it will be harder than others, but if you're in the Introduction to Higher Mathematics class they are all proofs you could come up with given sufficient time.)
\begin{exmp}
As noted above, the real numbers with respect to addition, which we denote as $\langle \mathbb{R}, +\rangle$, is a group: it has the identity 0, any element $x$ has an inverse $-x$, and it satisfies associativity.
\end{exmp}

\begin{nonexmp}
The real numbers with respect to multiplication, which we denote as $\langle \mathbb{R}, \cdot\rangle$, is \textbf{not} a group: the element $0 \in \mathbb{R}$ has no inverse, as there is nothing we can multiply 0 by to get to 1!
\end{nonexmp}

\begin{exmp}
The nonzero real numbers with respect to multiplication, which we denote as $\langle \mathbb{R}^\times, \cdot\rangle$, is a group!  The identity in this group is 1, every element $x$ has an inverse $1/x$ such that $x \cdot (1/x) = 1$, and this group satisfies associativity.
\end{exmp}

\begin{exmp}
The integers with respect to addition, $\langle \mathbb{Z}, +\rangle$ form a group!
\end{exmp}

\begin{nonexmp}
The integers with respect to multiplication, $\langle \mathbb{Z}, \cdot \rangle$ do not form a group: for example, there is no integer we can multiply 2 by to get to 1.
\end{nonexmp}

\begin{nonexmp}
The natural numbers $\mathbb{N}$  are not a group with respect to either addition or multiplication.  For example: in addition, there is no element $-1 \in \mathbb{N}$ that we can add to 1 to get to 0, and in multiplication there is no natural number we can multiply 2 by to get to 1.
\end{nonexmp}

\begin{exmp} 
$GL_n(\mathbb{R})$, the collection of all $n \times n$ invertible real-valued matrices, is a group under the operation of matrix multiplication.  Notice that this group is an example of a \textbf{nonabelian} group, as there are many matrices for which $AB \neq BA$: consider $\begin{bmatrix} 0 & 1\\ 0 & 0 \end{bmatrix} \cdot \begin{bmatrix} 1 & 0\\ 0 & 0 \end{bmatrix} = \begin{bmatrix} 0 & 0\\ 0 & 0 \end{bmatrix}$ versus $\begin{bmatrix} 1 & 0\\ 0 & 0 \end{bmatrix} \cdot \begin{bmatrix} 0 & 1\\ 0 & 0 \end{bmatrix} = \begin{bmatrix} 0 & 1\\ 0 & 0 \end{bmatrix}$.
\end{exmp}

\begin{exmp} 
$SL_n(\mathbb{R})$, the collection of all $n \times n$ invertible real-valued matrices with determinant 1, is also a group under the operation of matrix multiplication; this is because the property of being determinant 1 is preserved under taking inverses and multiplication for matrices.
\end{exmp}

These examples are all great, but they're not really what I'm interested in for this class.  Instead, I want to focus on examples of \textbf{finite} groups!  In the next section, we study examples of these groups in more depth than above, and explain more about why they form a group.
\subsection{Finite groups.}

\begin{defn}
The object $\langle \mathbb{Z}/n\mathbb{Z}, +, \cdot\rangle$ is defined as follows:
\begin{itemize}
\item Your set is the numbers $\{0,1,2,\ldots n-1\}$.
\item Your addition operation is the operation ``addition mod n,'' defined as follows: we say that $a + b \equiv c \mod n$ if the two integers $a+b$ and $c$ differ by a multiple of $n$.

For example, suppose that $n = 3.$  Then $1+1 \equiv 2 \mod 3$, and $2+ 2 \equiv 1 \mod 3$.  
\item Similarly, our multiplication operation is the operation ``multiplication mod n,'' written $a \cdot b \equiv c \mod n$, and holds whenever $a+b$ and $c$ differ by a multiple of $n$.

For example, if $n = 7$, then $2 \cdot 3 \equiv 6 \mod 7$, $4 \cdot 4 \equiv 2 \mod 7$, and $6 \cdot 4 \equiv 3 \mod 7$.
\end{itemize}
\end{defn}

\begin{exmp} 
$\mathbb{Z} / n\mathbb{Z} = \{0, 1, \ldots n-1\}$ is a commutative group with respect to the operation of addition mod $n$!  This is not hard to check:
\begin{enumerate}
\item \textbf{Identity}: 0 is the identity of this group.  This is easy to check: take any $x \in \{0, 1, \ldots n-1\}$.  We know that $0+x = x$ in the integers; therefore, because the difference of any two equal numbers is 0, and 0 is a multiple of $n$ for any $n$, we have by definition that $0 + x \equiv x \mod n$.
\item \textbf{Associativity} and \textbf{commutativity} are inherited from the integers in a similar fashion!  Notice that 
\begin{align*}
\forall x, y, z \in \mathbb{Z}/n\mathbb{Z}, x + (y + z) = (x + y) + z &\textrm{ and } x + y = y + x\\
\Rightarrow \forall x, y, z \in \{1, \ldots n-1\}, x + (y + z) = (x + y) + z &\textrm{ and } x + y = y + x\\
\Rightarrow \forall x, y, z \in \{1, \ldots n-1\}, x + (y + z) \equiv (x + y) + z \mod n &\textrm{ and } x + y \equiv y + x\mod n,\\
\end{align*}
by exactly the same logic as above (equality implies equivalence mod $n$ for any $n$.)
\item \textbf{Inverses}:  Given any $k \neq 0 \in  \{0, 1, \ldots n-1\}$, notice that $n-k$ is also in this set, and that $k + n-k = n \equiv 0 \mod n$.  Therefore every element has an inverse, as claimed!
\end{enumerate}
\end{exmp}

This is not the only way in which modular arithmetic can make a group:

\begin{exmp} 
$(\mathbb{Z} / p\mathbb{Z})^\times = \{1, \ldots p-1\}$ is a commutative group with respect to the operation of multiplication mod $p$, if and only if $p$ is a prime.

Seeing this is not too difficult.  If you repeat the logic from our earlier proof, we can see that $(\mathbb{Z} / p\mathbb{Z})^\times$ satisfies \textbf{associativity}, \textbf{identity} and \textbf{commutativity}, simply because these properties are ``inherited'' from the integers $\mathbb{Z}$.  

Therefore, the only property we need to check is inverses.  We first deal with the case where $p$ is not prime.  Write $p = mn$ for two positive integers $m, n \neq 1$; notice that because both of these values must be smaller than $p$ if their product is $p$, both $m$ and $n$ live in the set $\{1, \ldots p-1\}$.  

Consider the element $n$.  In particular, notice that for any $k$, we have 
\begin{align*}
&kn \equiv x \mod p\\
\Rightarrow &kn - x \textrm{ is a multiple of }p\\
\Rightarrow &kn - x \textrm{ is a multiple of }mn\\
\Rightarrow &kn - x \textrm{ is a multiple of }n\\
\Rightarrow &x \textrm{ is a multiple of }n.\\
\end{align*}
(If none of the above deductions make sense, reason them out in your head!)  Because of this, we can see that $n$ has no inverse in $(\mathbb{Z} / p\mathbb{Z})^\times$, as $kn$ is only congruent to multiples of $n$, and $1$ is not a multiple of $n$.

The converse --- showing that if $p$ is prime, $(\mathbb{Z} / p\mathbb{Z})^\times$ has inverses --- is a little trickier.  We do this as follows: first, we prove the following claim. 
\begin{claim}
For any $a, b \in \{0, \ldots p-1\}$, if $a \cdot b \equiv 0 \mod p$, then at least one of $a, b$ are equal to 0.
\end{claim}
\begin{proof}
Take any $a, b$ in $\{0, \ldots p-1\}$.  If one of $a, b$ are equal to 0, then we know that $a \cdot b = 0$ in the normal ``multiplying integers'' world that we've lived in our whole lives.  In particular, this means that $a \cdot b \equiv 0 \mod p$ as well.  

Now, suppose that neither $a$ nor $b$ are equal to 0.  Take both $a$ and $b$.  Recall, from grade school, the concept of \textbf{factorization}:
\begin{obs}
Take any nonzero natural number $n$.  We can write $n$ as a product of prime numbers $n_1 \cdot\ldots \cdot n_k$; we think of these prime numbers $n_1, \ldots n_k$ as the ``factors'' of $n$.  Furthermore, these factors are \textbf{unique}, up to the order we write them in: i.e.\ there is only one way to write $n$ as a product of prime numbers, up to the order in which we write those primes.  (For example: while you could say that $60$ can be factored as both $2 \cdot 2 \cdot 3 \cdot 5$ and as $3 \cdot 2 \cdot 5 \cdot 2$, those two factorizations are the same if we don't care about the order we write our numbers in.)

In the special case where $n = 1$, we think of this as already factored into the ``trivial'' product of no prime numbers.
\end{obs}

Take $a$, and write it as a product of prime numbers $a_1 \cdot \ldots \cdot a_k$.  Do the same for $b$, and write it as a product of primes $b_1 \cdot \ldots \cdot b_m$.    Notice that because $a$ and $b$ are both numbers that are strictly between 0 and $n-1$, $n$ cannot be one of these prime numbers (because positive multiples of $n$ must be greater than $n$!)

In particular, this tells us that the number $a\cdot b$ on one hand can be written as the product of primes $a_1 \cdot \ldots \cdot a_k \cdot b_1 \cdot \ldots \cdot b_m$, and on the other hand (because factorizations into primes are unique, up to ordering!) that there is no $n$ in the prime factorization of $a \cdot b$.

Conversely, for any natural number $k$, the number $k \cdot n$ \textbf{must} have a factor of $n$ in its prime factorization.  This is because if we factor $k$ into prime numbers $k_1 \cdot \ldots \cdot k_j$, we have $k \cdot n = k_1 \cdot \ldots \cdot k_j \cdot n$, which is a factorization into prime numbers and therefore (up to the order we write our primes) is unique!

In particular, this tells us that for any $k$, the quantities $a \cdot b$ and $k \cdot p$ are distinct; one of them has a factor of $p$, and the other does not.  Therefore, we have shown that if both $a$ and $b$ are nonzero, then $a \cdot b$ cannot be equal to a multiple of $p$ --- in other words, $a \cdot b$ is not congruent to 0 modulo $p$!  Therefore, the only way to pick two $a, b \in \{0, \ldots p-1\}$ such that $a \cdot b$ is congruent to 0 modulo $p$ is if at least one of them is equal to 0, as claimed.
\end{proof}

From here, the proof that our group has inverses is pretty straightforward.  Take any $x \in (\mathbb{Z} / p\mathbb{Z})^\times$, and suppose for contradiction that it did not have any inverses.  Look at the multiplication table for $x$ in $(\mathbb{Z} / p\mathbb{Z})^\times$:
\begin{align*}
\begin{array}{c|ccccc}
 & 1 & 2 & 3 & \ldots & p-1\\\hline
x & ? & ? & ? & \ldots & ?
\end{array}
\end{align*}
If $x$ doesn't have an inverse, then 1 does not show up in the above table!  The above table has $p$ slots, and if we're trying to fill it without using 1, we only have $p-1$ values to put in this table; therefore some value is repeated!  In other words, there must be two distinct values $k < l$ with $xl \equiv xk \mod p$.  

Consequently, we have $x(l-k) \equiv 0 \mod p$, which by our above observation means that one of $x, (l-k)$ are equal to 0.  But $x$ is nonzero, as it's actually in $(\mathbb{Z} / p\mathbb{Z})^\times$: therefore, $l-k$ is equal to 0, i.e. $l=k$.  But we said that $k, l$ are distinct; so we have a contradiction!  Therefore, every element $x$ has an inverse, as claimed.
\end{exmp}

There are other finite groups beyond those made out of modular arithmetic!  In particular, there are several notable examples of \textbf{noncommutative} groups: we describe some of those here.

\begin{exmp}
The \textbf{symmetric group} $S_n$ is the collection of all of the permutations on the set $\{1, \ldots n\}$, where our group operation is composition.  In case you haven't seen this before:
\begin{itemize}
\item A \textbf{permutation} of a set is just a bijective function on that set.  For example, one bijection on the set $\{1,2,3\}$ could be the map $f$ that sends $1$ to $2$, $2$ to $1$, and $3$ to $3$.
\item One way that people often denote functions and bijections is via ``arrow'' notation: i.e.\ to describe the map $f$ that we gave above, we could write
\begin{align*} 
f:\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] \\
1 & 2 & 3
}
\end{gathered}
\end{align*}
\item This, however, is not the most space-friendly way to write out a permutation.  A much more condensed way to write down a permutation is using something called \textbf{cycle notation}.  In particular: suppose that we want to denote the permutation that sends $a_1 \to a_2$, $a_2 \to a_3$, \ldots $a_{n-1} \to a_n$, $a_n \to a_1$, and does not change any of the other elements (i.e.\ keeps them all the same.)  In this case, we would denote this permutation using cycle notation as the permutation
\begin{align*}
(a_1a_2a_3\ldots a_n).
\end{align*}
\end{itemize}
To illustrate this notation, we describe all of the six possible permutations on $\{1,2,3\}$ using both the arrow and the cycle notations:
\begin{alignat*}{3}
id:\left(\begin{gathered}\xymatrix{
1 \ar[d] & 2 \ar[d] & 3 \ar[d] \\
1 & 2 & 3
}
\end{gathered}\right) &
\quad(12):\left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] \\
1 & 2 & 3
}
\end{gathered}\right) &
\quad (13):\left(\begin{gathered}\xymatrix{
1 \ar[rrd] & 2 \ar[d] & 3 \ar[lld] \\
1 & 2 & 3
}
\end{gathered}\right)\\
(23):\left(\begin{gathered}\xymatrix{
1 \ar[d] & 2 \ar[rd] & 3 \ar[ld] \\
1 & 2 & 3
}
\end{gathered}\right) &
\quad(123):\left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[rd] & 3 \ar[lld] \\
1 & 2 & 3
}
\end{gathered}\right) &
\quad (132):\left(\begin{gathered}\xymatrix{
1 \ar[rrd] & 2 \ar[ld] & 3 \ar[ld] \\
1 & 2 & 3
}
\end{gathered}\right)\\
\end{alignat*}

It's worth noting that some permutations need to be represented with multiple cycles.  For example,
\begin{align*}
\quad (143)(25)&= \left(\begin{gathered}\xymatrix{
1 \ar[rrrd] & 2 \ar[rrrd] & 3 \ar[lld] & 4 \ar[ld] & 5 \ar[llld] \\
1 & 2 & 3 & 4 & 5
}
\end{gathered}\right),\\
\end{align*}
because $1$ maps to 4, 4 maps to 3, and 3 maps to 1, giving us $(143)$, and 2 maps to 5 maps to 2, giving us $(25)$.

Because the composition of any two bijections is still a bijection, we have in particular that the composition of any two permutations is another permutation: so our group operation does indeed combine group elements into new group elements.  

Composing any map $f$ with the identity map $id(x) = x$ does not change the map $f$, so $id(x)$ is an identity element. 

Associativity is tedious but doable to check: take any three bijections $f: C \to D, g: B \to C , h: A \to B$.  We want to check that $(f \circ g) \circ h: A \to D$ is the same map as $f \circ (g \circ h): A \to D$.  To do this, it suffices to show that they send the same elements to the same places, as this is exactly what it means for two functions to be equal.  Take any $a \in A$, and notice that
\begin{align*}
((f \circ g) \circ h)(a) = (f \circ g)(h(a)) &= f(g(h(a)))\\
(f \circ (g \circ h))(a) = (f(g(h(a)))) &= f(g(h(a))).\\
\end{align*}
So we satisfy associativity!

Finally, to see that we have inverses, notice that any bijection $f: X \to Y$ has an inverse function $f^{-1}Y \to X$ defined by 
\begin{align*}
f^{-1}(y) = \textrm{ the unique }x \textrm{ such that }f(x) = y.
\end{align*}
Notice that $f^{-1} \circ f (x) = x$ for any $x$: in other words, their composition is the identity!  Therefore, any bijection has an inverse, and thus $S_n$ is a group.
\end{exmp}

While the above work certainly shows that $S_n$ is a group, it may not do a great job of giving us a feel for how to combine its elements.  To do this, let's demonstrate a small yet useful property about $S_n$:
\begin{defn}
A permutation $\sigma \in S_n$ is called a \textbf{transposition} if we can write $\sigma = (ab)$, for two distinct values $a, b \in \{1,\ldots n\}$.
\end{defn}
\begin{claim}
We can write any $\sigma \in S_n$ as a product of transpositions.  
\end{claim}
\begin{proof}
To illustrate what our claim is, let's work it out for all of the elements of $S_3$.  We first note that $(12), (13)$ and $(23)$ are all trivially covered by this proposition, as they are themselves transpositions; as well, we can ``trivially'' write $id$ as the product $(12)(12)$, amongst other things, as
\begin{align*}
id:\left(\begin{gathered}\xymatrix{
1 \ar[d] & 2 \ar[d] & 3 \ar[d] \\
1 & 2 & 3
}
\end{gathered}\right) \quad =
\quad(12)(12):\left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] \\
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] \\
1 & 2 & 3
}
\end{gathered}\right),
\end{align*}
because both maps send $1$ to $1$, $2$ to $2$, and $3$ to $3$ (just follow the arrows!)

To work this out for $(123)$ and $(132)$ takes not much more work.  Simply notice that to do the permutation $(123)$, we could start with the swap $1$ and $2$, to get $1$ to map to the right thing; from there, we currently have $2\to 1$ and $3\to 3$, when we want $ 2\to 3$ and $3 \to 1$.  Swapping $1$ and $3$ fixes these issues, and gives us the swap we want!  Because function compositions are read right-to-left (because in $f(g(x))$, you apply $g$ to $x$ before applying $f$!), we would write this as $(13)(12)$: and indeed, we can check that

\begin{align*}
\quad(123)=\left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[rd] & 3 \ar[lld] \\
1 & 2 & 3
}
\end{gathered}\right)=
(13)(12)=\left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] \\
1 \ar[rrd]& 2 \ar[d] & 3\ar[lld]\\
1 & 2 & 3\\
}
\end{gathered}\right).\\
\end{align*}

Using similar logic, we can see that $(132)$ can be written as $(12)(13)$:
\begin{align*}
\quad (132):\left(\begin{gathered}\xymatrix{
1 \ar[rrd] & 2 \ar[ld] & 3 \ar[ld] \\
1 & 2 & 3
}
\end{gathered}\right)=
(12)(13)=\left(\begin{gathered}\xymatrix{
1 \ar[rrd]& 2 \ar[d] & 3\ar[lld]\\
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] \\
1 & 2 & 3\\
}
\end{gathered}\right).\\
\end{align*}

This hopefully gives us a bit more of a feel for what we're doing here!  Just to illustrate a tricker case, however, let's try a longer permutation: what about $\sigma = (12345) \in S_5$?  Well: let's use similar logic to our earlier cases.  We know that $\sigma$ sends $1 \to 2$; so we can start with $(12)$ as our first transposition.  Now 1's going to the right place!  If we consider 2, it's currently going to 1, when it should be going to $3$.  Therefore, if we follow up our first switch with $(13)$, it will send 2 to 3, while not changing where 1 maps to (as we didn't touch its target from the first step, 2!)  

This process continues: 3 is mapping to 1 now, and it should map to 4; so we should apply $(14)$.  Then, 4 is mapping to 1, and it should map to 5; so we apply (15).  Now we have 5 mapping to 1, which is correct; in other words, all of our elements are mapping to the right place!  This is easily verified with a quick diagram:
\begin{align*}
\quad (12345)&= \left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[rd] & 3 \ar[rd] & 4 \ar[rd] & 5 \ar[lllld] \\
1 & 2 & 3 & 4 & 5
}
\end{gathered}\right)\\
(15)(14)(13)(12)&=\left(\begin{gathered}\xymatrix{
1 \ar[rd] & 2 \ar[ld] & 3 \ar[d] & 4 \ar[d] & 5 \ar[d] \\
1 \ar[rrd] & 2 \ar[d] & 3 \ar[lld] & 4 \ar[d] & 5 \ar[d] \\
1 \ar[rrrd] & 2 \ar[d] & 3 \ar[d] & 4 \ar[llld] & 5 \ar[d] \\
1 \ar[rrrrd] & 2 \ar[d] & 3 \ar[d] & 4 \ar[d] & 5 \ar[lllld] \\
1 & 2 & 3 &4 &5\\
}
\end{gathered}\right).\\
\end{align*}

In general, suppose we have any cycle $(a_1 a_2 \ldots a_n)$.  I claim that we can write this cycle as the product
\begin{align*}
(a_1 a_2 \ldots a_n) = (a_1a_n)\ldots(a_1a_4)(a_1a_3)(a_1a_2);
\end{align*}
we prove this by induction.  Our base case, when $n=2$, is trivially true: so we move to our inductive step.  Assume that our case holds for length-$n$ cycles, and consider a cycle $(a_1 a_2 \ldots a_na_{n+1})$ of length $n+1$.  

So: consider the product $(a_1a_{n+1}) (a_1a_n)\ldots(a_1a_4)(a_1a_3)(a_1a_2)$.  We want to show that this permutation is precisely the cycle $(a_1 a_2 \ldots a_na_{n+1})$ .  

By induction, we know our product of transpositions is equal to $(a_1a_{n+1})(a_1 a_2 \ldots a_n) $.  Consider where this permutation sends elements:
\begin{itemize}
\item If we look at any of the elements $a_k \in \{a_1, \ldots a_{n-1}\}$, each $a_k$ gets sent to $a_{k+1}$ by the cycle $(a_1 a_2 \ldots a_n) $; because none of the elements $a_2, \ldots a_n$ are in the transposition $(a_1a_{n+1})$, it does not interact further with any of these elements.
\item If we look at $a_{n}$, it is sent to $a_1$ by the cycle $(a_1 a_2 \ldots a_n)$; because $a_1$ is then sent to $a_{n+1}$ by the transposition $(a_1a_{n+1})$, in total we have that $a_n$ is sent to $a_{n+1}$.
\item Finally, $a_{n+1}$ is not touched by the cycle $(a_1 a_2 \ldots a_n)$, and is then sent to $a_1$ by the transposition $(a_1a_{n+1})$.
\end{itemize}
In total, we have that each $a_k$ is sent to $a_{k+1}$, with the exception of $a_{n+1}$, which is sent to $a_1$.  In other words, our product of transpositions is precisely $(a_1 a_2 \ldots a_na_{n+1})$ , as claimed.

Via cycle notation, we can write any permutation as some product of cycles: applying this result to each cycle in turn lets us write each permutation as a product of cycles, as claimed.
\end{proof}

Not all finite groups are as algebraic as $S_n$!  Our last example, for instance, is beautifully geometric in nature:

\begin{exmp}
Consider a regular $n$-gon.  There are a number of geometric transformations, or \textbf{similarities}, that we can apply that send this $n$-gon to ``itself'' without stretching or tearing the shape:\ i.e. there are several rotations and reflections that when applied to a $n$-gon do not change the $n$-gon.  For example, given a square, we can rotate the plane by $0^\circ, 90^\circ, 180^\circ,$ or $270^\circ$, or flip over one of the horizontal, vertical, top-left/bottom-right, or the top-right/bottom-left axes:
\begin{center}
\includegraphics[width=4in]{math137b_s2014_d4group.pdf}
\end{center}

Given two such transformations $f, g$, we can compose them to get a new transformation $f \circ g$.  Notice that because these two transformations each individually send the $n$-gon to itself, their composition also sends the $n$-gon to itself!  Therefore composition is a well-defined operation that we can use to combine two transformations.
\begin{center}
\includegraphics[width=4.5in]{math137b_s2014_d4groupcomp.pdf}
\end{center}

Notice that the trivial rotation by $0^\circ$, when composed with any other map, does not change that map: so, under the operation of composition, rotation by $0^\circ$ is an \textbf{identity}!  Similarly, notice that performing the same flip twice in a row returns us back to the identity, so every flip has an \textbf{inverse} given by itself! (I.e. if $f$ is a flip, $f \circ f = id$: i.e. $f  = f^{-1}$.)  As well, if we rotate by $k$ degrees, rotating by $360-k$ degrees results in a total rotation by $360$: i.e.\ rotation by $0^\circ$.  So all rotations have inverses as well!

Finally, notice that because function composition is associative (as shown above!), this operation is \textbf{associative} as well.  Consequently, the collection of all symmetries of a regular $n$-gon forms a group under the operation of function composition!
\end{exmp}

We call this last group $D_{2n}$, because it is the group of \textbf{order}\footnote{The \textbf{order} of a group is the number of elements in that group!} $2n$.  Algebraists will usually use this terminology; geometers, however, will often write the same group as $D_n$, as they care about they object whose symmetries we are studying (a $n$-gon) more than the number of symmetries themselves $(2n)$.

\subsection{Enumerating groups.}

This is a discrete mathematics course!  Consequently, the first question we should have, upon encountering a new concept, is (roughly) the following: \textbf{how many of these things exist}?  To be a bit more precise:
\begin{quest}
Given any natural number $n$, how many groups are there of order $n$?
\end{quest}

At first glance, you might suspect that the answer is infinite!  For example, the following four groups all give us groups of order 1:
\begin{itemize}
\item $\langle \{1\}, \cdot \rangle$, the group with one element 1, and the operation of multiplication.
\item $\langle \{0\}, + \rangle$, the group with one element 0, and the operation of addition.
\item $\langle \{f: \mathbb{R} \to \mathbb{R}, f(x) = x\}, \circ \rangle$, the group with one element $f(x) = x$, and the operation of composition.
\item $S_1$, the group made of all permutations of the set $\{1\}$ with respect to composition of permutations.
\end{itemize}

We could easily keep going, and in fact make an infinite family of order-1 groups:
\begin{itemize}
\item For any $n \in \mathbb{N}$, let $\langle \{f: \{n\} \to \{n\}, f(n) = n\}, \circ \rangle$ denote the one-element group of all maps from $\{n\}$ to $\{n\}$ under group composition.
\end{itemize}
However, in a sense all of these groups are the \textbf{same}!  They all have one element --- call it $x$ for right now --- and their operations are all defined by sending $(x,x)$ to $x$.  So, in a sense, calling these groups ``different'' is kind of silly: they have different names and labels, but they're all encoding the same \textbf{size} and \textbf{structure} as each other!  

We make this formal via the following definition:
\begin{defn}
Take any two groups $\langle G, \cdot \rangle, \langle H, \star \rangle$, and any map $\varphi: G \to H$.  We say that $\varphi$ is a \textbf{group isomorphism} if it satisfies the following two properties:
\begin{enumerate}
\item \textbf{Preserves size}: $\varphi$ is a bijection\footnote{Notice that this means that there is an inverse map $\varphi^{-1}:H \to G$, defined by $\varphi^{-1}(h) = $ the unique $g \in G$ such that $\varphi(g) = h$.}.  
\item \textbf{Preserves structure}: $\varphi$, in a sense, sends $\cdot$ to $\star$.  To describe this formally, we say the following:
\begin{align*}
\forall g_1, g_2 \in G, \quad\varphi( g_1 \cdot g_2) = \varphi(g_1) \star \varphi(g_2).
\end{align*}
This property ``preserves structure'' in the following sense: suppose that we have two elements we want to multiply together in $H$.  Because $\varphi$ is a bijection, we can write these two elements as $\varphi(g_1), \varphi(g_2)$.  Our property says that $\varphi( g_1 \cdot g_2) = \varphi(g_1) \star \varphi(g_2)$: in other words, if we want to multiply our two elements in $H$ together, we can do so using either the $G$-operation $\cdot$ by calculating $\varphi( g_1 \cdot g_2)$, or by using the $H$-operation $\star$ by calculating $\varphi(g_1) \star \varphi(g_2)$.

Similarly, if we want to multiply any two elements $g_1,  g_2$ in $G$ together, we can see that $g_1 \cdot g_2 =  \varphi^{-1} (\varphi(g_1 \cdot g_2)) = \varphi^{-1}( \varphi(g_1) \star \varphi(g_2))$.  So, again, we can multiply elements using either $G$ or $H$'s operation!  To choose which operation we use, we just need to apply $\varphi$ or $\varphi^{-1}$ as appropriate to get to the desired set, and perform our calculations there.
\end{enumerate}
\end{defn}

This is something that is perhaps best understood with an example.  Consider the following two groups:
\begin{exmp}
Take a $1 \times 2$ rectangle, and the set of all geometric transformations that send this rectangle to itself without stretching or tearing.  There are four such transformations: flipping across either the horizontal or vertical axes, rotating $180^\circ$, or the identity transformation:
\begin{align*}
id, r_{180}, f_v, f_h.
\end{align*}  
These transformations form a group!  
\end{exmp}

To see how they interact, we can form a \textbf{group table,} which we define here:
\begin{defn}
Take any group $\langle G, \cdot \rangle$ of order $n$: that is, any group $G$ consisting of $n$ distinct elements.  We can create a \textbf{group table} corresponding to $G$ as follows:
\begin{itemize}
\item Take any ordering $r_1, \ldots r_n$ of the $n$ elements of $G$: we use these elements to label our rows.
\item Take any other ordering $c_1, \ldots c_n$ of the $n$ elements of $G$: we use these elements to label our columns.  (This ordering is usually the same as that for the rows, but it does not have to be.)
\item Using these two orderings, we create a $n \times n$ array, called the \textbf{group table} of $G$, as follows: in each cell $(i,j)$, we put the entry $r_i \cdot c_j$.
\end{itemize}
\end{defn}

For example, one group table for the symmetries of the rectangle we were discussing earlier could be the following:

\setlength{\extrarowheight}{0.1cm}
\begin{align*}
\begin{array}{c||c|c|c|c}
r_i \circ c_j & id & r_{180} & f_v & f_h \\\hhline{=#====}
id & id& r_{180}& f_v&f_h\\\hline
r_{180} & r_{180} & id & f_h& f_v\\\hline
f_{v} &f_v& f_h& id& r_{180}\\\hline
f_h & f_h& f_v& r_{180}& id\\
\end{array}
\end{align*}

This table actually helps us verify that our collection of transformations is a group!  In particular, by looking at it, we can see that $id$ is an identity, as $id \circ $(anything) = (anything).  We can also see that every element has an inverse, as there is a copy of id in every row (and therefore for any element $x$, there is some other element $x^{-1}$ such that $x \cdot x^{-1} = id$.)  Associativity is the only group property that is not immediate from looking at a group table; to check it for this example, however, we can just refer to our earlier proof that function composition in general was associative.



\begin{exmp}
Take the set $(\mathbb{Z}/2\mathbb{Z})\times(\mathbb{Z}/2\mathbb{Z})$, otherwise denoted as $(\mathbb{Z}/2\mathbb{Z})^2$.  This set has four elements: $(0,0), (0,1), (1,0), (1,1)$, and is a group under the operation of ``pairwise addition mod 2.  To see this, we will construct this group's table as well:
\setlength{\extrarowheight}{0.1cm}
\begin{align*}
\begin{array}{c||c|c|c|c}
r_i + c_j \mod 2 & (0,0) & (1,1) & (1,0) & (0,1) \\\hhline{=#====}
(0,0) & (0,0)& (1,1)& (1,0)&(0,1)\\\hline
(1,1) & (1,1) & (0,0) & (0,1)& (1,0)\\\hline
(1,0) &(1,0)& (0,1)& (0,0)& (1,1)\\\hline
(0,1) & (0,1)& (1,0)& (1,1)& (0,0)\\
\end{array}
\end{align*}
As before, we can tell by looking at this table that our set has an identity $(0,0)$, and that every element has an inverse!  To see associativity, we just use the fact that we know that $\langle\mathbb{Z}/n\mathbb{Z}, +\rangle$ is associative from our earlier work: therefore, if we have any three elements $(a,b), (c,d), (e,f)$, we know that
\begin{align*}
(a,b) + ((c,d) + (e,f)) &= (a,b) + (c+e, d+f)\\
&= (a+ (c+e), b+ (d+f))\\
&= ((a+c)+e, (b+d)+f)\\
&= (a+c, b+d) + (e,f)\\
&= ((a,b) + (c,d)) + (e,f).
\end{align*}
So this is a group!
\end{exmp}

In fact, not only is $\langle (\mathbb{Z}/2\mathbb{Z})\times(\mathbb{Z}/2\mathbb{Z}), +\rangle$ a group, but it's a group that is \textbf{isomorphic} to our first group of symmetries of a rectangle!  To see this, simply consider the bijection $\varphi: (\mathbb{Z}/2\mathbb{Z})\times(\mathbb{Z}/2\mathbb{Z}) \to \{id, r_{180}, f_v, f_h\}$ defined by 
\begin{multicols}{2}
\begin{itemize}
\item $f((0,0)) = id$,
\item $f((1,1)) = r_{180}$,
\item $f((1,0)) = f_v$,
\item $f((0,1)) = f_h$.
\end{itemize}
\end{multicols}

Take this map, and apply it to the group table for $\langle(\mathbb{Z}/2\mathbb{Z})\times(\mathbb{Z}/2\mathbb{Z}), +\rangle$: that is, replace each element of $(\mathbb{Z}/2\mathbb{Z})\times(\mathbb{Z}/2\mathbb{Z})$ with $\phi$ of that element!  This gives us
\begin{align*}
\begin{array}{c||c|c|c|c}
r_i + c_j \mod 2 & (0,0) & (1,1) & (1,0) & (0,1) \\\hhline{=#====}
(0,0) & (0,0)& (1,1)& (1,0)&(0,1)\\\hline
(1,1) & (1,1) & (0,0) & (0,1)& (1,0)\\\hline
(1,0) &(1,0)& (0,1)& (0,0)& (1,1)\\\hline
(0,1) & (0,1)& (1,0)& (1,1)& (0,0)\\
\end{array} \longmapsto \begin{array}{c||c|c|c|c}
\varphi(r_i + c_j \mod 2) & id & r_{180} & f_v & f_h \\\hhline{=#====}
id & id& r_{180}& f_v&f_h\\\hline
r_{180} & r_{180} & id & f_h& f_v\\\hline
f_{v} &f_v& f_h& id& r_{180}\\\hline
f_h & f_h& f_v& r_{180}& id\\
\end{array}
\end{align*}
which is just our table that we calculated earlier for the symmetries of a rectangle!  In other words, we've just explicitly shown that $\varphi(g_1 + g_2) = \varphi(g_1) \circ \varphi(g_2)$, for any $g_1, g_2 \in (\mathbb{Z}/2\mathbb{Z})\times(\mathbb{Z}/2\mathbb{Z})$.  Therefore, $\varphi$ is a group isomorphism, and these two groups are isomorphic!

The idea here is that on some fundamental level, these two groups are the ``same:'' if you're adding things in $(\mathbb{Z}/2\mathbb{Z})\times(\mathbb{Z}/2\mathbb{Z})$ or composing symmetries of a rectangle, you're really doing the \textbf{same} things, up to the labels you've assigned to objects!  This is a powerful observation to have.  Many times in mathematics, it can be useful to take a problem and rephrase it in a different way; i.e. some tools may be easier to apply to a problem that's talking about geometric transformations, while others might be easier when you're working with a more number-theoretic setting like $\mathbb{Z}/n\mathbb{Z}$!  

Notice, also, \textbf{how} we showed that these two groups were equal: by finding a \textbf{bijection} that sent one group's table to the other!  This process generalizes completely:
\begin{thm}
Two groups $\langle G, \cdot\rangle, \langle H, \star\rangle$ are isomorphic if and only if there is a bijection $\varphi: G \to H$ such that when we apply $\varphi$ to a group table of $G$, we get a group table of $H$!.
\end{thm}
Note that our claim is not that applying $\varphi$ to a group table of $G$ gives us \textbf{any} group table of $H$.  It is possible that when we look at $H$'s group table, we would have written some elements in a different order; this does not mean that our group is different, or that $\varphi$ would not be a isomorphism!  

Using these ideas, you can verify the following claims:
\begin{itemize}
\item There is one group of order 1, up to isomorphism.
\item There is one group of order 2, up to isomorphism.
\item There is one group of order 3, up to isomorphism.
\item There are two groups of order 4, up to isomorphism.
\end{itemize}
To verify these claims, use the following process:
\begin{enumerate}
\item To count groups of order $n$, take $n$ distinct elements $id, a_1, \ldots a_{n-1}$, where we've decided that $id$ is the identity element.  (One identity must exist, so we are justified in doing this, and have lost no generality in doing so thus far!)
\item Attempt to find all of the ways to fill in the $n \times n$ group table for these elements that preserves our identity and inverse properties.  Notice that this will force you to have no repeated elements in any row or column (as $rc_1 = rc_2 \Rightarrow c_1 = c_2$ by using the existence of inverses!)
\item Now that you've made all of your tables, check to see if any are isomorphic!
\item Finally, check each table for associativity.  (This is the least-fun part.)
\item The total number of nonisomorphic group tables is your total number of groups.
\end{enumerate}

We illustrate this method for $n=3$:
\begin{claim}
There is one group of order 3 up to isomorphism
\end{claim}
\begin{proof}
Take any group on three elements.  Without loss of generality, let's name its elements $\{id, x, y\}$; we can do this without losing generality because we only care about groups up to isomorphism, and thus in particular don't care about the names of our elements (as a bijection can just relabel them to anything else.)  Furthermore, assume that one of them is the identity; we can do this because we know some identity element exists.  Again, because we don't care about what things are named, we can assume that $id $ is the identity.

Consider any possible group table for these elements under any arbitrary group operation.  We know that because $id$ is an identity, we have the following entries filled in ``for free' by using the definition of identity:
\begin{align*}
\begin{array}{c||c|c|c}
r_i \cdot c_j & id & x & y \\\hhline{=#===}
id & id & x & y \\\hline
x & x & & \\\hline 
y & y & & \\
\end{array}
\end{align*}
Notice that if $x \cdot x = id$, our ``no repeats in any row or column'' idea would force $x \cdot y = y$, which would place a repeated value in $y$'s column.  This cannot happen; therefore $x \cdot x \neq id$.  We also know from this no-repeats property that $x \cdot x \neq x$, as we already have an $x$ in this row: therefore, we have $x \cdot x = y$.  
\begin{align*}
\begin{array}{c||c|c|c}
r_i \cdot c_j & id & x & y \\\hhline{=#===}
id & id & x & y \\\hline
x & x & y& \\\hline 
y & y & & \\
\end{array}
\end{align*}
Our no-repeats property then forces us to set $x \cdot y = id, y \cdot x = id,$ and $y \cdot y = x$:
\begin{align*}
\begin{array}{c||c|c|c}
r_i \cdot c_j & id & x & y \\\hhline{=#===}
id & id & x & y \\\hline
x & x & y&id\\\hline 
y & y &id&x\\
\end{array}
\end{align*}
Therefore we have at most one group table!  If you want, you could directly check that this table is associative: alternately, you can observe that this is just the table for addition mod 3, which we already know is a group!
\begin{align*}
\begin{array}{c||c|c|c}
r_i \cdot c_j & 0 & 1 & 2 \\\hhline{=#===}
0 & 0 & 1 & 2 \\\hline
1 & 1 & 2 & 0\\\hline 
2 & 2 & 0 & 1\\
\end{array}
\end{align*}
So there is only one group of order 3, as claimed.
\end{proof}

\end{document}