(** Resolution with subrelation: favor decomposing products over applying reflexivity
  for unconstrained goals. *)
Ltac subrelation_tac T U :=
  (is_ground T ; is_ground U ; class_apply @subrelation_refl) ||
    class_apply @subrelation_respectful || class_apply @subrelation_refl.#[global]
Hint Extern 3 (@subrelation _ ?T ?U) => subrelation_tac T U : typeclass_instances.CoInductive apply_subrelation : Prop := do_subrelation.CoInductive apply_subrelation : Prop := do_subrelation.Ltac proper_subrelation :=
  match goal with
    [ H : apply_subrelation |- _ ] => clear H ; class_apply @subrelation_proper
  end.#[global]
Hint Extern 5 (@Proper _ ?H _) => proper_subrelation : typeclass_instances.(** Essential subrelation instances for [iff], [impl] and [pointwise_relation]. *)

#[global]
Instance iff_impl_subrelation : subrelation iff impl | 2.#[global]
Instance iff_flip_impl_subrelation : subrelation iff (flip impl) | 2.

Lemma symmetric_equiv_flip `(Symmetric A R) : relation_equivalence R (flip R).