Hint Extern 1 (RElim (pointwise_relation _ _) _ _ _ _) =>
eapply pointwise_relation_relim : typeclass_instances.
(** The rewriting system sometimes generates arguments constraints of the following form (when rewriting an argument of [arrow_rel] for instance), which need to be matched against our relational properties stated in terms of [subrel]. *)
Global Instance pointwise_relation_subrel_subrel A B:
Related (pointwise_relation A (pointwise_relation B impl)) subrel subrel.
(** *** [Morphisms.Proper] instances *)
(** Now that we can interpret the relators used in [Morphisms]-style relational properties, we can simply hook instances of [Morphisms.Proper] into our own database.  We have to be careful about how this instance works. For one thing, we are not interested in going through the whole resolution process in [Coq.Classes.Morphisms], but are only interested in recovering user-defined instances as-is. Moreover, we want to avoid a loop with [solve_morphisms_proper] below, where our library (and hence [Related] instances) are used to solve [Proper] queries. We can make sure both of those things are avoided by using a [normalization_done] hypothesis with our [Proper] query. *)
Global Instance morphisms_proper_related {A} (R: relation A) (a: A):
(normalization_done -> Proper R a) ->
Monotonic a R | 10.
(** *** [subrelation] instances *)
(** Likewise, we want to be able to use [subrelation] declaration as [subrel] instances. Again, we use an immediate hint. *)

(* Specifications: *)
Lemma subrelation_subrel {A} (R1 R2: relation A):
subrelation R1 R2 ->
Related R1 R2 subrel.