# General description of colimits in $\mathbf{Set}$

I'm not sure I can match the statement given here (from https://arxiv.org/abs/1612.09375) with the real results:

Example 5.2.16. The colimit of a diagram $$D \colon \mathbf{I} \to \mathbf{Set}$$ is given by $$\lim_{\to \mathbf{I}} D = \left. \left( \sum_{I \in \mathbf{I}} D(I) \right) \middle/ {\sim} \right.$$ where $$\sim$$ is the equivalence relation on $$\sum D(I)$$ generated by $$x \sim (Du)(x)$$ for all $$u \colon I \to J$$ in $$\mathbf{I}$$ and $$x \in D(I)$$. To see this, note that for any set $$A$$, the maps $$\left. \left( \sum D(I) \right) \middle/ {\sim} \right. \to A$$ correspond bijectively with the maps $$f \colon \sum D(I) \to A$$ such that $$f(x) = f( (Du)(x) )$$ for all $$u$$ and $$x$$ (by Remark 5.2.8). These in turn correspond to families of maps $$( f_I \colon D(I) \to A )_{I \in \mathbf{I}}$$ such that $$f_I(x) = f_J( (Du)(x) )$$ for all $$u$$ and $$x$$; but these are exactly the cocones on $$D$$ with vertex $$A$$.

For example, coequalizer is a colimit of a diagram $$s,t: X\to Y$$. In this case, $$\mathbf I =\{I,J\}$$, $$u,v:I\to J$$, $$s=Du, t=Dv, X=D(I), Y=D(J)$$. The colimit is $$Y/\sim$$ where $$\sim$$ is the equivalence relation generated by $$\{(s(x),t(x)):x\in X\}$$.

However the example suggests that the colimit is $$(X+Y)/e$$ where $$e$$ is the equivalence relation on $$X+Y$$ "generated by $$x\sim (Du)(x)$$".

My first concern is technical, but it really bothers me: I'm not quite sure how to write the "generating set" explicitly as a set. Naively, the generating set is the set $$\{(x,s(x)):x\in X\}\cup\{(x,t(x)):x\in X\}.$$ But by definition, $$X+Y=\{(x,\ast):x\in X\}\cup \{(\ast,y):y\in Y\}$$, so the above is not a subset of $$(X+Y)\times (X+Y)$$. Another attempt is to write it as $$\{\langle(x,\ast),s([x,\ast])\rangle:x\in X\}\cup \{\langle(x,\ast),t([x,\ast])\rangle:x\in X\}$$ but in this case the expression $$s([x,\ast])$$ does not make sense because the domain of $$s$$ (and $$t$$) is $$X$$, not $$X\times \{\ast\}$$ (or $$\{\ast\}\times X$$).

And my second concern is why my description of coequalizer coincides with the description in Example 5.2.16. But I guess first I need to understand what exactly the equivalence relation in 5.2.16 (which is my first question above). Further, I suppose standard descriptions of pushout and coproduct are different than those provided by the example. Is there a general way to see the equivalence or does one need to check the equivalence in each case (if one wants to make sure the two descriptions are the same)?

Your last attempt at writing down the generating set for the equivalence relation is very close, just replace $$s([x,*])$$ by $$(*, s(x))$$ (and similar for $$t$$).
You probably worry too much about the precise encodings though. For example, we may as well assume $$X$$ and $$Y$$ to be distinct. If they are not we can find distinct $$X'$$ and $$Y'$$, isomorphic to $$X$$ and $$Y$$ respectively, and work with them. So $$X + Y$$ just becomes $$X \cup Y$$ (or technically, they are isomorphic), and the generating set becomes $$\{(x, s(x)) : x \in X\} \cup \{(x, t(x)) : x \in X\}.$$ This declutters the notation quite a bit.