Hint Extern 0 (RIntro _ (- ==> _) _ _) =>
eapply arrow_pointwise_rintro : typeclass_instances.
(** Note that although the elimination rule could use a single variable and dispense with the equality premise, it actually uses two distinct variables [m] and [n], and a premise in [P] that [m = n]. Hence the effect is similar to the elimination rule for the equivalent relation [eq ==> R]. We do this because in contexts where we have a single term [t] against which both [m] and [n] unify, it is easy and cheap to automatically prove that [t = t], but in contexts where we have two disctinct variables and a proof of equality, it is more involved to massage the goal into a form where the single-variable version of the rule could apply. *)

Lemma arrow_pointwise_relim {A B1 B2} (R: rel B1 B2) f g (m n: A) P Q:
RElim R (f m) (g n) P Q ->
RElim (- ==> R) f g (m = n /\ P) Q.