aboutsummaryrefslogtreecommitdiff
path: root/plugins/ssr/ssreflect.v
diff options
context:
space:
mode:
authorErik Martin-Dorel2019-03-04 01:25:39 +0100
committerErik Martin-Dorel2019-04-23 20:22:05 +0200
commitbb6dc2355bcd027a3a89c40629b82eb2019eff6a (patch)
tree97495eceee09a17c9739f8e1db532ccde54e203c /plugins/ssr/ssreflect.v
parent7c598f9f1f6da2cecc70557f9f436392322fc6d9 (diff)
[ssr] under: Add iff support in side-conditions
Diffstat (limited to 'plugins/ssr/ssreflect.v')
-rw-r--r--plugins/ssr/ssreflect.v42
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/ssr/ssreflect.v b/plugins/ssr/ssreflect.v
index 37390e1af7..94e0b2a724 100644
--- a/plugins/ssr/ssreflect.v
+++ b/plugins/ssr/ssreflect.v
@@ -550,7 +550,49 @@ End Under.
Register Under as plugins.ssreflect.Under.
Register Under_from_eq as plugins.ssreflect.Under_from_eq.
+Module Type UNDER_IFF.
+Parameter Under_iff : Prop -> Prop -> Prop.
+Parameter Under_from_iff : forall x y : Prop, @Under_iff x y -> x <-> y.
+
+(** [Over_iff, over_iff, over_iff_done]: for "by rewrite over_iff" *)
+Parameter Over_iff : Prop -> Prop -> Prop.
+Parameter over_iff :
+ forall (x : Prop) (y : Prop), @Under_iff x y = @Over_iff x y.
+Parameter over_iff_done :
+ forall (x : Prop), @Over_iff x x.
+Hint Extern 0 (@Over_iff _ _) => solve [ apply over_iff_done ] : core.
+Hint Resolve over_iff_done : core.
+
+(** [under_iff_done]: for Ltac-style over *)
+Parameter under_iff_done :
+ forall (x : Prop), @Under_iff x x.
+Notation "''Under_iff[' x ]" := (@Under_iff x _)
+ (at level 8, format "''Under_iff[' x ]").
+End UNDER_IFF.
+
+Module Export Under_iff : UNDER_IFF.
+Definition Under_iff := iff.
+Lemma Under_from_iff (x y : Prop) :
+ @Under_iff x y -> x <-> y.
+Proof. by []. Qed.
+Definition Over_iff := Under_iff.
+Lemma over_iff :
+ forall (x : Prop) (y : Prop), @Under_iff x y = @Over_iff x y.
+Proof. by []. Qed.
+Lemma over_iff_done :
+ forall (x : Prop), @Over_iff x x.
+Proof. by []. Qed.
+Lemma under_iff_done :
+ forall (x : Prop), @Under_iff x x.
+Proof. by []. Qed.
+End Under_iff.
+
+Register Under_iff as plugins.ssreflect.Under_iff.
+Register Under_from_iff as plugins.ssreflect.Under_from_iff.
+
Ltac over :=
by [ apply: Under.under_done
| rewrite over
+ | apply: Under_iff.under_iff_done
+ | rewrite over_iff
].