\documentclass[master.tex]{subfiles}

%%%%%%%%%%%%%% BEGIN CONTENT: %%%%%%%%%%%%%%

\begin{document}
\section{Group Theory}
\subsection{Basic Facts}
\subsection*{Lecture 1: Normalizers and Centralizers}
\begin{defn*}[1.1.1]
    For $A \subset G$, we set $N_G(A) := \{g \in G | gAg^{-1} = A\}$ and
    $C_G(A) := \{g \in G | gag^{-1} = a, \forall a \in A\}$.
\end{defn*}
Note that $C_G(A) \subset N_G(A)$ and $Z(G) = C_G(G)$.
\begin{rmk*}[1.1.2a]
    If $A \subgroup G$, then $A \normsubgroup N_G(A)$. In fact, $N_G(A)$ is the
    largest subgroup of $G$ in which $A$ is normal.
\end{rmk*}
    The first part of this remark follows from the definition of $N_G(A)$. The
    second part follows by assuming that $N_G(A)$ is not the largest and then
    showing the ``largest'' is contained in $N_G(A)$.
\begin{rmk*}[1.1.2b]
    If $A \subgroup G$, then $A \normsubgroup G$ if $N_G(A) = G$.
\end{rmk*}
    This follows from the second part of the remark above.
    Now for some remakrs about centralizers.
    \begin{rmk*}[1.1.3]
      \begin{enumerate}
      \item If $A \subgroup G$, then $A$ is abelian if and only if $A \subset
        C_G(A)$.
      \item Furthermore, if $A \subgroup Z(G)$, then $A \normsubgroup G$.
        This follows using basic commutativity arguments.
      \end{enumerate}

    \end{rmk*}
    \begin{example}[1.1.4]
        $Z(S_n) = \{ id \}$ if $n \geq 3$. To prove this, prove $\sigma \in S_n, \sigma \neq id \implies \sigma \notin Z(S_n)$.

        $\sigma \neq id \implies \exists i,j \in \{1, \ldots, n\}$ where $i
        \neq j$ such that $\sigma(i) = j$. Now, choose $k \in \{1, \ldots, n\}$
        such that $k \neq i,j$. Now, let $\pi = \sigma(i,k)\sigma^{-1} =
        (\sigma(i), \sigma(j)) = (j, \sigma(k))$. So now, $\pi(j) = \sigma(k)
        \neq \sigma(i) = j$. However, $(ik)(j)=j$ since $j \neq i,k$. This
        means $\pi \neq (ik)$, but if $\sigma$ were in the center, then it
        would have. So, we have that $\sigma \notin C_{S_n}( (ik) ) \implies
        \sigma \notin Z(S_n)$.
    \end{example}
    \begin{lem}[1.1.5]
        Let $G$ be a group and $H \subgroup Z(G)$. (Note this implies $H
        \normsubgroup G$.) If $G/H$ is cyclic, then $G$ is abelian.
    \end{lem}
    \begin{proof}
        Since $G/H$ is cyclic, this means $\exists g \in G$ such that
        $G/H=\langle gH \rangle$. Now, let $x,y \in G$. Then, there are $n,m
        \in \Z$ such that $xH = (gH)^n = g^nH$ and, similarly, $yH = (gH)^m =
        g^mH$. This means $\exists h,h' \in H$ such that $x=g^nh$ and
        $y=g^mh'$. Thus, we get $xy = g^nhg^mh' = g^ng^mhh' = g^{n+m}hh'$ and
        $yx = g^mh'g^nh = g^mg^nh'h = g^{n+m}h'h = g^{n+m}hh'$. Thus, we have
        our commutativity, thereby showing $G$ is abelian.
    \end{proof}
    \begin{rmk*}
        Note, simply having $H \subgroup Z(G)$ and $G/H$ abelian does not imply
        $G$ is abelian. For a counter-example, look at $Q_8 = \{\pm 1, \pm i,
        \pm j, \pm k\}$, the standard quaternion group. It is easy to compute
        that $Z(Q_8) = \{\pm 1\}$. Now, $Q_8/Z(Q_8) \isom \Z_2 \times \Z_2$,
        the Klien-4 group, which is abelian. However, $Q_8$ is not abelian!
    \end{rmk*}
    \begin{defn}
        Let $A,B \subgroup G$, then \begin{itemize}
            \item $A^{-1} = \{a^{-1} | a \in A\}$.
            \item $AB = \{ab | a \in A, b \in B\}$.
        \end{itemize}
    \end{defn}
    \begin{lem}[1.1.6]
        Let $G$ be a group with $A,B \subgroup G$. Then,
        \begin{enumerate}
            \item $AB \subgroup G$ if and only if $AB = BA$.
            \item If $A \subgroup N_G(B)$ or $B \subgroup N_G(A)$, then $AB =
                BA$ and hence $AB \subgroup G$ by 1.
        \end{enumerate}
    \end{lem}
    \begin{proof}
        ($\Rightarrow$) Let $AB \subgroup G$. Then, $AB = (AB)^{-1} =
        B^{-1}A^{-1} = BA$.

        ($\Leftarrow$) Let $AB = BA$. Then, we simply must show that $AB$ has
        group properties.\begin{enumerate}
            \item $e \in A, e \in B \implies e = ee \in AB$.
            \item This is the same as above. $(AB)^{-1} = B^{-1}A^{-1} = B! = AB$.
            \item $(AB)(AB) = A(BA)B = A(AB)B = (AA)(BB) = AB$.
        \end{enumerate} Thus, $AB \subgroup G$.

        Now, for the second part, let $A \subgroup N_G(B)$. Then, let $a \in A,
        b \in B$. We know $a,a^{-1} \in A \subset N_G(B)$. Then, we have $ab =
        aba^{-1}a = (aba^{-1})a$. However, we know $aba^{-1} \in B$ from the
        definition of $N_G(B)$. So, $AB \subset BA$. Similar logic shows $BA
        \subset AB$ and thus $AB = BA$.
    \end{proof}
    \subsection*{Lecture 2}
    \begin{rmk*}
        \begin{enumerate}
            \item If $A,B \subgroup G$ and if $A \normsubgroup G$ or
              $B \normsubgroup G$, then $AB \subgroup G$.
            \item If $A,B \normsubgroup G$, then $AB \normsubgroup
              G$.
        \end{enumerate}
    \end{rmk*}
    \begin{proof}
        The first remark can be done by $(ab)(a'b') = aba'b^{-1}bb' =
        aa'b' = (aba'b^{-1})b' \in AB$ because $a$ and $ba'b^{-1}$ are
        in $A$ and $b \in B$. Also, $(ab)^{-1} = b^{-1}a^{-1} =
        (b^{1}a^{-1}b)b^{-1} \in AB$. The identity inclusion is
        obvious.

        The second remark is proven by, for $g \in G$, $gABg^{-1} =
        gAg^{-1}gBg^{-1} = AB$.
    \end{proof}

    \subsubsection*{Index Computations}

    \begin{lem}
        Let $A,B \subgroup G$ and $|A|, |B| < \infty$. Then, $|AB| = \frac{|A| \cdot |B|}{|A \cap B|}$.
    \end{lem}
    \begin{proof}
        Consider $A/(A \cap B)$. Take a complete set of coset representatives $A' = \{a_1, \ldots, a_n\}$. Then, $n = |A/(A \cap B)| = [A : A \cap B] = \frac{|A|}{|A \cap B|}$ by Lagrange's Theorem.

        Now, consider $f: A' \times B \to AB$ defined by $(a_i,b) \to a_ib$. If
        we show that $f$ is bijective, then we will have that $|A'| \cdot |B| =
        |A' \times B| = |AB|$, which will allow us to finish the proof.
        To show $f$ is injective, let us take \begin{align*}
            a_ib = a_jb' (1 \leq i,j \leq n; b,b' \in B) & \ \implies \ a_j^{-1} a_i = b'b^{-1} \in A\cap B\\
            \ & \ \implies \ a_i(A \cap B) = a_j(A \cap B) \\
            \ & \ \implies \ a_i = a_j \\
            a_ib = a_jb' & \ \implies b = b' \\
            \ & \ \implies (a_i, b) = (a_j, b')
        \end{align*}

        To show $f$ is surjective, we let $a \in A, b \in B$. Then $\exists i
        (1 \leq i \leq n)$ such that $a=a_ix$ with $x \in A \cup B$. This
        implies that $xb \in B$ so $ab = a_ixb = f( (a_i,xb) )$.

        Thus, we have that $f$ is bijective, and so we conclude that $n \cdot
        |B| = \frac{|A|}{|A \cap B|} \cdot |B|$ giving us our result when we
        divide by $|B|$.
    \end{proof}
    \begin{example}
        (a) $G = \Sym_3, A = \langle (12) \rangle, B = \langle (13) \rangle
        \subgroup G$. Then, $A \cap B = \{ id \} \implies |AB| = 2 \cdot 2 = 4$
        which does not divide $6 = |\Sym_3|$. Thus, $AB$ is not a subgroup of
        $\Sym_3$.
        (b) Let $G=\Sym_4, A = \Sym_3 \to \Sym_4, B = \langle (1234) \rangle$. Then, $A \cap B = \{id\} \implies |AB| = |A||B| = 6 \cdot 4 = 24 = |\Sym_4|$. This means that $AB = \Sym_4$ but note that $A \not\subset N_G(B)$ and $B \not\subset N_G(A)$.
    \end{example}
    \begin{lem}
        Let $G$ be a group and $A,B \subgroup G$. Then
        \begin{enumerate}
            \item If $A \subgroup B$, then $[G:A] = [G:B][B:A]$
            \item $[A: A \cap B] \leq [G:B]$
            \item $[G: A \cap B] \leq [G:A][G:B]$
        \end{enumerate}
    \end{lem}
    \begin{proof}
       For the first part, fix a set of coset representatives (using the Axiom of Choice in the infinite case) for $G/A$. Then, given a coset $gA$, we can TODO
\end{proof}
\subsection*{The Isomorphism Theorems}
\begin{thm}[1.1.10 First Isomorphism Theorem]
    If $\phi: G \to H$ is a group homomorphism, then $G/\ker \phi
    \isom \phi(G) \subgroup H$.
\end{thm}
\begin{proof}
    Set $N = \ker \phi \normsubgroup G$. Then, consider $\widetilde{\phi}: G/N
    \to \phi(G)$ defined by $\widetilde{\phi}(gN) = \phi(g)$. First, we check
    that $\widetilde{\phi}$ is well-defined.

    Assume $gN = g'N, g,g' \in G$. Then, there exists $n \in N$ such that $g'
    = gn$. This tells us that $\phi(g') = \phi(gn) = \phi(g)\phi(n) = \phi(g)e
    = \phi(g)$. Now, we show that $\widetilde{\phi}$ is a group homomorphism.

    Check $\widetilde{\phi}( (gN)(g'N) ) = \widetilde{\phi}(gg'N) = \phi(gg') =
    \phi(g)\phi(g') = \widetilde{\phi}(gN) \widetilde{\phi}(g'N)$.

    We know $\widetilde{\phi}$ is surjective by definition.

    To show $\widetilde{\phi}$ is injective, it suffices to show that $\ker
    \widetilde{\phi} = \{\widetilde{e} = eN\}$. If $\widetilde{\phi}(gN) =
    \phi(g) = e \in H$, then $g \in \ker \phi = N$ and therefore $gN = N =
    \widetilde{e}$
\end{proof}
\begin{cor}
    (Second Isomorphism Theorem) If $A,B \subgroup G$ and $A \subgroup N_G(B)$,
    then $AB/B \isom A/A\cap B$.
\end{cor}
\begin{proof}
    First, we know since $A \subgroup N_G(B)$ that $AB \subgroup N_G(B)$. Then,
    by definition of normalizer, $B \normsubgroup AB$. Now, define a group
    homomorphism $\phi: A \to AB/B$ by $\phi(a) = aB$. Then, we can use the
    first isomorphism theorem to get that $A/\ker \phi \isom \phi(A)$. Now,
    $\ker \phi$ is the set of all $a \in A$ that map to an element in $B$. This
    clearly only happens when $a \in B$. So, $\ker \phi = A \cap B$.
    Furthermore, it is clear $\phi(A) = AB/B$ (as opposed to $A/B$) because $B$
    need not be a subset of $A$. Thus, elements of the form $aB$ where $a \in A$
    are in $AB/B$. (This part is still unclear to me.) Thus, we get $A/A \cap B
    \isom AB/B$.
\end{proof}
The second isomorphism theorem is sometimes referred to as the ``diamond
theorem'' because if you draw a diagram of what is happening, it is a diamond
with $A, B, AB$, and $A \cap B$.
\begin{cor}
    (Third Isomorphism Theorem) If $A,B \normsubgroup G$ and $A \subgroup B$, then $(G/A)/(B/A) \isom G/B$.
\end{cor}
\begin{proof}
    Let us define a group homomorphism $\phi: G/A \to G/B$ by $\phi(gA) = gB$.
    Then, let us examine $\ker \phi$. We note that if $t \in B$,
    then $\phi(tA) = B$. Thus, $\ker \phi = \{tA | t \in B\} = B/A$. Now, applying the first
    isomorphism theorem with $\phi$, we get that $(G/A)/(B/A) \isom \phi(G/A)$.
    $\phi$ is clearly surjective because $A \subgroup B$, so we conclude that
    $(G/A)/(B/A) \isom G/B$.
\end{proof}

These isomorphism theorems are useful in many proof techniques and there are
analogues for many different algebraic structures. Next, we consider the
Correspondance Theorem which is sometimes referred to as the fourth isomorphism
theorem. The fundamental idea of the correspondance theorem is that the
structure of subgroups of $G/N$ for $N \normsubgroup G$ is the same as the
structore of the subgroups of $G$ containing $N$ where $N$ is ``collapsed'' as
the identity element.

\begin{thm}[Lattice Isomorphism Theorem]
    Let $G$ be a group, $N \normsubgroup G$, and $\overline{G} = G/N$. Next, let
    $\phi_N = \{ A \subgroup G | N \subgroup A \}$ and $\overline{\phi}$ be the
    set of all subgroups of $\overline{G}$. Then, all the following are true for $A,B \in \phi_N$.
    \begin{enumerate}[label=(\alph*)]
        \item $A \subgroup B$ if and only if $\overline{A} \subgroup \overline{B}$..
        \item $A \normsubgroup B$ if and only if $\overline{A} \normsubgroup
            \overline{B}$.
        \item If $A \subgroup B$, then $[B:A] = [\overline{B}:\overline{A}]$.
        \item $\overline{\langle A, B \rangle} = \langle \overline{A}, \overline{B} \rangle$
        \item $\overline{A \cap B} = \overline{A} \cap \overline{B}$.
        \item The map $\rho: \phi_N \to \overline{\phi}$ where $\rho(A) =
            \overline{A}$ is bijective.
        \item A map from $\{ A \in \phi_N | A \normsubgroup G\}$ to the set of
            normal subgroups of $\overline{G}$ defined by $A \mapsto
            \overline{A}$ is bijective.
    \end{enumerate}
\end{thm}
\begin{proof}
    Proofs for (a) -- (d) were left as an exercise (to be filled in later).
    For (e), let $\pi: G \twoheadrightarrow \overline{G}$ be the surjective
    group homomorphism defined by $\pi(g) = gN$. Now, consider $\psi:
    \overline{\phi} \to \phi_N$ defined by $\psi(H) = \pi^{-1}(H) \subgroup G$.
    Then, we want to show that $\rho \circ \psi = id_{\overline{\phi}}$ and
    $\psi \circ \rho = id_{\phi_N}$ because then we will know $\rho$ is
    invertible and thus bijective.

    Examine $\rho \circ \psi$. We know that $(\rho \circ \psi)(H) =
    \rho(\pi^{-1}(H))$. Now, note that $\rho(A)$ is the image of $\pi(A)$, so
    we get $\rho(\pi^{-1}(H)) = \pi(\pi^{-1}(H)) = H$ because $\pi$ is
    surjective.

    Next, examine $\psi \circ \rho$. We then get that $(\psi \circ \rho)(A) =
    \pi^{-1}(\pi(A))$ for $A \subgroup G$. We would like for this to be equal
    $A$. It is clear that $A \subset \pi^{-1}(\pi(A))$ because the pre-image of
    $A/N$ under $\pi$ must at least contain $A$. So, we still need to show that
    $\pi^{-1}(\pi(A)) \subset A$. To do this, take $x \in \pi^{-1}(A/N)$. Then,
    $xN = \pi(x) \in A/B$, so $xN = aN$ for some $a \in A$. This means that
    there exists an $n \in N$ such that $x = an$ since $N \subgroup A$. So,
    $\pi^{-1}(A/N) \subset A$.

    Thus, we have shown that $\rho$ and $\psi$ are bijective maps that are
    inverse to each other and we have proven (e). \\

    (f) follows from the same proof technique as (e), I believe.
\end{proof}

\subsubsection*{Commutators}

\begin{defn}
    The commutator of two elements $x,y \in G$ is defined as \[
        [x,y] = xyx^{-1}y^{-1}
    \]
\end{defn}

Note that mathematicians have not completely agreed on the definition and thus
some references will say $[x,y] = x^{-1}y^{-1}xy$. In essence, the commutator
of two elements indicates how ``close'' elements are to commuting. This can be
seen in the following lemma.

\begin{lem}
    For $x,y,z \in G$, we obtain
    \begin{enumerate}[label=(\alph*)]
        \item $[x,y] = e$ if and only if $xy=yx$ if and only if $[x^{-1},y^{-1}] = e$.
        \item $[x,y]^{-1} = [y,x]$.
        \item $z[x,y]z^{-1} = [zxz^{-1},zyz^{-1}]$.
        \item If $\phi: G \to H$ is a group homoromorphism, then $[\phi(g),\phi(h)] = \phi([g,h])$.
        \item $xy = [x,y]yx = yx[x^{-1},y^{-1}]$.
        \item $[xy,z] = x[y,z]x^{-1}[x,z]$
        \item $[x,yz] = [x,y]y[x,z]z^{-1}$.
    \end{enumerate}
\end{lem}
\begin{proof}
    All proofs are straightforward computations.
\end{proof}
\subsection*{Lecture 3: Continuing with Commutators}
\begin{defn}
    Let $A, B \subgroup G$. Then, the \emph{commutator} of $A$ and $B$ is the
    subgroup of $G$ denoted $[A,B] = \langle \{[a,b] | a \in A, b \in B\}
    \rangle$. Also note that $[G,G]$ is called the \emph{commutator subgroup of
    $G$}.
\end{defn}
\begin{rmk}
    Let $A,B \subgroup G$. Then
    \begin{enumerate}
        \item $[A,B] = \{e\}$ if and only if $ab = ba, \forall a \in A, b \in B$
            if and only if $A \subgroup C_G(B)$ if and only if $B \subgroup
            C_G(A)$. In this case, we say that $A$ and $B$ commute.
        \item $[G,G] = \{e\}$ if and only if $G$ is abelian if and only if $Z(G) = G$.
        \item $[A,B] = [B,A]$ since $[a,b]^{-1} = [b,a]$.
        \item (matt) $[G,G]$ is characteristic in $G$.
    \end{enumerate}
\end{rmk}
\begin{example}
    \begin{enumerate}
        \item $[Q_8,Q_8] = \{1,-1\} = [\langle i \rangle, \langle j \rangle]$.
            This can be seen because $[i,j] = iji^{-1}j^{-1} = ij(-i)(-j) =
            ij(-i)(-j) = iij(-j) = -i^2j^2 = -1$.
        \item $[A_n, \langle (12) \rangle] = A_n$ for $n \geq 2$. This follows
            because, for $i \geq 3$, we get $[(1i2),(12)] = (1i2)(12)(2i1)(12)
            = (12i)$. This tells us that $A_n = \langle \{(12i) | 3 \leq i \leq
            n\} \rangle \subset [A_n, \langle (12)\rangle$.
        \item $[S_n,S_n] = A_n$ for $n \geq 2$. To show this, for ($\subset$)
            we have \begin{align*}
                \sgn( [\sigma,\tau] ) & = \sgn(\sigma \tau \sigma^{-1} \tau^{-1}) \\
                \ & = \sgn(\sigma) \sgn(\tau) \sgn(\sigma)^{-1} \sgn(\tau)^{-1} \\
                \ & = 1, \forall \sigma, \tau \in S_n
            \end{align*}
            For ($\supset$), see the previous item.
        \item $[A_n,A_n] = A_n$ for $n \geq 5$. This is because every 3 cycle
            is a commutator. For instance $[(ijk),(klm)] = (ilk)$ for 5
            distinct elements $i,j,k,l,m \in \{1, \ldots, n\}$. Also note that
            $[A_3,A_3] = \{e\}$ and $[A_4,A_4] = \Z_2 \times \Z_2$, the set of
            all elements of the form $(ij)(kl)$.
    \end{enumerate}
\end{example}
\begin{lem}
    Let $A,B \subgroup G$. Then,
    \begin{enumerate}[label=(\alph*)]
        \item $A \subgroup N_G(B)$ if and only if $[A,B] \subgroup B$.
        \item $B \subgroup N_G(A)$ if and only if $[A,B] \subgroup A$.
        \item If $A,B \normsubgroup G$ then $[A,B] \normsubgroup G$ and $[A,B]
            \subgroup A \cap B$
    \end{enumerate}
\end{lem}
\begin{proof}
    The forward direction of $(a)$ is given by the fact that $[a,b] =
    aba^{-1}b^{-1}$ but $aba^{-1} \in B$ since $A$ normalizes $B$. Thus, $[a,b]
    \in B, \forall a \in A, b \in B$ so $[A,B] \subgroup B$. To do the other
    direction, we have that, we have that $aba^{-1}b^{-1} \in B, \forall a \in A,
    \forall b \in B$. Well, $(aba^{-1}b^{-1})b = aba^{-1} \in B$, so $A$
    normalizes $B$, so $A \subgroup N_G(B)$. \\

    (b) is similar to (a). \\

    Now, given that $A,B \normsubgroup G$, then $g[a,b]g^{-1} =
    gaba^{-1}b^{-1}g^{-1} = gag^{-1}gbg^{-1}ga^{-1}g^{-1}gb^{-1}g^{-1}$. Now
    note that $gag^{-1} \in A$ since $A \normsubgroup G$ and $(gag^{-1})^{-1} =
    ga^{-1}g^{-1}$. Similarly for $b$. So, we have that $g[a,b]g^{-1} \in [A,B]
    \implies [A,B] \normsubgroup G$. Finally, an element of the form
    $aba^{-1}b^{-1} \in A$ because $ba^{-1}b^{-1} \in A$ since $A$ is normal in
    $G$ and similarly $aba^{-1} \in B$. So, $[A,B] \subgroup A \cap B$. This
    final fact also follows from the first two items in the lemma.
\end{proof}

This lemma also gives us the important fact that $[G,G] \normsubgroup G$. This
follows easily from the third item.

\begin{prop}
    If $H \subgroup G$, then $[G,G] \subgroup H$ if and only if $H
    \normsubgroup G$ and $G/H$ is abelian.
\end{prop}
\begin{proof}
    Let $[G,G] \subgroup H$. Then, if $a,b \in G$, $aba^{-1}b^{-1} \in H$. Now,
    in particular, if $b \in H$, then $aba^{-1}b^{-1} \cdot b = aba^{-1} \in H$
    so $H \normsubgroup G$. More concisely, we have that $[G,H] \subgroup [G,G]
    \subgroup H \implies G \subgroup N_G(H)$ so $H \normsubgroup G$. To show
    $G/H$ is abelian, take a map $[a,b] \mapsto [aH,bH] =
    (aH)(bH)(aH)^{-1}(bH)^{-1} = aba^{-1}b^{-1}H = [x,y]H = H = e_{G/H}$. So,
    then $[G/H,G/H] = \{e\}$.

    To prove the other direction, let $G/H$ be abelian and $H \normsubgroup G$.
    Since $G/H$ is abelian, we have that $[aH,bH] = [a,b]H = H$. This means
    that $[a,b] \in H$ which implies that $[G,G] \in H$. (Where is the normalcy
    of $H$ used?!)
\end{proof}

\subsubsection*{Direct Products}

\begin{defn}
    The (external) direct product of two groups $A$ and $B$ is defined
    as the set (Cartesian product)  \[
        A \times B = \{(a,b) | a \in A, b \in B \}
    \] with multiplication $(a_1,b_1) \cdot (a_2,b_2) =
    (a_1a_2,b_1b_2)$. With this multiplication, it is clear that $A
    \times B$ is a group by direct computation.
\end{defn}

Direct products provide us with a way to build new groups from known groups.

\begin{lem}
    Let $G_1, G_2$ be groups and let $H_1 \subgroup G_1$ and $H_2 \subgroup G_2$. Then
    \begin{enumerate}[label=(\alph*)]
        \item $H_1 \times H_2 = \{(h_1,h_2) | h_1 \in H_1, h_2 \in H_2\} \subgroup G_1 \times G_2$.
        \item $H_1 \times H_2 \normsubgroup G_1 \times G_2$ if and only if $H_1 \normsubgroup G_1$ and $H_2 \normsubgroup G_2$. In this case, $(G_1 \times G_2)/(H_1 \times H_2) \isom (G_1/H_1) \times (G_2/H_2)$.
    \end{enumerate}
\end{lem}
\begin{proof}
    For the first item, the proof is a clear from the definition of subgroup. \\

    For the second item, examine the fact that
    $(g_1,g_2)(h_1,h_2)(g_1,g_2)^{-1} = (g_1h_1g_1^{-1},g_2h_2g_2^{-1})$. Then,
    if $H_1 \normsubgroup G_1$ and $H_2 \normsubgroup G_2$, we get
    $(g_1,g_2)(h_1,h_2)(g_1,g_2)^{-1} = (h_1,h_2)$, so $H_1 \times H_2
    \normsubgroup G_1 \times G_2$. Going the other direction is similar, but
    reducing the left hand side instead.

    Finally, we can show the final equivalence using $\phi: G_1 \times G_2 \to
    G_1/H_1 \times G_2/H_2$ where $\phi( (g_1,g_2) ) = (g_1H_1, g_2H_2)$. It
    is clear that $\phi$ is surjective and a group homomorphism, and we note
    that $\ker \phi = H_1 \times H_2$. Thus, we apply the first isomorphism
    theorem to get our equivalence.
\end{proof}

A note of warning is that not every subgroup of a direct product needs to be
of the form $H_1 \times H_2$ where $H_1 \subgroup G_1$ and $H_2 \subgroup G_2$.

\begin{example*}
    Examine $\Z_2 = \{0,1\}$. Then, $\Z_2 \times \Z_2 =
    \{(0,0),(0,1),(1,0),(1,1)\}$.  However, $H = \{(0,0),(1,1)\} \subgroup \Z_2
    \times \Z_2$ but is not of the form $H_1 \times H_2$.
\end{example*}

\begin{rmk}
    (Universal Property) Let $A \times B$ be the direct product of two groups
    $A$, $B$. Then, there are natural projections (surjective group
    homomorphisms) defined by $\pi_A: A \times B \to A$ by $\pi( (a,b) ) = a$
    and similarly for $\pi_B$. They satisfy the following universal property. \\

    For any group $G$, and any pairs of homomorphisms $\phi_A: G \to A$ and
    $\phi_B: G \to B$, there exists a \emph{unique} homomorphism $\phi: G \to A
    \times B$ such that $\pi_A \circ \phi = \phi_A$ and $\pi_b \circ \phi =
    \phi_B$. Indeed, if $\phi(g) = (a,b)$ for $g \in G$, then $a = \pi_A( (a,b)
    ) = \pi_A(\phi(g)) = \phi_A(g)$ and similarly for $b = \phi_B(g)$. \\

    The only possible map with these properties is given by $\phi: G \to A
    \times B$ where $\phi(g) = (\phi_A(g), \phi_B(g))$.

    We now check that $\phi$ so defined is a homomorphism with the properties
    $\pi_A \circ \phi = \phi_A$ and $\pi_B \circ \phi = \phi_B$.
\end{rmk}
\begin{proof}
    Let $\phi$ be defined as above. Then, $\phi( (a_1,b_1)(a_2,b_2) ) =
    (\phi_A(a_1a_2), \phi_B(b_1b_2)) =
    (\phi_A(a_1),\phi_B(b_1))(\phi_A(a_2),\phi_B(b_2)) = \phi( (a_1,b_1) )\phi(
    (a_2,b_2) )$. The other homomorphism properties clearly follow. \\

    $\pi_A \circ \phi( (a,b) ) = \pi_A( (\phi_A(a), \phi_B(b)) ) = \phi_A(a)$.
    Similarly for $\pi_B \circ \phi( (a,b))$. \\
\end{proof}
It is an exercise to generalize this for any $I$ index set with $(A_i)_{i \in
I}$ a family of groups to then generalize the unversal property to the direct
product of these groups, say $\times_{i \in I} A_i = \{(a_i) | a_i \in A_i
\forall i \in I\}$. \\

Now, let $A \times B$ be the external direct product of groups $A$ and $B$.
Then, we know $A \isom A' = \{(a,e_B) | a \in A\} \subgroup A \times B$ and
similarly for $B \isom B'$. Then, $A',B'$ have the following properties.
\begin{itemize}
    \item $A'B' = A \times B$.
    \item $A' \cap B' = \{e\}$.
    \item $A', B' \normsubgroup A \times B$.
\end{itemize}

Let us next discuss internal direct products.

\begin{defn}
    A group $G$ is the \emph{internal direct product} of two subgroups $A,B
    \subgroup G$ if the following conditions are satisfied:
    \begin{enumerate}[label=\roman*)]
        \item $AB = G$
        \item $A \cap B = \{e\}$
        \item $A,B \normsubgroup G$
    \end{enumerate}
\end{defn}
\begin{rmk*}
    In which case, $AB \isom A \times B$.
\end{rmk*}
\begin{example}
    \begin{enumerate}[label=(\alph*)]
        \item Let $G = \Z_6, A = \{\overline{0}, \overline{3}\} \subgroup G, B
            = \{\overline{0}, \overline{2}, \overline{4}\} \subgroup G$. Then,
            we have that $A \cap B = \{ \overline{0} \} \implies |AB|=|A||B| =
            6 = |G|$. Thus, $AB = G$. In abelian groups, all subgroups are
            normal, so $G = A \times B$. In fact, we can prove that $\Z_{mn}
            \isom \Z_m \times \Z_n$ when $\gcd(m,n) = 1$ using the same
            argument where we take $A = \{\overline{0}, \overline{n},
            \overline{2n}, \ldots, \overline{(m-1)n}\}$ and similarly $B =
            \{\overline{0}, \overline{m}, \ldots, \overline{(n-1)m}\}$ and
            showing that $A \cap B = \{\overline{0}\}$ since $\gcd(m,n) = 1$.
        \item $V = \{e, (12)(34), (13)(24), (14)(23)\} \normsubgroup S_4$. This
            is clearly true since conjugating by a permutation is like applying
            the permutation to the numbers of the cycle, which will not change
            the cycle structure. Now, let $A = \{e, (12)(34)\}, B = \{e, (13)(24)\}$, then $A \cap B = \{e\}$ and $A,B \normsubgroup V$. So,
            we get that $|AB| = 2\cdot 2 = 4 = |V| \implies V = AB$ so then $V
            = A \times B \isom \Z_2 \times \Z_2$.
        \item $S_4 = VS_3$. We know that $S_3$ can be embedded into $S_4$
            easily and $V \cap S_4 = \{e\}$. So, for this to happen $|VS_3| =
            24 = |S_4|$. From above, we know $V \normsubgroup S_3$, but it is
            easy to see that $S_3 \not\normsubgroup S_4$. So, we have found an
            example of a product of groups that is not a direct product but
            still forms a group. This leads us into our discussion of
            semi-direct products.
    \end{enumerate}
\end{example}

\begin{prop*}[1.1.26]
  If $G$ is the internal direct product of two subgroups $A,B
  \subgroup G$, then $G$ and the external product $A \times B$ are
  isomorphic.
\end{prop*}
\begin{proof}
  Proof was done in class but omitted here.
\end{proof}
\begin{cor*}[1.1.27]
  If $G = A \times B$, internal direct product, then
  \begin{enumerate}
  \item $A$ and $B$ commute.
  \item Any $g$ can be uniquely writen in the form $g = ab$ with $a
    \in A, b \in B$.
  \end{enumerate}
\end{cor*}
\begin{proof}
  Both of these statements follow easily from the proof of the
  proposition above.
\end{proof}

\subsubsection*{Automorphisms}
\begin{defn*}[1.1.28]
  An automorphism of a group $G$ is a bijective homomorphism from $G$
  onto $G$. \[
    \Aut(G) = \{\alpha: G \to G : \alpha \text{ is an automorphism.}\}
  \]
  is a group with respect to composition as multiplication.
\end{defn*}
\begin{example*}[1.1.29]
  \begin{enumerate}
  \item $\Aut(\Z) \isom \{1,-1\}$
  \item $\Aut(\Z_n) \isom \Z^\times_n \implies |\Aut(\Z_n)| = \phi(n)$
    where $\phi(n)$ is Euler's phi function.
  \item If $A,B$ are groups, then $\Aut(A) \times \Aut(B) \subgroup
    \Aut(A \times B)$.
  \item $\Aut(\Z_2 \times \Z_2) \isom \Sym_3$. Any permutations of
    $a,b,c$ yields an automorphism of $\Z_2 \times \Z_2$.
  \item For any group $G$ and any $g \in G$, conjugation with $g$
    defines an automorphism $\kappa_g: G \to G$ such that $x \mapsto
    gxg_{-1}$ called an inner automorphism.
  \end{enumerate}
\end{example*}
\begin{defn*}[1.1.30]
  An automorphism is called an inner automorphism if there exists a $g
  \in G$ such that $\alpha = \kappa_g$. We set \[
    \operatorname{Inn}(G) = \{\kappa_g : g \in G\} \subgroup \Aut(G).
  \]
\end{defn*}
\begin{lem*}
  \begin{enumerate}
  \item $\operatorname{Inn}(G) \isom G/Z(G)$
  \item $\operatorname{Inn}(G) \normsubgroup \Aut(G)$
  \end{enumerate}
\end{lem*}
Also note that the quotient $\Aut(G)/\operatorname{Inn}(G)$ is called
the group of outer automorphisms of $G$.
\begin{proof}
  Proved in class but ommitted here.
\end{proof}
\begin{example*}[1.1.32]
  \begin{enumerate}
  \item $G$ group, $\operatorname{Inn}(G) = \{id\}$ if and only if $G
    = Z(G)$ if and only if $G$ is abelian.
  \item $\operatorname{Inn}(\Sym_n) \isom \Sym_n$ if $n \geq 3$ since
    $Z(\Sym_n) = id$ by 1.1.4.
  \item $\Aut(\Sym_3) = \operatorname{Inn}(\Sym_3)$.
  \item With some more work, one can show that
    $\operatorname{Inn}(\Sym_n) = \Aut(\Sym_n)$ if $n \geq 3$ and $n
    \neq 6$. Also, $\Sym_6$ has 2 outer automorphisms.
  \end{enumerate}
\end{example*}
\begin{rmk*}[1.1.33]
  \begin{enumerate}
  \item If $\alpha \in \Aut(G)$ and $g \in G$, then $|\alpha(g)| =
    |g|$.
  \item $\alpha \in \Aut(G) \implies \alpha(Z(G)) = Z(G)$.
  \item $\alpha \in \Aut(G) \implies \alpha([G,G]) = [G,G]$.
  \end{enumerate}
\end{rmk*}
Proofs of these remarks were discussed in class but omitted here.
\begin{defn*}
  A subgroup $H \subgroup G$ is called a characteristic subgroup of
  $G$ if $\alpha(H) = H, \forall \alpha \in \Aut(G)$. We denote this $
  H \Char G$.
\end{defn*}
Some examples are $\{e\}, G, Z(G), [G,G]$.
\begin{lem*}[1.1.35]
  Let $G$ be a group and $A,B,H \subgroup G$.
  \begin{enumerate}
  \item $H \Char G \implies H \normsubgroup G$.
  \item $A \subgroup H, A \Char H \Char G \implies A \Char G$.
  \item $A \subgroup H, A \Char H \normsubgroup G \implies A
    \normsubgroup G$.
  \item $A \Char G, B \Char G \implies [A,B] \Char G$.
  \end{enumerate}
\end{lem*}
\begin{example*}[1.1.36]
  \item $G = \Z_2 \times \Z_2$. Then, any rder 2 subgroup of $G$ is
    normal but not characteristic.
  \item $G = \Sym_4, H = \{id, (12)(34), (13)(24), (14)(23)\}
    \normsubgroup \Sym_4$. Then $H = [A_4,A_4] \Char A_4 =
    [\Sym_4,\Sym_4] \Char \Sym_4$ so we get that $H \Char
    \Sym_4$. Take heed, though. Let $A = \{id, (12)(34)\}
    \normsubgroup H \Char \Sym_4$. This does not mean $A \normsubgroup
    \Sym_4$. In fact, this is false. In particular, $\normsubgroup$ is
    not a transitive relationship.
\end{example*}
\subsection*{Lecture 5: Finite Cyclic Groups}
We start by recounting some basic facts about finite cyclic groups. If
\(G=\langle x\rangle\) where \(|x|=n\) then \(G \isom \Z_n\) with the map
\[x^n \longleftrightarrow \bar{a}.\] Then the order of \(\bar{a}\) is given by
\[|\bar{a}|=\frac{n}{(n,a)}.\] We now show that the generators of \(\Z_n\) are
those elements relatively prime to \(n\).
\begin{align*}
  \Z_n = \langle \bar{a} \rangle &\iff |\bar{a}|=n\\
                                 &\iff \frac{n}{(n,a)}=n\\
                                 &\iff (n,a)=1.
\end{align*}
Another fact is that \(\Z_n\) has a unique subgroup of order \(d\) for each
divisor \(d\) of \(n\).
\begin{lem*}[1.2.1] Let \(R\) be a ring with \(1\).
  \begin{enumerate}
  \item[(a)] For any \(r \in R\) the map
    \begin{align*}
      \lambda_r \colon R &\to R\\
      r &\mapsto rx
    \end{align*}
    defines a homomorphism of the abelian group \((R,+)\).
  \item[(b)] For any \(r \in R^\times\), \(\lambda_r \in \Aut(R,+)\) and
    \begin{align*}
      \lambda \colon R^\times &\to \Aut(R,+)\\
      r &\mapsto \lambda_r
    \end{align*}
    is an injective group homomorphism.
  \end{enumerate}

\end{lem*}
\begin{prop*}[1.2.2]
  \[\Aut(\Z_n) \isom \Z_n^\times\]
\end{prop*}
\begin{proof}
  By Lemma 1.2.1 we have \(\lambda \colon \bar{a} \mapsto \lambda_{\bar{a}}\) is
  an injective group homomorphism. Thus we simply must show that it is
  surjective, we will use an order argument. Take any \(\alpha \in \Aut(\Z_n)\)
  since \(|\bar{1}|=n\) this means that \(|\alpha(\bar{1})|=n\). Thus
  \(|\Aut(\Z_n)| \le \varphi(n)\).
\end{proof}

\begin{prop*}[1.2.3]{Chinese Reminder Theorem}
  Let \(m,n \in \N\).
  \begin{enumerate}
  \item[(a)] The map
    \begin{align*}
      f \colon \Z_{mn} &\to \Z_n \times \Z_m\\
      [a]_{mn}&\mapsto [a]_m \times [a]_n
    \end{align*}
    is a ring homomorphism.
  \item[(b)] If \((m,n)=1\) then \(f\) is a ring isomorphism.
  \end{enumerate}
\end{prop*}
\begin{proof}[Proof of (a)]
  Just a routine calculation.
\end{proof}
Notice that this homomorphism sends \(1\) to \(1\), which needn't be the case in
general for a ring homomorphism.
\begin{proof}[Proof of (b)]
  Notice that \(f\) is surjective through order considerations. Now check that
  the kernel is trivial.
\end{proof}
Consequences of b: If \(n=\primedecomposition{p}{e}{r}\) where
\(p_1,\ldots,p_r\) are distinct primes and \(e_i \in \N\). Then
\[\Z_n \isom \prod_{i-1}^r \Z_{{p_i}^{e_i}}.\]
One can prove this by using the Chinese Reminder Theorem and induction on r.
\begin{cor*}[1.2.4]
  Let \(m,n \in \N\) with \((m,n)=1\).
  \begin{enumerate}
  \item[(a)] \(Z_{mn}^\times \isom \Z_m^\times \times \Z_n^\times\). If
    \(n=\primedecomposition{p}{e}{r}\) then
    \[\Z_n^\times \isom \prod_{i-1}^r \Z^\times_{{p_i}^{e_i}}.\]
  \item[(b)]
    \(\varphi(mn)=|\Z_{mn}^\times|=|\Z_{m}^\times\times
    \Z_{n}^\times|=|\Z_{m}^\times||\Z_{n}^\times|=\varphi(m)\varphi(n)\).
  \end{enumerate}
\end{cor*}
\begin{prop*}[1.2.5]
  For \(e \in \N\)
  \begin{enumerate}
    \item[(a)] \(\Z_{2^e}^\times \isom \Z_2 \times \Z_{2^{e-2}},\ e \ge 2\)
    \item[(b)] \(\Z_p^\times \isom \Z_{p-1}\) for every prime \(p\)
    \item[(c)] \(\Z_{p^e}^\times \isom \Z_{p^{e-1}(p-1)} \isom \Z_{p^{e-1}} \times \Z_{p-1} \) for every prime p
  \end{enumerate}
\end{prop*}

\subsection*{Lecture 6: Fundamental
  Theorem of Finitely Generated Abelian
  Groups}

\begin{thm*}[1.2.6 (Cauchy's Theorem)]
  Let \(A\) be an abelian group of
  finite order. If a prime \(p\) divides
  the order of \(A\), there exists an
  element \(a \in A\) of order \(p\).
\end{thm*}

\begin{proof}
  We will proceed by induction on
  \(|A|\). If \(|A|=p\), then
  \(A \isom \Z_p\), which means every
  nontrivial element has order
  \(p\). If \(|A| > p\) we may choose an
  \(x \in A/\{e\}\). Notice that
  \(|x| > 1\).

  \noindent Case 1:\\
  \(p \mid n \implies |a|=p\) for
  \(a=x^{\frac{n}{p}} \in \langle x
  \rangle \subset A\)\\

  \noindent Case 2:\\ \(p\) does not
  divide \(n\). Let
  \(B=\langle x \rangle \normsubgroup
  A\), and \(\bar{A}=A /B\). Then
  \[|\bar{A}|=\frac{|A|}{|B|}=\frac{|A|}{n}.\]
  Furthermore since \(p \mid |A|\)
  \[p \mid |A| \implies p \mid
    \frac{n|A|}{n}\] but since \(p\)
  does not divide \(n\) we have that
  \[p \mid \frac{|A|}{n}\implies p \mid
    |\bar{A}|.\] Now \(|\bar{A}|\) is a
  small group than \(A\), hence we may
  apply the inductive hypothesis, that
  is there exists some \(y \in \bar{A}\)
  of order \(p\). As the projection map
  \(\pi\) is surjective there must exist
  some \(z \in A\) such that
  \(\pi(z)=y\). Since \(\pi\) is a
  homomorphism \(|y| \mid |z|\), which
  means \(p \mid z\), hence \(z=pm\) for
  some \(m \in \Z\). Thus
  \(a=z^{\frac{m}{p}}\) is an element of
  order \(p\) in \(A\).
\end{proof}

\begin{prop*}[1.2.7]
  If \(A\) is a finite abelian group and
  \(m \in \N\) with \(m \mid |A|\), then
  \(A\) has a subgroup of order \(m\).
\end{prop*}
\begin{proof}
  We again proceed by induction. The
  case in which \(|A|=1\) is
  trivial. Assume \(|A|>1\) and
  \(m>1\). Choose any prime divisor
  \(p\) of \(m\). By Cauchy's Theorem
  there exists an \(a \in A\) of order
  \(p\). Set
  \(B=\langle a\rangle \unlhd A\), then
  \[|\bar{A}|=\frac{|A|}{|B|}=\frac{|A|}{p}.\]
  As \(m \mid |A|\) we have that
  \[\frac{m}{p} \mid \frac{|A|}{p}
    \implies \frac{m}{p} \mid
    \frac{|A|}{|\bar{A}|}.\] Now apply
  the inductive hypothesis on
  \(\bar{A}\), that is, there exists a
  subgroup \(\bar{H} \le \bar{A}\) of
  order \(p\). We now invoke the
  Correspondence Theorem, thus there
  exists \(H \le A\) with
  \(\bar{H}=H/B\). Then
  \[|H|=\frac{m}{p}=\frac{|H|}{|B|}=\frac{|H|}{p}
    \implies |H|=m.\]
\end{proof}

\begin{cor*}[1.2.8]
  Given a finite abelian group \(A\)
  with
  \(|A|=\primedecomposition{p}{e}{r}\)
  there exists subgroups \(B_i \le A\)
  for \(1 \le i \le r\) with
  \(|B_i|=p_i^{e_i}\) and
  \[A = B_1 \times \ldots \times B_r\] moreover
  \(B_i = \{a \mid |a| \text{ is a power
    of } p_i\}\).
\end{cor*}

\begin{proof}
  Subgroups \(B_i\) with
  \(|B_i|=p_i^{e_i}\) exist due to
  1.2.7.
  \[A \text{ is abelian} \implies B_i
    \normsubgroup A,\ \forall 1 \le i
    \le r\]
  \[\prod|B_i| = |A| \qquad \bigcap B_i
    = \{e\} \implies A = B_1 \times
    \ldots \times B_r\] Now we show
  uniqueness:
  \(A \isom B_1 \times \ldots \times
  B_r\) as an external direct product
  which means elemetns of \(A\) come as
  tuples \((b_1,\ldots,b_r)\), then
  \[|a|=|(b_1,\ldots,b_r)|=\text{lcm}(b_1,\ldots,b_r),\]
  which means \(|a|\) is a power of
  \(p_i\). (this needs clarification)
\end{proof}

\begin{rmk*}
  \(B_i\) are Sylow \(p_i\)-subgroups of
  \(A\)
\end{rmk*}

\begin{prop*}[1.2.9]
  Let \(A\) be a finite abelian group of
  order \(n\).
  \begin{enumerate}
  \item[(a)] If \(A\) is cyclic, and
    \(m \in \N\), then
    \[|\{a \in A \mid a^m = e\ (|a| \mid
      m)\}| =
      \begin{cases}
        m   &  m \mid n\\
        <m & m \text{ does not divide }
        n
      \end{cases}
    \]
  \item[(b)] If ( for every $m$ s.t. \(m \mid n\), we have
    \(|\{a \in A \mid a^m = e\}| \le
    m\)), then \(A\) is cyclic.
  \end{enumerate}
\end{prop*}
\begin{proof}
  Homework Three
\end{proof}

\begin{thm*}[1.2.10 (The Fundamental Theorem of Finitely Generated Abelian Groups)]
  Let \(A\) be a finite abelian group
  with
  \(|A|=\primedecomposition{p}{e}{r}\). Then
  for each \(i\) there exists a uniquely
  determined \(l_i \in \N\) such that
  \(m_{i1} < m_{i2} < \ldots <
  m_{il_i}\) that partitions \(e_i\) by
  \(e_i=m_{1i}+\ldots+m_{il_i}\) and
  \[A \isom (\Z_{{p_1}^{m_{11}}} \times
    \Z_{{p_1}^{m_{12}}} \cdots \times
    \Z_{{p_1}^{m_{1l_1}}}) \times \cdots
    \times (\Z_{{p_r}^{m_{r1}}} \times
    \Z_{{p_r}^{m_{r2}}} \cdots \times
    \Z_{{p_r}^{m_{rl_r}}}).\]
\end{thm*}

\begin{rmk*}
  Checkout Dummit and Foote 6.1 page
  197. For a proof that every abelian
  \(p\)-group is a direct product of
  cyclic \(p\)-groups.
\end{rmk*}

\begin{example*}
  Classification up to isomorphism of
  all abelian groups of order
  \(75\). First notice that
  \(72=2^3 \cdot 3^2\). The looking at
  the partitions of the exponents
  yields:
  \[\Z_8,\ \Z_4 \times \Z_2,\ \Z_2
    \times \Z_2 \times \Z_2\] and,
  \[\Z_9, \Z_3 \times \Z_3.\]
  This yields six total possibilities,
  furthermore by uniqueness these are
  exactly the abelian groups of order
  \(75\).
\end{example*}

\begin{rmk*}[1.2.11]
  Every abelian group is also a
  \(\Z\)-module. (which is a
  generalization of a vector space,
  instead of working with a field, we
  weaken the condition to working with a
  ring).
  \begin{align*}
    \Z \times A &\longrightarrow A\\
    (m,a)& \mapsto ma
  \end{align*}
  Where
  \[ma =
    \begin{cases}
      \underbrace{a+a+\ldots+a}_{m \text{ times}} & m > 0\\
      0 & m=0\\
      \underbrace{(-a)+(-a)+\ldots+(-a)}_{-m
        \text{ times}} & m < 0
    \end{cases}.
  \]
\end{rmk*}
One can check that this construction
satisfies the axioms of a
\(\Z\)-module. An abelian group is
finitely generated if and only if the
corresponding \(\Z\)-module is finitely
generated. That is to say the structure
of finitely generated abelian groups is
determined by finitely generated
\(Z\)-modules.

\begin{defn*}[1.2.12]
  An \emph{elementary abelian $p$-group}, $A$, is an abelian $p$-group such that
  \(|a|=p\) for all \(a \in A \smallsetminus \{e\}\).  (In OUR class, p-groups are *finite* by definition, but elementary abelian p-groups *can* be infinite.  In the REAL WORLD, p-groups can be infinite by definition.)
\end{defn*}

\begin{rmk*}[1.2.13]
  $A$ is an elementary \(p\)-group iff it
  is a vector space over
  \(\Fp\). This allows us to import
  linear algebra. We define the scalar
  multiplication by
  \begin{align*}
    \Fp \times A &\longrightarrow A\\
    (\bar{m},a) &\longmapsto ma
  \end{align*}
  This is well defined since if
  \(\bar{m} = n \in \Fp\) then there
  exists \(k\) such that \(n=m+kp\)
  which means
  \(na=(m+kp)a=ma+k(pa)=ma+k(0)=ma\). Next
  notice that any group homomorphism
  \(f \colon A \to A\) is automatically
  \(\Fp\)-linear:
  \(f(\bar{m}a)=\bar{m}f(a)\).
\end{rmk*}

\begin{cor}[1.2.14]
  Let \(A\) be an elementary abelian
  \(p\)-group.
  \begin{enumerate}
  \item[(a)] \(A\) is a direct sum of
    copies of \(\Z_p\)
  \item[(b)]
    \(\Aut(A) \isom \GL(A)=\{f \colon A
    \to A \mid f \text{ is a
      bijection}\}\) $<--$ this is not true.  not any permutation on the elements of A can be an automorphism of A.  Firstly, the identity must be fixed.  Secondly, if $f(a) = b$, then it is entirely necessary that $f(a+a) = b+b$.  So the choice of where one element gets sent will determine where other elements must be sent.  I think what was intended is this:  If A is written as the direct sum of copies of $Z_p$, then any permutation of the $Z_p$'s is an automorphism.
  \end{enumerate}
\end{cor}

Implications for elementary abelian
\(p\)-groups: \(\Aut(A) \isom \GL_n(\Fp)\), where $n$ is the number of copies of $\Z_p$ in $A$.
\begin{enumerate}
\item[(a)] \(A\) has a basis
  \(\{x_i \mid i \in I\}\)
\item[(b)] Any additive group is \(\Fp\)
  linear.
  \[\GL(A) \subseteq \Aut(A),\ \Aut(A)
    \subseteq \GL(A).\]
\end{enumerate}

\begin{example*}
  \begin{gather*}
    \Aut(\Z_2 \times \Z_2) \isom S_3 \isom \GL_2(\mathbb{F}_2)\\
    \Aut(\Z_2 \times \Z_2 \times \Z_2)
    \isom \GL_3(\mathbb{F}_2)
    \rightsquigarrow \text{order 168}
  \end{gather*}
\end{example*}

\subsection*{Lecture 7: Nilpotent and Solvable Groups}

\begin{defn*}[1.3.1]
  \begin{enumerate}
  \item[(a)] The \emph{lower central series} is defined inductively as follows:
    \begin{align*}
      G^{[0]} &:= G\\
      G^{[1]} &:= [G,G]\\
      &\vdots\\
      G^{[i+1]} &:= [G,G^{[i]}].
    \end{align*}
    \(G\) is called \emph{nilpotent} if there exists \(n \in \N\) such that \(G^{[n]}=1\). And \(G\) is \emph{nilpotent}
    of class \(c\), if \(c\) is the smallest natural number such that \(G^{[c]}=1\).
  \item[(b)] The \emph{derived series} of \(G\) is defined inductively as follows:
    \begin{align*}
      G^{{0}} &:= G\\
      G^{(1)} &:= [G,G]\\
      &\vdots\\
      G^{(i+1)} &:= [G^{(i)},G^{(i)}].
    \end{align*}
    \(G\) is called \emph{solvable} if there exists \(n \in \N\) such that \(G^{(n)}=1\).
  \end{enumerate}
\end{defn*}
\begin{rmk*}[1.3.2]
  The next facts follow directly:
  \begin{enumerate}
  \item \(G^{(i)} \subset G^{[i]}\). This means that nilpotent \(\implies\) solvable.
  \item \(G\) abelian \(\implies [G,G]=e \implies \) G is nilpotent.
  \item \(G\) is nilpotent of class \(2\) \(\iff\) \([G,G] \neq 1\) and \([G,G^{[1]}]=e\) \(\implies G^{[1]} \le Z(G)\).
  \end{enumerate}
\end{rmk*}

\begin{lem*}[1.3.3]
  Take \(G \neq 1\).
  \begin{enumerate}
  \item[(a)] \(G\) is nilpotent \(\implies\) \(Z(G) \neq 1\)
  \item[(matt)] Every term in a derived series is characteristic in $G$.  This is true because $[G,G]$ is characteristic in $G$, and ``characteristic'' is a transitive property, so we can induct downwards.
  \item[(b)] \(G\) is solvable \(\implies\) there exists an abelian subgroup \(A \neq 1\) with A characteristic in \(G\).
  \end{enumerate}
\end{lem*}

\begin{example*}[1.3.4]
  \begin{enumerate}
  \item[] % make spacing nicer
  \item[(a)] \(Z(Q)=\{-1,1\}=[Q,Q]\), hence \(Q\) is nilpotent of class \(2\).
  \item[(b)] \(S_n\) is not nilpotent \(n \ge 3\). Since \(Z(S_n)=1\). \(S_3,S_4\) are solvable. \(S_3^{(1)}=A_3\) and
    \(S_3^{(2)}=1\). \([S_n,S_n]=A_n,[A_n,A_n]=A_n\).  The very last statement is false.  This is because \([A_3,A_3]=1\).  Maybe he meant to add the condition that $ n \geq 5$.
  \item[(c)] \(A_4\) is solvable, non-nilpotent. \(S_n,A_n\) are not solvable \(n \ge 5\).
  \item[(e)] If \(|G| < 60\), then \(G\) is solvable. If \(|G|=60\) and \(G\) is not solvable, then \(G \isom
    A_5\).
  \item[(matt)] Every solvable simple group is solvable of class 1. (And nilpotent of class 1)
  \item[(f)] Let \(F\) be a field, then define
    \[U_n(F) := \left\{
       \left.\left( \begin{array}{c c c}
          1 & & \star\\
           & \ddots \\
          0& & 1
        \end{array}\right)\:\right\rvert \ \star \in F \right\} \le \GL_n.\]
  \(U_n(F)\) is nilpotent.
  \item[(g)] Define \(B_n(F)\) as above, but instead of 1s on the diagonal allow any unit of \(F\). \(B_n(F)\) is
    solvable, but potent for \(n \ge 2\) and \(F \neq F_2\).
  \end{enumerate}
\end{example*}
\begin{prop*}
  If \(G\) is a finite \(p\)-group, then \(G\) is nilpotent.
\end{prop*}
\begin{thm}[Burnside's Theorem]
  If \(|G|=p^mq^n\), then \(G\) is solvable.
\end{thm}
\begin{thm}[Feit–Thompson theorem]
    Every finite group of odd order is solvable.  (this is an extension of the previous theorem)
\end{thm}
\begin{prop*}[1.3.5]
  If \(G\) is nilpotent and \(H < G\), then \(N_G(H)\neq H\).
\end{prop*}
\begin{defn*}[1.3.6]
A sequence of homomorphisms
\[\ldots \to \ldots  G_{i-1} \xrightarrow{f_{i-1}}G_i \xrightarrow{f_i} G_{i+1} \to \ldots \to \ldots\]
is called \emph{exact} if \(\text{im}(f_{i-1})=\ker(f_i)\) for each \(i\). A sequence is a short exact sequence
(SES) if it is exact and takes the form:
\[1 \to N \xrightarrow{f_1} G \xrightarrow{f_2} Q \to 1.\]
\end{defn*}
Exactness means:
\begin{enumerate}
\item \(f_1\) is injective
\item \(f_2\) is surjective
\item \(G/f_1(N) \isom Q\)
\end{enumerate}

(still more to be said)

\subsection{I.5 Group Actions}

\begin{defn*}[1.5.1]
  Given a group \(G\) and set \(X\) we say that \(G\) \emph{acts} on \(X\) (on the left)
  if
  \begin{align*}
    G &\times X \to X\\
      &(g,x) \mapsto g\cdot x
  \end{align*}
  \begin{enumerate}
  \item[i.] \(g(h\cdot x)=(gh)\cdot x\) for all \(g,h \in G\) and \(x \in X\)
  \item[ii.] \(e\cdot x = x\)
  \end{enumerate}
\end{defn*}
\noindent Consequences:\\
For each \(g \in G\), we have a map
\begin{align*}
  \pi_g &\colon X \to X\\
  x &\mapsto g \cdot x
\end{align*}
\begin{enumerate}
\item[(i)] says that \(\pi_g \circ \pi_h = \pi_{gh}\)
\item[(ii)] says that \(\pi_g \pi_{g^{-1}} = 1_X\)
\end{enumerate}
Thus we have that \(\pi_g\) is a bijection, hence \(\pi_g\) really is a permutation of \(X\).
\[\varphi \colon G \to S(X)=\{G \colon X \to X | G \text{ is a bijection}\}\]
Hence \(\varphi\) is a group homomorphism.
\begin{align*}
  G \times X &\to X\\
  (g,x) &\mapsto \varphi(g)(x)
\end{align*}
Concepts: G acts on \(X\) \(\iff\) there is a homomorphism from \(G \to S(X)\).
\begin{defn*}[1.5.2]
  The action of \(G\) on \(X\) is \emph{faithful} if \(\ker\varphi = 1\).
\end{defn*}
\begin{example}[1.5.4]
  \begin{enumerate}
    \item[a.] \(S_n\) acts on \(X=\{1,\ldots,n\}\), \(\varphi\) is the identity
    \item[b.] \(\GL_n(\mathbb{F})\) acts on \(\mathbb{F}^n\) (column vectors)
    \item[c.] IF \(G\) acts on \(X\), and \(H \le G\) then \(G\) acts on \(H\) also
      \begin{align*}
        \varphi \colon G &\to S(X)\\
        \varphi|_H \colon H &\to S(X)
      \end{align*}
    \item[d.] \(G\) acts on the set \(X=G\) by left multiplication
      \begin{align*}
        G \times G &\to G\\
        (g,x) &\mapsto gx
      \end{align*}
      Here \(\pi_g\) is just a permutation, and not a group homomorphism we ignore the extra structure.
    \item[e.] If \(H \le G\) we can consider action \(G\) on \(X=G/H\), by left multiplication.
      \lambdadeclaration{G\times G/H}{G/H}{(g,g'H)}{(gg')H}
    \item[f.] \(G\) acts on the group. \(X=G\) by conjugation
      \lambdadeclaration{G \times G}{G}{(g,x)}{gxg^{-1}}
  \end{enumerate}
\end{example}

\subsection{Sylow Consequences to Know}
\newcommand{\syl}{\text{Syl}}
\begin{prop*}{1.7.6}
  \(P \in \syl_p(G) \implies N_G(N_G(P))=N_G(P)\)
\end{prop*}

\begin{thm*}{1.7.7}
  Let \(G \neq \{e\}\) be a finite group. If \(p_1, \ldots p_r\) are the distinct prime divisors of \(|G|\) then the
  following are equivalent (where \(P_i \in \syl_{p_i}(G)\)):
  \begin{enumerate}
  \item \(G\) is nilpotent
  \item \(H \neq N_G(H)\) for all \(H < G\)
  \item \(\forall P_i \unlhd G \implies G = P_1 \times \ldots \times P_r\)
  \end{enumerate}
\end{thm*}

\begin{lem*}{1.7.8}
  \(|G|=p^e m\) with \(p > m \implies n_p = 1\).
\end{lem*}

\begin{prop*}{1.7.9}
  If \(|G|=pqr\) with \(p > q > r\) then \(P,PQ \unlhd G\) furthermore
  \[G (P \rtimes Q) \rtimes R \cong (\Z_p \rtimes \Z_q) \rtimes \Z_r.\]
\end{prop*}

\begin{prop*}
  If \(|G|=p^em\) with \(m > p\) and \(p\) does not divide either \(m\) or \((m-1)!\) then \(G\) is not simple.
\end{prop*}

\subsection*{Free Groups and Presentations}

Let \(X\) be a non-empty set. Define \(X^{-1}=\{x^{-1} \mid x \in X\}\) with \(X \cap X^{-1} = \emptyset\) and where
there exists an injection \(X \to X^{-1}\). Set \(Y = X \coprod X^{-1}\). There define \(\iota \colon Y \to Y\) by
\begin{align*}
  x &\mapsto x^{-1}\\
  x^{-1} &\mapsto x
\end{align*}
Think of \(Y\) as an alphabet and
\[W(X)=\{(y_1,\ldots,y_n) \mid n \in \N, y_i \in Y\}\]
as the set of words over that alphabet. For convenience we write \(y_1\cdots y_n\) for \((y_1,\ldots,y_n)\). We may
define an associative multiplication on \(W(x)\) by
\[(y_1,\ldots,y_n)(y_{n+1},\ldots,y_m)=(y_1,\ldots,y_n,y_{n+1},\ldots,y_m).\]
Then \(W(X)\) is a free monoid on \(Y\).

\begin{defn*}
  Words \(v,w \in W(X)\) are \emph{elementary equivalent} if either one of the following hold:
  \begin{enumerate}
  \item \(w=w_1w_2\) and \(v=w_1y y^{-1}w_2\)
  \item \(w=w_1y^{-1}yw_2\) and \(v=w_1w_2\)
  \end{enumerate}
\end{defn*}

\begin{defn}
  \(v,w \in W(X)\) are \emph{equivalent} denote \(\sim\)if
  \begin{enumerate}
  \item \(w=v\)
  \item There exists a finite chain of elementary equivalences.
  \end{enumerate}
\end{defn}

Denote the equivalence class of words equivalent to \(w\) by \([w]\). Now define
\[F(x)=W(x)/\sim\]
where this is just given by the equivalence relation on the set \(W(X)\). Now define multiplication on \(F(x)\) by
inheriting it
from \(W(X)\), that is set \([w][v]=[wv]\). Now inversion is well defined by \([w]^{-1}=[w^{-1}]\).
\begin{defn}
  The set \(F(X)\) defined above together with the multiplication \([w][v]=[wv]\) is called the \emph{free group} on \(X\).
\end{defn}
\end{document}%

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "master.tex"
%%% End:


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (c) 2003-2018 by The University of Queensland
% http://www.uq.edu.au
%
% Primary Business: Queensland, Australia
% Licensed under the Apache License, version 2.0
% http://www.apache.org/licenses/LICENSE-2.0
%
% Development until 2012 by Earth Systems Science Computational Center (ESSCC)
% Development 2012-2013 by School of Earth Sciences
% Development from 2014 by Centre for Geoscience Computing (GeoComp)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Gravity Inversion}\label{sec:forward gravity}
For the gravity inversion we use the anomaly of the gravity acceleration~\index{gravity acceleration} of the Earth.
The controlling material parameter is the density~\index{density} $\rho$ of
the rock.
If the density field $\rho$ is known the gravitational potential $\psi$ is
given as the solution of the PDE
\begin{equation}\label{ref:GRAV:EQU:100}
-\psi_{,ii} = -4\pi G \cdot  \rho
\end{equation}
where $G=6.6730 \cdot 10^{-11}  \frac{m^3}{kg \cdot s^2}$ is the gravitational
constant.
The gravitational potential is set to zero at the top of the
domain $\Gamma_0$.
On all other faces the normal component of the gravity acceleration anomaly
$g_i$ is set to zero, i.e. $n_i \psi_{,i} = 0$ with outer normal field $n_i$.
The gravity force $g_i$ is given as the negative of the gradient of the gravity
potential $\psi$:
\begin{equation}\label{ref:GRAV:EQU:101}
 g_i = - \psi_{,i}
\end{equation}
From the gravitational potential we can calculate the gravity acceleration
anomaly via Equation~(\ref{ref:GRAV:EQU:101}) to obtain the defect to the
given data.
If $g^{(s)}_i$ is a measurement of the gravity acceleration anomaly for
survey $s$ and $\omega^{(s)}_i$ is a weighting factor the data defect
$J^{grav}(k)$ in the notation of Chapter~\ref{chapter:ref:inversion cost function} is given as
\begin{equation}\label{ref:GRAV:EQU:9}
J^{grav}(k) = \frac{1}{2}\sum_{s} \int_{\Omega} ( \omega^{(s)}_i \cdot (g_{i}- g^{(s)}_i) ) ^2 dx
\end{equation}
Summation over $i$ is performed.
The cost function kernel\index{cost function!kernel} is given as
\begin{equation}\label{ref:GRAV:EQU:10}
K^{grav}(\psi_{,i},k) = \frac{1}{2}\sum_{s} ( \omega^{(s)}_i \cdot (\psi_{,i}+ g^{(s)}_i) ) ^2
\end{equation}
In practice the gravity acceleration $g^{(s)}$ is measured in vertical
direction $z$ with a standard error deviation $\sigma^{(s)}$ at certain
locations in the domain.
In this case one sets the weighting factors $\omega^{(s)}$ as
\begin{equation}\label{ref:GRAV:EQU:11}
\omega^{(s)}_i
= \left\{
\begin{array}{lcl}
f \cdot  \frac{\delta_{iz}}{\sigma^{(s)}} & & \mbox{data are available} \\
& \mbox{ where } & \\
0 & & \mbox{ otherwise } \\
\end{array}
\right.
\end{equation}
With the objective to control the
gradient of the cost function
the scaling factor $f$ is chosen in the way that
\begin{equation}\label{ref:GRAV:EQU:12}
\sum_{s} \int_{\Omega} ( \omega^{(s)}_i g^{(s)}_i ) \cdot ( \omega^{(s)}_j \frac{1}{L_j} ) \cdot 4\pi G L^2 \cdot \rho' \;  dx =\alpha
\end{equation}
where $\alpha$ defines a scaling factor which is typically set to one and $L$ is defined by equation~(\ref{ref:EQU:REG:6b}). $\rho'$ is considering the
derivative of the density with respect to the level set function.

\subsection{Usage}

\begin{classdesc}{GravityModel}{domain,
w, g,
\optional{, coordinates=\None}
\optional{, fixPotentialAtBottom=False},
\optional{, tol=1e-8}
}
opens a gravity forward model over the \Domain \member{domain} with
weighting factors \member{w} ($=\omega^{(s)}$) and measured gravity acceleration anomalies \member{g} ($=g^{(s)}$).
The weighting factors and the  measured gravity acceleration anomalies must be vectors
where components refer to the components
$(x_0,x_1,x_2)$ for the Cartesian coordinate system
and to $(\phi, \lambda, h)$ for the geodetic coordinate system.
If \member{reference} defines the reference coordinate system to be used, see Chapter~\ref{Chp:ref:coordinates}.
\member{tol} set the tolerance for the solution of the PDE~(\ref{ref:GRAV:EQU:100}).
If \member{fixPotentialAtBottom} is set to  \True, the gravitational potential
at the bottom is set to zero in addition to the potential on the top.
\member{coordinates} set the reference coordinate system to be used. By the default the
Cartesian coordinate system is used.
\end{classdesc}

\begin{methoddesc}[GravityModel]{rescaleWeights}{
        \optional{scale=1.}
 \optional{rho_scale=1.}}
rescale the weighting factors such condition~(\ref{ref:GRAV:EQU:12}) holds where
\member{scale} sets the scale $\alpha$
and \member{rho_scale} sets $\rho'$. This method should be called before any inversion is started
in order to make sure that all components of the cost function are appropriately scaled.
\end{methoddesc}

\subsection{Gradient Calculation}
This section briefly explains how the gradient
$\frac{\partial J^{grav}}{\partial \rho}$ of the cost function $J^{grav}$ with
respect to the density $\rho$ is calculated. We follow the concept as outlined in section~\ref{chapter:ref:inversion cost function:gradient}.
The gravity potential $\psi$ from PDE~(\ref{ref:GRAV:EQU:100}) is solved in
weak form:
\begin{equation}\label{ref:GRAV:EQU:201}
\int_{\Omega} q_{,i} \psi_{,i} \; dx  = - \int_{\Omega}  4\pi G \cdot q \rho\; dx
\end{equation}
for all $q$ with $q=0$ on $\Gamma_0$.
In the following we set $\Psi[\cdot]=\psi$ for a given density $\cdot$ as
solution of the variational problem~(\ref{ref:GRAV:EQU:201}).
If $\Gamma_{\rho}$ denotes the region of the domain where the density is known
and for a given direction $p$ with $p=0$ on $\Gamma_{\rho}$ one has
\begin{equation}\label{ref:GRAV:EQU:201aa}
\int_{\Omega}   \frac{\partial J^{grav}}{\partial \rho} \cdot p \; dx  =  \int_{\Omega}
\sum_{s} (\omega^{(s)}_j \cdot
(g^{(s)}_j-g_{j}) ) \cdot ( \omega^{(s)}_i \Psi[p]_{,i})  \; dx
\end{equation}
with
\begin{equation}\label{ref:GRAV:EQU:202c}
Y_i[\psi]=  \sum_{s} (\omega^{(s)}_j \cdot
(g^{(s)}_j-g_{j}) ) \cdot  \omega^{(s)}_i
\end{equation}
This is written as
\begin{equation}\label{ref:GRAV:EQU:202cc}
\int_{\Omega}   \frac{\partial J^{grav}}{\partial \rho} \cdot p \;  dx  = \int_{\Omega}
Y_i[\psi] \Psi[p]_{,i} \; dx
\end{equation}
We then set $Y^*[\psi]$ as the solution of the equation
\begin{equation}\label{ref:GRAV:EQU:202d}
\int_{\Omega} r_{,i} Y^*[\psi]_{,i} \; dx  =  \int_{\Omega} r_{,i} ,Y_i[\psi]  \; dx  \mbox{ for all } p \mbox{ with } r=0 \mbox{ on } \Gamma_{top}
\end{equation}
with $Y^*[\psi]=0$ on $\Gamma_0$. With $r=\Psi[p]$ we get
\begin{equation}\label{ref:GRAV:EQU:202dd}
\int_{\Omega} \Psi[p]_{,i} Y^*[\psi]_{,i} \; dx  =  \int_{\Omega} \Psi[p]_{,i} ,Y_i[\psi]  \; dx
\end{equation}
and from Equation~(\ref{ref:GRAV:EQU:201}) with $q=Y^*[\psi]$ we get
\begin{equation}\label{ref:GRAV:EQU:20e}
\int_{\Omega} Y^*[\psi]_{,i}  \Psi[p]_{,i} \; dx  = - \int_{\Omega}  4\pi G \cdot Y^*[\psi] \cdot  p\;  dx
\end{equation}
which leads to
\begin{equation}\label{ref:GRAV:EQU:20ee}
\int_{\Omega} \Psi[p]_{,i} ,Y_i[\psi]  \; dx  = - \int_{\Omega}  4\pi G \cdot Y^*[\psi] \cdot  p \; dx
\end{equation}
and finally
\begin{equation}\label{ref:GRAV:EQU:201a}
\int_{\Omega}   \frac{\partial J^{grav}}{\partial \rho} \cdot p \;  dx  = - \int_{\Omega}
4\pi G \cdot Y^*[\psi] \cdot  p \; dx
\end{equation}
or
\begin{equation}\label{ref:GRAV:EQU:201b}
\frac{\partial J^{grav}}{\partial \rho}  =- 4\pi G \cdot Y^*[\psi]
\end{equation}

\subsection{Geodetic Coordinates }
For geodetic coordinates $(\phi, \lambda, h)$, see Chapter~\ref{Chp:ref:coordinates}, the solution process needs to be slightly modified.
Observations are recorded along the geodetic coordinates axes $\alpha$ rather than the Cartesian axes $i$. In fact we
have in equation~\ref{ref:GRAV:EQU:9}:
\begin{equation}\label{ref:GRAV:EQU:300}
\omega^{(s)}_i \cdot (g_{i}- g^{(s)}_i) = \omega^{(s)}_{\alpha} \cdot (g_{{\alpha}}- g^{(s)}_{\alpha})
\end{equation}
where now $g^{(s)}_{\alpha}$ are the observational data with weighting factors $\omega^{(s)}_{\alpha}$.  Using the
fact that $g_{{\alpha}} = - d_{\alpha \alpha} \psi_{,\alpha}$
equation~\ref{ref:GRAV:EQU:10} translates to
\begin{equation}\label{ref:GRAV:EQU:301}
J^{grav}(k) = \frac{1}{2}\sum_{s} \int_{\widehat{\Omega}}
( \omega^{(s)}_{\alpha} \cdot (d_{\alpha \alpha}  \psi_{,\alpha} + g^{(s)}_{\alpha} ) ) ^2 \; v \; d\widehat{x}
\end{equation}
where $\widehat{\Omega}$ and $d\widehat{x}$ refer to integration over the geodetic coordinates axes. This can be rearranged to
\begin{equation}\label{ref:GRAV:EQU:301bb}
J^{grav}(k) = \frac{1}{2}\sum_{s} \int_{\widehat{\Omega}}
(  \omega^{(s)}_{\alpha} v^{\frac{1}{2}} d_{\alpha \alpha} \cdot ( \psi_{,\alpha} + \frac{1}{d_{\alpha \alpha}} g^{(s)}_{\alpha} ) ) ^2 \; d\widehat{x}
=\frac{1}{2}\sum_{s} \int_{\widehat{\Omega}}
(  {\widehat{\omega}}^{(s)}_{\alpha}\cdot ( \psi_{,\alpha} + \widehat{g}^{(s)}_{\alpha} ) ) ^2 \; d\widehat{x}
\end{equation}
with
\begin{equation}\label{ref:GRAV:EQU:301b}
 \widehat{\omega}^{(s)}_{\alpha} =\omega^{(s)}_{\alpha} v^{\frac{1}{2}} d_{\alpha \alpha} \mbox{ and }
\widehat{ g}^{(s)}_{\alpha}=
\frac{1}{d_{\alpha \alpha}} g^{(s)}_{\alpha}
\end{equation}
which means one can apply the Cartesian formulation to the geodetic coordinates using modified data.
The gravity potential is calculated from
\begin{equation}\label{ref:GRAV:EQU:302}
\int_{\widehat{\Omega}} v \; d_{\alpha \alpha}^2 q_{,\alpha} \psi_{,\alpha} \;  d\widehat{x}
= - \int_{\widehat{\Omega}}  (4\pi G v) \cdot q \rho\;  d\widehat{x}
\end{equation}
see equation~\ref{ref:GRAV:EQU:201}, and the adjoint function $Y^*[\psi]$ for $Y_{\alpha}[\psi]$ is given from
\begin{equation}\label{ref:GRAV:EQU:303}
\int_{\widehat{\Omega}} v  \; d_{\alpha \alpha}^2 q_{,\alpha} Y^*[\psi]_{,\alpha } \;d\widehat{x}  =
  \int_{\widehat{\Omega}} q_{,\alpha} Y_{\alpha}[\psi]  \; d\widehat{x}
\end{equation}
and finally
\begin{equation}\label{ref:GRAV:EQU:310}
 \frac{\partial J^{grav}}{\partial \rho}  = -
(4\pi G v) \cdot Y^*[\psi]
\end{equation}


\lesson{3}{Oct 12 2021 Tue (10:03:31)}{Sum and Difference of Cubes}{Unit 2}

\subsubsection*{Factoring the Sums and Differences of Cubes}

\begin{example}[Factor $30c^3 - 20c^2 - 15c + 10$]
    \begin{align}
        2z^3 + 250 &= 2(z^3 + 125) \\
                   &= z^3 + 5^3 = (z + 5)(z^2 - z \times 5 + 5^2) \\
                   &= 2(z + 5)(z^2 - z \times 5 + 5^2) \\
    \end{align}
\end{example}

\newpage


\lab{Floating Point Numbers}{Floating Point Numbers}
\label{lab:IEEE}
\objective{Gain a basic understanding of the IEEE floating point standard.}

\section*{Introduction}
Floating point numbers permeate modern computing, but it is not always good to use them without knowledge of what they are and how they work.
A fundamental understanding of the inner workings of floating point numbers can be very helpful when working with a wide variety of floating point computations.
By far the most common floating point standard is the IEEE floating point standard described by in the standards IEEE-754-1985, IEEE-854-1987, and IEEE-754-2008.
These standards outline how floating point numbers are represented in binary form and how operations like addition, subtraction, multiplication, division, and rounding should work.
Most floating point numbers are either 32 or 64 bits long.
32 bit floating point numbers are known as "single precision floating point numbers" and 64 bit floating point numbers are known as "double precision floating point numbers."
There are also 16, 128, and 256 bit versions, but they are much less common.
Floating point numbers in Python are stored as double precision values.
Here we will consider 32 bit floating point numbers.

Before considering any more of the details of IEEE floating point representation, it will be good to establish what a floating point number is at all.
Floating point representation is a way of representing a number that is similar to the "scientific notation" commonly used to represent numbers that are extremely large or small.
In general, a floating point number is a number written in the form $d \times \beta^p$ where $\beta \in \mathbb{N}, \beta \geq 2$ is the base used for computation, $d$ is a decimal (like 1.10110) with base $\beta$ and $p\in \mathbb{Z}$ is the power of $\beta$.
Theoretically, for a given base $\beta \in \mathbb{N}, \beta \geq 2$, any real number $r \in \mathbb{R}$ can be represented at least one way by a series of the form
\begin{equation*}
r = d_0 \beta^{p} + d_1 \beta^{p-1} + \dots = \sum_{i=0}^{\infty} d_i \beta^{p-i}
\end{equation*}
where the $d_i$ are the digits of a decimal number $d$.
This representation is not necessarily unique, but finite approximations of this sort of sum can be useful in performing actual computations.
The floating point representation of a number allows easy representation of real numbers, particularly when they are extremely large, or when they are not integers.
The normal mathematical operations on real numbers apply in the theoretical context.

In real applications, floating point numbers can be used to make an \textit{approximate} representation of \textit{a useful number} of real numbers.
There are uncountably many real numbers, so it is impossible to create a computer system that can distinguish perfectly between all of them, but that is okay since measurements are imperfect and approximate computations are usually good enough.

It is also worth noting that often, for brevity, hexadecimal numbers are used to represent integers and floating point nubmers.
A hexadecimal number is a number base 16.
Each digit of a hexadecimal number can be used to represent four binary digits.
The letters a through f are used to represent the additional 6 values needed.
For example a1f23 is the same as 10100001111100100011.
Python has the built in functions \li{bin} and \li{hex} to convert integers to binary and hexadecimal values.
A binary and hexadecimal numbers stored as strings can be converted to integers using the \li{base} argument of the built in \li{int} funciton.
For example \li{int("a1f23", base=16)} will return 663331, the base 10 representation of the number.

\begin{problem}
\begin{itemize}

\item Make a Python class representing an arbitrary precision floating point number.
This shouldn't be too hard since Python's integers are arbitrary precision as well, just store one integer representing the exponent in some way and another representing the significand.
Make methods to do all of the following:
	\begin{itemize}

	\item Convert a floating point object to a Python float.

	\item Print the floating point number correctly.

	\item Copy the floating point number.

	\item Perform addition of two of your floating point objects (perform all operations without any sort of rounding first).

	\item Perform subtraction of two of your floating point objects.

	\item Perform multiplication of two of your floating point objects.

	\item Truncate the significand of the floating point number to remove all digits below a given power of 10.

	\end{itemize}

\item Now, make another class using the class you just wrote that tracks errors in computation.
Track two values, one for the exact value, and one for the exact error.
Computations involving the value and error should be carried out like they would be for your arbitrary precision floating point class.
Have it track the exact value of the significand and the error until you have it truncate all digits that fall within the error.
Make methods that do all of the following:
	\begin{itemize}

	\item Print the floating point number correctly.

	\item Copy the floating point nubmer.

	\item Perform addition of two of your floating point objects.
		Be sure to add the corresponding errors as well to represent that the possible range of values has increased.

	\item Perform subtraction of two floating point objects.
		Again, be sure to add the corresponding errors.

	\item Perform multiplication of two floating point objects.
		Here's how you can calculate the error term:
		Given two floating point numbers $a\pm\epsilon$ and $b\pm\delta$ where $a$ and $b$ are the values and $\epsilon$ and $\delta$ are the error terms, the result will be $ab \pm a\delta \pm b\epsilon \pm \epsilon\delta$.
		The first term in the expanded product will be the significand of the product and the rest will be the new error term.
		Be sure to take absolute values of $a$ and $b$ when calculating the error so that there is never a negative error term.

	\item Truncate the floating point number to the smallest power of ten that is larger than the error term.
		Set the new error term to be this same power of ten.
		(If you want to do many different calculations involving these floating point numbers, you may, at times have to truncate the values to prevent the integer storing the significand from becoming too large.)

	\end{itemize}

\end{itemize}
\end{problem}

\section*{Binary Representation}
A 32 bit floating point number is represented by 32 bits, each storing either a 0 or a 1.

The first bit in the binary representation of a floating point number represents the sign of the number.
If it is 0, the number is positive.
If it is 1, the number is negative.

The next 8 bits are used to store the exponent of the floating point number.
The exponent does not have an explicit sign bit, but is instead scaled so that the counting runs from -127 to 128.

The final 23 bits are used to store the binary decimal number.
This portion of the number is often called the "mantissa" or the "significand".
Since the first number of any decimal in binary is always one, the first number in the significand is assumed to be one and the bits included in the significand are used to represent the remaining digits.

For example, the following is the binary representation of the number .25.

\begin{equation*}
\underbrace{0}_{sign} \underbrace{01111101}_{exponent}\underbrace{(1.)}_{Implied 1.} \underbrace{00000000000000000000000}_{significand}
\end{equation*}

Since there is a limit on the number of digits used to represent the significand, rounding must occur at each step.
There are several possible rounding conventions, but IEEE floating point rounds the significand to the nearest even value, which in binary means that the last digit must become 0.
For example, using binary decimals, the value $1011011.1$ would round to $1011100$ since that is the nearest even number.

Since rounding occurs after each operation, addition, subtraction, multiplication, and division behave \textit{approximately} how they should.
In some cases, the usual properties you would expect from these operations do not hold.
More on that later.

For a double precision floating point number, there is still one bit to store the sign.
There are 11 bits to store the exponent, and 52 bits used to store the value (with the one still implied).

Floating point operations on modern processors are heavily optimized.
There are built in operations that allow for addition, subtraction, multiplication, division, square roots, and several other operations.
Floating point operations are actually a common way of measuring the performance of computer systems.
What is considered a single floating point operation depends somewhat on the system.
Some processors can perform a single addition and multiplication in a single clock cycle, so a floationg point operation is sometimes considered to be an addition and a multiplication.
It can also be measured as an addition or a multiplication.

The highest and lowest values in the exponent are reserved for modified numbers.
Zero is represented using the smallest exponent value (binary 0, representing a negative power of 2 since the exponent is scaled) with a significand of 0.
When the exponent is as small as possible, the significand is no longer considered normalized and the implied one is no longer considered.
This allows for the representation of even smaller numbers, but it implies the loss of some precision.
For example, the following code in Python yields 0
\begin{lstlisting}
1.123456789012345 * 10.**-306 * 10.**153 * 10.**153 - 1.123456789012345
\end{lstlisting}
While this yields -0.0365123681616.
\begin{lstlisting}
1.123456789012345 * 10.**-322 * 10.**161 * 10.**161 - 1.123456789012345
\end{lstlisting}
Numbers represented in this way are called "denormalized numbers" or "subnormal numbers."
Floating point zero is also still allowed to have a sign, so for example, \li{-0.} is valid in Python and prints as \li{-0.0}.
\li{0.} is considered equal to \li{-0.}, but the sign still carries through in multiplication, so for example \li{-0. *  0.} is \li{-0.}.
There are no analogues of the denormalized numbers.
The values of the highest exponent are used to store different kinds of infinity and "nan" values (nan stands for "not a number").
IEEE floating point allows for both negative and positive infinity.
\li{nan} values are defined to never be equal to one another.
Positive and negative infinity can be used for equality testing, for example, the following returns \li{True}.
\begin{lstlisting}
a = (10.**300)
a *= a # a is now positive infinity
a == a
\end{lstlisting}

% see how they measure it at http://software.intel.com/en-us/articles/estimating-flops-using-event-based-sampling-ebs

\section*{Fast Approximation of the Square Root}
% An amusing application, see http://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Approximations_that_depend_on_IEEE_representation
There are a variety of flaws involved with floating point computations, but those will be discussed in a later lab.
Here we will present an example of a clever manipulation of the IEEE floating point format.
Around the end of the 90's an algorithm was discovered which can give a quick approximation of the square root of a number.
It takes advantage of the layout of the bits in the IEEE floating point standard.
The main idea of it is that the exponent of a binary floating point number $d$ can be used as a rough approximation of the number $\log_2\left(d\right)$.
In performing this computation, we must account for the fact that the exponent has been scaled to allow representation of negative numbers.
The smallest exponent for 32 bit floating point integers is $-2^7 - 1 = -127$.
Since a floating point number has 23 bits in the significand, scaling the exponent can be represented in integer form as addition of $2^{30} - 2^{23}$.
Once we have scaled the exponent, we can divide it by two.
We then scale the exponent back to its original value.
With some extra arithmetic, the two scaling values can be reduced into the addition of a single constant.
When all is said and done, some simple code to calculate the square root of a function looks like this:
\begin{lstlisting}
def pysqrt32(A, reps):
    Ac = A.copy()
    I = Ac.view(dtype=np.int32) # get an integer view of the array
    I >>= 1 # divide by two using a binary bit flip
    I += (1<<29) - (1<<22) # scale by a constant value
    for i in xrange(reps):
        Ac = .5 *(Ac + A / Ac) # use an iterative method to increase accuracy, reps is the number of times.
    return Ac
\end{lstlisting}
The iterative method mentioned here is Newton's method, it is discussed at length in Volume 1, this is one of its many applications.
Without using any additional iterations of Newton's method, the above code gives the approximation to the square root shown in Figure \ref{float:sqrtapprox0}.
With one iteration of Newton's Method, the above code gives the approximation shown in Figure \ref{float:sqrtapprox1}.
Notice that there is no visible difference between the square root and the approximation.
The results should be the same for 64 bit floating point numbers.

\begin{figure}
\includegraphics[width=\textwidth]{sqrt0}
\caption{The initial approximation for the square root chosen using the binary representation of the floating point number}
\label{float:sqrtapprox0}
\end{figure}

\begin{figure}
\includegraphics[width=\textwidth]{sqrt1}
\caption{The approximation of the square root after one iteration of an iterative method to increase accuracy.}
\label{float:sqrtapprox1}
\end{figure}

Something similar can be done to find the reciprocal of the square root.
The first two of the following Cython functions calculate the inverse square root for 32 and 64 bit floating point arrays respectively.
The last two functions are equivalents that use the square root function built into C.

\lstinputlisting[name=]{sqrts.pyx}

\begin{figure}
\includegraphics[width=\textwidth]{invsqrt0}
\caption{An initial guess for the inverse square root of a number obtained using the floating point representation.}
\label{float:invsqrt0}
\end{figure}

\begin{figure}
\includegraphics[width=\textwidth]{invsqrt1}
\caption{An approximation for the inverse square root of a number after one iteration of Newton's Method.}
\label{float:invsqrt1}
\end{figure}

This fast inverse square root has been widely used in computer graphics to quickly normalize vectors.
This is a key part of shading 3D surfaces.
It has also been used in a variety of other applications.

\begin{problem}
Make a version of the square root function above that operates on 64 bit floating point arrays.
Hint: you will have to change the type you use for the new view of \li{Ac} and you will have to change the constants $29$ and $22$.
Notice that $29$ is $32-3$ and that $22$ is $29-(e-1)$ where $e$ is the number of bits used for the exponent.

Time the 64 bit square root against NumPy's square root.
NumPy will probably be faster for full accuracy, but the initial guess should run faster than NumPy's square root.
How do the implementations that take advantage of the format of floating point numbers compare with simply taking the reciprocal of the square root of a number using the square root function built in to C?
Why do you think that is?
\end{problem}

Note: It can be interesting to know about these sorts of bitwise operations but, unless you are desperate to optimize an algorithm a little further, it is probably easier and safer to use the built in implementations.


\section{Vectors in Euclidean Spaces of High Dimensions}
\subsection{Vectors in the Real Vector spaces}
If we regard $\mathbb R^n$ algebraically, i.e. see vectors as just a set of components, then it is easy to generalize from $3$ to $n$ dimensions.
\begin{definition}
    Let $\mathbb R^n$ be the set of real $n$-tuples.
    We define addition by $(x_1,x_2,\ldots,x_n)+(y_1,y_2,\ldots,y_n)=(x_1+y_1,x_2+y_2,\ldots, x_n+y_n)$ and scalar multiplication by $\lambda(x_1,x_2,\ldots,x_n)=(\lambda x_1,\lambda x_2,\ldots,\lambda x_n)$.\\
    So we can define linear combinations and the notion of parallel similarly.
\end{definition}
For any $\underline{x}\in\mathbb R^n$, we can write $\underline{x}=\sum_ix_i\underline{e_i}$ where $\underline{e_i}$ is a set of orthorgonal basis.
For example, we can take $e_1=(1,0,\ldots,0), e_2=(0,1,\ldots,0), \ldots, e_n=(0,0,\ldots,1)$.
This is called the standard basis of $\mathbb R^n$.\\
We can define the inner (dot) product in a similar way:
\begin{definition}
    The inner product (aka scalar product, dot product) is defined by
    $$\underline{x}\cdot\underline{y}=\sum_ix_iy_i$$
\end{definition}
We have a few properties for the inner products, which is basically analogous to the case in the $3$-dimensional case.
\begin{proposition}
    1. The inner product is symmetric.\\
    2. The inner product is bilinear.\\
    3. $\underline{x}\cdot\underline{x}\ge 0$ and the equality hold if and only if $\underline{x}=\underline{0}$.
    That is, it is positive definite.
    We thus define the length or norm $|\underline{x}|$ to be $\sqrt{\underline{x}\cdot\underline{x}}$.
    4. The standard basis in $\mathbb R^n$ is an orthonormal basis.
\end{proposition}
\begin{proof}
    Trivial.
\end{proof}
\begin{theorem}[Cauchy-Schwartz Inequality]
    $$|\underline{x}\cdot\underline{y}|\le |\underline{x}||\underline{y}|$$
    The equality hold if and only if $\underline{x},\underline{y}$ are parallel to each other.
\end{theorem}
The deduction from this is that we can define the angle between two vectors by examining the ratio between the right and left hand side of the inequality.\\
We can also have the triangle inequality, as one may expect norms to satisfy.
\begin{proof}
    Consider
    $$0\le|\underline{x}-\lambda\underline{y}|^2=|x|^2-2\lambda\underline{x}\cdot\underline{y}+\lambda^2|y|^2$$
    Taking this as a quadratic in $\lambda$, we have
    $$\delta=4(x\cdot y)^2-4|x|^2|y|^2\le 0\implies|\underline{x}\cdot\underline{y}|\le |\underline{x}||\underline{y}|$$
    The equality holds if and only if $\delta=0\iff 0=|\underline{x}-\lambda\underline{y}|^2\iff\underline{x}\parallel\underline{y}$.
\end{proof}
\begin{theorem}
    $|\underline{x}+\underline{y}|\le|\underline{x}|+|\underline{y}|$
\end{theorem}
\begin{proof}
    Square both sides and use Cauchy-Schwartz.
\end{proof}
Note that by $\underline{x}\cdot\underline{y}$, we can think of $\underline{x},\underline{y}$ as both row and column vectors, since it doesn't matter.
But still if we take them as for example column vectors, then their transposes are row vectors, so $\underline{x}\cdot\underline{y}=\underline{x}^\top\underline{y}$.\\
The algebraic definition of of the inner product can be also written by $\delta_{ij}$, so it gives us the initiative to generalize the summation convention.
In $\mathbb R^3$, we also have an algebraic definition of cross product. but we cannot really generalize it to $\mathbb R^n$.
We have a generalization of $\epsilon$ though, which is also antisymmetric.\\
But in $\mathbb R^2$, this generalization gives $\epsilon_{ij}$, where we can define a product by
$$[\underline{a},\underline{b}]=\epsilon_{ij}a_ib_j=a_1b_2-a_2b_1$$
Geometrically, this gives the signed area of the parallelogram that $a,b$ defined.\\
In comparison, $[\underline{a},\underline{b},\underline{c}]=\underline{a}\cdot(\underline{b}\times\underline{c})=\epsilon_{ijk}a_ib_jc_k$ is the volume of the size of a parallelopiped that these three vectors construct.
\subsection{Axioms of Real Vector Spaces}
\begin{definition}
    Let $V$ be a set of objects called vectors with operations:\\
    1. $\underline{v}+\underline{w}\in V$.\\
    2. $\lambda\underline{v}\in V$.\\
    For $\underline{v},\underline{w}\in V, \lambda\in\mathbb R$.\\
    Then $V$ is called a real vector space if $(V,+,\underline{0})$ is an abelian group addition\\
    1. $\lambda (\underline{v}+\underline{w})=\lambda\underline{v}+\lambda\underline{w}$.\\
    2. $(\lambda+\mu)\underline{v}=\lambda\underline{v}+\mu\underline{v}$.\\
    3. $(\lambda\mu)\underline{v}=\lambda(\mu(\underline{v}))$.\\
    4. $1\underline{v}=\underline{v}$.\\
    where $\lambda,\mu\in\mathbb R, \underline{v},\underline{w}\in V$
\end{definition}
\begin{definition}
    For any vectors $\underline{v_1},\underline{v_2},\ldots\underline{v_r}\in V$, we can form a linear combination
    $$\sum_{i=1}^ra_i\underline{v_i}$$
    where $a_i\in\mathbb R$.
    The span of these vectors $\operatorname{span}\{v_1,v_2,\ldots,v_r\}$ consists of all linear combinations of these vectors.\\
    The span is a subspace, that is, a subset of the vector space that is itself a vector space under the same way of vector addition and scalar multiplication.
\end{definition}
It is immediate that nonempty subset $U\subseteq V$ is a subspace if and only if $\operatorname{span} U=U$.
\begin{example}
    Take $V=\mathbb R^3$, then any line or plane through the origin is a subspace, but a line or plane that does not contain the origin is not since \underline{0}=$\underline{v}+(-1)\underline{v}\in\operatorname{span}\{\underline{v}\}$.
\end{example}
\begin{definition}
    A set of vectors $\underline{v_1},\underline{v_2},\ldots,\underline{v_r}$, a linear relation of them is an equation
    $$\sum_{i=1}^r\lambda_i\underline{v_i}=\underline{0}$$
    If the equation if true only if $\lambda_i=0$ for every $i$, then the vectors are called linearly independent and that they obey only the trivial linear relation.
    And we say this set of vectors is a independent set.\\
    Otherwise, we say they are linearly dependent, and the set of vectors a dependent set.
\end{definition}
\begin{example}
    1. So for example, if we take $V=\mathbb R^2$ and consider the set $(0,1),(1,0),(0,2)$.
    It is a dependent set since $2(0,1)-(0,2)=(0,0)$.\\
    2. Any set containing $\underline{0}$ is dependent.\\
    3. $\{\underline{a}\}$ is independent if and only if $\underline{a}\neq\underline{0}$.\\
    4. $\{\underline{a},\underline{b}\}$ is independent if and only if $\underline{a}\nparallel\underline{b}$.
\end{example}
\begin{definition}
    A function $\cdot:V\times V\to\mathbb R$ is called an inner product on $V$ if and only if:\\
    1. $\underline{v}\cdot\underline{w}=\underline{w}\cdot\underline{v}$.\\
    2. It is bilinear.\\
    3. $\underline{v}\cdot\underline{v}\ge 0$ and the equality hold if and only if $\underline{v}=\underline{0}$.
\end{definition}
\subsection{Basis and Dimension}
For general vector spaces, a basis $\mathscr{B}$ is a independent set of vectors such that $\operatorname{span}\mathscr{B}=V$.
Given this property, it is trivial that the coefficients of any vector as a linear combination of elements in $\mathscr{B}$ are unique.
\begin{example}
    The standard basis for $\mathbb R^n$ consisting of
    $$\underline{e_1}=(1,0,\ldots,0),\underline{e_2}=(0,1,\ldots,0),\ldots,\underline{e_n}=(0,0,\ldots,1)$$
    is a basis.
    There are many other basis can be chosen though.
    For example, in $\mathbb R^2$, $\{(1,0),(1,1)\}$, $\{(1,-1),(1,1)\}$ or simply any $\{\underline{a},\underline{b}\}$ that are not parallel would be a basis.
\end{example}
\begin{theorem}
    If $\{\underline{e_1},\underline{e_2},\ldots.\underline{e_n}\}$ and $\{\underline{f_1},\underline{f_2},\ldots.\underline{f_m}\}$, then $m=n$.
\end{theorem}
It follows that we can define the following
\begin{definition}
    The number of vectors in a basis in a vector space is called its dimension.
    So with this definition, $\mathbb R^n$ has dimension $n$.
\end{definition}
Now we can prove the theorem.
\begin{proof}
    Note that we can find coefficients $A_{ai}$ such that $\underline{f_a}=\sum_iA_{ai}\underline{e_i}$ for each $a$.
    Similarly, $\underline{e_i}=\sum_aB_{ia}\underline{f_a}$.\\
    Then $\underline{f_a}=\sum_b(\sum_iA_{ai}B_{ib})\underline{f_b}$ and $\underline{e_i}=\sum_j(\sum_aB_{ia}A_{aj})\underline{e_j}$.
    So $\sum_iA_{ai}B_{ib}=\delta_{ij}$ and $\sum_aB_{ia}A_{aj}=\delta_{ij}$.\\
    $\sum_{i,a}A_{ai}B_{ia}=\sum_i\delta_{ii}$ and $\sum_{i,a}A_{ai}B_{ia}=\sum_a\delta_{aa}$, thus $n=m$.
\end{proof}
In fact we did secretly used traces, but we have presented it within the scope of this course.
The proof in the general case can be done elegantly using matrices.\\
We can also apply our notions to the following:
\begin{proposition}
    Let $V$ be a vector space of dimension $n$.\\
    1. If $Y=\{\underline{w_1},\underline{w_2},\ldots,\underline{w_m}\}$ spans $V$, then $m\ge n$ and if $m>n$ we can remove an element from $Y$ such that the new set of vectors still spans $V$.
    Thus we can continue doing it till it becomes a basis.\\
    2. If $X=\{\underline{u_1},\underline{u_2},\ldots,\underline{u_k}\}$ be an independent set of vectors, then $k\le n$ and if $k<n$ we can add vector to $X$ until we have a basis.
\end{proposition}
\begin{proof}
    1. If $Y$ is linearly independent, then we are done and $m=n$.
    Otherwise, there is some linear relation $\sum_i\lambda_i\underline{w_i}=0$ such that $\exists i, \lambda_i\neq 0$.
    WLOG $i=m$, then $\underline{w_m}=\lambda_m^{-1}(\sum_{i,i\neq m}\underline{w_i})$.
    So $Y'=Y\setminus\{\underline{w_m}\}$ spans $V$.
    We can repeat this till it becomes independent, i.e. we obtain a basis.\\
    2. If $X$ spans $V$, we are done and then $k=m$.
    Otherwise, there is some $\underline{u_{k+1}}\in V\setminus\operatorname{span}X$, then $X\cup\{\underline{u_{k+1}}\}$ is still independent.
    Indeed, if there is some nontrivial linear relation $\sum_i\mu_i\underline{u_i}=0$, then $\mu_{k+1}\neq 0$ since $X$ is independent, but then $\underline{u_{k+1}}$ can be written as a linear combination of $\underline{u_i}$ for $i\in\{1,2,\ldots,k\}$, contradiction.\\
    So we can do it over again and obtain a basis at last.
\end{proof}
Note that the basis does not use nor depend on the inner product structure of the vector space.
But we can make use of it to obtain an orthorgonal basis.
\begin{definition}
    A basis is called orthorgonal if they are pairwisely orthorgonal.
\end{definition}
\begin{proposition}
    Any set of pairwise orthogonal vectors is independent.
\end{proposition}
\begin{proof}
    Easy.
\end{proof}
\subsection{Vectors in the Complex Vector Space}
\begin{definition}
    Let $\mathbb C^n$ consist of all complex $n$-tuples.
    We define the vector space by taking the vector addition and scalar multiplication analogously to the $\mathbb R^n$ case.
\end{definition}
Taking real scalars in scalar multiplication, then $\mathbb C^n$ is just a real vector space of dimension $2n$.
Taking complex scalars, $\mathbb C^n$ is a complex vector space.\\
The definitions of linear combinations, linear independence, basis, dimensions are all analogous.
Consider
$$(z_1,\ldots,z_n)=(x_1+iy_1,\ldots,x_n+iy_n)=(x_1,\ldots,x_n)+i(y_1,\ldots,y_n)$$
then $\underline{e_j}$ and $i\underline{e_j}$ gives a basis for $\mathbb C^n$ as a real vector space.
And the $\underline{e_j}$ is a basis for $\mathbb C^n$ as a complex vector space.
We view $\mathbb C_n$ to be over $\mathbb C$ unless otherwise stated.
\begin{definition}
    The inner product on $\mathbb C^n$ is defined by
    $(\underline{z},\underline{w})=\sum_{j}\bar{z}_jw_j$
\end{definition}
\begin{proposition}
    The complex inner product is:\\
    1. Hermitian, $(\underline{z},\underline{w})=\overline{(\underline{w},\underline{z})}$.\\
    2. Anti-linear, $(\underline{z},\lambda\underline{w}+\lambda'\underline{w'})=\lambda(\underline{z},\underline{w})+\lambda'(\underline{z},\underline{w'})$ and $(\lambda\underline{z}+\lambda'\underline{z'},\underline{w})=\bar\lambda(\underline{z},\underline{w})+\bar\lambda'(\underline{z'}+\underline{w})$.\\
    3. Positive definite.
\end{proposition}
The geometric content of this sort of inner product is a little more subtle than in the real case.
\begin{example}
    Consider the complex inner product on $\mathbb C$, that is $n=1$, since there is only one component, $(z,w)=\bar zw$.
    Suppose $z=a_1+ia_2,w=b_1+ib_2$ where $a_1,a_2,b_1,b_2\in\mathbb R$.
    Let $\underline{a}=(a_1,a_2),\underline{b}=(b_1,b_2)$, then
    $$(z,w)=a_1b_1+a_2b_2+i(a_1b_2-a_2b_1)=\underline{a}\cdot\underline{b}+i[\underline{a},\underline{b}]$$
\end{example}
Given the positive definite property, we can define the length or norm $|\underline{z}|$ for any $\underline{z}\in\mathbb C^n$ by $|\underline{z}|=\sqrt{(\underline{z},\underline{z})}$.
We still say that two complex vectors are orthorgonal if their (complex) inner product vanishes.
In this way, the standard basis for $\mathbb C^n$ is orthorgonal.\\
If $\underline{z_1},\underline{z_2},\ldots,\underline{z_k}$ are nonzero and orthorgonal, then they are linearly independent.\\
Notationally, we think of the vectors in $\mathbb C^n$ as column vector, and the Hermitian conjugate $\underline{z}^{\dagger}$ the row vector consisting of the conjugates of the entries.