From f4f609f598fb4804acf272209782b60d4647cad4 Mon Sep 17 00:00:00 2001 From: Russell O'Connor Date: Thu, 29 Jun 2017 15:17:06 -0400 Subject: Add Z.mod_div lemma to standard library. --- theories/ZArith/Zdiv.v | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'theories/ZArith') diff --git a/theories/ZArith/Zdiv.v b/theories/ZArith/Zdiv.v index 2ba865bd0..509384104 100644 --- a/theories/ZArith/Zdiv.v +++ b/theories/ZArith/Zdiv.v @@ -508,6 +508,12 @@ Qed. (** Unfortunately, the previous result isn't always true on negative numbers. For instance: 3/(-2)/(-2) = 1 <> 0 = 3 / (-2*-2) *) +Lemma Zmod_div (a b : Z) : a mod b / b = 0. +Proof. + zero_or_not b. + auto using Z.mod_div. +Qed. + (** A last inequality: *) Theorem Zdiv_mult_le: -- cgit v1.2.3 From 79f2e62eb22318c9a2b0c96a19ef3fadd1ca781d Mon Sep 17 00:00:00 2001 From: roconnor-blockstream Date: Thu, 29 Jun 2017 17:57:05 -0400 Subject: Use forall for consistency --- theories/ZArith/Zdiv.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'theories/ZArith') diff --git a/theories/ZArith/Zdiv.v b/theories/ZArith/Zdiv.v index 509384104..140d1b3c8 100644 --- a/theories/ZArith/Zdiv.v +++ b/theories/ZArith/Zdiv.v @@ -508,7 +508,7 @@ Qed. (** Unfortunately, the previous result isn't always true on negative numbers. For instance: 3/(-2)/(-2) = 1 <> 0 = 3 / (-2*-2) *) -Lemma Zmod_div (a b : Z) : a mod b / b = 0. +Lemma Zmod_div : forall a b, a mod b / b = 0. Proof. zero_or_not b. auto using Z.mod_div. -- cgit v1.2.3 From 8eb6370b94af56b94d2645aa4eaab5915341b961 Mon Sep 17 00:00:00 2001 From: Russell O'Connor Date: Thu, 29 Jun 2017 19:56:34 -0400 Subject: Fix Zmod_div. --- theories/ZArith/Zdiv.v | 1 + 1 file changed, 1 insertion(+) (limited to 'theories/ZArith') diff --git a/theories/ZArith/Zdiv.v b/theories/ZArith/Zdiv.v index 140d1b3c8..54ab227e8 100644 --- a/theories/ZArith/Zdiv.v +++ b/theories/ZArith/Zdiv.v @@ -510,6 +510,7 @@ Qed. Lemma Zmod_div : forall a b, a mod b / b = 0. Proof. + intros a b. zero_or_not b. auto using Z.mod_div. Qed. -- cgit v1.2.3