Definition
A category consists of
- A collection , whose elements are called the objects of and are usually denoted by uppercase letters
- A collection , whose elements are called the morphisms or arrows of and are usually denoted by lowercase letter such that
- Each morphism has assigned two objects, called source and target, or domain and codomain. We denote the source and target of the morphism by and , respectively. If the morphism has source and target , we also write , or more graphically,
- Each object has a distinguished morphism , called identity morphism
- For each pair of morphism such that there exists a specified morphism , called the composite morphism, such that and . More graphically:
These structures need to satisfy the following axioms
- Unitality: for every morphism , the compositions and are both equal to
- Associativity: for , and , the composition and are equal
Categories as operations
Another way to think about categories is
A category is a collection of operations which can be composed in a consistent way
An example for this idea is a group. We can view a group as a particular category, where
- There is a single object
- There is a morphism for each element , denoted as
- The identity of the object is the morphism given by
- The composition is given by the multiplication of . That is, the composition of the morphisms given by is the morphism given by the element of
Note that we didn't use the inverse of , since this property is unnecessary to form a category. Therefore, if we drop the inverse requirement, we can still get a category, and this means a monoid can also be seen as a category
Sometimes, to distinguish the concept of a group/monoid and a category, we may define the category we get from a group as the delooping of , denoted as . Similarly, stands for the delooping of monoid
Categories as spaces and maps with extra structure
By the name, we can consider a category as a collection of sets or spaces equipped with extra structure, and maps between them which are compatible with that structure
We can therefore give some examples of category in this idea.
Category Set
The category is the category whose objects are sets, and whose morphisms are maps (functions) between them.
For each set , the identity function is a function . Functions can be composed, and the composition is associative.
Category Top
The category is the category whose objects are topological spaces, and whose morphisms are continuous maps between them
Category Mfd
The category is the category whose objects are smooth manifolds, and whose morphisms are smooth maps between them
Category Vect
The category is the category whose objects are vector spaces, and whose morphisms are linear maps between them
Category Meas
The category is the category whose objects are measurable spaces, and whose morphisms are measurable maps between them
Category Grp
The category is the category whose objects are groups, and whose morphisms are homomorphisms between them, i.e. maps such that for each , we have
Category Poset
The category is the category whose objects are partially ordered sets, and whose morphisms are monotone maps between them, i.e. maps such that for each with in , we have in
Other examples
Graph Theory
For graphs there are many choices of morphisms, depending on what one wants to do with graphs. For example, for undirected, unweighted graphs, a possible choice of morphisms is function between the sets of vertices which preserve the adjacency relation: if the vertices and are connected by an edge in , then and must be connected by an edge in . With this choice of morphisms, graphs and these morphisms form a category.
Considerations with Sets
From Russell's paradox, we know that there is no such thing as the "set of all sets" since we cannot conclude whether the set contains itself. Therefore, if we want a "category of all sets", the objects of this category cannot form a set. That is why we said collections rather than sets in the definition of a category
We call a category is small if and (see the definition above) are sets. And a category is called locally small if for every to objects and of , the morphisms form a set
Based on this, if we let and be objects of a locally small category . The hom-set or hom-space of and is the set of morphisms of from X to Y, denoted by . For example,
- is the set of all functions , i.e. the morphisms of
- is the set of all continuous functions , i.e. the morphisms of
- is the set of all linear functions