src/HOL/Real/Real.thy
changeset 5078 7b5ea59c0275
child 5588 a3ab526bb891
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/HOL/Real/Real.thy	Thu Jun 25 13:57:34 1998 +0200
     1.3 @@ -0,0 +1,61 @@
     1.4 +(*  Title       : Real.thy
     1.5 +    Author      : Jacques D. Fleuriot
     1.6 +    Copyright   : 1998  University of Cambridge
     1.7 +    Description : The reals
     1.8 +*) 
     1.9 +
    1.10 +Real = PReal +
    1.11 +
    1.12 +constdefs
    1.13 +    realrel   ::  "((preal * preal) * (preal * preal)) set"
    1.14 +    "realrel  ==  {p. ? x1 y1 x2 y2. p=((x1::preal,y1),(x2,y2)) & x1+y2 = x2+y1}" 
    1.15 +
    1.16 +typedef real = "{x::(preal*preal).True}/realrel"          (Equiv.quotient_def)
    1.17 +
    1.18 +
    1.19 +instance
    1.20 +   real  :: {ord,plus,times}
    1.21 +
    1.22 +consts 
    1.23 +
    1.24 +  "0r"       :: real               ("0r")   
    1.25 +  "1r"       :: real               ("1r")  
    1.26 +
    1.27 +defs
    1.28 +
    1.29 +  real_zero_def      "0r == Abs_real(realrel^^{(@#($#1p),@#($#1p))})"
    1.30 +  real_one_def       "1r == Abs_real(realrel^^{(@#($#1p) + @#($#1p),@#($#1p))})"
    1.31 +
    1.32 +constdefs
    1.33 +
    1.34 +  real_preal :: preal => real              ("%#_" [80] 80)
    1.35 +  "%# m     == Abs_real(realrel^^{(m+@#($#1p),@#($#1p))})"
    1.36 +
    1.37 +  real_minus :: real => real               ("%~ _" [80] 80) 
    1.38 +  "%~ R     ==  Abs_real(UN p:Rep_real(R). split (%x y. realrel^^{(y,x)}) p)"
    1.39 +
    1.40 +  rinv       :: real => real
    1.41 +  "rinv(R)   == (@S. R ~= 0r & S*R = 1r)"
    1.42 +
    1.43 +  real_nat :: nat => real                  ("%%# _" [80] 80) 
    1.44 +  "%%# n      == %#(@#($#(*# n)))"
    1.45 +
    1.46 +defs
    1.47 +
    1.48 +  real_add_def  
    1.49 +  "P + Q == Abs_real(UN p1:Rep_real(P). UN p2:Rep_real(Q).
    1.50 +                split(%x1 y1. split(%x2 y2. realrel^^{(x1+x2, y1+y2)}) p2) p1)"
    1.51 +  
    1.52 +  real_mult_def  
    1.53 +  "P * Q == Abs_real(UN p1:Rep_real(P). UN p2:Rep_real(Q).
    1.54 +                split(%x1 y1. split(%x2 y2. realrel^^{(x1*x2+y1*y2,x1*y2+x2*y1)}) p2) p1)"
    1.55 +
    1.56 +  real_less_def
    1.57 +  "P < (Q::real) == EX x1 y1 x2 y2. x1 + y2 < x2 + y1 & 
    1.58 +                                   (x1,y1::preal):Rep_real(P) &
    1.59 +                                   (x2,y2):Rep_real(Q)" 
    1.60 +
    1.61 +  real_le_def
    1.62 +  "P <= (Q::real) == ~(Q < P)"
    1.63 +
    1.64 +end