# The Unapologetic Mathematician

## Free Algebras

Let’s work an explicit example from start to finish to illustrate these free monoid objects a little further. Consider the category $K\mathbf{-mod}$ of modules over the commutative ring $K$, with tensor product over $K$ as its monoidal structure. We know that monoid objects here are $K$-algebras with units.

Before we can invoke our theorem to cook up free $K$-algebras, we need to verify the hypotheses. First of all, $K\mathbf{-mod}$ is symmetric. Well, remember that the tensor product is defined so that $K$-bilinear functions from $A\times B$ to $C$ are in bijection with $K$-linear functions from $A\otimes B$ to $C$. So we’ll define the function $T(a,b)=b\otimes a$. Now there is a unique function $\tau:A\otimes B\rightarrow B\otimes A$ which sends $a\otimes b$ to $b\otimes a$. Naturality and symmetry are straightforward from here.

Now we need to know that $K\mathbf{-mod}$ is closed. Again, this goes back to the definition of tensor products. The set $\hom_K(A\otimes B,C)$ consists of $K$-linear functions from $A\otimes B$ to $C$, which correspond to $K$-bilinear functions from $A\times B$ to $C$. Now we can use th same argument we did for sets to see such a function as a $K$-linear function from $A$ to the $K$-module $\hom_K(B,C)$. Remember here that every modyle over $K$ is both a left and a right module because $K$ is commutative. That is, we have a bijection $\hom_K(A\otimes B)\cong\hom_K(A,\hom_K(B,C))$. Naturality is easy to check, so we conclude that $K\mathbf{-mod}$ is indeed closed.

Finally, we need to see that $K\mathbf{-mod}$ has countable coproducts. But the direct sum of modules gives us our coproducts (but not products, since our index set is infinite). Then since $K\mathbf{-mod}$ is closed the tensor product preserves all of these coproducts.

At last, the machinery of our free monoid object theorem creaks to life and says that the free $K$-algebra on a $K$-module $A$ is $\bigoplus\limits_n(A^{\otimes n})$. And we see that this is exactly how we constructed the free ring on an abelian group! In fact, that’s a special case of this construction because abelian groups are $\mathbb{Z}$-modules and rings are $\mathbb{Z}$-algebras.