src/HOL/Divides.thy
author nipkow
Thu, 26 Nov 1998 12:18:08 +0100
changeset 5974 6acf3ff0f486
parent 3366 2402c6ab1561
child 6865 5577ffe4c2f1
permissions -rw-r--r--
Added filter_prems_tac
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
    ID:         $Id$
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
     5
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
     6
The division operators div, mod and the divides relation "dvd"
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
     7
*)
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
     8
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
     9
Divides = Arith +
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    10
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    11
consts
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    12
  div, mod  :: [nat, nat] => nat          (infixl 70)
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    13
  dvd     :: [nat,nat]=>bool              (infixl 70) 
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    14
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    15
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    16
defs
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    17
  mod_def   "m mod n == wfrec (trancl pred_nat)
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    18
                          (%f j. if j<n then j else f (j-n)) m"
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    19
  div_def   "m div n == wfrec (trancl pred_nat) 
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    20
                          (%f j. if j<n then 0 else Suc (f (j-n))) m"
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    21
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    22
  dvd_def   "m dvd n == EX k. n = m*k"
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    23
2402c6ab1561 Moving div and mod from Arith to Divides
paulson
parents:
diff changeset
    24
end