Equivalence Relation is Congruence iff Compatible with Operation

Theorem
Let $\left({S, \circ}\right)$ be an algebraic structure.

Let $\mathcal R$ be an equivalence relation on $S$.

Then $\mathcal R$ is a congruence relation for $\circ$ iff:

That is, iff $\mathcal R$ is compatible with $\circ$.

Proof 1
Suppose $\mathcal R$ is a congruence relation for $\circ$.

That is:
 * $\forall x_1, x_2, y_1, y_2 \in S: x_1 \ \mathcal R \ x_2 \land y_1 \ \mathcal R \ y_2 \implies \left({x_1 \circ y_1}\right) \ \mathcal R \ \left({x_2 \circ y_2}\right)$

As $\mathcal R$ is an equivalence relation it is by definition reflexive.

That is:
 * $\forall z \in S: z \ \mathcal R \ z$

Make the substitutions:
 * $x_1 \to x$
 * $x_2 \to y$
 * $y_1 \to z$
 * $y_2 \to z$

It follows that:
 * $\forall x, y, z \in S: x \ \mathcal R \ y \implies \left({x \circ z}\right) \ \mathcal R \ \left({y \circ z}\right)$

Similarly, make the substitutions:
 * $x_1 \to z$
 * $x_2 \to z$
 * $y_1 \to x$
 * $y_2 \to y$

It follows that:
 * $\forall x, y, z \in S: x \ \mathcal R \ y \implies \left({z \circ x}\right) \ \mathcal R \ \left({z \circ y}\right)$

Now let $\mathcal R$ have the nature that:

Then we have:

As $\mathcal R$ is an equivalence relation it is by definition transitive.

Thus it follows that:
 * $\left({x_1 \circ x_2}\right) \ \mathcal R \ \left({y_1 \circ y_2}\right)$

The result follows.

Proof 2
We have that a equivalence relation is a preordering.

Thus the result Preorder Compatible with Operation is a Congruence can be applied directly.