author | paulson |
Tue, 03 Feb 2004 11:06:36 +0100 | |
changeset 14373 | 67a628beb981 |
parent 14365 | 3d4df8c166ae |
child 14374 | 61de62096768 |
permissions | -rw-r--r-- |
13957 | 1 |
(* Title : NSCA.ML |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 2001,2002 University of Edinburgh |
|
4 |
Description : Infinite, infinitesimal complex number etc! |
|
5 |
*) |
|
6 |
||
14373 | 7 |
val complex_induct = thm"complex.induct"; |
8 |
||
9 |
||
13957 | 10 |
(*--------------------------------------------------------------------------------------*) |
11 |
(* Closure laws for members of (embedded) set standard complex SComplex *) |
|
12 |
(* -------------------------------------------------------------------------------------*) |
|
13 |
||
14 |
Goalw [SComplex_def] "[| (x::hcomplex): SComplex; y: SComplex |] ==> x + y: SComplex"; |
|
15 |
by (Step_tac 1); |
|
16 |
by (res_inst_tac [("x","r + ra")] exI 1); |
|
17 |
by (Simp_tac 1); |
|
18 |
qed "SComplex_add"; |
|
19 |
||
20 |
Goalw [SComplex_def] "[| (x::hcomplex): SComplex; y: SComplex |] ==> x * y: SComplex"; |
|
21 |
by (Step_tac 1); |
|
22 |
by (res_inst_tac [("x","r * ra")] exI 1); |
|
23 |
by (Simp_tac 1); |
|
24 |
qed "SComplex_mult"; |
|
25 |
||
26 |
Goalw [SComplex_def] "x: SComplex ==> inverse x : SComplex"; |
|
27 |
by (blast_tac (claset() addIs [hcomplex_of_complex_inverse RS sym]) 1); |
|
28 |
qed "SComplex_inverse"; |
|
29 |
||
30 |
Goal "[| x: SComplex; y: SComplex |] ==> x/y: SComplex"; |
|
31 |
by (asm_simp_tac (simpset() addsimps [SComplex_mult,SComplex_inverse, |
|
32 |
hcomplex_divide_def]) 1); |
|
33 |
qed "SComplex_divide"; |
|
34 |
||
35 |
Goalw [SComplex_def] "x: SComplex ==> -x : SComplex"; |
|
36 |
by (blast_tac (claset() addIs [hcomplex_of_complex_minus RS sym]) 1); |
|
37 |
qed "SComplex_minus"; |
|
38 |
||
39 |
Goal "(-x : SComplex) = (x: SComplex)"; |
|
40 |
by Auto_tac; |
|
41 |
by (etac SComplex_minus 2); |
|
42 |
by (dtac SComplex_minus 1); |
|
43 |
by Auto_tac; |
|
44 |
qed "SComplex_minus_iff"; |
|
45 |
Addsimps [SComplex_minus_iff]; |
|
46 |
||
47 |
Goal "[| x + y : SComplex; y: SComplex |] ==> x: SComplex"; |
|
48 |
by (dres_inst_tac [("x","y")] SComplex_minus 1); |
|
49 |
by (dtac SComplex_add 1); |
|
50 |
by (assume_tac 1); |
|
51 |
by Auto_tac; |
|
52 |
qed "SComplex_add_cancel"; |
|
53 |
||
54 |
Goalw [hcomplex_of_complex_def] |
|
55 |
"hcmod (hcomplex_of_complex r) : Reals"; |
|
56 |
by (simp_tac (simpset() addsimps [hcmod,SReal_def, |
|
57 |
hypreal_of_real_def]) 1); |
|
58 |
qed "SReal_hcmod_hcomplex_of_complex"; |
|
59 |
Addsimps [SReal_hcmod_hcomplex_of_complex]; |
|
60 |
||
61 |
Goalw [hcomplex_number_of_def] |
|
62 |
"hcmod (number_of w ::hcomplex) : Reals"; |
|
63 |
by (rtac SReal_hcmod_hcomplex_of_complex 1); |
|
64 |
qed "SReal_hcmod_number_of"; |
|
65 |
Addsimps [SReal_hcmod_number_of]; |
|
66 |
||
67 |
Goalw [SComplex_def] "x: SComplex ==> hcmod x : Reals"; |
|
68 |
by Auto_tac; |
|
69 |
qed "SReal_hcmod_SComplex"; |
|
70 |
||
71 |
Goalw [SComplex_def] "hcomplex_of_complex x: SComplex"; |
|
72 |
by (Blast_tac 1); |
|
73 |
qed "SComplex_hcomplex_of_complex"; |
|
74 |
Addsimps [SComplex_hcomplex_of_complex]; |
|
75 |
||
76 |
Goalw [hcomplex_number_of_def] "(number_of w ::hcomplex) : SComplex"; |
|
77 |
by (rtac SComplex_hcomplex_of_complex 1); |
|
78 |
qed "SComplex_number_of"; |
|
79 |
Addsimps [SComplex_number_of]; |
|
80 |
||
81 |
Goalw [hcomplex_divide_def] "r : SComplex ==> r/(number_of w::hcomplex) : SComplex"; |
|
82 |
by (blast_tac (claset() addSIs [SComplex_number_of, SComplex_mult, |
|
83 |
SComplex_inverse]) 1); |
|
84 |
qed "SComplex_divide_number_of"; |
|
85 |
||
86 |
Goalw [SComplex_def] "{x. hcomplex_of_complex x : SComplex} = (UNIV::complex set)"; |
|
87 |
by Auto_tac; |
|
88 |
qed "SComplex_UNIV_complex"; |
|
89 |
||
90 |
Goalw [SComplex_def] "(x: SComplex) = (EX y. x = hcomplex_of_complex y)"; |
|
91 |
by Auto_tac; |
|
92 |
qed "SComplex_iff"; |
|
93 |
||
94 |
Goalw [SComplex_def] "hcomplex_of_complex `(UNIV::complex set) = SComplex"; |
|
95 |
by Auto_tac; |
|
96 |
qed "hcomplex_of_complex_image"; |
|
97 |
||
98 |
Goalw [SComplex_def] "inv hcomplex_of_complex `SComplex = (UNIV::complex set)"; |
|
99 |
by Auto_tac; |
|
100 |
by (rtac (inj_hcomplex_of_complex RS inv_f_f RS subst) 1); |
|
101 |
by (Blast_tac 1); |
|
102 |
qed "inv_hcomplex_of_complex_image"; |
|
103 |
||
104 |
Goalw [SComplex_def] |
|
105 |
"[| EX x. x: P; P <= SComplex |] ==> EX Q. P = hcomplex_of_complex ` Q"; |
|
106 |
by (Best_tac 1); |
|
107 |
qed "SComplex_hcomplex_of_complex_image"; |
|
108 |
||
109 |
Goal "[| (x::hcomplex): SComplex; y: SComplex; hcmod x < hcmod y \ |
|
110 |
\ |] ==> EX r: Reals. hcmod x< r & r < hcmod y"; |
|
111 |
by (auto_tac (claset() addIs [SReal_dense], simpset() |
|
112 |
addsimps [SReal_hcmod_SComplex])); |
|
113 |
qed "SComplex_SReal_dense"; |
|
114 |
||
115 |
Goalw [SComplex_def,SReal_def] |
|
116 |
"z : SComplex ==> hcmod z : Reals"; |
|
117 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
118 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hypreal_of_real_def, |
|
119 |
hcomplex_of_complex_def,cmod_def])); |
|
120 |
by (res_inst_tac [("x","cmod r")] exI 1); |
|
121 |
by (ultra_tac (claset(),simpset() addsimps [cmod_def]) 1); |
|
122 |
qed "SComplex_hcmod_SReal"; |
|
123 |
||
124 |
Goal "0 : SComplex"; |
|
125 |
by (auto_tac (claset(),simpset() addsimps [SComplex_def])); |
|
126 |
qed "SComplex_zero"; |
|
127 |
Addsimps [SComplex_zero]; |
|
128 |
||
129 |
Goal "1 : SComplex"; |
|
130 |
by (auto_tac (claset(),simpset() addsimps [SComplex_def,hcomplex_of_complex_def, |
|
131 |
hcomplex_one_def])); |
|
132 |
qed "SComplex_one"; |
|
133 |
Addsimps [SComplex_one]; |
|
134 |
||
135 |
(* |
|
136 |
Goalw [SComplex_def,SReal_def] "hcmod z : Reals ==> z : SComplex"; |
|
137 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
|
138 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hypreal_of_real_def, |
|
139 |
hcomplex_of_complex_def,cmod_def])); |
|
140 |
*) |
|
141 |
||
142 |
(*--------------------------------------------------------------------------------------------*) |
|
143 |
(* Set of finite elements is a subring of the extended complex numbers *) |
|
144 |
(* -------------------------------------------------------------------------------------------*) |
|
145 |
||
146 |
Goalw [CFinite_def] "[|x : CFinite; y : CFinite|] ==> (x+y) : CFinite"; |
|
147 |
by (blast_tac (claset() addSIs [SReal_add,hcmod_add_less]) 1); |
|
148 |
qed "CFinite_add"; |
|
149 |
||
150 |
Goalw [CFinite_def] "[|x : CFinite; y : CFinite|] ==> x*y : CFinite"; |
|
151 |
by (blast_tac (claset() addSIs [SReal_mult,hcmod_mult_less]) 1); |
|
152 |
qed "CFinite_mult"; |
|
153 |
||
154 |
Goalw [CFinite_def] "(-x : CFinite) = (x : CFinite)"; |
|
155 |
by (Simp_tac 1); |
|
156 |
qed "CFinite_minus_iff"; |
|
157 |
Addsimps [CFinite_minus_iff]; |
|
158 |
||
159 |
Goalw [SComplex_def,CFinite_def] "SComplex <= CFinite"; |
|
160 |
by Auto_tac; |
|
161 |
by (res_inst_tac [("x","1 + hcmod(hcomplex_of_complex r)")] bexI 1); |
|
162 |
by (auto_tac (claset() addIs [SReal_add],simpset())); |
|
163 |
qed "SComplex_subset_CFinite"; |
|
164 |
Addsimps [ SComplex_subset_CFinite]; |
|
165 |
||
166 |
Goal "hcmod (hcomplex_of_complex r) : HFinite"; |
|
167 |
by (auto_tac (claset() addSIs [ SReal_subset_HFinite RS subsetD],simpset())); |
|
168 |
qed "HFinite_hcmod_hcomplex_of_complex"; |
|
169 |
Addsimps [HFinite_hcmod_hcomplex_of_complex]; |
|
170 |
||
171 |
Goal "hcomplex_of_complex x: CFinite"; |
|
172 |
by (auto_tac (claset() addSIs [ SComplex_subset_CFinite RS subsetD],simpset())); |
|
173 |
qed "CFinite_hcomplex_of_complex"; |
|
174 |
Addsimps [CFinite_hcomplex_of_complex]; |
|
175 |
||
176 |
Goalw [CFinite_def] "x : CFinite ==> EX t: Reals. hcmod x < t"; |
|
177 |
by Auto_tac; |
|
178 |
qed "CFiniteD"; |
|
179 |
||
180 |
Goalw [CFinite_def] "(x : CFinite) = (hcmod x : HFinite)"; |
|
181 |
by (auto_tac (claset(), simpset() addsimps [HFinite_def])); |
|
182 |
qed "CFinite_hcmod_iff"; |
|
183 |
||
184 |
Goal "number_of w : CFinite"; |
|
185 |
by (rtac (SComplex_number_of RS (SComplex_subset_CFinite RS subsetD)) 1); |
|
186 |
qed "CFinite_number_of"; |
|
187 |
Addsimps [CFinite_number_of]; |
|
188 |
||
189 |
Goal "[|x : CFinite; y <= hcmod x; 0 <= y |] ==> y: HFinite"; |
|
190 |
by (auto_tac (claset() addIs [HFinite_bounded],simpset() addsimps |
|
191 |
[CFinite_hcmod_iff])); |
|
192 |
qed "CFinite_bounded"; |
|
193 |
||
194 |
(*--------------------------------------------------------------------------------------*) |
|
195 |
(* Set of complex infinitesimals is a subring of the nonstandard complex numbers *) |
|
196 |
(*--------------------------------------------------------------------------------------*) |
|
197 |
||
198 |
Goalw [CInfinitesimal_def] |
|
199 |
"x : CInfinitesimal ==> ALL r: Reals. 0 < r --> hcmod x < r"; |
|
200 |
by Auto_tac; |
|
201 |
qed "CInfinitesimalD"; |
|
202 |
||
203 |
Goalw [CInfinitesimal_def] "0 : CInfinitesimal"; |
|
204 |
by Auto_tac; |
|
205 |
qed "CInfinitesimal_zero"; |
|
206 |
AddIffs [CInfinitesimal_zero]; |
|
207 |
||
208 |
Goal "x/(2::hcomplex) + x/(2::hcomplex) = x"; |
|
209 |
by Auto_tac; |
|
210 |
qed "hcomplex_sum_of_halves"; |
|
211 |
||
212 |
Goalw [CInfinitesimal_def,Infinitesimal_def] |
|
213 |
"(z : CInfinitesimal) = (hcmod z : Infinitesimal)"; |
|
214 |
by Auto_tac; |
|
215 |
qed "CInfinitesimal_hcmod_iff"; |
|
216 |
||
217 |
Goal "1 ~: CInfinitesimal"; |
|
218 |
by (simp_tac (simpset() addsimps [CInfinitesimal_hcmod_iff]) 1); |
|
219 |
qed "one_not_CInfinitesimal"; |
|
220 |
Addsimps [one_not_CInfinitesimal]; |
|
221 |
||
222 |
Goal "[| x : CInfinitesimal; y : CInfinitesimal |] ==> (x+y) : CInfinitesimal"; |
|
223 |
by (auto_tac (claset(),simpset() addsimps [CInfinitesimal_hcmod_iff])); |
|
224 |
by (rtac hrabs_le_Infinitesimal 1); |
|
225 |
by (res_inst_tac [("y","hcmod y")] Infinitesimal_add 1); |
|
226 |
by Auto_tac; |
|
227 |
qed "CInfinitesimal_add"; |
|
228 |
||
229 |
Goalw [CInfinitesimal_def] "(-x:CInfinitesimal) = (x:CInfinitesimal)"; |
|
230 |
by (Full_simp_tac 1); |
|
231 |
qed "CInfinitesimal_minus_iff"; |
|
232 |
Addsimps [CInfinitesimal_minus_iff]; |
|
233 |
||
234 |
Goal "[| x : CInfinitesimal; y : CInfinitesimal |] ==> x-y : CInfinitesimal"; |
|
235 |
by (asm_simp_tac |
|
236 |
(simpset() addsimps [hcomplex_diff_def, CInfinitesimal_add]) 1); |
|
237 |
qed "CInfinitesimal_diff"; |
|
238 |
||
239 |
Goal "[| x : CInfinitesimal; y : CInfinitesimal |] ==> (x * y) : CInfinitesimal"; |
|
240 |
by (auto_tac (claset() addIs [Infinitesimal_mult],simpset() addsimps |
|
241 |
[CInfinitesimal_hcmod_iff,hcmod_mult])); |
|
242 |
qed "CInfinitesimal_mult"; |
|
243 |
||
244 |
Goal "[| x : CInfinitesimal; y : CFinite |] ==> (x * y) : CInfinitesimal"; |
|
245 |
by (auto_tac (claset() addIs [Infinitesimal_HFinite_mult],simpset() |
|
246 |
addsimps [CInfinitesimal_hcmod_iff,CFinite_hcmod_iff,hcmod_mult])); |
|
247 |
qed "CInfinitesimal_CFinite_mult"; |
|
248 |
||
249 |
Goal "[| x : CInfinitesimal; y : CFinite |] ==> (y * x) : CInfinitesimal"; |
|
250 |
by (auto_tac (claset() addDs [CInfinitesimal_CFinite_mult], |
|
251 |
simpset() addsimps [hcomplex_mult_commute])); |
|
252 |
qed "CInfinitesimal_CFinite_mult2"; |
|
253 |
||
254 |
Goalw [CInfinite_def,HInfinite_def] |
|
255 |
"(z : CInfinite) = (hcmod z : HInfinite)"; |
|
256 |
by Auto_tac; |
|
257 |
qed "CInfinite_hcmod_iff"; |
|
258 |
||
259 |
Goal "x: CInfinite ==> inverse x: CInfinitesimal"; |
|
260 |
by (auto_tac (claset() addIs [HInfinite_inverse_Infinitesimal], |
|
261 |
simpset() addsimps [CInfinitesimal_hcmod_iff, |
|
262 |
CInfinite_hcmod_iff,hcmod_hcomplex_inverse])); |
|
263 |
qed "CInfinite_inverse_CInfinitesimal"; |
|
264 |
||
265 |
Goal "[|x: CInfinite; y: CInfinite|] ==> (x*y): CInfinite"; |
|
266 |
by (auto_tac (claset() addIs [HInfinite_mult],simpset() addsimps |
|
267 |
[CInfinite_hcmod_iff,hcmod_mult])); |
|
268 |
qed "CInfinite_mult"; |
|
269 |
||
270 |
Goalw [CInfinite_def] "(-x : CInfinite) = (x : CInfinite)"; |
|
271 |
by (Simp_tac 1); |
|
272 |
qed "CInfinite_minus_iff"; |
|
273 |
Addsimps [CInfinite_minus_iff]; |
|
274 |
||
275 |
Goal "[|a: CFinite; b: CFinite; c: CFinite|] \ |
|
276 |
\ ==> a*a + b*b + c*c : CFinite"; |
|
277 |
by (auto_tac (claset() addIs [CFinite_mult,CFinite_add], simpset())); |
|
278 |
qed "CFinite_sum_squares"; |
|
279 |
||
280 |
Goal "x ~: CInfinitesimal ==> x ~= 0"; |
|
281 |
by Auto_tac; |
|
282 |
qed "not_CInfinitesimal_not_zero"; |
|
283 |
||
284 |
Goal "x: CFinite - CInfinitesimal ==> x ~= 0"; |
|
285 |
by Auto_tac; |
|
286 |
qed "not_CInfinitesimal_not_zero2"; |
|
287 |
||
288 |
Goal "x : CFinite - CInfinitesimal ==> hcmod x : HFinite - Infinitesimal"; |
|
289 |
by (auto_tac (claset(),simpset() addsimps [CFinite_hcmod_iff,CInfinitesimal_hcmod_iff])); |
|
290 |
qed "CFinite_diff_CInfinitesimal_hcmod"; |
|
291 |
||
292 |
Goal "[| e : CInfinitesimal; hcmod x < hcmod e |] ==> x : CInfinitesimal"; |
|
293 |
by (auto_tac (claset() addIs [hrabs_less_Infinitesimal],simpset() |
|
294 |
addsimps [CInfinitesimal_hcmod_iff])); |
|
295 |
qed "hcmod_less_CInfinitesimal"; |
|
296 |
||
297 |
Goal "[| e : CInfinitesimal; hcmod x <= hcmod e |] ==> x : CInfinitesimal"; |
|
298 |
by (auto_tac (claset() addIs [hrabs_le_Infinitesimal],simpset() |
|
299 |
addsimps [CInfinitesimal_hcmod_iff])); |
|
300 |
qed "hcmod_le_CInfinitesimal"; |
|
301 |
||
302 |
Goal "[| e : CInfinitesimal; \ |
|
303 |
\ e' : CInfinitesimal; \ |
|
304 |
\ hcmod e' < hcmod x ; hcmod x < hcmod e \ |
|
305 |
\ |] ==> x : CInfinitesimal"; |
|
306 |
by (auto_tac (claset() addIs [Infinitesimal_interval],simpset() |
|
307 |
addsimps [CInfinitesimal_hcmod_iff])); |
|
308 |
qed "CInfinitesimal_interval"; |
|
309 |
||
310 |
Goal "[| e : CInfinitesimal; \ |
|
311 |
\ e' : CInfinitesimal; \ |
|
312 |
\ hcmod e' <= hcmod x ; hcmod x <= hcmod e \ |
|
313 |
\ |] ==> x : CInfinitesimal"; |
|
314 |
by (auto_tac (claset() addIs [Infinitesimal_interval2],simpset() |
|
315 |
addsimps [CInfinitesimal_hcmod_iff])); |
|
316 |
qed "CInfinitesimal_interval2"; |
|
317 |
||
318 |
Goal "[| x ~: CInfinitesimal; y ~: CInfinitesimal|] ==> (x*y) ~: CInfinitesimal"; |
|
319 |
by (auto_tac (claset(),simpset() addsimps [CInfinitesimal_hcmod_iff,hcmod_mult])); |
|
320 |
by (dtac not_Infinitesimal_mult 1); |
|
321 |
by Auto_tac; |
|
322 |
qed "not_CInfinitesimal_mult"; |
|
323 |
||
324 |
Goal "x*y : CInfinitesimal ==> x : CInfinitesimal | y : CInfinitesimal"; |
|
325 |
by (auto_tac (claset() addDs [Infinitesimal_mult_disj],simpset() addsimps |
|
326 |
[CInfinitesimal_hcmod_iff,hcmod_mult])); |
|
327 |
qed "CInfinitesimal_mult_disj"; |
|
328 |
||
329 |
Goal "[| x : CFinite - CInfinitesimal; \ |
|
330 |
\ y : CFinite - CInfinitesimal \ |
|
331 |
\ |] ==> (x*y) : CFinite - CInfinitesimal"; |
|
332 |
by (Clarify_tac 1); |
|
333 |
by (blast_tac (claset() addDs [CFinite_mult,not_CInfinitesimal_mult]) 1); |
|
334 |
qed "CFinite_CInfinitesimal_diff_mult"; |
|
335 |
||
336 |
Goal "CInfinitesimal <= CFinite"; |
|
337 |
by (auto_tac (claset() addIs [Infinitesimal_subset_HFinite RS subsetD], |
|
338 |
simpset() addsimps [CInfinitesimal_hcmod_iff,CFinite_hcmod_iff])); |
|
339 |
qed "CInfinitesimal_subset_CFinite"; |
|
340 |
||
341 |
Goal "x: CInfinitesimal ==> x * hcomplex_of_complex r : CInfinitesimal"; |
|
342 |
by (auto_tac (claset() addSIs [Infinitesimal_HFinite_mult], |
|
343 |
simpset() addsimps [CInfinitesimal_hcmod_iff,hcmod_mult])); |
|
344 |
qed "CInfinitesimal_hcomplex_of_complex_mult"; |
|
345 |
||
346 |
Goal "x: CInfinitesimal ==> hcomplex_of_complex r * x: CInfinitesimal"; |
|
347 |
by (auto_tac (claset() addSIs [Infinitesimal_HFinite_mult2], |
|
348 |
simpset() addsimps [CInfinitesimal_hcmod_iff,hcmod_mult])); |
|
349 |
qed "CInfinitesimal_hcomplex_of_complex_mult2"; |
|
350 |
||
351 |
||
352 |
(*--------------------------------------------------------------------------------------*) |
|
353 |
(* Infinitely close relation @c= *) |
|
354 |
(* -------------------------------------------------------------------------------------*) |
|
355 |
||
356 |
(* |
|
357 |
Goalw [capprox_def,approx_def] "(z @c= w) = (hcmod z @= hcmod w)"; |
|
358 |
by (auto_tac (claset(),simpset() addsimps [CInfinitesimal_hcmod_iff])); |
|
359 |
*) |
|
360 |
||
361 |
Goal "x:CInfinitesimal = (x @c= 0)"; |
|
362 |
by (simp_tac (simpset() addsimps [CInfinitesimal_hcmod_iff, |
|
363 |
capprox_def]) 1); |
|
364 |
qed "mem_cinfmal_iff"; |
|
365 |
||
366 |
Goalw [capprox_def,hcomplex_diff_def] |
|
367 |
" (x @c= y) = (x + -y @c= 0)"; |
|
368 |
by (Simp_tac 1); |
|
369 |
qed "capprox_minus_iff"; |
|
370 |
||
371 |
Goalw [capprox_def,hcomplex_diff_def] |
|
372 |
" (x @c= y) = (-y + x @c= 0)"; |
|
373 |
by (simp_tac (simpset() addsimps [hcomplex_add_commute]) 1); |
|
374 |
qed "capprox_minus_iff2"; |
|
375 |
||
376 |
Goalw [capprox_def] "x @c= x"; |
|
377 |
by (Simp_tac 1); |
|
378 |
qed "capprox_refl"; |
|
379 |
Addsimps [capprox_refl]; |
|
380 |
||
381 |
Goalw [capprox_def,CInfinitesimal_def] |
|
382 |
"x @c= y ==> y @c= x"; |
|
383 |
by (auto_tac (claset() addSDs [bspec],simpset() addsimps |
|
384 |
[hcmod_diff_commute])); |
|
385 |
qed "capprox_sym"; |
|
386 |
||
387 |
Goalw [capprox_def] "[| x @c= y; y @c= z |] ==> x @c= z"; |
|
388 |
by (dtac CInfinitesimal_add 1); |
|
389 |
by (assume_tac 1); |
|
390 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_diff_def])); |
|
391 |
qed "capprox_trans"; |
|
392 |
||
393 |
Goal "[| r @c= x; s @c= x |] ==> r @c= s"; |
|
394 |
by (blast_tac (claset() addIs [capprox_sym, capprox_trans]) 1); |
|
395 |
qed "capprox_trans2"; |
|
396 |
||
397 |
Goal "[| x @c= r; x @c= s|] ==> r @c= s"; |
|
398 |
by (blast_tac (claset() addIs [capprox_sym, capprox_trans]) 1); |
|
399 |
qed "capprox_trans3"; |
|
400 |
||
401 |
Goal "(number_of w @c= x) = (x @c= number_of w)"; |
|
402 |
by (blast_tac (claset() addIs [capprox_sym]) 1); |
|
403 |
qed "number_of_capprox_reorient"; |
|
404 |
Addsimps [number_of_capprox_reorient]; |
|
405 |
||
406 |
Goal "(x-y : CInfinitesimal) = (x @c= y)"; |
|
407 |
by (auto_tac (claset(), |
|
408 |
simpset() addsimps [hcomplex_diff_def, capprox_minus_iff RS sym, |
|
409 |
mem_cinfmal_iff])); |
|
410 |
qed "CInfinitesimal_capprox_minus"; |
|
411 |
||
412 |
Goalw [cmonad_def] "(x @c= y) = (cmonad(x)=cmonad(y))"; |
|
413 |
by (auto_tac (claset() addDs [capprox_sym] |
|
414 |
addSEs [capprox_trans,equalityCE], |
|
415 |
simpset())); |
|
416 |
qed "capprox_monad_iff"; |
|
417 |
||
418 |
Goal "[| x: CInfinitesimal; y: CInfinitesimal |] ==> x @c= y"; |
|
419 |
by (asm_full_simp_tac (simpset() addsimps [mem_cinfmal_iff]) 1); |
|
420 |
by (blast_tac (claset() addIs [capprox_trans, capprox_sym]) 1); |
|
421 |
qed "Infinitesimal_capprox"; |
|
422 |
||
423 |
val prem1::prem2::rest = |
|
424 |
goalw thy [capprox_def,hcomplex_diff_def] |
|
425 |
"[| a @c= b; c @c= d |] ==> a+c @c= b+d"; |
|
14335 | 426 |
by (rtac (minus_add_distrib RS ssubst) 1); |
13957 | 427 |
by (rtac (hcomplex_add_assoc RS ssubst) 1); |
14335 | 428 |
by (res_inst_tac [("b1","c")] (add_left_commute RS subst) 1); |
13957 | 429 |
by (rtac (hcomplex_add_assoc RS subst) 1); |
430 |
by (rtac ([prem1,prem2] MRS CInfinitesimal_add) 1); |
|
431 |
qed "capprox_add"; |
|
432 |
||
433 |
Goal "a @c= b ==> -a @c= -b"; |
|
434 |
by (rtac ((capprox_minus_iff RS iffD2) RS capprox_sym) 1); |
|
435 |
by (dtac (capprox_minus_iff RS iffD1) 1); |
|
436 |
by (simp_tac (simpset() addsimps [hcomplex_add_commute]) 1); |
|
437 |
qed "capprox_minus"; |
|
438 |
||
439 |
Goal "-a @c= -b ==> a @c= b"; |
|
440 |
by (auto_tac (claset() addDs [capprox_minus], simpset())); |
|
441 |
qed "capprox_minus2"; |
|
442 |
||
443 |
Goal "(-a @c= -b) = (a @c= b)"; |
|
444 |
by (blast_tac (claset() addIs [capprox_minus,capprox_minus2]) 1); |
|
445 |
qed "capprox_minus_cancel"; |
|
446 |
Addsimps [capprox_minus_cancel]; |
|
447 |
||
448 |
Goal "[| a @c= b; c @c= d |] ==> a + -c @c= b + -d"; |
|
449 |
by (blast_tac (claset() addSIs [capprox_add,capprox_minus]) 1); |
|
450 |
qed "capprox_add_minus"; |
|
451 |
||
452 |
Goalw [capprox_def,hcomplex_diff_def] |
|
453 |
"[| a @c= b; c: CFinite|] ==> a*c @c= b*c"; |
|
14331 | 454 |
by (asm_full_simp_tac (HOL_ss addsimps [CInfinitesimal_CFinite_mult, |
14335 | 455 |
minus_mult_left,hcomplex_add_mult_distrib RS sym]) 1); |
13957 | 456 |
qed "capprox_mult1"; |
457 |
||
458 |
Goal "[|a @c= b; c: CFinite|] ==> c*a @c= c*b"; |
|
459 |
by (asm_simp_tac (simpset() addsimps [capprox_mult1,hcomplex_mult_commute]) 1); |
|
460 |
qed "capprox_mult2"; |
|
461 |
||
462 |
Goal "[|u @c= v*x; x @c= y; v: CFinite|] ==> u @c= v*y"; |
|
463 |
by (fast_tac (claset() addIs [capprox_mult2,capprox_trans]) 1); |
|
464 |
qed "capprox_mult_subst"; |
|
465 |
||
466 |
Goal "[| u @c= x*v; x @c= y; v: CFinite |] ==> u @c= y*v"; |
|
467 |
by (fast_tac (claset() addIs [capprox_mult1,capprox_trans]) 1); |
|
468 |
qed "capprox_mult_subst2"; |
|
469 |
||
470 |
Goal "[| u @c= x*hcomplex_of_complex v; x @c= y |] ==> u @c= y*hcomplex_of_complex v"; |
|
471 |
by (auto_tac (claset() addIs [capprox_mult_subst2], simpset())); |
|
472 |
qed "capprox_mult_subst_SComplex"; |
|
473 |
||
474 |
Goalw [capprox_def] "a = b ==> a @c= b"; |
|
475 |
by (Asm_simp_tac 1); |
|
476 |
qed "capprox_eq_imp"; |
|
477 |
||
478 |
Goal "x: CInfinitesimal ==> -x @c= x"; |
|
479 |
by (fast_tac (HOL_cs addIs [CInfinitesimal_minus_iff RS iffD2, |
|
480 |
mem_cinfmal_iff RS iffD1,capprox_trans2]) 1); |
|
481 |
qed "CInfinitesimal_minus_capprox"; |
|
482 |
||
483 |
Goalw [capprox_def] |
|
484 |
"(EX y: CInfinitesimal. x - z = y) = (x @c= z)"; |
|
485 |
by (Blast_tac 1); |
|
486 |
qed "bex_CInfinitesimal_iff"; |
|
487 |
||
488 |
Goal "(EX y: CInfinitesimal. x = z + y) = (x @c= z)"; |
|
489 |
by (asm_full_simp_tac (simpset() addsimps [bex_CInfinitesimal_iff RS sym]) 1); |
|
490 |
by (Force_tac 1); |
|
491 |
qed "bex_CInfinitesimal_iff2"; |
|
492 |
||
493 |
Goal "[| y: CInfinitesimal; x + y = z |] ==> x @c= z"; |
|
494 |
by (rtac (bex_CInfinitesimal_iff RS iffD1) 1); |
|
495 |
by (dtac (CInfinitesimal_minus_iff RS iffD2) 1); |
|
496 |
by (auto_tac (claset(), simpset() addsimps [hcomplex_add_assoc RS sym])); |
|
497 |
qed "CInfinitesimal_add_capprox"; |
|
498 |
||
499 |
Goal "y: CInfinitesimal ==> x @c= x + y"; |
|
500 |
by (rtac (bex_CInfinitesimal_iff RS iffD1) 1); |
|
501 |
by (dtac (CInfinitesimal_minus_iff RS iffD2) 1); |
|
502 |
by (auto_tac (claset(), simpset() addsimps [hcomplex_add_assoc RS sym])); |
|
503 |
qed "CInfinitesimal_add_capprox_self"; |
|
504 |
||
505 |
Goal "y: CInfinitesimal ==> x @c= y + x"; |
|
506 |
by (auto_tac (claset() addDs [CInfinitesimal_add_capprox_self], |
|
507 |
simpset() addsimps [hcomplex_add_commute])); |
|
508 |
qed "CInfinitesimal_add_capprox_self2"; |
|
509 |
||
510 |
Goal "y: CInfinitesimal ==> x @c= x + -y"; |
|
511 |
by (blast_tac (claset() addSIs [CInfinitesimal_add_capprox_self, |
|
512 |
CInfinitesimal_minus_iff RS iffD2]) 1); |
|
513 |
qed "CInfinitesimal_add_minus_capprox_self"; |
|
514 |
||
515 |
Goal "[| y: CInfinitesimal; x+y @c= z|] ==> x @c= z"; |
|
516 |
by (dres_inst_tac [("x","x")] (CInfinitesimal_add_capprox_self RS capprox_sym) 1); |
|
517 |
by (etac (capprox_trans3 RS capprox_sym) 1); |
|
518 |
by (assume_tac 1); |
|
519 |
qed "CInfinitesimal_add_cancel"; |
|
520 |
||
521 |
Goal "[| y: CInfinitesimal; x @c= z + y|] ==> x @c= z"; |
|
522 |
by (dres_inst_tac [("x","z")] (CInfinitesimal_add_capprox_self2 RS capprox_sym) 1); |
|
523 |
by (etac (capprox_trans3 RS capprox_sym) 1); |
|
524 |
by (asm_full_simp_tac (simpset() addsimps [hcomplex_add_commute]) 1); |
|
525 |
by (etac capprox_sym 1); |
|
526 |
qed "CInfinitesimal_add_right_cancel"; |
|
527 |
||
528 |
Goal "d + b @c= d + c ==> b @c= c"; |
|
529 |
by (dtac (capprox_minus_iff RS iffD1) 1); |
|
530 |
by (asm_full_simp_tac (simpset() addsimps |
|
14335 | 531 |
[minus_add_distrib,capprox_minus_iff RS sym] |
532 |
@ add_ac) 1); |
|
13957 | 533 |
qed "capprox_add_left_cancel"; |
534 |
||
535 |
Goal "b + d @c= c + d ==> b @c= c"; |
|
536 |
by (rtac capprox_add_left_cancel 1); |
|
537 |
by (asm_full_simp_tac (simpset() addsimps |
|
538 |
[hcomplex_add_commute]) 1); |
|
539 |
qed "capprox_add_right_cancel"; |
|
540 |
||
541 |
Goal "b @c= c ==> d + b @c= d + c"; |
|
542 |
by (rtac (capprox_minus_iff RS iffD2) 1); |
|
543 |
by (asm_full_simp_tac (simpset() addsimps |
|
14335 | 544 |
[capprox_minus_iff RS sym] @ add_ac) 1); |
13957 | 545 |
qed "capprox_add_mono1"; |
546 |
||
547 |
Goal "b @c= c ==> b + a @c= c + a"; |
|
548 |
by (asm_simp_tac (simpset() addsimps |
|
549 |
[hcomplex_add_commute,capprox_add_mono1]) 1); |
|
550 |
qed "capprox_add_mono2"; |
|
551 |
||
552 |
Goal "(a + b @c= a + c) = (b @c= c)"; |
|
553 |
by (fast_tac (claset() addEs [capprox_add_left_cancel, |
|
554 |
capprox_add_mono1]) 1); |
|
555 |
qed "capprox_add_left_iff"; |
|
556 |
||
557 |
AddIffs [capprox_add_left_iff]; |
|
558 |
||
559 |
||
560 |
Goal "(b + a @c= c + a) = (b @c= c)"; |
|
561 |
by (simp_tac (simpset() addsimps [hcomplex_add_commute]) 1); |
|
562 |
qed "capprox_add_right_iff"; |
|
563 |
||
564 |
AddIffs [capprox_add_right_iff]; |
|
565 |
||
566 |
Goal "[| x: CFinite; x @c= y |] ==> y: CFinite"; |
|
567 |
by (dtac (bex_CInfinitesimal_iff2 RS iffD2) 1); |
|
568 |
by (Step_tac 1); |
|
569 |
by (dtac (CInfinitesimal_subset_CFinite RS subsetD |
|
570 |
RS (CFinite_minus_iff RS iffD2)) 1); |
|
571 |
by (dtac CFinite_add 1); |
|
572 |
by (assume_tac 1 THEN Auto_tac); |
|
573 |
qed "capprox_CFinite"; |
|
574 |
||
575 |
Goal "x @c= hcomplex_of_complex D ==> x: CFinite"; |
|
576 |
by (rtac (capprox_sym RSN (2,capprox_CFinite)) 1); |
|
577 |
by Auto_tac; |
|
578 |
qed "capprox_hcomplex_of_complex_CFinite"; |
|
579 |
||
580 |
Goal "[|a @c= b; c @c= d; b: CFinite; d: CFinite|] ==> a*c @c= b*d"; |
|
581 |
by (rtac capprox_trans 1); |
|
582 |
by (rtac capprox_mult2 2); |
|
583 |
by (rtac capprox_mult1 1); |
|
584 |
by (blast_tac (claset() addIs [capprox_CFinite, capprox_sym]) 2); |
|
585 |
by Auto_tac; |
|
586 |
qed "capprox_mult_CFinite"; |
|
587 |
||
588 |
Goal "[|a @c= hcomplex_of_complex b; c @c= hcomplex_of_complex d |] \ |
|
589 |
\ ==> a*c @c= hcomplex_of_complex b * hcomplex_of_complex d"; |
|
590 |
by (blast_tac (claset() addSIs [capprox_mult_CFinite, |
|
591 |
capprox_hcomplex_of_complex_CFinite,CFinite_hcomplex_of_complex]) 1); |
|
592 |
qed "capprox_mult_hcomplex_of_complex"; |
|
593 |
||
594 |
Goal "[| a: SComplex; a ~= 0; a*x @c= 0 |] ==> x @c= 0"; |
|
595 |
by (dtac (SComplex_inverse RS (SComplex_subset_CFinite RS subsetD)) 1); |
|
596 |
by (auto_tac (claset() addDs [capprox_mult2], |
|
597 |
simpset() addsimps [hcomplex_mult_assoc RS sym])); |
|
598 |
qed "capprox_SComplex_mult_cancel_zero"; |
|
599 |
||
600 |
Goal "[| a: SComplex; x @c= 0 |] ==> x*a @c= 0"; |
|
601 |
by (auto_tac (claset() addDs [(SComplex_subset_CFinite RS subsetD), |
|
602 |
capprox_mult1], simpset())); |
|
603 |
qed "capprox_mult_SComplex1"; |
|
604 |
||
605 |
Goal "[| a: SComplex; x @c= 0 |] ==> a*x @c= 0"; |
|
606 |
by (auto_tac (claset() addDs [(SComplex_subset_CFinite RS subsetD), |
|
607 |
capprox_mult2], simpset())); |
|
608 |
qed "capprox_mult_SComplex2"; |
|
609 |
||
610 |
Goal "[|a : SComplex; a ~= 0 |] ==> (a*x @c= 0) = (x @c= 0)"; |
|
611 |
by (blast_tac (claset() addIs [capprox_SComplex_mult_cancel_zero, |
|
612 |
capprox_mult_SComplex2]) 1); |
|
613 |
qed "capprox_mult_SComplex_zero_cancel_iff"; |
|
614 |
Addsimps [capprox_mult_SComplex_zero_cancel_iff]; |
|
615 |
||
616 |
Goal "[| a: SComplex; a ~= 0; a* w @c= a*z |] ==> w @c= z"; |
|
617 |
by (dtac (SComplex_inverse RS (SComplex_subset_CFinite RS subsetD)) 1); |
|
618 |
by (auto_tac (claset() addDs [capprox_mult2], |
|
619 |
simpset() addsimps [hcomplex_mult_assoc RS sym])); |
|
620 |
qed "capprox_SComplex_mult_cancel"; |
|
621 |
||
622 |
Goal "[| a: SComplex; a ~= 0|] ==> (a* w @c= a*z) = (w @c= z)"; |
|
623 |
by (auto_tac (claset() addSIs [capprox_mult2,SComplex_subset_CFinite RS subsetD] |
|
624 |
addIs [capprox_SComplex_mult_cancel], simpset())); |
|
625 |
qed "capprox_SComplex_mult_cancel_iff1"; |
|
626 |
Addsimps [capprox_SComplex_mult_cancel_iff1]; |
|
627 |
||
628 |
Goal "(x @c= y) = (hcmod (y - x) @= 0)"; |
|
629 |
by (rtac (capprox_minus_iff RS ssubst) 1); |
|
630 |
by (auto_tac (claset(),simpset() addsimps [capprox_def, |
|
631 |
CInfinitesimal_hcmod_iff,mem_infmal_iff,symmetric hcomplex_diff_def, |
|
632 |
hcmod_diff_commute])); |
|
633 |
qed "capprox_hcmod_approx_zero"; |
|
634 |
||
635 |
Goal "(x @c= 0) = (hcmod x @= 0)"; |
|
636 |
by (auto_tac (claset(),simpset() addsimps |
|
637 |
[capprox_hcmod_approx_zero])); |
|
638 |
qed "capprox_approx_zero_iff"; |
|
639 |
||
640 |
Goal "(-x @c= 0) = (x @c= 0)"; |
|
641 |
by (auto_tac (claset(),simpset() addsimps |
|
642 |
[capprox_hcmod_approx_zero])); |
|
643 |
qed "capprox_minus_zero_cancel_iff"; |
|
644 |
Addsimps [capprox_minus_zero_cancel_iff]; |
|
645 |
||
646 |
Goal "u @c= 0 ==> hcmod(x + u) - hcmod x : Infinitesimal"; |
|
647 |
by (res_inst_tac [("e","hcmod u"),("e'","- hcmod u")] Infinitesimal_interval2 1); |
|
648 |
by (auto_tac (claset() addDs [capprox_approx_zero_iff RS iffD1], |
|
649 |
simpset() addsimps [mem_infmal_iff RS sym,hypreal_diff_def])); |
|
14334 | 650 |
by (res_inst_tac [("c1","hcmod x")] (add_le_cancel_left RS iffD1) 1); |
13957 | 651 |
by (auto_tac (claset(),simpset() addsimps [symmetric hypreal_diff_def])); |
652 |
qed "Infinitesimal_hcmod_add_diff"; |
|
653 |
||
654 |
Goal "u @c= 0 ==> hcmod(x + u) @= hcmod x"; |
|
655 |
by (rtac (approx_minus_iff RS iffD2) 1); |
|
656 |
by (auto_tac (claset() addIs [Infinitesimal_hcmod_add_diff], |
|
657 |
simpset() addsimps [mem_infmal_iff RS sym,symmetric hypreal_diff_def])); |
|
658 |
qed "approx_hcmod_add_hcmod"; |
|
659 |
||
660 |
Goal "x @c= y ==> hcmod x @= hcmod y"; |
|
661 |
by (auto_tac (claset() addIs [approx_hcmod_add_hcmod] |
|
662 |
addSDs [bex_CInfinitesimal_iff2 RS iffD2],simpset() addsimps [mem_cinfmal_iff])); |
|
663 |
qed "capprox_hcmod_approx"; |
|
664 |
||
665 |
(*--------------------------------------------------------------------------------------*) |
|
666 |
(* zero is the only complex number that is also infinitesimal *) |
|
667 |
(*--------------------------------------------------------------------------------------*) |
|
668 |
||
669 |
Goal "[| x: SComplex; y: CInfinitesimal; 0 < hcmod x |] ==> hcmod y < hcmod x"; |
|
670 |
by (auto_tac (claset() addSIs [Infinitesimal_less_SReal,SComplex_hcmod_SReal], |
|
671 |
simpset() addsimps [CInfinitesimal_hcmod_iff])); |
|
672 |
qed "CInfinitesimal_less_SComplex"; |
|
673 |
||
674 |
Goal "y: CInfinitesimal ==> ALL r: SComplex. 0 < hcmod r --> hcmod y < hcmod r"; |
|
675 |
by (blast_tac (claset() addIs [CInfinitesimal_less_SComplex]) 1); |
|
676 |
qed "CInfinitesimal_less_SComplex2"; |
|
677 |
||
678 |
Goal "SComplex Int CInfinitesimal = {0}"; |
|
679 |
by (auto_tac (claset(),simpset() addsimps [SComplex_def,CInfinitesimal_hcmod_iff])); |
|
680 |
by (cut_inst_tac [("r","r")] SReal_hcmod_hcomplex_of_complex 1); |
|
681 |
by (dres_inst_tac [("A","Reals")] IntI 1 THEN assume_tac 1); |
|
682 |
by (subgoal_tac "hcmod (hcomplex_of_complex r) = 0" 1); |
|
683 |
by (Asm_full_simp_tac 1); |
|
684 |
by (cut_facts_tac [SReal_Int_Infinitesimal_zero] 1); |
|
685 |
by (rotate_tac 2 1); |
|
686 |
by (Asm_full_simp_tac 1); |
|
687 |
qed "SComplex_Int_CInfinitesimal_zero"; |
|
688 |
||
689 |
Goal "[| x: SComplex; x: CInfinitesimal|] ==> x = 0"; |
|
690 |
by (cut_facts_tac [SComplex_Int_CInfinitesimal_zero] 1); |
|
691 |
by (Blast_tac 1); |
|
692 |
qed "SComplex_CInfinitesimal_zero"; |
|
693 |
||
694 |
Goal "[| x : SComplex; x ~= 0 |] ==> x : CFinite - CInfinitesimal"; |
|
695 |
by (auto_tac (claset() addDs [SComplex_CInfinitesimal_zero, |
|
696 |
SComplex_subset_CFinite RS subsetD], |
|
697 |
simpset())); |
|
698 |
qed "SComplex_CFinite_diff_CInfinitesimal"; |
|
699 |
||
700 |
Goal "hcomplex_of_complex x ~= 0 ==> hcomplex_of_complex x : CFinite - CInfinitesimal"; |
|
701 |
by (rtac SComplex_CFinite_diff_CInfinitesimal 1); |
|
702 |
by Auto_tac; |
|
703 |
qed "hcomplex_of_complex_CFinite_diff_CInfinitesimal"; |
|
704 |
||
705 |
Goal "(hcomplex_of_complex x : CInfinitesimal) = (x=0)"; |
|
706 |
by (auto_tac (claset(), simpset() addsimps [hcomplex_of_complex_zero])); |
|
707 |
by (rtac ccontr 1); |
|
708 |
by (rtac (hcomplex_of_complex_CFinite_diff_CInfinitesimal RS DiffD2) 1); |
|
709 |
by Auto_tac; |
|
710 |
qed "hcomplex_of_complex_CInfinitesimal_iff_0"; |
|
711 |
AddIffs [hcomplex_of_complex_CInfinitesimal_iff_0]; |
|
712 |
||
713 |
Goal "number_of w ~= (0::hcomplex) ==> number_of w ~: CInfinitesimal"; |
|
714 |
by (fast_tac (claset() addDs [SComplex_number_of RS SComplex_CInfinitesimal_zero]) 1); |
|
715 |
qed "number_of_not_CInfinitesimal"; |
|
716 |
Addsimps [number_of_not_CInfinitesimal]; |
|
717 |
||
718 |
Goal "[| y: SComplex; x @c= y; y~= 0 |] ==> x ~= 0"; |
|
719 |
by (auto_tac (claset() addDs [SComplex_CInfinitesimal_zero, |
|
720 |
capprox_sym RS (mem_cinfmal_iff RS iffD2)],simpset())); |
|
721 |
qed "capprox_SComplex_not_zero"; |
|
722 |
||
723 |
Goal "[| x @c= y; y : CFinite - CInfinitesimal |] \ |
|
724 |
\ ==> x : CFinite - CInfinitesimal"; |
|
725 |
by (auto_tac (claset() addIs [capprox_sym RSN (2,capprox_CFinite)], |
|
726 |
simpset() addsimps [mem_cinfmal_iff])); |
|
727 |
by (dtac capprox_trans3 1 THEN assume_tac 1); |
|
728 |
by (blast_tac (claset() addDs [capprox_sym]) 1); |
|
729 |
qed "CFinite_diff_CInfinitesimal_capprox"; |
|
730 |
||
731 |
Goal "[| y ~= 0; y: CInfinitesimal; x/y : CFinite |] ==> x : CInfinitesimal"; |
|
732 |
by (dtac CInfinitesimal_CFinite_mult2 1); |
|
733 |
by (assume_tac 1); |
|
734 |
by (asm_full_simp_tac |
|
735 |
(simpset() addsimps [hcomplex_divide_def, hcomplex_mult_assoc]) 1); |
|
736 |
qed "CInfinitesimal_ratio"; |
|
737 |
||
738 |
Goal "[|x: SComplex; y: SComplex|] ==> (x @c= y) = (x = y)"; |
|
739 |
by Auto_tac; |
|
740 |
by (rewrite_goals_tac [capprox_def]); |
|
741 |
by (dres_inst_tac [("x","y")] SComplex_minus 1); |
|
742 |
by (dtac SComplex_add 1 THEN assume_tac 1); |
|
743 |
by (rtac (CLAIM "x - y = 0 ==> x = (y::hcomplex)") 1); |
|
744 |
by (rtac SComplex_CInfinitesimal_zero 1); |
|
745 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_diff_def])); |
|
746 |
qed "SComplex_capprox_iff"; |
|
747 |
||
748 |
Goal "(number_of v @c= number_of w) = (number_of v = (number_of w :: hcomplex))"; |
|
749 |
by (rtac SComplex_capprox_iff 1); |
|
750 |
by Auto_tac; |
|
751 |
qed "number_of_capprox_iff"; |
|
752 |
Addsimps [number_of_capprox_iff]; |
|
753 |
||
754 |
Goal "(number_of w : CInfinitesimal) = (number_of w = (0::hcomplex))"; |
|
755 |
by (rtac iffI 1); |
|
756 |
by (fast_tac (claset() addDs [SComplex_number_of RS SComplex_CInfinitesimal_zero]) 1); |
|
757 |
by (Asm_simp_tac 1); |
|
758 |
qed "number_of_CInfinitesimal_iff"; |
|
759 |
Addsimps [number_of_CInfinitesimal_iff]; |
|
760 |
||
761 |
Goal "(hcomplex_of_complex k @c= hcomplex_of_complex m) = (k = m)"; |
|
762 |
by Auto_tac; |
|
763 |
by (rtac (inj_hcomplex_of_complex RS injD) 1); |
|
764 |
by (rtac (SComplex_capprox_iff RS iffD1) 1); |
|
765 |
by Auto_tac; |
|
766 |
qed "hcomplex_of_complex_approx_iff"; |
|
767 |
Addsimps [hcomplex_of_complex_approx_iff]; |
|
768 |
||
769 |
Goal "(hcomplex_of_complex k @c= number_of w) = (k = number_of w)"; |
|
770 |
by (stac (hcomplex_of_complex_approx_iff RS sym) 1); |
|
771 |
by Auto_tac; |
|
772 |
qed "hcomplex_of_complex_capprox_number_of_iff"; |
|
773 |
Addsimps [hcomplex_of_complex_capprox_number_of_iff]; |
|
774 |
||
775 |
Goal "[| r: SComplex; s: SComplex; r @c= x; s @c= x|] ==> r = s"; |
|
776 |
by (blast_tac (claset() addIs [(SComplex_capprox_iff RS iffD1), |
|
777 |
capprox_trans2]) 1); |
|
778 |
qed "capprox_unique_complex"; |
|
779 |
||
780 |
Goal "Abs_hcomplex(hcomplexrel ``{%n. X n}) @c= Abs_hcomplex(hcomplexrel``{%n. Y n}) \ |
|
781 |
\ ==> Abs_hypreal(hyprel `` {%n. Re(X n)}) @= \ |
|
782 |
\ Abs_hypreal(hyprel `` {%n. Re(Y n)})"; |
|
783 |
by (auto_tac (claset(),simpset() addsimps [approx_FreeUltrafilterNat_iff])); |
|
784 |
by (dtac (capprox_minus_iff RS iffD1) 1); |
|
785 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_minus,hcomplex_add, |
|
786 |
mem_cinfmal_iff RS sym,CInfinitesimal_hcmod_iff,hcmod, |
|
787 |
Infinitesimal_FreeUltrafilterNat_iff2])); |
|
788 |
by (dres_inst_tac [("x","m")] spec 1); |
|
789 |
by (Ultra_tac 1); |
|
14299 | 790 |
by (rename_tac "Z x" 1); |
14373 | 791 |
by (case_tac "X x" 1); |
792 |
by (case_tac "Y x" 1); |
|
13957 | 793 |
by (auto_tac (claset(),simpset() addsimps [complex_minus,complex_add, |
794 |
complex_mod] delsimps [realpow_Suc])); |
|
795 |
by (rtac order_le_less_trans 1 THEN assume_tac 2); |
|
14299 | 796 |
by (dres_inst_tac [("t","Z x")] sym 1); |
13957 | 797 |
by (auto_tac (claset(),simpset() addsimps [abs_eqI1] delsimps [realpow_Suc])); |
798 |
qed "hcomplex_capproxD1"; |
|
799 |
||
800 |
(* same proof *) |
|
801 |
Goal "Abs_hcomplex(hcomplexrel ``{%n. X n}) @c= Abs_hcomplex(hcomplexrel``{%n. Y n}) \ |
|
802 |
\ ==> Abs_hypreal(hyprel `` {%n. Im(X n)}) @= \ |
|
803 |
\ Abs_hypreal(hyprel `` {%n. Im(Y n)})"; |
|
804 |
by (auto_tac (claset(),simpset() addsimps [approx_FreeUltrafilterNat_iff])); |
|
805 |
by (dtac (capprox_minus_iff RS iffD1) 1); |
|
806 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_minus,hcomplex_add, |
|
807 |
mem_cinfmal_iff RS sym,CInfinitesimal_hcmod_iff,hcmod, |
|
808 |
Infinitesimal_FreeUltrafilterNat_iff2])); |
|
809 |
by (dres_inst_tac [("x","m")] spec 1); |
|
810 |
by (Ultra_tac 1); |
|
14299 | 811 |
by (rename_tac "Z x" 1); |
14373 | 812 |
by (case_tac "X x" 1); |
813 |
by (case_tac "Y x" 1); |
|
13957 | 814 |
by (auto_tac (claset(),simpset() addsimps [complex_minus,complex_add, |
815 |
complex_mod] delsimps [realpow_Suc])); |
|
816 |
by (rtac order_le_less_trans 1 THEN assume_tac 2); |
|
14299 | 817 |
by (dres_inst_tac [("t","Z x")] sym 1); |
13957 | 818 |
by (auto_tac (claset(),simpset() addsimps [abs_eqI1] delsimps [realpow_Suc])); |
819 |
qed "hcomplex_capproxD2"; |
|
820 |
||
821 |
Goal "[| Abs_hypreal(hyprel `` {%n. Re(X n)}) @= \ |
|
822 |
\ Abs_hypreal(hyprel `` {%n. Re(Y n)}); \ |
|
823 |
\ Abs_hypreal(hyprel `` {%n. Im(X n)}) @= \ |
|
824 |
\ Abs_hypreal(hyprel `` {%n. Im(Y n)}) \ |
|
825 |
\ |] ==> Abs_hcomplex(hcomplexrel ``{%n. X n}) @c= Abs_hcomplex(hcomplexrel``{%n. Y n})"; |
|
826 |
by (dtac (approx_minus_iff RS iffD1) 1); |
|
827 |
by (dtac (approx_minus_iff RS iffD1) 1); |
|
828 |
by (rtac (capprox_minus_iff RS iffD2) 1); |
|
14353
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
829 |
by (auto_tac (claset(), |
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
830 |
simpset() addsimps [mem_cinfmal_iff RS sym, |
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
831 |
mem_infmal_iff RS sym,hypreal_minus,hypreal_add,hcomplex_minus, |
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
832 |
hcomplex_add,CInfinitesimal_hcmod_iff,hcmod, |
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
833 |
Infinitesimal_FreeUltrafilterNat_iff])); |
13957 | 834 |
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2); |
835 |
by Auto_tac; |
|
836 |
by (dres_inst_tac [("x","u/2")] spec 1); |
|
837 |
by (dres_inst_tac [("x","u/2")] spec 1); |
|
14353
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
838 |
by Safe_tac; |
13957 | 839 |
by (TRYALL(Force_tac)); |
840 |
by (ultra_tac (claset(),HOL_ss) 1); |
|
14353
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
841 |
by (dtac sym 1 THEN dtac sym 1); |
14373 | 842 |
by (case_tac "X x" 1); |
843 |
by (case_tac "Y x" 1); |
|
14353
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
844 |
by (auto_tac (claset(), |
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
845 |
HOL_ss addsimps [complex_minus,complex_add, |
14323 | 846 |
complex_mod, snd_conv, fst_conv,numeral_2_eq_2])); |
14373 | 847 |
by (rename_tac "a b c d" 1); |
848 |
by (subgoal_tac "sqrt (abs(a + - c) ^ 2 + abs(b + - d) ^ 2) < u" 1); |
|
14353
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
849 |
by (rtac lemma_sqrt_hcomplex_capprox 2); |
13957 | 850 |
by Auto_tac; |
14353
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
851 |
by (asm_full_simp_tac (simpset() addsimps [power2_eq_square]) 1); |
13957 | 852 |
qed "hcomplex_capproxI"; |
853 |
||
854 |
Goal "(Abs_hcomplex(hcomplexrel ``{%n. X n}) @c= Abs_hcomplex(hcomplexrel``{%n. Y n})) =\ |
|
855 |
\ (Abs_hypreal(hyprel `` {%n. Re(X n)}) @= Abs_hypreal(hyprel `` {%n. Re(Y n)}) & \ |
|
856 |
\ Abs_hypreal(hyprel `` {%n. Im(X n)}) @= Abs_hypreal(hyprel `` {%n. Im(Y n)}))"; |
|
857 |
by (blast_tac (claset() addIs [hcomplex_capproxI,hcomplex_capproxD1,hcomplex_capproxD2]) 1); |
|
858 |
qed "capprox_approx_iff"; |
|
859 |
||
860 |
Goal "(hcomplex_of_hypreal x @c= hcomplex_of_hypreal z) = (x @= z)"; |
|
861 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
862 |
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1); |
|
863 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal, |
|
864 |
capprox_approx_iff])); |
|
865 |
qed "hcomplex_of_hypreal_capprox_iff"; |
|
866 |
Addsimps [hcomplex_of_hypreal_capprox_iff]; |
|
867 |
||
868 |
Goal "Abs_hcomplex(hcomplexrel ``{%n. X n}) : CFinite \ |
|
869 |
\ ==> Abs_hypreal(hyprel `` {%n. Re(X n)}) : HFinite"; |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14353
diff
changeset
|
870 |
by (auto_tac (claset(), |
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14353
diff
changeset
|
871 |
simpset() addsimps [CFinite_hcmod_iff,hcmod,HFinite_FreeUltrafilterNat_iff])); |
13957 | 872 |
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2); |
873 |
by (res_inst_tac [("x","u")] exI 1 THEN Auto_tac); |
|
874 |
by (Ultra_tac 1); |
|
14373 | 875 |
by (dtac sym 1 THEN case_tac "X x" 1); |
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14353
diff
changeset
|
876 |
by (auto_tac (claset(), |
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14353
diff
changeset
|
877 |
simpset() addsimps [complex_mod,numeral_2_eq_2] delsimps [realpow_Suc])); |
14334 | 878 |
by (rtac ccontr 1 THEN dtac (linorder_not_less RS iffD1) 1); |
13957 | 879 |
by (dtac order_less_le_trans 1 THEN assume_tac 1); |
880 |
by (dtac (real_sqrt_ge_abs1 RSN (2,order_less_le_trans)) 1); |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14353
diff
changeset
|
881 |
by (auto_tac ((claset(),simpset() addsimps [numeral_2_eq_2 RS sym]) addIffs [order_less_irrefl])); |
13957 | 882 |
qed "CFinite_HFinite_Re"; |
883 |
||
884 |
Goal "Abs_hcomplex(hcomplexrel ``{%n. X n}) : CFinite \ |
|
885 |
\ ==> Abs_hypreal(hyprel `` {%n. Im(X n)}) : HFinite"; |
|
886 |
by (auto_tac (claset(),simpset() addsimps [CFinite_hcmod_iff, |
|
887 |
hcmod,HFinite_FreeUltrafilterNat_iff])); |
|
888 |
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2); |
|
889 |
by (res_inst_tac [("x","u")] exI 1 THEN Auto_tac); |
|
890 |
by (Ultra_tac 1); |
|
14373 | 891 |
by (dtac sym 1 THEN case_tac "X x" 1); |
13957 | 892 |
by (auto_tac (claset(),simpset() addsimps [complex_mod] delsimps [realpow_Suc])); |
14334 | 893 |
by (rtac ccontr 1 THEN dtac (linorder_not_less RS iffD1) 1); |
13957 | 894 |
by (dtac order_less_le_trans 1 THEN assume_tac 1); |
895 |
by (dtac (real_sqrt_ge_abs2 RSN (2,order_less_le_trans)) 1); |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14353
diff
changeset
|
896 |
by (auto_tac (clasimpset() addIffs [order_less_irrefl])); |
13957 | 897 |
qed "CFinite_HFinite_Im"; |
898 |
||
899 |
Goal "[| Abs_hypreal(hyprel `` {%n. Re(X n)}) : HFinite; \ |
|
900 |
\ Abs_hypreal(hyprel `` {%n. Im(X n)}) : HFinite \ |
|
901 |
\ |] ==> Abs_hcomplex(hcomplexrel ``{%n. X n}) : CFinite"; |
|
902 |
by (auto_tac (claset(),simpset() addsimps [CFinite_hcmod_iff, |
|
903 |
hcmod,HFinite_FreeUltrafilterNat_iff])); |
|
14299 | 904 |
by (rename_tac "Y Z u v" 1); |
13957 | 905 |
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2); |
14299 | 906 |
by (res_inst_tac [("x","2*(u + v)")] exI 1); |
13957 | 907 |
by (Ultra_tac 1); |
14373 | 908 |
by (dtac sym 1 THEN case_tac "X x" 1); |
14323 | 909 |
by (auto_tac (claset(),simpset() addsimps [complex_mod,numeral_2_eq_2] delsimps [realpow_Suc])); |
13957 | 910 |
by (subgoal_tac "0 < u" 1 THEN arith_tac 2); |
14299 | 911 |
by (subgoal_tac "0 < v" 1 THEN arith_tac 2); |
14353
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
912 |
by (subgoal_tac "sqrt (abs(Y x) ^ 2 + abs(Z x) ^ 2) < 2*u + 2*v" 1); |
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
913 |
by (rtac lemma_sqrt_hcomplex_capprox 2); |
13957 | 914 |
by Auto_tac; |
14353
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14335
diff
changeset
|
915 |
by (asm_full_simp_tac (simpset() addsimps [power2_eq_square]) 1); |
13957 | 916 |
qed "HFinite_Re_Im_CFinite"; |
917 |
||
918 |
Goal "(Abs_hcomplex(hcomplexrel ``{%n. X n}) : CFinite) = \ |
|
919 |
\ (Abs_hypreal(hyprel `` {%n. Re(X n)}) : HFinite & \ |
|
920 |
\ Abs_hypreal(hyprel `` {%n. Im(X n)}) : HFinite)"; |
|
921 |
by (blast_tac (claset() addIs [HFinite_Re_Im_CFinite,CFinite_HFinite_Im, |
|
922 |
CFinite_HFinite_Re]) 1); |
|
923 |
qed "CFinite_HFinite_iff"; |
|
924 |
||
925 |
Goal "Abs_hcomplex(hcomplexrel ``{%n. X n}) : SComplex \ |
|
926 |
\ ==> Abs_hypreal(hyprel `` {%n. Re(X n)}) : Reals"; |
|
927 |
by (auto_tac (claset(),simpset() addsimps [SComplex_def, |
|
928 |
hcomplex_of_complex_def,SReal_def,hypreal_of_real_def])); |
|
929 |
by (res_inst_tac [("x","Re r")] exI 1); |
|
930 |
by (Ultra_tac 1); |
|
931 |
qed "SComplex_Re_SReal"; |
|
932 |
||
933 |
Goal "Abs_hcomplex(hcomplexrel ``{%n. X n}) : SComplex \ |
|
934 |
\ ==> Abs_hypreal(hyprel `` {%n. Im(X n)}) : Reals"; |
|
935 |
by (auto_tac (claset(),simpset() addsimps [SComplex_def, |
|
936 |
hcomplex_of_complex_def,SReal_def,hypreal_of_real_def])); |
|
937 |
by (res_inst_tac [("x","Im r")] exI 1); |
|
938 |
by (Ultra_tac 1); |
|
939 |
qed "SComplex_Im_SReal"; |
|
940 |
||
941 |
Goal "[| Abs_hypreal(hyprel `` {%n. Re(X n)}) : Reals; \ |
|
942 |
\ Abs_hypreal(hyprel `` {%n. Im(X n)}) : Reals \ |
|
943 |
\ |] ==> Abs_hcomplex(hcomplexrel ``{%n. X n}) : SComplex"; |
|
944 |
by (auto_tac (claset(),simpset() addsimps [SComplex_def, |
|
945 |
hcomplex_of_complex_def,SReal_def,hypreal_of_real_def])); |
|
946 |
by (res_inst_tac [("x","complex_of_real r + ii * complex_of_real ra")] exI 1); |
|
947 |
by (Ultra_tac 1); |
|
14373 | 948 |
by (case_tac "X x" 1); |
13957 | 949 |
by (auto_tac (claset(),simpset() addsimps [complex_of_real_def,i_def, |
950 |
complex_add,complex_mult])); |
|
951 |
qed "Reals_Re_Im_SComplex"; |
|
952 |
||
953 |
Goal "(Abs_hcomplex(hcomplexrel ``{%n. X n}) : SComplex) = \ |
|
954 |
\ (Abs_hypreal(hyprel `` {%n. Re(X n)}) : Reals & \ |
|
955 |
\ Abs_hypreal(hyprel `` {%n. Im(X n)}) : Reals)"; |
|
956 |
by (blast_tac (claset() addIs [SComplex_Re_SReal,SComplex_Im_SReal, |
|
957 |
Reals_Re_Im_SComplex]) 1); |
|
958 |
qed "SComplex_SReal_iff"; |
|
959 |
||
960 |
Goal "(Abs_hcomplex(hcomplexrel ``{%n. X n}) : CInfinitesimal) = \ |
|
961 |
\ (Abs_hypreal(hyprel `` {%n. Re(X n)}) : Infinitesimal & \ |
|
962 |
\ Abs_hypreal(hyprel `` {%n. Im(X n)}) : Infinitesimal)"; |
|
963 |
by (auto_tac (claset(),simpset() addsimps [mem_cinfmal_iff, |
|
964 |
mem_infmal_iff,hcomplex_zero_num,hypreal_zero_num,capprox_approx_iff])); |
|
965 |
qed "CInfinitesimal_Infinitesimal_iff"; |
|
966 |
||
967 |
(*** more lemmas ****) |
|
968 |
Goal "(EX t. P t) = (EX X. P (Abs_hcomplex(hcomplexrel `` {X})))"; |
|
969 |
by Auto_tac; |
|
970 |
by (res_inst_tac [("z","t")] eq_Abs_hcomplex 1); |
|
971 |
by Auto_tac; |
|
972 |
qed "eq_Abs_hcomplex_EX"; |
|
973 |
||
974 |
Goal "(EX t : A. P t) = (EX X. (Abs_hcomplex(hcomplexrel `` {X})) : A & \ |
|
975 |
\ P (Abs_hcomplex(hcomplexrel `` {X})))"; |
|
976 |
by Auto_tac; |
|
977 |
by (res_inst_tac [("z","t")] eq_Abs_hcomplex 1); |
|
978 |
by Auto_tac; |
|
979 |
qed "eq_Abs_hcomplex_Bex"; |
|
980 |
||
981 |
(* Here we go - easy proof now!! *) |
|
982 |
Goal "x:CFinite ==> EX t: SComplex. x @c= t"; |
|
983 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1); |
|
984 |
by (auto_tac (claset(),simpset() addsimps [CFinite_HFinite_iff, |
|
985 |
eq_Abs_hcomplex_Bex,SComplex_SReal_iff,capprox_approx_iff])); |
|
986 |
by (REPEAT(dtac st_part_Ex 1 THEN Step_tac 1)); |
|
987 |
by (res_inst_tac [("z","t")] eq_Abs_hypreal 1); |
|
988 |
by (res_inst_tac [("z","ta")] eq_Abs_hypreal 1); |
|
989 |
by Auto_tac; |
|
990 |
by (res_inst_tac [("x","%n. complex_of_real (xa n) + ii * complex_of_real (xb n)")] |
|
991 |
exI 1); |
|
992 |
by Auto_tac; |
|
993 |
qed "stc_part_Ex"; |
|
994 |
||
995 |
Goal "x:CFinite ==> EX! t. t : SComplex & x @c= t"; |
|
996 |
by (dtac stc_part_Ex 1 THEN Step_tac 1); |
|
997 |
by (dtac capprox_sym 2 THEN dtac capprox_sym 2 |
|
998 |
THEN dtac capprox_sym 2); |
|
999 |
by (auto_tac (claset() addSIs [capprox_unique_complex], simpset())); |
|
1000 |
qed "stc_part_Ex1"; |
|
1001 |
||
1002 |
Goalw [CFinite_def,CInfinite_def] "CFinite Int CInfinite = {}"; |
|
1003 |
by Auto_tac; |
|
1004 |
qed "CFinite_Int_CInfinite_empty"; |
|
1005 |
Addsimps [CFinite_Int_CInfinite_empty]; |
|
1006 |
||
1007 |
Goal "x: CFinite ==> x ~: CInfinite"; |
|
1008 |
by (EVERY1[Step_tac, dtac IntI, assume_tac]); |
|
1009 |
by Auto_tac; |
|
1010 |
qed "CFinite_not_CInfinite"; |
|
1011 |
||
1012 |
Goal "x~: CFinite ==> x: CInfinite"; |
|
1013 |
by (auto_tac (claset() addIs [not_HFinite_HInfinite], |
|
1014 |
simpset() addsimps [CFinite_hcmod_iff,CInfinite_hcmod_iff])); |
|
1015 |
qed "not_CFinite_CInfinite"; |
|
1016 |
||
1017 |
Goal "x : CInfinite | x : CFinite"; |
|
1018 |
by (blast_tac (claset() addIs [not_CFinite_CInfinite]) 1); |
|
1019 |
qed "CInfinite_CFinite_disj"; |
|
1020 |
||
1021 |
Goal "(x : CInfinite) = (x ~: CFinite)"; |
|
1022 |
by (blast_tac (claset() addDs [CFinite_not_CInfinite, |
|
1023 |
not_CFinite_CInfinite]) 1); |
|
1024 |
qed "CInfinite_CFinite_iff"; |
|
1025 |
||
1026 |
Goal "(x : CFinite) = (x ~: CInfinite)"; |
|
1027 |
by (simp_tac (simpset() addsimps [CInfinite_CFinite_iff]) 1); |
|
1028 |
qed "CFinite_CInfinite_iff"; |
|
1029 |
||
1030 |
Goal "x ~: CInfinitesimal ==> x : CInfinite | x : CFinite - CInfinitesimal"; |
|
1031 |
by (fast_tac (claset() addIs [not_CFinite_CInfinite]) 1); |
|
1032 |
qed "CInfinite_diff_CFinite_CInfinitesimal_disj"; |
|
1033 |
||
1034 |
Goal "[| x : CFinite; x ~: CInfinitesimal |] ==> inverse x : CFinite"; |
|
1035 |
by (cut_inst_tac [("x","inverse x")] CInfinite_CFinite_disj 1); |
|
1036 |
by (auto_tac (claset() addSDs [CInfinite_inverse_CInfinitesimal], simpset())); |
|
1037 |
qed "CFinite_inverse"; |
|
1038 |
||
1039 |
Goal "x : CFinite - CInfinitesimal ==> inverse x : CFinite"; |
|
1040 |
by (blast_tac (claset() addIs [CFinite_inverse]) 1); |
|
1041 |
qed "CFinite_inverse2"; |
|
1042 |
||
1043 |
Goal "x ~: CInfinitesimal ==> inverse(x) : CFinite"; |
|
1044 |
by (dtac CInfinite_diff_CFinite_CInfinitesimal_disj 1); |
|
1045 |
by (blast_tac (claset() addIs [CFinite_inverse, |
|
1046 |
CInfinite_inverse_CInfinitesimal, |
|
1047 |
CInfinitesimal_subset_CFinite RS subsetD]) 1); |
|
1048 |
qed "CInfinitesimal_inverse_CFinite"; |
|
1049 |
||
1050 |
||
1051 |
Goal "x : CFinite - CInfinitesimal ==> inverse x : CFinite - CInfinitesimal"; |
|
1052 |
by (auto_tac (claset() addIs [CInfinitesimal_inverse_CFinite], simpset())); |
|
1053 |
by (dtac CInfinitesimal_CFinite_mult2 1); |
|
1054 |
by (assume_tac 1); |
|
1055 |
by (asm_full_simp_tac (simpset() addsimps [not_CInfinitesimal_not_zero]) 1); |
|
1056 |
qed "CFinite_not_CInfinitesimal_inverse"; |
|
1057 |
||
1058 |
Goal "[| x @c= y; y : CFinite - CInfinitesimal |] \ |
|
1059 |
\ ==> inverse x @c= inverse y"; |
|
1060 |
by (forward_tac [CFinite_diff_CInfinitesimal_capprox] 1); |
|
1061 |
by (assume_tac 1); |
|
1062 |
by (forward_tac [not_CInfinitesimal_not_zero2] 1); |
|
1063 |
by (forw_inst_tac [("x","x")] not_CInfinitesimal_not_zero2 1); |
|
1064 |
by (REPEAT(dtac CFinite_inverse2 1)); |
|
1065 |
by (dtac capprox_mult2 1 THEN assume_tac 1); |
|
1066 |
by Auto_tac; |
|
1067 |
by (dres_inst_tac [("c","inverse x")] capprox_mult1 1 |
|
1068 |
THEN assume_tac 1); |
|
1069 |
by (auto_tac (claset() addIs [capprox_sym], |
|
1070 |
simpset() addsimps [hcomplex_mult_assoc])); |
|
1071 |
qed "capprox_inverse"; |
|
1072 |
||
1073 |
bind_thm ("hcomplex_of_complex_capprox_inverse", |
|
1074 |
hcomplex_of_complex_CFinite_diff_CInfinitesimal RSN (2, capprox_inverse)); |
|
1075 |
||
1076 |
Goal "[| x: CFinite - CInfinitesimal; \ |
|
1077 |
\ h : CInfinitesimal |] ==> inverse(x + h) @c= inverse x"; |
|
1078 |
by (auto_tac (claset() addIs [capprox_inverse, capprox_sym, |
|
1079 |
CInfinitesimal_add_capprox_self], |
|
1080 |
simpset())); |
|
1081 |
qed "inverse_add_CInfinitesimal_capprox"; |
|
1082 |
||
1083 |
Goal "[| x: CFinite - CInfinitesimal; \ |
|
1084 |
\ h : CInfinitesimal |] ==> inverse(h + x) @c= inverse x"; |
|
1085 |
by (rtac (hcomplex_add_commute RS subst) 1); |
|
1086 |
by (blast_tac (claset() addIs [inverse_add_CInfinitesimal_capprox]) 1); |
|
1087 |
qed "inverse_add_CInfinitesimal_capprox2"; |
|
1088 |
||
1089 |
Goal "[| x : CFinite - CInfinitesimal; \ |
|
1090 |
\ h : CInfinitesimal |] ==> inverse(x + h) - inverse x @c= h"; |
|
1091 |
by (rtac capprox_trans2 1); |
|
1092 |
by (auto_tac (claset() addIs [inverse_add_CInfinitesimal_capprox], |
|
1093 |
simpset() addsimps [mem_cinfmal_iff,hcomplex_diff_def, |
|
1094 |
capprox_minus_iff RS sym])); |
|
1095 |
qed "inverse_add_CInfinitesimal_approx_CInfinitesimal"; |
|
1096 |
||
1097 |
Goal "(x*x : CInfinitesimal) = (x : CInfinitesimal)"; |
|
1098 |
by (auto_tac (claset(), simpset() addsimps [CInfinitesimal_hcmod_iff, |
|
1099 |
hcmod_mult])); |
|
1100 |
qed "CInfinitesimal_square_iff"; |
|
1101 |
AddIffs [CInfinitesimal_square_iff]; |
|
1102 |
||
1103 |
Goal "[| a: CFinite-CInfinitesimal; a*w @c= a*z |] ==> w @c= z"; |
|
1104 |
by (Step_tac 1); |
|
1105 |
by (ftac CFinite_inverse 1 THEN assume_tac 1); |
|
1106 |
by (dtac not_CInfinitesimal_not_zero 1); |
|
1107 |
by (auto_tac (claset() addDs [capprox_mult2], |
|
1108 |
simpset() addsimps [hcomplex_mult_assoc RS sym])); |
|
1109 |
qed "capprox_CFinite_mult_cancel"; |
|
1110 |
||
1111 |
Goal "a: CFinite-CInfinitesimal ==> (a * w @c= a * z) = (w @c= z)"; |
|
1112 |
by (auto_tac (claset() addIs [capprox_mult2, |
|
1113 |
capprox_CFinite_mult_cancel], simpset())); |
|
1114 |
qed "capprox_CFinite_mult_cancel_iff1"; |
|
1115 |
||
1116 |
||
1117 |
(*---------------------------------------------------------------------------*) |
|
1118 |
(* Theorems about monads *) |
|
1119 |
(*---------------------------------------------------------------------------*) |
|
1120 |
||
1121 |
Goalw [cmonad_def] "(x @c= y) = (cmonad(x)=cmonad(y))"; |
|
1122 |
by (auto_tac (claset() addDs [capprox_sym] |
|
1123 |
addSEs [capprox_trans,equalityCE], |
|
1124 |
simpset())); |
|
1125 |
qed "capprox_cmonad_iff"; |
|
1126 |
||
1127 |
Goal "e : CInfinitesimal ==> cmonad (x+e) = cmonad x"; |
|
1128 |
by (fast_tac (claset() addSIs [CInfinitesimal_add_capprox_self RS capprox_sym, |
|
1129 |
capprox_cmonad_iff RS iffD1]) 1); |
|
1130 |
qed "CInfinitesimal_cmonad_eq"; |
|
1131 |
||
1132 |
Goalw [cmonad_def] "(u:cmonad x) = (-u:cmonad (-x))"; |
|
1133 |
by Auto_tac; |
|
1134 |
qed "mem_cmonad_iff"; |
|
1135 |
||
1136 |
Goalw [cmonad_def] "(x:CInfinitesimal) = (x:cmonad 0)"; |
|
1137 |
by (auto_tac (claset() addIs [capprox_sym], |
|
1138 |
simpset() addsimps [mem_cinfmal_iff])); |
|
1139 |
qed "CInfinitesimal_cmonad_zero_iff"; |
|
1140 |
||
1141 |
Goal "(x:cmonad 0) = (-x:cmonad 0)"; |
|
1142 |
by (simp_tac (simpset() addsimps [CInfinitesimal_cmonad_zero_iff RS sym]) 1); |
|
1143 |
qed "cmonad_zero_minus_iff"; |
|
1144 |
||
1145 |
Goal "(x:cmonad 0) = (hcmod x:monad 0)"; |
|
1146 |
by (auto_tac (claset(), simpset() addsimps |
|
1147 |
[CInfinitesimal_cmonad_zero_iff RS sym, |
|
1148 |
CInfinitesimal_hcmod_iff,Infinitesimal_monad_zero_iff RS sym])); |
|
1149 |
qed "cmonad_zero_hcmod_iff"; |
|
1150 |
||
1151 |
Goalw [cmonad_def] "x:cmonad x"; |
|
1152 |
by (Simp_tac 1); |
|
1153 |
qed "mem_cmonad_self"; |
|
1154 |
Addsimps [mem_cmonad_self]; |
|
1155 |
||
1156 |
(*---------------------------------------------------------------------------*) |
|
1157 |
(* Theorems about standard part *) |
|
1158 |
(*---------------------------------------------------------------------------*) |
|
1159 |
Goalw [stc_def] "x: CFinite ==> stc x @c= x"; |
|
1160 |
by (forward_tac [stc_part_Ex] 1 THEN Step_tac 1); |
|
1161 |
by (rtac someI2 1); |
|
1162 |
by (auto_tac (claset() addIs [capprox_sym], simpset())); |
|
1163 |
qed "stc_capprox_self"; |
|
1164 |
||
1165 |
Goalw [stc_def] "x: CFinite ==> stc x: SComplex"; |
|
1166 |
by (forward_tac [stc_part_Ex] 1 THEN Step_tac 1); |
|
1167 |
by (rtac someI2 1); |
|
1168 |
by (auto_tac (claset() addIs [capprox_sym], simpset())); |
|
1169 |
qed "stc_SComplex"; |
|
1170 |
||
1171 |
Goal "x: CFinite ==> stc x: CFinite"; |
|
1172 |
by (etac (stc_SComplex RS (SComplex_subset_CFinite RS subsetD)) 1); |
|
1173 |
qed "stc_CFinite"; |
|
1174 |
||
1175 |
Goalw [stc_def] "x: SComplex ==> stc x = x"; |
|
1176 |
by (rtac some_equality 1); |
|
1177 |
by (auto_tac (claset() addIs [(SComplex_subset_CFinite RS subsetD)],simpset())); |
|
1178 |
by (blast_tac (claset() addDs [SComplex_capprox_iff RS iffD1]) 1); |
|
1179 |
qed "stc_SComplex_eq"; |
|
1180 |
Addsimps [stc_SComplex_eq]; |
|
1181 |
||
1182 |
Goal "stc (hcomplex_of_complex x) = hcomplex_of_complex x"; |
|
1183 |
by Auto_tac; |
|
1184 |
qed "stc_hcomplex_of_complex"; |
|
1185 |
||
1186 |
Goal "[| x: CFinite; y: CFinite; stc x = stc y |] ==> x @c= y"; |
|
1187 |
by (auto_tac (claset() addSDs [stc_capprox_self] |
|
1188 |
addSEs [capprox_trans3], simpset())); |
|
1189 |
qed "stc_eq_capprox"; |
|
1190 |
||
1191 |
Goal "[| x: CFinite; y: CFinite; x @c= y |] ==> stc x = stc y"; |
|
1192 |
by (EVERY1 [forward_tac [stc_capprox_self], |
|
1193 |
forw_inst_tac [("x","y")] stc_capprox_self, |
|
1194 |
dtac stc_SComplex,dtac stc_SComplex]); |
|
1195 |
by (fast_tac (claset() addEs [capprox_trans, |
|
1196 |
capprox_trans2,SComplex_capprox_iff RS iffD1]) 1); |
|
1197 |
qed "capprox_stc_eq"; |
|
1198 |
||
1199 |
Goal "[| x: CFinite; y: CFinite|] ==> (x @c= y) = (stc x = stc y)"; |
|
1200 |
by (blast_tac (claset() addIs [capprox_stc_eq,stc_eq_capprox]) 1); |
|
1201 |
qed "stc_eq_capprox_iff"; |
|
1202 |
||
1203 |
Goal "[| x: SComplex; e: CInfinitesimal |] ==> stc(x + e) = x"; |
|
1204 |
by (forward_tac [stc_SComplex_eq RS subst] 1); |
|
1205 |
by (assume_tac 2); |
|
1206 |
by (forward_tac [SComplex_subset_CFinite RS subsetD] 1); |
|
1207 |
by (forward_tac [CInfinitesimal_subset_CFinite RS subsetD] 1); |
|
1208 |
by (dtac stc_SComplex_eq 1); |
|
1209 |
by (rtac capprox_stc_eq 1); |
|
1210 |
by (auto_tac (claset() addIs [CFinite_add], |
|
1211 |
simpset() addsimps [CInfinitesimal_add_capprox_self |
|
1212 |
RS capprox_sym])); |
|
1213 |
qed "stc_CInfinitesimal_add_SComplex"; |
|
1214 |
||
1215 |
Goal "[| x: SComplex; e: CInfinitesimal |] ==> stc(e + x) = x"; |
|
1216 |
by (rtac (hcomplex_add_commute RS subst) 1); |
|
1217 |
by (blast_tac (claset() addSIs [stc_CInfinitesimal_add_SComplex]) 1); |
|
1218 |
qed "stc_CInfinitesimal_add_SComplex2"; |
|
1219 |
||
1220 |
Goal "x: CFinite ==> EX e: CInfinitesimal. x = stc(x) + e"; |
|
1221 |
by (blast_tac (claset() addSDs [(stc_capprox_self RS |
|
1222 |
capprox_sym),bex_CInfinitesimal_iff2 RS iffD2]) 1); |
|
1223 |
qed "CFinite_stc_CInfinitesimal_add"; |
|
1224 |
||
1225 |
Goal "[| x: CFinite; y: CFinite |] ==> stc (x + y) = stc(x) + stc(y)"; |
|
1226 |
by (forward_tac [CFinite_stc_CInfinitesimal_add] 1); |
|
1227 |
by (forw_inst_tac [("x","y")] CFinite_stc_CInfinitesimal_add 1); |
|
1228 |
by (Step_tac 1); |
|
1229 |
by (subgoal_tac "stc (x + y) = stc ((stc x + e) + (stc y + ea))" 1); |
|
1230 |
by (dtac sym 2 THEN dtac sym 2); |
|
1231 |
by (Asm_full_simp_tac 2); |
|
14335 | 1232 |
by (asm_simp_tac (simpset() addsimps add_ac) 1); |
13957 | 1233 |
by (REPEAT(dtac stc_SComplex 1)); |
1234 |
by (dtac SComplex_add 1 THEN assume_tac 1); |
|
1235 |
by (dtac CInfinitesimal_add 1 THEN assume_tac 1); |
|
1236 |
by (rtac (hcomplex_add_assoc RS subst) 1); |
|
1237 |
by (blast_tac (claset() addSIs [stc_CInfinitesimal_add_SComplex2]) 1); |
|
1238 |
qed "stc_add"; |
|
1239 |
||
1240 |
Goal "stc (number_of w) = number_of w"; |
|
1241 |
by (rtac (SComplex_number_of RS stc_SComplex_eq) 1); |
|
1242 |
qed "stc_number_of"; |
|
1243 |
Addsimps [stc_number_of]; |
|
1244 |
||
1245 |
Goal "stc 0 = 0"; |
|
1246 |
by (Simp_tac 1); |
|
1247 |
qed "stc_zero"; |
|
1248 |
Addsimps [stc_zero]; |
|
1249 |
||
1250 |
Goal "stc 1 = 1"; |
|
1251 |
by (Simp_tac 1); |
|
1252 |
qed "stc_one"; |
|
1253 |
Addsimps [stc_one]; |
|
1254 |
||
1255 |
Goal "y: CFinite ==> stc(-y) = -stc(y)"; |
|
1256 |
by (forward_tac [CFinite_minus_iff RS iffD2] 1); |
|
1257 |
by (rtac hcomplex_add_minus_eq_minus 1); |
|
1258 |
by (dtac (stc_add RS sym) 1 THEN assume_tac 1); |
|
14320 | 1259 |
by (asm_simp_tac (simpset() addsimps [add_commute]) 1); |
13957 | 1260 |
qed "stc_minus"; |
1261 |
||
1262 |
Goalw [hcomplex_diff_def] |
|
1263 |
"[| x: CFinite; y: CFinite |] ==> stc (x-y) = stc(x) - stc(y)"; |
|
1264 |
by (forw_inst_tac [("y1","y")] (stc_minus RS sym) 1); |
|
1265 |
by (dres_inst_tac [("x1","y")] (CFinite_minus_iff RS iffD2) 1); |
|
1266 |
by (auto_tac (claset() addIs [stc_add],simpset())); |
|
1267 |
qed "stc_diff"; |
|
1268 |
||
1269 |
Goal "[| x: CFinite; y: CFinite; \ |
|
1270 |
\ e: CInfinitesimal; \ |
|
1271 |
\ ea: CInfinitesimal |] \ |
|
1272 |
\ ==> e*y + x*ea + e*ea: CInfinitesimal"; |
|
1273 |
by (forw_inst_tac [("x","e"),("y","y")] CInfinitesimal_CFinite_mult 1); |
|
1274 |
by (forw_inst_tac [("x","ea"),("y","x")] CInfinitesimal_CFinite_mult 2); |
|
1275 |
by (dtac CInfinitesimal_mult 3); |
|
1276 |
by (auto_tac (claset() addIs [CInfinitesimal_add], |
|
14335 | 1277 |
simpset() addsimps add_ac @ mult_ac)); |
13957 | 1278 |
qed "lemma_stc_mult"; |
1279 |
||
1280 |
Goal "[| x: CFinite; y: CFinite |] \ |
|
1281 |
\ ==> stc (x * y) = stc(x) * stc(y)"; |
|
1282 |
by (forward_tac [CFinite_stc_CInfinitesimal_add] 1); |
|
1283 |
by (forw_inst_tac [("x","y")] CFinite_stc_CInfinitesimal_add 1); |
|
1284 |
by (Step_tac 1); |
|
1285 |
by (subgoal_tac "stc (x * y) = stc ((stc x + e) * (stc y + ea))" 1); |
|
1286 |
by (dtac sym 2 THEN dtac sym 2); |
|
1287 |
by (Asm_full_simp_tac 2); |
|
1288 |
by (thin_tac "x = stc x + e" 1); |
|
1289 |
by (thin_tac "y = stc y + ea" 1); |
|
1290 |
by (asm_full_simp_tac (simpset() addsimps |
|
14335 | 1291 |
[hcomplex_add_mult_distrib,right_distrib]) 1); |
13957 | 1292 |
by (REPEAT(dtac stc_SComplex 1)); |
1293 |
by (full_simp_tac (simpset() addsimps [hcomplex_add_assoc]) 1); |
|
1294 |
by (rtac stc_CInfinitesimal_add_SComplex 1); |
|
1295 |
by (blast_tac (claset() addSIs [SComplex_mult]) 1); |
|
1296 |
by (REPEAT(dtac (SComplex_subset_CFinite RS subsetD) 1)); |
|
1297 |
by (rtac (hcomplex_add_assoc RS subst) 1); |
|
1298 |
by (blast_tac (claset() addSIs [lemma_stc_mult]) 1); |
|
1299 |
qed "stc_mult"; |
|
1300 |
||
1301 |
Goal "x: CInfinitesimal ==> stc x = 0"; |
|
1302 |
by (rtac (stc_zero RS subst) 1); |
|
1303 |
by (rtac capprox_stc_eq 1); |
|
1304 |
by (auto_tac (claset() addIs [CInfinitesimal_subset_CFinite RS subsetD], |
|
1305 |
simpset() addsimps [mem_cinfmal_iff RS sym])); |
|
1306 |
qed "stc_CInfinitesimal"; |
|
1307 |
||
1308 |
Goal "stc(x) ~= 0 ==> x ~: CInfinitesimal"; |
|
1309 |
by (fast_tac (claset() addIs [stc_CInfinitesimal]) 1); |
|
1310 |
qed "stc_not_CInfinitesimal"; |
|
1311 |
||
1312 |
Goal "[| x: CFinite; stc x ~= 0 |] \ |
|
1313 |
\ ==> stc(inverse x) = inverse (stc x)"; |
|
1314 |
by (res_inst_tac [("c1","stc x")] (hcomplex_mult_left_cancel RS iffD1) 1); |
|
1315 |
by (auto_tac (claset(), |
|
1316 |
simpset() addsimps [stc_mult RS sym, stc_not_CInfinitesimal, |
|
1317 |
CFinite_inverse])); |
|
14318 | 1318 |
by (stac right_inverse 1); |
13957 | 1319 |
by Auto_tac; |
1320 |
qed "stc_inverse"; |
|
1321 |
||
1322 |
Goal "[| x: CFinite; y: CFinite; stc y ~= 0 |] \ |
|
1323 |
\ ==> stc(x/y) = (stc x) / (stc y)"; |
|
1324 |
by (auto_tac (claset(), |
|
1325 |
simpset() addsimps [hcomplex_divide_def, stc_mult, stc_not_CInfinitesimal, |
|
1326 |
CFinite_inverse, stc_inverse])); |
|
1327 |
qed "stc_divide"; |
|
1328 |
Addsimps [stc_divide]; |
|
1329 |
||
1330 |
Goal "x: CFinite ==> stc(stc(x)) = stc(x)"; |
|
1331 |
by (blast_tac (claset() addIs [stc_CFinite, stc_capprox_self, |
|
1332 |
capprox_stc_eq]) 1); |
|
1333 |
qed "stc_idempotent"; |
|
1334 |
Addsimps [stc_idempotent]; |
|
1335 |
||
1336 |
Goal "z : HFinite ==> hcomplex_of_hypreal z : CFinite"; |
|
1337 |
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1); |
|
1338 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal, |
|
1339 |
CFinite_HFinite_iff,symmetric hypreal_zero_def])); |
|
1340 |
qed "CFinite_HFinite_hcomplex_of_hypreal"; |
|
1341 |
||
1342 |
Goal "x : Reals ==> hcomplex_of_hypreal x : SComplex"; |
|
1343 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
1344 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal, |
|
1345 |
SComplex_SReal_iff,symmetric hypreal_zero_def])); |
|
1346 |
qed "SComplex_SReal_hcomplex_of_hypreal"; |
|
1347 |
||
1348 |
Goalw [st_def,stc_def] |
|
1349 |
"z : HFinite ==> stc(hcomplex_of_hypreal z) = hcomplex_of_hypreal (st z)"; |
|
1350 |
by (ftac st_part_Ex 1 THEN Step_tac 1); |
|
1351 |
by (rtac someI2 1); |
|
1352 |
by (auto_tac (claset() addIs [approx_sym],simpset())); |
|
1353 |
by (dtac CFinite_HFinite_hcomplex_of_hypreal 1); |
|
1354 |
by (ftac stc_part_Ex 1 THEN Step_tac 1); |
|
1355 |
by (rtac someI2 1); |
|
1356 |
by (auto_tac (claset() addIs [capprox_sym] addSIs [capprox_unique_complex] |
|
1357 |
addDs [SComplex_SReal_hcomplex_of_hypreal],simpset())); |
|
1358 |
qed "stc_hcomplex_of_hypreal"; |
|
1359 |
||
1360 |
(* |
|
1361 |
Goal "x: CFinite ==> hcmod(stc x) = st(hcmod x)"; |
|
1362 |
by (dtac stc_capprox_self 1); |
|
1363 |
by (auto_tac (claset(),simpset() addsimps [bex_CInfinitesimal_iff2 RS sym])); |
|
1364 |
||
1365 |
||
1366 |
approx_hcmod_add_hcmod |
|
1367 |
*) |
|
1368 |
||
1369 |
(*---------------------------------------------------------------------------*) |
|
1370 |
(* More nonstandard complex specific theorems *) |
|
1371 |
(*---------------------------------------------------------------------------*) |
|
1372 |
Goal "(hcnj z : CInfinitesimal) = (z : CInfinitesimal)"; |
|
1373 |
by (auto_tac (claset(),simpset() addsimps [CInfinitesimal_hcmod_iff])); |
|
1374 |
qed "CInfinitesimal_hcnj_iff"; |
|
1375 |
Addsimps [CInfinitesimal_hcnj_iff]; |
|
1376 |
||
1377 |
Goal "(Abs_hcomplex(hcomplexrel ``{%n. X n}) : CInfinite) = \ |
|
1378 |
\ (Abs_hypreal(hyprel `` {%n. Re(X n)}) : HInfinite | \ |
|
1379 |
\ Abs_hypreal(hyprel `` {%n. Im(X n)}) : HInfinite)"; |
|
1380 |
by (auto_tac (claset(),simpset() addsimps [CInfinite_CFinite_iff, |
|
1381 |
HInfinite_HFinite_iff,CFinite_HFinite_iff])); |
|
1382 |
qed "CInfinite_HInfinite_iff"; |
|
1383 |
||
1384 |
Goal "(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y : CInfinitesimal) = \ |
|
1385 |
\ (x : Infinitesimal & y : Infinitesimal)"; |
|
1386 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
1387 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1); |
|
1388 |
by (auto_tac (claset(),simpset() addsimps [iii_def,hcomplex_add,hcomplex_mult, |
|
1389 |
hcomplex_of_hypreal,CInfinitesimal_Infinitesimal_iff])); |
|
1390 |
qed "hcomplex_split_CInfinitesimal_iff"; |
|
1391 |
||
1392 |
Goal "(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y : CFinite) = \ |
|
1393 |
\ (x : HFinite & y : HFinite)"; |
|
1394 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
1395 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1); |
|
1396 |
by (auto_tac (claset(),simpset() addsimps [iii_def,hcomplex_add,hcomplex_mult, |
|
1397 |
hcomplex_of_hypreal,CFinite_HFinite_iff])); |
|
1398 |
qed "hcomplex_split_CFinite_iff"; |
|
1399 |
||
1400 |
Goal "(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y : SComplex) = \ |
|
1401 |
\ (x : Reals & y : Reals)"; |
|
1402 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
1403 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1); |
|
1404 |
by (auto_tac (claset(),simpset() addsimps [iii_def,hcomplex_add,hcomplex_mult, |
|
1405 |
hcomplex_of_hypreal,SComplex_SReal_iff])); |
|
1406 |
qed "hcomplex_split_SComplex_iff"; |
|
1407 |
||
1408 |
Goal "(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y : CInfinite) = \ |
|
1409 |
\ (x : HInfinite | y : HInfinite)"; |
|
1410 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
1411 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1); |
|
1412 |
by (auto_tac (claset(),simpset() addsimps [iii_def,hcomplex_add,hcomplex_mult, |
|
1413 |
hcomplex_of_hypreal,CInfinite_HInfinite_iff])); |
|
1414 |
qed "hcomplex_split_CInfinite_iff"; |
|
1415 |
||
1416 |
Goal "(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y @c= \ |
|
1417 |
\ hcomplex_of_hypreal x' + iii * hcomplex_of_hypreal y') = \ |
|
1418 |
\ (x @= x' & y @= y')"; |
|
1419 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
1420 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1); |
|
1421 |
by (res_inst_tac [("z","x'")] eq_Abs_hypreal 1); |
|
1422 |
by (res_inst_tac [("z","y'")] eq_Abs_hypreal 1); |
|
1423 |
by (auto_tac (claset(),simpset() addsimps [iii_def,hcomplex_add,hcomplex_mult, |
|
1424 |
hcomplex_of_hypreal,capprox_approx_iff])); |
|
1425 |
qed "hcomplex_split_capprox_iff"; |
|
1426 |
||
1427 |
(*** More theorems ***) |
|
1428 |
||
1429 |
Goal "ALL n. cmod (X n - x) < inverse (real (Suc n)) ==> \ |
|
1430 |
\ Abs_hcomplex(hcomplexrel``{X}) - hcomplex_of_complex x : CInfinitesimal"; |
|
1431 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_diff, |
|
1432 |
CInfinitesimal_hcmod_iff,hcomplex_of_complex_def, |
|
1433 |
Infinitesimal_FreeUltrafilterNat_iff,hcmod])); |
|
1434 |
by (rtac bexI 1 THEN Auto_tac); |
|
1435 |
by (auto_tac (claset() addDs [FreeUltrafilterNat_inverse_real_of_posnat, |
|
1436 |
FreeUltrafilterNat_all,FreeUltrafilterNat_Int] |
|
1437 |
addIs [order_less_trans, FreeUltrafilterNat_subset], |
|
1438 |
simpset())); |
|
1439 |
qed "complex_seq_to_hcomplex_CInfinitesimal"; |
|
1440 |
||
1441 |
Goal "hcomplex_of_hypreal epsilon : CInfinitesimal"; |
|
1442 |
by (auto_tac (claset(),simpset() addsimps [CInfinitesimal_hcmod_iff])); |
|
1443 |
qed "CInfinitesimal_hcomplex_of_hypreal_epsilon"; |
|
1444 |
Addsimps [CInfinitesimal_hcomplex_of_hypreal_epsilon]; |
|
1445 |
||
1446 |
Goal "(hcomplex_of_complex z @c= 0) = (z = 0)"; |
|
1447 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_complex_zero RS sym] |
|
1448 |
delsimps [hcomplex_of_complex_zero])); |
|
1449 |
qed "hcomplex_of_complex_approx_zero_iff"; |
|
1450 |
||
1451 |
Goal "(0 @c= hcomplex_of_complex z) = (z = 0)"; |
|
1452 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_complex_zero RS sym] |
|
1453 |
delsimps [hcomplex_of_complex_zero])); |
|
1454 |
qed "hcomplex_of_complex_approx_zero_iff2"; |
|
1455 |
||
1456 |
Addsimps [hcomplex_of_complex_approx_zero_iff,hcomplex_of_complex_approx_zero_iff2]; |
|
1457 |
||
1458 |