# The Unapologetic Mathematician

## Group objects

Just like we have monoid objects, we can construct a category called $\mathrm{Th}(\mathbf{Grp})$, which encodes the notion of a “group object”.

Groups are a lot like monoids, but we’ll need to be able to do a few more things to describe groups than we needed for monoids. So let’s start with all the same setup as for monoid objects, but let’s make the monoidal structure in our toy category be an actual cartesian structure. That is, we start with an object $G$ and we build up all the “powers”, but now we insist that they be built from categorical products rather than just some arbitrary monoidal structure. Then $G^{\times n}$ is the categorical product of $n$ copies of $G$. Not only does this work like a monoidal structure, but it come equipped with a bunch of extra arrows. For example, there are arrows to “project out” a copy of $G$ from a product, and every object $X$ has a unique arrow $t_X$ from $X$ to the terminal object — the product of zero copies of $G$.

More importantly it has an arrow $\Delta:G\rightarrow G\times G$ called the “diagonal” that is defined as the unique arrow satisfying $\pi_1\circ\Delta=1_G=\pi_2\circ\Delta$. That is, it makes an “identical copy” of $G$. For instance, in the context of sets this is the function $\Delta:S\rightarrow S\times S$ defined by $\Delta(s)=(s,s)$.

Now we do everything like we did for monoid objects. There’s a morphism $m:G\times G\rightarrow G$, and one $e:G^{\otimes0}\rightarrow G$, and these satisfy the identity and associativity relations. Now we also throw in an arrow $i:G\rightarrow G$ satisfying $m\circ(i\times1_G)\circ\Delta=e\circ t_G=m\circ(1_G\times i)\circ\Delta$. That is, we can start with an “element” of $G$ and split it into two copies. Then we can either copy with $i$ and leave the other alone. Then we can multiply together the copies. Either choice of which one to hit with $i$ will give us the exact same result as if we’d just “forgotten” the original element of $G$ by passing to the terminal object, and then created a copy of the identity element with $e$.

Wow, that looks complicated. Well, let’s take a functor from this category to $\mathbf{Set}$ that preserves products. Then what does the equation say in terms of elements of sets? We read off $m(x,i(x))=e=m(i(x),x)$. That is, the product of $x$ and $i(x)$ on either side is just the single element in the image of the arrow described by $e$ — the identity element of the monoid. But this is the condition that $i(x)$ be the inverse of $x$. So we’re just saying that (when we read the condition in sets) every element of our monoid has an inverse, which makes it into a group! Now a group object in any other category $\mathcal{C}$ is a product-preserving functor from $\mathrm{Th}(\mathbf{Grp})$ to $\mathcal{C}$.

We can do even better. Since the monoidal structure in $\mathrm{Th}(\mathbf{Grp})$ is cartesian, it comes with a symmetry. The twist $\tau_{A,B}:A\times B\rightarrow B\times A$ is defined as the unique arrow satisfying $\pi_1\circ\tau_{A,B}=\pi_2$ and $\pi_2\circ\tau_{A,B}=\pi_1$. In sets, this means $\tau_{A,B}(a,b)=(b,a)$. Now we can add the relation $m\circ\tau_{G,G}=m$ to our category. In sets this reads that $m(x,y)=m(y,x)$, which says that the multiplication is commutative. The resulting category is $\mathrm{Th}(\mathbf{Ab})$ — the “theory of abelian groups” — and an “abelian group object” in a category $\mathcal{C}$ is a product-preserving functor in $\mathcal{C}^{\mathrm{Th}(\mathbf{Ab})}$.