author | nipkow |
Tue, 09 Jan 2001 15:32:27 +0100 | |
changeset 10834 | a7897aebbffc |
parent 10797 | 028d22926a41 |
child 10919 | 144ede948e58 |
permissions | -rw-r--r-- |
10751 | 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 |
|
10834 | 28 |
"hypnat_of_nat m == Abs_hypnat(hypnatrel``{%n::nat. m})" |
10751 | 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. n = real_of_nat no}" |
|
34 |
||
35 |
(* the set of infinite hypernatural numbers *) |
|
36 |
HNatInfinite :: "hypnat set" |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
37 |
"HNatInfinite == {n. n ~: SNat}" |
10751 | 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). |
|
10834 | 42 |
hyprel``{%n::nat. real_of_nat (X n)})" |
10751 | 43 |
|
44 |
defs |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
45 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
46 |
(** the overloaded constant "SNat" **) |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
47 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
48 |
(* set of naturals embedded in the hyperreals*) |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
49 |
SNat_def "SNat == {n. EX N. n = hypreal_of_nat N}" |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
50 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
51 |
(* set of naturals embedded in the hypernaturals*) |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
52 |
SHNat_def "SNat == {n. EX N. n = hypnat_of_nat N}" |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
53 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
54 |
(** hypernatural arithmetic **) |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
55 |
|
10834 | 56 |
hypnat_zero_def "0 == Abs_hypnat(hypnatrel``{%n::nat. 0})" |
57 |
hypnat_one_def "1hn == Abs_hypnat(hypnatrel``{%n::nat. 1})" |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
58 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
59 |
(* omega is in fact an infinite hypernatural number = [<1,2,3,...>] *) |
10834 | 60 |
hypnat_omega_def "whn == Abs_hypnat(hypnatrel``{%n::nat. n})" |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
61 |
|
10751 | 62 |
hypnat_add_def |
63 |
"P + Q == Abs_hypnat(UN X:Rep_hypnat(P). UN Y:Rep_hypnat(Q). |
|
10834 | 64 |
hypnatrel``{%n::nat. X n + Y n})" |
10751 | 65 |
|
66 |
hypnat_mult_def |
|
67 |
"P * Q == Abs_hypnat(UN X:Rep_hypnat(P). UN Y:Rep_hypnat(Q). |
|
10834 | 68 |
hypnatrel``{%n::nat. X n * Y n})" |
10751 | 69 |
|
70 |
hypnat_minus_def |
|
71 |
"P - Q == Abs_hypnat(UN X:Rep_hypnat(P). UN Y:Rep_hypnat(Q). |
|
10834 | 72 |
hypnatrel``{%n::nat. X n - Y n})" |
10751 | 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 |