aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories/Numbers
diff options
context:
space:
mode:
authorGravatar Russell O'Connor <roconnor@blockstream.io>2017-06-29 15:17:06 -0400
committerGravatar Russell O'Connor <roconnor@blockstream.io>2017-06-29 15:17:06 -0400
commitf4f609f598fb4804acf272209782b60d4647cad4 (patch)
tree9c5b298fd555708716cccca99dec6982d3f2a9f8 /theories/Numbers
parent6d7c392b73eaa021083ab03c9042d271fb4c28c0 (diff)
Add Z.mod_div lemma to standard library.
Diffstat (limited to 'theories/Numbers')
-rw-r--r--theories/Numbers/Integer/Abstract/ZDivEucl.v8
-rw-r--r--theories/Numbers/Integer/Abstract/ZDivFloor.v8
-rw-r--r--theories/Numbers/Integer/Abstract/ZDivTrunc.v8
3 files changed, 24 insertions, 0 deletions
diff --git a/theories/Numbers/Integer/Abstract/ZDivEucl.v b/theories/Numbers/Integer/Abstract/ZDivEucl.v
index c2fa69e53..c5b8d5ebe 100644
--- a/theories/Numbers/Integer/Abstract/ZDivEucl.v
+++ b/theories/Numbers/Integer/Abstract/ZDivEucl.v
@@ -602,6 +602,14 @@ Proof.
apply div_mod; order.
Qed.
+Lemma mod_div: forall a b, b~=0 ->
+ a mod b / b == 0.
+Proof.
+ intros a b Hb.
+ rewrite div_small_iff by assumption.
+ auto using mod_always_pos.
+Qed.
+
(** A last inequality: *)
Theorem div_mul_le:
diff --git a/theories/Numbers/Integer/Abstract/ZDivFloor.v b/theories/Numbers/Integer/Abstract/ZDivFloor.v
index 310748ddb..eeb803eea 100644
--- a/theories/Numbers/Integer/Abstract/ZDivFloor.v
+++ b/theories/Numbers/Integer/Abstract/ZDivFloor.v
@@ -650,6 +650,14 @@ Proof.
apply div_mod; order.
Qed.
+Lemma mod_div: forall a b, b~=0 ->
+ a mod b / b == 0.
+Proof.
+ intros a b Hb.
+ rewrite div_small_iff by assumption.
+ auto using mod_bound_or.
+Qed.
+
(** A last inequality: *)
Theorem div_mul_le:
diff --git a/theories/Numbers/Integer/Abstract/ZDivTrunc.v b/theories/Numbers/Integer/Abstract/ZDivTrunc.v
index 043010779..a9b72d815 100644
--- a/theories/Numbers/Integer/Abstract/ZDivTrunc.v
+++ b/theories/Numbers/Integer/Abstract/ZDivTrunc.v
@@ -622,6 +622,14 @@ Proof.
apply quot_rem; order.
Qed.
+Lemma rem_quot: forall a b, b~=0 ->
+ a rem b รท b == 0.
+Proof.
+ intros a b Hb.
+ rewrite quot_small_iff by assumption.
+ auto using rem_bound_abs.
+Qed.
+
(** A last inequality: *)
Theorem quot_mul_le: