src/HOL/Divides.thy
author haftmann
Sat, 08 Aug 2015 10:51:33 +0200
changeset 60868 dd18c33c001e
parent 60867 86e7560e07d0
child 60930 dd8ab7252ba2
permissions -rw-r--r--
direct bootstrap of integer division from natural division
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3366
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Divides.thy
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
6865
5577ffe4c2f1 now div and mod are overloaded; dvd is polymorphic
paulson
parents: 3366
diff changeset
     3
    Copyright   1999  University of Cambridge
18154
0c05abaf6244 add header
huffman
parents: 17609
diff changeset
     4
*)
3366
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
     5
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 60690
diff changeset
     6
section \<open>The division operators div and mod\<close>
3366
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
     7
15131
c69542757a4d New theory header syntax.
nipkow
parents: 14640
diff changeset
     8
theory Divides
58778
e29cae8eab1f even further downshift of theory Parity in the hierarchy
haftmann
parents: 58710
diff changeset
     9
imports Parity
15131
c69542757a4d New theory header syntax.
nipkow
parents: 14640
diff changeset
    10
begin
3366
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    11
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 60690
diff changeset
    12
subsection \<open>Abstract division in commutative semirings.\<close>
25942
a52309ac4a4d added class semiring_div
haftmann
parents: 25571
diff changeset
    13
60352
d46de31a50c4 separate class for division operator, with particular syntax added in more specific classes
haftmann
parents: 59833
diff changeset
    14
class div = dvd + divide +
d46de31a50c4 separate class for division operator, with particular syntax added in more specific classes
haftmann
parents: 59833
diff changeset
    15
  fixes mod :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "mod" 70)
25942
a52309ac4a4d added class semiring_div
haftmann
parents: 25571
diff changeset
    16
59833
ab828c2c5d67 clarified no_zero_devisors: makes only sense in a semiring;
haftmann
parents: 59816
diff changeset
    17
class semiring_div = semidom + div +
25942
a52309ac4a4d added class semiring_div
haftmann
parents: 25571
diff changeset
    18
  assumes mod_div_equality: "a div b * b + a mod b = a"
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    19
    and div_by_0 [simp]: "a div 0 = 0"
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    20
    and div_0 [simp]: "0 div a = 0"
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    21
    and div_mult_self1 [simp]: "b \<noteq> 0 \<Longrightarrow> (a + c * b) div b = c + a div b"
30930
11010e5f18f0 tightended specification of class semiring_div
haftmann
parents: 30923
diff changeset
    22
    and div_mult_mult1 [simp]: "c \<noteq> 0 \<Longrightarrow> (c * a) div (c * b) = a div b"
25942
a52309ac4a4d added class semiring_div
haftmann
parents: 25571
diff changeset
    23
begin
a52309ac4a4d added class semiring_div
haftmann
parents: 25571
diff changeset
    24
60517
f16e4fb20652 separate class for notions specific for integral (semi)domains, in contrast to fields where these are trivial
haftmann
parents: 60516
diff changeset
    25
subclass algebraic_semidom
60353
838025c6e278 implicit partial divison operation in integral domains
haftmann
parents: 60352
diff changeset
    26
proof
838025c6e278 implicit partial divison operation in integral domains
haftmann
parents: 60352
diff changeset
    27
  fix b a
838025c6e278 implicit partial divison operation in integral domains
haftmann
parents: 60352
diff changeset
    28
  assume "b \<noteq> 0"
838025c6e278 implicit partial divison operation in integral domains
haftmann
parents: 60352
diff changeset
    29
  then show "a * b div b = a"
838025c6e278 implicit partial divison operation in integral domains
haftmann
parents: 60352
diff changeset
    30
    using div_mult_self1 [of b 0 a] by (simp add: ac_simps)
838025c6e278 implicit partial divison operation in integral domains
haftmann
parents: 60352
diff changeset
    31
qed simp
58953
2e19b392d9e3 self-contained simp rules for dvd on numerals
haftmann
parents: 58911
diff changeset
    32
60867
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
    33
lemma div_by_1:
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
    34
  "a div 1 = a"
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
    35
  by (fact divide_1)
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
    36
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
    37
lemma div_mult_self1_is_id:
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
    38
  "b \<noteq> 0 \<Longrightarrow> b * a div b = a"
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
    39
  by (fact nonzero_mult_divide_cancel_left)
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
    40
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
    41
lemma div_mult_self2_is_id:
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
    42
  "b \<noteq> 0 \<Longrightarrow> a * b div b = a"
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
    43
  by (fact nonzero_mult_divide_cancel_right)
