\documentclass{article}

\usepackage[english]{babel}
\usepackage[margin=1in]{geometry}

\usepackage{amsmath}
% for symbols such as /implies
\usepackage{amssymb}
% for symbols such as /subsetneq
\usepackage{amsthm}
% for commands such as \newtheorem

\theoremstyle{definition}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}
\newtheorem{axiom}{Axiom}

\begin{document}

\section{Groups}

% binary operation/ closed under binary operation
\begin{definition}
  A \emph{binary operation} on a set $S$ is a function $*: S\times S \to S$. For $a,b\in S$, we denote $*(a,b)$ by $a*b$, or simply $ab$.
  If $*$ is a binary opeation on $S$ and $A\subseteq S$, then $A$ is \emph{closed under} $*$ if for each $a,b\in A$ one has $a*b\in A$.
\end{definition}

% associative, commutative
\begin{definition}
  Let $*$ be a binary operation on a set $S$.
  \begin{enumerate}
    \item We call $*$ \emph{associative} if
    $$
      \forall a,b,c\in S \quad (a*b)*c = a*(b*c)
    $$
    \item We call $*$ \emph{commutative} if
    $$
      \forall a,b\in S \quad a*b = b*a
    $$
  \end{enumerate}
\end{definition}

% group
\begin{definition}
  A \emph{group} is a set $G$ with a binary operation $* : G\times G \to G$ satisfying the following.
  \begin{enumerate}
    \item The operation $*$ is associative.
    \item There is $e\in G$ such that for any $g\in G$ one has $g*e=e*g=g$. Such an $e$ is an \emph{identity} of $G$.
    \item For each $g\in G$ there is $g^{-1}\in G$ such that $g*g^{-1}=g^{-1}*g=e$ where $e$ is an identity of $G$. Such a $g^{-1}$ is an \emph{inverse} of $g$.
  \end{enumerate}
\end{definition}

\begin{theorem}
  If $G$ is a group, the identity $e\in G$ is unique.
  \begin{proof}
    Let $G$ be a group. Suppose $e_1\in G$ and $e_2\in G$ are identities. Then $e_1 = e_1 * e_2 = e_2$.
  \end{proof}
\end{theorem}

\begin{theorem}
  If $G$ is a group, for each $g\in G$ the inverse $g^{-1}\in G$ is unique.
  \begin{proof}
    Let $G$ be a group. Let $g\in G$. Suppose $g_1\in G$ and $g_2\in G$ are inverses of $g$. Then
    $$
      g_1 = e * g_1 = (g_2 * g) * g_1 = g_2 * (g * g_1) = g_2 * e = g_2.
    $$
  \end{proof}
\end{theorem}

% subgroup
\begin{definition}
  If $G$ is a group and $H\subseteq G$ is a group with the same binary operation as $G$, then $H$ is a \emph{subgroup} of $G$, denoted $H\leq G$.
\end{definition}

\begin{theorem}
  If $G$ is a group and $H\subseteq G$, then $H\leq G$ if and only if $e\in H$ and for all $x,y\in H$ one has $xy^{-1}\in H$.
  \begin{proof}
  Let $G$ be a group.
  
  Suppose $H\leq G$. Then $H\subseteq G$ is a group with the same binary operation as $G$. Let $x,y\in H$. Since $H$ is a group, $y^{-1}\in H$. Since $H\subseteq G$, we have $y,y^{-1}\in G$. Then $y y^{-1} = e$. Since $H$ is a group, we have $e\in H$ and $xy^{-1}\in H$.

  Suppose $H\subseteq G$, $e\in H$, and for all $x,y\in H$ one has $xy^{-1}\in H$. Let $a\in H$. Since $H\subseteq G$, we have $a\in G$. Then $ae=ea=a$ and $e$ is an identity of $H$. Since $e,a\in H$, we have $a^{-1} = ea^{-1} \in H$. Then $H$ has inverses. Since the operation on $G$ is associative and $H\subseteq G$, it follows that the operation on $G$ is associative on $H$. Then $H\leq G$.
\end{proof}
\end{theorem}
    
\begin{example}
  For any group $G$, we have $G\leq G$ and $\{e\}\leq G$. The latter is called the \emph{trivial subgroup}.
\end{example}

\begin{theorem}
  Let $G$ be a group and let $\mathcal{H}$ be a nonempty collection of subgroups of $G$. Then $\cap\mathcal{H}\leq G$.
  \begin{proof}
    Since each $H\in\mathcal{H}$ is a subgroup of $G$, we have $e\in H$. Then $e\in\cap\mathcal{H}$. Let $x,y\in\cap\mathcal{H}$. Then $x,y\in H$ for each $H\in\mathcal{H}$. Since each $H\in\mathcal{H}$ is a subgroup of $G$, we have $xy^{-1}\in H$. Then $xy^{-1}\in\cap\mathcal{H}$. It follows that $\cap\mathcal{H}\leq G$.
  \end{proof}
\end{theorem}

\begin{definition}
  Let $G$ be a group. Let $S\subseteq G$. The \emph{subgroup generated} by $S$, denoted $\langle S\rangle$, is the intersection of all subgroups of $G$ containing $S$. That is
  $$
    \langle S \rangle = \bigcap \{H\leq G : S\subseteq H\}
  $$
  If $S$ is a finite set, we may denote $\langle S\rangle$ by listing the elements of $S$ surrounded by angle brackets and separated by commas.
\end{definition}

\begin{example}
  If $S = \{x\}$, we write $\langle x\rangle$ in place of $\langle S\rangle$. If $S=\{x,y\}$, we write $\langle x, y\rangle$ in place of $\langle S\rangle$.
\end{example}

\begin{theorem}
  Let $G$ be a group. Let $S\subseteq G$ by nonempty. Let $S^{-1} = \{s^{-1} : s\in S\}$. Then $\langle S\rangle$ is the set of all products of elements in $S\cup S^{-1}$ using the operation in $G$.
  $$
    \langle S\rangle = \bigcup_{n=1}^\infty \left\{\prod_{j=1}^n a_j : a_1,\dots,a_n \in S\cup S^{-1}\right\}
  $$
  \begin{proof}
    Let $H$ be the set of all products of elements in $S\cup S^{-1}$ using the operation in $G$. 
    
    Let $s\in S$. Then $e=ss^{-1}\in H$. Let $x,y\in H$. Then there are positive integers $m$ and $n$ and elements $(x_j)_{j=1}^m$ and $(y_j)_{j=1}^n$ of $S\cup S^{-1}$ such that $x=\prod_{j=1}^m x_j$ and $y=\prod_{j=1}^n y_j$. Then $xy^{-1} = \prod_{j=1}^m x_j \prod_{j=1}^n y_{n-j+1}^{-1} \in H$. 
    
    Then $H\leq G$. Moreover, $S\subseteq H$ since $H$ contains products of just one element of $S$. Then $\langle S\rangle \subseteq H$.

    Let $K\leq G$ be a subgroup with $S\subseteq K$. Since $K$ is a group, $S^{-1}\subseteq K$, and any product of elements in $S\cup S^{-1}$ using the operation in $K$ is an element of $K$. Since $K\leq G$, the operation in $K$ is the same as the operation in $G$. Then $H\subseteq K$. Since $K$ is arbitrary, we have $H\subseteq \langle S\rangle$. Then $H=\langle S\rangle$.
  \end{proof}
\end{theorem}

% order
\begin{definition}
  The \emph{order} of a group $G$ is the cardinality of the set $G$, denoted $|G|$. The \emph{order} of an element $x\in G$ is the smallest $n\in\mathbb{Z}_+$ such that $x^n=e$, denoted $|x|$. If there is no such $n$, we say that $x$ has infinite order.
\end{definition}

\begin{theorem}
  Let $G$ be a group. If $x\in G$, then $|\langle x\rangle| = |x|$.
  \begin{proof}
    WIP
  \end{proof}
\end{theorem}

% cosets
\begin{definition}
  Let $G$ be a group and $H\leq G$. For each $g\in G$, we define the \emph{left coset} of $H$ with $g$ as the set
  $$
    gH = \{gh\in G: h\in H\}
  $$
  and the \emph{right coset} of $H$ with $g$ as the set
  $$
    Hg = \{hg\in G: h\in H\}
  $$
  For each $g\in G$, we also define the set
  $$
    gHg^{-1} = \{ghg^{-1} : h\in H\}
  $$
\end{definition}

\begin{lemma}
  Let $G$ be a group and $H\leq G$. Let $x,y\in G$. The following are equivalent.
  \begin{enumerate}
    \item $xH=yH$
    \item $x\in yH$
    \item $y\in xH$
    \item $x^{-1}y\in H$
  \end{enumerate}
  \begin{proof}
    We show $1.\implies 2.\implies 3.\implies 4.\implies 1$.

    ($1.\implies 2$.) Suppose $xH=yH$. Since $e\in H$, we have $x=xe\in xH=yH$.

    ($2.\implies 3$.) Suppose $x\in yH$. Then there is $h\in H$ with $x=yh$. Since $H\leq G$, we have $h^{-1}\in H$. Then $y=xh^{-1} \in xH$.

    ($3.\implies 4$.) Suppose $y\in xH$. Then there is $h\in H$ with $y=xh$. Then $x^{-1}y = h\in H$.

    ($4.\implies 1$.)
    Suppose $x^{-1}y\in H$. Let $h=x^{-1}y$. Let $a\in xH$. Then there is $h_1\in H$ such that $a=xh_1$. Then
    $$
      a = xh_1 = y h^{-1} h_1 \in yH.
    $$
    Hence $xH\subseteq yH$. Let $b\in yH$. Then there is $h_2\in H$ such that $b=yh_2$. Then
    $$
      b = yh_2 = xh h_2 \in xH.
    $$
    Hence $yH\subseteq xH$. It follows that $xH=yH$.
  \end{proof}
\end{lemma}

\begin{lemma}
  Let $G$ be a group and $H\leq G$. Let $x,y\in G$. The following are equivalent.
  \begin{enumerate}
    \item $Hx=Hy$
    \item $x\in Hy$
    \item $y\in Hx$
    \item $xy^{-1}\in H$
  \end{enumerate}
  \begin{proof}
    We show $1.\implies 2.\implies 3.\implies 4.\implies 1$.

    ($1.\implies 2$.) Suppose $Hx=Hy$. Since $e\in H$, we have $x=ex\in Hx=Hy$.

    ($2.\implies 3$.) Suppose $x\in Hy$. Then there is $h\in H$ with $x=hy$. Since $H\leq G$, we have $h^{-1}\in H$. Then $y=h^{-1}x \in Hx$.

    ($3.\implies 4$.) Suppose $y\in Hx$. Then there is $h\in H$ with $y=hx$. Since $H\leq G$, we have $h^{-1}\in H$. Then $xy^{-1} = h^{-1}\in H$.

    ($4.\implies 1$.) Suppose $xy^{-1}\in H$. Let $h=xy^{-1}$. Let $a\in Hx$. Then there is $h_1\in H$ such that $a=h_1 x$. Then
    $$
      a = h_1 x = h_1 h y \in Hy.
    $$
    Hence $Hx\subseteq Hy$. Let $b\in Hy$. Then there is $h_2\in H$ such that $b=h_2 y$. Then
    $$
      b = h_2 y = h_2 h^{-1} x \in Hx.
    $$
    Hence $Hy\subseteq Hx$. It follows that $Hx=Hy$.
  \end{proof}
\end{lemma}

\begin{lemma}
  Let $G$ be a group and $H\leq G$. Then the set of left cosets of $H$ with elements of $G$ has the same cardinality as the set of right cosets of $H$ with elements of $G$. That is
  $$
    |\{gH : g\in G\}| = |\{Hg : g\in G\}|
  $$
  \begin{proof}
    Define a function $f:\{gH : g\in G\}\to \{Hg : g\in G\}$ by $f(gH) = Hg^{-1}$. We first check that this function is well-defined. Suppose for $g_1,g_2\in G$ that $g_1 H = g_2 H$. Then $g_1^{-1} g_2 \in H$. Then $Hg_1^{-1} = Hg_2^{-1}$ and the function $f$ is well-defined.

    Let $Hg$ be a right coset. We have $(g^{-1})^{-1}g^{-1}=e\in H$. Then $Hg = H(g^{-1})^{-1}=f(g^{-1}H)$. Hence $f$ is surjective.

    Suppose for left cosets $g_1 H$ and $g_2 H$ that $f(g_1 H) = f(g_2 H)$. Then $Hg_1^{-1} = Hg_2^{-1}$. Then $g_1^{-1}g_2 = g_1^{-1}(g_2^{-1})^{-1}\in H$. Then $g_1 H = g_2 H$. Hence $f$ is injective.

    Then $f$ is bijective and the proof is complete.
  \end{proof}
\end{lemma}

\begin{definition}
  Let $G$ be a group and $H\leq G$. The \emph{index} of $H$ in $G$, denoted $[G:H]$ is the cardinality of the set of cosets of $H$ with elements of $G$. That is
  $$
    [G:H] = |\{gH : g\in G\}| = |\{Hg : g\in G\}|
  $$
\end{definition}

\begin{lemma}
  Let $G$ be a group and $H\leq G$. Then all cosets of $H$ by elements of $G$, whether they are left or right cosets, have the same cardinality as $H$.
  \begin{proof}
    \textbf{Part 1:} We first show that all left cosets have the same cardinality. 
    
    Let $aH$ and $bH$ be left cosets. Define $f:aH\to bH$ by $f(ah)=bh$. We first check that this function is well-defined. Suppose for $h_1,h_2\in H$ that $ah_1 = ah_2$. Then $h_1 = a^{-1}ah_1 = a^{-1}ah_2 = h_2$. Hence $bh_1 = bh_2$ and $f$ is well-defined. 

    Let $y\in bH$. Then there is $h\in H$ with $y=bh$. Then $y=bh=f(ah)$ and $f$ is surjective.

    Suppose for $x,y\in aH$ that $f(x)=f(y)$. There are $h_1,h_2\in H$ such that $x=ah_1$ and $y=ah_2$. Then $bh_1=bh_2$ and so $h_1=b^{-1}bh_1 = b^{-1}bh_2 = h_2$. Then $x=ah_1=ah_2=y$ and $f$ is injective.

    Then $f$ is bijective. Hence all left cosets have the same cardinality.

    \textbf{Part 2:} We now show that all right cosets have the same cardinality.

    Let $Ha$ and $Hb$ be right cosets. Define $f:Ha\to Hb$ by $f(ha)=hb$. We first check that this function is well-defined. Suppose for $h_1,h_2\in H$ that $h_1 a = h_2 b$. Then $h_1 = h_1 aa^{-1} = h_2 aa^{-1} = h_2$. Hence $h_1 b = h_2 b$ and $f$ is well-defined.

    Let $y\in Hb$. Then there is $h\in H$ with $y=hb$. Then $y=hb=f(ha)$ and $f$ is surjective.

    Suppose for $x,y\in Ha$ that $f(x)=f(y)$. There are $h_1,h_2\in H$ such that $x=h_1 a$ and $y=h_2 a$. Then $h_1 b = h_2 b$ and so $h_1 = h_1 bb^{-1} = h_2 bb^{-1} = h_2$. Then $x = h_1 a = h_2 a = y$ and $f$ is injective.

    Then $f$ is bijective. Hence all right cosets have the same cardinality.

    \textbf{Part 3:} We finish by showing that left and right cosets have the same cardinality.

    Let $aH$ and $Hb$ be left and right cosets, respectively. Define $f:aH\to Hb$ by $f(ah)=hb$. We first check that this function is well-defined. Suppose for $h_1,h_2\in H$ that $ah_1 = ah_2$. Then $h_1 = h_2$ and so $h_1 b = h_2 b$ and $f$ is well-defined.

    Let $y\in Hb$. Then there is $h\in H$ with $y=hb$. Then $y=hb=f(ah)$ and $f$ is surjective.

    Suppose for $x,y\in aH$ that $f(x)=f(y)$. There are $h_1,h_2\in H$ such that $x=ah_1$ and $y=ah_2$. Then $h_1 b = h_2 b$ and so $h_1 = h_2$. Then $x = a h_1 = a h_2 = y$ and $f$ is injective.

    Then $f$ is bijective. Hence all cosets have the same cardinality. Since $H=eH=He$ is a coset, all cosets have cardinality $|H|$.
  \end{proof}
