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 source or domain of and is called the target or codomain of , though note that itself need not be a Function and and need not be sets. This is written as .
These morphisms must satisfy three conditions:
- [Composition_of_functions Composition]: For any two morphisms and , there exists a morphism , written as or simply .
- Associativity: For any morphisms , and composition is associative, i.e., .
- [identity_map Identity]: For any object , there is a (unique) morphism, which, when composed with another morphism, leaves it unchanged. I.e., given and it holds that: and .