59009
348561aa3869 generalized lemmas (particularly concerning dvd) as far as appropriate
haftmann
parents: 59000
diff changeset
    44
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 60690
diff changeset
    45
text \<open>@{const divide} and @{const mod}\<close>
26100
fbc60cd02ae2 using only an relation predicate to construct div and mod
haftmann
parents: 26072
diff changeset
    46
26062
16f334d7156a more abstract lemmas
haftmann
parents: 25947
diff changeset
    47
lemma mod_div_equality2: "b * (a div b) + a mod b = a"
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57492
diff changeset
    48
  unfolding mult.commute [of b]
26062
16f334d7156a more abstract lemmas
haftmann
parents: 25947
diff changeset
    49
  by (rule mod_div_equality)
16f334d7156a more abstract lemmas
haftmann
parents: 25947
diff changeset
    50
29403
fe17df4e4ab3 generalize some div/mod lemmas; remove type-specific proofs
huffman
parents: 29252
diff changeset
    51
lemma mod_div_equality': "a mod b + a div b * b = a"
fe17df4e4ab3 generalize some div/mod lemmas; remove type-specific proofs
huffman
parents: 29252
diff changeset
    52
  using mod_div_equality [of a b]
57514
bdc2c6b40bf2 prefer ac_simps collections over separate name bindings for add and mult
haftmann
parents: 57512
diff changeset
    53
  by (simp only: ac_simps)
29403
fe17df4e4ab3 generalize some div/mod lemmas; remove type-specific proofs
huffman
parents: 29252
diff changeset
    54
26062
16f334d7156a more abstract lemmas
haftmann
parents: 25947
diff changeset
    55
lemma div_mod_equality: "((a div b) * b + a mod b) + c = a + c"
30934
ed5377c2b0a3 tuned setups of CancelDivMod
haftmann
parents: 30930
diff changeset
    56
  by (simp add: mod_div_equality)
26062
16f334d7156a more abstract lemmas
haftmann
parents: 25947
diff changeset
    57
16f334d7156a more abstract lemmas
haftmann
parents: 25947
diff changeset
    58
lemma div_mod_equality2: "(b * (a div b) + a mod b) + c = a + c"
30934
ed5377c2b0a3 tuned setups of CancelDivMod
haftmann
parents: 30930
diff changeset
    59
  by (simp add: mod_div_equality2)
26062
16f334d7156a more abstract lemmas
haftmann
parents: 25947
diff changeset
    60
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    61
lemma mod_by_0 [simp]: "a mod 0 = a"
30934
ed5377c2b0a3 tuned setups of CancelDivMod
haftmann
parents: 30930
diff changeset
    62
  using mod_div_equality [of a zero] by simp
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    63
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    64
lemma mod_0 [simp]: "0 mod a = 0"
30934
ed5377c2b0a3 tuned setups of CancelDivMod
haftmann
parents: 30930
diff changeset
    65
  using mod_div_equality [of zero a] div_0 by simp
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    66
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    67
lemma div_mult_self2 [simp]:
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    68
  assumes "b \<noteq> 0"
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    69
  shows "(a + b * c) div b = c + a div b"
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57492
diff changeset
    70
  using assms div_mult_self1 [of b a c] by (simp add: mult.commute)
26100
fbc60cd02ae2 using only an relation predicate to construct div and mod
haftmann
parents: 26072
diff changeset
    71
54221
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
    72
lemma div_mult_self3 [simp]:
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
    73
  assumes "b \<noteq> 0"
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
    74
  shows "(c * b + a) div b = c + a div b"
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
    75
  using assms by (simp add: add.commute)
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
    76
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
    77
lemma div_mult_self4 [simp]:
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
    78
  assumes "b \<noteq> 0"
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
    79
  shows "(b * c + a) div b = c + a div b"
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
    80
  using assms by (simp add: add.commute)
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
    81
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    82
lemma mod_mult_self1 [simp]: "(a + c * b) mod b = a mod b"
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    83
proof (cases "b = 0")
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    84
  case True then show ?thesis by simp
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    85
next
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    86
  case False
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    87
  have "a + c * b = (a + c * b) div b * b + (a + c * b) mod b"
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    88
    by (simp add: mod_div_equality)
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    89
  also from False div_mult_self1 [of b a c] have
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    90
    "\<dots> = (c + a div b) * b + (a + c * b) mod b"