\end{lemma}

\begin{lemma}
  Let $G$ be a group and $H\leq G$. Then the relation $\sim$ on $G$ defined by $x\sim y$ if and only if $x^{-1}y\in H$ is an equivalence relation. 
  The set of equivalence classes is the set of left cosets of $H$ with elements of $G$
  $$
    \{[g] : g\in G\} = \{ gH : g\in G\}
  $$
  \begin{proof}
    Let $x,y,z\in G$. Since $H\leq G$, we have $x^{-1}x=e\in H$. Then $x\sim x$ and $\sim$ is reflexive. 
    
    Suppose $x\sim y$. Then $x^{-1}y\in H$. Since $H\leq G$, we have $y^{-1}x = (x^{-1}y)^{-1}\in H$. Then $y\sim x$ and $\sim$ is symmetric.

    Suppose $x\sim y$ and $y\sim z$. Then $x^{-1}y\in H$ and $y^{-1}z\in H$. Since $H\leq G$, we have $x^{-1}z = x^{-1}yy^{-1}z\in H$. Then $x\sim z$ and $\sim$ is transitive. 
    
    Then $\sim$ is an equivalence relation on $G$. Let $g\in G$ and consider the equivalence class $[g]$. We have
    $$
      x \in [g] \iff x \sim g \iff x^{-1}g\in H \iff xH = gH \iff x\in gH.
    $$
    It follows that the set of equivalence classes is the set of left cosets of $H$ with elements of $G$.
  \end{proof}
\end{lemma}

\begin{theorem}[Lagrange]
  If $G$ is a finite group and $H\leq G$, then
  $$
    |G| = [G:H] \cdot |H|
  $$
  In particular, the order of $H$ divides the order of $G$.
  \begin{proof}
    Let $G$ be a finite group with $H\leq G$. Then $H\subseteq G$ and $H$ is finite. The relation $\sim$ on $G$ defined by $x\sim y$ if and only if $x^{-1}y\in H$ is an equivalence relation. The equivalence classes are left cosets of $H$ with elements of $G$, which all have cardinality $|H|$. The equivalence classes form a partition of $G$ and there are $[G:H]$ left cosets of $H$ with elements of $G$. It follows that
    $$
      |G| = [G:H] \cdot |H|.
    $$
  \end{proof}
\end{theorem}

\begin{corollary}
  If $G$ is a finite group and $x\in G$, then the order of $x$ divides the order of $G$.
  \begin{proof}
    Let $G$ be a finite group and let $x\in G$. Then $H = \langle x\rangle$ is a subgroup of $G$ with $|H|=|x|$. By Lagrange's theorem, the order of $H$ divides the order of $G$. Hence the order of $x$ divides the order of $G$.
  \end{proof}
\end{corollary}

\begin{definition}
  Let $G$ be a group. A subgroup $N\leq G$ is a \emph{normal subgroup} if for all $g\in G$ one has $gN=Ng$. We denote this as $N\trianglelefteq G$.
\end{definition}

\begin{theorem}
  Let $G$ be a group and $N\leq G$. The following are equivalent.
  \begin{enumerate}
    \item For all $g\in G$, one has $gN=Ng$. That is, $N\trianglelefteq G$.
    \item For all $g\in G$, one has $gNg^{-1} = N$.
    \item For all $g\in G$ and $n\in N$, one has $gng^{-1}\in N$.
  \end{enumerate}
  \begin{proof}
    WIP
  \end{proof}
\end{theorem}

\end{document}