Questions about the definition of a Category

This is the following definition of a category that I'm using

enter image description here

Now correct me if I'm wrong but nothing explicitly in the definition of a category above states that for any two objects $X$, $Y \in \text{Obj}(C)$ there must exist a morphism $f \in \text{Hom}_C(X, Y)$ correct?

But under the text describing composition, there most exist a morphism $f \in \text{Hom}_C(X, Y)$ for any two objects $X$, $Y \in \text{Obj}(C)$, because we need that morphism for composition. So there can't be any empty $\text{Hom}_C(X, Y)$ classes correct?

My assertion in the above paragraph would then trivially prove the following.

Let $C$ be a category and suppose $f \in \text{Hom}_C(X, Y)$ for some objects $X, Y \in \text{Obj}(C)$, then there exists a morphism $g \in \text{Hom}_C(Y, X)$

Has everything I said above been correct?


Solution 1:

Yes, it may happen that $\operatorname{Hom}_C(X,Y)$ is the empty class.

No, that does not invalidate the part about composition. If $\operatorname{Hom}_C(X,Y)=\emptyset$, then it is vacuously true that for every $f\in \operatorname{Hom}_C(X,Y)$ and $g\in \operatorname{Hom}_C(Y,Z)$, we have a composite morphism $g\circ f$.


An example is the category of fields and field homomorphisms: If two fields have different characteristic, there is no morphism between them.

Solution 2:

The axioms just state that there is a mapping

$$ Hom(X,Y) \times Hom(Y,Z) \to Hom(X,Z) $$

but this does not imply that $Hom(X,Y),Hom(Y,Z)$ and $Hom(X,Z)$ are non empty.

Indeed, if any of $Hom(X,Y),Hom(Y,Z)$ are empty, then the domain of the wanted mapping is empty, so we can take the mapping to be the empty set. Indeed, the empty set is a mapping $\emptyset \to A$ for any class $A$. (It is also unique, since no other such mappings exist.)

For a simple counterexample, take the $\bf Set$ category made of sets and functions, and observe that $Hom(\{42\},\emptyset)$ is empty, otherwise we could take a morphism/function $f:\{42\}\to\emptyset$ and have $f(42)\in\emptyset$.

Discrete (poset) categories also provide counterexamples. Take $\{0,1\}$ as objects, and only the two identity morphisms $id_0,id_1$. This makes a category, even if $Hom(0,1)=Hom(1,0)=\emptyset$.

At most, the composition axiom implies that, if $Hom(X,Y),Hom(Y,Z)$ are both non empty, then $Hom(X,Z)$ is also non empty. This is because we can take two morphisms $f\in Hom(X,Y),g \in Hom(Y,Z)$ and compose them as $g\circ f \in Hom(X,Z)$.

$Hom(W,W)$ is always nonempty because of the identity morphism.