## Category Theory: Definition and Examples

**Point of Post:** The point of this post is to give the axiomatic definition of a category, and explain some of the nuances I’ve picked up. Also, I will give quite a few examples and show that they are indeed categoreis.

**Definition**

It comes time now to actually define what a category is. So, formally a *category *is a quadruple consisting of

**a) **A class , whose members are called -objects.

**b) **A set for for each whose members are referred to as -morphisms.

*Remark: *It is common to instead of write to write “ is a morphism”

**c) **For each -object a morphism

**d) **A composition law which associates for any morphism and any morphism a morphism called the composite of and

*Remark: *To me, it seems that we could rephrase this as. For each -objects there exists a function

Such that

**1) **The composition is associative, namely for morphisms and the equation holds true.

**2) **If is a morphism then

**3) **The elements of the set are pairwise disjoint.

*Remark:* It is common to denote as and .

Also, if then we say that is the *domain *of , denoted . Similarly, is called the *codomain *and is denoted . Note that by assumption **c) **above we have that for each we have that and are *unique*. Note though that even if 3**) **weren’t true we could force the uniqueness by replacing by . Thus, in practice we do not show **3)**

It is important to notice that is defined if and only if in the same sense that if (normal functions) and you couldn’t consider

Lastly, it is common to write if more than one categories are involved.

**Examples**

** **I’ll now give a few examples and non-examples of these ubiquitous structures and carefully show why each is or isn’t a category keeping with the lettering/number of the axioms above **a),…,d),1),2)** Note that while the examples may be easily verifiable, most category theory books (the three I’ve seen to be specific) state examples but do not go through a single one.

** Example:** Define the category to be the one with

,

,

is the identity map on , and if and are morphisms then is defined as the normal composition of functions.

So, now we need to check that this actually defines a category. So, we need to verify the six axioms (the existence and functional)

**a) **Clearly is a class.

**b) **We also have that for each there is an associated set, namely the set of all continuous functions from to

**c) **For each we have identified an element, namely the identity map. Note though that just merely saying isn’t enough. Once you’ve defined there is actually a question of whether or not is contained within it. But, it is obviously true that as defined is a map from to and since (as is easily proven) the identity map on any topological space to itself is continuous.

*Remark:* The above may cause some ambiguity if one does not recall that a topological space is the set (remember we defined an ordered pair of sets as a set) where is a set and is a topology on . Thus, when we say that the map is continuous, we are being sloppy and should really write to indicate that the domain and codomain are not only equal as sets,but equal as topological spaces in the sense that they are imbued with the same topology. In other words, topological space means the set and the topology on it. It is easy to find a set with different topologies such that the identity map need not be continuous.

This is part of a larger issue. When one gets into category theory one need be precise. Remember that formally a topological space, as I just said, is an ordered pair and the elements of are topological spaces. So, when we write we are thinking of the ‘s in both slots as being equal as objects of , i.e. equal as topological spaces. This gets confusing though since we denote arbitrary objects as just capital letters, the same sloppy notation used to identify a topological space with it’s underlying set. The same goes for all structures where the true definitions of them is an ordered tuple but we denote them using only the underlying set.

**d) **We have defined what it means to compose when and a. Note that clearly if and that , but for we need that is continuous. But, a simple topological fact is that the composition of continuous maps is continuous. So, in fact and the specified mapping is indeed legitimate.

Now, we must show that these identified things satisfy the two functional axioms.

**1) ** We must show that the composition operation, as defined, is associative. But, this is immediate since normal function composition is associative.

**2) **We must check that for each and each that , but this follows immediately since are the identity maps on respectively and is function composition.

** Non-Example:** The following example is stronger than a mere non-example. We will give three of the four definitions of a category and show that there does not exist a definition of the fourth which transforms it into a category. Thus, creating infinitely many examples of non-categories.

We’ll present this non-example in the categorical sense, namely we’ll define its objects, its morphisms, etc. We do this for purely pedagogical reasons. So, consider where

, and for we defined

We verify the axioms (or at leas those that work)

**a) **We have certainly chose so that was a class.

**b) **We have, for each defined a set

**d) **We have, for each , defined a mapping

So, now we have to try and prove the two functional axioms.

**1) **Suppose that and , and . Then,

and

and so is associative.

**2) **We know show that no matter how one defines if that there exists some such that . To do this, let and . Then, we note that

But, if it were really an “identity element” we would have that . Thus, if one choose then this equality is untrue and so cannot be the desired identity element.

** Example:** Let be defined as follows:

,

, is the identity function, and is normal function composition. So, let us verify the axioms

**a) **Clearly we have defined to be a class

