Solution (source code)

= Solution

The inverse argument in part (i) proves that the one-sided inclusion in (iii) already implies equality:
$$
\boxed{S\circ R\subseteq R\circ S\quad\Longleftrightarrow\quad
R\circ S=S\circ R.}
$$
Parts (i) and (ii) then make $T$ both symmetric and transitive; it is reflexive from the root solution. Therefore $T$ is an <equivalence relation> containing $R$ and $S$.

If $U$ is any other <equivalence relation> containing both, a witness $xRy,\ ySz$ gives $xUy,\ yUz$, and <transitivity> gives $xUz$. Hence $T\subseteq U$. Thus (iii) implies the unique-smallest assertion in (iv).