Category Theory and Graph of a Function

172 Views Asked by At

Let's assume I have a function between sets $X$ and $Y$, $f:X\to Y$. How can I view this as a subset of $X\times Y$? I am aware from category theory that a product comes equipped with two projection maps, so actually when we write $X\times Y$, we really mean $(X\times Y, p_x, p_y)$.

My question is this, am I guaranteed that there always exists a section of $p_x$, let's call it $s$, such that I can write $f=p_y \circ s_x$? Is this section unique? Is there any theorem with which one can check if a section exists?

1

There are 1 best solutions below

6
On BEST ANSWER

Let $\mathcal A$ be a category with binary products. Given $f_1 : Z \to A, f_2 : Z \to B$ there is a unqiue morphism $(f_1,f_2) : Z\to A\times B$, such that $p_A\circ (f_1,f_2) = f_1$ and $p_B \circ (f_1,f_2)$ (by the universal property of products).

Now in your case, we have $f = p_Y\circ (\operatorname{id}_X, f)$ and $p_X \circ (\operatorname{id}_X, f) = \operatorname{id}_X$. This morphism is unique (by the universal property of products).

In the case $\mathcal A = \mathsf{Set}$ we explicitly have:

$$(\operatorname{id}_X, f)(x) = (x,f(x))$$


Indeed, in category theory $(\operatorname{id}_X,f)$ is commonly defined to be the graph of $f$. The morphism $(\operatorname{id}_X,f)$ is obviously mono. A mono into $X\times Y$ is called a relation from $X$ to $Y$, so in this sense the graph of a morphism is a (categorical) relation.