aboutsummaryrefslogtreecommitdiff
path: root/mathcomp/ssreflect/eqtype.v
diff options
context:
space:
mode:
authorCyril Cohen2019-05-29 18:48:38 +0200
committerGitHub2019-05-29 18:48:38 +0200
commitbd4300d26ecbb43f7170e8da7eaaff1a13cc70b1 (patch)
treec685f3321960d062eedc51708c3f956d19a40515 /mathcomp/ssreflect/eqtype.v
parent6bf8d7707ec6a1d9baf0ce8abaa31f1d681b3b99 (diff)
parentccceb6fbd3bd811b728f6e11dad3cf255a577801 (diff)
Replace eqVneq to destruct both x == y, but also y == x (#351)
Diffstat (limited to 'mathcomp/ssreflect/eqtype.v')
-rw-r--r--mathcomp/ssreflect/eqtype.v12
1 files changed, 9 insertions, 3 deletions
diff --git a/mathcomp/ssreflect/eqtype.v b/mathcomp/ssreflect/eqtype.v
index 3fbc110..7e1cdc8 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 (T : eqType) (x y : T) : bool -> bool -> Set :=
+ | EqNotNeq of x = y : eq_xor_neq x y true true
+ | NeqNotEq of x != y : eq_xor_neq x y false false.
+
+Lemma eqVneq (T : eqType) (x y : T) : eq_xor_neq x y (y == x) (x == y).
+Proof. by rewrite eq_sym; case: (altP eqP); constructor. Qed.
+
+Arguments eqVneq {T} x y, {T x y}.
+
Section Contrapositives.
Variables (T1 T2 : eqType).
@@ -370,9 +379,6 @@ Proof. by move->; rewrite eqxx. Qed.
Lemma predU1r : b -> (x == y) || b.
Proof. by move->; rewrite orbT. Qed.
-Lemma eqVneq : {x = y} + {x != y}.
-Proof. by case: eqP; [left | right]. Qed.
-
End EqPred.
Arguments predU1P {T x y b}.