Part of the first section of Hungerford’s Algebra is on category theory, with a focus on products, coproducts, and free objects.

The distinction between classes and sets in Hungerford is informal. We start with undefined notions of class, membership, and equality. A class can be thought of as an object that satisfies a formula. Classes are very similar to sets except that we do not allow classes to be members of other classes and they are thought to be defined purely defined in terms of the formula. Some classes can manifest as a set. The classes that are not sets are said to be proper classes. Classes were invented to avoid sets that lead to paradoxes such as Russel’s paradox. A set of all sets, or a set of all groups does not exist, but we commonly discuss the categories and .

A category consists of a class of objects, a class of morphisms, and a binary operation , called composition of morphisms.

Each morphism has a source object and a target object , and this is denoted . denotes the hom-class of all morphisms from to . The binary operation is such that The composition of is written as or , and satisfies associativity and the existence of an identity:

Every object has a morphism called the identity morphism for such that for every morphism , .

These definitions are reminiscent of functions between sets. In concrete categories, objects are sets and morphisms are simply functions.

A morphism is called an equivalence if there is a morphism such that . If is an equivalence, and are said to be equivalent. A morphism to itself is called an endomorphism.

Next, we define products and coproducts.

A product of is usually denoted . A family of objects in a category need not have a product. In category theory, we can always interchange the source and target of each morphism to obtain the dual statement.

For a category , the dual category is a category with the same objects but where the morphisms have interchanged the source and target. A dual statement is obtained by interchanging the source and target of each morphism and interchanging the order of composing two morphisms, e.g. is replaced by . We see that a statement is true in iff its dual statement is true in .

The coproduct is the dual notion of a product. Its definition is as follows:

Although there is no uniform notation for coproduct, is sometimes used.

In the category , the category of sets, the product is the Cartesian product, defined as The coproduct in is the disjoint union, defined as

Next, we discuss free objects.

Essentially, to define a morphism with domain , it suffices to specify it on the image . As an example, consider the category of groups. Let and be the inclusion map. Then is free on in . Let be a group and . Let . The map defined by is the unique homomorphism with .

The notation seems to suggest that is an injection. Indeed, it usually is an injection.

*Proof.* If
, then
is injective. Assume
. Assume
is not injective.
That is, there exists
.
Let
be an object in
with
and let
where
,
where
. Because
is free, there is a
unique morphism
where
as
a map of sets. But
a contradiction. ◻

Products, coproducts, and free objects are all similar in that they are defined by the existence of a unique morphism up to equivalence. This is called a universal property.

Clearly, universal and couniversal are dual concepts. There is only one universal or couniversal object in a category up to equivalence.

*Proof.* Let
and
be universal objects
in
. Since
is universal, there
is a unique morphism
. Similarly,
there is a unique morphism
. The
composition
is a
morphism of
. Since
is
also a morphism of
, by
universality,
.
Likewise,
is a
morphism so
.
Thus
is an
equivalence. ◻

As an example, is both a universal and couniversal object in .

We shall show that products, coproducts, and free objects are universal objects in an appropriately defined category:

Let be a free object on the set in a concrete category . Define a new category as follows: objects of are maps of sets , where is an object of . A morphism in from to is a morphism of such that . Note that in is in . Also, is an equivalence in iff is an equivalence in . Since is free on , for each function there is a unique morphism such that . Thus is a universal object in the category .

*Proof.* Let
,
be the
functions defined by the definition of free objects. There is a
bijection
. Since
is a universal object
in
as defined
above, there is a unique morphism
in
which
implies that there is a unique morphism
in
such that
.
Let
be the
inverse of
. By similar
reasoning, there is a unique morphism
in
such that
.
Thus
Since
is universal in
,
.
Similarly,
Thus
is an
equivalence. ◻

The converse is false in general.

Now we show that a product is a couniversal object in an appropriate category. By duality, this would also imply that a coproduct is a universal object in an appropriate category.

Let be a family of objects in a category . Define a category whose objects are all pairs , where is an object of and is a morphism of . A morphism in