# Category Theory - Basic question concerning the intersection of arbitrary sets and their morphisms

Take an arbitrary category $\mathscr{C}$ and let $A, B \in \text{ob} (\mathscr{C})$. Also, let $\mathscr{C}(A, B)$ the collection of all morphisms between $A$ and $B$. In his book "Basic Category Theory" Tom Leinster writes:

"If $f \in \mathscr{C}(A,B)$, we call $A$ the domain and $B$ the codomain of $f$. Every map in every category has a definite domain and a definite codomain. (If you believe it makes sense to form the intersection of an arbitrary pair of abstract sets, you should add to the definition of category the condition that $\mathscr{C}(A,B) \cap \mathscr{C}(A',B')= \emptyset$ unless $A=A'$ and $B=B'$.)"

My problem is with the statement in between brackets.

The point is that if we work in $\mathbf{Set}$ it seems to me this condition is too strong. Indeed, let a function be defined in such a way that $x \mapsto x^2$ for every $x \in \mathbb{R}$. Then we have actually two morphisms in the category, namely $f \in \mathbf{Set}(\mathbb{R}, \mathbb{R})$ and $f' \in \mathbf{Set}(\mathbb{R}, \mathbb{R}^+)$: the codomains are different but their intersection is nonempty, but $f$ and $f'$ are somewhat similar, i.e., there is some 'overlap' in between them, so we should have something like $\mathbf{Set}(\mathbb{R},\mathbb{R}) \cap \mathbf{Set}(\mathbb{R},\mathbb{R}^+) \neq \emptyset$.

Any help to clarify this point will be greatly appreciated.
Thank you for your time.

In a category the domain and codomain of a morphism are an intrinsic property of a morphism: the same morphism can't have two different domains or two different codomains. In the category of sets, you have to represent a morphism as something like a triple $(X, f, Y)$, where $X$ and $Y$ are sets and $f$ is a set of pairs comprising a function from $X$ to $Y$. In your example you have $(\Bbb{R}, f, \Bbb{R}) \in {\cal C}(\Bbb{R}, \Bbb{R})$ which is not the same as $(\Bbb{R}, f, \Bbb{R}^{+}) \in {\cal C}(\Bbb{R}, \Bbb{R}^{+})$.

In the example immediately following the passage that you quote, Leinster states that "a map from $A$ to $B$ in the category $\mathbf{Set}$ is exactly what is ordinarily called a map (or mapping or function)". This is rather misleading to anyone brought up on the usual set-theoretic definition of a function as a set of pairs.

• First of all, thanks a lot! Thus, the bottom line should be that $x \mapsto x^2$ generates an uncountable number of morphisms in $\mathbf{Set}$, each and all of them different, as long as the codomain $B$ is such that $B \supseteq \mathbb{R}^+$ (with $A := \mathbb{R}$), right? – Kolmin May 13 '18 at 12:19
• @Kolmin Yes. Technically, note that $B$ is otherwise unconstrained, so the "number of generated morphisms" is not well defined, since we have one for each $B\supseteq \mathbb{R}^+$, and the class of all these $B$'s is a proper class, which has no cardinality. Morally, though, I'd consider your intuition to be correct. – chi May 13 '18 at 13:43
• @chi Thanks a lot, very useful: +1. I felt my statement was somewhat problematic to formalize and only intuitive. I see everything you write, however I don't understand your usage of "otherwise", since I don't see the alternative (i.e., if we want to translate $x \mapsto x^2$ in $\mathbf{Set}$, we have to put the constrain $B \supseteq \mathbb{R}^+$: there are really no other options). – Kolmin May 13 '18 at 15:08
• What chi means is that there is no upper bound on the sets $B$ such that $B \supseteq \Bbb{R}^{+}$. So the "number" of such sets isn't defined in set theory: set theory only defines cardinalities for sets and not for proper classes. – Rob Arthan May 13 '18 at 15:18
• @RobArthan This I got :). My problem was quite literally with the usage of the conjunction "otherwise": it made me feel I was missing something, while from both what chi and you wrote this was not the case (after your first comment). Anyway, really thanks a lot to both of you! – Kolmin May 13 '18 at 17:00

It is a similar story as with a disjoint union of sets. If you have two sets $A,B$ that are not necessarily disjoint, you can still form the set known as $A \sqcup B$. One possible implementation is $A\times \{1\} \cup B\times \{2\}$.

Also in your case you can label each morphism with its domain and codomain, to make sure that different copies of "the same map" are distinguished when they belong to different hom-sets. And then of course you mentally immediately forget that you did this and treat the hom-sets as disjoint.

• First of all, thanks a lot! Actually I could see that you can parametrize the morphisms with their corresponding domains and codomains. My problem was more about the relation between different morphisms that refer to what is actually (in set-theoretic terms) the same function (see my comment below Rob Arthan's answer). – Kolmin May 13 '18 at 12:23