1 (* Title : HyperNat.thy
2 Author : Jacques D. Fleuriot
3 Copyright : 1998 University of Cambridge
4 Description : Explicit construction of hypernaturals using
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}"
15 typedef hypnat = "UNIV//hypnatrel" (Equiv.quotient_def)
18 hypnat :: {ord,zero,plus,times,minus}
21 "1hn" :: hypnat ("1hn")
22 "whn" :: hypnat ("whn")
26 (* embedding the naturals in the hypernaturals *)
27 hypnat_of_nat :: nat => hypnat
28 "hypnat_of_nat m == Abs_hypnat(hypnatrel``{%n::nat. m})"
30 (* hypernaturals as members of the hyperreals; the set is defined as *)
31 (* the nonstandard extension of set of naturals embedded in the reals *)
33 "HNat == *s* {n. EX no::nat. n = real no}"
35 (* the set of infinite hypernatural numbers *)
36 HNatInfinite :: "hypnat set"
37 "HNatInfinite == {n. n ~: Nats}"
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)})"
46 (** the overloaded constant "Nats" **)
48 (* set of naturals embedded in the hyperreals*)
49 SNat_def "Nats == {n. EX N. n = hypreal_of_nat N}"
51 (* set of naturals embedded in the hypernaturals*)
52 SHNat_def "Nats == {n. EX N. n = hypnat_of_nat N}"
54 (** hypernatural arithmetic **)
56 hypnat_zero_def "0 == Abs_hypnat(hypnatrel``{%n::nat. 0})"
57 hypnat_one_def "1hn == Abs_hypnat(hypnatrel``{%n::nat. 1})"
59 (* omega is in fact an infinite hypernatural number = [<1,2,3,...>] *)
60 hypnat_omega_def "whn == Abs_hypnat(hypnatrel``{%n::nat. n})"
63 "P + Q == Abs_hypnat(UN X:Rep_hypnat(P). UN Y:Rep_hypnat(Q).
64 hypnatrel``{%n::nat. X n + Y n})"
67 "P * Q == Abs_hypnat(UN X:Rep_hypnat(P). UN Y:Rep_hypnat(Q).
68 hypnatrel``{%n::nat. X n * Y n})"
71 "P - Q == Abs_hypnat(UN X:Rep_hypnat(P). UN Y:Rep_hypnat(Q).
72 hypnatrel``{%n::nat. X n - Y n})"
75 "P < (Q::hypnat) == EX X Y. X: Rep_hypnat(P) &
77 {n::nat. X n < Y n} : FreeUltrafilterNat"
79 "P <= (Q::hypnat) == ~(Q < P)"