aboutsummaryrefslogtreecommitdiff
path: root/mathcomp/ssreflect/eqtype.v
diff options
context:
space:
mode:
authorAnton Trunov2019-05-28 22:57:38 +0300
committerAnton Trunov2019-05-28 23:56:19 +0300
commiteac1d28204c93f082771dedb90fc5a1edec6e6f8 (patch)
tree1d3709a7e13e1db2508253213ee690af1e222d2c /mathcomp/ssreflect/eqtype.v
parent748d716efb2f2f75946c8386e441ce1789806a39 (diff)
Add eqsP view to destruct not only x == y, but also y == x
Diffstat (limited to 'mathcomp/ssreflect/eqtype.v')
-rw-r--r--mathcomp/ssreflect/eqtype.v9
1 files changed, 9 insertions, 0 deletions
diff --git a/mathcomp/ssreflect/eqtype.v b/mathcomp/ssreflect/eqtype.v
index 3fbc110..895a86e 100644
--- a/mathcomp/ssreflect/eqtype.v
+++ b/mathcomp/ssreflect/eqtype.v
@@ -196,6 +196,15 @@ Proof. exact/eqP/eqP. Qed.
Hint Resolve eq_refl eq_sym : core.
+Variant eq_xor_neq_sym (T : eqType) (x y : T) : bool -> bool -> Set :=
+ | EqNotNeqSym of x = y : eq_xor_neq_sym x y true true
+ | NeqNotEqSym of x <> y : eq_xor_neq_sym x y false false.
+
+Lemma eqsP (T : eqType) (x y : T) : eq_xor_neq_sym x y (y == x) (x == y).
+Proof. by rewrite eq_sym; case: eqP; constructor. Qed.
+
+Arguments eqsP {T x y}.
+
Section Contrapositives.
Variables (T1 T2 : eqType).