diff options
author | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-06-21 21:18:47 +0000 |
---|---|---|
committer | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-06-21 21:18:47 +0000 |
commit | b03db7e43a67251406c4b27fa179f1d46c248906 (patch) | |
tree | a22d3a52c779149be1d7f7f3f982d12d5b51e923 | |
parent | 6810929f652be3ebe40de86fe360665c6aded049 (diff) |
Follow-up concerning eqb / ltb / leb comparisons
- All statement using reflect are made transparent.
(Otherwise, since reflect isn't in Prop, extraction
complains now about opaque Type definition).
- remove two local Peqb_spec and Neqb_spec, now provided
globally as Pos.eqb_spec and N.eqb_spec.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14232 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r-- | plugins/setoid_ring/Field_theory.v | 18 | ||||
-rw-r--r-- | theories/Bool/Bool.v | 4 | ||||
-rw-r--r-- | theories/Structures/Equalities.v | 2 | ||||
-rw-r--r-- | theories/Structures/OrdersFacts.v | 4 |
4 files changed, 9 insertions, 19 deletions
diff --git a/plugins/setoid_ring/Field_theory.v b/plugins/setoid_ring/Field_theory.v index 6f4747dcf..40138526d 100644 --- a/plugins/setoid_ring/Field_theory.v +++ b/plugins/setoid_ring/Field_theory.v @@ -390,16 +390,6 @@ Qed. ***************************************************************************) -Lemma Peqb_spec x y : Bool.reflect (x=y) (Pos.eqb x y). -Proof. - apply Bool.iff_reflect. symmetry. apply Pos.eqb_eq. -Qed. - -Lemma Neqb_spec x y : Bool.reflect (x=y) (N.eqb x y). -Proof. - apply Bool.iff_reflect. symmetry. apply N.eqb_eq. -Qed. - (* equality test *) Fixpoint PExpr_eq (e1 e2 : PExpr C) {struct e1} : bool := match e1, e2 with @@ -434,7 +424,7 @@ intros l e1; elim e1. intros c1; intros e2; elim e2; simpl; (try (intros; discriminate)). intros c2; apply (morph_eq CRmorph). intros p1; intros e2; elim e2; simpl; (try (intros; discriminate)). -intros p2; case Peqb_spec; intros; now subst. +intros p2; case Pos.eqb_spec; intros; now subst. intros e3 rec1 e5 rec2 e2; case e2; simpl; (try (intros; discriminate)). intros e4 e6; generalize (rec1 e4); case (PExpr_eq e3 e4); (try (intros; discriminate)); generalize (rec2 e6); case (PExpr_eq e5 e6); @@ -451,7 +441,7 @@ intros e3 rec e2; (case e2; simpl; (try (intros; discriminate))). intros e4; generalize (rec e4); case (PExpr_eq e3 e4); (try (intros; discriminate)); auto. intros e3 rec n3 e2;(case e2;simpl;(try (intros;discriminate))). -intros e4 n4; case Neqb_spec; try discriminate; intros EQ H; subst. +intros e4 n4; case N.eqb_spec; try discriminate; intros EQ H; subst. repeat rewrite pow_th.(rpow_pow_N). rewrite (rec _ H);auto. Qed. @@ -493,7 +483,7 @@ Proof. destruct n;simpl. rewrite pow_th.(rpow_pow_N);simpl;auto. fold (p =? 1)%positive. - case Peqb_spec; intros H; (rewrite H || clear H). + case Pos.eqb_spec; intros H; (rewrite H || clear H). now rewrite pow_th.(rpow_pow_N). destruct e;simpl;auto. repeat apply ceqb_rect;simpl;intros;rewrite pow_th.(rpow_pow_N);simpl. @@ -526,7 +516,7 @@ induction e1;destruct e2; simpl in |- *;try reflexivity; try (intro eq_c; rewrite eq_c in |- *); simpl in |- *; try reflexivity; try ring [(morph0 CRmorph) (morph1 CRmorph)]. apply (morph_mul CRmorph). -case Neqb_spec; intros H; try rewrite <- H; clear H. +case N.eqb_spec; intros H; try rewrite <- H; clear H. rewrite NPEpow_correct. simpl. repeat rewrite pow_th.(rpow_pow_N). rewrite IHe1; destruct n;simpl;try ring. diff --git a/theories/Bool/Bool.v b/theories/Bool/Bool.v index 437ce5726..d5d11ceaa 100644 --- a/theories/Bool/Bool.v +++ b/theories/Bool/Bool.v @@ -791,7 +791,7 @@ Qed. Lemma iff_reflect : forall P b, (P<->b=true) -> reflect P b. Proof. destr_bool; intuition. -Qed. +Defined. (** It would be nice to join [reflect_iff] and [iff_reflect] in a unique [iff] statement, but this isn't allowed since @@ -802,7 +802,7 @@ Qed. Lemma reflect_dec : forall P b, reflect P b -> {P}+{~P}. Proof. destruct 1; auto. -Qed. +Defined. (** Reciprocally, from a decidability, we could state a [reflect] as soon as we have a [bool_of_sumbool]. *) diff --git a/theories/Structures/Equalities.v b/theories/Structures/Equalities.v index 933c4ea0e..eb5373859 100644 --- a/theories/Structures/Equalities.v +++ b/theories/Structures/Equalities.v @@ -196,7 +196,7 @@ Qed. Lemma eqb_spec x y : reflect (x==y) (x =? y). Proof. apply iff_reflect. symmetry. apply eqb_eq. -Qed. +Defined. (** Negated form of [eqb_eq] *) diff --git a/theories/Structures/OrdersFacts.v b/theories/Structures/OrdersFacts.v index a447e8fb5..2e9c0cf56 100644 --- a/theories/Structures/OrdersFacts.v +++ b/theories/Structures/OrdersFacts.v @@ -365,7 +365,7 @@ Include CompareBasedOrderFacts E C O. Lemma leb_spec0 x y : reflect (x<=y) (x<=?y). Proof. apply iff_reflect. symmetry. apply leb_le. -Qed. +Defined. Lemma leb_spec x y : BoolSpec (x<=y) (y<x) (x<=?y). Proof. @@ -376,7 +376,7 @@ Qed. Lemma ltb_spec0 x y : reflect (x<y) (x<?y). Proof. apply iff_reflect. symmetry. apply ltb_lt. -Qed. +Defined. Lemma ltb_spec x y : BoolSpec (x<y) (y<=x) (x<?y). Proof. |