Note that this composition is unique by the axioms of category theory. If we instead work in a weak higher category, composition need not be unique. In this sense we may identify the composite of and with the colimit over the diagram . This point of view is taken and generalized in transfinite composition.
This reduces to the above definition in the case that Set. The composition morphism sends any two composable morphisms to their composite.
For three objects, the composition morphism
Strictly speaking, composition as defined above is binary composition. One can also define -ary composites for any natural number : given objects and morphisms , we get the composite . Since composition in a category is associative, a definition of -ary composition from binary composition via any choice of bracketing will be equal to that resulting from any other choice of bracketing. The unary composite of is simply itself, and the nullary composite of is its identity morphism.
Conversely, a category can equivalently be defined as a quiver (a directed graph) equipped with an -ary composition operation for every natural number , satisfying suitable associativity axioms. This definition may be called unbiased, as opposed to the usual definition which is “biased” towards and .
Traditionally, the composite of and as above is written , following the notation introduced by the followers of Leibniz for composition of functions. This is often abbreviated as simply . Of course, this notation preserves the order of symbols in the elementwise definition of function composition: .
On the other hand, reading a diagram
the notation reads better. One way to make this anti-Leibniz convention clearer is to write (which is based on the interpretation of programming commands as morphisms in theoretical computer science). Since this convention is motivated by the drawing of diagrams, it is also sometimes called diagrammatic order.
Therefore, the notations and are ambiguous, while and are less so. It seems that the notation for is more common than for , although the notation occurs in some important older papers.
Although diagrammatic order has advantages and partisans, especially among category theorists and computer scientists, the “classical” order of composition is firmly entrenched in much of mathematics. Many people who agree that diagrammatic order is “better” on its own merits nevertheless believe that trying to change the established “classical” order of composition creates more confusion than it removes.
In some older category theory papers, arrows were written pointing from right to left, so that the composition of arrows could be written in the “classical” style, while still preserving the diagrammatic intuition. Hom-sets were accordingly written , where is the source, and is the target. This sort of convention has also been used by people working with string diagrams and surface diagrams.