src/ZF/ex/Integ.thy
author lcp
Tue Nov 29 00:31:31 1994 +0100 (1994-11-29)
changeset 753 ec86863e87c8
parent 532 851df239ac8b
child 1110 756aa2e81f6e
permissions -rw-r--r--
replaced "rules" by "defs"
clasohm@0
     1
(*  Title: 	ZF/ex/integ.thy
clasohm@0
     2
    ID:         $Id$
clasohm@0
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
clasohm@0
     4
    Copyright   1993  University of Cambridge
clasohm@0
     5
clasohm@0
     6
The integers as equivalence classes over nat*nat.
clasohm@0
     7
*)
clasohm@0
     8
lcp@532
     9
Integ = EquivClass + Arith +
clasohm@0
    10
consts
clasohm@0
    11
    intrel,integ::      "i"
clasohm@0
    12
    znat	::	"i=>i"		("$# _" [80] 80)
clasohm@0
    13
    zminus	::	"i=>i"		("$~ _" [80] 80)
clasohm@0
    14
    znegative	::	"i=>o"
clasohm@0
    15
    zmagnitude	::	"i=>i"
clasohm@0
    16
    "$*"        ::      "[i,i]=>i"      (infixl 70)
clasohm@0
    17
    "$'/"       ::      "[i,i]=>i"      (infixl 70) 
clasohm@0
    18
    "$'/'/"     ::      "[i,i]=>i"      (infixl 70)
clasohm@0
    19
    "$+"	::      "[i,i]=>i"      (infixl 65)
clasohm@0
    20
    "$-"        ::      "[i,i]=>i"      (infixl 65)
clasohm@0
    21
    "$<"	:: 	"[i,i]=>o"  	(infixl 50)
clasohm@0
    22
lcp@753
    23
defs
clasohm@0
    24
clasohm@0
    25
    intrel_def
clasohm@0
    26
     "intrel == {p:(nat*nat)*(nat*nat). 		\
clasohm@0
    27
\        EX x1 y1 x2 y2. p=<<x1,y1>,<x2,y2>> & x1#+y2 = x2#+y1}"
clasohm@0
    28
clasohm@0
    29
    integ_def   "integ == (nat*nat)/intrel"
clasohm@0
    30
    
clasohm@0
    31
    znat_def	"$# m == intrel `` {<m,0>}"
clasohm@0
    32
    
clasohm@0
    33
    zminus_def	"$~ Z == UN p:Z. split(%x y. intrel``{<y,x>}, p)"
clasohm@0
    34
    
clasohm@0
    35
    znegative_def
lcp@29
    36
	"znegative(Z) == EX x y. x<y & y:nat & <x,y>:Z"
clasohm@0
    37
    
clasohm@0
    38
    zmagnitude_def
clasohm@0
    39
	"zmagnitude(Z) == UN p:Z. split(%x y. (y#-x) #+ (x#-y), p)"
clasohm@0
    40
    
clasohm@0
    41
    zadd_def
clasohm@0
    42
     "Z1 $+ Z2 == \
clasohm@0
    43
\       UN p1:Z1. UN p2:Z2. split(%x1 y1. split(%x2 y2. 		\
clasohm@0
    44
\                                         intrel``{<x1#+x2, y1#+y2>}, p2), p1)"
clasohm@0
    45
    
clasohm@0
    46
    zdiff_def   "Z1 $- Z2 == Z1 $+ zminus(Z2)"
clasohm@0
    47
    zless_def	"Z1 $< Z2 == znegative(Z1 $- Z2)"
clasohm@0
    48
    
clasohm@0
    49
    zmult_def
clasohm@0
    50
     "Z1 $* Z2 == \
clasohm@0
    51
\       UN p1:Z1. UN p2:Z2.  split(%x1 y1. split(%x2 y2. 	\
clasohm@0
    52
\                   intrel``{<x1#*x2 #+ y1#*y2, x1#*y2 #+ y1#*x2>}, p2), p1)"
clasohm@0
    53
    
clasohm@0
    54
 end