The diagonal of the product of sets is the natural transformation
whose component
\[ \Delta _{X}\colon X\to X\times X \]
at $X\in \text{Obj}\webleft (\mathsf{Sets}\webright )$ is given by
\[ \Delta _{X}\webleft (x\webright )\mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\webleft (x,x\webright ) \]
for each $x\in X$.