author | wenzelm |
Mon, 08 Oct 2001 15:23:20 +0200 | |
changeset 11713 | 883d559b0b8c |
parent 10919 | 144ede948e58 |
child 13487 | 1291c6375c29 |
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 |
|
11713
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
wenzelm
parents:
10919
diff
changeset
|
18 |
hypnat :: {ord, zero, one, plus, times, minus} |
10751 | 19 |
|
20 |
consts |
|
21 |
"whn" :: hypnat ("whn") |
|
22 |
||
23 |
constdefs |
|
24 |
||
25 |
(* embedding the naturals in the hypernaturals *) |
|
26 |
hypnat_of_nat :: nat => hypnat |
|
10834 | 27 |
"hypnat_of_nat m == Abs_hypnat(hypnatrel``{%n::nat. m})" |
10751 | 28 |
|
29 |
(* hypernaturals as members of the hyperreals; the set is defined as *) |
|
30 |
(* the nonstandard extension of set of naturals embedded in the reals *) |
|
31 |
HNat :: "hypreal set" |
|
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
32 |
"HNat == *s* {n. EX no::nat. n = real no}" |
10751 | 33 |
|
34 |
(* the set of infinite hypernatural numbers *) |
|
35 |
HNatInfinite :: "hypnat set" |
|
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
36 |
"HNatInfinite == {n. n ~: Nats}" |
10751 | 37 |
|
38 |
(* explicit embedding of the hypernaturals in the hyperreals *) |
|
39 |
hypreal_of_hypnat :: hypnat => hypreal |
|
40 |
"hypreal_of_hypnat N == Abs_hypreal(UN X: Rep_hypnat(N). |
|
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
41 |
hyprel``{%n::nat. real (X n)})" |
10751 | 42 |
|
43 |
defs |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
44 |
|
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
45 |
(** the overloaded constant "Nats" **) |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
46 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
47 |
(* set of naturals embedded in the hyperreals*) |
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
48 |
SNat_def "Nats == {n. EX N. n = hypreal_of_nat N}" |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
49 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
50 |
(* set of naturals embedded in the hypernaturals*) |
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
51 |
SHNat_def "Nats == {n. EX N. n = hypnat_of_nat N}" |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
52 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
53 |
(** hypernatural arithmetic **) |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
54 |
|
10834 | 55 |
hypnat_zero_def "0 == Abs_hypnat(hypnatrel``{%n::nat. 0})" |
11713
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
wenzelm
parents:
10919
diff
changeset
|
56 |
hypnat_one_def "1 == Abs_hypnat(hypnatrel``{%n::nat. 1})" |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
57 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
58 |
(* omega is in fact an infinite hypernatural number = [<1,2,3,...>] *) |
10834 | 59 |
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
|
60 |
|
10751 | 61 |
hypnat_add_def |
62 |
"P + Q == Abs_hypnat(UN X:Rep_hypnat(P). UN Y:Rep_hypnat(Q). |
|
10834 | 63 |
hypnatrel``{%n::nat. X n + Y n})" |
10751 | 64 |
|
65 |
hypnat_mult_def |
|
66 |
"P * Q == Abs_hypnat(UN X:Rep_hypnat(P). UN Y:Rep_hypnat(Q). |
|
10834 | 67 |
hypnatrel``{%n::nat. X n * Y n})" |
10751 | 68 |
|
69 |
hypnat_minus_def |
|
70 |
"P - Q == Abs_hypnat(UN X:Rep_hypnat(P). UN Y:Rep_hypnat(Q). |
|
10834 | 71 |
hypnatrel``{%n::nat. X n - Y n})" |
10751 | 72 |
|
73 |
hypnat_less_def |
|
74 |
"P < (Q::hypnat) == EX X Y. X: Rep_hypnat(P) & |
|
75 |
Y: Rep_hypnat(Q) & |
|
76 |
{n::nat. X n < Y n} : FreeUltrafilterNat" |
|
77 |
hypnat_le_def |
|
78 |
"P <= (Q::hypnat) == ~(Q < P)" |
|
79 |
||
80 |
end |
|
81 |
||
82 |
||
83 |