src/HOL/Real/Real.thy
author paulson
Thu Jun 25 13:57:34 1998 +0200 (1998-06-25)
changeset 5078 7b5ea59c0275
child 5588 a3ab526bb891
permissions -rw-r--r--
Installation of target HOL-Real
paulson@5078
     1
(*  Title       : Real.thy
paulson@5078
     2
    Author      : Jacques D. Fleuriot
paulson@5078
     3
    Copyright   : 1998  University of Cambridge
paulson@5078
     4
    Description : The reals
paulson@5078
     5
*) 
paulson@5078
     6
paulson@5078
     7
Real = PReal +
paulson@5078
     8
paulson@5078
     9
constdefs
paulson@5078
    10
    realrel   ::  "((preal * preal) * (preal * preal)) set"
paulson@5078
    11
    "realrel  ==  {p. ? x1 y1 x2 y2. p=((x1::preal,y1),(x2,y2)) & x1+y2 = x2+y1}" 
paulson@5078
    12
paulson@5078
    13
typedef real = "{x::(preal*preal).True}/realrel"          (Equiv.quotient_def)
paulson@5078
    14
paulson@5078
    15
paulson@5078
    16
instance
paulson@5078
    17
   real  :: {ord,plus,times}
paulson@5078
    18
paulson@5078
    19
consts 
paulson@5078
    20
paulson@5078
    21
  "0r"       :: real               ("0r")   
paulson@5078
    22
  "1r"       :: real               ("1r")  
paulson@5078
    23
paulson@5078
    24
defs
paulson@5078
    25
paulson@5078
    26
  real_zero_def      "0r == Abs_real(realrel^^{(@#($#1p),@#($#1p))})"
paulson@5078
    27
  real_one_def       "1r == Abs_real(realrel^^{(@#($#1p) + @#($#1p),@#($#1p))})"
paulson@5078
    28
paulson@5078
    29
constdefs
paulson@5078
    30
paulson@5078
    31
  real_preal :: preal => real              ("%#_" [80] 80)
paulson@5078
    32
  "%# m     == Abs_real(realrel^^{(m+@#($#1p),@#($#1p))})"
paulson@5078
    33
paulson@5078
    34
  real_minus :: real => real               ("%~ _" [80] 80) 
paulson@5078
    35
  "%~ R     ==  Abs_real(UN p:Rep_real(R). split (%x y. realrel^^{(y,x)}) p)"
paulson@5078
    36
paulson@5078
    37
  rinv       :: real => real
paulson@5078
    38
  "rinv(R)   == (@S. R ~= 0r & S*R = 1r)"
paulson@5078
    39
paulson@5078
    40
  real_nat :: nat => real                  ("%%# _" [80] 80) 
paulson@5078
    41
  "%%# n      == %#(@#($#(*# n)))"
paulson@5078
    42
paulson@5078
    43
defs
paulson@5078
    44
paulson@5078
    45
  real_add_def  
paulson@5078
    46
  "P + Q == Abs_real(UN p1:Rep_real(P). UN p2:Rep_real(Q).
paulson@5078
    47
                split(%x1 y1. split(%x2 y2. realrel^^{(x1+x2, y1+y2)}) p2) p1)"
paulson@5078
    48
  
paulson@5078
    49
  real_mult_def  
paulson@5078
    50
  "P * Q == Abs_real(UN p1:Rep_real(P). UN p2:Rep_real(Q).
paulson@5078
    51
                split(%x1 y1. split(%x2 y2. realrel^^{(x1*x2+y1*y2,x1*y2+x2*y1)}) p2) p1)"
paulson@5078
    52
paulson@5078
    53
  real_less_def
paulson@5078
    54
  "P < (Q::real) == EX x1 y1 x2 y2. x1 + y2 < x2 + y1 & 
paulson@5078
    55
                                   (x1,y1::preal):Rep_real(P) &
paulson@5078
    56
                                   (x2,y2):Rep_real(Q)" 
paulson@5078
    57
paulson@5078
    58
  real_le_def
paulson@5078
    59
  "P <= (Q::real) == ~(Q < P)"
paulson@5078
    60
paulson@5078
    61
end