# Connecting Mac Lane's discussion of free categories from graphs to free algebraic systems

I want to understand how the following observation applies to free algebraic systems. In Thm. II.7.1 of Mac Lane's Categories for the Working Mathematician (p.49 of ed. 2), the functor $$P:G \rightarrow UC$$ is universal when $$U$$ the forgetful functor. The theorem: Check me here: for functor $$U$$ and object $$G$$ (are we treating $$G$$ as an object in the category of categories?), the pair $$\langle C, P\rangle$$ is a universal arrow from $$G$$ to $$U$$ because for every other pair $$\langle B,D \rangle$$ where $$D: G \rightarrow UB$$, $$D$$ can be factored as $$(UD') \circ P = D$$. Correct?

On p.56 Mac Lane states that this same idea can be applied to free algebraic systems which I don't understand.

Monoid case: should I be thinking of $$C$$ and $$B$$ as free monoids (understood as categories with single objects) with a functor $$D'$$ between them? Is $$G$$ for this case then the small graph with a single object and arrows the self loops corresponding to the generators of $$C$$? A careful explanation of this case would be helpful for me.

Is the takeaway that free monoid $$C$$ and functor $$U$$ are somehow special because of the factoring condition? (The concept of universality is a new one for me.)

• G is a graph and this is a diagram in the category of graphs. The universal arrow is from G to UC and the rest of your statement is correct. When you move to free monoids, you have a similar situation using the category of sets and the category of monoids. May 4 at 22:35

To clarify the connection between free algebraic structures (like monoids) and the theorem you quoted, let me write out the analogous theorem about monoids. I'll write $$U$$ for the "underlying set" functor from monoids to groups.
"Let $$G$$ be a set. There is a monoid $$C=C_G$$ and a morphism $$P:G\to UC$$ of sets from $$G$$ to the underlying set $$UC$$ of $$C$$ with the following property. Given any monoid $$B$$ and any morphism $$D:G\to UB$$ of sets, there is a unique morphism of monoids $$D':C\to B$$ with $$(UD')\circ P=D$$ as in the commutative diagram [same diagram as in Mac Lane's theorem]."
You should check that the $$C$$ is the monoid version of the theorem can be constructed as the set of all finite words on the alphabet $$G$$ with the operation of concatenation (i.e., the usual construction of a free monoid on $$G$$). The function $$P$$ sends each letter in the alphabet $$G$$ to the corresponding one-letter word in $$C$$.
• Thank you! I understand that a free monoid is just the collection of finite words constructed from a generating alphabet. Just to be clear, is $G$ then the generating alphabet understood as a set and $UC$ the set of all finite words generated? If so, $P$ would be an inclusion map between sets. But in this context I should think of it as a functor between discrete categories (sets). Correct?
• @fred Most of your comment is fine, but at the very end you should think of $P$ as simply a map of sets, i.e., a morphism in the category of sets. I see nothing to gain here (except complexity and confusion) by viewing sets as discrete categories and maps as functors. The sets in this example are analogous to the graphs in the text you quoted. May 6 at 16:04