| 1 |
|
| 2 |
Require Import Corelib.Setoids.Setoid Corelib.Classes.Morphisms. |
| 3 |
Definition f (v : option nat) := match v with |
| 4 |
| Some k => Some k |
| 5 |
| None => None |
| 6 |
end. |
| 7 |
|
| 8 |
Axioms F G : (option nat -> option nat) -> Prop. |
| 9 |
Axiom FG : forall f, f None = None -> F f = G f. |
| 10 |
|
| 11 |
Axiom admit : forall {T}, T. |
| 12 |
|
| 13 |
#[export] Existing Instance eq_Reflexive. |
| 14 |
|
| 15 |
Global Instance foo (A := nat) |
| 16 |
: Proper ((pointwise_relation _ eq) |
| 17 |
==> eq ==> forall_relation (fun _ => Basics.flip Basics.impl)) |
| 18 |
(@option_rect A (fun _ => Prop)) | 0. |
| 19 |
exact admit. |
| 20 |
Qed. |
| 21 |
|
| 22 |
Global Instance bar (A := nat) |
| 23 |
: Proper ((pointwise_relation _ eq) |
| 24 |
==> eq ==> eq ==> Basics.flip Basics.impl) |
| 25 |
(@option_rect A (fun _ => Prop)) | 0. |
| 26 |
exact admit. |
| 27 |
Qed. |
| 28 |
|
| 29 |
Goal forall k, option_rect (fun _ => Prop) (fun v : nat => v = v /\ F f) True k. |
| 30 |
Proof. |
| 31 |
intro. |
| 32 |
pose proof (_ : (Proper (_ ==> eq ==> _) and)). |
| 33 |
setoid_rewrite (FG _ _); [ | reflexivity.. ]. |
| 34 |
Undo. |
| 35 |
setoid_rewrite (FG _ eq_refl). (* Error: Tactic failure: setoid rewrite failed: Nothing to rewrite. in 8.5 *) Admitted. |