What category is the universal property of the Free Group a diagram in

category-theorygroup-theoryuniversal-property

wikipedia says that the free group is defined by a universal property:

The free group $F_S$ is the universal group generated by the set $S$. This can be formalized by the following universal property: given any function $f$ from $S$ to a group $G$, there exists a unique homomorphism $φ: F_S → G$ making the following diagram commute (where the unnamed mapping denotes the inclusion from $S$ into $F_S$):

enter image description here

My question is, in what category is this a diagram? Is it in Grp or Set? Either way I'm confused, because $S$ is not a group, suggesting it's in Set, but the uniqueness of $\phi$ only holds for homomorphisms, not general functions, suggesting this is in Grp.

Best Answer

As you say, $S$ is a set, so this is a diagram in $\text{Set}$. The fact that we force $\varphi$ to be a homomorphism of groups is extra structure that isn't captured by the diagram alone.

You might consider this unsatisfying, so alternatively we can explicitly name the forgetful functor $U : \text{Grp} \to \text{Set}$ from groups to sets, which is being implicitly applied to $G$ here, and regard $f$ as a morphism $f : S \to U(G)$ in $\text{Set}$, then talk about the universal property in terms of the adjunction

$$\text{Hom}_{\text{Grp}}(F(S), G) \cong \text{Hom}_{\text{Set}}(S, U(G)).$$