aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories/QArith/Qround.v
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2010-11-02 19:30:57 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2010-11-02 19:30:57 +0000
commit2a7a989025a5dde9a6f34792e1e1f2b4e3ad3108 (patch)
tree63b6bf19f0cf27bfc4a2d77381eef5a0cb403c85 /theories/QArith/Qround.v
parentc5eea71cebc0fd1553196598e6b88af482dbffe5 (diff)
Add small utility lemmas about nat/P/Z/Q arithmetic.
Initial patch by Eelis van der Weegen, minor adaptations by myself git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13613 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/QArith/Qround.v')
-rw-r--r--theories/QArith/Qround.v13
1 files changed, 12 insertions, 1 deletions
diff --git a/theories/QArith/Qround.v b/theories/QArith/Qround.v
index 58a7967ed..ce363a33b 100644
--- a/theories/QArith/Qround.v
+++ b/theories/QArith/Qround.v
@@ -136,4 +136,15 @@ intros x y H.
apply Zle_antisym.
auto with *.
symmetry in H; auto with *.
-Qed. \ No newline at end of file
+Qed.
+
+Lemma Zdiv_Qdiv (n m: Z): (n / m)%Z = Qfloor (n / m).
+Proof.
+ unfold Qfloor. intros. simpl.
+ destruct m as [?|?|p]; simpl.
+ now rewrite Zdiv_0_r, Zmult_0_r.
+ now rewrite Zmult_1_r.
+ rewrite <- Zopp_eq_mult_neg_1.
+ rewrite <- (Zopp_involutive (Zpos p)).
+ now rewrite Zdiv_opp_opp.
+Qed.