Motivation: I defined a binary relation R (A → A → Prop) in Coq and try to implement setoid_rewrite for it (rewrite on R, not on the Coq equality eq).
Expectation: For example, if (P a_1) and (R a_1 a_2) holds, by using setoid_rewrite we can get (P a_2) holds.
Problem and Details: I have proved the symmetry and transitivity of R but failed to prove the reflexivity
since (R a a) holds only when (ok a) holds where ‘ok’ is a predicate on a.
To be more specific, the following lemma can be proved.
(*
This lemma can be proved.
However, it does not match the pattern of Reflexive in Coq.Equivalence.
*)
Lemma refl_R : forall (a : A),
ok a -> R a a.
Proof.
...
Qed.
So I wonder if it is possible to implement setoid_rewrite for such a relation R in Coq.