Why is a slice category a category? I don't understand why the Hom-sets in a slice category are disjoint.
Let $C$ be a category and $A$ an object of $C$, then the slice category $C_{A}$ has as objects all morphisms $f\colon Z \to A $ where $Z$ is an object of $C$.
For two objects of $C_A$, $f_1 \colon Z_1 \to A$ and $f_2 \colon Z_2 \to A$,  the elements of $Hom_{C_A}(f_1,f_2)$ are given by the elements of $\sigma \in Hom_{C}(Z_1,Z_2)$ that satisfy $f_1=f_2 \circ \sigma$.
The definition of a category entails that $Hom_{C_A}(f,g)$ and $Hom_{C_A}(f',g')$ have to be disjoint unless $(f,g)=(f',g')$.
Now let $Z$ be an object in $C$ and let $f_1,f_2 \in Hom_{C}(Z,A)$ such that $f_1 \neq f_2$
Then the identity morphism $id_Z \in Hom_C(Z,Z)$ satisfies $f_1=f_1\circ id_Z$ and $f_2=f_2\circ id_Z$.
Hence $id_Z \in Hom_{C_A}(f_1,f_1)$ and $id_Z \in Hom_{C_A}(f_2,f_2)$, implying that $C_A$ is not a category.
What am i getting wrong here? I've had this problem since i read the definition of  a slice category in Aluffi's book, which i find a bit unclear.
At first i thought that maybe the morphisms contain the information of their source and target and that instead of elements in $Hom_C(f_1,f_2)$ they would be something like tuples of the form $(f_1,f_2,\sigma)$ where $\sigma \in Hom_C(f_1,f_2)$.
But according to the definition given on Wikipedia for example (https://en.wikipedia.org/wiki/Comma_category#Definition), this doesn't seem to be the case.
 A: There are two ways you can define the morphism part of a category $\mathcal{C}$. Either:


*

*Define a set $\mathrm{mor}(\mathcal{C})$ of morphisms and functions $\mathrm{dom}, \mathrm{cod} : \mathrm{mor}(\mathcal{C}) \to \mathrm{ob}(\mathcal{C})$; or

*Define sets $\mathrm{Hom}_{\mathcal{C}}(A,B)$ for each $A,B \in \mathrm{ob}(\mathcal{C})$.


To translate from the first definition into the second, you can define $\mathrm{Hom}_{\mathcal{C}}(A,B)$ to be $\{ f \in \mathrm{mor}(\mathcal{C}) \mid \mathrm{dom}(f) = A \text{ and } \mathrm{cod}(f) = B \}$. Then the hom sets are automatically disjoint since the domain and codomain are encoded in the morphism.
In the second case, however, the hom sets don't need to be disjoint, since we haven't explicitly required disjointness of the hom sets. Thus the second case is more general than the first case. This is why some people require hom sets to be disjoint—namely, so that $\mathrm{dom}(f)$ and $\mathrm{cod}(f)$ are well-defined.
However, you can always turn a specification of a category without disjoint hom sets into a specification of a category with disjoint hom sets, by replacing $\mathrm{Hom}_{\mathcal{C}}(A,B)$ by $\{A\} \times \{ B \} \times \mathrm{Hom}_{\mathcal{C}}(A,B)$, so that a morphism $f : A \to B$ is then 'officially' a triple $(A,B,f)$.
This is equivalent to defining $\mathrm{mor}(\mathcal{C})$ to be the disjoint union $\bigsqcup\limits_{(A,B) \in \mathrm{ob}(\mathcal{C}) \times \mathrm{ob}(\mathcal{C})} \mathrm{Hom}_{\mathcal{C}}(A,B)$ and taking $\mathrm{dom}$ and $\mathrm{cod}$ to be the respective projection maps to $\mathrm{ob}(\mathcal{C})$.
Under this encoding, a morphism $\sigma : (f_1 : Z_1 \to A) \to (f_2 : Z_2 \to A)$ in $\mathcal{C}/A$ is 'officially' a triple $(f_1,f_2,\sigma)$ where $\sigma : Z_1 \to Z_2$ and $f_2 \circ \sigma = f_1$. The morphisms $\mathrm{id}_Z : f_1 \to f_1$ and $\mathrm{id}_Z : f_2 \to f_2$ are then 'officially' triples $(f_1,f_1,\mathrm{id}_Z)$ and $(f_2,f_2,\mathrm{id}_Z)$, so you don't have any issues.
However, in practice, it's easier to define $\mathrm{Hom}_{\mathcal{C}}(A,B)$ without worrying about whether the hom sets are disjoint, and rest easy with the knowledge that the hom sets could be made disjoint if you wanted them to be.
