inlined definition of equivalence