Let $A$ and $B$ be sets and let $f,g\colon A\rightrightarrows B$ be functions.
We claim that $\text{Eq}\webleft (f,g\webright )$ is the categorical equaliser of $f$ and $g$ in $\mathsf{Sets}$. First we need to check that the relevant equaliser diagram commutes, i.e. that we have
\[ f\circ \text{eq}\webleft (f,g\webright )=g\circ \text{eq}\webleft (f,g\webright ), \]
which indeed holds by the definition of the set $\text{Eq}\webleft (f,g\webright )$. Next, we prove that $\text{Eq}\webleft (f,g\webright )$ satisfies the universal property of the equaliser. Suppose we have a diagram of the form
in $\mathsf{Sets}$. Then there exists a unique map $\phi \colon E\to \text{Eq}\webleft (f,g\webright )$ making the diagram
commute, being uniquely determined by the condition
\[ \text{eq}\webleft (f,g\webright )\circ \phi =e \]
via
\[ \phi \webleft (x\webright )=e\webleft (x\webright ) \]
for each $x\in E$, where we note that $e\webleft (x\webright )\in A$ indeed lies in $\text{Eq}\webleft (f,g\webright )$ by the condition
\[ f\circ e=g\circ e, \]
which gives
\[ f\webleft (e\webleft (x\webright )\webright )=g\webleft (e\webleft (x\webright )\webright ) \]
for each $x\in E$, so that $e\webleft (x\webright )\in \text{Eq}\webleft (f,g\webright )$.
We first prove that $\text{Eq}\webleft (f,g,h\webright )$ is indeed given by
\[ \text{Eq}\webleft (f,g,h\webright )\cong \webleft\{ a\in A\ \middle |\ f\webleft (a\webright )=g\webleft (a\webright )=h\webleft (a\webright )\webright\} . \]
Indeed, suppose we have a diagram of the form
in $\mathsf{Sets}$. Then there exists a unique map $\phi \colon E\to \text{Eq}\webleft (f,g,h\webright )$, uniquely determined by the condition
\[ \text{eq}\webleft (f,g\webright )\circ \phi =e \]
being necessarily given by
\[ \phi \webleft (x\webright )=e\webleft (x\webright ) \]
for each $x\in E$, where we note that $e\webleft (x\webright )\in A$ indeed lies in $\text{Eq}\webleft (f,g,h\webright )$ by the condition
\[ f\circ e=g\circ e=h\circ e, \]
which gives
\[ f\webleft (e\webleft (x\webright )\webright )=g\webleft (e\webleft (x\webright )\webright )=h\webleft (e\webleft (x\webright )\webright ) \]
for each $x\in E$, so that $e\webleft (x\webright )\in \text{Eq}\webleft (f,g,h\webright )$.
We now check the equalities
\[ \text{Eq}\webleft (f\circ \text{eq}\webleft (g,h\webright ),g\circ \text{eq}\webleft (g,h\webright )\webright )\cong \text{Eq}\webleft (f,g,h\webright ) \cong \text{Eq}\webleft (f\circ \text{eq}\webleft (f,g\webright ),h\circ \text{eq}\webleft (f,g\webright )\webright ). \]
Indeed, we have
Similarly, we have
Indeed, we have
\begin{align*} \text{Eq}\webleft (f,f\webright ) & \mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\webleft\{ a\in A\ \middle |\ f\webleft (a\webright )=f\webleft (a\webright )\webright\} \\ & = A. \end{align*}
Indeed, we have
\begin{align*} \text{Eq}\webleft (f,g\webright ) & \mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\webleft\{ a\in A\ \middle |\ f\webleft (a\webright )=g\webleft (a\webright )\webright\} \\ & = \webleft\{ a\in A\ \middle |\ g\webleft (a\webright )=f\webleft (a\webright )\webright\} \\ & \mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\text{Eq}\webleft (g,f\webright ). \end{align*}
Item 4: Interaction With Composition
Indeed, we have and
\[ \text{Eq}\webleft (h\circ f,k\circ g\webright )\cong \webleft\{ a\in A\ \middle |\ h\webleft (f\webleft (a\webright )\webright )=k\webleft (g\webleft (a\webright )\webright )\webright\} , \]
and thus there’s an inclusion from $\text{Eq}\webleft (h\circ f\circ \text{eq}\webleft (f,g\webright ),k\circ g\circ \text{eq}\webleft (f,g\webright )\webright )$ to $\text{Eq}\webleft (h\circ f,k\circ g\webright )$.