aboutsummaryrefslogtreecommitdiff
path: root/theories/Numbers/Integer/Abstract/ZDivTrunc.v
diff options
context:
space:
mode:
authorletouzey2010-01-08 14:44:56 +0000
committerletouzey2010-01-08 14:44:56 +0000
commit5db31bb0333810ccdd0a79e9855ae9d2fcdbf2d3 (patch)
treedd8cd4a8b4453d96fdcd8fea56c9a56a4f766087 /theories/Numbers/Integer/Abstract/ZDivTrunc.v
parentc630fdf04db508d5d877a6b1fd93145893377287 (diff)
Numbers: axiomatization + generic properties of abs and sgn.
This allow to really finish files about division. An abs and sgn is added to BigZ. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12644 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/Numbers/Integer/Abstract/ZDivTrunc.v')
-rw-r--r--theories/Numbers/Integer/Abstract/ZDivTrunc.v27
1 files changed, 6 insertions, 21 deletions
diff --git a/theories/Numbers/Integer/Abstract/ZDivTrunc.v b/theories/Numbers/Integer/Abstract/ZDivTrunc.v
index 0468b3bf58..6b6b717035 100644
--- a/theories/Numbers/Integer/Abstract/ZDivTrunc.v
+++ b/theories/Numbers/Integer/Abstract/ZDivTrunc.v
@@ -35,8 +35,8 @@ End ZDivSpecific.
Module Type ZDiv (Z:ZAxiomsSig)
:= DivMod Z <+ NZDivCommon Z <+ ZDivSpecific Z.
-Module Type ZDivSig := ZAxiomsSig <+ ZDiv.
-Module Type ZDivSig' := ZAxiomsSig' <+ ZDiv <+ DivModNotation.
+Module Type ZDivSig := ZAxiomsExtSig <+ ZDiv.
+Module Type ZDivSig' := ZAxiomsExtSig' <+ ZDiv <+ DivModNotation.
Module ZDivPropFunct (Import Z : ZDivSig')(Import ZP : ZPropSig Z).
@@ -205,31 +205,16 @@ Proof. exact div_pos. Qed.
Lemma div_str_pos : forall a b, 0<b<=a -> 0 < a/b.
Proof. exact div_str_pos. Qed.
-(** TODO: TO MIGRATE LATER *)
-Definition abs z := max z (-z).
-Lemma abs_pos : forall z, 0<=z -> abs z == z.
-Proof.
-intros; apply max_l. apply le_trans with 0; trivial.
-now rewrite opp_nonpos_nonneg.
-Qed.
-Lemma abs_neg : forall z, 0<=-z -> abs z == -z.
-Proof.
-intros; apply max_r. apply le_trans with 0; trivial.
-now rewrite <- opp_nonneg_nonpos.
-Qed.
-
-(** END TODO *)
-
Lemma div_small_iff : forall a b, b~=0 -> (a/b==0 <-> abs a < abs b).
Proof.
intros. pos_or_neg a; pos_or_neg b.
-rewrite div_small_iff; try order. rewrite 2 abs_pos; intuition; order.
+rewrite div_small_iff; try order. rewrite 2 abs_eq; intuition; order.
rewrite <- opp_inj_wd, opp_0, <- div_opp_r, div_small_iff by order.
- rewrite (abs_pos a), (abs_neg b); intuition; order.
+ rewrite (abs_eq a), (abs_neq' b); intuition; order.
rewrite <- opp_inj_wd, opp_0, <- div_opp_l, div_small_iff by order.
- rewrite (abs_neg a), (abs_pos b); intuition; order.
+ rewrite (abs_neq' a), (abs_eq b); intuition; order.
rewrite <- div_opp_opp, div_small_iff by order.
- rewrite (abs_neg a), (abs_neg b); intuition; order.
+ rewrite (abs_neq' a), (abs_neq' b); intuition; order.
Qed.
Lemma mod_small_iff : forall a b, b~=0 -> (a mod b == a <-> abs a < abs b).