10751
|
1 |
(* Title : Star.thy
|
|
2 |
Author : Jacques D. Fleuriot
|
|
3 |
Copyright : 1998 University of Cambridge
|
14370
|
4 |
Description : defining *-transforms in NSA which extends sets of reals,
|
10751
|
5 |
and real=>real functions
|
14370
|
6 |
*)
|
10751
|
7 |
|
14370
|
8 |
header{*Star-Transforms in Non-Standard Analysis*}
|
|
9 |
|
|
10 |
theory Star = NSA:
|
10751
|
11 |
|
|
12 |
constdefs
|
|
13 |
(* nonstandard extension of sets *)
|
14370
|
14 |
starset :: "real set => hypreal set" ("*s* _" [80] 80)
|
10751
|
15 |
"*s* A == {x. ALL X: Rep_hypreal(x). {n::nat. X n : A}: FreeUltrafilterNat}"
|
|
16 |
|
|
17 |
(* internal sets *)
|
14370
|
18 |
starset_n :: "(nat => real set) => hypreal set" ("*sn* _" [80] 80)
|
|
19 |
"*sn* As == {x. ALL X: Rep_hypreal(x). {n::nat. X n : (As n)}: FreeUltrafilterNat}"
|
|
20 |
|
10751
|
21 |
InternalSets :: "hypreal set set"
|
|
22 |
"InternalSets == {X. EX As. X = *sn* As}"
|
|
23 |
|
|
24 |
(* nonstandard extension of function *)
|
14370
|
25 |
is_starext :: "[hypreal => hypreal, real => real] => bool"
|
10751
|
26 |
"is_starext F f == (ALL x y. EX X: Rep_hypreal(x). EX Y: Rep_hypreal(y).
|
|
27 |
((y = (F x)) = ({n. Y n = f(X n)} : FreeUltrafilterNat)))"
|
14370
|
28 |
|
|
29 |
starfun :: "(real => real) => hypreal => hypreal" ("*f* _" [80] 80)
|
|
30 |
"*f* f == (%x. Abs_hypreal(UN X: Rep_hypreal(x). hyprel``{%n. f(X n)}))"
|
10751
|
31 |
|
|
32 |
(* internal functions *)
|
14370
|
33 |
starfun_n :: "(nat => (real => real)) => hypreal => hypreal"
|
|
34 |
("*fn* _" [80] 80)
|
|
35 |
"*fn* F == (%x. Abs_hypreal(UN X: Rep_hypreal(x). hyprel``{%n. (F n)(X n)}))"
|
10751
|
36 |
|
14370
|
37 |
InternalFuns :: "(hypreal => hypreal) set"
|
10751
|
38 |
"InternalFuns == {X. EX F. X = *fn* F}"
|
|
39 |
|
|
40 |
|
|
41 |
|
14370
|
42 |
(*--------------------------------------------------------
|
|
43 |
Preamble - Pulling "EX" over "ALL"
|
|
44 |
---------------------------------------------------------*)
|
|
45 |
|
|
46 |
(* This proof does not need AC and was suggested by the
|
|
47 |
referee for the JCM Paper: let f(x) be least y such
|
|
48 |
that Q(x,y)
|
|
49 |
*)
|
|
50 |
lemma no_choice: "ALL x. EX y. Q x y ==> EX (f :: nat => nat). ALL x. Q x (f x)"
|
|
51 |
apply (rule_tac x = "%x. LEAST y. Q x y" in exI)
|
|
52 |
apply (blast intro: LeastI)
|
|
53 |
done
|
|
54 |
|
|
55 |
(*------------------------------------------------------------
|
|
56 |
Properties of the *-transform applied to sets of reals
|
|
57 |
------------------------------------------------------------*)
|
|
58 |
|
|
59 |
lemma STAR_real_set: "*s*(UNIV::real set) = (UNIV::hypreal set)"
|
|
60 |
|
|
61 |
apply (unfold starset_def)
|
|
62 |
apply auto
|
|
63 |
done
|
|
64 |
declare STAR_real_set [simp]
|
|
65 |
|
|
66 |
lemma STAR_empty_set: "*s* {} = {}"
|
|
67 |
apply (unfold starset_def)
|
|
68 |
apply safe
|
|
69 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
70 |
apply (drule_tac x = "%n. xa n" in bspec)
|
|
71 |
apply auto
|
|
72 |
done
|
|
73 |
declare STAR_empty_set [simp]
|
|
74 |
|
|
75 |
lemma STAR_Un: "*s* (A Un B) = *s* A Un *s* B"
|
|
76 |
apply (unfold starset_def)
|
|
77 |
apply auto
|
|
78 |
prefer 3 apply (blast intro: FreeUltrafilterNat_subset)
|
|
79 |
prefer 2 apply (blast intro: FreeUltrafilterNat_subset)
|
|
80 |
apply (drule FreeUltrafilterNat_Compl_mem)
|
|
81 |
apply (drule bspec , assumption)
|
|
82 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
83 |
apply auto
|
|
84 |
apply ultra
|
|
85 |
done
|
|
86 |
|
|
87 |
lemma STAR_Int: "*s* (A Int B) = *s* A Int *s* B"
|
|
88 |
apply (unfold starset_def)
|
|
89 |
apply auto
|
|
90 |
prefer 3 apply (blast intro: FreeUltrafilterNat_Int FreeUltrafilterNat_subset)
|
|
91 |
apply (blast intro: FreeUltrafilterNat_subset)+
|
|
92 |
done
|
|
93 |
|
|
94 |
lemma STAR_Compl: "*s* -A = -( *s* A)"
|
|
95 |
apply (auto simp add: starset_def)
|
|
96 |
apply (rule_tac [!] z = "x" in eq_Abs_hypreal)
|
|
97 |
apply (auto dest!: bspec);
|
|
98 |
apply ultra
|
|
99 |
apply (drule FreeUltrafilterNat_Compl_mem)
|
|
100 |
apply ultra
|
|
101 |
done
|
|
102 |
|
|
103 |
lemma STAR_mem_Compl: "x \<notin> *s* F ==> x : *s* (- F)"
|
|
104 |
apply (auto simp add: STAR_Compl)
|
|
105 |
done
|
|
106 |
|
|
107 |
lemma STAR_diff: "*s* (A - B) = *s* A - *s* B"
|
|
108 |
apply (auto simp add: Diff_eq STAR_Int STAR_Compl)
|
|
109 |
done
|
|
110 |
|
|
111 |
lemma STAR_subset: "A <= B ==> *s* A <= *s* B"
|
|
112 |
apply (unfold starset_def)
|
|
113 |
apply (blast intro: FreeUltrafilterNat_subset)+
|
|
114 |
done
|
|
115 |
|
|
116 |
lemma STAR_mem: "a : A ==> hypreal_of_real a : *s* A"
|
|
117 |
apply (unfold starset_def hypreal_of_real_def)
|
|
118 |
apply (auto intro: FreeUltrafilterNat_subset)
|
|
119 |
done
|
|
120 |
|
|
121 |
lemma STAR_hypreal_of_real_image_subset: "hypreal_of_real ` A <= *s* A"
|
|
122 |
apply (unfold starset_def)
|
|
123 |
apply (auto simp add: hypreal_of_real_def)
|
|
124 |
apply (blast intro: FreeUltrafilterNat_subset)
|
|
125 |
done
|
|
126 |
|
|
127 |
lemma STAR_hypreal_of_real_Int: "*s* X Int Reals = hypreal_of_real ` X"
|
|
128 |
apply (unfold starset_def)
|
|
129 |
apply (auto simp add: hypreal_of_real_def SReal_def)
|
|
130 |
apply (simp add: hypreal_of_real_def [symmetric])
|
|
131 |
apply (rule imageI , rule ccontr)
|
|
132 |
apply (drule bspec)
|
|
133 |
apply (rule lemma_hyprel_refl)
|
|
134 |
prefer 2 apply (blast intro: FreeUltrafilterNat_subset)
|
|
135 |
apply auto
|
|
136 |
done
|
|
137 |
|
|
138 |
lemma lemma_not_hyprealA: "x \<notin> hypreal_of_real ` A ==> ALL y: A. x \<noteq> hypreal_of_real y"
|
|
139 |
apply auto
|
|
140 |
done
|
|
141 |
|
|
142 |
lemma lemma_Compl_eq: "- {n. X n = xa} = {n. X n \<noteq> xa}"
|
|
143 |
apply auto
|
|
144 |
done
|
|
145 |
|
|
146 |
lemma STAR_real_seq_to_hypreal:
|
|
147 |
"ALL n. (X n) \<notin> M
|
|
148 |
==> Abs_hypreal(hyprel``{X}) \<notin> *s* M"
|
|
149 |
apply (unfold starset_def)
|
|
150 |
apply (auto , rule bexI , rule_tac [2] lemma_hyprel_refl)
|
|
151 |
apply auto
|
|
152 |
done
|
|
153 |
|
|
154 |
lemma STAR_singleton: "*s* {x} = {hypreal_of_real x}"
|
|
155 |
apply (unfold starset_def)
|
|
156 |
apply (auto simp add: hypreal_of_real_def)
|
|
157 |
apply (rule_tac z = "xa" in eq_Abs_hypreal)
|
|
158 |
apply (auto intro: FreeUltrafilterNat_subset)
|
|
159 |
done
|
|
160 |
declare STAR_singleton [simp]
|
|
161 |
|
|
162 |
lemma STAR_not_mem: "x \<notin> F ==> hypreal_of_real x \<notin> *s* F"
|
|
163 |
apply (auto simp add: starset_def hypreal_of_real_def)
|
|
164 |
apply (rule bexI , rule_tac [2] lemma_hyprel_refl)
|
|
165 |
apply auto
|
|
166 |
done
|
|
167 |
|
|
168 |
lemma STAR_subset_closed: "[| x : *s* A; A <= B |] ==> x : *s* B"
|
|
169 |
apply (blast dest: STAR_subset)
|
|
170 |
done
|
|
171 |
|
|
172 |
(*------------------------------------------------------------------
|
|
173 |
Nonstandard extension of a set (defined using a constant
|
|
174 |
sequence) as a special case of an internal set
|
|
175 |
-----------------------------------------------------------------*)
|
|
176 |
|
|
177 |
lemma starset_n_starset:
|
|
178 |
"ALL n. (As n = A) ==> *sn* As = *s* A"
|
|
179 |
|
|
180 |
apply (unfold starset_n_def starset_def)
|
|
181 |
apply auto
|
|
182 |
done
|
|
183 |
|
|
184 |
|
|
185 |
(*----------------------------------------------------------------*)
|
|
186 |
(* Theorems about nonstandard extensions of functions *)
|
|
187 |
(*----------------------------------------------------------------*)
|
|
188 |
|
|
189 |
(*----------------------------------------------------------------*)
|
|
190 |
(* Nonstandard extension of a function (defined using a *)
|
|
191 |
(* constant sequence) as a special case of an internal function *)
|
|
192 |
(*----------------------------------------------------------------*)
|
|
193 |
|
|
194 |
lemma starfun_n_starfun:
|
|
195 |
"ALL n. (F n = f) ==> *fn* F = *f* f"
|
|
196 |
|
|
197 |
apply (unfold starfun_n_def starfun_def)
|
|
198 |
apply auto
|
|
199 |
done
|
|
200 |
|
|
201 |
|
|
202 |
(*
|
|
203 |
Prove that hrabs is a nonstandard extension of rabs without
|
|
204 |
use of congruence property (proved after this for general
|
|
205 |
nonstandard extensions of real valued functions). This makes
|
|
206 |
proof much longer- see comments at end of HREALABS.thy where
|
|
207 |
we proved a congruence theorem for hrabs.
|
|
208 |
|
|
209 |
NEW!!! No need to prove all the lemmas anymore. Use the ultrafilter
|
|
210 |
tactic!
|
|
211 |
*)
|
|
212 |
|
|
213 |
lemma hrabs_is_starext_rabs: "is_starext abs abs"
|
|
214 |
|
|
215 |
apply (unfold is_starext_def)
|
|
216 |
apply safe
|
|
217 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
218 |
apply (rule_tac z = "y" in eq_Abs_hypreal)
|
|
219 |
apply auto
|
|
220 |
apply (rule bexI , rule_tac [2] lemma_hyprel_refl)
|
|
221 |
apply (rule bexI , rule_tac [2] lemma_hyprel_refl)
|
|
222 |
apply (auto dest!: spec simp add: hypreal_minus hrabs_def hypreal_zero_def hypreal_le_def hypreal_less_def)
|
|
223 |
apply (arith | ultra)+
|
|
224 |
done
|
|
225 |
|
|
226 |
lemma Rep_hypreal_FreeUltrafilterNat: "[| X: Rep_hypreal z; Y: Rep_hypreal z |]
|
|
227 |
==> {n. X n = Y n} : FreeUltrafilterNat"
|
|
228 |
apply (rule_tac z = "z" in eq_Abs_hypreal)
|
|
229 |
apply (auto , ultra)
|
|
230 |
done
|
|
231 |
|
|
232 |
(*-----------------------------------------------------------------------
|
|
233 |
Nonstandard extension of functions- congruence
|
|
234 |
-----------------------------------------------------------------------*)
|
|
235 |
|
|
236 |
lemma starfun_congruent: "congruent hyprel (%X. hyprel``{%n. f (X n)})"
|
|
237 |
apply (unfold congruent_def)
|
|
238 |
apply auto
|
|
239 |
apply ultra
|
|
240 |
done
|
|
241 |
|
|
242 |
lemma starfun:
|
|
243 |
"( *f* f) (Abs_hypreal(hyprel``{%n. X n})) =
|
|
244 |
Abs_hypreal(hyprel `` {%n. f (X n)})"
|
|
245 |
apply (unfold starfun_def)
|
|
246 |
apply (rule_tac f = "Abs_hypreal" in arg_cong)
|
|
247 |
apply (simp add: hyprel_in_hypreal [THEN Abs_hypreal_inverse]
|
|
248 |
UN_equiv_class [OF equiv_hyprel starfun_congruent])
|
|
249 |
done
|
|
250 |
|
|
251 |
(*-------------------------------------------
|
|
252 |
multiplication: ( *f ) x ( *g ) = *(f x g)
|
|
253 |
------------------------------------------*)
|
|
254 |
lemma starfun_mult: "( *f* f) xa * ( *f* g) xa = ( *f* (%x. f x * g x)) xa"
|
|
255 |
apply (rule_tac z = "xa" in eq_Abs_hypreal)
|
|
256 |
apply (auto simp add: starfun hypreal_mult)
|
|
257 |
done
|
|
258 |
declare starfun_mult [symmetric, simp]
|
|
259 |
|
|
260 |
(*---------------------------------------
|
|
261 |
addition: ( *f ) + ( *g ) = *(f + g)
|
|
262 |
---------------------------------------*)
|
|
263 |
lemma starfun_add: "( *f* f) xa + ( *f* g) xa = ( *f* (%x. f x + g x)) xa"
|
|
264 |
apply (rule_tac z = "xa" in eq_Abs_hypreal)
|
|
265 |
apply (auto simp add: starfun hypreal_add)
|
|
266 |
done
|
|
267 |
declare starfun_add [symmetric, simp]
|
|
268 |
|
|
269 |
(*--------------------------------------------
|
|
270 |
subtraction: ( *f ) + -( *g ) = *(f + -g)
|
|
271 |
-------------------------------------------*)
|
|
272 |
|
|
273 |
lemma starfun_minus: "- ( *f* f) x = ( *f* (%x. - f x)) x"
|
|
274 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
275 |
apply (auto simp add: starfun hypreal_minus)
|
|
276 |
done
|
|
277 |
declare starfun_minus [symmetric, simp]
|
|
278 |
|
|
279 |
(*FIXME: delete*)
|
|
280 |
lemma starfun_add_minus: "( *f* f) xa + -( *f* g) xa = ( *f* (%x. f x + -g x)) xa"
|
|
281 |
apply (simp (no_asm))
|
|
282 |
done
|
|
283 |
declare starfun_add_minus [symmetric, simp]
|
|
284 |
|
|
285 |
lemma starfun_diff:
|
|
286 |
"( *f* f) xa - ( *f* g) xa = ( *f* (%x. f x - g x)) xa"
|
|
287 |
apply (unfold hypreal_diff_def real_diff_def)
|
|
288 |
apply (rule starfun_add_minus)
|
|
289 |
done
|
|
290 |
declare starfun_diff [symmetric, simp]
|
|
291 |
|
|
292 |
(*--------------------------------------
|
|
293 |
composition: ( *f ) o ( *g ) = *(f o g)
|
|
294 |
---------------------------------------*)
|
|
295 |
|
|
296 |
lemma starfun_o2: "(%x. ( *f* f) (( *f* g) x)) = *f* (%x. f (g x))"
|
|
297 |
apply (rule ext)
|
|
298 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
299 |
apply (auto simp add: starfun)
|
|
300 |
done
|
|
301 |
|
|
302 |
lemma starfun_o: "( *f* f) o ( *f* g) = ( *f* (f o g))"
|
|
303 |
apply (unfold o_def)
|
|
304 |
apply (simp (no_asm) add: starfun_o2)
|
|
305 |
done
|
|
306 |
|
|
307 |
(*--------------------------------------
|
|
308 |
NS extension of constant function
|
|
309 |
--------------------------------------*)
|
|
310 |
lemma starfun_const_fun: "( *f* (%x. k)) xa = hypreal_of_real k"
|
|
311 |
apply (rule_tac z = "xa" in eq_Abs_hypreal)
|
|
312 |
apply (auto simp add: starfun hypreal_of_real_def)
|
|
313 |
done
|
|
314 |
|
|
315 |
declare starfun_const_fun [simp]
|
|
316 |
|
|
317 |
(*----------------------------------------------------
|
|
318 |
the NS extension of the identity function
|
|
319 |
----------------------------------------------------*)
|
|
320 |
|
|
321 |
lemma starfun_Idfun_approx: "x @= hypreal_of_real a ==> ( *f* (%x. x)) x @= hypreal_of_real a"
|
|
322 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
323 |
apply (auto simp add: starfun)
|
|
324 |
done
|
|
325 |
|
|
326 |
lemma starfun_Id: "( *f* (%x. x)) x = x"
|
|
327 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
328 |
apply (auto simp add: starfun)
|
|
329 |
done
|
|
330 |
declare starfun_Id [simp]
|
|
331 |
|
|
332 |
(*----------------------------------------------------------------------
|
|
333 |
the *-function is a (nonstandard) extension of the function
|
|
334 |
----------------------------------------------------------------------*)
|
|
335 |
|
|
336 |
lemma is_starext_starfun: "is_starext ( *f* f) f"
|
|
337 |
|
|
338 |
apply (unfold is_starext_def)
|
|
339 |
apply auto
|
|
340 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
341 |
apply (rule_tac z = "y" in eq_Abs_hypreal)
|
|
342 |
apply (auto intro!: bexI simp add: starfun)
|
|
343 |
done
|
|
344 |
|
|
345 |
(*----------------------------------------------------------------------
|
|
346 |
Any nonstandard extension is in fact the *-function
|
|
347 |
----------------------------------------------------------------------*)
|
|
348 |
|
|
349 |
lemma is_starfun_starext: "is_starext F f ==> F = *f* f"
|
|
350 |
|
|
351 |
apply (unfold is_starext_def)
|
|
352 |
apply (rule ext)
|
|
353 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
354 |
apply (drule_tac x = "x" in spec)
|
|
355 |
apply (drule_tac x = "( *f* f) x" in spec)
|
|
356 |
apply (auto dest!: FreeUltrafilterNat_Compl_mem simp add: starfun)
|
|
357 |
apply ultra
|
|
358 |
done
|
|
359 |
|
|
360 |
lemma is_starext_starfun_iff: "(is_starext F f) = (F = *f* f)"
|
|
361 |
apply (blast intro: is_starfun_starext is_starext_starfun)
|
|
362 |
done
|
|
363 |
|
|
364 |
(*--------------------------------------------------------
|
|
365 |
extented function has same solution as its standard
|
|
366 |
version for real arguments. i.e they are the same
|
|
367 |
for all real arguments
|
|
368 |
-------------------------------------------------------*)
|
|
369 |
lemma starfun_eq: "( *f* f) (hypreal_of_real a) = hypreal_of_real (f a)"
|
|
370 |
apply (auto simp add: starfun hypreal_of_real_def)
|
|
371 |
done
|
|
372 |
|
|
373 |
declare starfun_eq [simp]
|
|
374 |
|
|
375 |
lemma starfun_approx: "( *f* f) (hypreal_of_real a) @= hypreal_of_real (f a)"
|
|
376 |
apply auto
|
|
377 |
done
|
|
378 |
|
|
379 |
(* useful for NS definition of derivatives *)
|
|
380 |
lemma starfun_lambda_cancel: "( *f* (%h. f (x + h))) xa = ( *f* f) (hypreal_of_real x + xa)"
|
|
381 |
apply (rule_tac z = "xa" in eq_Abs_hypreal)
|
|
382 |
apply (auto simp add: starfun hypreal_of_real_def hypreal_add)
|
|
383 |
done
|
|
384 |
|
|
385 |
lemma starfun_lambda_cancel2: "( *f* (%h. f(g(x + h)))) xa = ( *f* (f o g)) (hypreal_of_real x + xa)"
|
|
386 |
apply (rule_tac z = "xa" in eq_Abs_hypreal)
|
|
387 |
apply (auto simp add: starfun hypreal_of_real_def hypreal_add)
|
|
388 |
done
|
|
389 |
|
|
390 |
lemma starfun_mult_HFinite_approx: "[| ( *f* f) xa @= l; ( *f* g) xa @= m;
|
|
391 |
l: HFinite; m: HFinite
|
|
392 |
|] ==> ( *f* (%x. f x * g x)) xa @= l * m"
|
|
393 |
apply (drule approx_mult_HFinite)
|
|
394 |
apply (assumption)+
|
|
395 |
apply (auto intro: approx_HFinite [OF _ approx_sym])
|
|
396 |
done
|
|
397 |
|
|
398 |
lemma starfun_add_approx: "[| ( *f* f) xa @= l; ( *f* g) xa @= m
|
|
399 |
|] ==> ( *f* (%x. f x + g x)) xa @= l + m"
|
|
400 |
apply (auto intro: approx_add)
|
|
401 |
done
|
|
402 |
|
|
403 |
(*----------------------------------------------------
|
|
404 |
Examples: hrabs is nonstandard extension of rabs
|
|
405 |
inverse is nonstandard extension of inverse
|
|
406 |
---------------------------------------------------*)
|
|
407 |
|
|
408 |
(* can be proved easily using theorem "starfun" and *)
|
|
409 |
(* properties of ultrafilter as for inverse below we *)
|
|
410 |
(* use the theorem we proved above instead *)
|
|
411 |
|
|
412 |
lemma starfun_rabs_hrabs: "*f* abs = abs"
|
|
413 |
apply (rule hrabs_is_starext_rabs [THEN is_starext_starfun_iff [THEN iffD1], symmetric])
|
|
414 |
done
|
|
415 |
|
|
416 |
lemma starfun_inverse_inverse: "( *f* inverse) x = inverse(x)"
|
|
417 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
418 |
apply (auto simp add: starfun hypreal_inverse hypreal_zero_def)
|
|
419 |
done
|
|
420 |
declare starfun_inverse_inverse [simp]
|
|
421 |
|
|
422 |
lemma starfun_inverse: "inverse (( *f* f) x) = ( *f* (%x. inverse (f x))) x"
|
|
423 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
424 |
apply (auto simp add: starfun hypreal_inverse)
|
|
425 |
done
|
|
426 |
declare starfun_inverse [symmetric, simp]
|
|
427 |
|
|
428 |
lemma starfun_divide:
|
|
429 |
"( *f* f) xa / ( *f* g) xa = ( *f* (%x. f x / g x)) xa"
|
|
430 |
apply (unfold hypreal_divide_def real_divide_def)
|
|
431 |
apply auto
|
|
432 |
done
|
|
433 |
declare starfun_divide [symmetric, simp]
|
|
434 |
|
|
435 |
lemma starfun_inverse2: "inverse (( *f* f) x) = ( *f* (%x. inverse (f x))) x"
|
|
436 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
437 |
apply (auto intro: FreeUltrafilterNat_subset dest!: FreeUltrafilterNat_Compl_mem simp add: starfun hypreal_inverse hypreal_zero_def)
|
|
438 |
done
|
|
439 |
|
|
440 |
(*-------------------------------------------------------------
|
|
441 |
General lemma/theorem needed for proofs in elementary
|
|
442 |
topology of the reals
|
|
443 |
------------------------------------------------------------*)
|
|
444 |
lemma starfun_mem_starset:
|
|
445 |
"( *f* f) x : *s* A ==> x : *s* {x. f x : A}"
|
|
446 |
apply (unfold starset_def)
|
|
447 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
448 |
apply (auto simp add: starfun)
|
|
449 |
apply (rename_tac "X")
|
|
450 |
apply (drule_tac x = "%n. f (X n) " in bspec)
|
|
451 |
apply (auto , ultra)
|
|
452 |
done
|
|
453 |
|
|
454 |
(*------------------------------------------------------------
|
|
455 |
Alternative definition for hrabs with rabs function
|
|
456 |
applied entrywise to equivalence class representative.
|
|
457 |
This is easily proved using starfun and ns extension thm
|
|
458 |
------------------------------------------------------------*)
|
|
459 |
lemma hypreal_hrabs: "abs (Abs_hypreal (hyprel `` {X})) =
|
|
460 |
Abs_hypreal(hyprel `` {%n. abs (X n)})"
|
|
461 |
apply (simp (no_asm) add: starfun_rabs_hrabs [symmetric] starfun)
|
|
462 |
done
|
|
463 |
|
|
464 |
(*----------------------------------------------------------------
|
|
465 |
nonstandard extension of set through nonstandard extension
|
|
466 |
of rabs function i.e hrabs. A more general result should be
|
|
467 |
where we replace rabs by some arbitrary function f and hrabs
|
|
468 |
by its NS extenson ( *f* f). See second NS set extension below.
|
|
469 |
----------------------------------------------------------------*)
|
|
470 |
lemma STAR_rabs_add_minus:
|
|
471 |
"*s* {x. abs (x + - y) < r} =
|
|
472 |
{x. abs(x + -hypreal_of_real y) < hypreal_of_real r}"
|
|
473 |
apply (unfold starset_def)
|
|
474 |
apply safe
|
|
475 |
apply (rule_tac [!] z = "x" in eq_Abs_hypreal)
|
|
476 |
apply (auto intro!: exI dest!: bspec simp add: hypreal_minus hypreal_of_real_def hypreal_add hypreal_hrabs hypreal_less)
|
|
477 |
apply ultra
|
|
478 |
done
|
|
479 |
|
|
480 |
lemma STAR_starfun_rabs_add_minus:
|
|
481 |
"*s* {x. abs (f x + - y) < r} =
|
|
482 |
{x. abs(( *f* f) x + -hypreal_of_real y) < hypreal_of_real r}"
|
|
483 |
apply (unfold starset_def)
|
|
484 |
apply safe
|
|
485 |
apply (rule_tac [!] z = "x" in eq_Abs_hypreal)
|
|
486 |
apply (auto intro!: exI dest!: bspec simp add: hypreal_minus hypreal_of_real_def hypreal_add hypreal_hrabs hypreal_less starfun)
|
|
487 |
apply ultra
|
|
488 |
done
|
|
489 |
|
|
490 |
(*-------------------------------------------------------------------
|
|
491 |
Another characterization of Infinitesimal and one of @= relation.
|
|
492 |
In this theory since hypreal_hrabs proved here. (To Check:) Maybe
|
|
493 |
move both if possible?
|
|
494 |
-------------------------------------------------------------------*)
|
|
495 |
lemma Infinitesimal_FreeUltrafilterNat_iff2: "(x:Infinitesimal) =
|
|
496 |
(EX X:Rep_hypreal(x).
|
|
497 |
ALL m. {n. abs(X n) < inverse(real(Suc m))}
|
|
498 |
: FreeUltrafilterNat)"
|
|
499 |
apply (rule_tac z = "x" in eq_Abs_hypreal)
|
|
500 |
apply (auto intro!: bexI lemma_hyprel_refl
|
|
501 |
simp add: Infinitesimal_hypreal_of_nat_iff hypreal_of_real_def
|
|
502 |
hypreal_inverse hypreal_hrabs hypreal_less hypreal_of_nat_def)
|
|
503 |
apply (drule_tac x = "n" in spec)
|
|
504 |
apply ultra
|
|
505 |
done
|
|
506 |
|
|
507 |
lemma approx_FreeUltrafilterNat_iff: "(Abs_hypreal(hyprel``{X}) @= Abs_hypreal(hyprel``{Y})) =
|
|
508 |
(ALL m. {n. abs (X n + - Y n) <
|
|
509 |
inverse(real(Suc m))} : FreeUltrafilterNat)"
|
|
510 |
apply (subst approx_minus_iff)
|
|
511 |
apply (rule mem_infmal_iff [THEN subst])
|
|
512 |
apply (auto simp add: hypreal_minus hypreal_add Infinitesimal_FreeUltrafilterNat_iff2)
|
|
513 |
apply (drule_tac x = "m" in spec)
|
|
514 |
apply ultra
|
|
515 |
done
|
|
516 |
|
|
517 |
lemma inj_starfun: "inj starfun"
|
|
518 |
apply (rule inj_onI)
|
|
519 |
apply (rule ext , rule ccontr)
|
|
520 |
apply (drule_tac x = "Abs_hypreal (hyprel ``{%n. xa}) " in fun_cong)
|
|
521 |
apply (auto simp add: starfun)
|
|
522 |
done
|
|
523 |
|
|
524 |
ML
|
|
525 |
{*
|
|
526 |
val starset_def = thm"starset_def";
|
|
527 |
val starset_n_def = thm"starset_n_def";
|
|
528 |
val InternalSets_def = thm"InternalSets_def";
|
|
529 |
val is_starext_def = thm"is_starext_def";
|
|
530 |
val starfun_def = thm"starfun_def";
|
|
531 |
val starfun_n_def = thm"starfun_n_def";
|
|
532 |
val InternalFuns_def = thm"InternalFuns_def";
|
|
533 |
|
|
534 |
val no_choice = thm "no_choice";
|
|
535 |
val STAR_real_set = thm "STAR_real_set";
|
|
536 |
val STAR_empty_set = thm "STAR_empty_set";
|
|
537 |
val STAR_Un = thm "STAR_Un";
|
|
538 |
val STAR_Int = thm "STAR_Int";
|
|
539 |
val STAR_Compl = thm "STAR_Compl";
|
|
540 |
val STAR_mem_Compl = thm "STAR_mem_Compl";
|
|
541 |
val STAR_diff = thm "STAR_diff";
|
|
542 |
val STAR_subset = thm "STAR_subset";
|
|
543 |
val STAR_mem = thm "STAR_mem";
|
|
544 |
val STAR_hypreal_of_real_image_subset = thm "STAR_hypreal_of_real_image_subset";
|
|
545 |
val STAR_hypreal_of_real_Int = thm "STAR_hypreal_of_real_Int";
|
|
546 |
val STAR_real_seq_to_hypreal = thm "STAR_real_seq_to_hypreal";
|
|
547 |
val STAR_singleton = thm "STAR_singleton";
|
|
548 |
val STAR_not_mem = thm "STAR_not_mem";
|
|
549 |
val STAR_subset_closed = thm "STAR_subset_closed";
|
|
550 |
val starset_n_starset = thm "starset_n_starset";
|
|
551 |
val starfun_n_starfun = thm "starfun_n_starfun";
|
|
552 |
val hrabs_is_starext_rabs = thm "hrabs_is_starext_rabs";
|
|
553 |
val Rep_hypreal_FreeUltrafilterNat = thm "Rep_hypreal_FreeUltrafilterNat";
|
|
554 |
val starfun_congruent = thm "starfun_congruent";
|
|
555 |
val starfun = thm "starfun";
|
|
556 |
val starfun_mult = thm "starfun_mult";
|
|
557 |
val starfun_add = thm "starfun_add";
|
|
558 |
val starfun_minus = thm "starfun_minus";
|
|
559 |
val starfun_add_minus = thm "starfun_add_minus";
|
|
560 |
val starfun_diff = thm "starfun_diff";
|
|
561 |
val starfun_o2 = thm "starfun_o2";
|
|
562 |
val starfun_o = thm "starfun_o";
|
|
563 |
val starfun_const_fun = thm "starfun_const_fun";
|
|
564 |
val starfun_Idfun_approx = thm "starfun_Idfun_approx";
|
|
565 |
val starfun_Id = thm "starfun_Id";
|
|
566 |
val is_starext_starfun = thm "is_starext_starfun";
|
|
567 |
val is_starfun_starext = thm "is_starfun_starext";
|
|
568 |
val is_starext_starfun_iff = thm "is_starext_starfun_iff";
|
|
569 |
val starfun_eq = thm "starfun_eq";
|
|
570 |
val starfun_approx = thm "starfun_approx";
|
|
571 |
val starfun_lambda_cancel = thm "starfun_lambda_cancel";
|
|
572 |
val starfun_lambda_cancel2 = thm "starfun_lambda_cancel2";
|
|
573 |
val starfun_mult_HFinite_approx = thm "starfun_mult_HFinite_approx";
|
|
574 |
val starfun_add_approx = thm "starfun_add_approx";
|
|
575 |
val starfun_rabs_hrabs = thm "starfun_rabs_hrabs";
|
|
576 |
val starfun_inverse_inverse = thm "starfun_inverse_inverse";
|
|
577 |
val starfun_inverse = thm "starfun_inverse";
|
|
578 |
val starfun_divide = thm "starfun_divide";
|
|
579 |
val starfun_inverse2 = thm "starfun_inverse2";
|
|
580 |
val starfun_mem_starset = thm "starfun_mem_starset";
|
|
581 |
val hypreal_hrabs = thm "hypreal_hrabs";
|
|
582 |
val STAR_rabs_add_minus = thm "STAR_rabs_add_minus";
|
|
583 |
val STAR_starfun_rabs_add_minus = thm "STAR_starfun_rabs_add_minus";
|
|
584 |
val Infinitesimal_FreeUltrafilterNat_iff2 = thm "Infinitesimal_FreeUltrafilterNat_iff2";
|
|
585 |
val approx_FreeUltrafilterNat_iff = thm "approx_FreeUltrafilterNat_iff";
|
|
586 |
val inj_starfun = thm "inj_starfun";
|
|
587 |
*}
|
|
588 |
|
|
589 |
end
|