The following question is taken from Arrows, Structures and Functors the categorical imperative by Arbib and Manes.
$\color{Green}{Background:}$
Let $A, B$ be sets. A $\textbf{relation from} A$ to $B$, denoted $\alpha:A\to B,$ is a subset $\alpha$ of $A\times B.$ If also $\beta: B\to C$ define $\beta\cdot \alpha: A\to C$ by
$$\beta\cdot \alpha=\{(a,c)\mid \text{ for some }b\in B, (a,b)\in \alpha \text{ and } (b,c)\in \beta \}$$
$(a)$ Show that $\textbf{K},$ whose objects are sets and whose morphisms are relations, is a category with composition as above
$(b)$ Given $\alpha:A\to B$
define
$\alpha^{*}:B\to A$ by $\alpha^{*}=\{(b,a)\mid(a,b)\in \alpha\}.$
Show that a diagram
$$A\xleftarrow{\pi_1}P\xrightarrow{\pi_2}B$$
is a product in $R$ if and only if $$A\xrightarrow{{\pi_1}^{*}}P\xleftarrow{{\pi_2}^{*}}B$$
is a coproduct in $\textbf{K}$
$\color{Red}{Questions:}$
For the exercise above, I am not sure if product and coproduct are defined in the context of $\textbf{Set}.$ If so, I am not sure how to properly define the projection map for the product and injection maps for coproduct. My guess is as follows:
The projection maps are as follows:
$A\times B\xrightarrow{\pi_1}A:(a,b)\mapsto a$ and $A\times B\xrightarrow{\pi_2}B:(a,b)\mapsto b,$ similarly if we replace one of the $A$ or $B$ with $C$. But since the maps $\alpha\in B,$ $\beta\in C,$ $\beta\cdot \alpha \in C$ and $\alpha^{*}\in A.$ Then won't we have:
Let $P=A\times B$
$A\times B\xrightarrow{\pi_1}A:(\alpha^{*}, \alpha)\mapsto \alpha^{*},$
$A\times B\xrightarrow{\pi_2}A:(\alpha^{*}, \alpha)\mapsto \alpha,$
The projection maps for $A\times C$ or $B\times C$ would not make sense since both $\beta\cdot \alpha, \beta$ are in $C$.
For the injection maps,
$A\xrightarrow{{in}_1}A+B:a\mapsto (a,1)$
$B\xrightarrow{{in}_2}A+B:b\mapsto (b,2),$
So, let $P=A+B$, then the injection maps are:
$A\xrightarrow{{in}_1}A+B:\alpha^{*}\mapsto (\alpha^{*},1)$
and
$B\xrightarrow{{in}_2}A+B:\alpha\mapsto (\alpha, 2)$
As in the projection maps case, it would not make sense to have the case $A+C$ or $B+C,$ since both $\beta, \beta\cdot\alpha$ are both in $C.$
In both projections and injection maps, I don't have to write them in terms of elements. What I mean is I don't have to let $\alpha^{*}=(b,a)$ and $\alpha=(a,b)?$
Also, is there ways to involve $\beta\in C$ and $\beta\cdot\alpha\in C$ in the definition of projection and injection maps for product and coproduct respectively.
Thank you in advance
