diff options
Diffstat (limited to 'theories/ZArith/Zcompare.v')
-rw-r--r-- | theories/ZArith/Zcompare.v | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/theories/ZArith/Zcompare.v b/theories/ZArith/Zcompare.v index 6c5b07d2..8244d4ce 100644 --- a/theories/ZArith/Zcompare.v +++ b/theories/ZArith/Zcompare.v @@ -40,6 +40,15 @@ Proof. | destruct ((x' ?= y')%positive Eq); reflexivity || discriminate ] ]. Qed. +Ltac destr_zcompare := + match goal with |- context [Zcompare ?x ?y] => + let H := fresh "H" in + case_eq (Zcompare x y); intro H; + [generalize (Zcompare_Eq_eq _ _ H); clear H; intro H | + change (x<y)%Z in H | + change (x>y)%Z in H ] + end. + Lemma Zcompare_Eq_iff_eq : forall n m:Z, (n ?= m) = Eq <-> n = m. Proof. intros x y; split; intro E; |