author | paulson |
Fri, 19 Mar 2004 10:51:03 +0100 | |
changeset 14477 | cc61fd03e589 |
parent 14468 | 6be497cacab5 |
child 14565 | c6dc17aab88a |
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 |
|
14468 | 5 |
Conversion to Isar and new proofs by Lawrence C Paulson, 2004 |
13487 | 6 |
*) |
10751 | 7 |
|
14468 | 8 |
header{*Construction of Hyperreals Using Ultrafilters*} |
9 |
||
14299 | 10 |
theory HyperDef = Filter + Real |
11 |
files ("fuf.ML"): (*Warning: file fuf.ML refers to the name Hyperdef!*) |
|
10751 | 12 |
|
13 |
||
14 |
constdefs |
|
14299 | 15 |
|
14361
ad2f5da643b4
* Support for raw latex output in control symbols: \<^raw...>
schirmer
parents:
14348
diff
changeset
|
16 |
FreeUltrafilterNat :: "nat set set" ("\<U>") |
14299 | 17 |
"FreeUltrafilterNat == (SOME U. U \<in> FreeUltrafilter (UNIV:: nat set))" |
18 |
||
19 |
hyprel :: "((nat=>real)*(nat=>real)) set" |
|
20 |
"hyprel == {p. \<exists>X Y. p = ((X::nat=>real),Y) & |
|
10751 | 21 |
{n::nat. X(n) = Y(n)}: FreeUltrafilterNat}" |
22 |
||
14299 | 23 |
typedef hypreal = "UNIV//hyprel" |
24 |
by (auto simp add: quotient_def) |
|
10751 | 25 |
|
14299 | 26 |
instance hypreal :: ord .. |
27 |
instance hypreal :: zero .. |
|
28 |
instance hypreal :: one .. |
|
29 |
instance hypreal :: plus .. |
|
30 |
instance hypreal :: times .. |
|
31 |
instance hypreal :: minus .. |
|
32 |
instance hypreal :: inverse .. |
|
10751 | 33 |
|
34 |
||
14299 | 35 |
defs (overloaded) |
36 |
||
37 |
hypreal_zero_def: |
|
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11713
diff
changeset
|
38 |
"0 == Abs_hypreal(hyprel``{%n::nat. (0::real)})" |
10751 | 39 |
|
14299 | 40 |
hypreal_one_def: |
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11713
diff
changeset
|
41 |
"1 == Abs_hypreal(hyprel``{%n::nat. (1::real)})" |
10751 | 42 |
|
14299 | 43 |
hypreal_minus_def: |
44 |
"- P == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). hyprel``{%n::nat. - (X n)})" |
|
10751 | 45 |
|
14299 | 46 |
hypreal_diff_def: |
10751 | 47 |
"x - y == x + -(y::hypreal)" |
48 |
||
14299 | 49 |
hypreal_inverse_def: |
50 |
"inverse P == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). |
|
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11713
diff
changeset
|
51 |
hyprel``{%n. if X n = 0 then 0 else inverse (X n)})" |
10751 | 52 |
|
14299 | 53 |
hypreal_divide_def: |
10751 | 54 |
"P / Q::hypreal == P * inverse Q" |
13487 | 55 |
|
10751 | 56 |
constdefs |
57 |
||
14299 | 58 |
hypreal_of_real :: "real => hypreal" |
10834 | 59 |
"hypreal_of_real r == Abs_hypreal(hyprel``{%n::nat. r})" |
10751 | 60 |
|
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
61 |
omega :: hypreal (*an infinite number = [<1,2,3,...>] *) |
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
62 |
"omega == Abs_hypreal(hyprel``{%n::nat. real (Suc n)})" |
13487 | 63 |
|
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
64 |
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
|
65 |
"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
|
66 |
|
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
67 |
syntax (xsymbols) |
14299 | 68 |
omega :: hypreal ("\<omega>") |
69 |
epsilon :: hypreal ("\<epsilon>") |
|
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
70 |
|
10751 | 71 |
|
14370 | 72 |
defs (overloaded) |
13487 | 73 |
|
14299 | 74 |
hypreal_add_def: |
75 |
"P + Q == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). \<Union>Y \<in> Rep_hypreal(Q). |
|
10834 | 76 |
hyprel``{%n::nat. X n + Y n})" |
10751 | 77 |
|
14299 | 78 |
hypreal_mult_def: |
79 |
"P * Q == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). \<Union>Y \<in> Rep_hypreal(Q). |
|
10834 | 80 |
hyprel``{%n::nat. X n * Y n})" |
10751 | 81 |
|
14370 | 82 |
hypreal_le_def: |
83 |
"P \<le> (Q::hypreal) == \<exists>X Y. X \<in> Rep_hypreal(P) & |
|
14299 | 84 |
Y \<in> Rep_hypreal(Q) & |
14370 | 85 |
{n::nat. X n \<le> Y n} \<in> FreeUltrafilterNat" |
86 |
||
87 |
hypreal_less_def: "(x < (y::hypreal)) == (x \<le> y & x \<noteq> y)" |
|
10751 | 88 |
|
14329 | 89 |
hrabs_def: "abs (r::hypreal) == (if 0 \<le> r then r else -r)" |
90 |
||
91 |
||
92 |
subsection{*The Set of Naturals is not Finite*} |
|
14299 | 93 |
|
94 |
(*** based on James' proof that the set of naturals is not finite ***) |
|
14329 | 95 |
lemma finite_exhausts [rule_format]: |
96 |
"finite (A::nat set) --> (\<exists>n. \<forall>m. Suc (n + m) \<notin> A)" |
|
14299 | 97 |
apply (rule impI) |
14301 | 98 |
apply (erule_tac F = A in finite_induct) |
99 |
apply (blast, erule exE) |
|
14299 | 100 |
apply (rule_tac x = "n + x" in exI) |
14301 | 101 |
apply (rule allI, erule_tac x = "x + m" in allE) |
14299 | 102 |
apply (auto simp add: add_ac) |
103 |
done |
|
104 |
||
14329 | 105 |
lemma finite_not_covers [rule_format (no_asm)]: |
106 |
"finite (A :: nat set) --> (\<exists>n. n \<notin>A)" |
|
14301 | 107 |
by (rule impI, drule finite_exhausts, blast) |
14299 | 108 |
|
109 |
lemma not_finite_nat: "~ finite(UNIV:: nat set)" |
|
14301 | 110 |
by (fast dest!: finite_exhausts) |
14299 | 111 |
|
14329 | 112 |
|
113 |
subsection{*Existence of Free Ultrafilter over the Naturals*} |
|
114 |
||
115 |
text{*Also, proof of various properties of @{term FreeUltrafilterNat}: |
|
116 |
an arbitrary free ultrafilter*} |
|
14299 | 117 |
|
118 |
lemma FreeUltrafilterNat_Ex: "\<exists>U. U: FreeUltrafilter (UNIV::nat set)" |
|
14301 | 119 |
by (rule not_finite_nat [THEN FreeUltrafilter_Ex]) |
14299 | 120 |
|
14301 | 121 |
lemma FreeUltrafilterNat_mem [simp]: |
14299 | 122 |
"FreeUltrafilterNat: FreeUltrafilter(UNIV:: nat set)" |
123 |
apply (unfold FreeUltrafilterNat_def) |
|
124 |
apply (rule FreeUltrafilterNat_Ex [THEN exE]) |
|
14301 | 125 |
apply (rule someI2, assumption+) |
14299 | 126 |
done |
127 |
||
128 |
lemma FreeUltrafilterNat_finite: "finite x ==> x \<notin> FreeUltrafilterNat" |
|
129 |
apply (unfold FreeUltrafilterNat_def) |
|
130 |
apply (rule FreeUltrafilterNat_Ex [THEN exE]) |
|
14301 | 131 |
apply (rule someI2, assumption) |
14299 | 132 |
apply (blast dest: mem_FreeUltrafiltersetD1) |
133 |
done |
|
134 |
||
135 |
lemma FreeUltrafilterNat_not_finite: "x: FreeUltrafilterNat ==> ~ finite x" |
|
14301 | 136 |
by (blast dest: FreeUltrafilterNat_finite) |
14299 | 137 |
|
14301 | 138 |
lemma FreeUltrafilterNat_empty [simp]: "{} \<notin> FreeUltrafilterNat" |
14299 | 139 |
apply (unfold FreeUltrafilterNat_def) |
140 |
apply (rule FreeUltrafilterNat_Ex [THEN exE]) |
|
14301 | 141 |
apply (rule someI2, assumption) |
142 |
apply (blast dest: FreeUltrafilter_Ultrafilter Ultrafilter_Filter |
|
143 |
Filter_empty_not_mem) |
|
14299 | 144 |
done |
145 |
||
14329 | 146 |
lemma FreeUltrafilterNat_Int: |
147 |
"[| X: FreeUltrafilterNat; Y: FreeUltrafilterNat |] |
|
14299 | 148 |
==> X Int Y \<in> FreeUltrafilterNat" |
149 |
apply (cut_tac FreeUltrafilterNat_mem) |
|
150 |
apply (blast dest: FreeUltrafilter_Ultrafilter Ultrafilter_Filter mem_FiltersetD1) |
|
151 |
done |
|
152 |
||
14329 | 153 |
lemma FreeUltrafilterNat_subset: |
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14361
diff
changeset
|
154 |
"[| X: FreeUltrafilterNat; X \<subseteq> Y |] |
14299 | 155 |
==> Y \<in> FreeUltrafilterNat" |
156 |
apply (cut_tac FreeUltrafilterNat_mem) |
|
157 |
apply (blast dest: FreeUltrafilter_Ultrafilter Ultrafilter_Filter mem_FiltersetD2) |
|
158 |
done |
|
159 |
||
14329 | 160 |
lemma FreeUltrafilterNat_Compl: |
161 |
"X: FreeUltrafilterNat ==> -X \<notin> FreeUltrafilterNat" |
|
14301 | 162 |
apply safe |
163 |
apply (drule FreeUltrafilterNat_Int, assumption, auto) |
|
14299 | 164 |
done |
165 |
||
14329 | 166 |
lemma FreeUltrafilterNat_Compl_mem: |
167 |
"X\<notin> FreeUltrafilterNat ==> -X \<in> FreeUltrafilterNat" |
|
14299 | 168 |
apply (cut_tac FreeUltrafilterNat_mem [THEN FreeUltrafilter_iff [THEN iffD1]]) |
14301 | 169 |
apply (safe, drule_tac x = X in bspec) |
14299 | 170 |
apply (auto simp add: UNIV_diff_Compl) |
171 |
done |
|
172 |
||
14329 | 173 |
lemma FreeUltrafilterNat_Compl_iff1: |
174 |
"(X \<notin> FreeUltrafilterNat) = (-X: FreeUltrafilterNat)" |
|
14301 | 175 |
by (blast dest: FreeUltrafilterNat_Compl FreeUltrafilterNat_Compl_mem) |
14299 | 176 |
|
14329 | 177 |
lemma FreeUltrafilterNat_Compl_iff2: |
178 |
"(X: FreeUltrafilterNat) = (-X \<notin> FreeUltrafilterNat)" |
|
14301 | 179 |
by (auto simp add: FreeUltrafilterNat_Compl_iff1 [symmetric]) |
14299 | 180 |
|
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
181 |
lemma cofinite_mem_FreeUltrafilterNat: "finite (-X) ==> X \<in> FreeUltrafilterNat" |
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
182 |
apply (drule FreeUltrafilterNat_finite) |
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
183 |
apply (simp add: FreeUltrafilterNat_Compl_iff2 [symmetric]) |
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
184 |
done |
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
185 |
|
14301 | 186 |
lemma FreeUltrafilterNat_UNIV [simp]: "(UNIV::nat set) \<in> FreeUltrafilterNat" |
187 |
by (rule FreeUltrafilterNat_mem [THEN FreeUltrafilter_Ultrafilter, THEN Ultrafilter_Filter, THEN mem_FiltersetD4]) |
|
14299 | 188 |
|
14301 | 189 |
lemma FreeUltrafilterNat_Nat_set [simp]: "UNIV \<in> FreeUltrafilterNat" |
190 |
by auto |
|
14299 | 191 |
|
14329 | 192 |
lemma FreeUltrafilterNat_Nat_set_refl [intro]: |
193 |
"{n. P(n) = P(n)} \<in> FreeUltrafilterNat" |
|
14301 | 194 |
by simp |
14299 | 195 |
|
196 |
lemma FreeUltrafilterNat_P: "{n::nat. P} \<in> FreeUltrafilterNat ==> P" |
|
14301 | 197 |
by (rule ccontr, simp) |
14299 | 198 |
|
199 |
lemma FreeUltrafilterNat_Ex_P: "{n. P(n)} \<in> FreeUltrafilterNat ==> \<exists>n. P(n)" |
|
14301 | 200 |
by (rule ccontr, simp) |
14299 | 201 |
|
202 |
lemma FreeUltrafilterNat_all: "\<forall>n. P(n) ==> {n. P(n)} \<in> FreeUltrafilterNat" |
|
14301 | 203 |
by (auto intro: FreeUltrafilterNat_Nat_set) |
14299 | 204 |
|
14329 | 205 |
|
206 |
text{*Define and use Ultrafilter tactics*} |
|
14299 | 207 |
use "fuf.ML" |
208 |
||
209 |
method_setup fuf = {* |
|
210 |
Method.ctxt_args (fn ctxt => |
|
211 |
Method.METHOD (fn facts => |
|
212 |
fuf_tac (Classical.get_local_claset ctxt, |
|
213 |
Simplifier.get_local_simpset ctxt) 1)) *} |
|
214 |
"free ultrafilter tactic" |
|
215 |
||
216 |
method_setup ultra = {* |
|
217 |
Method.ctxt_args (fn ctxt => |
|
218 |
Method.METHOD (fn facts => |
|
219 |
ultra_tac (Classical.get_local_claset ctxt, |
|
220 |
Simplifier.get_local_simpset ctxt) 1)) *} |
|
221 |
"ultrafilter tactic" |
|
222 |
||
223 |
||
14329 | 224 |
text{*One further property of our free ultrafilter*} |
225 |
lemma FreeUltrafilterNat_Un: |
|
226 |
"X Un Y: FreeUltrafilterNat |
|
14299 | 227 |
==> X: FreeUltrafilterNat | Y: FreeUltrafilterNat" |
228 |
apply auto |
|
14301 | 229 |
apply ultra |
14299 | 230 |
done |
231 |
||
232 |
||
14329 | 233 |
subsection{*Properties of @{term hyprel}*} |
234 |
||
235 |
text{*Proving that @{term hyprel} is an equivalence relation*} |
|
14299 | 236 |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14361
diff
changeset
|
237 |
lemma hyprel_iff: "((X,Y) \<in> hyprel) = ({n. X n = Y n}: FreeUltrafilterNat)" |
14468 | 238 |
by (simp add: hyprel_def) |
14299 | 239 |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14361
diff
changeset
|
240 |
lemma hyprel_refl: "(x,x) \<in> hyprel" |
14468 | 241 |
by (simp add: hyprel_def) |
14299 | 242 |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14361
diff
changeset
|
243 |
lemma hyprel_sym [rule_format (no_asm)]: "(x,y) \<in> hyprel --> (y,x) \<in> hyprel" |
14301 | 244 |
by (simp add: hyprel_def eq_commute) |
14299 | 245 |
|
246 |
lemma hyprel_trans: |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14361
diff
changeset
|
247 |
"[|(x,y) \<in> hyprel; (y,z) \<in> hyprel|] ==> (x,z) \<in> hyprel" |
14468 | 248 |
by (simp add: hyprel_def, ultra) |
14299 | 249 |
|
250 |
lemma equiv_hyprel: "equiv UNIV hyprel" |
|
251 |
apply (simp add: equiv_def refl_def sym_def trans_def hyprel_refl) |
|
252 |
apply (blast intro: hyprel_sym hyprel_trans) |
|
253 |
done |
|
254 |
||
255 |
(* (hyprel `` {x} = hyprel `` {y}) = ((x,y) \<in> hyprel) *) |
|
256 |
lemmas equiv_hyprel_iff = |
|
257 |
eq_equiv_class_iff [OF equiv_hyprel UNIV_I UNIV_I, simp] |
|
258 |
||
14301 | 259 |
lemma hyprel_in_hypreal [simp]: "hyprel``{x}:hypreal" |
14468 | 260 |
by (simp add: hypreal_def hyprel_def quotient_def, blast) |
14299 | 261 |
|
262 |
lemma inj_on_Abs_hypreal: "inj_on Abs_hypreal hypreal" |
|
263 |
apply (rule inj_on_inverseI) |
|
264 |
apply (erule Abs_hypreal_inverse) |
|
265 |
done |
|
266 |
||
267 |
declare inj_on_Abs_hypreal [THEN inj_on_iff, simp] |
|
14301 | 268 |
Abs_hypreal_inverse [simp] |
14299 | 269 |
|
270 |
declare equiv_hyprel [THEN eq_equiv_class_iff, simp] |
|
271 |
||
272 |
declare hyprel_iff [iff] |
|
273 |
||
274 |
lemmas eq_hyprelD = eq_equiv_class [OF _ equiv_hyprel] |
|
275 |
||
276 |
lemma inj_Rep_hypreal: "inj(Rep_hypreal)" |
|
277 |
apply (rule inj_on_inverseI) |
|
278 |
apply (rule Rep_hypreal_inverse) |
|
279 |
done |
|
280 |
||
14301 | 281 |
lemma lemma_hyprel_refl [simp]: "x \<in> hyprel `` {x}" |
14468 | 282 |
by (simp add: hyprel_def) |
14299 | 283 |
|
14301 | 284 |
lemma hypreal_empty_not_mem [simp]: "{} \<notin> hypreal" |
14468 | 285 |
apply (simp add: hypreal_def) |
14299 | 286 |
apply (auto elim!: quotientE equalityCE) |
287 |
done |
|
288 |
||
14301 | 289 |
lemma Rep_hypreal_nonempty [simp]: "Rep_hypreal x \<noteq> {}" |
290 |
by (cut_tac x = x in Rep_hypreal, auto) |
|
14299 | 291 |
|
292 |
||
14329 | 293 |
subsection{*@{term hypreal_of_real}: |
294 |
the Injection from @{typ real} to @{typ hypreal}*} |
|
14299 | 295 |
|
296 |
lemma inj_hypreal_of_real: "inj(hypreal_of_real)" |
|
297 |
apply (rule inj_onI) |
|
14468 | 298 |
apply (simp add: hypreal_of_real_def split: split_if_asm) |
14299 | 299 |
done |
300 |
||
301 |
lemma eq_Abs_hypreal: |
|
14468 | 302 |
"(!!x. z = Abs_hypreal(hyprel``{x}) ==> P) ==> P" |
14299 | 303 |
apply (rule_tac x1=z in Rep_hypreal [unfolded hypreal_def, THEN quotientE]) |
14301 | 304 |
apply (drule_tac f = Abs_hypreal in arg_cong) |
14299 | 305 |
apply (force simp add: Rep_hypreal_inverse) |
306 |
done |
|
307 |
||
14468 | 308 |
theorem hypreal_cases [case_names Abs_hypreal, cases type: hypreal]: |
309 |
"(!!x. z = Abs_hypreal(hyprel``{x}) ==> P) ==> P" |
|
310 |
by (rule eq_Abs_hypreal [of z], blast) |
|
311 |
||
14329 | 312 |
|
313 |
subsection{*Hyperreal Addition*} |
|
314 |
||
315 |
lemma hypreal_add_congruent2: |
|
316 |
"congruent2 hyprel (%X Y. hyprel``{%n. X n + Y n})" |
|
14468 | 317 |
apply (simp add: congruent2_def, auto, ultra) |
14329 | 318 |
done |
319 |
||
320 |
lemma hypreal_add: |
|
321 |
"Abs_hypreal(hyprel``{%n. X n}) + Abs_hypreal(hyprel``{%n. Y n}) = |
|
322 |
Abs_hypreal(hyprel``{%n. X n + Y n})" |
|
14468 | 323 |
apply (simp add: hypreal_add_def) |
14329 | 324 |
apply (simp add: UN_equiv_class2 [OF equiv_hyprel hypreal_add_congruent2]) |
325 |
done |
|
326 |
||
327 |
lemma hypreal_add_commute: "(z::hypreal) + w = w + z" |
|
14468 | 328 |
apply (cases z, cases w) |
14334 | 329 |
apply (simp add: add_ac hypreal_add) |
14329 | 330 |
done |
331 |
||
332 |
lemma hypreal_add_assoc: "((z1::hypreal) + z2) + z3 = z1 + (z2 + z3)" |
|
14468 | 333 |
apply (cases z1, cases z2, cases z3) |
14329 | 334 |
apply (simp add: hypreal_add real_add_assoc) |
335 |
done |
|
336 |
||
14331 | 337 |
lemma hypreal_add_zero_left: "(0::hypreal) + z = z" |
14468 | 338 |
by (cases z, simp add: hypreal_zero_def hypreal_add) |
14329 | 339 |
|
340 |
instance hypreal :: plus_ac0 |
|
341 |
by (intro_classes, |
|
342 |
(assumption | |
|
343 |
rule hypreal_add_commute hypreal_add_assoc hypreal_add_zero_left)+) |
|
344 |
||
345 |
lemma hypreal_add_zero_right [simp]: "z + (0::hypreal) = z" |
|
346 |
by (simp add: hypreal_add_zero_left hypreal_add_commute) |
|
347 |
||
348 |
||
349 |
subsection{*Additive inverse on @{typ hypreal}*} |
|
14299 | 350 |
|
351 |
lemma hypreal_minus_congruent: |
|
352 |
"congruent hyprel (%X. hyprel``{%n. - (X n)})" |
|
353 |
by (force simp add: congruent_def) |
|
354 |
||
355 |
lemma hypreal_minus: |
|
356 |
"- (Abs_hypreal(hyprel``{%n. X n})) = Abs_hypreal(hyprel `` {%n. -(X n)})" |
|
14468 | 357 |
apply (simp add: hypreal_minus_def) |
14301 | 358 |
apply (rule_tac f = Abs_hypreal in arg_cong) |
359 |
apply (simp add: hyprel_in_hypreal [THEN Abs_hypreal_inverse] |
|
14299 | 360 |
UN_equiv_class [OF equiv_hyprel hypreal_minus_congruent]) |
361 |
done |
|
362 |
||
14329 | 363 |
lemma hypreal_diff: |
364 |
"Abs_hypreal(hyprel``{%n. X n}) - Abs_hypreal(hyprel``{%n. Y n}) = |
|
14299 | 365 |
Abs_hypreal(hyprel``{%n. X n - Y n})" |
14301 | 366 |
apply (simp add: hypreal_diff_def hypreal_minus hypreal_add) |
14299 | 367 |
done |
368 |
||
14301 | 369 |
lemma hypreal_add_minus [simp]: "z + -z = (0::hypreal)" |
14468 | 370 |
apply (simp add: hypreal_zero_def) |
14301 | 371 |
apply (rule_tac z = z in eq_Abs_hypreal) |
14299 | 372 |
apply (simp add: hypreal_minus hypreal_add) |
373 |
done |
|
374 |
||
14331 | 375 |
lemma hypreal_add_minus_left: "-z + z = (0::hypreal)" |
14301 | 376 |
by (simp add: hypreal_add_commute hypreal_add_minus) |
14299 | 377 |
|
14329 | 378 |
|
379 |
subsection{*Hyperreal Multiplication*} |
|
14299 | 380 |
|
381 |
lemma hypreal_mult_congruent2: |
|
382 |
"congruent2 hyprel (%X Y. hyprel``{%n. X n * Y n})" |
|
14468 | 383 |
apply (simp add: congruent2_def, auto, ultra) |
14299 | 384 |
done |
385 |
||
386 |
lemma hypreal_mult: |
|
387 |
"Abs_hypreal(hyprel``{%n. X n}) * Abs_hypreal(hyprel``{%n. Y n}) = |
|
388 |
Abs_hypreal(hyprel``{%n. X n * Y n})" |
|
14468 | 389 |
apply (simp add: hypreal_mult_def) |
14299 | 390 |
apply (simp add: UN_equiv_class2 [OF equiv_hyprel hypreal_mult_congruent2]) |
391 |
done |
|
392 |
||
393 |
lemma hypreal_mult_commute: "(z::hypreal) * w = w * z" |
|
14468 | 394 |
apply (cases z, cases w) |
14331 | 395 |
apply (simp add: hypreal_mult mult_ac) |
14299 | 396 |
done |
397 |
||
398 |
lemma hypreal_mult_assoc: "((z1::hypreal) * z2) * z3 = z1 * (z2 * z3)" |
|
14468 | 399 |
apply (cases z1, cases z2, cases z3) |
14331 | 400 |
apply (simp add: hypreal_mult mult_assoc) |
14299 | 401 |
done |
402 |
||
14331 | 403 |
lemma hypreal_mult_1: "(1::hypreal) * z = z" |
14468 | 404 |
apply (simp add: hypreal_one_def) |
14301 | 405 |
apply (rule_tac z = z in eq_Abs_hypreal) |
14299 | 406 |
apply (simp add: hypreal_mult) |
407 |
done |
|
14301 | 408 |
|
14329 | 409 |
lemma hypreal_add_mult_distrib: |
410 |
"((z1::hypreal) + z2) * w = (z1 * w) + (z2 * w)" |
|
14468 | 411 |
apply (cases z1, cases z2, cases w) |
14334 | 412 |
apply (simp add: hypreal_mult hypreal_add left_distrib) |
14299 | 413 |
done |
414 |
||
14331 | 415 |
text{*one and zero are distinct*} |
14299 | 416 |
lemma hypreal_zero_not_eq_one: "0 \<noteq> (1::hypreal)" |
14468 | 417 |
by (simp add: hypreal_zero_def hypreal_one_def) |
14299 | 418 |
|
419 |
||
14329 | 420 |
subsection{*Multiplicative Inverse on @{typ hypreal} *} |
14299 | 421 |
|
422 |
lemma hypreal_inverse_congruent: |
|
423 |
"congruent hyprel (%X. hyprel``{%n. if X n = 0 then 0 else inverse(X n)})" |
|
14468 | 424 |
apply (simp add: congruent_def) |
14301 | 425 |
apply (auto, ultra) |
14299 | 426 |
done |
427 |
||
428 |
lemma hypreal_inverse: |
|
429 |
"inverse (Abs_hypreal(hyprel``{%n. X n})) = |
|
430 |
Abs_hypreal(hyprel `` {%n. if X n = 0 then 0 else inverse(X n)})" |
|
14468 | 431 |
apply (simp add: hypreal_inverse_def) |
14301 | 432 |
apply (rule_tac f = Abs_hypreal in arg_cong) |
433 |
apply (simp add: hyprel_in_hypreal [THEN Abs_hypreal_inverse] |
|
14299 | 434 |
UN_equiv_class [OF equiv_hyprel hypreal_inverse_congruent]) |
435 |
done |
|
436 |
||
14331 | 437 |
lemma hypreal_mult_inverse: |
14299 | 438 |
"x \<noteq> 0 ==> x*inverse(x) = (1::hypreal)" |
14468 | 439 |
apply (simp add: hypreal_one_def hypreal_zero_def) |
440 |
apply (cases x) |
|
14299 | 441 |
apply (simp add: hypreal_inverse hypreal_mult) |
442 |
apply (drule FreeUltrafilterNat_Compl_mem) |
|
14334 | 443 |
apply (blast intro!: right_inverse FreeUltrafilterNat_subset) |
14299 | 444 |
done |
445 |
||
14331 | 446 |
lemma hypreal_mult_inverse_left: |
14329 | 447 |
"x \<noteq> 0 ==> inverse(x)*x = (1::hypreal)" |
14301 | 448 |
by (simp add: hypreal_mult_inverse hypreal_mult_commute) |
14299 | 449 |
|
14331 | 450 |
instance hypreal :: field |
451 |
proof |
|
452 |
fix x y z :: hypreal |
|
453 |
show "(x + y) + z = x + (y + z)" by (rule hypreal_add_assoc) |
|
454 |
show "x + y = y + x" by (rule hypreal_add_commute) |
|
455 |
show "0 + x = x" by simp |
|
456 |
show "- x + x = 0" by (simp add: hypreal_add_minus_left) |
|
457 |
show "x - y = x + (-y)" by (simp add: hypreal_diff_def) |
|
458 |
show "(x * y) * z = x * (y * z)" by (rule hypreal_mult_assoc) |
|
459 |
show "x * y = y * x" by (rule hypreal_mult_commute) |
|
460 |
show "1 * x = x" by (simp add: hypreal_mult_1) |
|
461 |
show "(x + y) * z = x * z + y * z" by (simp add: hypreal_add_mult_distrib) |
|
462 |
show "0 \<noteq> (1::hypreal)" by (rule hypreal_zero_not_eq_one) |
|
463 |
show "x \<noteq> 0 ==> inverse x * x = 1" by (simp add: hypreal_mult_inverse_left) |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
464 |
show "x / y = x * inverse y" by (simp add: hypreal_divide_def) |
14331 | 465 |
qed |
466 |
||
467 |
||
468 |
instance hypreal :: division_by_zero |
|
469 |
proof |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
470 |
show "inverse 0 = (0::hypreal)" |
14421
ee97b6463cb4
new Ring_and_Field hierarchy, eliminating redundant axioms
paulson
parents:
14387
diff
changeset
|
471 |
by (simp add: hypreal_inverse hypreal_zero_def) |
14331 | 472 |
qed |
473 |
||
14329 | 474 |
|
475 |
subsection{*Properties of The @{text "\<le>"} Relation*} |
|
14299 | 476 |
|
477 |
lemma hypreal_le: |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14361
diff
changeset
|
478 |
"(Abs_hypreal(hyprel``{%n. X n}) \<le> Abs_hypreal(hyprel``{%n. Y n})) = |
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14361
diff
changeset
|
479 |
({n. X n \<le> Y n} \<in> FreeUltrafilterNat)" |
14468 | 480 |
apply (simp add: hypreal_le_def) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
481 |
apply (auto intro!: lemma_hyprel_refl, ultra) |
14299 | 482 |
done |
483 |
||
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14361
diff
changeset
|
484 |
lemma hypreal_le_refl: "w \<le> (w::hypreal)" |
14468 | 485 |
apply (cases w) |
14370 | 486 |
apply (simp add: hypreal_le) |
14299 | 487 |
done |
488 |
||
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14361
diff
changeset
|
489 |
lemma hypreal_le_trans: "[| i \<le> j; j \<le> k |] ==> i \<le> (k::hypreal)" |
14468 | 490 |
apply (cases i, cases j, cases k) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
491 |
apply (simp add: hypreal_le, ultra) |
14299 | 492 |
done |
493 |
||
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14361
diff
changeset
|
494 |
lemma hypreal_le_anti_sym: "[| z \<le> w; w \<le> z |] ==> z = (w::hypreal)" |
14468 | 495 |
apply (cases z, cases w) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
496 |
apply (simp add: hypreal_le, ultra) |
14299 | 497 |
done |
498 |
||
499 |
(* Axiom 'order_less_le' of class 'order': *) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14361
diff
changeset
|
500 |
lemma hypreal_less_le: "((w::hypreal) < z) = (w \<le> z & w \<noteq> z)" |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
501 |
by (simp add: hypreal_less_def) |
14299 | 502 |
|
14329 | 503 |
instance hypreal :: order |
14370 | 504 |
proof qed |
505 |
(assumption | |
|
506 |
rule hypreal_le_refl hypreal_le_trans hypreal_le_anti_sym hypreal_less_le)+ |
|
507 |
||
508 |
||
509 |
(* Axiom 'linorder_linear' of class 'linorder': *) |
|
510 |
lemma hypreal_le_linear: "(z::hypreal) \<le> w | w \<le> z" |
|
14468 | 511 |
apply (cases z, cases w) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
512 |
apply (auto simp add: hypreal_le, ultra) |
14370 | 513 |
done |
14329 | 514 |
|
515 |
instance hypreal :: linorder |
|
516 |
by (intro_classes, rule hypreal_le_linear) |
|
517 |
||
14370 | 518 |
lemma hypreal_not_refl2: "!!(x::hypreal). x < y ==> x \<noteq> y" |
519 |
by (auto simp add: order_less_irrefl) |
|
14329 | 520 |
|
14370 | 521 |
lemma hypreal_add_left_mono: "x \<le> y ==> z + x \<le> z + (y::hypreal)" |
14468 | 522 |
apply (cases x, cases y, cases z) |
14370 | 523 |
apply (auto simp add: hypreal_le hypreal_add) |
14329 | 524 |
done |
525 |
||
526 |
lemma hypreal_mult_less_mono2: "[| (0::hypreal)<z; x<y |] ==> z*x<z*y" |
|
14468 | 527 |
apply (cases x, cases y, cases z) |
14370 | 528 |
apply (auto simp add: hypreal_zero_def hypreal_le hypreal_mult |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
529 |
linorder_not_le [symmetric], ultra) |
14329 | 530 |
done |
531 |
||
14370 | 532 |
|
14329 | 533 |
subsection{*The Hyperreals Form an Ordered Field*} |
534 |
||
535 |
instance hypreal :: ordered_field |
|
536 |
proof |
|
537 |
fix x y z :: hypreal |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14341
diff
changeset
|
538 |
show "x \<le> y ==> z + x \<le> z + y" |
14370 | 539 |
by (rule hypreal_add_left_mono) |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14341
diff
changeset
|
540 |
show "x < y ==> 0 < z ==> z * x < z * y" |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14341
diff
changeset
|
541 |
by (simp add: hypreal_mult_less_mono2) |
14329 | 542 |
show "\<bar>x\<bar> = (if x < 0 then -x else x)" |
543 |
by (auto dest: order_le_less_trans simp add: hrabs_def linorder_not_le) |
|
544 |
qed |
|
545 |
||
14331 | 546 |
lemma hypreal_eq_minus_iff: "((x::hypreal) = y) = (x + - y = 0)" |
547 |
apply auto |
|
548 |
apply (rule Ring_and_Field.add_right_cancel [of _ "-y", THEN iffD1], auto) |
|
549 |
done |
|
550 |
||
14329 | 551 |
lemma hypreal_mult_left_cancel: "(c::hypreal) \<noteq> 0 ==> (c*a=c*b) = (a=b)" |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
552 |
by auto |
14329 | 553 |
|
554 |
lemma hypreal_mult_right_cancel: "(c::hypreal) \<noteq> 0 ==> (a*c=b*c) = (a=b)" |
|
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
555 |
by auto |
14329 | 556 |
|
557 |
||
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
558 |
subsection{*The Embedding @{term hypreal_of_real} Preserves Field and |
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
559 |
Order Properties*} |
14329 | 560 |
|
14301 | 561 |
lemma hypreal_of_real_add [simp]: |
14369 | 562 |
"hypreal_of_real (w + z) = hypreal_of_real w + hypreal_of_real z" |
14468 | 563 |
apply (simp add: hypreal_of_real_def) |
14331 | 564 |
apply (simp add: hypreal_add left_distrib) |
14299 | 565 |
done |
566 |
||
14301 | 567 |
lemma hypreal_of_real_mult [simp]: |
14369 | 568 |
"hypreal_of_real (w * z) = hypreal_of_real w * hypreal_of_real z" |
14468 | 569 |
apply (simp add: hypreal_of_real_def) |
14331 | 570 |
apply (simp add: hypreal_mult right_distrib) |
14299 | 571 |
done |
572 |
||
14301 | 573 |
lemma hypreal_of_real_one [simp]: "hypreal_of_real 1 = (1::hypreal)" |
14468 | 574 |
by (simp add: hypreal_of_real_def hypreal_one_def) |
14299 | 575 |
|
14301 | 576 |
lemma hypreal_of_real_zero [simp]: "hypreal_of_real 0 = 0" |
14468 | 577 |
by (simp add: hypreal_of_real_def hypreal_zero_def) |
14299 | 578 |
|
14370 | 579 |
lemma hypreal_of_real_le_iff [simp]: |
580 |
"(hypreal_of_real w \<le> hypreal_of_real z) = (w \<le> z)" |
|
14468 | 581 |
apply (simp add: hypreal_le_def hypreal_of_real_def, auto) |
14369 | 582 |
apply (rule_tac [2] x = "%n. w" in exI, safe) |
583 |
apply (rule_tac [3] x = "%n. z" in exI, auto) |
|
584 |
apply (rule FreeUltrafilterNat_P, ultra) |
|
585 |
done |
|
586 |
||
14370 | 587 |
lemma hypreal_of_real_less_iff [simp]: |
588 |
"(hypreal_of_real w < hypreal_of_real z) = (w < z)" |
|
589 |
by (simp add: linorder_not_le [symmetric]) |
|
14369 | 590 |
|
591 |
lemma hypreal_of_real_eq_iff [simp]: |
|
592 |
"(hypreal_of_real w = hypreal_of_real z) = (w = z)" |
|
593 |
by (force intro: order_antisym hypreal_of_real_le_iff [THEN iffD1]) |
|
594 |
||
595 |
text{*As above, for 0*} |
|
596 |
||
597 |
declare hypreal_of_real_less_iff [of 0, simplified, simp] |
|
598 |
declare hypreal_of_real_le_iff [of 0, simplified, simp] |
|
599 |
declare hypreal_of_real_eq_iff [of 0, simplified, simp] |
|
600 |
||
601 |
declare hypreal_of_real_less_iff [of _ 0, simplified, simp] |
|
602 |
declare hypreal_of_real_le_iff [of _ 0, simplified, simp] |
|
603 |
declare hypreal_of_real_eq_iff [of _ 0, simplified, simp] |
|
604 |
||
605 |
text{*As above, for 1*} |
|
606 |
||
607 |
declare hypreal_of_real_less_iff [of 1, simplified, simp] |
|
608 |
declare hypreal_of_real_le_iff [of 1, simplified, simp] |
|
609 |
declare hypreal_of_real_eq_iff [of 1, simplified, simp] |
|
610 |
||
611 |
declare hypreal_of_real_less_iff [of _ 1, simplified, simp] |
|
612 |
declare hypreal_of_real_le_iff [of _ 1, simplified, simp] |
|
613 |
declare hypreal_of_real_eq_iff [of _ 1, simplified, simp] |
|
614 |
||
615 |
lemma hypreal_of_real_minus [simp]: |
|
616 |
"hypreal_of_real (-r) = - hypreal_of_real r" |
|
14370 | 617 |
by (auto simp add: hypreal_of_real_def hypreal_minus) |
14299 | 618 |
|
14329 | 619 |
lemma hypreal_of_real_inverse [simp]: |
620 |
"hypreal_of_real (inverse r) = inverse (hypreal_of_real r)" |
|
14370 | 621 |
apply (case_tac "r=0", simp) |
14299 | 622 |
apply (rule_tac c1 = "hypreal_of_real r" in hypreal_mult_left_cancel [THEN iffD1]) |
14369 | 623 |
apply (auto simp add: hypreal_of_real_mult [symmetric]) |
14299 | 624 |
done |
625 |
||
14329 | 626 |
lemma hypreal_of_real_divide [simp]: |
14369 | 627 |
"hypreal_of_real (w / z) = hypreal_of_real w / hypreal_of_real z" |
14301 | 628 |
by (simp add: hypreal_divide_def real_divide_def) |
14299 | 629 |
|
630 |
||
14329 | 631 |
subsection{*Misc Others*} |
14299 | 632 |
|
14370 | 633 |
lemma hypreal_less: |
634 |
"(Abs_hypreal(hyprel``{%n. X n}) < Abs_hypreal(hyprel``{%n. Y n})) = |
|
635 |
({n. X n < Y n} \<in> FreeUltrafilterNat)" |
|
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
636 |
apply (auto simp add: hypreal_le linorder_not_le [symmetric], ultra+) |
14370 | 637 |
done |
638 |
||
14299 | 639 |
lemma hypreal_zero_num: "0 = Abs_hypreal (hyprel `` {%n. 0})" |
14301 | 640 |
by (simp add: hypreal_zero_def [THEN meta_eq_to_obj_eq, symmetric]) |
14299 | 641 |
|
642 |
lemma hypreal_one_num: "1 = Abs_hypreal (hyprel `` {%n. 1})" |
|
14301 | 643 |
by (simp add: hypreal_one_def [THEN meta_eq_to_obj_eq, symmetric]) |
14299 | 644 |
|
14301 | 645 |
lemma hypreal_omega_gt_zero [simp]: "0 < omega" |
14468 | 646 |
apply (simp add: omega_def) |
14299 | 647 |
apply (auto simp add: hypreal_less hypreal_zero_num) |
648 |
done |
|
649 |
||
14329 | 650 |
lemma hypreal_hrabs: |
651 |
"abs (Abs_hypreal (hyprel `` {X})) = |
|
652 |
Abs_hypreal(hyprel `` {%n. abs (X n)})" |
|
653 |
apply (auto simp add: hrabs_def hypreal_zero_def hypreal_le hypreal_minus) |
|
654 |
apply (ultra, arith)+ |
|
655 |
done |
|
656 |
||
14370 | 657 |
|
658 |
||
659 |
lemma hypreal_add_zero_less_le_mono: "[|r < x; (0::hypreal) \<le> y|] ==> r < x+y" |
|
660 |
by (auto dest: add_less_le_mono) |
|
661 |
||
662 |
text{*The precondition could be weakened to @{term "0\<le>x"}*} |
|
663 |
lemma hypreal_mult_less_mono: |
|
664 |
"[| u<v; x<y; (0::hypreal) < v; 0 < x |] ==> u*x < v* y" |
|
665 |
by (simp add: Ring_and_Field.mult_strict_mono order_less_imp_le) |
|
666 |
||
667 |
||
668 |
subsection{*Existence of Infinite Hyperreal Number*} |
|
669 |
||
670 |
lemma Rep_hypreal_omega: "Rep_hypreal(omega) \<in> hypreal" |
|
14468 | 671 |
by (simp add: omega_def) |
14370 | 672 |
|
673 |
text{*Existence of infinite number not corresponding to any real number. |
|
674 |
Use assumption that member @{term FreeUltrafilterNat} is not finite.*} |
|
675 |
||
676 |
||
677 |
text{*A few lemmas first*} |
|
678 |
||
679 |
lemma lemma_omega_empty_singleton_disj: "{n::nat. x = real n} = {} | |
|
680 |
(\<exists>y. {n::nat. x = real n} = {y})" |
|
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
681 |
by force |
14370 | 682 |
|
683 |
lemma lemma_finite_omega_set: "finite {n::nat. x = real n}" |
|
684 |
by (cut_tac x = x in lemma_omega_empty_singleton_disj, auto) |
|
685 |
||
686 |
lemma not_ex_hypreal_of_real_eq_omega: |
|
687 |
"~ (\<exists>x. hypreal_of_real x = omega)" |
|
14468 | 688 |
apply (simp add: omega_def hypreal_of_real_def) |
14370 | 689 |
apply (auto simp add: real_of_nat_Suc diff_eq_eq [symmetric] |
690 |
lemma_finite_omega_set [THEN FreeUltrafilterNat_finite]) |
|
691 |
done |
|
692 |
||
693 |
lemma hypreal_of_real_not_eq_omega: "hypreal_of_real x \<noteq> omega" |
|
694 |
by (cut_tac not_ex_hypreal_of_real_eq_omega, auto) |
|
695 |
||
696 |
text{*Existence of infinitesimal number also not corresponding to any |
|
697 |
real number*} |
|
698 |
||
699 |
lemma lemma_epsilon_empty_singleton_disj: |
|
700 |
"{n::nat. x = inverse(real(Suc n))} = {} | |
|
701 |
(\<exists>y. {n::nat. x = inverse(real(Suc n))} = {y})" |
|
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
702 |
by auto |
14370 | 703 |
|
704 |
lemma lemma_finite_epsilon_set: "finite {n. x = inverse(real(Suc n))}" |
|
705 |
by (cut_tac x = x in lemma_epsilon_empty_singleton_disj, auto) |
|
706 |
||
707 |
lemma not_ex_hypreal_of_real_eq_epsilon: |
|
708 |
"~ (\<exists>x. hypreal_of_real x = epsilon)" |
|
14468 | 709 |
apply (simp add: epsilon_def hypreal_of_real_def) |
14370 | 710 |
apply (auto simp add: lemma_finite_epsilon_set [THEN FreeUltrafilterNat_finite]) |
711 |
done |
|
712 |
||
713 |
lemma hypreal_of_real_not_eq_epsilon: "hypreal_of_real x \<noteq> epsilon" |
|
714 |
by (cut_tac not_ex_hypreal_of_real_eq_epsilon, auto) |
|
715 |
||
716 |
lemma hypreal_epsilon_not_zero: "epsilon \<noteq> 0" |
|
14468 | 717 |
by (simp add: epsilon_def hypreal_zero_def) |
14370 | 718 |
|
719 |
lemma hypreal_epsilon_inverse_omega: "epsilon = inverse(omega)" |
|
720 |
by (simp add: hypreal_inverse omega_def epsilon_def) |
|
721 |
||
722 |
||
14299 | 723 |
ML |
724 |
{* |
|
14329 | 725 |
val hrabs_def = thm "hrabs_def"; |
726 |
val hypreal_hrabs = thm "hypreal_hrabs"; |
|
727 |
||
14299 | 728 |
val hypreal_zero_def = thm "hypreal_zero_def"; |
729 |
val hypreal_one_def = thm "hypreal_one_def"; |
|
730 |
val hypreal_minus_def = thm "hypreal_minus_def"; |
|
731 |
val hypreal_diff_def = thm "hypreal_diff_def"; |
|
732 |
val hypreal_inverse_def = thm "hypreal_inverse_def"; |
|
733 |
val hypreal_divide_def = thm "hypreal_divide_def"; |
|
734 |
val hypreal_of_real_def = thm "hypreal_of_real_def"; |
|
735 |
val omega_def = thm "omega_def"; |
|
736 |
val epsilon_def = thm "epsilon_def"; |
|
737 |
val hypreal_add_def = thm "hypreal_add_def"; |
|
738 |
val hypreal_mult_def = thm "hypreal_mult_def"; |
|
739 |
val hypreal_less_def = thm "hypreal_less_def"; |
|
740 |
val hypreal_le_def = thm "hypreal_le_def"; |
|
741 |
||
742 |
val finite_exhausts = thm "finite_exhausts"; |
|
743 |
val finite_not_covers = thm "finite_not_covers"; |
|
744 |
val not_finite_nat = thm "not_finite_nat"; |
|
745 |
val FreeUltrafilterNat_Ex = thm "FreeUltrafilterNat_Ex"; |
|
746 |
val FreeUltrafilterNat_mem = thm "FreeUltrafilterNat_mem"; |
|
747 |
val FreeUltrafilterNat_finite = thm "FreeUltrafilterNat_finite"; |
|
748 |
val FreeUltrafilterNat_not_finite = thm "FreeUltrafilterNat_not_finite"; |
|
749 |
val FreeUltrafilterNat_empty = thm "FreeUltrafilterNat_empty"; |
|
750 |
val FreeUltrafilterNat_Int = thm "FreeUltrafilterNat_Int"; |
|
751 |
val FreeUltrafilterNat_subset = thm "FreeUltrafilterNat_subset"; |
|
752 |
val FreeUltrafilterNat_Compl = thm "FreeUltrafilterNat_Compl"; |
|
753 |
val FreeUltrafilterNat_Compl_mem = thm "FreeUltrafilterNat_Compl_mem"; |
|
754 |
val FreeUltrafilterNat_Compl_iff1 = thm "FreeUltrafilterNat_Compl_iff1"; |
|
755 |
val FreeUltrafilterNat_Compl_iff2 = thm "FreeUltrafilterNat_Compl_iff2"; |
|
756 |
val FreeUltrafilterNat_UNIV = thm "FreeUltrafilterNat_UNIV"; |
|
757 |
val FreeUltrafilterNat_Nat_set = thm "FreeUltrafilterNat_Nat_set"; |
|
758 |
val FreeUltrafilterNat_Nat_set_refl = thm "FreeUltrafilterNat_Nat_set_refl"; |
|
759 |
val FreeUltrafilterNat_P = thm "FreeUltrafilterNat_P"; |
|
760 |
val FreeUltrafilterNat_Ex_P = thm "FreeUltrafilterNat_Ex_P"; |
|
761 |
val FreeUltrafilterNat_all = thm "FreeUltrafilterNat_all"; |
|
762 |
val FreeUltrafilterNat_Un = thm "FreeUltrafilterNat_Un"; |
|
763 |
val hyprel_iff = thm "hyprel_iff"; |
|
764 |
val hyprel_refl = thm "hyprel_refl"; |
|
765 |
val hyprel_sym = thm "hyprel_sym"; |
|
766 |
val hyprel_trans = thm "hyprel_trans"; |
|
767 |
val equiv_hyprel = thm "equiv_hyprel"; |
|
768 |
val hyprel_in_hypreal = thm "hyprel_in_hypreal"; |
|
769 |
val Abs_hypreal_inverse = thm "Abs_hypreal_inverse"; |
|
770 |
val inj_on_Abs_hypreal = thm "inj_on_Abs_hypreal"; |
|
771 |
val inj_Rep_hypreal = thm "inj_Rep_hypreal"; |
|
772 |
val lemma_hyprel_refl = thm "lemma_hyprel_refl"; |
|
773 |
val hypreal_empty_not_mem = thm "hypreal_empty_not_mem"; |
|
774 |
val Rep_hypreal_nonempty = thm "Rep_hypreal_nonempty"; |
|
775 |
val inj_hypreal_of_real = thm "inj_hypreal_of_real"; |
|
776 |
val eq_Abs_hypreal = thm "eq_Abs_hypreal"; |
|
777 |
val hypreal_minus_congruent = thm "hypreal_minus_congruent"; |
|
778 |
val hypreal_minus = thm "hypreal_minus"; |
|
779 |
val hypreal_add_congruent2 = thm "hypreal_add_congruent2"; |
|
780 |
val hypreal_add = thm "hypreal_add"; |
|
781 |
val hypreal_diff = thm "hypreal_diff"; |
|
782 |
val hypreal_add_commute = thm "hypreal_add_commute"; |
|
783 |
val hypreal_add_assoc = thm "hypreal_add_assoc"; |
|
784 |
val hypreal_add_zero_left = thm "hypreal_add_zero_left"; |
|
785 |
val hypreal_add_zero_right = thm "hypreal_add_zero_right"; |
|
786 |
val hypreal_add_minus = thm "hypreal_add_minus"; |
|
787 |
val hypreal_add_minus_left = thm "hypreal_add_minus_left"; |
|
788 |
val hypreal_mult_congruent2 = thm "hypreal_mult_congruent2"; |
|
789 |
val hypreal_mult = thm "hypreal_mult"; |
|
790 |
val hypreal_mult_commute = thm "hypreal_mult_commute"; |
|
791 |
val hypreal_mult_assoc = thm "hypreal_mult_assoc"; |
|
792 |
val hypreal_mult_1 = thm "hypreal_mult_1"; |
|
793 |
val hypreal_zero_not_eq_one = thm "hypreal_zero_not_eq_one"; |
|
794 |
val hypreal_inverse_congruent = thm "hypreal_inverse_congruent"; |
|
795 |
val hypreal_inverse = thm "hypreal_inverse"; |
|
796 |
val hypreal_mult_inverse = thm "hypreal_mult_inverse"; |
|
797 |
val hypreal_mult_inverse_left = thm "hypreal_mult_inverse_left"; |
|
798 |
val hypreal_mult_left_cancel = thm "hypreal_mult_left_cancel"; |
|
799 |
val hypreal_mult_right_cancel = thm "hypreal_mult_right_cancel"; |
|
800 |
val hypreal_not_refl2 = thm "hypreal_not_refl2"; |
|
801 |
val hypreal_less = thm "hypreal_less"; |
|
802 |
val hypreal_eq_minus_iff = thm "hypreal_eq_minus_iff"; |
|
803 |
val hypreal_le = thm "hypreal_le"; |
|
804 |
val hypreal_le_refl = thm "hypreal_le_refl"; |
|
805 |
val hypreal_le_linear = thm "hypreal_le_linear"; |
|
806 |
val hypreal_le_trans = thm "hypreal_le_trans"; |
|
807 |
val hypreal_le_anti_sym = thm "hypreal_le_anti_sym"; |
|
808 |
val hypreal_less_le = thm "hypreal_less_le"; |
|
809 |
val hypreal_of_real_add = thm "hypreal_of_real_add"; |
|
810 |
val hypreal_of_real_mult = thm "hypreal_of_real_mult"; |
|
811 |
val hypreal_of_real_less_iff = thm "hypreal_of_real_less_iff"; |
|
812 |
val hypreal_of_real_le_iff = thm "hypreal_of_real_le_iff"; |
|
813 |
val hypreal_of_real_eq_iff = thm "hypreal_of_real_eq_iff"; |
|
814 |
val hypreal_of_real_minus = thm "hypreal_of_real_minus"; |
|
815 |
val hypreal_of_real_one = thm "hypreal_of_real_one"; |
|
816 |
val hypreal_of_real_zero = thm "hypreal_of_real_zero"; |
|
817 |
val hypreal_of_real_inverse = thm "hypreal_of_real_inverse"; |
|
818 |
val hypreal_of_real_divide = thm "hypreal_of_real_divide"; |
|
819 |
val hypreal_zero_num = thm "hypreal_zero_num"; |
|
820 |
val hypreal_one_num = thm "hypreal_one_num"; |
|
821 |
val hypreal_omega_gt_zero = thm "hypreal_omega_gt_zero"; |
|
14370 | 822 |
|
823 |
val hypreal_add_zero_less_le_mono = thm"hypreal_add_zero_less_le_mono"; |
|
824 |
val Rep_hypreal_omega = thm"Rep_hypreal_omega"; |
|
825 |
val lemma_omega_empty_singleton_disj = thm"lemma_omega_empty_singleton_disj"; |
|
826 |
val lemma_finite_omega_set = thm"lemma_finite_omega_set"; |
|
827 |
val not_ex_hypreal_of_real_eq_omega = thm"not_ex_hypreal_of_real_eq_omega"; |
|
828 |
val hypreal_of_real_not_eq_omega = thm"hypreal_of_real_not_eq_omega"; |
|
829 |
val not_ex_hypreal_of_real_eq_epsilon = thm"not_ex_hypreal_of_real_eq_epsilon"; |
|
830 |
val hypreal_of_real_not_eq_epsilon = thm"hypreal_of_real_not_eq_epsilon"; |
|
831 |
val hypreal_epsilon_not_zero = thm"hypreal_epsilon_not_zero"; |
|
832 |
val hypreal_epsilon_inverse_omega = thm"hypreal_epsilon_inverse_omega"; |
|
14299 | 833 |
*} |
834 |
||
10751 | 835 |
end |