src/HOL/Integ/IntDef.thy
changeset 10797 028d22926a41
parent 10214 77349ed89f45
child 10834 a7897aebbffc
equal deleted inserted replaced
10796:c0bcea781b3a 10797:028d22926a41
    17 instance
    17 instance
    18   int :: {ord, zero, plus, times, minus}
    18   int :: {ord, zero, plus, times, minus}
    19 
    19 
    20 defs
    20 defs
    21   zminus_def
    21   zminus_def
    22     "- Z == Abs_Integ(UN (x,y):Rep_Integ(Z). intrel^^{(y,x)})"
    22     "- Z == Abs_Integ(UN (x,y):Rep_Integ(Z). intrel```{(y,x)})"
    23 
    23 
    24 constdefs
    24 constdefs
    25 
    25 
    26   int :: nat => int
    26   int :: nat => int
    27   "int m == Abs_Integ(intrel ^^ {(m,0)})"
    27   "int m == Abs_Integ(intrel ``` {(m,0)})"
    28 
    28 
    29   neg   :: int => bool
    29   neg   :: int => bool
    30   "neg(Z) == EX x y. x<y & (x,y::nat):Rep_Integ(Z)"
    30   "neg(Z) == EX x y. x<y & (x,y::nat):Rep_Integ(Z)"
    31 
    31 
    32   (*For simplifying equalities*)
    32   (*For simplifying equalities*)
    38   Zero_def      "0 == int 0"
    38   Zero_def      "0 == int 0"
    39 
    39 
    40   zadd_def
    40   zadd_def
    41    "z + w == 
    41    "z + w == 
    42        Abs_Integ(UN (x1,y1):Rep_Integ(z). UN (x2,y2):Rep_Integ(w).   
    42        Abs_Integ(UN (x1,y1):Rep_Integ(z). UN (x2,y2):Rep_Integ(w).   
    43 		 intrel^^{(x1+x2, y1+y2)})"
    43 		 intrel```{(x1+x2, y1+y2)})"
    44 
    44 
    45   zdiff_def "z - (w::int) == z + (-w)"
    45   zdiff_def "z - (w::int) == z + (-w)"
    46 
    46 
    47   zless_def "z<w == neg(z - w)"
    47   zless_def "z<w == neg(z - w)"
    48 
    48 
    49   zle_def   "z <= (w::int) == ~(w < z)"
    49   zle_def   "z <= (w::int) == ~(w < z)"
    50 
    50 
    51   zmult_def
    51   zmult_def
    52    "z * w == 
    52    "z * w == 
    53        Abs_Integ(UN (x1,y1):Rep_Integ(z). UN (x2,y2):Rep_Integ(w).   
    53        Abs_Integ(UN (x1,y1):Rep_Integ(z). UN (x2,y2):Rep_Integ(w).   
    54 		 intrel^^{(x1*x2 + y1*y2, x1*y2 + y1*x2)})"
    54 		 intrel```{(x1*x2 + y1*y2, x1*y2 + y1*x2)})"
    55 
    55 
    56 end
    56 end