10751
|
1 |
(* Title : STAR.ML
|
|
2 |
Author : Jacques D. Fleuriot
|
|
3 |
Copyright : 1998 University of Cambridge
|
|
4 |
Description : *-transforms
|
|
5 |
*)
|
|
6 |
|
|
7 |
(*--------------------------------------------------------
|
|
8 |
Preamble - Pulling "EX" over "ALL"
|
|
9 |
---------------------------------------------------------*)
|
|
10 |
|
|
11 |
(* This proof does not need AC and was suggested by the
|
|
12 |
referee for the JCM Paper: let f(x) be least y such
|
|
13 |
that Q(x,y)
|
|
14 |
*)
|
|
15 |
Goal "ALL x. EX y. Q x y ==> EX (f :: nat => nat). ALL x. Q x (f x)";
|
|
16 |
by (res_inst_tac [("x","%x. LEAST y. Q x y")] exI 1);
|
|
17 |
by (blast_tac (claset() addIs [LeastI]) 1);
|
|
18 |
qed "no_choice";
|
|
19 |
|
|
20 |
(*------------------------------------------------------------
|
|
21 |
Properties of the *-transform applied to sets of reals
|
|
22 |
------------------------------------------------------------*)
|
|
23 |
|
|
24 |
Goalw [starset_def] "*s*(UNIV::real set) = (UNIV::hypreal set)";
|
|
25 |
by (Auto_tac);
|
|
26 |
qed "STAR_real_set";
|
|
27 |
Addsimps [STAR_real_set];
|
|
28 |
|
|
29 |
Goalw [starset_def] "*s* {} = {}";
|
|
30 |
by (Step_tac 1);
|
|
31 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
32 |
by (dres_inst_tac [("x","%n. xa n")] bspec 1);
|
|
33 |
by (Auto_tac);
|
|
34 |
qed "STAR_empty_set";
|
|
35 |
Addsimps [STAR_empty_set];
|
|
36 |
|
|
37 |
Goalw [starset_def] "*s* (A Un B) = *s* A Un *s* B";
|
|
38 |
by (Auto_tac);
|
|
39 |
by (REPEAT(blast_tac (claset() addIs [FreeUltrafilterNat_subset]) 2));
|
|
40 |
by (dtac FreeUltrafilterNat_Compl_mem 1);
|
|
41 |
by (dtac bspec 1 THEN assume_tac 1);
|
|
42 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
43 |
by (Auto_tac);
|
|
44 |
by (Fuf_tac 1);
|
|
45 |
qed "STAR_Un";
|
|
46 |
|
|
47 |
Goalw [starset_def] "*s* (A Int B) = *s* A Int *s* B";
|
|
48 |
by (Auto_tac);
|
|
49 |
by (blast_tac (claset() addIs [FreeUltrafilterNat_Int,
|
|
50 |
FreeUltrafilterNat_subset]) 3);
|
|
51 |
by (REPEAT(blast_tac (claset() addIs [FreeUltrafilterNat_subset]) 1));
|
|
52 |
qed "STAR_Int";
|
|
53 |
|
|
54 |
Goalw [starset_def] "*s* -A = -(*s* A)";
|
|
55 |
by (Auto_tac);
|
|
56 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
57 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 2);
|
|
58 |
by (REPEAT(Step_tac 1) THEN Auto_tac);
|
|
59 |
by (Fuf_empty_tac 1);
|
|
60 |
by (dtac FreeUltrafilterNat_Compl_mem 1);
|
|
61 |
by (Fuf_tac 1);
|
|
62 |
qed "STAR_Compl";
|
|
63 |
|
|
64 |
goal Set.thy "(A - B) = (A Int (- B))";
|
|
65 |
by (Step_tac 1);
|
|
66 |
qed "set_diff_iff2";
|
|
67 |
|
|
68 |
Goal "x ~: *s* F ==> x : *s* (- F)";
|
|
69 |
by (auto_tac (claset(),simpset() addsimps [STAR_Compl]));
|
|
70 |
qed "STAR_mem_Compl";
|
|
71 |
|
|
72 |
Goal "*s* (A - B) = *s* A - *s* B";
|
|
73 |
by (auto_tac (claset(),simpset() addsimps
|
|
74 |
[set_diff_iff2,STAR_Int,STAR_Compl]));
|
|
75 |
qed "STAR_diff";
|
|
76 |
|
|
77 |
Goalw [starset_def] "A <= B ==> *s* A <= *s* B";
|
|
78 |
by (REPEAT(blast_tac (claset() addIs [FreeUltrafilterNat_subset]) 1));
|
|
79 |
qed "STAR_subset";
|
|
80 |
|
|
81 |
Goalw [starset_def,hypreal_of_real_def]
|
|
82 |
"a : A ==> hypreal_of_real a : *s* A";
|
|
83 |
by (auto_tac (claset() addIs [FreeUltrafilterNat_subset],simpset()));
|
|
84 |
qed "STAR_mem";
|
|
85 |
|
|
86 |
Goalw [starset_def] "hypreal_of_real `` A <= *s* A";
|
|
87 |
by (auto_tac (claset(),simpset() addsimps [hypreal_of_real_def]));
|
|
88 |
by (blast_tac (claset() addIs [FreeUltrafilterNat_subset]) 1);
|
|
89 |
qed "STAR_hypreal_of_real_image_subset";
|
|
90 |
|
|
91 |
Goalw [starset_def] "*s* X Int SReal = hypreal_of_real `` X";
|
|
92 |
by (auto_tac (claset(),simpset() addsimps [hypreal_of_real_def,SReal_def]));
|
|
93 |
by (fold_tac [hypreal_of_real_def]);
|
|
94 |
by (rtac imageI 1 THEN rtac ccontr 1);
|
|
95 |
by (dtac bspec 1);
|
|
96 |
by (rtac lemma_hyprel_refl 1);
|
|
97 |
by (blast_tac (claset() addIs [FreeUltrafilterNat_subset]) 2);
|
|
98 |
by (Auto_tac);
|
|
99 |
qed "STAR_hypreal_of_real_Int";
|
|
100 |
|
|
101 |
Goal "x ~: hypreal_of_real `` A ==> ALL y: A. x ~= hypreal_of_real y";
|
|
102 |
by (Auto_tac);
|
|
103 |
qed "lemma_not_hyprealA";
|
|
104 |
|
|
105 |
Goal "- {n. X n = xa} = {n. X n ~= xa}";
|
|
106 |
by (Auto_tac);
|
|
107 |
qed "lemma_Compl_eq";
|
|
108 |
|
|
109 |
Goalw [starset_def]
|
|
110 |
"ALL n. (X n) ~: M \
|
|
111 |
\ ==> Abs_hypreal(hyprel^^{X}) ~: *s* M";
|
|
112 |
by (Auto_tac THEN rtac bexI 1 THEN rtac lemma_hyprel_refl 2);
|
|
113 |
by (Auto_tac);
|
|
114 |
qed "STAR_real_seq_to_hypreal";
|
|
115 |
|
|
116 |
Goalw [starset_def] "*s* {x} = {hypreal_of_real x}";
|
|
117 |
by (auto_tac (claset(),simpset() addsimps [hypreal_of_real_def]));
|
|
118 |
by (res_inst_tac [("z","xa")] eq_Abs_hypreal 1);
|
|
119 |
by (auto_tac (claset() addIs [FreeUltrafilterNat_subset],simpset()));
|
|
120 |
qed "STAR_singleton";
|
|
121 |
Addsimps [STAR_singleton];
|
|
122 |
|
|
123 |
Goal "x ~: F ==> hypreal_of_real x ~: *s* F";
|
|
124 |
by (auto_tac (claset(),simpset() addsimps
|
|
125 |
[starset_def,hypreal_of_real_def]));
|
|
126 |
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2);
|
|
127 |
by (Auto_tac);
|
|
128 |
qed "STAR_not_mem";
|
|
129 |
|
|
130 |
Goal "[| x : *s* A; A <= B |] ==> x : *s* B";
|
|
131 |
by (blast_tac (claset() addDs [STAR_subset]) 1);
|
|
132 |
qed "STAR_subset_closed";
|
|
133 |
|
|
134 |
(*------------------------------------------------------------------
|
|
135 |
Nonstandard extension of a set (defined using a constant
|
|
136 |
sequence) as a special case of an internal set
|
|
137 |
-----------------------------------------------------------------*)
|
|
138 |
|
|
139 |
Goalw [starset_n_def,starset_def]
|
|
140 |
"ALL n. (As n = A) ==> *sn* As = *s* A";
|
|
141 |
by (Auto_tac);
|
|
142 |
qed "starset_n_starset";
|
|
143 |
|
|
144 |
|
|
145 |
(*----------------------------------------------------------------*)
|
|
146 |
(* Theorems about nonstandard extensions of functions *)
|
|
147 |
(*----------------------------------------------------------------*)
|
|
148 |
|
|
149 |
(*----------------------------------------------------------------*)
|
|
150 |
(* Nonstandard extension of a function (defined using a *)
|
|
151 |
(* constant sequence) as a special case of an internal function *)
|
|
152 |
(*----------------------------------------------------------------*)
|
|
153 |
|
|
154 |
Goalw [starfun_n_def,starfun_def]
|
|
155 |
"ALL n. (F n = f) ==> *fn* F = *f* f";
|
|
156 |
by (Auto_tac);
|
|
157 |
qed "starfun_n_starfun";
|
|
158 |
|
|
159 |
|
|
160 |
(*
|
|
161 |
Prove that hrabs is a nonstandard extension of rabs without
|
|
162 |
use of congruence property (proved after this for general
|
|
163 |
nonstandard extensions of real valued functions). This makes
|
|
164 |
proof much longer- see comments at end of HREALABS.thy where
|
|
165 |
we proved a congruence theorem for hrabs.
|
|
166 |
|
|
167 |
NEW!!! No need to prove all the lemmas anymore. Use the ultrafilter
|
|
168 |
tactic!
|
|
169 |
*)
|
|
170 |
|
|
171 |
Goalw [is_starext_def] "is_starext abs abs";
|
|
172 |
by (Step_tac 1);
|
|
173 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
174 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
175 |
by Auto_tac;
|
|
176 |
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2);
|
|
177 |
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2);
|
|
178 |
by (auto_tac (claset() addSDs [spec],
|
|
179 |
simpset() addsimps [hypreal_minus,hrabs_def,
|
|
180 |
rename_numerals hypreal_zero_def,
|
|
181 |
hypreal_le_def, hypreal_less_def]));
|
|
182 |
by (TRYALL(Ultra_tac));
|
|
183 |
by (TRYALL(arith_tac));
|
|
184 |
qed "hrabs_is_starext_rabs";
|
|
185 |
|
|
186 |
Goal "[| X: Rep_hypreal z; Y: Rep_hypreal z |] \
|
|
187 |
\ ==> {n. X n = Y n} : FreeUltrafilterNat";
|
|
188 |
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
|
|
189 |
by (Auto_tac THEN Fuf_tac 1);
|
|
190 |
qed "Rep_hypreal_FreeUltrafilterNat";
|
|
191 |
|
|
192 |
(*-----------------------------------------------------------------------
|
|
193 |
Nonstandard extension of functions- congruence
|
|
194 |
-----------------------------------------------------------------------*)
|
|
195 |
|
|
196 |
Goalw [congruent_def] "congruent hyprel (%X. hyprel^^{%n. f (X n)})";
|
|
197 |
by (safe_tac (claset()));
|
|
198 |
by (ALLGOALS(Fuf_tac));
|
|
199 |
qed "starfun_congruent";
|
|
200 |
|
|
201 |
Goalw [starfun_def]
|
|
202 |
"(*f* f) (Abs_hypreal(hyprel^^{%n. X n})) = \
|
|
203 |
\ Abs_hypreal(hyprel ^^ {%n. f (X n)})";
|
|
204 |
by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1);
|
|
205 |
by (simp_tac (simpset() addsimps
|
|
206 |
[hyprel_in_hypreal RS Abs_hypreal_inverse,[equiv_hyprel,
|
|
207 |
starfun_congruent] MRS UN_equiv_class]) 1);
|
|
208 |
qed "starfun";
|
|
209 |
|
|
210 |
(*-------------------------------------------
|
|
211 |
multiplication: ( *f ) x ( *g ) = *(f x g)
|
|
212 |
------------------------------------------*)
|
|
213 |
Goal "(*f* f) xa * (*f* g) xa = (*f* (%x. f x * g x)) xa";
|
|
214 |
by (res_inst_tac [("z","xa")] eq_Abs_hypreal 1);
|
|
215 |
by (auto_tac (claset(),simpset() addsimps [starfun,hypreal_mult]));
|
|
216 |
qed "starfun_mult";
|
|
217 |
Addsimps [starfun_mult RS sym];
|
|
218 |
|
|
219 |
(*---------------------------------------
|
|
220 |
addition: ( *f ) + ( *g ) = *(f + g)
|
|
221 |
---------------------------------------*)
|
|
222 |
Goal "(*f* f) xa + (*f* g) xa = (*f* (%x. f x + g x)) xa";
|
|
223 |
by (res_inst_tac [("z","xa")] eq_Abs_hypreal 1);
|
|
224 |
by (auto_tac (claset(),simpset() addsimps [starfun,hypreal_add]));
|
|
225 |
qed "starfun_add";
|
|
226 |
Addsimps [starfun_add RS sym];
|
|
227 |
|
|
228 |
(*--------------------------------------------
|
|
229 |
subtraction: ( *f ) + -( *g ) = *(f + -g)
|
|
230 |
-------------------------------------------*)
|
|
231 |
|
|
232 |
Goal "- (*f* f) x = (*f* (%x. - f x)) x";
|
|
233 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
234 |
by (auto_tac (claset(),simpset() addsimps [starfun, hypreal_minus]));
|
|
235 |
qed "starfun_minus";
|
|
236 |
Addsimps [starfun_minus RS sym];
|
|
237 |
|
|
238 |
(*FIXME: delete*)
|
|
239 |
Goal "(*f* f) xa + -(*f* g) xa = (*f* (%x. f x + -g x)) xa";
|
|
240 |
by (Simp_tac 1);
|
|
241 |
qed "starfun_add_minus";
|
|
242 |
Addsimps [starfun_add_minus RS sym];
|
|
243 |
|
|
244 |
Goalw [hypreal_diff_def,real_diff_def]
|
|
245 |
"(*f* f) xa - (*f* g) xa = (*f* (%x. f x - g x)) xa";
|
|
246 |
by (rtac starfun_add_minus 1);
|
|
247 |
qed "starfun_diff";
|
|
248 |
Addsimps [starfun_diff RS sym];
|
|
249 |
|
|
250 |
(*--------------------------------------
|
|
251 |
composition: ( *f ) o ( *g ) = *(f o g)
|
|
252 |
---------------------------------------*)
|
|
253 |
|
|
254 |
Goal "(%x. (*f* f) ((*f* g) x)) = *f* (%x. f (g x))";
|
|
255 |
by (rtac ext 1);
|
|
256 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
257 |
by (auto_tac (claset(),simpset() addsimps [starfun]));
|
|
258 |
qed "starfun_o2";
|
|
259 |
|
|
260 |
Goalw [o_def] "(*f* f) o (*f* g) = (*f* (f o g))";
|
|
261 |
by (simp_tac (simpset() addsimps [starfun_o2]) 1);
|
|
262 |
qed "starfun_o";
|
|
263 |
|
|
264 |
(*--------------------------------------
|
|
265 |
NS extension of constant function
|
|
266 |
--------------------------------------*)
|
|
267 |
Goal "(*f* (%x. k)) xa = hypreal_of_real k";
|
|
268 |
by (res_inst_tac [("z","xa")] eq_Abs_hypreal 1);
|
|
269 |
by (auto_tac (claset(),simpset() addsimps [starfun,
|
|
270 |
hypreal_of_real_def]));
|
|
271 |
qed "starfun_const_fun";
|
|
272 |
|
|
273 |
Addsimps [starfun_const_fun];
|
|
274 |
|
|
275 |
(*----------------------------------------------------
|
|
276 |
the NS extension of the identity function
|
|
277 |
----------------------------------------------------*)
|
|
278 |
|
|
279 |
Goal "x @= hypreal_of_real a ==> (*f* (%x. x)) x @= hypreal_of_real a";
|
|
280 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
281 |
by (auto_tac (claset(),simpset() addsimps [starfun]));
|
|
282 |
qed "starfun_Idfun_inf_close";
|
|
283 |
|
|
284 |
Goal "(*f* (%x. x)) x = x";
|
|
285 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
286 |
by (auto_tac (claset(),simpset() addsimps [starfun]));
|
|
287 |
qed "starfun_Id";
|
|
288 |
Addsimps [starfun_Id];
|
|
289 |
|
|
290 |
(*----------------------------------------------------------------------
|
|
291 |
the *-function is a (nonstandard) extension of the function
|
|
292 |
----------------------------------------------------------------------*)
|
|
293 |
|
|
294 |
Goalw [is_starext_def] "is_starext (*f* f) f";
|
|
295 |
by (Auto_tac);
|
|
296 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
297 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
298 |
by (auto_tac (claset() addSIs [bexI] ,simpset() addsimps [starfun]));
|
|
299 |
qed "is_starext_starfun";
|
|
300 |
|
|
301 |
(*----------------------------------------------------------------------
|
|
302 |
Any nonstandard extension is in fact the *-function
|
|
303 |
----------------------------------------------------------------------*)
|
|
304 |
|
|
305 |
Goalw [is_starext_def] "is_starext F f ==> F = *f* f";
|
|
306 |
by (rtac ext 1);
|
|
307 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
308 |
by (dres_inst_tac [("x","x")] spec 1);
|
|
309 |
by (dres_inst_tac [("x","(*f* f) x")] spec 1);
|
|
310 |
by (auto_tac (claset() addSDs [FreeUltrafilterNat_Compl_mem],
|
|
311 |
simpset() addsimps [starfun]));
|
|
312 |
by (Fuf_empty_tac 1);
|
|
313 |
qed "is_starfun_starext";
|
|
314 |
|
|
315 |
Goal "(is_starext F f) = (F = *f* f)";
|
|
316 |
by (blast_tac (claset() addIs [is_starfun_starext,is_starext_starfun]) 1);
|
|
317 |
qed "is_starext_starfun_iff";
|
|
318 |
|
|
319 |
(*--------------------------------------------------------
|
|
320 |
extented function has same solution as its standard
|
|
321 |
version for real arguments. i.e they are the same
|
|
322 |
for all real arguments
|
|
323 |
-------------------------------------------------------*)
|
|
324 |
Goal "(*f* f) (hypreal_of_real a) = hypreal_of_real (f a)";
|
|
325 |
by (auto_tac (claset(),simpset() addsimps
|
|
326 |
[starfun,hypreal_of_real_def]));
|
|
327 |
qed "starfun_eq";
|
|
328 |
|
|
329 |
Addsimps [starfun_eq];
|
|
330 |
|
|
331 |
Goal "(*f* f) (hypreal_of_real a) @= hypreal_of_real (f a)";
|
|
332 |
by (Auto_tac);
|
|
333 |
qed "starfun_inf_close";
|
|
334 |
|
|
335 |
(* useful for NS definition of derivatives *)
|
|
336 |
Goal "(*f* (%h. f (x + h))) xa = (*f* f) (hypreal_of_real x + xa)";
|
|
337 |
by (res_inst_tac [("z","xa")] eq_Abs_hypreal 1);
|
|
338 |
by (auto_tac (claset(),simpset() addsimps [starfun,
|
|
339 |
hypreal_of_real_def,hypreal_add]));
|
|
340 |
qed "starfun_lambda_cancel";
|
|
341 |
|
|
342 |
Goal "(*f* (%h. f(g(x + h)))) xa = (*f* (f o g)) (hypreal_of_real x + xa)";
|
|
343 |
by (res_inst_tac [("z","xa")] eq_Abs_hypreal 1);
|
|
344 |
by (auto_tac (claset(),simpset() addsimps [starfun,
|
|
345 |
hypreal_of_real_def,hypreal_add]));
|
|
346 |
qed "starfun_lambda_cancel2";
|
|
347 |
|
|
348 |
Goal "[| (*f* f) xa @= l; (*f* g) xa @= m; \
|
|
349 |
\ l: HFinite; m: HFinite \
|
|
350 |
\ |] ==> (*f* (%x. f x * g x)) xa @= l * m";
|
|
351 |
by (dtac inf_close_mult_HFinite 1);
|
|
352 |
by (REPEAT(assume_tac 1));
|
|
353 |
by (auto_tac (claset() addIs [inf_close_sym RSN (2,inf_close_HFinite)],
|
|
354 |
simpset()));
|
|
355 |
qed "starfun_mult_HFinite_inf_close";
|
|
356 |
|
|
357 |
Goal "[| (*f* f) xa @= l; (*f* g) xa @= m \
|
|
358 |
\ |] ==> (*f* (%x. f x + g x)) xa @= l + m";
|
|
359 |
by (auto_tac (claset() addIs [inf_close_add], simpset()));
|
|
360 |
qed "starfun_add_inf_close";
|
|
361 |
|
|
362 |
(*----------------------------------------------------
|
|
363 |
Examples: hrabs is nonstandard extension of rabs
|
|
364 |
inverse is nonstandard extension of inverse
|
|
365 |
---------------------------------------------------*)
|
|
366 |
|
|
367 |
(* can be proved easily using theorem "starfun" and *)
|
|
368 |
(* properties of ultrafilter as for inverse below we *)
|
|
369 |
(* use the theorem we proved above instead *)
|
|
370 |
|
|
371 |
Goal "*f* abs = abs";
|
|
372 |
by (rtac (hrabs_is_starext_rabs RS
|
|
373 |
(is_starext_starfun_iff RS iffD1) RS sym) 1);
|
|
374 |
qed "starfun_rabs_hrabs";
|
|
375 |
|
|
376 |
Goal "(*f* inverse) x = inverse(x)";
|
|
377 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
378 |
by (auto_tac (claset(),
|
|
379 |
simpset() addsimps [starfun, hypreal_inverse, hypreal_zero_def]));
|
|
380 |
qed "starfun_inverse_inverse";
|
|
381 |
Addsimps [starfun_inverse_inverse];
|
|
382 |
|
|
383 |
Goal "inverse ((*f* f) x) = (*f* (%x. inverse (f x))) x";
|
|
384 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
385 |
by (auto_tac (claset(),
|
|
386 |
simpset() addsimps [starfun, hypreal_inverse]));
|
|
387 |
qed "starfun_inverse";
|
|
388 |
Addsimps [starfun_inverse RS sym];
|
|
389 |
|
|
390 |
Goalw [hypreal_divide_def,real_divide_def]
|
|
391 |
"(*f* f) xa / (*f* g) xa = (*f* (%x. f x / g x)) xa";
|
|
392 |
by Auto_tac;
|
|
393 |
qed "starfun_divide";
|
|
394 |
Addsimps [starfun_divide RS sym];
|
|
395 |
|
|
396 |
Goal "inverse ((*f* f) x) = (*f* (%x. inverse (f x))) x";
|
|
397 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
398 |
by (auto_tac (claset() addIs [FreeUltrafilterNat_subset]
|
|
399 |
addSDs [FreeUltrafilterNat_Compl_mem],
|
|
400 |
simpset() addsimps [starfun, hypreal_inverse, hypreal_zero_def]));
|
|
401 |
qed "starfun_inverse2";
|
|
402 |
|
|
403 |
(*-------------------------------------------------------------
|
|
404 |
General lemma/theorem needed for proofs in elementary
|
|
405 |
topology of the reals
|
|
406 |
------------------------------------------------------------*)
|
|
407 |
Goalw [starset_def]
|
|
408 |
"(*f* f) x : *s* A ==> x : *s* {x. f x : A}";
|
|
409 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
410 |
by (auto_tac (claset(),simpset() addsimps [starfun]));
|
|
411 |
by (dres_inst_tac [("x","%n. f (Xa n)")] bspec 1);
|
|
412 |
by (Auto_tac THEN Fuf_tac 1);
|
|
413 |
qed "starfun_mem_starset";
|
|
414 |
|
|
415 |
(*------------------------------------------------------------
|
|
416 |
Alternative definition for hrabs with rabs function
|
|
417 |
applied entrywise to equivalence class representative.
|
|
418 |
This is easily proved using starfun and ns extension thm
|
|
419 |
------------------------------------------------------------*)
|
|
420 |
Goal "abs (Abs_hypreal (hyprel ^^ {X})) = \
|
|
421 |
\ Abs_hypreal(hyprel ^^ {%n. abs (X n)})";
|
|
422 |
by (simp_tac (simpset() addsimps [starfun_rabs_hrabs RS sym,starfun]) 1);
|
|
423 |
qed "hypreal_hrabs";
|
|
424 |
|
|
425 |
(*----------------------------------------------------------------
|
|
426 |
nonstandard extension of set through nonstandard extension
|
|
427 |
of rabs function i.e hrabs. A more general result should be
|
|
428 |
where we replace rabs by some arbitrary function f and hrabs
|
|
429 |
by its NS extenson ( *f* f). See second NS set extension below.
|
|
430 |
----------------------------------------------------------------*)
|
|
431 |
Goalw [starset_def]
|
|
432 |
"*s* {x. abs (x + - y) < r} = \
|
|
433 |
\ {x. abs(x + -hypreal_of_real y) < hypreal_of_real r}";
|
|
434 |
by (Step_tac 1);
|
|
435 |
by (ALLGOALS(res_inst_tac [("z","x")] eq_Abs_hypreal));
|
|
436 |
by (auto_tac (claset() addSIs [exI] addSDs [bspec],
|
|
437 |
simpset() addsimps [hypreal_minus, hypreal_of_real_def,hypreal_add,
|
|
438 |
hypreal_hrabs,hypreal_less_def]));
|
|
439 |
by (Fuf_tac 1);
|
|
440 |
qed "STAR_rabs_add_minus";
|
|
441 |
|
|
442 |
Goalw [starset_def]
|
|
443 |
"*s* {x. abs (f x + - y) < r} = \
|
|
444 |
\ {x. abs((*f* f) x + -hypreal_of_real y) < hypreal_of_real r}";
|
|
445 |
by (Step_tac 1);
|
|
446 |
by (ALLGOALS(res_inst_tac [("z","x")] eq_Abs_hypreal));
|
|
447 |
by (auto_tac (claset() addSIs [exI] addSDs [bspec],
|
|
448 |
simpset() addsimps [hypreal_minus, hypreal_of_real_def,hypreal_add,
|
|
449 |
hypreal_hrabs,hypreal_less_def,starfun]));
|
|
450 |
by (Fuf_tac 1);
|
|
451 |
qed "STAR_starfun_rabs_add_minus";
|
|
452 |
|
|
453 |
(*-------------------------------------------------------------------
|
|
454 |
Another charaterization of Infinitesimal and one of @= relation.
|
|
455 |
In this theory since hypreal_hrabs proved here. (To Check:) Maybe
|
|
456 |
move both if possible?
|
|
457 |
-------------------------------------------------------------------*)
|
|
458 |
Goal "(x:Infinitesimal) = \
|
|
459 |
\ (EX X:Rep_hypreal(x). \
|
|
460 |
\ ALL m. {n. abs(X n) < inverse(real_of_posnat m)}:FreeUltrafilterNat)";
|
|
461 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
462 |
by (auto_tac (claset() addSIs [bexI,lemma_hyprel_refl],
|
|
463 |
simpset() addsimps [Infinitesimal_hypreal_of_posnat_iff,
|
|
464 |
hypreal_of_real_of_posnat,hypreal_of_real_def,hypreal_inverse,
|
|
465 |
hypreal_hrabs,hypreal_less]));
|
|
466 |
by (dres_inst_tac [("x","n")] spec 1);
|
|
467 |
by (Fuf_tac 1);
|
|
468 |
qed "Infinitesimal_FreeUltrafilterNat_iff2";
|
|
469 |
|
|
470 |
Goal "(Abs_hypreal(hyprel^^{X}) @= Abs_hypreal(hyprel^^{Y})) = \
|
|
471 |
\ (ALL m. {n. abs (X n + - Y n) < \
|
|
472 |
\ inverse(real_of_posnat m)} : FreeUltrafilterNat)";
|
|
473 |
by (rtac (inf_close_minus_iff RS ssubst) 1);
|
|
474 |
by (rtac (mem_infmal_iff RS subst) 1);
|
|
475 |
by (auto_tac (claset(),
|
|
476 |
simpset() addsimps [hypreal_minus, hypreal_add,
|
|
477 |
Infinitesimal_FreeUltrafilterNat_iff2]));
|
|
478 |
by (dres_inst_tac [("x","m")] spec 1);
|
|
479 |
by (Fuf_tac 1);
|
|
480 |
qed "inf_close_FreeUltrafilterNat_iff";
|
|
481 |
|
|
482 |
Goal "inj starfun";
|
|
483 |
by (rtac injI 1);
|
|
484 |
by (rtac ext 1 THEN rtac ccontr 1);
|
|
485 |
by (dres_inst_tac [("x","Abs_hypreal(hyprel ^^{%n. xa})")] fun_cong 1);
|
|
486 |
by (auto_tac (claset(),simpset() addsimps [starfun]));
|
|
487 |
qed "inj_starfun";
|
|
488 |
|
|
489 |
|
|
490 |
|
|
491 |
|
|
492 |
|