Qed.
End Relations.
Hint Unfold reflexive transitive symmetric partial_equivalence equivalence:
algebra.
Hint Resolve equiv_refl equiv_sym equiv_trans: algebra.
Comments "Then we define a dedicated structure to represent sets:".
Record Setoid : Type :=
{Carrier :> Type; Equal : relation Carrier; Prf_equiv :> equivalence Equal}.
Hint Resolve Prf_equiv: algebra.
Comments
"A set is then given by a type (for its elements), a binary relation"
"and a proof that this relation is an equivalence relation".
Comments "We will write" (Equal x y)
"for the equality of two elements of a set".

Lemma Refl : forall (E : Setoid) (x : E), Equal x x.
intros E; try assumption.