# In a category, does the composition morphism need to exist?

I revisited this popular tutorial about category theory after some time and I realised that right at the beginning there is a statement about what a category is:

In a category, if there is an arrow going from A to B and an arrow going from B to C then there must also be a direct arrow from A to C that is their composition.

Is that true in a standard category? All this time I was happy with my composition function

$$\circ : \operatorname{Hom}_\mathcal{C}(A,B)\times\operatorname{Hom}_\mathcal{C}(B,C)\to\operatorname{Hom}_\mathcal{C}(A,C)$$

To my knowledge this function never complained when the codomain was the empty set. Was I operating in something that is not a category? Or is the statement in the tutorial an oversimplification and I'm being too pedantic?

• +1 just by the picture. Very funny :D May 16, 2018 at 9:49
• I don't take any credit @Dog_69 it's from the page in the link May 16, 2018 at 9:50
• OK. But still... It's worth. May 16, 2018 at 11:42
• Maybe you were operating in $\mathsf{Rel}$-enriched categories without knowing ($\mathsf{Rel}$ is the category of sets and relations between them) ?
– Pece
May 16, 2018 at 12:27
• No smartpants :) May 16, 2018 at 12:38

## 1 Answer

If the codomain is the empty set and the domain is not, then the composition map cannot exist as there is no map from a non empty set into the empty set. Hence the existence of such a composition map rules out this situation.

• In other words, if $Hom(A,C)$ is empty the composition function proves that one of $Hom(A,B)$ or $Hom(B,C)$ must be empty May 16, 2018 at 9:47
• Thanks, sometimes my brain doesn't go that extra step. May 16, 2018 at 9:49
• @Chessanator This holds for all functions, not just composition; there is no function from a non-empty set to the empty set. Put another way, the set of all functions from non-empty sets to the empty set is the empty set. Dec 11, 2020 at 10:08