Inverse of Relation Compatible with Operation is Compatible

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

Let $\mathcal R$ be a relation on $S$ which is compatible with $\circ$.

Let $\mathcal Q$ be the inverse relation of $\mathcal R$.

Then $\mathcal Q$ is compatible with $\circ$.

Proof
Let $x,y,z \in S$.

Suppose that $x \mathop {\mathcal Q} y$.

Then by the definition of $\mathcal Q$,
 * $y \mathop{\mathcal R} x$.

Since $\mathcal R$ is compatible with $\circ$,
 * $\left({y \circ z}\right) \mathop {\mathcal R} \left({x \circ z}\right)$

and
 * $\left({z \circ y}\right) \mathop {\mathcal R} \left({z \circ x}\right)$.

Thus by the definition of $\mathcal Q$,
 * $\left({x \circ z}\right) \mathop {\mathcal Q} \left({y \circ z}\right)$

and
 * $\left({z \circ x}\right) \mathop {\mathcal R} \left({z \circ y}\right)$.

Thus $\mathcal Q$ is compatible with $\circ$.