**b) **Also, we have defined to be a set, namely the set of all functions

**c) **We have defined, for each a , thus the only question is if it is really a morphism . But, this is clear since the identity function is a map from to itself.

**d) **For each we have specified the function

so the question is whether or not this definition of a function is well-defined. And, it clearly is (we’ll show in the next non-example why this step shouldn’t be omitted when checking whether is a category)

So, we just need to check the functional axioms:

**1) **Clearly is associative, since it’s regular function composition

**2) **Also, it’s clear that if that since is normal function composition and are the normal identity maps on respectively.

** Non-Example: **Let us consider some with

,

,

is the identity function, and is normal function composition

I point out this example for one simple reason. It is easy to verify like all else before that

**a) ** is a class

**b) **For each two -object there is an associated hom-set

**c) **For every object , namely , the prescribed is in fact in

**1) **The composition operation is clearly associative, being normal function composition.

**2) **The chosen identity element suffices.

Thus, from the looks of it is going to be a category. But then, you realize that our definition of is not well-defined. Notice that by definition we must have that

But, take to be the only thing it can, , and notice that while that . Thus, the composition function is not well-defined.

The thing being, it’s easy when you prove that something is a category over and over and over again to get used to being “given” the objects, in the contrived sense of the word. Namely, you do an exercise “Prove… is a category”. So, you might take the given four tuple, and prove that it satisfies the two function axioms **1) **and **2) **paying nary a mind to **a),b),c) **or **d) **since in almost every other example they just worked. You need to be diligent, otherwise stupid examples like the above may trip you up. All in all, just because you say a function maps to does not mean it does.

* Example: *Every group induces a category where , , (where is the identity element of ) and

So, now we need to check that this is actually a category

**a) **Clearly is a class. (recall informally that any set is a class and “sets of sets” are classes)

**b) **We need to check that for each there is an associated set , but the only is . But, as indicated we have that which is a set.

**c) **We have identified for every (namely, ) an identity element (the only choice this time being . Furthermore, we see that for every (since )

**d) **Lastly, we notice that for each we have defined a mapping

The reason for this is that there is only one choice for and that’s and we’ve defined a mapping

namely the multiplication map

We now need to check that the four definitions of the tuples (see the actual definition if you don’t understand the tuple reference). Namely

**1) **We need to check that given any that the associated map is associative. But, as said before there is only one such map since there is only one choice for namely . Thus, we must only check that the map is associative. Notice though that since is actually the multiplication map that for any three morphisms we have that

This is because we assumed that was a group, and so by definition is associative.

**2) **We need to check that for any and any morphism that . But, our only choice is and so for any we have that

from where the second axiom follows.

**3) **Clearly since there is only one hom-set (this is the categorical vernacular for any set of the form ) they are pairwise disjoint

Thus, as defined is, in fact, a category

*Remark: *Note that this shows that the morphisms need not be functions from to as they were in all the preceding examples.

Note also that there was no mention of the fact that had inverses, the only thing that was important was the associativity of the multiplication and the existence of an identity element. Thus, the above applies equally well for things called *monoids* which are just sets with an associative binary operation and an identity element. I’m going to do at least one or two posts on them immediately after this one, so I delay their explicit mention until then.

**References:**

*1. *Adámek, Jiří, Horst Herrlich, and George E. Strecker. “Categories and Functors.” *Abstract and Concrete Categories: the Joy of Cats*. New York: Wiley, 1990. Pr

[…] intuition about categories, but to set down some of the notation and recurring characters. We have already defined categories (although, somewhat unsatisfactorily, but it will have to do) and motivated […]

Pingback by Examples of Categories (Revisited) « Abstract Nonsense | November 2, 2011 |

[…] of now, with just the bare definition of categories, we have little to work with. From our current standpoint, all morphisms are created […]

Pingback by Types of Morphisms « Abstract Nonsense | December 27, 2011 |

[…] that we know what categories are we’d like to define the appropriate sub notion, of when a smaller category sits inside a […]

Pingback by Subcategories and Skeleta « Abstract Nonsense | December 27, 2011 |

[…] Roughly what we we shall see is that direct systems over a fixed preordered set form a nice little category and limits shall be functors on this category. Moreover, what we shall see is that there is a […]

Pingback by Category of Directed/Inverse Systems and the Direct/Inverse Limit Functor « Abstract Nonsense | December 27, 2011 |

[…] is a simple example of why in general categories aren’t balanced. Indeed, the monos and epis in are the injective and surjective […]

Pingback by The Exponential and Trigonometric Functions (Pt. II) « Abstract Nonsense | May 5, 2012 |