aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories/Reals
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-05-05 15:13:04 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-05-05 15:13:04 +0000
commit959543f6f899f0384394f9770abbf17649f69b81 (patch)
tree46dc4791f1799a3b2095bec6d887d9aa54f42ad3 /theories/Reals
parentd2bd5d87d23d443f6e41496bdfe5f8e82d675634 (diff)
BinInt: Z.add become the alternative Z.add'
It relies on Z.pos_sub instead of a Pos.compare followed by Pos.sub. Proofs seem to be quite easy to adapt, via some rewrite Z.pos_sub_spec. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14107 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/Reals')
-rw-r--r--theories/Reals/RIneq.v3
-rw-r--r--theories/Reals/Rfunctions.v10
2 files changed, 8 insertions, 5 deletions
diff --git a/theories/Reals/RIneq.v b/theories/Reals/RIneq.v
index de41fd3f6..70f4ff0d9 100644
--- a/theories/Reals/RIneq.v
+++ b/theories/Reals/RIneq.v
@@ -1717,7 +1717,8 @@ Qed.
Lemma plus_IZR_NEG_POS :
forall p q:positive, IZR (Zpos p + Zneg q) = IZR (Zpos p) + IZR (Zneg q).
Proof.
- intros p q; simpl. case Pcompare_spec; intros H; simpl.
+ intros p q; simpl. rewrite Z.pos_sub_spec.
+ case Pcompare_spec; intros H; simpl.
subst. ring.
rewrite Pminus_minus by trivial.
rewrite minus_INR by (now apply lt_le_weak, Plt_lt).
diff --git a/theories/Reals/Rfunctions.v b/theories/Reals/Rfunctions.v
index 1eee8d852..c0cd78649 100644
--- a/theories/Reals/Rfunctions.v
+++ b/theories/Reals/Rfunctions.v
@@ -557,6 +557,7 @@ Proof.
(* POS/POS *)
rewrite Pplus_plus; auto with real.
(* POS/NEG *)
+ rewrite Z.pos_sub_spec.
case Pcompare_spec; intros; simpl.
subst; auto with real.
rewrite Pminus_minus by trivial.
@@ -568,16 +569,17 @@ Proof.
rewrite plus_comm, le_plus_minus_r by (now apply lt_le_weak, Plt_lt).
reflexivity.
(* NEG/POS *)
+ rewrite Z.pos_sub_spec.
case Pcompare_spec; intros; simpl.
subst; auto with real.
rewrite Pminus_minus by trivial.
- rewrite (pow_RN_plus x _ (nat_of_P n1)) by auto with real.
- rewrite plus_comm, le_plus_minus_r by (now apply lt_le_weak, Plt_lt).
- auto with real.
- rewrite Pminus_minus by trivial.
rewrite (pow_RN_plus x _ (nat_of_P m1)) by auto with real.
rewrite plus_comm, le_plus_minus_r by (now apply lt_le_weak, Plt_lt).
rewrite Rinv_mult_distr, Rinv_involutive; auto with real.
+ rewrite Pminus_minus by trivial.
+ rewrite (pow_RN_plus x _ (nat_of_P n1)) by auto with real.
+ rewrite plus_comm, le_plus_minus_r by (now apply lt_le_weak, Plt_lt).
+ auto with real.
(* NEG/NEG *)
rewrite Pplus_plus; auto with real.
intros H'; rewrite pow_add; auto with real.