author | paulson |
Tue, 10 Feb 2004 12:02:11 +0100 | |
changeset 14378 | 69c4d5997669 |
parent 14377 | f454b3004f8f |
permissions | -rw-r--r-- |
13957 | 1 |
(* Title : CStar.ML |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 2001 University of Edinburgh |
|
4 |
Description : defining *-transforms in NSA which extends sets of complex numbers, |
|
5 |
and complex functions |
|
6 |
*) |
|
7 |
||
8 |
||
9 |
||
10 |
(*-----------------------------------------------------------------------------------*) |
|
11 |
(* Properties of the *-transform applied to sets of reals *) |
|
12 |
(* ----------------------------------------------------------------------------------*) |
|
13 |
||
14 |
Goalw [starsetC_def] "*sc*(UNIV::complex set) = (UNIV::hcomplex set)"; |
|
15 |
by (Auto_tac); |
|
16 |
qed "STARC_complex_set"; |
|
17 |
Addsimps [STARC_complex_set]; |
|
18 |
||
19 |
Goalw [starsetC_def] "*sc* {} = {}"; |
|
20 |
by (Auto_tac); |
|
21 |
qed "STARC_empty_set"; |
|
22 |
Addsimps [STARC_empty_set]; |
|
23 |
||
24 |
Goalw [starsetC_def] "*sc* (A Un B) = *sc* A Un *sc* B"; |
|
25 |
by (Auto_tac); |
|
26 |
by (REPEAT(blast_tac (claset() addIs [FreeUltrafilterNat_subset]) 2)); |
|
27 |
by (dtac bspec 1 THEN assume_tac 1); |
|
28 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
29 |
by (Auto_tac); |
|
30 |
by (Ultra_tac 1); |
|
31 |
qed "STARC_Un"; |
|
32 |
||
33 |
Goalw [starsetC_n_def] |
|
34 |
"*scn* (%n. (A n) Un (B n)) = *scn* A Un *scn* B"; |
|
35 |
by Auto_tac; |
|
36 |
by (dres_inst_tac [("x","Xa")] bspec 1); |
|
37 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 2); |
|
38 |
by (auto_tac (claset() addSDs [bspec], simpset())); |
|
39 |
by (TRYALL(Ultra_tac)); |
|
40 |
qed "starsetC_n_Un"; |
|
41 |
||
42 |
Goalw [InternalCSets_def] |
|
43 |
"[| X : InternalCSets; Y : InternalCSets |] \ |
|
44 |
\ ==> (X Un Y) : InternalCSets"; |
|
45 |
by (auto_tac (claset(), |
|
46 |
simpset() addsimps [starsetC_n_Un RS sym])); |
|
47 |
qed "InternalCSets_Un"; |
|
48 |
||
49 |
Goalw [starsetC_def] "*sc* (A Int B) = *sc* A Int *sc* B"; |
|
50 |
by (Auto_tac); |
|
51 |
by (blast_tac (claset() addIs [FreeUltrafilterNat_Int, |
|
52 |
FreeUltrafilterNat_subset]) 3); |
|
53 |
by (REPEAT(blast_tac (claset() addIs [FreeUltrafilterNat_subset]) 1)); |
|
54 |
qed "STARC_Int"; |
|
55 |
||
56 |
Goalw [starsetC_n_def] |
|
57 |
"*scn* (%n. (A n) Int (B n)) = *scn* A Int *scn* B"; |
|
58 |
by (Auto_tac); |
|
59 |
by (auto_tac (claset() addSDs [bspec],simpset())); |
|
60 |
by (TRYALL(Ultra_tac)); |
|
61 |
qed "starsetC_n_Int"; |
|
62 |
||
63 |
Goalw [InternalCSets_def] |
|
64 |
"[| X : InternalCSets; Y : InternalCSets |] \ |
|
65 |
\ ==> (X Int Y) : InternalCSets"; |
|
66 |
by (auto_tac (claset(), |
|
67 |
simpset() addsimps [starsetC_n_Int RS sym])); |
|
68 |
qed "InternalCSets_Int"; |
|
69 |
||
70 |
Goalw [starsetC_def] "*sc* -A = -( *sc* A)"; |
|
71 |
by (Auto_tac); |
|
72 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
73 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 2); |
|
74 |
by (REPEAT(Step_tac 1) THEN Auto_tac); |
|
75 |
by (ALLGOALS(Ultra_tac)); |
|
76 |
qed "STARC_Compl"; |
|
77 |
||
78 |
Goalw [starsetC_n_def] "*scn* ((%n. - A n)) = -( *scn* A)"; |
|
79 |
by (Auto_tac); |
|
80 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
81 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 2); |
|
82 |
by (REPEAT(Step_tac 1) THEN Auto_tac); |
|
83 |
by (TRYALL(Ultra_tac)); |
|
84 |
qed "starsetC_n_Compl"; |
|
85 |
||
86 |
Goalw [InternalCSets_def] |
|
87 |
"X :InternalCSets ==> -X : InternalCSets"; |
|
88 |
by (auto_tac (claset(), |
|
89 |
simpset() addsimps [starsetC_n_Compl RS sym])); |
|
90 |
qed "InternalCSets_Compl"; |
|
91 |
||
92 |
Goal "x ~: *sc* F ==> x : *sc* (- F)"; |
|
93 |
by (auto_tac (claset(),simpset() addsimps [STARC_Compl])); |
|
94 |
qed "STARC_mem_Compl"; |
|
95 |
||
96 |
Goal "*sc* (A - B) = *sc* A - *sc* B"; |
|
97 |
by (auto_tac (claset(),simpset() addsimps |
|
14370 | 98 |
[Diff_eq,STARC_Int,STARC_Compl])); |
13957 | 99 |
qed "STARC_diff"; |
100 |
||
101 |
Goalw [starsetC_n_def] |
|
102 |
"*scn* (%n. (A n) - (B n)) = *scn* A - *scn* B"; |
|
103 |
by (Auto_tac); |
|
104 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 2); |
|
105 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 3); |
|
106 |
by (auto_tac (claset() addSDs [bspec], simpset())); |
|
107 |
by (TRYALL(Ultra_tac)); |
|
108 |
qed "starsetC_n_diff"; |
|
109 |
||
110 |
Goalw [InternalCSets_def] |
|
111 |
"[| X : InternalCSets; Y : InternalCSets |] \ |
|
112 |
\ ==> (X - Y) : InternalCSets"; |
|
113 |
by (auto_tac (claset(), simpset() addsimps [starsetC_n_diff RS sym])); |
|
114 |
qed "InternalCSets_diff"; |
|
115 |
||
116 |
Goalw [starsetC_def] "A <= B ==> *sc* A <= *sc* B"; |
|
117 |
by (REPEAT(blast_tac (claset() addIs [FreeUltrafilterNat_subset]) 1)); |
|
118 |
qed "STARC_subset"; |
|
119 |
||
120 |
Goalw [starsetC_def,hcomplex_of_complex_def] |
|
121 |
"a : A ==> hcomplex_of_complex a : *sc* A"; |
|
122 |
by (auto_tac (claset() addIs [FreeUltrafilterNat_subset], |
|
123 |
simpset())); |
|
124 |
qed "STARC_mem"; |
|
125 |
||
126 |
Goalw [starsetC_def] "hcomplex_of_complex ` A <= *sc* A"; |
|
127 |
by (auto_tac (claset(), simpset() addsimps [hcomplex_of_complex_def])); |
|
128 |
by (blast_tac (claset() addIs [FreeUltrafilterNat_subset]) 1); |
|
129 |
qed "STARC_hcomplex_of_complex_image_subset"; |
|
130 |
||
131 |
Goal "SComplex <= *sc* (UNIV:: complex set)"; |
|
132 |
by Auto_tac; |
|
133 |
qed "STARC_SComplex_subset"; |
|
134 |
||
135 |
Goalw [starsetC_def] |
|
136 |
"*sc* X Int SComplex = hcomplex_of_complex ` X"; |
|
137 |
by (auto_tac (claset(), |
|
138 |
simpset() addsimps |
|
139 |
[hcomplex_of_complex_def,SComplex_def])); |
|
140 |
by (fold_tac [hcomplex_of_complex_def]); |
|
141 |
by (rtac imageI 1 THEN rtac ccontr 1); |
|
142 |
by (dtac bspec 1); |
|
143 |
by (rtac lemma_hcomplexrel_refl 1); |
|
144 |
by (blast_tac (claset() addIs [FreeUltrafilterNat_subset]) 2); |
|
145 |
by (Auto_tac); |
|
146 |
qed "STARC_hcomplex_of_complex_Int"; |
|
147 |
||
148 |
Goal "x ~: hcomplex_of_complex ` A ==> ALL y: A. x ~= hcomplex_of_complex y"; |
|
149 |
by (Auto_tac); |
|
150 |
qed "lemma_not_hcomplexA"; |
|
151 |
||
152 |
Goalw [starsetC_n_def,starsetC_def] "*sc* X = *scn* (%n. X)"; |
|
153 |
by Auto_tac; |
|
154 |
qed "starsetC_starsetC_n_eq"; |
|
155 |
||
156 |
Goalw [InternalCSets_def] "( *sc* X) : InternalCSets"; |
|
157 |
by (auto_tac (claset(), |
|
158 |
simpset() addsimps [starsetC_starsetC_n_eq])); |
|
159 |
qed "InternalCSets_starsetC_n"; |
|
160 |
Addsimps [InternalCSets_starsetC_n]; |
|
161 |
||
162 |
Goal "X : InternalCSets ==> UNIV - X : InternalCSets"; |
|
163 |
by (auto_tac (claset() addIs [InternalCSets_Compl], simpset())); |
|
164 |
qed "InternalCSets_UNIV_diff"; |
|
165 |
||
166 |
(*-----------------------------------------------------------------------------------*) |
|
167 |
(* Nonstandard extension of a set (defined using a constant sequence) as a special *) |
|
168 |
(* case of an internal set *) |
|
169 |
(*-----------------------------------------------------------------------------------*) |
|
170 |
||
171 |
Goalw [starsetC_n_def,starsetC_def] |
|
172 |
"ALL n. (As n = A) ==> *scn* As = *sc* A"; |
|
173 |
by (Auto_tac); |
|
174 |
qed "starsetC_n_starsetC"; |
|
175 |
||
176 |
(*-----------------------------------------------------------------------------------*) |
|
177 |
(* Theorems about nonstandard extensions of functions *) |
|
178 |
(*-----------------------------------------------------------------------------------*) |
|
179 |
||
180 |
Goalw [starfunC_n_def,starfunC_def] |
|
181 |
"ALL n. (F n = f) ==> *fcn* F = *fc* f"; |
|
182 |
by (Auto_tac); |
|
183 |
qed "starfunC_n_starfunC"; |
|
184 |
||
185 |
Goalw [starfunRC_n_def,starfunRC_def] |
|
186 |
"ALL n. (F n = f) ==> *fRcn* F = *fRc* f"; |
|
187 |
by (Auto_tac); |
|
188 |
qed "starfunRC_n_starfunRC"; |
|
189 |
||
190 |
Goalw [starfunCR_n_def,starfunCR_def] |
|
191 |
"ALL n. (F n = f) ==> *fcRn* F = *fcR* f"; |
|
192 |
by (Auto_tac); |
|
193 |
qed "starfunCR_n_starfunCR"; |
|
194 |
||
195 |
Goalw [congruent_def] |
|
196 |
"congruent hcomplexrel (%X. hcomplexrel``{%n. f (X n)})"; |
|
14377 | 197 |
by (auto_tac (clasimpset() addIffs [hcomplexrel_iff])); |
13957 | 198 |
by (ALLGOALS(Ultra_tac)); |
199 |
qed "starfunC_congruent"; |
|
200 |
||
201 |
(* f::complex => complex *) |
|
202 |
Goalw [starfunC_def] |
|
203 |
"( *fc* f) (Abs_hcomplex(hcomplexrel``{%n. X n})) = \ |
|
204 |
\ Abs_hcomplex(hcomplexrel `` {%n. f (X n)})"; |
|
205 |
by (res_inst_tac [("f","Abs_hcomplex")] arg_cong 1); |
|
14377 | 206 |
by (auto_tac (clasimpset() addIffs [hcomplexrel_iff])); |
13957 | 207 |
by (Ultra_tac 1); |
208 |
qed "starfunC"; |
|
209 |
||
210 |
Goalw [starfunRC_def] |
|
211 |
"( *fRc* f) (Abs_hypreal(hyprel``{%n. X n})) = \ |
|
212 |
\ Abs_hcomplex(hcomplexrel `` {%n. f (X n)})"; |
|
213 |
by (res_inst_tac [("f","Abs_hcomplex")] arg_cong 1); |
|
214 |
by Auto_tac; |
|
215 |
by (Ultra_tac 1); |
|
216 |
qed "starfunRC"; |
|
217 |
||
218 |
Goalw [starfunCR_def] |
|
219 |
"( *fcR* f) (Abs_hcomplex(hcomplexrel``{%n. X n})) = \ |
|
220 |
\ Abs_hypreal(hyprel `` {%n. f (X n)})"; |
|
221 |
by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1); |
|
14377 | 222 |
by (auto_tac (clasimpset() addIffs [hcomplexrel_iff])); |
13957 | 223 |
by (Ultra_tac 1); |
224 |
qed "starfunCR"; |
|
225 |
||
226 |
(** multiplication: ( *f ) x ( *g ) = *(f x g) **) |
|
227 |
||
228 |
Goal "( *fc* f) z * ( *fc* g) z = ( *fc* (%x. f x * g x)) z"; |
|
229 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
230 |
by (auto_tac (claset(), simpset() addsimps [starfunC,hcomplex_mult])); |
|
231 |
qed "starfunC_mult"; |
|
232 |
Addsimps [starfunC_mult RS sym]; |
|
233 |
||
234 |
Goal "( *fRc* f) z * ( *fRc* g) z = ( *fRc* (%x. f x * g x)) z"; |
|
235 |
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1); |
|
236 |
by (auto_tac (claset(), simpset() addsimps [starfunRC,hcomplex_mult])); |
|
237 |
qed "starfunRC_mult"; |
|
238 |
Addsimps [starfunRC_mult RS sym]; |
|
239 |
||
240 |
Goal "( *fcR* f) z * ( *fcR* g) z = ( *fcR* (%x. f x * g x)) z"; |
|
241 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
242 |
by (auto_tac (claset(), simpset() addsimps [starfunCR,hypreal_mult])); |
|
243 |
qed "starfunCR_mult"; |
|
244 |
Addsimps [starfunCR_mult RS sym]; |
|
245 |
||
246 |
(** addition: ( *f ) + ( *g ) = *(f + g) **) |
|
247 |
||
248 |
Goal "( *fc* f) z + ( *fc* g) z = ( *fc* (%x. f x + g x)) z"; |
|
249 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
250 |
by (auto_tac (claset(), simpset() addsimps [starfunC,hcomplex_add])); |
|
251 |
qed "starfunC_add"; |
|
252 |
Addsimps [starfunC_add RS sym]; |
|
253 |
||
254 |
Goal "( *fRc* f) z + ( *fRc* g) z = ( *fRc* (%x. f x + g x)) z"; |
|
255 |
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1); |
|
256 |
by (auto_tac (claset(), simpset() addsimps [starfunRC,hcomplex_add])); |
|
257 |
qed "starfunRC_add"; |
|
258 |
Addsimps [starfunRC_add RS sym]; |
|
259 |
||
260 |
Goal "( *fcR* f) z + ( *fcR* g) z = ( *fcR* (%x. f x + g x)) z"; |
|
261 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
262 |
by (auto_tac (claset(), simpset() addsimps [starfunCR,hypreal_add])); |
|
263 |
qed "starfunCR_add"; |
|
264 |
Addsimps [starfunCR_add RS sym]; |
|
265 |
||
266 |
(** uminus **) |
|
267 |
Goal "( *fc* (%x. - f x)) x = - ( *fc* f) x"; |
|
268 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
269 |
by (auto_tac (claset(),simpset() addsimps [starfunC, hcomplex_minus])); |
|
270 |
qed "starfunC_minus"; |
|
271 |
Addsimps [starfunC_minus]; |
|
272 |
||
273 |
Goal "( *fRc* (%x. - f x)) x = - ( *fRc* f) x"; |
|
274 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
275 |
by (auto_tac (claset(),simpset() addsimps [starfunRC, hcomplex_minus])); |
|
276 |
qed "starfunRC_minus"; |
|
277 |
Addsimps [starfunRC_minus]; |
|
278 |
||
279 |
Goal "( *fcR* (%x. - f x)) x = - ( *fcR* f) x"; |
|
280 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
281 |
by (auto_tac (claset(),simpset() addsimps [starfunCR, hypreal_minus])); |
|
282 |
qed "starfunCR_minus"; |
|
283 |
Addsimps [starfunCR_minus]; |
|
284 |
||
285 |
(** addition: ( *f ) - ( *g ) = *(f - g) **) |
|
286 |
||
287 |
Goalw [hcomplex_diff_def,complex_diff_def] |
|
288 |
"( *fc* f) xa - ( *fc* g) xa = ( *fc* (%x. f x - g x)) xa"; |
|
289 |
by (auto_tac (claset(),simpset() addsimps [starfunC_minus,starfunC_add RS sym])); |
|
290 |
qed "starfunC_diff"; |
|
291 |
Addsimps [starfunC_diff RS sym]; |
|
292 |
||
293 |
Goalw [hcomplex_diff_def,complex_diff_def] |
|
294 |
"( *fRc* f) xa - ( *fRc* g) xa = ( *fRc* (%x. f x - g x)) xa"; |
|
295 |
by (auto_tac (claset(),simpset() addsimps [starfunRC_minus,starfunRC_add RS sym])); |
|
296 |
qed "starfunRC_diff"; |
|
297 |
Addsimps [starfunRC_diff RS sym]; |
|
298 |
||
299 |
Goalw [hypreal_diff_def,real_diff_def] |
|
300 |
"( *fcR* f) xa - ( *fcR* g) xa = ( *fcR* (%x. f x - g x)) xa"; |
|
301 |
by (auto_tac (claset(),simpset() addsimps [starfunCR_minus,starfunCR_add RS sym])); |
|
302 |
qed "starfunCR_diff"; |
|
303 |
Addsimps [starfunCR_diff RS sym]; |
|
304 |
||
305 |
(** composition: ( *f ) o ( *g ) = *(f o g) **) |
|
306 |
||
307 |
Goal "(%x. ( *fc* f) (( *fc* g) x)) = *fc* (%x. f (g x))"; |
|
308 |
by (rtac ext 1); |
|
309 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
310 |
by (auto_tac (claset(),simpset() addsimps [starfunC])); |
|
311 |
qed "starfunC_o2"; |
|
312 |
||
313 |
Goalw [o_def] "( *fc* f) o ( *fc* g) = ( *fc* (f o g))"; |
|
314 |
by (simp_tac (simpset() addsimps [starfunC_o2]) 1); |
|
315 |
qed "starfunC_o"; |
|
316 |
||
317 |
Goal "(%x. ( *fc* f) (( *fRc* g) x)) = *fRc* (%x. f (g x))"; |
|
318 |
by (rtac ext 1); |
|
319 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
320 |
by (auto_tac (claset(),simpset() addsimps [starfunRC,starfunC])); |
|
321 |
qed "starfunC_starfunRC_o2"; |
|
322 |
||
323 |
Goal "(%x. ( *f* f) (( *fcR* g) x)) = *fcR* (%x. f (g x))"; |
|
324 |
by (rtac ext 1); |
|
325 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
326 |
by (auto_tac (claset(),simpset() addsimps [starfunCR,starfun])); |
|
327 |
qed "starfun_starfunCR_o2"; |
|
328 |
||
329 |
Goalw [o_def] "( *fc* f) o ( *fRc* g) = ( *fRc* (f o g))"; |
|
330 |
by (simp_tac (simpset() addsimps [starfunC_starfunRC_o2]) 1); |
|
331 |
qed "starfunC_starfunRC_o"; |
|
332 |
||
333 |
Goalw [o_def] "( *f* f) o ( *fcR* g) = ( *fcR* (f o g))"; |
|
334 |
by (simp_tac (simpset() addsimps [starfun_starfunCR_o2]) 1); |
|
335 |
qed "starfun_starfunCR_o"; |
|
336 |
||
337 |
Goal "( *fc* (%x. k)) z = hcomplex_of_complex k"; |
|
338 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
339 |
by (auto_tac (claset(), simpset() addsimps [starfunC, hcomplex_of_complex_def])); |
|
340 |
qed "starfunC_const_fun"; |
|
341 |
Addsimps [starfunC_const_fun]; |
|
342 |
||
343 |
Goal "( *fRc* (%x. k)) z = hcomplex_of_complex k"; |
|
344 |
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1); |
|
345 |
by (auto_tac (claset(), simpset() addsimps [starfunRC, hcomplex_of_complex_def])); |
|
346 |
qed "starfunRC_const_fun"; |
|
347 |
Addsimps [starfunRC_const_fun]; |
|
348 |
||
349 |
Goal "( *fcR* (%x. k)) z = hypreal_of_real k"; |
|
350 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
351 |
by (auto_tac (claset(), simpset() addsimps [starfunCR, hypreal_of_real_def])); |
|
352 |
qed "starfunCR_const_fun"; |
|
353 |
Addsimps [starfunCR_const_fun]; |
|
354 |
||
355 |
Goal "inverse (( *fc* f) x) = ( *fc* (%x. inverse (f x))) x"; |
|
356 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
357 |
by (auto_tac (claset(), simpset() addsimps [starfunC, hcomplex_inverse])); |
|
358 |
qed "starfunC_inverse"; |
|
359 |
Addsimps [starfunC_inverse RS sym]; |
|
360 |
||
361 |
Goal "inverse (( *fRc* f) x) = ( *fRc* (%x. inverse (f x))) x"; |
|
362 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
363 |
by (auto_tac (claset(), simpset() addsimps [starfunRC, hcomplex_inverse])); |
|
364 |
qed "starfunRC_inverse"; |
|
365 |
Addsimps [starfunRC_inverse RS sym]; |
|
366 |
||
367 |
Goal "inverse (( *fcR* f) x) = ( *fcR* (%x. inverse (f x))) x"; |
|
368 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
369 |
by (auto_tac (claset(), simpset() addsimps [starfunCR, hypreal_inverse])); |
|
370 |
qed "starfunCR_inverse"; |
|
371 |
Addsimps [starfunCR_inverse RS sym]; |
|
372 |
||
373 |
Goal "( *fc* f) (hcomplex_of_complex a) = hcomplex_of_complex (f a)"; |
|
374 |
by (auto_tac (claset(), |
|
375 |
simpset() addsimps [starfunC,hcomplex_of_complex_def])); |
|
376 |
qed "starfunC_eq"; |
|
377 |
Addsimps [starfunC_eq]; |
|
378 |
||
379 |
Goal "( *fRc* f) (hypreal_of_real a) = hcomplex_of_complex (f a)"; |
|
380 |
by (auto_tac (claset(), |
|
381 |
simpset() addsimps [starfunRC,hcomplex_of_complex_def,hypreal_of_real_def])); |
|
382 |
qed "starfunRC_eq"; |
|
383 |
Addsimps [starfunRC_eq]; |
|
384 |
||
385 |
Goal "( *fcR* f) (hcomplex_of_complex a) = hypreal_of_real (f a)"; |
|
386 |
by (auto_tac (claset(), |
|
387 |
simpset() addsimps [starfunCR,hcomplex_of_complex_def,hypreal_of_real_def])); |
|
388 |
qed "starfunCR_eq"; |
|
389 |
Addsimps [starfunCR_eq]; |
|
390 |
||
391 |
Goal "( *fc* f) (hcomplex_of_complex a) @c= hcomplex_of_complex (f a)"; |
|
392 |
by (Auto_tac); |
|
393 |
qed "starfunC_capprox"; |
|
394 |
||
395 |
Goal "( *fRc* f) (hypreal_of_real a) @c= hcomplex_of_complex (f a)"; |
|
396 |
by (Auto_tac); |
|
397 |
qed "starfunRC_capprox"; |
|
398 |
||
399 |
Goal "( *fcR* f) (hcomplex_of_complex a) @= hypreal_of_real (f a)"; |
|
400 |
by (Auto_tac); |
|
401 |
qed "starfunCR_approx"; |
|
402 |
||
403 |
(* |
|
404 |
Goal "( *fcNat* (%n. z ^ n)) N = (hcomplex_of_complex z) hcpow N"; |
|
405 |
*) |
|
406 |
||
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14377
diff
changeset
|
407 |
Goal "( *fc* (%z. z ^ n)) Z = Z hcpow hypnat_of_nat n"; |
13957 | 408 |
by (res_inst_tac [("z","Z")] eq_Abs_hcomplex 1); |
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14377
diff
changeset
|
409 |
by (auto_tac (claset(), simpset() addsimps [hcpow,starfunC,hypnat_of_nat_eq])); |
13957 | 410 |
qed "starfunC_hcpow"; |
411 |
||
412 |
Goal "( *fc* (%h. f (x + h))) xa = ( *fc* f) (hcomplex_of_complex x + xa)"; |
|
413 |
by (res_inst_tac [("z","xa")] eq_Abs_hcomplex 1); |
|
414 |
by (auto_tac (claset(),simpset() addsimps [starfunC, |
|
415 |
hcomplex_of_complex_def,hcomplex_add])); |
|
416 |
qed "starfunC_lambda_cancel"; |
|
417 |
||
418 |
Goal "( *fcR* (%h. f (x + h))) xa = ( *fcR* f) (hcomplex_of_complex x + xa)"; |
|
419 |
by (res_inst_tac [("z","xa")] eq_Abs_hcomplex 1); |
|
420 |
by (auto_tac (claset(),simpset() addsimps [starfunCR, |
|
421 |
hcomplex_of_complex_def,hcomplex_add])); |
|
422 |
qed "starfunCR_lambda_cancel"; |
|
423 |
||
424 |
Goal "( *fRc* (%h. f (x + h))) xa = ( *fRc* f) (hypreal_of_real x + xa)"; |
|
425 |
by (res_inst_tac [("z","xa")] eq_Abs_hypreal 1); |
|
426 |
by (auto_tac (claset(),simpset() addsimps [starfunRC, |
|
427 |
hypreal_of_real_def,hypreal_add])); |
|
428 |
qed "starfunRC_lambda_cancel"; |
|
429 |
||
430 |
Goal "( *fc* (%h. f(g(x + h)))) xa = ( *fc* (f o g)) (hcomplex_of_complex x + xa)"; |
|
431 |
by (res_inst_tac [("z","xa")] eq_Abs_hcomplex 1); |
|
432 |
by (auto_tac (claset(),simpset() addsimps [starfunC, |
|
433 |
hcomplex_of_complex_def,hcomplex_add])); |
|
434 |
qed "starfunC_lambda_cancel2"; |
|
435 |
||
436 |
Goal "( *fcR* (%h. f(g(x + h)))) xa = ( *fcR* (f o g)) (hcomplex_of_complex x + xa)"; |
|
437 |
by (res_inst_tac [("z","xa")] eq_Abs_hcomplex 1); |
|
438 |
by (auto_tac (claset(),simpset() addsimps [starfunCR, |
|
439 |
hcomplex_of_complex_def,hcomplex_add])); |
|
440 |
qed "starfunCR_lambda_cancel2"; |
|
441 |
||
442 |
Goal "( *fRc* (%h. f(g(x + h)))) xa = ( *fRc* (f o g)) (hypreal_of_real x + xa)"; |
|
443 |
by (res_inst_tac [("z","xa")] eq_Abs_hypreal 1); |
|
444 |
by (auto_tac (claset(),simpset() addsimps [starfunRC, |
|
445 |
hypreal_of_real_def,hypreal_add])); |
|
446 |
qed "starfunRC_lambda_cancel2"; |
|
447 |
||
448 |
Goal "[| ( *fc* f) xa @c= l; ( *fc* g) xa @c= m; \ |
|
449 |
\ l: CFinite; m: CFinite \ |
|
450 |
\ |] ==> ( *fc* (%x. f x * g x)) xa @c= l * m"; |
|
451 |
by (dtac capprox_mult_CFinite 1); |
|
452 |
by (REPEAT(assume_tac 1)); |
|
453 |
by (auto_tac (claset() addIs [capprox_sym RSN (2,capprox_CFinite)], |
|
454 |
simpset())); |
|
455 |
qed "starfunC_mult_CFinite_capprox"; |
|
456 |
||
457 |
Goal "[| ( *fcR* f) xa @= l; ( *fcR* g) xa @= m; \ |
|
458 |
\ l: HFinite; m: HFinite \ |
|
459 |
\ |] ==> ( *fcR* (%x. f x * g x)) xa @= l * m"; |
|
460 |
by (dtac approx_mult_HFinite 1); |
|
461 |
by (REPEAT(assume_tac 1)); |
|
462 |
by (auto_tac (claset() addIs [approx_sym RSN (2,approx_HFinite)], |
|
463 |
simpset())); |
|
464 |
qed "starfunCR_mult_HFinite_capprox"; |
|
465 |
||
466 |
Goal "[| ( *fRc* f) xa @c= l; ( *fRc* g) xa @c= m; \ |
|
467 |
\ l: CFinite; m: CFinite \ |
|
468 |
\ |] ==> ( *fRc* (%x. f x * g x)) xa @c= l * m"; |
|
469 |
by (dtac capprox_mult_CFinite 1); |
|
470 |
by (REPEAT(assume_tac 1)); |
|
471 |
by (auto_tac (claset() addIs [capprox_sym RSN (2,capprox_CFinite)], |
|
472 |
simpset())); |
|
473 |
qed "starfunRC_mult_CFinite_capprox"; |
|
474 |
||
475 |
Goal "[| ( *fc* f) xa @c= l; ( *fc* g) xa @c= m \ |
|
476 |
\ |] ==> ( *fc* (%x. f x + g x)) xa @c= l + m"; |
|
477 |
by (auto_tac (claset() addIs [capprox_add], simpset())); |
|
478 |
qed "starfunC_add_capprox"; |
|
479 |
||
480 |
Goal "[| ( *fRc* f) xa @c= l; ( *fRc* g) xa @c= m \ |
|
481 |
\ |] ==> ( *fRc* (%x. f x + g x)) xa @c= l + m"; |
|
482 |
by (auto_tac (claset() addIs [capprox_add], simpset())); |
|
483 |
qed "starfunRC_add_capprox"; |
|
484 |
||
485 |
Goal "[| ( *fcR* f) xa @= l; ( *fcR* g) xa @= m \ |
|
486 |
\ |] ==> ( *fcR* (%x. f x + g x)) xa @= l + m"; |
|
487 |
by (auto_tac (claset() addIs [approx_add], simpset())); |
|
488 |
qed "starfunCR_add_approx"; |
|
489 |
||
490 |
Goal "*fcR* cmod = hcmod"; |
|
491 |
by (rtac ext 1); |
|
492 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
493 |
by (auto_tac (claset(),simpset() addsimps [starfunCR,hcmod])); |
|
494 |
qed "starfunCR_cmod"; |
|
495 |
||
496 |
Goal "( *fc* inverse) x = inverse(x)"; |
|
497 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
498 |
by (auto_tac (claset(),simpset() addsimps [starfunC,hcomplex_inverse])); |
|
499 |
qed "starfunC_inverse_inverse"; |
|
500 |
||
501 |
Goalw [hcomplex_divide_def,complex_divide_def] |
|
502 |
"( *fc* f) xa / ( *fc* g) xa = ( *fc* (%x. f x / g x)) xa"; |
|
503 |
by Auto_tac; |
|
504 |
qed "starfunC_divide"; |
|
505 |
Addsimps [starfunC_divide RS sym]; |
|
506 |
||
507 |
Goalw [hypreal_divide_def,real_divide_def] |
|
508 |
"( *fcR* f) xa / ( *fcR* g) xa = ( *fcR* (%x. f x / g x)) xa"; |
|
509 |
by Auto_tac; |
|
510 |
qed "starfunCR_divide"; |
|
511 |
Addsimps [starfunCR_divide RS sym]; |
|
512 |
||
513 |
Goalw [hcomplex_divide_def,complex_divide_def] |
|
514 |
"( *fRc* f) xa / ( *fRc* g) xa = ( *fRc* (%x. f x / g x)) xa"; |
|
515 |
by Auto_tac; |
|
516 |
qed "starfunRC_divide"; |
|
517 |
Addsimps [starfunRC_divide RS sym]; |
|
518 |
||
519 |
(*-----------------------------------------------------------------------------------*) |
|
520 |
(* Internal functions - some redundancy with *fc* now *) |
|
521 |
(*-----------------------------------------------------------------------------------*) |
|
522 |
||
523 |
Goalw [congruent_def] |
|
524 |
"congruent hcomplexrel (%X. hcomplexrel``{%n. f n (X n)})"; |
|
14377 | 525 |
by (auto_tac (clasimpset() addIffs [hcomplexrel_iff])); |
13957 | 526 |
by (ALLGOALS(Fuf_tac)); |
527 |
qed "starfunC_n_congruent"; |
|
528 |
||
529 |
Goalw [starfunC_n_def] |
|
530 |
"( *fcn* f) (Abs_hcomplex(hcomplexrel``{%n. X n})) = \ |
|
531 |
\ Abs_hcomplex(hcomplexrel `` {%n. f n (X n)})"; |
|
532 |
by (res_inst_tac [("f","Abs_hcomplex")] arg_cong 1); |
|
14377 | 533 |
by (auto_tac (clasimpset() addIffs [hcomplexrel_iff])); |
13957 | 534 |
by (Ultra_tac 1); |
535 |
qed "starfunC_n"; |
|
536 |
||
537 |
(** multiplication: ( *fn ) x ( *gn ) = *(fn x gn) **) |
|
538 |
||
539 |
Goal "( *fcn* f) z * ( *fcn* g) z = ( *fcn* (% i x. f i x * g i x)) z"; |
|
540 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
541 |
by (auto_tac (claset(), simpset() addsimps [starfunC_n,hcomplex_mult])); |
|
542 |
qed "starfunC_n_mult"; |
|
543 |
||
544 |
(** addition: ( *fn ) + ( *gn ) = *(fn + gn) **) |
|
545 |
||
546 |
Goal "( *fcn* f) z + ( *fcn* g) z = ( *fcn* (%i x. f i x + g i x)) z"; |
|
547 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
548 |
by (auto_tac (claset(), simpset() addsimps [starfunC_n,hcomplex_add])); |
|
549 |
qed "starfunC_n_add"; |
|
550 |
||
551 |
(** uminus **) |
|
552 |
||
553 |
Goal "- ( *fcn* g) z = ( *fcn* (%i x. - g i x)) z"; |
|
554 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
555 |
by (auto_tac (claset(), simpset() addsimps [starfunC_n,hcomplex_minus])); |
|
556 |
qed "starfunC_n_minus"; |
|
557 |
||
558 |
(** subtraction: ( *fn ) - ( *gn ) = *(fn - gn) **) |
|
559 |
||
560 |
Goalw [hcomplex_diff_def,complex_diff_def] |
|
561 |
"( *fcn* f) z - ( *fcn* g) z = ( *fcn* (%i x. f i x - g i x)) z"; |
|
562 |
by (auto_tac (claset(), |
|
563 |
simpset() addsimps [starfunC_n_add,starfunC_n_minus])); |
|
564 |
qed "starfunNat_n_diff"; |
|
565 |
||
566 |
(** composition: ( *fn ) o ( *gn ) = *(fn o gn) **) |
|
567 |
||
568 |
Goal "( *fcn* (%i x. k)) z = hcomplex_of_complex k"; |
|
569 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
570 |
by (auto_tac (claset(), |
|
571 |
simpset() addsimps [starfunC_n, hcomplex_of_complex_def])); |
|
572 |
qed "starfunC_n_const_fun"; |
|
573 |
Addsimps [starfunC_n_const_fun]; |
|
574 |
||
575 |
Goal "( *fcn* f) (hcomplex_of_complex n) = Abs_hcomplex(hcomplexrel `` {%i. f i n})"; |
|
576 |
by (auto_tac (claset(), simpset() addsimps [starfunC_n,hcomplex_of_complex_def])); |
|
577 |
qed "starfunC_n_eq"; |
|
578 |
Addsimps [starfunC_n_eq]; |
|
579 |
||
580 |
Goal "(( *fc* f) = ( *fc* g)) = (f = g)"; |
|
581 |
by Auto_tac; |
|
582 |
by (rtac ext 1 THEN rtac ccontr 1); |
|
583 |
by (dres_inst_tac [("x","hcomplex_of_complex(x)")] fun_cong 1); |
|
584 |
by (auto_tac (claset(), simpset() addsimps [starfunC,hcomplex_of_complex_def])); |
|
585 |
qed "starfunC_eq_iff"; |
|
586 |
||
587 |
Goal "(( *fRc* f) = ( *fRc* g)) = (f = g)"; |
|
588 |
by Auto_tac; |
|
589 |
by (rtac ext 1 THEN rtac ccontr 1); |
|
590 |
by (dres_inst_tac [("x","hypreal_of_real(x)")] fun_cong 1); |
|
591 |
by Auto_tac; |
|
592 |
qed "starfunRC_eq_iff"; |
|
593 |
||
594 |
Goal "(( *fcR* f) = ( *fcR* g)) = (f = g)"; |
|
595 |
by Auto_tac; |
|
596 |
by (rtac ext 1 THEN rtac ccontr 1); |
|
597 |
by (dres_inst_tac [("x","hcomplex_of_complex(x)")] fun_cong 1); |
|
598 |
by Auto_tac; |
|
599 |
qed "starfunCR_eq_iff"; |
|
600 |
||
601 |
(*** more theorems ***) |
|
602 |
||
603 |
Goal "(( *fc* f) x = z) = ((( *fcR* (%x. Re(f x))) x = hRe (z)) & \ |
|
604 |
\ (( *fcR* (%x. Im(f x))) x = hIm (z)))"; |
|
605 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
606 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
607 |
by (auto_tac (claset(),simpset() addsimps [starfunCR,starfunC, |
|
608 |
hIm,hRe,complex_Re_Im_cancel_iff])); |
|
609 |
by (ALLGOALS(Ultra_tac)); |
|
610 |
qed "starfunC_eq_Re_Im_iff"; |
|
611 |
||
612 |
Goal "(( *fc* f) x @c= z) = ((( *fcR* (%x. Re(f x))) x @= hRe (z)) & \ |
|
613 |
\ (( *fcR* (%x. Im(f x))) x @= hIm (z)))"; |
|
614 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
615 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
616 |
by (auto_tac (claset(),simpset() addsimps [starfunCR,starfunC, |
|
617 |
hIm,hRe,capprox_approx_iff])); |
|
618 |
qed "starfunC_approx_Re_Im_iff"; |
|
619 |
||
620 |
Goal "x @c= hcomplex_of_complex a ==> ( *fc* (%x. x)) x @c= hcomplex_of_complex a"; |
|
621 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
622 |
by (auto_tac (claset(),simpset() addsimps [starfunC])); |
|
623 |
qed "starfunC_Idfun_capprox"; |
|
624 |
||
625 |
Goal "( *fc* (%x. x)) x = x"; |
|
626 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
627 |
by (auto_tac (claset(),simpset() addsimps [starfunC])); |
|
628 |
qed "starfunC_Id"; |
|
629 |
Addsimps [starfunC_Id]; |