A category consists of a collection of things and binary relationships (or transitions) between them, such that these relationships can be combined and include the “identity” relationship “is the same as.”
A category is a directed graph with a rule saying how to compose two edges that fit together to get a new edge. Furthermore, each vertex has an edge starting and ending at that vertex, which acts as an identity for this composition.
A category is a combinatorial model for a directed space – a “directed homotopy 1-type” in some sense. It has “points”, called objects, and also directed “paths”, or “processes” connecting these points, called morphisms. There is a rule for how to compose paths; and for each object there is an identity path that starts and ends there.
More precisely, a category consists of a collections of objects and a collection of morphisms. Every morphism has a source object and a target object. If is a morphism with as its source and as its target, we write
and we say that is a morphism from to . In a category, we can compose a morphism and a morphism to get a morphism . Composition is associative and satisfies the left and right unit laws.
The example to keep in mind is the category Set, in which the objects are sets and a morphism is a function from the set to the set . Here composition is the usual composition of functions.
For more background on and context for categories see
A category consists of
a collection of objects;
a collection of morphisms (or arrows);
two maps called source (or domain) and target (or codomain);
a rule which assigns to any pair of morphisms , such that their composite morphism (also written or sometimes — see diagrammatic order);
a rule which assigns to each object a morphism , the identity morphism on ;
such that the following properties are satisfied:
source and target are respected by composition: and ;
source and target are respected by identities: , ;
composition is associative: whenever and ;
composition satisfies the left and right unit laws: given any morphism we have .
People often write , , or for the collection of morphisms ; the latter two have the advantage of making clear which category is being discussed. People also often write instead of as a short way to indicate that is an object of . Also, some people write and instead of and .
The classic example is Set, the category with sets as objects and functions as morphisms, and the usual composition of functions as composition. Here are some other famous examples, which arise as variations on this theme:
Vect - vector spaces as objects, linear maps as morphisms.
Top - topological spaces as objects, continuous functions as morphisms.
Diff - smooth manifolds as objects, smooth maps as morphisms.
Note that in all these cases the morphisms are actually special sorts of functions. That need not be the case in general!
These classic examples are the original motivation for the term “category”: all of the above categories encapsulate one “kind of mathematical structure”. These are often called “concrete” categories (that term also has a technical definition that these examples all satisfy). But just as widespread in applications as these categorization examples of categories are are other categories (often “small” ones) which, roughly, model something like states and processes of some system.
Poset A poset can be thought of as a category with its elements as objects and one morphism in each if is less than or equal to , but none otherwise.
Group A group is just a category where there’s one object and all the morphisms have inverses - we call the morphisms “elements” of the group. This may seem weird, but it’s actually a very useful viewpoint. Here’s another way to say it: A group is a groupoid with a single object.
Monoid More generally, a monoid is a category with a single object. In fact, this is one way to motivate the concept of categories: categories are the many object version of monoids.
Quiver A quiver is a free category on a directed graph. Given a directed graph with collection of vertices and collection of edges , there is the free category on the graph whose collection of objects coincides with the collection of vertices, and whose collection of morphisms consists of finite sequences of edges in that fit together head-to-tail. The composition operation in this free category is the concatenation of sequences of edges.
The attentive reader will note that we said a category has a ‘collection’ of objects and a ‘collection’ of morphisms. A category is said to be small if these collections are sets — as opposed to proper classes, for example. (The alternatives depend on ones foundations for mathematics.)
Similarly, a category is locally small if is a set for every pair of objects in that category. The above examples of “concrete” categories are all locally small but not small (unless one restricts their objects in some way).
The definition of a category can be rephrased in different mostly-equivalent ways. For example, instead of taking as given a collection of objects and a collection of morphisms, one can take as given a collection of objects, together with for each pair of objects a collection of morphisms from to . (If each collection is a set, then this latter version defines only a “locally small category,” as above.) The first definition generalizes naturally to internal categories, while the second generalizes naturally to enriched categories.
It is also possible to define a category in terms of only one collection (the collection of arrows); see single-sorted definition of a category. This is sometimes convenient for technical reasons.
We will build a database of categories listing well-known categories (with links to articles on these categories, if such articles) and some of their properties. Right now this is just beginning.
Let’s include a lot of nice online introductions. Here is a start:
Jaap van Oosten, Basic category theory.
Andrea Schalk and H. Simmons, An introduction to category theory in four easy movements, notes for a course offered as part of the MSc. in Mathematical Logic, Manchester University.
Daniele Turim, Category theory lecture notes, 1996-2001. Based on Mac Lane’s book (1998).
A. Martini, H. Ehrig, and D. Nunes, Elements of basic category theory, Technical Report 96-5, Technical University Berlin.