proposition: Lemma equivalence_from_rel r x: equivalence_r r -> equivalence (graph_on r x).
proof: Proof. move=> [pa pb]. have gg: sgraph (graph_on r x) by apply: graph_on_graph. apply: (equivalence_relation_pr1 gg). split. move => a b /graph_on_P1 [ax bx rab]; apply /graph_on_P1. by split => //; apply: pa. move=> a b c /graph_on_P1 [ax bx rab] /graph_on_P1 [_ cx rbc]. apply /graph_on_P1;split => //; apply: pb rab rbc. Qed.
imports: mathcomp(ssreflect ssrfun ssrbool eqtype ssrnat)