29667
53103fc8ffa3 Replaced group_ and ring_simps by algebra_simps;
nipkow
parents: 29509
diff changeset
    91
      by (simp add: algebra_simps)
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    92
  finally have "a = a div b * b + (a + c * b) mod b"
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57492
diff changeset
    93
    by (simp add: add.commute [of a] add.assoc distrib_right)
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    94
  then have "a div b * b + (a + c * b) mod b = a div b * b + a mod b"
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    95
    by (simp add: mod_div_equality)
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    96
  then show ?thesis by simp
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    97
qed
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
    98
60562
24af00b010cf Amalgamation of the class comm_semiring_1_diff_distrib into comm_semiring_1_cancel. Moving axiom le_add_diff_inverse2 from semiring_numeral_div to linordered_semidom.
paulson <lp15@cam.ac.uk>
parents: 60517
diff changeset
    99
lemma mod_mult_self2 [simp]:
54221
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
   100
  "(a + b * c) mod b = a mod b"
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57492
diff changeset
   101
  by (simp add: mult.commute [of b])
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   102
54221
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
   103
lemma mod_mult_self3 [simp]:
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
   104
  "(c * b + a) mod b = a mod b"
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
   105
  by (simp add: add.commute)
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
   106
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
   107
lemma mod_mult_self4 [simp]:
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
   108
  "(b * c + a) mod b = a mod b"
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
   109
  by (simp add: add.commute)
56587960e444 more lemmas on division
haftmann
parents: 53374
diff changeset
   110
60867
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
   111
lemma mod_mult_self1_is_0 [simp]:
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
   112
  "b * a mod b = 0"
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   113
  using mod_mult_self2 [of 0 b a] by simp
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   114
60867
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
   115
lemma mod_mult_self2_is_0 [simp]:
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
   116
  "a * b mod b = 0"
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   117
  using mod_mult_self1 [of 0 a b] by simp
26062
16f334d7156a more abstract lemmas
haftmann
parents: 25947
diff changeset
   118
60867
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
   119
lemma mod_by_1 [simp]:
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
   120
  "a mod 1 = 0"
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   121
proof -
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   122
  from mod_div_equality [of a one] div_by_1 have "a + a mod 1 = a" by simp
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   123
  then have "a + a mod 1 = a + 0" by simp
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   124
  then show ?thesis by (rule add_left_imp_eq)
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   125
qed
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   126
60867
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
   127
lemma mod_self [simp]:
86e7560e07d0 slight cleanup of lemmas
haftmann
parents: 60758
diff changeset
   128
  "a mod a = 0"
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   129
  using mod_mult_self2_is_0 [of 1] by simp
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   130
27676
55676111ed69 (re-)added simp rules for (_ + _) div/mod _
haftmann
parents: 27651
diff changeset
   131
lemma div_add_self1 [simp]:
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   132
  assumes "b \<noteq> 0"
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   133
  shows "(b + a) div b = a div b + 1"
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57492
diff changeset
   134
  using assms div_mult_self1 [of b a 1] by (simp add: add.commute)
26062
16f334d7156a more abstract lemmas
haftmann
parents: 25947
diff changeset
   135
27676
55676111ed69 (re-)added simp rules for (_ + _) div/mod _
haftmann
parents: 27651
diff changeset
   136
lemma div_add_self2 [simp]:
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   137
  assumes "b \<noteq> 0"
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   138
  shows "(a + b) div b = a div b + 1"
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57492
diff changeset
   139
  using assms div_add_self1 [of b a] by (simp add: add.commute)
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   140
27676
55676111ed69 (re-)added simp rules for (_ + _) div/mod _
haftmann
parents: 27651
diff changeset
   141
lemma mod_add_self1 [simp]:
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   142
  "(b + a) mod b = a mod b"
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57492
diff changeset
   143
  using mod_mult_self1 [of a 1 b] by (simp add: add.commute)
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   144
27676
55676111ed69 (re-)added simp rules for (_ + _) div/mod _
haftmann
parents: 27651
diff changeset
   145
lemma mod_add_self2 [simp]:
27651
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   146
  "(a + b) mod b = a mod b"
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   147
  using mod_mult_self1 [of a 1 b] by simp
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   148
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   149
lemma mod_div_decomp:
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   150
  fixes a b
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   151
  obtains q r where "q = a div b" and "r = a mod b"
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   152
    and "a = q * b + r"
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   153
proof -
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   154
  from mod_div_equality have "a = a div b * b + a mod b" by simp
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   155
  moreover have "a div b = a div b" ..
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas
haftmann
parents: 27540
diff changeset
   156
  moreover have "a mod b = a mod b" ..
16a26996c30e moved op dvd to theory Ring_and_Field; generalized a couple of lemmas