author | paulson |
Thu, 18 Dec 2003 15:06:24 +0100 | |
changeset 14301 | 48dc606749bd |
parent 14299 | 0b5c0b0a3eba |
child 14305 | f17ca9f6dc8c |
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 |
|
13487 | 6 |
*) |
10751 | 7 |
|
14299 | 8 |
theory HyperDef = Filter + Real |
9 |
files ("fuf.ML"): (*Warning: file fuf.ML refers to the name Hyperdef!*) |
|
10751 | 10 |
|
11 |
||
12 |
constdefs |
|
14299 | 13 |
|
14 |
FreeUltrafilterNat :: "nat set set" ("\\<U>") |
|
15 |
"FreeUltrafilterNat == (SOME U. U \<in> FreeUltrafilter (UNIV:: nat set))" |
|
16 |
||
17 |
hyprel :: "((nat=>real)*(nat=>real)) set" |
|
18 |
"hyprel == {p. \<exists>X Y. p = ((X::nat=>real),Y) & |
|
10751 | 19 |
{n::nat. X(n) = Y(n)}: FreeUltrafilterNat}" |
20 |
||
14299 | 21 |
typedef hypreal = "UNIV//hyprel" |
22 |
by (auto simp add: quotient_def) |
|
10751 | 23 |
|
14299 | 24 |
instance hypreal :: ord .. |
25 |
instance hypreal :: zero .. |
|
26 |
instance hypreal :: one .. |
|
27 |
instance hypreal :: plus .. |
|
28 |
instance hypreal :: times .. |
|
29 |
instance hypreal :: minus .. |
|
30 |
instance hypreal :: inverse .. |
|
10751 | 31 |
|
32 |
||
14299 | 33 |
defs (overloaded) |
34 |
||
35 |
hypreal_zero_def: |
|
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11713
diff
changeset
|
36 |
"0 == Abs_hypreal(hyprel``{%n::nat. (0::real)})" |
10751 | 37 |
|
14299 | 38 |
hypreal_one_def: |
12018
ec054019c910
Numerals and simprocs for types real and hypreal. The abstract
paulson
parents:
11713
diff
changeset
|
39 |
"1 == Abs_hypreal(hyprel``{%n::nat. (1::real)})" |
10751 | 40 |
|
14299 | 41 |
hypreal_minus_def: |
42 |
"- P == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). hyprel``{%n::nat. - (X n)})" |
|
10751 | 43 |
|
14299 | 44 |
hypreal_diff_def: |
10751 | 45 |
"x - y == x + -(y::hypreal)" |
46 |
||
14299 | 47 |
hypreal_inverse_def: |
48 |
"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
|
49 |
hyprel``{%n. if X n = 0 then 0 else inverse (X n)})" |
10751 | 50 |
|
14299 | 51 |
hypreal_divide_def: |
10751 | 52 |
"P / Q::hypreal == P * inverse Q" |
13487 | 53 |
|
10751 | 54 |
constdefs |
55 |
||
14299 | 56 |
hypreal_of_real :: "real => hypreal" |
10834 | 57 |
"hypreal_of_real r == Abs_hypreal(hyprel``{%n::nat. r})" |
10751 | 58 |
|
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
59 |
omega :: hypreal (*an infinite number = [<1,2,3,...>] *) |
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
60 |
"omega == Abs_hypreal(hyprel``{%n::nat. real (Suc n)})" |
13487 | 61 |
|
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
62 |
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
|
63 |
"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
|
64 |
|
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
65 |
syntax (xsymbols) |
14299 | 66 |
omega :: hypreal ("\<omega>") |
67 |
epsilon :: hypreal ("\<epsilon>") |
|
10919
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
paulson
parents:
10834
diff
changeset
|
68 |
|
10751 | 69 |
|
13487 | 70 |
defs |
71 |
||
14299 | 72 |
hypreal_add_def: |
73 |
"P + Q == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). \<Union>Y \<in> Rep_hypreal(Q). |
|
10834 | 74 |
hyprel``{%n::nat. X n + Y n})" |
10751 | 75 |
|
14299 | 76 |
hypreal_mult_def: |
77 |
"P * Q == Abs_hypreal(\<Union>X \<in> Rep_hypreal(P). \<Union>Y \<in> Rep_hypreal(Q). |
|
10834 | 78 |
hyprel``{%n::nat. X n * Y n})" |
10751 | 79 |
|
14299 | 80 |
hypreal_less_def: |
81 |
"P < (Q::hypreal) == \<exists>X Y. X \<in> Rep_hypreal(P) & |
|
82 |
Y \<in> Rep_hypreal(Q) & |
|
83 |
{n::nat. X n < Y n} \<in> FreeUltrafilterNat" |
|
84 |
hypreal_le_def: |
|
13487 | 85 |
"P <= (Q::hypreal) == ~(Q < P)" |
10751 | 86 |
|
14299 | 87 |
(*------------------------------------------------------------------------ |
88 |
Proof that the set of naturals is not finite |
|
89 |
------------------------------------------------------------------------*) |
|
90 |
||
91 |
(*** based on James' proof that the set of naturals is not finite ***) |
|
92 |
lemma finite_exhausts [rule_format (no_asm)]: "finite (A::nat set) --> (\<exists>n. \<forall>m. Suc (n + m) \<notin> A)" |
|
93 |
apply (rule impI) |
|
14301 | 94 |
apply (erule_tac F = A in finite_induct) |
95 |
apply (blast, erule exE) |
|
14299 | 96 |
apply (rule_tac x = "n + x" in exI) |
14301 | 97 |
apply (rule allI, erule_tac x = "x + m" in allE) |
14299 | 98 |
apply (auto simp add: add_ac) |
99 |
done |
|
100 |
||
101 |
lemma finite_not_covers [rule_format (no_asm)]: "finite (A :: nat set) --> (\<exists>n. n \<notin>A)" |
|
14301 | 102 |
by (rule impI, drule finite_exhausts, blast) |
14299 | 103 |
|
104 |
lemma not_finite_nat: "~ finite(UNIV:: nat set)" |
|
14301 | 105 |
by (fast dest!: finite_exhausts) |
14299 | 106 |
|
107 |
(*------------------------------------------------------------------------ |
|
108 |
Existence of free ultrafilter over the naturals and proof of various |
|
109 |
properties of the FreeUltrafilterNat- an arbitrary free ultrafilter |
|
110 |
------------------------------------------------------------------------*) |
|
111 |
||
112 |
lemma FreeUltrafilterNat_Ex: "\<exists>U. U: FreeUltrafilter (UNIV::nat set)" |
|
14301 | 113 |
by (rule not_finite_nat [THEN FreeUltrafilter_Ex]) |
14299 | 114 |
|
14301 | 115 |
lemma FreeUltrafilterNat_mem [simp]: |
14299 | 116 |
"FreeUltrafilterNat: FreeUltrafilter(UNIV:: nat set)" |
117 |
apply (unfold FreeUltrafilterNat_def) |
|
118 |
apply (rule FreeUltrafilterNat_Ex [THEN exE]) |
|
14301 | 119 |
apply (rule someI2, assumption+) |
14299 | 120 |
done |
121 |
||
122 |
lemma FreeUltrafilterNat_finite: "finite x ==> x \<notin> FreeUltrafilterNat" |
|
123 |
apply (unfold FreeUltrafilterNat_def) |
|
124 |
apply (rule FreeUltrafilterNat_Ex [THEN exE]) |
|
14301 | 125 |
apply (rule someI2, assumption) |
14299 | 126 |
apply (blast dest: mem_FreeUltrafiltersetD1) |
127 |
done |
|
128 |
||
129 |
lemma FreeUltrafilterNat_not_finite: "x: FreeUltrafilterNat ==> ~ finite x" |
|
14301 | 130 |
by (blast dest: FreeUltrafilterNat_finite) |
14299 | 131 |
|
14301 | 132 |
lemma FreeUltrafilterNat_empty [simp]: "{} \<notin> FreeUltrafilterNat" |
14299 | 133 |
apply (unfold FreeUltrafilterNat_def) |
134 |
apply (rule FreeUltrafilterNat_Ex [THEN exE]) |
|
14301 | 135 |
apply (rule someI2, assumption) |
136 |
apply (blast dest: FreeUltrafilter_Ultrafilter Ultrafilter_Filter |
|
137 |
Filter_empty_not_mem) |
|
14299 | 138 |
done |
139 |
||
140 |
lemma FreeUltrafilterNat_Int: "[| X: FreeUltrafilterNat; Y: FreeUltrafilterNat |] |
|
141 |
==> X Int Y \<in> FreeUltrafilterNat" |
|
142 |
apply (cut_tac FreeUltrafilterNat_mem) |
|
143 |
apply (blast dest: FreeUltrafilter_Ultrafilter Ultrafilter_Filter mem_FiltersetD1) |
|
144 |
done |
|
145 |
||
146 |
lemma FreeUltrafilterNat_subset: "[| X: FreeUltrafilterNat; X <= Y |] |
|
147 |
==> Y \<in> FreeUltrafilterNat" |
|
148 |
apply (cut_tac FreeUltrafilterNat_mem) |
|
149 |
apply (blast dest: FreeUltrafilter_Ultrafilter Ultrafilter_Filter mem_FiltersetD2) |
|
150 |
done |
|
151 |
||
152 |
lemma FreeUltrafilterNat_Compl: "X: FreeUltrafilterNat ==> -X \<notin> FreeUltrafilterNat" |
|
14301 | 153 |
apply safe |
154 |
apply (drule FreeUltrafilterNat_Int, assumption, auto) |
|
14299 | 155 |
done |
156 |
||
157 |
lemma FreeUltrafilterNat_Compl_mem: "X\<notin> FreeUltrafilterNat ==> -X \<in> FreeUltrafilterNat" |
|
158 |
apply (cut_tac FreeUltrafilterNat_mem [THEN FreeUltrafilter_iff [THEN iffD1]]) |
|
14301 | 159 |
apply (safe, drule_tac x = X in bspec) |
14299 | 160 |
apply (auto simp add: UNIV_diff_Compl) |
161 |
done |
|
162 |
||
163 |
lemma FreeUltrafilterNat_Compl_iff1: "(X \<notin> FreeUltrafilterNat) = (-X: FreeUltrafilterNat)" |
|
14301 | 164 |
by (blast dest: FreeUltrafilterNat_Compl FreeUltrafilterNat_Compl_mem) |
14299 | 165 |
|
166 |
lemma FreeUltrafilterNat_Compl_iff2: "(X: FreeUltrafilterNat) = (-X \<notin> FreeUltrafilterNat)" |
|
14301 | 167 |
by (auto simp add: FreeUltrafilterNat_Compl_iff1 [symmetric]) |
14299 | 168 |
|
14301 | 169 |
lemma FreeUltrafilterNat_UNIV [simp]: "(UNIV::nat set) \<in> FreeUltrafilterNat" |
170 |
by (rule FreeUltrafilterNat_mem [THEN FreeUltrafilter_Ultrafilter, THEN Ultrafilter_Filter, THEN mem_FiltersetD4]) |
|
14299 | 171 |
|
14301 | 172 |
lemma FreeUltrafilterNat_Nat_set [simp]: "UNIV \<in> FreeUltrafilterNat" |
173 |
by auto |
|
14299 | 174 |
|
14301 | 175 |
lemma FreeUltrafilterNat_Nat_set_refl [intro]: "{n. P(n) = P(n)} \<in> FreeUltrafilterNat" |
176 |
by simp |
|
14299 | 177 |
|
178 |
lemma FreeUltrafilterNat_P: "{n::nat. P} \<in> FreeUltrafilterNat ==> P" |
|
14301 | 179 |
by (rule ccontr, simp) |
14299 | 180 |
|
181 |
lemma FreeUltrafilterNat_Ex_P: "{n. P(n)} \<in> FreeUltrafilterNat ==> \<exists>n. P(n)" |
|
14301 | 182 |
by (rule ccontr, simp) |
14299 | 183 |
|
184 |
lemma FreeUltrafilterNat_all: "\<forall>n. P(n) ==> {n. P(n)} \<in> FreeUltrafilterNat" |
|
14301 | 185 |
by (auto intro: FreeUltrafilterNat_Nat_set) |
14299 | 186 |
|
187 |
(*------------------------------------------------------- |
|
188 |
Define and use Ultrafilter tactics |
|
189 |
-------------------------------------------------------*) |
|
190 |
use "fuf.ML" |
|
191 |
||
192 |
method_setup fuf = {* |
|
193 |
Method.ctxt_args (fn ctxt => |
|
194 |
Method.METHOD (fn facts => |
|
195 |
fuf_tac (Classical.get_local_claset ctxt, |
|
196 |
Simplifier.get_local_simpset ctxt) 1)) *} |
|
197 |
"free ultrafilter tactic" |
|
198 |
||
199 |
method_setup ultra = {* |
|
200 |
Method.ctxt_args (fn ctxt => |
|
201 |
Method.METHOD (fn facts => |
|
202 |
ultra_tac (Classical.get_local_claset ctxt, |
|
203 |
Simplifier.get_local_simpset ctxt) 1)) *} |
|
204 |
"ultrafilter tactic" |
|
205 |
||
206 |
||
207 |
(*------------------------------------------------------- |
|
208 |
Now prove one further property of our free ultrafilter |
|
209 |
-------------------------------------------------------*) |
|
210 |
lemma FreeUltrafilterNat_Un: "X Un Y: FreeUltrafilterNat |
|
211 |
==> X: FreeUltrafilterNat | Y: FreeUltrafilterNat" |
|
212 |
apply auto |
|
14301 | 213 |
apply ultra |
14299 | 214 |
done |
215 |
||
216 |
(*------------------------------------------------------- |
|
217 |
Properties of hyprel |
|
218 |
-------------------------------------------------------*) |
|
219 |
||
220 |
(** Proving that hyprel is an equivalence relation **) |
|
221 |
(** Natural deduction for hyprel **) |
|
222 |
||
223 |
lemma hyprel_iff: "((X,Y): hyprel) = ({n. X n = Y n}: FreeUltrafilterNat)" |
|
14301 | 224 |
by (unfold hyprel_def, fast) |
14299 | 225 |
|
226 |
lemma hyprel_refl: "(x,x): hyprel" |
|
227 |
apply (unfold hyprel_def) |
|
228 |
apply (auto simp add: FreeUltrafilterNat_Nat_set) |
|
229 |
done |
|
230 |
||
231 |
lemma hyprel_sym [rule_format (no_asm)]: "(x,y): hyprel --> (y,x):hyprel" |
|
14301 | 232 |
by (simp add: hyprel_def eq_commute) |
14299 | 233 |
|
234 |
lemma hyprel_trans: |
|
235 |
"[|(x,y): hyprel; (y,z):hyprel|] ==> (x,z):hyprel" |
|
14301 | 236 |
apply (unfold hyprel_def, auto, ultra) |
14299 | 237 |
done |
238 |
||
239 |
lemma equiv_hyprel: "equiv UNIV hyprel" |
|
240 |
apply (simp add: equiv_def refl_def sym_def trans_def hyprel_refl) |
|
241 |
apply (blast intro: hyprel_sym hyprel_trans) |
|
242 |
done |
|
243 |
||
244 |
(* (hyprel `` {x} = hyprel `` {y}) = ((x,y) \<in> hyprel) *) |
|
245 |
lemmas equiv_hyprel_iff = |
|
246 |
eq_equiv_class_iff [OF equiv_hyprel UNIV_I UNIV_I, simp] |
|
247 |
||
14301 | 248 |
lemma hyprel_in_hypreal [simp]: "hyprel``{x}:hypreal" |
249 |
by (unfold hypreal_def hyprel_def quotient_def, blast) |
|
14299 | 250 |
|
251 |
lemma inj_on_Abs_hypreal: "inj_on Abs_hypreal hypreal" |
|
252 |
apply (rule inj_on_inverseI) |
|
253 |
apply (erule Abs_hypreal_inverse) |
|
254 |
done |
|
255 |
||
256 |
declare inj_on_Abs_hypreal [THEN inj_on_iff, simp] |
|
14301 | 257 |
Abs_hypreal_inverse [simp] |
14299 | 258 |
|
259 |
declare equiv_hyprel [THEN eq_equiv_class_iff, simp] |
|
260 |
||
261 |
declare hyprel_iff [iff] |
|
262 |
||
263 |
lemmas eq_hyprelD = eq_equiv_class [OF _ equiv_hyprel] |
|
264 |
||
265 |
lemma inj_Rep_hypreal: "inj(Rep_hypreal)" |
|
266 |
apply (rule inj_on_inverseI) |
|
267 |
apply (rule Rep_hypreal_inverse) |
|
268 |
done |
|
269 |
||
14301 | 270 |
lemma lemma_hyprel_refl [simp]: "x \<in> hyprel `` {x}" |
271 |
apply (unfold hyprel_def, safe) |
|
14299 | 272 |
apply (auto intro!: FreeUltrafilterNat_Nat_set) |
273 |
done |
|
274 |
||
14301 | 275 |
lemma hypreal_empty_not_mem [simp]: "{} \<notin> hypreal" |
14299 | 276 |
apply (unfold hypreal_def) |
277 |
apply (auto elim!: quotientE equalityCE) |
|
278 |
done |
|
279 |
||
14301 | 280 |
lemma Rep_hypreal_nonempty [simp]: "Rep_hypreal x \<noteq> {}" |
281 |
by (cut_tac x = x in Rep_hypreal, auto) |
|
14299 | 282 |
|
283 |
||
284 |
(*------------------------------------------------------------------------ |
|
285 |
hypreal_of_real: the injection from real to hypreal |
|
286 |
------------------------------------------------------------------------*) |
|
287 |
||
288 |
lemma inj_hypreal_of_real: "inj(hypreal_of_real)" |
|
289 |
apply (rule inj_onI) |
|
290 |
apply (unfold hypreal_of_real_def) |
|
291 |
apply (drule inj_on_Abs_hypreal [THEN inj_onD]) |
|
292 |
apply (rule hyprel_in_hypreal)+ |
|
293 |
apply (drule eq_equiv_class) |
|
294 |
apply (rule equiv_hyprel) |
|
295 |
apply (simp_all add: split: split_if_asm) |
|
296 |
done |
|
297 |
||
298 |
lemma eq_Abs_hypreal: |
|
299 |
"(!!x y. z = Abs_hypreal(hyprel``{x}) ==> P) ==> P" |
|
300 |
apply (rule_tac x1=z in Rep_hypreal [unfolded hypreal_def, THEN quotientE]) |
|
14301 | 301 |
apply (drule_tac f = Abs_hypreal in arg_cong) |
14299 | 302 |
apply (force simp add: Rep_hypreal_inverse) |
303 |
done |
|
304 |
||
305 |
(**** hypreal_minus: additive inverse on hypreal ****) |
|
306 |
||
307 |
lemma hypreal_minus_congruent: |
|
308 |
"congruent hyprel (%X. hyprel``{%n. - (X n)})" |
|
309 |
by (force simp add: congruent_def) |
|
310 |
||
311 |
lemma hypreal_minus: |
|
312 |
"- (Abs_hypreal(hyprel``{%n. X n})) = Abs_hypreal(hyprel `` {%n. -(X n)})" |
|
313 |
apply (unfold hypreal_minus_def) |
|
14301 | 314 |
apply (rule_tac f = Abs_hypreal in arg_cong) |
315 |
apply (simp add: hyprel_in_hypreal [THEN Abs_hypreal_inverse] |
|
14299 | 316 |
UN_equiv_class [OF equiv_hyprel hypreal_minus_congruent]) |
317 |
done |
|
318 |
||
14301 | 319 |
lemma hypreal_minus_minus [simp]: "- (- z) = (z::hypreal)" |
320 |
apply (rule_tac z = z in eq_Abs_hypreal) |
|
321 |
apply (simp add: hypreal_minus) |
|
14299 | 322 |
done |
323 |
||
324 |
lemma inj_hypreal_minus: "inj(%r::hypreal. -r)" |
|
325 |
apply (rule inj_onI) |
|
14301 | 326 |
apply (drule_tac f = uminus in arg_cong) |
14299 | 327 |
apply (simp add: hypreal_minus_minus) |
328 |
done |
|
329 |
||
14301 | 330 |
lemma hypreal_minus_zero [simp]: "- 0 = (0::hypreal)" |
14299 | 331 |
apply (unfold hypreal_zero_def) |
14301 | 332 |
apply (simp add: hypreal_minus) |
14299 | 333 |
done |
334 |
||
14301 | 335 |
lemma hypreal_minus_zero_iff [simp]: "(-x = 0) = (x = (0::hypreal))" |
336 |
apply (rule_tac z = x in eq_Abs_hypreal) |
|
14299 | 337 |
apply (auto simp add: hypreal_zero_def hypreal_minus) |
338 |
done |
|
339 |
||
340 |
||
341 |
(**** hyperreal addition: hypreal_add ****) |
|
342 |
||
343 |
lemma hypreal_add_congruent2: |
|
344 |
"congruent2 hyprel (%X Y. hyprel``{%n. X n + Y n})" |
|
14301 | 345 |
apply (unfold congruent2_def, auto, ultra) |
14299 | 346 |
done |
347 |
||
348 |
lemma hypreal_add: |
|
349 |
"Abs_hypreal(hyprel``{%n. X n}) + Abs_hypreal(hyprel``{%n. Y n}) = |
|
350 |
Abs_hypreal(hyprel``{%n. X n + Y n})" |
|
351 |
apply (unfold hypreal_add_def) |
|
352 |
apply (simp add: UN_equiv_class2 [OF equiv_hyprel hypreal_add_congruent2]) |
|
353 |
done |
|
354 |
||
355 |
lemma hypreal_diff: "Abs_hypreal(hyprel``{%n. X n}) - Abs_hypreal(hyprel``{%n. Y n}) = |
|
356 |
Abs_hypreal(hyprel``{%n. X n - Y n})" |
|
14301 | 357 |
apply (simp add: hypreal_diff_def hypreal_minus hypreal_add) |
14299 | 358 |
done |
359 |
||
360 |
lemma hypreal_add_commute: "(z::hypreal) + w = w + z" |
|
14301 | 361 |
apply (rule_tac z = z in eq_Abs_hypreal) |
362 |
apply (rule_tac z = w in eq_Abs_hypreal) |
|
363 |
apply (simp add: real_add_ac hypreal_add) |
|
14299 | 364 |
done |
365 |
||
366 |
lemma hypreal_add_assoc: "((z1::hypreal) + z2) + z3 = z1 + (z2 + z3)" |
|
14301 | 367 |
apply (rule_tac z = z1 in eq_Abs_hypreal) |
368 |
apply (rule_tac z = z2 in eq_Abs_hypreal) |
|
369 |
apply (rule_tac z = z3 in eq_Abs_hypreal) |
|
370 |
apply (simp add: hypreal_add real_add_assoc) |
|
14299 | 371 |
done |
372 |
||
373 |
(*For AC rewriting*) |
|
374 |
lemma hypreal_add_left_commute: "(x::hypreal)+(y+z)=y+(x+z)" |
|
375 |
apply (rule mk_left_commute [of "op +"]) |
|
376 |
apply (rule hypreal_add_assoc) |
|
377 |
apply (rule hypreal_add_commute) |
|
378 |
done |
|
379 |
||
380 |
(* hypreal addition is an AC operator *) |
|
381 |
lemmas hypreal_add_ac = |
|
382 |
hypreal_add_assoc hypreal_add_commute hypreal_add_left_commute |
|
383 |
||
14301 | 384 |
lemma hypreal_add_zero_left [simp]: "(0::hypreal) + z = z" |
14299 | 385 |
apply (unfold hypreal_zero_def) |
14301 | 386 |
apply (rule_tac z = z in eq_Abs_hypreal) |
14299 | 387 |
apply (simp add: hypreal_add) |
388 |
done |
|
389 |
||
14301 | 390 |
lemma hypreal_add_zero_right [simp]: "z + (0::hypreal) = z" |
391 |
by (simp add: hypreal_add_zero_left hypreal_add_commute) |
|
14299 | 392 |
|
14301 | 393 |
lemma hypreal_add_minus [simp]: "z + -z = (0::hypreal)" |
14299 | 394 |
apply (unfold hypreal_zero_def) |
14301 | 395 |
apply (rule_tac z = z in eq_Abs_hypreal) |
14299 | 396 |
apply (simp add: hypreal_minus hypreal_add) |
397 |
done |
|
398 |
||
14301 | 399 |
lemma hypreal_add_minus_left [simp]: "-z + z = (0::hypreal)" |
400 |
by (simp add: hypreal_add_commute hypreal_add_minus) |
|
14299 | 401 |
|
402 |
lemma hypreal_minus_ex: "\<exists>y. (x::hypreal) + y = 0" |
|
14301 | 403 |
by (fast intro: hypreal_add_minus) |
14299 | 404 |
|
405 |
lemma hypreal_minus_ex1: "EX! y. (x::hypreal) + y = 0" |
|
406 |
apply (auto intro: hypreal_add_minus) |
|
407 |
apply (drule_tac f = "%x. ya+x" in arg_cong) |
|
408 |
apply (simp add: hypreal_add_assoc [symmetric]) |
|
409 |
apply (simp add: hypreal_add_commute) |
|
410 |
done |
|
411 |
||
412 |
lemma hypreal_minus_left_ex1: "EX! y. y + (x::hypreal) = 0" |
|
413 |
apply (auto intro: hypreal_add_minus_left) |
|
414 |
apply (drule_tac f = "%x. x+ya" in arg_cong) |
|
415 |
apply (simp add: hypreal_add_assoc) |
|
416 |
apply (simp add: hypreal_add_commute) |
|
417 |
done |
|
418 |
||
419 |
lemma hypreal_add_minus_eq_minus: "x + y = (0::hypreal) ==> x = -y" |
|
14301 | 420 |
apply (cut_tac z = y in hypreal_add_minus_left) |
421 |
apply (rule_tac x1 = y in hypreal_minus_left_ex1 [THEN ex1E], blast) |
|
14299 | 422 |
done |
423 |
||
424 |
lemma hypreal_as_add_inverse_ex: "\<exists>y::hypreal. x = -y" |
|
14301 | 425 |
apply (cut_tac x = x in hypreal_minus_ex) |
426 |
apply (erule exE, drule hypreal_add_minus_eq_minus, fast) |
|
14299 | 427 |
done |
428 |
||
14301 | 429 |
lemma hypreal_minus_add_distrib [simp]: "-(x + (y::hypreal)) = -x + -y" |
430 |
apply (rule_tac z = x in eq_Abs_hypreal) |
|
431 |
apply (rule_tac z = y in eq_Abs_hypreal) |
|
14299 | 432 |
apply (auto simp add: hypreal_minus hypreal_add real_minus_add_distrib) |
433 |
done |
|
434 |
||
435 |
lemma hypreal_minus_distrib1: "-(y + -(x::hypreal)) = x + -y" |
|
14301 | 436 |
by (simp add: hypreal_add_commute) |
14299 | 437 |
|
438 |
lemma hypreal_add_left_cancel: "((x::hypreal) + y = x + z) = (y = z)" |
|
14301 | 439 |
apply safe |
14299 | 440 |
apply (drule_tac f = "%t.-x + t" in arg_cong) |
441 |
apply (simp add: hypreal_add_assoc [symmetric]) |
|
442 |
done |
|
443 |
||
444 |
lemma hypreal_add_right_cancel: "(y + (x::hypreal)= z + x) = (y = z)" |
|
14301 | 445 |
by (simp add: hypreal_add_commute hypreal_add_left_cancel) |
14299 | 446 |
|
14301 | 447 |
lemma hypreal_add_minus_cancelA [simp]: "z + ((- z) + w) = (w::hypreal)" |
448 |
by (simp add: hypreal_add_assoc [symmetric]) |
|
14299 | 449 |
|
14301 | 450 |
lemma hypreal_minus_add_cancelA [simp]: "(-z) + (z + w) = (w::hypreal)" |
451 |
by (simp add: hypreal_add_assoc [symmetric]) |
|
14299 | 452 |
|
453 |
(**** hyperreal multiplication: hypreal_mult ****) |
|
454 |
||
455 |
lemma hypreal_mult_congruent2: |
|
456 |
"congruent2 hyprel (%X Y. hyprel``{%n. X n * Y n})" |
|
14301 | 457 |
apply (unfold congruent2_def, auto, ultra) |
14299 | 458 |
done |
459 |
||
460 |
lemma hypreal_mult: |
|
461 |
"Abs_hypreal(hyprel``{%n. X n}) * Abs_hypreal(hyprel``{%n. Y n}) = |
|
462 |
Abs_hypreal(hyprel``{%n. X n * Y n})" |
|
463 |
apply (unfold hypreal_mult_def) |
|
464 |
apply (simp add: UN_equiv_class2 [OF equiv_hyprel hypreal_mult_congruent2]) |
|
465 |
done |
|
466 |
||
467 |
lemma hypreal_mult_commute: "(z::hypreal) * w = w * z" |
|
14301 | 468 |
apply (rule_tac z = z in eq_Abs_hypreal) |
469 |
apply (rule_tac z = w in eq_Abs_hypreal) |
|
470 |
apply (simp add: hypreal_mult real_mult_ac) |
|
14299 | 471 |
done |
472 |
||
473 |
lemma hypreal_mult_assoc: "((z1::hypreal) * z2) * z3 = z1 * (z2 * z3)" |
|
14301 | 474 |
apply (rule_tac z = z1 in eq_Abs_hypreal) |
475 |
apply (rule_tac z = z2 in eq_Abs_hypreal) |
|
476 |
apply (rule_tac z = z3 in eq_Abs_hypreal) |
|
477 |
apply (simp add: hypreal_mult real_mult_assoc) |
|
14299 | 478 |
done |
479 |
||
480 |
lemma hypreal_mult_left_commute: "(z1::hypreal) * (z2 * z3) = z2 * (z1 * z3)" |
|
481 |
apply (rule mk_left_commute [of "op *"]) |
|
482 |
apply (rule hypreal_mult_assoc) |
|
483 |
apply (rule hypreal_mult_commute) |
|
484 |
done |
|
485 |
||
486 |
(* hypreal multiplication is an AC operator *) |
|
487 |
lemmas hypreal_mult_ac = |
|
488 |
hypreal_mult_assoc hypreal_mult_commute hypreal_mult_left_commute |
|
489 |
||
14301 | 490 |
lemma hypreal_mult_1 [simp]: "(1::hypreal) * z = z" |
14299 | 491 |
apply (unfold hypreal_one_def) |
14301 | 492 |
apply (rule_tac z = z in eq_Abs_hypreal) |
14299 | 493 |
apply (simp add: hypreal_mult) |
494 |
done |
|
14301 | 495 |
|
496 |
lemma hypreal_mult_1_right [simp]: "z * (1::hypreal) = z" |
|
497 |
by (simp add: hypreal_mult_commute hypreal_mult_1) |
|
14299 | 498 |
|
14301 | 499 |
lemma hypreal_mult_0 [simp]: "0 * z = (0::hypreal)" |
14299 | 500 |
apply (unfold hypreal_zero_def) |
14301 | 501 |
apply (rule_tac z = z in eq_Abs_hypreal) |
14299 | 502 |
apply (simp add: hypreal_mult) |
503 |
done |
|
504 |
||
14301 | 505 |
lemma hypreal_mult_0_right [simp]: "z * 0 = (0::hypreal)" |
506 |
by (simp add: hypreal_mult_commute) |
|
14299 | 507 |
|
508 |
lemma hypreal_minus_mult_eq1: "-(x * y) = -x * (y::hypreal)" |
|
14301 | 509 |
apply (rule_tac z = x in eq_Abs_hypreal) |
510 |
apply (rule_tac z = y in eq_Abs_hypreal) |
|
14299 | 511 |
apply (auto simp add: hypreal_minus hypreal_mult real_mult_ac real_add_ac) |
512 |
done |
|
513 |
||
514 |
lemma hypreal_minus_mult_eq2: "-(x * y) = (x::hypreal) * -y" |
|
14301 | 515 |
apply (rule_tac z = x in eq_Abs_hypreal) |
516 |
apply (rule_tac z = y in eq_Abs_hypreal) |
|
14299 | 517 |
apply (auto simp add: hypreal_minus hypreal_mult real_mult_ac real_add_ac) |
518 |
done |
|
519 |
||
520 |
(*Pull negations out*) |
|
14301 | 521 |
declare hypreal_minus_mult_eq2 [symmetric, simp] |
522 |
hypreal_minus_mult_eq1 [symmetric, simp] |
|
14299 | 523 |
|
14301 | 524 |
lemma hypreal_mult_minus_1 [simp]: "(- (1::hypreal)) * z = -z" |
525 |
by simp |
|
14299 | 526 |
|
14301 | 527 |
lemma hypreal_mult_minus_1_right [simp]: "z * (- (1::hypreal)) = -z" |
528 |
by (subst hypreal_mult_commute, simp) |
|
14299 | 529 |
|
530 |
lemma hypreal_minus_mult_commute: "(-x) * y = (x::hypreal) * -y" |
|
14301 | 531 |
by auto |
14299 | 532 |
|
533 |
(*----------------------------------------------------------------------------- |
|
534 |
A few more theorems |
|
535 |
----------------------------------------------------------------------------*) |
|
536 |
lemma hypreal_add_assoc_cong: "(z::hypreal) + v = z' + v' ==> z + (v + w) = z' + (v' + w)" |
|
14301 | 537 |
by (simp add: hypreal_add_assoc [symmetric]) |
14299 | 538 |
|
539 |
lemma hypreal_add_mult_distrib: "((z1::hypreal) + z2) * w = (z1 * w) + (z2 * w)" |
|
14301 | 540 |
apply (rule_tac z = z1 in eq_Abs_hypreal) |
541 |
apply (rule_tac z = z2 in eq_Abs_hypreal) |
|
542 |
apply (rule_tac z = w in eq_Abs_hypreal) |
|
543 |
apply (simp add: hypreal_mult hypreal_add real_add_mult_distrib) |
|
14299 | 544 |
done |
545 |
||
546 |
lemma hypreal_add_mult_distrib2: "(w::hypreal) * (z1 + z2) = (w * z1) + (w * z2)" |
|
14301 | 547 |
by (simp add: hypreal_mult_commute [of w] hypreal_add_mult_distrib) |
14299 | 548 |
|
549 |
||
550 |
lemma hypreal_diff_mult_distrib: "((z1::hypreal) - z2) * w = (z1 * w) - (z2 * w)" |
|
551 |
||
552 |
apply (unfold hypreal_diff_def) |
|
14301 | 553 |
apply (simp add: hypreal_add_mult_distrib) |
14299 | 554 |
done |
555 |
||
556 |
lemma hypreal_diff_mult_distrib2: "(w::hypreal) * (z1 - z2) = (w * z1) - (w * z2)" |
|
14301 | 557 |
by (simp add: hypreal_mult_commute [of w] hypreal_diff_mult_distrib) |
14299 | 558 |
|
559 |
(*** one and zero are distinct ***) |
|
560 |
lemma hypreal_zero_not_eq_one: "0 \<noteq> (1::hypreal)" |
|
561 |
apply (unfold hypreal_zero_def hypreal_one_def) |
|
562 |
apply (auto simp add: real_zero_not_eq_one) |
|
563 |
done |
|
564 |
||
565 |
||
566 |
(**** multiplicative inverse on hypreal ****) |
|
567 |
||
568 |
lemma hypreal_inverse_congruent: |
|
569 |
"congruent hyprel (%X. hyprel``{%n. if X n = 0 then 0 else inverse(X n)})" |
|
570 |
apply (unfold congruent_def) |
|
14301 | 571 |
apply (auto, ultra) |
14299 | 572 |
done |
573 |
||
574 |
lemma hypreal_inverse: |
|
575 |
"inverse (Abs_hypreal(hyprel``{%n. X n})) = |
|
576 |
Abs_hypreal(hyprel `` {%n. if X n = 0 then 0 else inverse(X n)})" |
|
577 |
apply (unfold hypreal_inverse_def) |
|
14301 | 578 |
apply (rule_tac f = Abs_hypreal in arg_cong) |
579 |
apply (simp add: hyprel_in_hypreal [THEN Abs_hypreal_inverse] |
|
14299 | 580 |
UN_equiv_class [OF equiv_hyprel hypreal_inverse_congruent]) |
581 |
done |
|
582 |
||
583 |
lemma HYPREAL_INVERSE_ZERO: "inverse 0 = (0::hypreal)" |
|
14301 | 584 |
by (simp add: hypreal_inverse hypreal_zero_def) |
14299 | 585 |
|
586 |
lemma HYPREAL_DIVISION_BY_ZERO: "a / (0::hypreal) = 0" |
|
14301 | 587 |
by (simp add: hypreal_divide_def HYPREAL_INVERSE_ZERO) |
588 |
||
589 |
lemma hypreal_inverse_inverse [simp]: "inverse (inverse (z::hypreal)) = z" |
|
590 |
apply (case_tac "z=0", simp add: HYPREAL_INVERSE_ZERO) |
|
591 |
apply (rule_tac z = z in eq_Abs_hypreal) |
|
592 |
apply (simp add: hypreal_inverse hypreal_zero_def) |
|
14299 | 593 |
done |
594 |
||
14301 | 595 |
lemma hypreal_inverse_1 [simp]: "inverse((1::hypreal)) = (1::hypreal)" |
596 |
apply (unfold hypreal_one_def) |
|
597 |
apply (simp add: hypreal_inverse real_zero_not_eq_one [THEN not_sym]) |
|
14299 | 598 |
done |
599 |
||
600 |
||
601 |
(*** existence of inverse ***) |
|
602 |
||
14301 | 603 |
lemma hypreal_mult_inverse [simp]: |
14299 | 604 |
"x \<noteq> 0 ==> x*inverse(x) = (1::hypreal)" |
605 |
apply (unfold hypreal_one_def hypreal_zero_def) |
|
14301 | 606 |
apply (rule_tac z = x in eq_Abs_hypreal) |
14299 | 607 |
apply (simp add: hypreal_inverse hypreal_mult) |
608 |
apply (drule FreeUltrafilterNat_Compl_mem) |
|
609 |
apply (blast intro!: real_mult_inv_right FreeUltrafilterNat_subset) |
|
610 |
done |
|
611 |
||
14301 | 612 |
lemma hypreal_mult_inverse_left [simp]: "x \<noteq> 0 ==> inverse(x)*x = (1::hypreal)" |
613 |
by (simp add: hypreal_mult_inverse hypreal_mult_commute) |
|
14299 | 614 |
|
615 |
lemma hypreal_mult_left_cancel: "(c::hypreal) \<noteq> 0 ==> (c*a=c*b) = (a=b)" |
|
616 |
apply auto |
|
617 |
apply (drule_tac f = "%x. x*inverse c" in arg_cong) |
|
618 |
apply (simp add: hypreal_mult_inverse hypreal_mult_ac) |
|
619 |
done |
|
620 |
||
621 |
lemma hypreal_mult_right_cancel: "(c::hypreal) \<noteq> 0 ==> (a*c=b*c) = (a=b)" |
|
14301 | 622 |
apply safe |
14299 | 623 |
apply (drule_tac f = "%x. x*inverse c" in arg_cong) |
624 |
apply (simp add: hypreal_mult_inverse hypreal_mult_ac) |
|
625 |
done |
|
626 |
||
627 |
lemma hypreal_inverse_not_zero: "x \<noteq> 0 ==> inverse (x::hypreal) \<noteq> 0" |
|
628 |
apply (unfold hypreal_zero_def) |
|
14301 | 629 |
apply (rule_tac z = x in eq_Abs_hypreal) |
14299 | 630 |
apply (simp add: hypreal_inverse hypreal_mult) |
631 |
done |
|
632 |
||
633 |
||
634 |
lemma hypreal_mult_not_0: "[| x \<noteq> 0; y \<noteq> 0 |] ==> x * y \<noteq> (0::hypreal)" |
|
14301 | 635 |
apply safe |
14299 | 636 |
apply (drule_tac f = "%z. inverse x*z" in arg_cong) |
637 |
apply (simp add: hypreal_mult_assoc [symmetric]) |
|
638 |
done |
|
639 |
||
640 |
lemma hypreal_mult_zero_disj: "x*y = (0::hypreal) ==> x = 0 | y = 0" |
|
14301 | 641 |
by (auto intro: ccontr dest: hypreal_mult_not_0) |
14299 | 642 |
|
643 |
lemma hypreal_minus_inverse: "inverse(-x) = -inverse(x::hypreal)" |
|
644 |
apply (case_tac "x=0", simp add: HYPREAL_INVERSE_ZERO) |
|
14301 | 645 |
apply (rule hypreal_mult_right_cancel [of "-x", THEN iffD1], simp) |
646 |
apply (subst hypreal_mult_inverse_left, auto) |
|
14299 | 647 |
done |
648 |
||
649 |
lemma hypreal_inverse_distrib: "inverse(x*y) = inverse(x)*inverse(y::hypreal)" |
|
650 |
apply (case_tac "x=0", simp add: HYPREAL_INVERSE_ZERO) |
|
651 |
apply (case_tac "y=0", simp add: HYPREAL_INVERSE_ZERO) |
|
14301 | 652 |
apply (frule_tac y = y in hypreal_mult_not_0, assumption) |
653 |
apply (rule_tac c1 = x in hypreal_mult_left_cancel [THEN iffD1]) |
|
14299 | 654 |
apply (auto simp add: hypreal_mult_assoc [symmetric]) |
14301 | 655 |
apply (rule_tac c1 = y in hypreal_mult_left_cancel [THEN iffD1]) |
14299 | 656 |
apply (auto simp add: hypreal_mult_left_commute) |
14301 | 657 |
apply (simp add: hypreal_mult_assoc [symmetric]) |
14299 | 658 |
done |
659 |
||
660 |
(*------------------------------------------------------------------ |
|
661 |
Theorems for ordering |
|
662 |
------------------------------------------------------------------*) |
|
663 |
||
664 |
(* prove introduction and elimination rules for hypreal_less *) |
|
665 |
||
666 |
lemma hypreal_less_iff: |
|
667 |
"(P < (Q::hypreal)) = (\<exists>X Y. X \<in> Rep_hypreal(P) & |
|
668 |
Y \<in> Rep_hypreal(Q) & |
|
669 |
{n. X n < Y n} \<in> FreeUltrafilterNat)" |
|
670 |
||
14301 | 671 |
apply (unfold hypreal_less_def, fast) |
14299 | 672 |
done |
673 |
||
674 |
lemma hypreal_lessI: |
|
675 |
"[| {n. X n < Y n} \<in> FreeUltrafilterNat; |
|
676 |
X \<in> Rep_hypreal(P); |
|
677 |
Y \<in> Rep_hypreal(Q) |] ==> P < (Q::hypreal)" |
|
14301 | 678 |
apply (unfold hypreal_less_def, fast) |
14299 | 679 |
done |
680 |
||
681 |
||
682 |
lemma hypreal_lessE: |
|
683 |
"!! R1. [| R1 < (R2::hypreal); |
|
684 |
!!X Y. {n. X n < Y n} \<in> FreeUltrafilterNat ==> P; |
|
685 |
!!X. X \<in> Rep_hypreal(R1) ==> P; |
|
686 |
!!Y. Y \<in> Rep_hypreal(R2) ==> P |] |
|
687 |
==> P" |
|
688 |
||
14301 | 689 |
apply (unfold hypreal_less_def, auto) |
14299 | 690 |
done |
691 |
||
692 |
lemma hypreal_lessD: |
|
693 |
"R1 < (R2::hypreal) ==> (\<exists>X Y. {n. X n < Y n} \<in> FreeUltrafilterNat & |
|
694 |
X \<in> Rep_hypreal(R1) & |
|
695 |
Y \<in> Rep_hypreal(R2))" |
|
14301 | 696 |
apply (unfold hypreal_less_def, fast) |
14299 | 697 |
done |
698 |
||
699 |
lemma hypreal_less_not_refl: "~ (R::hypreal) < R" |
|
14301 | 700 |
apply (rule_tac z = R in eq_Abs_hypreal) |
701 |
apply (auto simp add: hypreal_less_def, ultra) |
|
14299 | 702 |
done |
703 |
||
704 |
(*** y < y ==> P ***) |
|
705 |
lemmas hypreal_less_irrefl = hypreal_less_not_refl [THEN notE, standard] |
|
706 |
declare hypreal_less_irrefl [elim!] |
|
707 |
||
708 |
lemma hypreal_not_refl2: "!!(x::hypreal). x < y ==> x \<noteq> y" |
|
14301 | 709 |
by (auto simp add: hypreal_less_not_refl) |
14299 | 710 |
|
711 |
lemma hypreal_less_trans: "!!(R1::hypreal). [| R1 < R2; R2 < R3 |] ==> R1 < R3" |
|
14301 | 712 |
apply (rule_tac z = R1 in eq_Abs_hypreal) |
713 |
apply (rule_tac z = R2 in eq_Abs_hypreal) |
|
714 |
apply (rule_tac z = R3 in eq_Abs_hypreal) |
|
715 |
apply (auto intro!: exI simp add: hypreal_less_def, ultra) |
|
14299 | 716 |
done |
717 |
||
718 |
lemma hypreal_less_asym: "!! (R1::hypreal). [| R1 < R2; R2 < R1 |] ==> P" |
|
14301 | 719 |
apply (drule hypreal_less_trans, assumption) |
14299 | 720 |
apply (simp add: hypreal_less_not_refl) |
721 |
done |
|
722 |
||
723 |
(*------------------------------------------------------- |
|
724 |
TODO: The following theorem should have been proved |
|
725 |
first and then used througout the proofs as it probably |
|
726 |
makes many of them more straightforward. |
|
727 |
-------------------------------------------------------*) |
|
728 |
lemma hypreal_less: |
|
729 |
"(Abs_hypreal(hyprel``{%n. X n}) < |
|
730 |
Abs_hypreal(hyprel``{%n. Y n})) = |
|
731 |
({n. X n < Y n} \<in> FreeUltrafilterNat)" |
|
732 |
apply (unfold hypreal_less_def) |
|
14301 | 733 |
apply (auto intro!: lemma_hyprel_refl, ultra) |
14299 | 734 |
done |
735 |
||
736 |
(*---------------------------------------------------------------------------- |
|
737 |
Trichotomy: the hyperreals are linearly ordered |
|
738 |
---------------------------------------------------------------------------*) |
|
739 |
||
740 |
lemma lemma_hyprel_0_mem: "\<exists>x. x: hyprel `` {%n. 0}" |
|
741 |
||
742 |
apply (unfold hyprel_def) |
|
14301 | 743 |
apply (rule_tac x = "%n. 0" in exI, safe) |
14299 | 744 |
apply (auto intro!: FreeUltrafilterNat_Nat_set) |
745 |
done |
|
746 |
||
747 |
lemma hypreal_trichotomy: "0 < x | x = 0 | x < (0::hypreal)" |
|
748 |
apply (unfold hypreal_zero_def) |
|
14301 | 749 |
apply (rule_tac z = x in eq_Abs_hypreal) |
14299 | 750 |
apply (auto simp add: hypreal_less_def) |
14301 | 751 |
apply (cut_tac lemma_hyprel_0_mem, erule exE) |
752 |
apply (drule_tac x = xa in spec) |
|
753 |
apply (drule_tac x = x in spec) |
|
754 |
apply (cut_tac x = x in lemma_hyprel_refl, auto) |
|
755 |
apply (drule_tac x = x in spec) |
|
756 |
apply (drule_tac x = xa in spec, auto, ultra) |
|
14299 | 757 |
done |
758 |
||
759 |
lemma hypreal_trichotomyE: |
|
760 |
"[| (0::hypreal) < x ==> P; |
|
761 |
x = 0 ==> P; |
|
762 |
x < 0 ==> P |] ==> P" |
|
14301 | 763 |
apply (insert hypreal_trichotomy [of x], blast) |
14299 | 764 |
done |
765 |
||
766 |
(*---------------------------------------------------------------------------- |
|
767 |
More properties of < |
|
768 |
----------------------------------------------------------------------------*) |
|
769 |
||
770 |
lemma hypreal_less_minus_iff: "((x::hypreal) < y) = (0 < y + -x)" |
|
14301 | 771 |
apply (rule_tac z = x in eq_Abs_hypreal) |
772 |
apply (rule_tac z = y in eq_Abs_hypreal) |
|
14299 | 773 |
apply (auto simp add: hypreal_add hypreal_zero_def hypreal_minus hypreal_less) |
774 |
done |
|
775 |
||
776 |
lemma hypreal_less_minus_iff2: "((x::hypreal) < y) = (x + -y < 0)" |
|
14301 | 777 |
apply (rule_tac z = x in eq_Abs_hypreal) |
778 |
apply (rule_tac z = y in eq_Abs_hypreal) |
|
14299 | 779 |
apply (auto simp add: hypreal_add hypreal_zero_def hypreal_minus hypreal_less) |
780 |
done |
|
781 |
||
782 |
lemma hypreal_eq_minus_iff: "((x::hypreal) = y) = (x + - y = 0)" |
|
783 |
apply auto |
|
14301 | 784 |
apply (rule_tac x1 = "-y" in hypreal_add_right_cancel [THEN iffD1], auto) |
14299 | 785 |
done |
786 |
||
787 |
lemma hypreal_eq_minus_iff2: "((x::hypreal) = y) = (0 = y + - x)" |
|
788 |
apply auto |
|
14301 | 789 |
apply (rule_tac x1 = "-x" in hypreal_add_right_cancel [THEN iffD1], auto) |
14299 | 790 |
done |
791 |
||
792 |
(* 07/00 *) |
|
14301 | 793 |
lemma hypreal_diff_zero [simp]: "(0::hypreal) - x = -x" |
794 |
by (simp add: hypreal_diff_def) |
|
14299 | 795 |
|
14301 | 796 |
lemma hypreal_diff_zero_right [simp]: "x - (0::hypreal) = x" |
797 |
by (simp add: hypreal_diff_def) |
|
14299 | 798 |
|
14301 | 799 |
lemma hypreal_diff_self [simp]: "x - x = (0::hypreal)" |
800 |
by (simp add: hypreal_diff_def) |
|
14299 | 801 |
|
802 |
lemma hypreal_eq_minus_iff3: "(x = y + z) = (x + -z = (y::hypreal))" |
|
14301 | 803 |
by (auto simp add: hypreal_add_assoc) |
14299 | 804 |
|
805 |
lemma hypreal_not_eq_minus_iff: "(x \<noteq> a) = (x + -a \<noteq> (0::hypreal))" |
|
14301 | 806 |
by (auto dest: hypreal_eq_minus_iff [THEN iffD2]) |
14299 | 807 |
|
808 |
||
809 |
(*** linearity ***) |
|
810 |
||
811 |
lemma hypreal_linear: "(x::hypreal) < y | x = y | y < x" |
|
812 |
apply (subst hypreal_eq_minus_iff2) |
|
14301 | 813 |
apply (rule_tac x1 = x in hypreal_less_minus_iff [THEN ssubst]) |
814 |
apply (rule_tac x1 = y in hypreal_less_minus_iff2 [THEN ssubst]) |
|
815 |
apply (rule hypreal_trichotomyE, auto) |
|
14299 | 816 |
done |
817 |
||
818 |
lemma hypreal_neq_iff: "((w::hypreal) \<noteq> z) = (w<z | z<w)" |
|
14301 | 819 |
by (cut_tac hypreal_linear, blast) |
14299 | 820 |
|
821 |
lemma hypreal_linear_less2: "!!(x::hypreal). [| x < y ==> P; x = y ==> P; |
|
822 |
y < x ==> P |] ==> P" |
|
14301 | 823 |
apply (cut_tac x = x and y = y in hypreal_linear, auto) |
14299 | 824 |
done |
825 |
||
826 |
(*------------------------------------------------------------------------------ |
|
827 |
Properties of <= |
|
828 |
------------------------------------------------------------------------------*) |
|
829 |
(*------ hypreal le iff reals le a.e ------*) |
|
830 |
||
831 |
lemma hypreal_le: |
|
832 |
"(Abs_hypreal(hyprel``{%n. X n}) <= |
|
833 |
Abs_hypreal(hyprel``{%n. Y n})) = |
|
834 |
({n. X n <= Y n} \<in> FreeUltrafilterNat)" |
|
835 |
apply (unfold hypreal_le_def real_le_def) |
|
836 |
apply (auto simp add: hypreal_less) |
|
837 |
apply (ultra+) |
|
838 |
done |
|
839 |
||
840 |
(*---------------------------------------------------------*) |
|
841 |
(*---------------------------------------------------------*) |
|
842 |
lemma hypreal_leI: |
|
843 |
"~(w < z) ==> z <= (w::hypreal)" |
|
14301 | 844 |
apply (unfold hypreal_le_def, assumption) |
14299 | 845 |
done |
846 |
||
847 |
lemma hypreal_leD: |
|
848 |
"z<=w ==> ~(w<(z::hypreal))" |
|
14301 | 849 |
apply (unfold hypreal_le_def, assumption) |
14299 | 850 |
done |
851 |
||
852 |
lemma hypreal_less_le_iff: "(~(w < z)) = (z <= (w::hypreal))" |
|
14301 | 853 |
by (fast intro!: hypreal_leI hypreal_leD) |
14299 | 854 |
|
855 |
lemma not_hypreal_leE: "~ z <= w ==> w<(z::hypreal)" |
|
14301 | 856 |
by (unfold hypreal_le_def, fast) |
14299 | 857 |
|
858 |
lemma hypreal_le_imp_less_or_eq: "!!(x::hypreal). x <= y ==> x < y | x = y" |
|
859 |
apply (unfold hypreal_le_def) |
|
860 |
apply (cut_tac hypreal_linear) |
|
861 |
apply (fast elim: hypreal_less_irrefl hypreal_less_asym) |
|
862 |
done |
|
863 |
||
864 |
lemma hypreal_less_or_eq_imp_le: "z<w | z=w ==> z <=(w::hypreal)" |
|
865 |
apply (unfold hypreal_le_def) |
|
866 |
apply (cut_tac hypreal_linear) |
|
867 |
apply (fast elim: hypreal_less_irrefl hypreal_less_asym) |
|
868 |
done |
|
869 |
||
870 |
lemma hypreal_le_eq_less_or_eq: "(x <= (y::hypreal)) = (x < y | x=y)" |
|
871 |
by (blast intro!: hypreal_less_or_eq_imp_le dest: hypreal_le_imp_less_or_eq) |
|
872 |
||
873 |
lemmas hypreal_le_less = hypreal_le_eq_less_or_eq |
|
874 |
||
875 |
lemma hypreal_le_refl: "w <= (w::hypreal)" |
|
14301 | 876 |
by (simp add: hypreal_le_eq_less_or_eq) |
14299 | 877 |
|
878 |
(* Axiom 'linorder_linear' of class 'linorder': *) |
|
879 |
lemma hypreal_le_linear: "(z::hypreal) <= w | w <= z" |
|
14301 | 880 |
apply (simp add: hypreal_le_less) |
881 |
apply (cut_tac hypreal_linear, blast) |
|
14299 | 882 |
done |
883 |
||
884 |
lemma hypreal_le_trans: "[| i <= j; j <= k |] ==> i <= (k::hypreal)" |
|
885 |
apply (drule hypreal_le_imp_less_or_eq) |
|
886 |
apply (drule hypreal_le_imp_less_or_eq) |
|
887 |
apply (rule hypreal_less_or_eq_imp_le) |
|
888 |
apply (blast intro: hypreal_less_trans) |
|
889 |
done |
|
890 |
||
891 |
lemma hypreal_le_anti_sym: "[| z <= w; w <= z |] ==> z = (w::hypreal)" |
|
892 |
apply (drule hypreal_le_imp_less_or_eq) |
|
893 |
apply (drule hypreal_le_imp_less_or_eq) |
|
894 |
apply (fast elim: hypreal_less_irrefl hypreal_less_asym) |
|
895 |
done |
|
896 |
||
897 |
lemma not_less_not_eq_hypreal_less: "[| ~ y < x; y \<noteq> x |] ==> x < (y::hypreal)" |
|
898 |
apply (rule not_hypreal_leE) |
|
899 |
apply (fast dest: hypreal_le_imp_less_or_eq) |
|
900 |
done |
|
901 |
||
902 |
(* Axiom 'order_less_le' of class 'order': *) |
|
903 |
lemma hypreal_less_le: "((w::hypreal) < z) = (w <= z & w \<noteq> z)" |
|
14301 | 904 |
apply (simp add: hypreal_le_def hypreal_neq_iff) |
14299 | 905 |
apply (blast intro: hypreal_less_asym) |
906 |
done |
|
907 |
||
14301 | 908 |
lemma hypreal_minus_zero_less_iff [simp]: "(0 < -R) = (R < (0::hypreal))" |
909 |
apply (rule_tac z = R in eq_Abs_hypreal) |
|
14299 | 910 |
apply (auto simp add: hypreal_zero_def hypreal_less hypreal_minus) |
911 |
done |
|
912 |
||
14301 | 913 |
lemma hypreal_minus_zero_less_iff2 [simp]: "(-R < 0) = ((0::hypreal) < R)" |
914 |
apply (rule_tac z = R in eq_Abs_hypreal) |
|
14299 | 915 |
apply (auto simp add: hypreal_zero_def hypreal_less hypreal_minus) |
916 |
done |
|
917 |
||
14301 | 918 |
lemma hypreal_minus_zero_le_iff [simp]: "((0::hypreal) <= -r) = (r <= 0)" |
14299 | 919 |
apply (unfold hypreal_le_def) |
14301 | 920 |
apply (simp add: hypreal_minus_zero_less_iff2) |
14299 | 921 |
done |
922 |
||
14301 | 923 |
lemma hypreal_minus_zero_le_iff2 [simp]: "(-r <= (0::hypreal)) = (0 <= r)" |
14299 | 924 |
apply (unfold hypreal_le_def) |
14301 | 925 |
apply (simp add: hypreal_minus_zero_less_iff2) |
14299 | 926 |
done |
927 |
||
928 |
(*---------------------------------------------------------- |
|
929 |
hypreal_of_real preserves field and order properties |
|
930 |
-----------------------------------------------------------*) |
|
14301 | 931 |
lemma hypreal_of_real_add [simp]: |
14299 | 932 |
"hypreal_of_real (z1 + z2) = hypreal_of_real z1 + hypreal_of_real z2" |
933 |
apply (unfold hypreal_of_real_def) |
|
14301 | 934 |
apply (simp add: hypreal_add hypreal_add_mult_distrib) |
14299 | 935 |
done |
936 |
||
14301 | 937 |
lemma hypreal_of_real_mult [simp]: |
14299 | 938 |
"hypreal_of_real (z1 * z2) = hypreal_of_real z1 * hypreal_of_real z2" |
939 |
apply (unfold hypreal_of_real_def) |
|
14301 | 940 |
apply (simp add: hypreal_mult hypreal_add_mult_distrib2) |
14299 | 941 |
done |
942 |
||
14301 | 943 |
lemma hypreal_of_real_less_iff [simp]: |
14299 | 944 |
"(hypreal_of_real z1 < hypreal_of_real z2) = (z1 < z2)" |
14301 | 945 |
apply (unfold hypreal_less_def hypreal_of_real_def, auto) |
946 |
apply (rule_tac [2] x = "%n. z1" in exI, safe) |
|
947 |
apply (rule_tac [3] x = "%n. z2" in exI, auto) |
|
948 |
apply (rule FreeUltrafilterNat_P, ultra) |
|
14299 | 949 |
done |
950 |
||
14301 | 951 |
lemma hypreal_of_real_le_iff [simp]: |
14299 | 952 |
"(hypreal_of_real z1 <= hypreal_of_real z2) = (z1 <= z2)" |
14301 | 953 |
apply (unfold hypreal_le_def real_le_def, auto) |
14299 | 954 |
done |
955 |
||
14301 | 956 |
lemma hypreal_of_real_eq_iff [simp]: "(hypreal_of_real z1 = hypreal_of_real z2) = (z1 = z2)" |
957 |
by (force intro: order_antisym hypreal_of_real_le_iff [THEN iffD1]) |
|
14299 | 958 |
|
14301 | 959 |
lemma hypreal_of_real_minus [simp]: "hypreal_of_real (-r) = - hypreal_of_real r" |
14299 | 960 |
apply (unfold hypreal_of_real_def) |
961 |
apply (auto simp add: hypreal_minus) |
|
962 |
done |
|
963 |
||
14301 | 964 |
lemma hypreal_of_real_one [simp]: "hypreal_of_real 1 = (1::hypreal)" |
965 |
by (unfold hypreal_of_real_def hypreal_one_def, simp) |
|
14299 | 966 |
|
14301 | 967 |
lemma hypreal_of_real_zero [simp]: "hypreal_of_real 0 = 0" |
968 |
by (unfold hypreal_of_real_def hypreal_zero_def, simp) |
|
14299 | 969 |
|
970 |
lemma hypreal_of_real_zero_iff: "(hypreal_of_real r = 0) = (r = 0)" |
|
14301 | 971 |
by (auto intro: FreeUltrafilterNat_P simp add: hypreal_of_real_def hypreal_zero_def FreeUltrafilterNat_Nat_set) |
14299 | 972 |
|
14301 | 973 |
lemma hypreal_of_real_inverse [simp]: "hypreal_of_real (inverse r) = inverse (hypreal_of_real r)" |
14299 | 974 |
apply (case_tac "r=0") |
14301 | 975 |
apply (simp add: DIVISION_BY_ZERO INVERSE_ZERO HYPREAL_INVERSE_ZERO) |
14299 | 976 |
apply (rule_tac c1 = "hypreal_of_real r" in hypreal_mult_left_cancel [THEN iffD1]) |
977 |
apply (auto simp add: hypreal_of_real_zero_iff hypreal_of_real_mult [symmetric]) |
|
978 |
done |
|
979 |
||
14301 | 980 |
lemma hypreal_of_real_divide [simp]: "hypreal_of_real (z1 / z2) = hypreal_of_real z1 / hypreal_of_real z2" |
981 |
by (simp add: hypreal_divide_def real_divide_def) |
|
14299 | 982 |
|
983 |
||
984 |
(*** Division lemmas ***) |
|
985 |
||
986 |
lemma hypreal_zero_divide: "(0::hypreal)/x = 0" |
|
14301 | 987 |
by (simp add: hypreal_divide_def) |
14299 | 988 |
|
989 |
lemma hypreal_divide_one: "x/(1::hypreal) = x" |
|
14301 | 990 |
by (simp add: hypreal_divide_def) |
14299 | 991 |
declare hypreal_zero_divide [simp] hypreal_divide_one [simp] |
992 |
||
14301 | 993 |
lemma hypreal_times_divide1_eq [simp]: "(x::hypreal) * (y/z) = (x*y)/z" |
994 |
by (simp add: hypreal_divide_def hypreal_mult_assoc) |
|
14299 | 995 |
|
14301 | 996 |
lemma hypreal_times_divide2_eq [simp]: "(y/z) * (x::hypreal) = (y*x)/z" |
997 |
by (simp add: hypreal_divide_def hypreal_mult_ac) |
|
14299 | 998 |
|
999 |
||
14301 | 1000 |
lemma hypreal_divide_divide1_eq [simp]: "(x::hypreal) / (y/z) = (x*z)/y" |
1001 |
by (simp add: hypreal_divide_def hypreal_inverse_distrib hypreal_mult_ac) |
|
14299 | 1002 |
|
14301 | 1003 |
lemma hypreal_divide_divide2_eq [simp]: "((x::hypreal) / y) / z = x/(y*z)" |
1004 |
by (simp add: hypreal_divide_def hypreal_inverse_distrib hypreal_mult_assoc) |
|
14299 | 1005 |
|
1006 |
||
1007 |
(** As with multiplication, pull minus signs OUT of the / operator **) |
|
1008 |
||
14301 | 1009 |
lemma hypreal_minus_divide_eq [simp]: "(-x) / (y::hypreal) = - (x/y)" |
1010 |
by (simp add: hypreal_divide_def) |
|
14299 | 1011 |
|
14301 | 1012 |
lemma hypreal_divide_minus_eq [simp]: "(x / -(y::hypreal)) = - (x/y)" |
1013 |
by (simp add: hypreal_divide_def hypreal_minus_inverse) |
|
14299 | 1014 |
|
1015 |
lemma hypreal_add_divide_distrib: "(x+y)/(z::hypreal) = x/z + y/z" |
|
14301 | 1016 |
by (simp add: hypreal_divide_def hypreal_add_mult_distrib) |
14299 | 1017 |
|
1018 |
lemma hypreal_inverse_add: "[|(x::hypreal) \<noteq> 0; y \<noteq> 0 |] |
|
1019 |
==> inverse(x) + inverse(y) = (x + y)*inverse(x*y)" |
|
1020 |
apply (simp add: hypreal_inverse_distrib hypreal_add_mult_distrib hypreal_mult_assoc [symmetric]) |
|
1021 |
apply (subst hypreal_mult_assoc) |
|
1022 |
apply (rule hypreal_mult_left_commute [THEN subst]) |
|
1023 |
apply (simp add: hypreal_add_commute) |
|
1024 |
done |
|
1025 |
||
1026 |
lemma hypreal_self_eq_minus_self_zero: "x = -x ==> x = (0::hypreal)" |
|
14301 | 1027 |
apply (rule_tac z = x in eq_Abs_hypreal) |
1028 |
apply (auto simp add: hypreal_minus hypreal_zero_def, ultra) |
|
14299 | 1029 |
done |
1030 |
||
14301 | 1031 |
lemma hypreal_add_self_zero_cancel [simp]: "(x + x = 0) = (x = (0::hypreal))" |
1032 |
apply (rule_tac z = x in eq_Abs_hypreal) |
|
14299 | 1033 |
apply (auto simp add: hypreal_add hypreal_zero_def) |
1034 |
done |
|
1035 |
||
14301 | 1036 |
lemma hypreal_add_self_zero_cancel2 [simp]: "(x + x + y = y) = (x = (0::hypreal))" |
14299 | 1037 |
apply auto |
1038 |
apply (drule hypreal_eq_minus_iff [THEN iffD1]) |
|
1039 |
apply (auto simp add: hypreal_add_assoc hypreal_self_eq_minus_self_zero) |
|
1040 |
done |
|
1041 |
||
14301 | 1042 |
lemma hypreal_add_self_zero_cancel2a [simp]: "(x + (x + y) = y) = (x = (0::hypreal))" |
1043 |
by (simp add: hypreal_add_assoc [symmetric]) |
|
14299 | 1044 |
|
1045 |
lemma hypreal_minus_eq_swap: "(b = -a) = (-b = (a::hypreal))" |
|
14301 | 1046 |
by auto |
14299 | 1047 |
|
14301 | 1048 |
lemma hypreal_minus_eq_cancel [simp]: "(-b = -a) = (b = (a::hypreal))" |
1049 |
by (simp add: hypreal_minus_eq_swap) |
|
14299 | 1050 |
|
1051 |
lemma hypreal_less_eq_diff: "(x<y) = (x-y < (0::hypreal))" |
|
1052 |
apply (unfold hypreal_diff_def) |
|
1053 |
apply (rule hypreal_less_minus_iff2) |
|
1054 |
done |
|
1055 |
||
1056 |
(*** Subtraction laws ***) |
|
1057 |
||
1058 |
lemma hypreal_add_diff_eq: "x + (y - z) = (x + y) - (z::hypreal)" |
|
14301 | 1059 |
by (simp add: hypreal_diff_def hypreal_add_ac) |
14299 | 1060 |
|
1061 |
lemma hypreal_diff_add_eq: "(x - y) + z = (x + z) - (y::hypreal)" |
|
14301 | 1062 |
by (simp add: hypreal_diff_def hypreal_add_ac) |
14299 | 1063 |
|
1064 |
lemma hypreal_diff_diff_eq: "(x - y) - z = x - (y + (z::hypreal))" |
|
14301 | 1065 |
by (simp add: hypreal_diff_def hypreal_add_ac) |
14299 | 1066 |
|
1067 |
lemma hypreal_diff_diff_eq2: "x - (y - z) = (x + z) - (y::hypreal)" |
|
14301 | 1068 |
by (simp add: hypreal_diff_def hypreal_add_ac) |
14299 | 1069 |
|
1070 |
lemma hypreal_diff_less_eq: "(x-y < z) = (x < z + (y::hypreal))" |
|
1071 |
apply (subst hypreal_less_eq_diff) |
|
14301 | 1072 |
apply (rule_tac y1 = z in hypreal_less_eq_diff [THEN ssubst]) |
1073 |
apply (simp add: hypreal_diff_def hypreal_add_ac) |
|
14299 | 1074 |
done |
1075 |
||
1076 |
lemma hypreal_less_diff_eq: "(x < z-y) = (x + (y::hypreal) < z)" |
|
1077 |
apply (subst hypreal_less_eq_diff) |
|
1078 |
apply (rule_tac y1 = "z-y" in hypreal_less_eq_diff [THEN ssubst]) |
|
14301 | 1079 |
apply (simp add: hypreal_diff_def hypreal_add_ac) |
14299 | 1080 |
done |
1081 |
||
1082 |
lemma hypreal_diff_le_eq: "(x-y <= z) = (x <= z + (y::hypreal))" |
|
1083 |
apply (unfold hypreal_le_def) |
|
14301 | 1084 |
apply (simp add: hypreal_less_diff_eq) |
14299 | 1085 |
done |
1086 |
||
1087 |
lemma hypreal_le_diff_eq: "(x <= z-y) = (x + (y::hypreal) <= z)" |
|
1088 |
apply (unfold hypreal_le_def) |
|
14301 | 1089 |
apply (simp add: hypreal_diff_less_eq) |
14299 | 1090 |
done |
1091 |
||
1092 |
lemma hypreal_diff_eq_eq: "(x-y = z) = (x = z + (y::hypreal))" |
|
1093 |
apply (unfold hypreal_diff_def) |
|
1094 |
apply (auto simp add: hypreal_add_assoc) |
|
1095 |
done |
|
1096 |
||
1097 |
lemma hypreal_eq_diff_eq: "(x = z-y) = (x + (y::hypreal) = z)" |
|
1098 |
apply (unfold hypreal_diff_def) |
|
1099 |
apply (auto simp add: hypreal_add_assoc) |
|
1100 |
done |
|
1101 |
||
1102 |
||
1103 |
(** For the cancellation simproc. |
|
1104 |
The idea is to cancel like terms on opposite sides by subtraction **) |
|
1105 |
||
1106 |
lemma hypreal_less_eqI: "(x::hypreal) - y = x' - y' ==> (x<y) = (x'<y')" |
|
1107 |
apply (subst hypreal_less_eq_diff) |
|
14301 | 1108 |
apply (rule_tac y1 = y in hypreal_less_eq_diff [THEN ssubst], simp) |
14299 | 1109 |
done |
1110 |
||
1111 |
lemma hypreal_le_eqI: "(x::hypreal) - y = x' - y' ==> (y<=x) = (y'<=x')" |
|
1112 |
apply (drule hypreal_less_eqI) |
|
14301 | 1113 |
apply (simp add: hypreal_le_def) |
14299 | 1114 |
done |
1115 |
||
1116 |
lemma hypreal_eq_eqI: "(x::hypreal) - y = x' - y' ==> (x=y) = (x'=y')" |
|
1117 |
apply safe |
|
1118 |
apply (simp_all add: hypreal_eq_diff_eq hypreal_diff_eq_eq) |
|
1119 |
done |
|
1120 |
||
1121 |
lemma hypreal_zero_num: "0 = Abs_hypreal (hyprel `` {%n. 0})" |
|
14301 | 1122 |
by (simp add: hypreal_zero_def [THEN meta_eq_to_obj_eq, symmetric]) |
14299 | 1123 |
|
1124 |
lemma hypreal_one_num: "1 = Abs_hypreal (hyprel `` {%n. 1})" |
|
14301 | 1125 |
by (simp add: hypreal_one_def [THEN meta_eq_to_obj_eq, symmetric]) |
14299 | 1126 |
|
14301 | 1127 |
lemma hypreal_omega_gt_zero [simp]: "0 < omega" |
14299 | 1128 |
apply (unfold omega_def) |
1129 |
apply (auto simp add: hypreal_less hypreal_zero_num) |
|
1130 |
done |
|
1131 |
||
1132 |
ML |
|
1133 |
{* |
|
1134 |
val hypreal_zero_def = thm "hypreal_zero_def"; |
|
1135 |
val hypreal_one_def = thm "hypreal_one_def"; |
|
1136 |
val hypreal_minus_def = thm "hypreal_minus_def"; |
|
1137 |
val hypreal_diff_def = thm "hypreal_diff_def"; |
|
1138 |
val hypreal_inverse_def = thm "hypreal_inverse_def"; |
|
1139 |
val hypreal_divide_def = thm "hypreal_divide_def"; |
|
1140 |
val hypreal_of_real_def = thm "hypreal_of_real_def"; |
|
1141 |
val omega_def = thm "omega_def"; |
|
1142 |
val epsilon_def = thm "epsilon_def"; |
|
1143 |
val hypreal_add_def = thm "hypreal_add_def"; |
|
1144 |
val hypreal_mult_def = thm "hypreal_mult_def"; |
|
1145 |
val hypreal_less_def = thm "hypreal_less_def"; |
|
1146 |
val hypreal_le_def = thm "hypreal_le_def"; |
|
1147 |
||
1148 |
val finite_exhausts = thm "finite_exhausts"; |
|
1149 |
val finite_not_covers = thm "finite_not_covers"; |
|
1150 |
val not_finite_nat = thm "not_finite_nat"; |
|
1151 |
val FreeUltrafilterNat_Ex = thm "FreeUltrafilterNat_Ex"; |
|
1152 |
val FreeUltrafilterNat_mem = thm "FreeUltrafilterNat_mem"; |
|
1153 |
val FreeUltrafilterNat_finite = thm "FreeUltrafilterNat_finite"; |
|
1154 |
val FreeUltrafilterNat_not_finite = thm "FreeUltrafilterNat_not_finite"; |
|
1155 |
val FreeUltrafilterNat_empty = thm "FreeUltrafilterNat_empty"; |
|
1156 |
val FreeUltrafilterNat_Int = thm "FreeUltrafilterNat_Int"; |
|
1157 |
val FreeUltrafilterNat_subset = thm "FreeUltrafilterNat_subset"; |
|
1158 |
val FreeUltrafilterNat_Compl = thm "FreeUltrafilterNat_Compl"; |
|
1159 |
val FreeUltrafilterNat_Compl_mem = thm "FreeUltrafilterNat_Compl_mem"; |
|
1160 |
val FreeUltrafilterNat_Compl_iff1 = thm "FreeUltrafilterNat_Compl_iff1"; |
|
1161 |
val FreeUltrafilterNat_Compl_iff2 = thm "FreeUltrafilterNat_Compl_iff2"; |
|
1162 |
val FreeUltrafilterNat_UNIV = thm "FreeUltrafilterNat_UNIV"; |
|
1163 |
val FreeUltrafilterNat_Nat_set = thm "FreeUltrafilterNat_Nat_set"; |
|
1164 |
val FreeUltrafilterNat_Nat_set_refl = thm "FreeUltrafilterNat_Nat_set_refl"; |
|
1165 |
val FreeUltrafilterNat_P = thm "FreeUltrafilterNat_P"; |
|
1166 |
val FreeUltrafilterNat_Ex_P = thm "FreeUltrafilterNat_Ex_P"; |
|
1167 |
val FreeUltrafilterNat_all = thm "FreeUltrafilterNat_all"; |
|
1168 |
val FreeUltrafilterNat_Un = thm "FreeUltrafilterNat_Un"; |
|
1169 |
val hyprel_iff = thm "hyprel_iff"; |
|
1170 |
val hyprel_refl = thm "hyprel_refl"; |
|
1171 |
val hyprel_sym = thm "hyprel_sym"; |
|
1172 |
val hyprel_trans = thm "hyprel_trans"; |
|
1173 |
val equiv_hyprel = thm "equiv_hyprel"; |
|
1174 |
val hyprel_in_hypreal = thm "hyprel_in_hypreal"; |
|
1175 |
val Abs_hypreal_inverse = thm "Abs_hypreal_inverse"; |
|
1176 |
val inj_on_Abs_hypreal = thm "inj_on_Abs_hypreal"; |
|
1177 |
val inj_Rep_hypreal = thm "inj_Rep_hypreal"; |
|
1178 |
val lemma_hyprel_refl = thm "lemma_hyprel_refl"; |
|
1179 |
val hypreal_empty_not_mem = thm "hypreal_empty_not_mem"; |
|
1180 |
val Rep_hypreal_nonempty = thm "Rep_hypreal_nonempty"; |
|
1181 |
val inj_hypreal_of_real = thm "inj_hypreal_of_real"; |
|
1182 |
val eq_Abs_hypreal = thm "eq_Abs_hypreal"; |
|
1183 |
val hypreal_minus_congruent = thm "hypreal_minus_congruent"; |
|
1184 |
val hypreal_minus = thm "hypreal_minus"; |
|
1185 |
val hypreal_minus_minus = thm "hypreal_minus_minus"; |
|
1186 |
val inj_hypreal_minus = thm "inj_hypreal_minus"; |
|
1187 |
val hypreal_minus_zero = thm "hypreal_minus_zero"; |
|
1188 |
val hypreal_minus_zero_iff = thm "hypreal_minus_zero_iff"; |
|
1189 |
val hypreal_add_congruent2 = thm "hypreal_add_congruent2"; |
|
1190 |
val hypreal_add = thm "hypreal_add"; |
|
1191 |
val hypreal_diff = thm "hypreal_diff"; |
|
1192 |
val hypreal_add_commute = thm "hypreal_add_commute"; |
|
1193 |
val hypreal_add_assoc = thm "hypreal_add_assoc"; |
|
1194 |
val hypreal_add_left_commute = thm "hypreal_add_left_commute"; |
|
1195 |
val hypreal_add_zero_left = thm "hypreal_add_zero_left"; |
|
1196 |
val hypreal_add_zero_right = thm "hypreal_add_zero_right"; |
|
1197 |
val hypreal_add_minus = thm "hypreal_add_minus"; |
|
1198 |
val hypreal_add_minus_left = thm "hypreal_add_minus_left"; |
|
1199 |
val hypreal_minus_ex = thm "hypreal_minus_ex"; |
|
1200 |
val hypreal_minus_ex1 = thm "hypreal_minus_ex1"; |
|
1201 |
val hypreal_minus_left_ex1 = thm "hypreal_minus_left_ex1"; |
|
1202 |
val hypreal_add_minus_eq_minus = thm "hypreal_add_minus_eq_minus"; |
|
1203 |
val hypreal_as_add_inverse_ex = thm "hypreal_as_add_inverse_ex"; |
|
1204 |
val hypreal_minus_add_distrib = thm "hypreal_minus_add_distrib"; |
|
1205 |
val hypreal_minus_distrib1 = thm "hypreal_minus_distrib1"; |
|
1206 |
val hypreal_add_left_cancel = thm "hypreal_add_left_cancel"; |
|
1207 |
val hypreal_add_right_cancel = thm "hypreal_add_right_cancel"; |
|
1208 |
val hypreal_add_minus_cancelA = thm "hypreal_add_minus_cancelA"; |
|
1209 |
val hypreal_minus_add_cancelA = thm "hypreal_minus_add_cancelA"; |
|
1210 |
val hypreal_mult_congruent2 = thm "hypreal_mult_congruent2"; |
|
1211 |
val hypreal_mult = thm "hypreal_mult"; |
|
1212 |
val hypreal_mult_commute = thm "hypreal_mult_commute"; |
|
1213 |
val hypreal_mult_assoc = thm "hypreal_mult_assoc"; |
|
1214 |
val hypreal_mult_left_commute = thm "hypreal_mult_left_commute"; |
|
1215 |
val hypreal_mult_1 = thm "hypreal_mult_1"; |
|
1216 |
val hypreal_mult_1_right = thm "hypreal_mult_1_right"; |
|
1217 |
val hypreal_mult_0 = thm "hypreal_mult_0"; |
|
1218 |
val hypreal_mult_0_right = thm "hypreal_mult_0_right"; |
|
1219 |
val hypreal_minus_mult_eq1 = thm "hypreal_minus_mult_eq1"; |
|
1220 |
val hypreal_minus_mult_eq2 = thm "hypreal_minus_mult_eq2"; |
|
1221 |
val hypreal_mult_minus_1 = thm "hypreal_mult_minus_1"; |
|
1222 |
val hypreal_mult_minus_1_right = thm "hypreal_mult_minus_1_right"; |
|
1223 |
val hypreal_minus_mult_commute = thm "hypreal_minus_mult_commute"; |
|
1224 |
val hypreal_add_assoc_cong = thm "hypreal_add_assoc_cong"; |
|
1225 |
val hypreal_add_mult_distrib = thm "hypreal_add_mult_distrib"; |
|
1226 |
val hypreal_add_mult_distrib2 = thm "hypreal_add_mult_distrib2"; |
|
1227 |
val hypreal_diff_mult_distrib = thm "hypreal_diff_mult_distrib"; |
|
1228 |
val hypreal_diff_mult_distrib2 = thm "hypreal_diff_mult_distrib2"; |
|
1229 |
val hypreal_zero_not_eq_one = thm "hypreal_zero_not_eq_one"; |
|
1230 |
val hypreal_inverse_congruent = thm "hypreal_inverse_congruent"; |
|
1231 |
val hypreal_inverse = thm "hypreal_inverse"; |
|
1232 |
val HYPREAL_INVERSE_ZERO = thm "HYPREAL_INVERSE_ZERO"; |
|
1233 |
val HYPREAL_DIVISION_BY_ZERO = thm "HYPREAL_DIVISION_BY_ZERO"; |
|
1234 |
val hypreal_inverse_inverse = thm "hypreal_inverse_inverse"; |
|
1235 |
val hypreal_inverse_1 = thm "hypreal_inverse_1"; |
|
1236 |
val hypreal_mult_inverse = thm "hypreal_mult_inverse"; |
|
1237 |
val hypreal_mult_inverse_left = thm "hypreal_mult_inverse_left"; |
|
1238 |
val hypreal_mult_left_cancel = thm "hypreal_mult_left_cancel"; |
|
1239 |
val hypreal_mult_right_cancel = thm "hypreal_mult_right_cancel"; |
|
1240 |
val hypreal_inverse_not_zero = thm "hypreal_inverse_not_zero"; |
|
1241 |
val hypreal_mult_not_0 = thm "hypreal_mult_not_0"; |
|
1242 |
val hypreal_mult_zero_disj = thm "hypreal_mult_zero_disj"; |
|
1243 |
val hypreal_minus_inverse = thm "hypreal_minus_inverse"; |
|
1244 |
val hypreal_inverse_distrib = thm "hypreal_inverse_distrib"; |
|
1245 |
val hypreal_less_iff = thm "hypreal_less_iff"; |
|
1246 |
val hypreal_lessI = thm "hypreal_lessI"; |
|
1247 |
val hypreal_lessE = thm "hypreal_lessE"; |
|
1248 |
val hypreal_lessD = thm "hypreal_lessD"; |
|
1249 |
val hypreal_less_not_refl = thm "hypreal_less_not_refl"; |
|
1250 |
val hypreal_not_refl2 = thm "hypreal_not_refl2"; |
|
1251 |
val hypreal_less_trans = thm "hypreal_less_trans"; |
|
1252 |
val hypreal_less_asym = thm "hypreal_less_asym"; |
|
1253 |
val hypreal_less = thm "hypreal_less"; |
|
1254 |
val hypreal_trichotomy = thm "hypreal_trichotomy"; |
|
1255 |
val hypreal_trichotomyE = thm "hypreal_trichotomyE"; |
|
1256 |
val hypreal_less_minus_iff = thm "hypreal_less_minus_iff"; |
|
1257 |
val hypreal_less_minus_iff2 = thm "hypreal_less_minus_iff2"; |
|
1258 |
val hypreal_eq_minus_iff = thm "hypreal_eq_minus_iff"; |
|
1259 |
val hypreal_eq_minus_iff2 = thm "hypreal_eq_minus_iff2"; |
|
1260 |
val hypreal_diff_zero = thm "hypreal_diff_zero"; |
|
1261 |
val hypreal_diff_zero_right = thm "hypreal_diff_zero_right"; |
|
1262 |
val hypreal_diff_self = thm "hypreal_diff_self"; |
|
1263 |
val hypreal_eq_minus_iff3 = thm "hypreal_eq_minus_iff3"; |
|
1264 |
val hypreal_not_eq_minus_iff = thm "hypreal_not_eq_minus_iff"; |
|
1265 |
val hypreal_linear = thm "hypreal_linear"; |
|
1266 |
val hypreal_neq_iff = thm "hypreal_neq_iff"; |
|
1267 |
val hypreal_linear_less2 = thm "hypreal_linear_less2"; |
|
1268 |
val hypreal_le = thm "hypreal_le"; |
|
1269 |
val hypreal_leI = thm "hypreal_leI"; |
|
1270 |
val hypreal_leD = thm "hypreal_leD"; |
|
1271 |
val hypreal_less_le_iff = thm "hypreal_less_le_iff"; |
|
1272 |
val not_hypreal_leE = thm "not_hypreal_leE"; |
|
1273 |
val hypreal_le_imp_less_or_eq = thm "hypreal_le_imp_less_or_eq"; |
|
1274 |
val hypreal_less_or_eq_imp_le = thm "hypreal_less_or_eq_imp_le"; |
|
1275 |
val hypreal_le_eq_less_or_eq = thm "hypreal_le_eq_less_or_eq"; |
|
1276 |
val hypreal_le_refl = thm "hypreal_le_refl"; |
|
1277 |
val hypreal_le_linear = thm "hypreal_le_linear"; |
|
1278 |
val hypreal_le_trans = thm "hypreal_le_trans"; |
|
1279 |
val hypreal_le_anti_sym = thm "hypreal_le_anti_sym"; |
|
1280 |
val not_less_not_eq_hypreal_less = thm "not_less_not_eq_hypreal_less"; |
|
1281 |
val hypreal_less_le = thm "hypreal_less_le"; |
|
1282 |
val hypreal_minus_zero_less_iff = thm "hypreal_minus_zero_less_iff"; |
|
1283 |
val hypreal_minus_zero_less_iff2 = thm "hypreal_minus_zero_less_iff2"; |
|
1284 |
val hypreal_minus_zero_le_iff = thm "hypreal_minus_zero_le_iff"; |
|
1285 |
val hypreal_minus_zero_le_iff2 = thm "hypreal_minus_zero_le_iff2"; |
|
1286 |
val hypreal_of_real_add = thm "hypreal_of_real_add"; |
|
1287 |
val hypreal_of_real_mult = thm "hypreal_of_real_mult"; |
|
1288 |
val hypreal_of_real_less_iff = thm "hypreal_of_real_less_iff"; |
|
1289 |
val hypreal_of_real_le_iff = thm "hypreal_of_real_le_iff"; |
|
1290 |
val hypreal_of_real_eq_iff = thm "hypreal_of_real_eq_iff"; |
|
1291 |
val hypreal_of_real_minus = thm "hypreal_of_real_minus"; |
|
1292 |
val hypreal_of_real_one = thm "hypreal_of_real_one"; |
|
1293 |
val hypreal_of_real_zero = thm "hypreal_of_real_zero"; |
|
1294 |
val hypreal_of_real_zero_iff = thm "hypreal_of_real_zero_iff"; |
|
1295 |
val hypreal_of_real_inverse = thm "hypreal_of_real_inverse"; |
|
1296 |
val hypreal_of_real_divide = thm "hypreal_of_real_divide"; |
|
1297 |
val hypreal_zero_divide = thm "hypreal_zero_divide"; |
|
1298 |
val hypreal_divide_one = thm "hypreal_divide_one"; |
|
1299 |
val hypreal_times_divide1_eq = thm "hypreal_times_divide1_eq"; |
|
1300 |
val hypreal_times_divide2_eq = thm "hypreal_times_divide2_eq"; |
|
1301 |
val hypreal_divide_divide1_eq = thm "hypreal_divide_divide1_eq"; |
|
1302 |
val hypreal_divide_divide2_eq = thm "hypreal_divide_divide2_eq"; |
|
1303 |
val hypreal_minus_divide_eq = thm "hypreal_minus_divide_eq"; |
|
1304 |
val hypreal_divide_minus_eq = thm "hypreal_divide_minus_eq"; |
|
1305 |
val hypreal_add_divide_distrib = thm "hypreal_add_divide_distrib"; |
|
1306 |
val hypreal_inverse_add = thm "hypreal_inverse_add"; |
|
1307 |
val hypreal_self_eq_minus_self_zero = thm "hypreal_self_eq_minus_self_zero"; |
|
1308 |
val hypreal_add_self_zero_cancel = thm "hypreal_add_self_zero_cancel"; |
|
1309 |
val hypreal_add_self_zero_cancel2 = thm "hypreal_add_self_zero_cancel2"; |
|
1310 |
val hypreal_add_self_zero_cancel2a = thm "hypreal_add_self_zero_cancel2a"; |
|
1311 |
val hypreal_minus_eq_swap = thm "hypreal_minus_eq_swap"; |
|
1312 |
val hypreal_minus_eq_cancel = thm "hypreal_minus_eq_cancel"; |
|
1313 |
val hypreal_less_eq_diff = thm "hypreal_less_eq_diff"; |
|
1314 |
val hypreal_add_diff_eq = thm "hypreal_add_diff_eq"; |
|
1315 |
val hypreal_diff_add_eq = thm "hypreal_diff_add_eq"; |
|
1316 |
val hypreal_diff_diff_eq = thm "hypreal_diff_diff_eq"; |
|
1317 |
val hypreal_diff_diff_eq2 = thm "hypreal_diff_diff_eq2"; |
|
1318 |
val hypreal_diff_less_eq = thm "hypreal_diff_less_eq"; |
|
1319 |
val hypreal_less_diff_eq = thm "hypreal_less_diff_eq"; |
|
1320 |
val hypreal_diff_le_eq = thm "hypreal_diff_le_eq"; |
|
1321 |
val hypreal_le_diff_eq = thm "hypreal_le_diff_eq"; |
|
1322 |
val hypreal_diff_eq_eq = thm "hypreal_diff_eq_eq"; |
|
1323 |
val hypreal_eq_diff_eq = thm "hypreal_eq_diff_eq"; |
|
1324 |
val hypreal_less_eqI = thm "hypreal_less_eqI"; |
|
1325 |
val hypreal_le_eqI = thm "hypreal_le_eqI"; |
|
1326 |
val hypreal_eq_eqI = thm "hypreal_eq_eqI"; |
|
1327 |
val hypreal_zero_num = thm "hypreal_zero_num"; |
|
1328 |
val hypreal_one_num = thm "hypreal_one_num"; |
|
1329 |
val hypreal_omega_gt_zero = thm "hypreal_omega_gt_zero"; |
|
1330 |
*} |
|
1331 |
||
1332 |
||
10751 | 1333 |
end |