I am working an elementary (not to me) exercise in category theory:
Consider the category of sets, denoted by $\mathcal{S}et$. Check in detail the axioms of a category holds. What exactly are the morphisms?
I know that for each $A,B\in\mathcal{S}et$, we can define the set of morphisms $Mor(A,B)$ to just be the set of all the functions from $A$ to $B$.
However, I don't know how to prove the first axiom, that is
If $A\neq C$ or $B\neq D,$ then $Mor(A,B)\cap Mor(C,D)=\varnothing$
I tried to argue with contradiction:
Let $A,B,C,D\in \mathcal{S}et$ such that $A\neq C$ and $B\neq D$, then consider $Mor(A,B)$ and $Mor(C,D)$.
Suppose $Mor(A,B)\cap Mor(C,D)\neq \varnothing$, then there must be a morphism $$f\in Mor(A,B)\cap Mor(C,D).$$
Then, we know that $f$ is a function from $A$ to $B$ and is also a function from $C$ to $D$.
Then what should I do to arrive at a contradiction? How could I use $A\neq C$ and $B\neq D$?
Thank you!
Hint: you raise a good technical point. In a category, one must be able to determine the domain and codomain of an arrow from the arrow. If you take the usual set-theoretic approach and represent a function $f$ by its graph $\{(x, y) \mid f(x) = y\}$, then you cannot recover the codomain of $f$ from its representation: $n : \Bbb{N} \mapsto n^2$ could be viewed as function $\Bbb{N} \to \Bbb{N}$ or $\Bbb{N} \to \Bbb{Z}$. So you need to represent morphisms in the category of sets as pairs $(f, Y)$, where $f$ is the graph of a function whose range is contained in $Y$. (Or more symmetrically, you could use triples $(X, f, Y)$ where $f$ is the graph of a function from $X$ to $Y$.)