author | wenzelm |
Fri, 01 Dec 2000 19:42:35 +0100 | |
changeset 10568 | a7701b1d6c6a |
parent 9391 | a6ab3a442da6 |
child 10607 | 352f6f209775 |
permissions | -rw-r--r-- |
7218 | 1 |
(* Title : HOL/Real/Hyperreal/HyperDef.thy |
2 |
ID : $Id$ |
|
3 |
Author : Jacques D. Fleuriot |
|
4 |
Copyright : 1998 University of Cambridge |
|
5 |
Description : Construction of hyperreals using ultrafilters |
|
6 |
*) |
|
7 |
||
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
7292
diff
changeset
|
8 |
HyperDef = Filter + Real + |
7218 | 9 |
|
10 |
consts |
|
11 |
||
10568 | 12 |
FreeUltrafilterNat :: nat set set ("\\<U>") |
7218 | 13 |
|
14 |
defs |
|
15 |
||
16 |
FreeUltrafilterNat_def |
|
17 |
"FreeUltrafilterNat == (@U. U : FreeUltrafilter (UNIV:: nat set))" |
|
18 |
||
19 |
||
20 |
constdefs |
|
21 |
hyprel :: "((nat=>real)*(nat=>real)) set" |
|
22 |
"hyprel == {p. ? X Y. p = ((X::nat=>real),Y) & |
|
23 |
{n::nat. X(n) = Y(n)}: FreeUltrafilterNat}" |
|
24 |
||
9391 | 25 |
typedef hypreal = "UNIV//hyprel" (Equiv.quotient_def) |
7218 | 26 |
|
27 |
instance |
|
9055 | 28 |
hypreal :: {ord, zero, plus, times, minus} |
7218 | 29 |
|
30 |
consts |
|
31 |
||
32 |
"1hr" :: hypreal ("1hr") |
|
33 |
"whr" :: hypreal ("whr") |
|
34 |
"ehr" :: hypreal ("ehr") |
|
35 |
||
36 |
||
37 |
defs |
|
38 |
||
9055 | 39 |
hypreal_zero_def "0 == Abs_hypreal(hyprel^^{%n::nat. (#0::real)})" |
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
7292
diff
changeset
|
40 |
hypreal_one_def "1hr == Abs_hypreal(hyprel^^{%n::nat. (#1::real)})" |
7218 | 41 |
|
42 |
(* an infinite number = [<1,2,3,...>] *) |
|
43 |
omega_def "whr == Abs_hypreal(hyprel^^{%n::nat. real_of_posnat n})" |
|
44 |
||
45 |
(* an infinitesimal number = [<1,1/2,1/3,...>] *) |
|
46 |
epsilon_def "ehr == Abs_hypreal(hyprel^^{%n::nat. rinv(real_of_posnat n)})" |
|
47 |
||
48 |
hypreal_minus_def |
|
9055 | 49 |
"- P == Abs_hypreal(UN X: Rep_hypreal(P). hyprel^^{%n::nat. - (X n)})" |
7218 | 50 |
|
51 |
hypreal_diff_def |
|
52 |
"x - y == x + -(y::hypreal)" |
|
53 |
||
54 |
constdefs |
|
55 |
||
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
7292
diff
changeset
|
56 |
hypreal_of_real :: real => hypreal |
7218 | 57 |
"hypreal_of_real r == Abs_hypreal(hyprel^^{%n::nat. r})" |
58 |
||
59 |
hrinv :: hypreal => hypreal |
|
60 |
"hrinv(P) == Abs_hypreal(UN X: Rep_hypreal(P). |
|
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
7292
diff
changeset
|
61 |
hyprel^^{%n. if X n = #0 then #0 else rinv(X n)})" |
7218 | 62 |
|
63 |
(* n::nat --> (n+1)::hypreal *) |
|
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
7292
diff
changeset
|
64 |
hypreal_of_posnat :: nat => hypreal |
7218 | 65 |
"hypreal_of_posnat n == (hypreal_of_real(real_of_preal |
66 |
(preal_of_prat(prat_of_pnat(pnat_of_nat n)))))" |
|
67 |
||
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
7292
diff
changeset
|
68 |
hypreal_of_nat :: nat => hypreal |
7218 | 69 |
"hypreal_of_nat n == hypreal_of_posnat n + -1hr" |
70 |
||
71 |
defs |
|
72 |
||
73 |
hypreal_add_def |
|
74 |
"P + Q == Abs_hypreal(UN X:Rep_hypreal(P). UN Y:Rep_hypreal(Q). |
|
75 |
hyprel^^{%n::nat. X n + Y n})" |
|
76 |
||
77 |
hypreal_mult_def |
|
78 |
"P * Q == Abs_hypreal(UN X:Rep_hypreal(P). UN Y:Rep_hypreal(Q). |
|
79 |
hyprel^^{%n::nat. X n * Y n})" |
|
80 |
||
81 |
hypreal_less_def |
|
82 |
"P < (Q::hypreal) == EX X Y. X: Rep_hypreal(P) & |
|
83 |
Y: Rep_hypreal(Q) & |
|
84 |
{n::nat. X n < Y n} : FreeUltrafilterNat" |
|
85 |
hypreal_le_def |
|
86 |
"P <= (Q::hypreal) == ~(Q < P)" |
|
87 |
||
88 |
end |
|
89 |
||
90 |