TITLE: Categorical description of equivalence relation generated by a relation?
QUESTION [7 upvotes]: The notion of an equivalence relation generated by a relation is widespread and useful. How can one categorically describe it?

REPLY [4 votes]: A binary relation $R$ on a set $X$ is a subset of $X\times X$, represented categorically by a monomorphism $R\to X\times X$. By the categorical definition of products, that amounts to a (jointly monic) pair of morphisms $R\to X$.  Take the coequalizer $p:X\to Q$ of that pair.  Then take the kernel pair of $p$ (i.e., the pullback of $p$ along itself). That's a pair of morphisms $E\to X$, so you can combine them to constitute a morphism $E\to X\times X$. That morphism is monic, and the binary relation on $X$ that it represents is the equivalence relation generated by the original $R$.