Formalized equivalence relations