Equivalence and congruence relations