src/HOL/Hyperreal/HyperNat.thy
author paulson
Tue, 16 Jan 2001 12:20:52 +0100
changeset 10919 144ede948e58
parent 10834 a7897aebbffc
child 11713 883d559b0b8c
permissions -rw-r--r--
renamings: real_of_nat, real_of_int -> (overloaded) real
inf_close -> approx
SReal -> Reals
SNat -> Nats
     1 (*  Title       : HyperNat.thy
     2     Author      : Jacques D. Fleuriot
     3     Copyright   : 1998  University of Cambridge
     4     Description : Explicit construction of hypernaturals using 
     5                   ultrafilters
     6 *) 
     7 
     8 HyperNat = Star + 
     9 
    10 constdefs
    11     hypnatrel :: "((nat=>nat)*(nat=>nat)) set"
    12     "hypnatrel == {p. EX X Y. p = ((X::nat=>nat),Y) & 
    13                        {n::nat. X(n) = Y(n)} : FreeUltrafilterNat}"
    14 
    15 typedef hypnat = "UNIV//hypnatrel"              (Equiv.quotient_def)
    16 
    17 instance
    18    hypnat  :: {ord,zero,plus,times,minus}
    19 
    20 consts
    21   "1hn"       :: hypnat               ("1hn")  
    22   "whn"       :: hypnat               ("whn")  
    23 
    24 constdefs
    25 
    26   (* embedding the naturals in the hypernaturals *)
    27   hypnat_of_nat   :: nat => hypnat
    28   "hypnat_of_nat m  == Abs_hypnat(hypnatrel``{%n::nat. m})"
    29 
    30   (* hypernaturals as members of the hyperreals; the set is defined as  *)
    31   (* the nonstandard extension of set of naturals embedded in the reals *)
    32   HNat         :: "hypreal set"
    33   "HNat == *s* {n. EX no::nat. n = real no}"
    34 
    35   (* the set of infinite hypernatural numbers *)
    36   HNatInfinite :: "hypnat set"
    37   "HNatInfinite == {n. n ~: Nats}"
    38 
    39   (* explicit embedding of the hypernaturals in the hyperreals *)    
    40   hypreal_of_hypnat :: hypnat => hypreal
    41   "hypreal_of_hypnat N  == Abs_hypreal(UN X: Rep_hypnat(N). 
    42                                        hyprel``{%n::nat. real (X n)})"
    43   
    44 defs
    45 
    46   (** the overloaded constant "Nats" **)
    47   
    48   (* set of naturals embedded in the hyperreals*)
    49   SNat_def             "Nats == {n. EX N. n = hypreal_of_nat N}"  
    50 
    51   (* set of naturals embedded in the hypernaturals*)
    52   SHNat_def            "Nats == {n. EX N. n = hypnat_of_nat N}"  
    53 
    54   (** hypernatural arithmetic **)
    55   
    56   hypnat_zero_def      "0 == Abs_hypnat(hypnatrel``{%n::nat. 0})"
    57   hypnat_one_def       "1hn == Abs_hypnat(hypnatrel``{%n::nat. 1})"
    58 
    59   (* omega is in fact an infinite hypernatural number = [<1,2,3,...>] *)
    60   hypnat_omega_def     "whn == Abs_hypnat(hypnatrel``{%n::nat. n})"
    61  
    62   hypnat_add_def  
    63   "P + Q == Abs_hypnat(UN X:Rep_hypnat(P). UN Y:Rep_hypnat(Q).
    64                 hypnatrel``{%n::nat. X n + Y n})"
    65 
    66   hypnat_mult_def  
    67   "P * Q == Abs_hypnat(UN X:Rep_hypnat(P). UN Y:Rep_hypnat(Q).
    68                 hypnatrel``{%n::nat. X n * Y n})"
    69 
    70   hypnat_minus_def  
    71   "P - Q == Abs_hypnat(UN X:Rep_hypnat(P). UN Y:Rep_hypnat(Q).
    72                 hypnatrel``{%n::nat. X n - Y n})"
    73 
    74   hypnat_less_def
    75   "P < (Q::hypnat) == EX X Y. X: Rep_hypnat(P) & 
    76                                Y: Rep_hypnat(Q) & 
    77                                {n::nat. X n < Y n} : FreeUltrafilterNat"
    78   hypnat_le_def
    79   "P <= (Q::hypnat) == ~(Q < P)" 
    80 
    81 end
    82 
    83 
    84