author | paulson |
Fri, 02 Nov 2001 17:55:24 +0100 | |
changeset 12018 | ec054019c910 |
parent 11713 | 883d559b0b8c |
child 13487 | 1291c6375c29 |
permissions | -rw-r--r-- |
10751 | 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 |
||
8 |
HyperDef = Filter + Real + |
|
9 |
||
10 |
consts |
|
11 |
||
12 |
FreeUltrafilterNat :: nat set set ("\\<U>") |
|
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 |
||
25 |
typedef hypreal = "UNIV//hyprel" (Equiv.quotient_def) |
|
26 |
||
27 |
instance |
|
11713
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
wenzelm
parents:
11701
diff
changeset
|
28 |
hypreal :: {ord, zero, one, plus, times, minus, inverse} |
10751 | 29 |
|
30 |
defs |
|
31 |
||
32 |
hypreal_zero_def |
|
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11713
diff
changeset
|
33 |
"0 == Abs_hypreal(hyprel``{%n::nat. (0::real)})" |
10751 | 34 |
|
35 |
hypreal_one_def |
|
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11713
diff
changeset
|
36 |
"1 == Abs_hypreal(hyprel``{%n::nat. (1::real)})" |
10751 | 37 |
|
38 |
hypreal_minus_def |
|
10834 | 39 |
"- P == Abs_hypreal(UN X: Rep_hypreal(P). hyprel``{%n::nat. - (X n)})" |
10751 | 40 |
|
41 |
hypreal_diff_def |
|
42 |
"x - y == x + -(y::hypreal)" |
|
43 |
||
44 |
hypreal_inverse_def |
|
45 |
"inverse P == Abs_hypreal(UN X: Rep_hypreal(P). |
|
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11713
diff
changeset
|
46 |
hyprel``{%n. if X n = 0 then 0 else inverse (X n)})" |
10751 | 47 |
|
48 |
hypreal_divide_def |
|
49 |
"P / Q::hypreal == P * inverse Q" |
|
50 |
||
51 |
constdefs |
|
52 |
||
53 |
hypreal_of_real :: real => hypreal |
|
10834 | 54 |
"hypreal_of_real r == Abs_hypreal(hyprel``{%n::nat. r})" |
10751 | 55 |
|
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
56 |
omega :: hypreal (*an infinite number = [<1,2,3,...>] *) |
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
57 |
"omega == Abs_hypreal(hyprel``{%n::nat. real (Suc n)})" |
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
58 |
|
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
59 |
epsilon :: hypreal (*an infinitesimal number = [<1,1/2,1/3,...>] *) |
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
60 |
"epsilon == Abs_hypreal(hyprel``{%n::nat. inverse (real (Suc n))})" |
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
61 |
|
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
62 |
syntax (xsymbols) |
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
63 |
omega :: hypreal ("\\<omega>") |
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
64 |
epsilon :: hypreal ("\\<epsilon>") |
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
65 |
|
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
66 |
|
10751 | 67 |
defs |
68 |
||
69 |
hypreal_add_def |
|
70 |
"P + Q == Abs_hypreal(UN X:Rep_hypreal(P). UN Y:Rep_hypreal(Q). |
|
10834 | 71 |
hyprel``{%n::nat. X n + Y n})" |
10751 | 72 |
|
73 |
hypreal_mult_def |
|
74 |
"P * Q == Abs_hypreal(UN X:Rep_hypreal(P). UN Y:Rep_hypreal(Q). |
|
10834 | 75 |
hyprel``{%n::nat. X n * Y n})" |
10751 | 76 |
|
77 |
hypreal_less_def |
|
78 |
"P < (Q::hypreal) == EX X Y. X: Rep_hypreal(P) & |
|
79 |
Y: Rep_hypreal(Q) & |
|
80 |
{n::nat. X n < Y n} : FreeUltrafilterNat" |
|
81 |
hypreal_le_def |
|
82 |
"P <= (Q::hypreal) == ~(Q < P)" |
|
83 |
||
84 |
end |
|
85 |
||
86 |