Categories
Concept
Category theory can be viewed as the field studying spaces and transformations of spaces. For instance, vector spaces and their transformations (linear maps), groups/fields and their transformations (group/field homomorphisms), sets and their transformations (functions), topological spaces and their transformations (continuous functions).
To that end, the role of a category is to package together some spaces along with their transformations. The spaces are termed objects, and the transformations morphisms (a generalization of homomorphism). The collection of all topological spaces together with all continuous functions together forms the category .
The definition of a category adopts only very mild conditions on its data: essentially, that composition is associative and has identity (is “monoidal”). Hence, although the “quintessential” categories are those of spaces and transformations, the notion of a category is not limited to such constructions. (The notion of category can be seen as largely syntactic.)
As examples of categories that do not consist of spaces and transformations but are still useful, one can consider poset categories and group deloopings, as well as many category-theoretic constructions, such as slice categories, product categories, categories of elements, comma categories, and the like.
Definition
A category consists exactly of
A collection1 of objects in
For any two objects , a collection of morphisms from to (also called arrows). A morphism in is usually written as (hence the name ‘arrow’).
For any two morphisms and , a designated2 composite morphism (also written ).
By ‘designated’, I mean that a category not only contains a morphism for every choice of , but also that it chooses one in particular and calls it (or ).
A category must abide by the following laws:
-collections are pairwise disjoint
Composition is associative
Composition has identities: for each object the collection is inhabited by at least one morphism, called the identity morphism which acts as an identity for
Examples
, the category where and where
The category whose objects are rings (without identity) is sometimes called
, the category with no objects
, the category with a single object and a single morphism
, the category with two objects, and , identities for each, and a single other morphism
, the category with two objects, and , identities for each, and morphisms and
, the category whose objects are functions (with varying) and whose morphisms are morphisms such that . (See slice category)
Notation, terminology, and remarks
The collections are often called hom-sets. Generally speaking, they need not be sets nor contain hom(omorphism)s. More correctly, but less frequently, they are called mor-collections.
If , then we may write and say that goes “from to ". Additionally, we may say that the “domain” of is and the “codomain” , or that the “source” of is and the “target”
The collection of all morphisms in a category is denoted
The definition of category carefully contains the word ‘collection’ several times. This is not to be interpreted as a synonym for ‘set’, but as a more generic notion of ‘collection’, such as classes4. The reason for this is to avoid size issues: we want to consider the category of all sets, and if were a set, then that would give a set of all sets, which is impossible.
There are other options as well
Equality of objects/morphisms is assumed to ‘exist a priori’; i.e., don’t worry about it. Apparently equality is a spicy subject in category theory. I guess it’s fine to assume (to start) Leibniz equality, that two things are equal exactly when they abide by the same properties.
To some people, the term “homomorphism” means something slightly different than “element of ". We will not respect this distinction, using both “homomorphism” and “morphism” to mean the same thing.