Category theory studies the abstraction of mathematical objects (such as sets, groups, and topological spaces) in terms of the morphisms between them. These morphisms often represent functions. For example, in the category of sets, morphisms are functions, in the category of groups they are group homomorphism and in the category of topological spaces they are continuous maps.
Morphisms do not have to represent functions. For example, any partially ordered set may be seen as a category where there is a (unique) morphism between two elements and if and only if .
Categories are usually drawn as diagrams where the objects of interest in the category are usually represented by variables or points with (labelled) arrows between them representing morphisms. For this reason morphisms are also referred to as arrows.
A category consists of a collection of objects with morphisms between them. A morphism goes from one object, say , to another, say , and is drawn as an arrow from to . Note that may equal (in which case is referred to as an endomorphism). The object is called the domain of and is called the codomain of . This is written as .
These morphisms must satisfy three conditions:
Note that composition is written 'backwards' since given an element and two functions and , the result of applying then is which equals .