13957
|
1 |
(* Title: NSComplex.ML
|
|
2 |
Author: Jacques D. Fleuriot
|
|
3 |
Copyhright: 2001 University of Edinburgh
|
|
4 |
Description: Nonstandard Complex numbers
|
|
5 |
*)
|
|
6 |
|
|
7 |
Goalw [hcomplexrel_def]
|
|
8 |
"((X,Y): hcomplexrel) = ({n. X n = Y n}: FreeUltrafilterNat)";
|
|
9 |
by (Fast_tac 1);
|
|
10 |
qed "hcomplexrel_iff";
|
|
11 |
|
|
12 |
Goalw [hcomplexrel_def]
|
|
13 |
"!!X. {n. X n = Y n}: FreeUltrafilterNat \
|
|
14 |
\ ==> (X,Y): hcomplexrel";
|
|
15 |
by (Fast_tac 1);
|
|
16 |
qed "hcomplexrelI";
|
|
17 |
|
|
18 |
Goalw [hcomplexrel_def]
|
|
19 |
"p: hcomplexrel --> (EX X Y. \
|
|
20 |
\ p = (X,Y) & {n. X n = Y n} : FreeUltrafilterNat)";
|
|
21 |
by (Fast_tac 1);
|
|
22 |
qed "hcomplexrelE_lemma";
|
|
23 |
|
|
24 |
val [major,minor] = goal thy
|
|
25 |
"[| p: hcomplexrel; \
|
|
26 |
\ !!X Y. [| p = (X,Y); {n. X n = Y n}: FreeUltrafilterNat\
|
|
27 |
\ |] ==> Q |] ==> Q";
|
|
28 |
by (cut_facts_tac [major RS (hcomplexrelE_lemma RS mp)] 1);
|
|
29 |
by (REPEAT (eresolve_tac [asm_rl,exE,conjE,minor] 1));
|
|
30 |
qed "hcomplexrelE";
|
|
31 |
|
|
32 |
AddSIs [hcomplexrelI];
|
|
33 |
AddSEs [hcomplexrelE];
|
|
34 |
|
|
35 |
Goalw [hcomplexrel_def] "(x,x): hcomplexrel";
|
|
36 |
by (Auto_tac);
|
|
37 |
qed "hcomplexrel_refl";
|
|
38 |
|
|
39 |
Goalw [hcomplexrel_def] "(x,y): hcomplexrel --> (y,x):hcomplexrel";
|
|
40 |
by (auto_tac (claset() addIs [lemma_perm RS subst],simpset()));
|
|
41 |
qed_spec_mp "hcomplexrel_sym";
|
|
42 |
|
|
43 |
Goalw [hcomplexrel_def]
|
|
44 |
"(x,y): hcomplexrel --> (y,z):hcomplexrel --> (x,z):hcomplexrel";
|
|
45 |
by (Auto_tac);
|
|
46 |
by (Ultra_tac 1);
|
|
47 |
qed_spec_mp "hcomplexrel_trans";
|
|
48 |
|
|
49 |
Goalw [equiv_def, refl_def, sym_def, trans_def]
|
|
50 |
"equiv {x::nat=>complex. True} hcomplexrel";
|
|
51 |
by (auto_tac (claset() addSIs [hcomplexrel_refl] addSEs
|
|
52 |
[hcomplexrel_sym,hcomplexrel_trans] delrules [hcomplexrelI,hcomplexrelE],
|
|
53 |
simpset()));
|
|
54 |
qed "equiv_hcomplexrel";
|
|
55 |
|
|
56 |
val equiv_hcomplexrel_iff =
|
|
57 |
[TrueI, TrueI] MRS
|
|
58 |
([CollectI, CollectI] MRS
|
|
59 |
(equiv_hcomplexrel RS eq_equiv_class_iff));
|
|
60 |
|
|
61 |
Goalw [hcomplex_def,hcomplexrel_def,quotient_def] "hcomplexrel``{x}:hcomplex";
|
|
62 |
by (Blast_tac 1);
|
|
63 |
qed "hcomplexrel_in_hcomplex";
|
|
64 |
|
|
65 |
Goal "inj_on Abs_hcomplex hcomplex";
|
|
66 |
by (rtac inj_on_inverseI 1);
|
|
67 |
by (etac Abs_hcomplex_inverse 1);
|
|
68 |
qed "inj_on_Abs_hcomplex";
|
|
69 |
|
|
70 |
Addsimps [equiv_hcomplexrel_iff,inj_on_Abs_hcomplex RS inj_on_iff,
|
|
71 |
hcomplexrel_iff, hcomplexrel_in_hcomplex, Abs_hcomplex_inverse];
|
|
72 |
|
|
73 |
Addsimps [equiv_hcomplexrel RS eq_equiv_class_iff];
|
|
74 |
val eq_hcomplexrelD = equiv_hcomplexrel RSN (2,eq_equiv_class);
|
|
75 |
|
|
76 |
Goal "inj(Rep_hcomplex)";
|
|
77 |
by (rtac inj_inverseI 1);
|
|
78 |
by (rtac Rep_hcomplex_inverse 1);
|
|
79 |
qed "inj_Rep_hcomplex";
|
|
80 |
|
|
81 |
Goalw [hcomplexrel_def] "x: hcomplexrel `` {x}";
|
|
82 |
by (Step_tac 1);
|
|
83 |
by (Auto_tac);
|
|
84 |
qed "lemma_hcomplexrel_refl";
|
|
85 |
Addsimps [lemma_hcomplexrel_refl];
|
|
86 |
|
|
87 |
Goalw [hcomplex_def] "{} ~: hcomplex";
|
|
88 |
by (auto_tac (claset() addSEs [quotientE],simpset()));
|
|
89 |
qed "hcomplex_empty_not_mem";
|
|
90 |
Addsimps [hcomplex_empty_not_mem];
|
|
91 |
|
|
92 |
Goal "Rep_hcomplex x ~= {}";
|
|
93 |
by (cut_inst_tac [("x","x")] Rep_hcomplex 1);
|
|
94 |
by (Auto_tac);
|
|
95 |
qed "Rep_hcomplex_nonempty";
|
|
96 |
Addsimps [Rep_hcomplex_nonempty];
|
|
97 |
|
|
98 |
val [prem] = goal thy
|
|
99 |
"(!!x. z = Abs_hcomplex(hcomplexrel `` {x}) ==> P) ==> P";
|
|
100 |
by (res_inst_tac [("x1","z")]
|
|
101 |
(rewrite_rule [hcomplex_def] Rep_hcomplex RS quotientE) 1);
|
|
102 |
by (dres_inst_tac [("f","Abs_hcomplex")] arg_cong 1);
|
|
103 |
by (res_inst_tac [("x","x")] prem 1);
|
|
104 |
by (asm_full_simp_tac (simpset() addsimps [Rep_hcomplex_inverse]) 1);
|
|
105 |
qed "eq_Abs_hcomplex";
|
|
106 |
|
|
107 |
(*-----------------------------------------------------------------------*)
|
|
108 |
(* Properties of nonstandard real and imaginary parts *)
|
|
109 |
(*-----------------------------------------------------------------------*)
|
|
110 |
|
|
111 |
Goalw [hRe_def]
|
|
112 |
"hRe(Abs_hcomplex (hcomplexrel `` {X})) = \
|
|
113 |
\ Abs_hypreal(hyprel `` {%n. Re(X n)})";
|
|
114 |
by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1);
|
|
115 |
by (Auto_tac THEN Ultra_tac 1);
|
|
116 |
qed "hRe";
|
|
117 |
|
|
118 |
Goalw [hIm_def]
|
|
119 |
"hIm(Abs_hcomplex (hcomplexrel `` {X})) = \
|
|
120 |
\ Abs_hypreal(hyprel `` {%n. Im(X n)})";
|
|
121 |
by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1);
|
|
122 |
by (Auto_tac THEN Ultra_tac 1);
|
|
123 |
qed "hIm";
|
|
124 |
|
|
125 |
Goal "(w=z) = (hRe(w) = hRe(z) & hIm(w) = hIm(z))";
|
|
126 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
127 |
by (res_inst_tac [("z","w")] eq_Abs_hcomplex 1);
|
|
128 |
by (auto_tac (claset(),simpset() addsimps [hRe,hIm,
|
|
129 |
complex_Re_Im_cancel_iff]));
|
|
130 |
by (ALLGOALS(Ultra_tac));
|
|
131 |
qed "hcomplex_hRe_hIm_cancel_iff";
|
|
132 |
|
|
133 |
Goalw [hcomplex_zero_def] "hRe 0 = 0";
|
|
134 |
by (simp_tac (simpset() addsimps [hRe,hypreal_zero_num]) 1);
|
|
135 |
qed "hcomplex_hRe_zero";
|
|
136 |
Addsimps [hcomplex_hRe_zero];
|
|
137 |
|
|
138 |
Goalw [hcomplex_zero_def] "hIm 0 = 0";
|
|
139 |
by (simp_tac (simpset() addsimps [hIm,hypreal_zero_num]) 1);
|
|
140 |
qed "hcomplex_hIm_zero";
|
|
141 |
Addsimps [hcomplex_hIm_zero];
|
|
142 |
|
|
143 |
Goalw [hcomplex_one_def] "hRe 1 = 1";
|
|
144 |
by (simp_tac (simpset() addsimps [hRe,hypreal_one_num]) 1);
|
|
145 |
qed "hcomplex_hRe_one";
|
|
146 |
Addsimps [hcomplex_hRe_one];
|
|
147 |
|
|
148 |
Goalw [hcomplex_one_def] "hIm 1 = 0";
|
|
149 |
by (simp_tac (simpset() addsimps [hIm,hypreal_one_def,hypreal_zero_num]) 1);
|
|
150 |
qed "hcomplex_hIm_one";
|
|
151 |
Addsimps [hcomplex_hIm_one];
|
|
152 |
|
|
153 |
(*-----------------------------------------------------------------------*)
|
|
154 |
(* hcomplex_of_complex: the injection from complex to hcomplex *)
|
|
155 |
(* ----------------------------------------------------------------------*)
|
|
156 |
|
|
157 |
Goal "inj(hcomplex_of_complex)";
|
|
158 |
by (rtac injI 1 THEN rtac ccontr 1);
|
|
159 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_complex_def]));
|
|
160 |
qed "inj_hcomplex_of_complex";
|
|
161 |
|
|
162 |
Goalw [iii_def,hcomplex_of_complex_def] "iii = hcomplex_of_complex ii";
|
|
163 |
by (Simp_tac 1);
|
|
164 |
qed "hcomplex_of_complex_i";
|
|
165 |
|
|
166 |
(*-----------------------------------------------------------------------*)
|
|
167 |
(* Addition for nonstandard complex numbers: hcomplex_add *)
|
|
168 |
(* ----------------------------------------------------------------------*)
|
|
169 |
|
|
170 |
Goalw [congruent2_def]
|
|
171 |
"congruent2 hcomplexrel (%X Y. hcomplexrel `` {%n. X n + Y n})";
|
|
172 |
by (safe_tac (claset()));
|
|
173 |
by (ALLGOALS(Ultra_tac));
|
|
174 |
qed "hcomplex_add_congruent2";
|
|
175 |
|
|
176 |
Goalw [hcomplex_add_def]
|
|
177 |
"Abs_hcomplex(hcomplexrel``{%n. X n}) + Abs_hcomplex(hcomplexrel``{%n. Y n}) = \
|
|
178 |
\ Abs_hcomplex(hcomplexrel``{%n. X n + Y n})";
|
|
179 |
by (res_inst_tac [("f","Abs_hcomplex")] arg_cong 1);
|
|
180 |
by Auto_tac;
|
|
181 |
by (Ultra_tac 1);
|
|
182 |
qed "hcomplex_add";
|
|
183 |
|
|
184 |
Goal "(z::hcomplex) + w = w + z";
|
|
185 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
186 |
by (res_inst_tac [("z","w")] eq_Abs_hcomplex 1);
|
|
187 |
by (asm_simp_tac (simpset() addsimps (complex_add_ac @ [hcomplex_add])) 1);
|
|
188 |
qed "hcomplex_add_commute";
|
|
189 |
|
|
190 |
Goal "((z1::hcomplex) + z2) + z3 = z1 + (z2 + z3)";
|
|
191 |
by (res_inst_tac [("z","z1")] eq_Abs_hcomplex 1);
|
|
192 |
by (res_inst_tac [("z","z2")] eq_Abs_hcomplex 1);
|
|
193 |
by (res_inst_tac [("z","z3")] eq_Abs_hcomplex 1);
|
|
194 |
by (asm_simp_tac (simpset() addsimps [hcomplex_add,complex_add_assoc]) 1);
|
|
195 |
qed "hcomplex_add_assoc";
|
|
196 |
|
|
197 |
(*For AC rewriting*)
|
|
198 |
Goal "(x::hcomplex)+(y+z)=y+(x+z)";
|
|
199 |
by (rtac (hcomplex_add_commute RS trans) 1);
|
|
200 |
by (rtac (hcomplex_add_assoc RS trans) 1);
|
|
201 |
by (rtac (hcomplex_add_commute RS arg_cong) 1);
|
|
202 |
qed "hcomplex_add_left_commute";
|
|
203 |
|
|
204 |
(* hcomplex addition is an AC operator *)
|
|
205 |
val hcomplex_add_ac = [hcomplex_add_assoc,hcomplex_add_commute,
|
|
206 |
hcomplex_add_left_commute];
|
|
207 |
|
|
208 |
Goalw [hcomplex_zero_def] "(0::hcomplex) + z = z";
|
|
209 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
210 |
by (asm_full_simp_tac (simpset() addsimps
|
|
211 |
[hcomplex_add]) 1);
|
|
212 |
qed "hcomplex_add_zero_left";
|
|
213 |
|
|
214 |
Goal "z + (0::hcomplex) = z";
|
|
215 |
by (simp_tac (simpset() addsimps
|
|
216 |
[hcomplex_add_zero_left,hcomplex_add_commute]) 1);
|
|
217 |
qed "hcomplex_add_zero_right";
|
|
218 |
Addsimps [hcomplex_add_zero_left,hcomplex_add_zero_right];
|
|
219 |
|
|
220 |
Goal "hRe(x + y) = hRe(x) + hRe(y)";
|
|
221 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
222 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
223 |
by (auto_tac (claset(),simpset() addsimps [hRe,hcomplex_add,
|
|
224 |
hypreal_add,complex_Re_add]));
|
|
225 |
qed "hRe_add";
|
|
226 |
|
|
227 |
Goal "hIm(x + y) = hIm(x) + hIm(y)";
|
|
228 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
229 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
230 |
by (auto_tac (claset(),simpset() addsimps [hIm,hcomplex_add,
|
|
231 |
hypreal_add,complex_Im_add]));
|
|
232 |
qed "hIm_add";
|
|
233 |
|
|
234 |
(*-----------------------------------------------------------------------*)
|
|
235 |
(* hypreal_minus: additive inverse on nonstandard complex *)
|
|
236 |
(* ----------------------------------------------------------------------*)
|
|
237 |
|
|
238 |
Goalw [congruent_def]
|
|
239 |
"congruent hcomplexrel (%X. hcomplexrel `` {%n. - (X n)})";
|
|
240 |
by (safe_tac (claset()));
|
|
241 |
by (ALLGOALS(Ultra_tac));
|
|
242 |
qed "hcomplex_minus_congruent";
|
|
243 |
|
|
244 |
Goalw [hcomplex_minus_def]
|
|
245 |
"- (Abs_hcomplex(hcomplexrel `` {%n. X n})) = \
|
|
246 |
\ Abs_hcomplex(hcomplexrel `` {%n. -(X n)})";
|
|
247 |
by (res_inst_tac [("f","Abs_hcomplex")] arg_cong 1);
|
|
248 |
by (Auto_tac THEN Ultra_tac 1);
|
|
249 |
qed "hcomplex_minus";
|
|
250 |
|
|
251 |
Goal "- (- z) = (z::hcomplex)";
|
|
252 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
253 |
by (asm_simp_tac (simpset() addsimps [hcomplex_minus]) 1);
|
|
254 |
qed "hcomplex_minus_minus";
|
|
255 |
Addsimps [hcomplex_minus_minus];
|
|
256 |
|
|
257 |
Goal "inj(%z::hcomplex. -z)";
|
|
258 |
by (rtac injI 1);
|
|
259 |
by (dres_inst_tac [("f","uminus")] arg_cong 1);
|
|
260 |
by (Asm_full_simp_tac 1);
|
|
261 |
qed "inj_hcomplex_minus";
|
|
262 |
|
|
263 |
Goalw [hcomplex_zero_def] "- 0 = (0::hcomplex)";
|
|
264 |
by (simp_tac (simpset() addsimps [hcomplex_minus]) 1);
|
|
265 |
qed "hcomplex_minus_zero";
|
|
266 |
Addsimps [hcomplex_minus_zero];
|
|
267 |
|
|
268 |
Goal "(-x = 0) = (x = (0::hcomplex))";
|
|
269 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
270 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_zero_def,
|
|
271 |
hcomplex_minus] @ complex_add_ac));
|
|
272 |
qed "hcomplex_minus_zero_iff";
|
|
273 |
Addsimps [hcomplex_minus_zero_iff];
|
|
274 |
|
|
275 |
Goal "(0 = -x) = (x = (0::hcomplex))";
|
|
276 |
by (auto_tac (claset() addDs [sym],simpset()));
|
|
277 |
qed "hcomplex_minus_zero_iff2";
|
|
278 |
Addsimps [hcomplex_minus_zero_iff2];
|
|
279 |
|
|
280 |
Goal "(-x ~= 0) = (x ~= (0::hcomplex))";
|
|
281 |
by Auto_tac;
|
|
282 |
qed "hcomplex_minus_not_zero_iff";
|
|
283 |
|
|
284 |
Goal "z + - z = (0::hcomplex)";
|
|
285 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
286 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_add,hcomplex_minus,
|
|
287 |
hcomplex_zero_def]));
|
|
288 |
qed "hcomplex_add_minus_right";
|
|
289 |
Addsimps [hcomplex_add_minus_right];
|
|
290 |
|
|
291 |
Goal "-z + z = (0::hcomplex)";
|
|
292 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
293 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_add,hcomplex_minus,
|
|
294 |
hcomplex_zero_def]));
|
|
295 |
qed "hcomplex_add_minus_left";
|
|
296 |
Addsimps [hcomplex_add_minus_left];
|
|
297 |
|
|
298 |
Goal "z + (- z + w) = (w::hcomplex)";
|
|
299 |
by (simp_tac (simpset() addsimps [hcomplex_add_assoc RS sym]) 1);
|
|
300 |
qed "hcomplex_add_minus_cancel";
|
|
301 |
|
|
302 |
Goal "(-z) + (z + w) = (w::hcomplex)";
|
|
303 |
by (simp_tac (simpset() addsimps [hcomplex_add_assoc RS sym]) 1);
|
|
304 |
qed "hcomplex_minus_add_cancel";
|
|
305 |
|
|
306 |
Goal "hRe(-z) = - hRe(z)";
|
|
307 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
308 |
by (auto_tac (claset(),simpset() addsimps [hRe,hcomplex_minus,
|
|
309 |
hypreal_minus,complex_Re_minus]));
|
|
310 |
qed "hRe_minus";
|
|
311 |
|
|
312 |
Goal "hIm(-z) = - hIm(z)";
|
|
313 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
314 |
by (auto_tac (claset(),simpset() addsimps [hIm,hcomplex_minus,
|
|
315 |
hypreal_minus,complex_Im_minus]));
|
|
316 |
qed "hIm_minus";
|
|
317 |
|
|
318 |
Goalw [hcomplex_zero_def]
|
|
319 |
"x + y = (0::hcomplex) ==> x = -y";
|
|
320 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
321 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
322 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_add,hcomplex_minus]));
|
|
323 |
by (ultra_tac (claset() addIs [complex_add_minus_eq_minus],simpset()) 1);
|
|
324 |
qed "hcomplex_add_minus_eq_minus";
|
|
325 |
|
|
326 |
Goal "-(x + y) = -x + -(y::hcomplex)";
|
|
327 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
328 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
329 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_add,hcomplex_minus]));
|
|
330 |
qed "hcomplex_minus_add_distrib";
|
|
331 |
Addsimps [hcomplex_minus_add_distrib];
|
|
332 |
|
|
333 |
Goal "((x::hcomplex) + y = x + z) = (y = z)";
|
|
334 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
335 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
336 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
337 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_add]));
|
|
338 |
qed "hcomplex_add_left_cancel";
|
|
339 |
AddIffs [hcomplex_add_left_cancel];
|
|
340 |
|
|
341 |
Goal "(y + (x::hcomplex)= z + x) = (y = z)";
|
|
342 |
by (simp_tac (simpset() addsimps [hcomplex_add_commute]) 1);
|
|
343 |
qed "hcomplex_add_right_cancel";
|
|
344 |
AddIffs [hcomplex_add_right_cancel];
|
|
345 |
|
|
346 |
Goal "((x::hcomplex) = y) = ((0::hcomplex) = x + - y)";
|
|
347 |
by (Step_tac 1);
|
|
348 |
by (res_inst_tac [("x1","-y")]
|
|
349 |
(hcomplex_add_right_cancel RS iffD1) 2);
|
|
350 |
by (Auto_tac);
|
|
351 |
qed "hcomplex_eq_minus_iff";
|
|
352 |
|
|
353 |
Goal "((x::hcomplex) = y) = (x + - y = (0::hcomplex))";
|
|
354 |
by (Step_tac 1);
|
|
355 |
by (res_inst_tac [("x1","-y")]
|
|
356 |
(hcomplex_add_right_cancel RS iffD1) 2);
|
|
357 |
by (Auto_tac);
|
|
358 |
qed "hcomplex_eq_minus_iff2";
|
|
359 |
|
|
360 |
(*-----------------------------------------------------------------------*)
|
|
361 |
(* Subraction for nonstandard complex numbers: hcomplex_diff *)
|
|
362 |
(* ----------------------------------------------------------------------*)
|
|
363 |
|
|
364 |
Goalw [hcomplex_diff_def]
|
|
365 |
"Abs_hcomplex(hcomplexrel``{%n. X n}) - Abs_hcomplex(hcomplexrel``{%n. Y n}) = \
|
|
366 |
\ Abs_hcomplex(hcomplexrel``{%n. X n - Y n})";
|
|
367 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_minus,hcomplex_add,
|
|
368 |
complex_diff_def]));
|
|
369 |
qed "hcomplex_diff";
|
|
370 |
|
|
371 |
Goalw [hcomplex_diff_def] "(z::hcomplex) - z = (0::hcomplex)";
|
|
372 |
by (Simp_tac 1);
|
|
373 |
qed "hcomplex_diff_zero";
|
|
374 |
Addsimps [hcomplex_diff_zero];
|
|
375 |
|
|
376 |
Goal "(0::hcomplex) - x = -x";
|
|
377 |
by (simp_tac (simpset() addsimps [hcomplex_diff_def]) 1);
|
|
378 |
qed "hcomplex_diff_0";
|
|
379 |
|
|
380 |
Goal "x - (0::hcomplex) = x";
|
|
381 |
by (simp_tac (simpset() addsimps [hcomplex_diff_def]) 1);
|
|
382 |
qed "hcomplex_diff_0_right";
|
|
383 |
|
|
384 |
Goal "x - x = (0::hcomplex)";
|
|
385 |
by (simp_tac (simpset() addsimps [hcomplex_diff_def]) 1);
|
|
386 |
qed "hcomplex_diff_self";
|
|
387 |
|
|
388 |
Addsimps [hcomplex_diff_0, hcomplex_diff_0_right, hcomplex_diff_self];
|
|
389 |
|
|
390 |
Goal "((x::hcomplex) - y = z) = (x = z + y)";
|
|
391 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_diff_def,hcomplex_add_assoc]));
|
|
392 |
qed "hcomplex_diff_eq_eq";
|
|
393 |
|
|
394 |
(*-----------------------------------------------------------------------*)
|
|
395 |
(* Multiplication for nonstandard complex numbers: hcomplex_mult *)
|
|
396 |
(* ----------------------------------------------------------------------*)
|
|
397 |
|
|
398 |
Goalw [hcomplex_mult_def]
|
|
399 |
"Abs_hcomplex(hcomplexrel``{%n. X n}) * Abs_hcomplex(hcomplexrel``{%n. Y n}) = \
|
|
400 |
\ Abs_hcomplex(hcomplexrel``{%n. X n * Y n})";
|
|
401 |
by (res_inst_tac [("f","Abs_hcomplex")] arg_cong 1);
|
|
402 |
by (Auto_tac THEN Ultra_tac 1);
|
|
403 |
qed "hcomplex_mult";
|
|
404 |
|
|
405 |
Goal "(w::hcomplex) * z = z * w";
|
|
406 |
by (res_inst_tac [("z","w")] eq_Abs_hcomplex 1);
|
|
407 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
408 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult,
|
|
409 |
complex_mult_commute]));
|
|
410 |
qed "hcomplex_mult_commute";
|
|
411 |
|
|
412 |
Goal "((u::hcomplex) * v) * w = u * (v * w)";
|
|
413 |
by (res_inst_tac [("z","u")] eq_Abs_hcomplex 1);
|
|
414 |
by (res_inst_tac [("z","v")] eq_Abs_hcomplex 1);
|
|
415 |
by (res_inst_tac [("z","w")] eq_Abs_hcomplex 1);
|
|
416 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult,
|
|
417 |
complex_mult_assoc]));
|
|
418 |
qed "hcomplex_mult_assoc";
|
|
419 |
|
|
420 |
Goal "(x::hcomplex) * (y * z) = y * (x * z)";
|
|
421 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
422 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
423 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
424 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult,
|
|
425 |
complex_mult_left_commute]));
|
|
426 |
qed "hcomplex_mult_left_commute";
|
|
427 |
|
|
428 |
val hcomplex_mult_ac = [hcomplex_mult_assoc,hcomplex_mult_commute,
|
|
429 |
hcomplex_mult_left_commute];
|
|
430 |
|
|
431 |
Goalw [hcomplex_one_def] "(1::hcomplex) * z = z";
|
|
432 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
433 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult]));
|
|
434 |
qed "hcomplex_mult_one_left";
|
|
435 |
Addsimps [hcomplex_mult_one_left];
|
|
436 |
|
|
437 |
Goal "z * (1::hcomplex) = z";
|
|
438 |
by (simp_tac (simpset() addsimps [hcomplex_mult_commute]) 1);
|
|
439 |
qed "hcomplex_mult_one_right";
|
|
440 |
Addsimps [hcomplex_mult_one_right];
|
|
441 |
|
|
442 |
Goalw [hcomplex_zero_def] "(0::hcomplex) * z = 0";
|
|
443 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
444 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult]));
|
|
445 |
qed "hcomplex_mult_zero_left";
|
|
446 |
Addsimps [hcomplex_mult_zero_left];
|
|
447 |
|
|
448 |
Goal "z * (0::hcomplex) = 0";
|
|
449 |
by (simp_tac (simpset() addsimps [hcomplex_mult_commute]) 1);
|
|
450 |
qed "hcomplex_mult_zero_right";
|
|
451 |
Addsimps [hcomplex_mult_zero_right];
|
|
452 |
|
|
453 |
Goal "-(x * y) = -x * (y::hcomplex)";
|
|
454 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
455 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
456 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult,
|
|
457 |
hcomplex_minus]));
|
|
458 |
qed "hcomplex_minus_mult_eq1";
|
|
459 |
|
|
460 |
Goal "-(x * y) = x * -(y::hcomplex)";
|
|
461 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
462 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
463 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult,
|
|
464 |
hcomplex_minus]));
|
|
465 |
qed "hcomplex_minus_mult_eq2";
|
|
466 |
|
|
467 |
Addsimps [hcomplex_minus_mult_eq1 RS sym,hcomplex_minus_mult_eq2 RS sym];
|
|
468 |
|
|
469 |
Goal "- 1 * (z::hcomplex) = -z";
|
|
470 |
by (Simp_tac 1);
|
|
471 |
qed "hcomplex_mult_minus_one";
|
|
472 |
Addsimps [hcomplex_mult_minus_one];
|
|
473 |
|
|
474 |
Goal "(z::hcomplex) * - 1 = -z";
|
|
475 |
by (stac hcomplex_mult_commute 1);
|
|
476 |
by (Simp_tac 1);
|
|
477 |
qed "hcomplex_mult_minus_one_right";
|
|
478 |
Addsimps [hcomplex_mult_minus_one_right];
|
|
479 |
|
|
480 |
Goal "-x * -y = x * (y::hcomplex)";
|
|
481 |
by Auto_tac;
|
|
482 |
qed "hcomplex_minus_mult_cancel";
|
|
483 |
Addsimps [hcomplex_minus_mult_cancel];
|
|
484 |
|
|
485 |
Goal "-x * y = x * -(y::hcomplex)";
|
|
486 |
by Auto_tac;
|
|
487 |
qed "hcomplex_minus_mult_commute";
|
|
488 |
|
|
489 |
qed_goal "hcomplex_add_assoc_cong" thy
|
|
490 |
"!!z. (z::hcomplex) + v = z' + v' ==> z + (v + w) = z' + (v' + w)"
|
|
491 |
(fn _ => [(asm_simp_tac (simpset() addsimps [hcomplex_add_assoc RS sym]) 1)]);
|
|
492 |
|
|
493 |
qed_goal "hcomplex_add_assoc_swap" thy "(z::hcomplex) + (v + w) = v + (z + w)"
|
|
494 |
(fn _ => [(REPEAT (ares_tac [hcomplex_add_commute RS hcomplex_add_assoc_cong] 1))]);
|
|
495 |
|
|
496 |
Goal "((z1::hcomplex) + z2) * w = (z1 * w) + (z2 * w)";
|
|
497 |
by (res_inst_tac [("z","z1")] eq_Abs_hcomplex 1);
|
|
498 |
by (res_inst_tac [("z","z2")] eq_Abs_hcomplex 1);
|
|
499 |
by (res_inst_tac [("z","w")] eq_Abs_hcomplex 1);
|
|
500 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult,hcomplex_add,
|
|
501 |
complex_add_mult_distrib]));
|
|
502 |
qed "hcomplex_add_mult_distrib";
|
|
503 |
|
|
504 |
Goal "(w::hcomplex) * (z1 + z2) = (w * z1) + (w * z2)";
|
|
505 |
by (res_inst_tac [("z1","z1 + z2")] (hcomplex_mult_commute RS ssubst) 1);
|
|
506 |
by (simp_tac (simpset() addsimps [hcomplex_add_mult_distrib]) 1);
|
|
507 |
by (simp_tac (simpset() addsimps [hcomplex_mult_commute]) 1);
|
|
508 |
qed "hcomplex_add_mult_distrib2";
|
|
509 |
|
|
510 |
Goalw [hcomplex_zero_def,hcomplex_one_def] "(0::hcomplex) ~= (1::hcomplex)";
|
|
511 |
by Auto_tac;
|
|
512 |
qed "hcomplex_zero_not_eq_one";
|
|
513 |
Addsimps [hcomplex_zero_not_eq_one];
|
|
514 |
Addsimps [hcomplex_zero_not_eq_one RS not_sym];
|
|
515 |
|
|
516 |
(*-----------------------------------------------------------------------*)
|
|
517 |
(* Inverse of nonstandard complex number *)
|
|
518 |
(*-----------------------------------------------------------------------*)
|
|
519 |
|
|
520 |
Goalw [hcinv_def]
|
|
521 |
"inverse (Abs_hcomplex(hcomplexrel `` {%n. X n})) = \
|
|
522 |
\ Abs_hcomplex(hcomplexrel `` {%n. inverse (X n)})";
|
|
523 |
by (res_inst_tac [("f","Abs_hcomplex")] arg_cong 1);
|
|
524 |
by (Auto_tac THEN Ultra_tac 1);
|
|
525 |
qed "hcomplex_inverse";
|
|
526 |
|
|
527 |
Goalw [hcomplex_zero_def] "inverse (0::hcomplex) = 0";
|
|
528 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_inverse]));
|
|
529 |
qed "HCOMPLEX_INVERSE_ZERO";
|
|
530 |
|
|
531 |
Goal "a / (0::hcomplex) = 0";
|
|
532 |
by (simp_tac (simpset() addsimps [hcomplex_divide_def, HCOMPLEX_INVERSE_ZERO]) 1);
|
|
533 |
qed "HCOMPLEX_DIVISION_BY_ZERO"; (*NOT for adding to default simpset*)
|
|
534 |
|
|
535 |
fun hcomplex_div_undefined_case_tac s i =
|
|
536 |
case_tac s i THEN
|
|
537 |
asm_simp_tac (simpset() addsimps [HCOMPLEX_DIVISION_BY_ZERO, HCOMPLEX_INVERSE_ZERO]) i;
|
|
538 |
|
|
539 |
Goalw [hcomplex_zero_def,hcomplex_one_def]
|
|
540 |
"z ~= (0::hcomplex) ==> inverse(z) * z = (1::hcomplex)";
|
|
541 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
542 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_inverse,hcomplex_mult]));
|
|
543 |
by (Ultra_tac 1);
|
|
544 |
by (rtac ccontr 1 THEN dtac (complex_mult_inv_left) 1);
|
|
545 |
by Auto_tac;
|
|
546 |
qed "hcomplex_mult_inv_left";
|
|
547 |
Addsimps [hcomplex_mult_inv_left];
|
|
548 |
|
|
549 |
Goal "z ~= (0::hcomplex) ==> z * inverse(z) = (1::hcomplex)";
|
|
550 |
by (auto_tac (claset() addIs [hcomplex_mult_commute RS subst],simpset()));
|
|
551 |
qed "hcomplex_mult_inv_right";
|
|
552 |
Addsimps [hcomplex_mult_inv_right];
|
|
553 |
|
|
554 |
Goal "(c::hcomplex) ~= (0::hcomplex) ==> (c*a=c*b) = (a=b)";
|
|
555 |
by Auto_tac;
|
|
556 |
by (dres_inst_tac [("f","%x. x*inverse c")] arg_cong 1);
|
|
557 |
by (asm_full_simp_tac (simpset() addsimps hcomplex_mult_ac) 1);
|
|
558 |
qed "hcomplex_mult_left_cancel";
|
|
559 |
|
|
560 |
Goal "(c::hcomplex) ~= (0::hcomplex) ==> (a*c=b*c) = (a=b)";
|
|
561 |
by (Step_tac 1);
|
|
562 |
by (dres_inst_tac [("f","%x. x*inverse c")] arg_cong 1);
|
|
563 |
by (asm_full_simp_tac (simpset() addsimps hcomplex_mult_ac) 1);
|
|
564 |
qed "hcomplex_mult_right_cancel";
|
|
565 |
|
|
566 |
Goal "z ~= (0::hcomplex) ==> inverse(z) ~= 0";
|
|
567 |
by (Step_tac 1);
|
|
568 |
by (ftac (hcomplex_mult_right_cancel RS iffD2) 1);
|
|
569 |
by (thin_tac "inverse z = 0" 2);
|
|
570 |
by (assume_tac 1 THEN Auto_tac);
|
|
571 |
qed "hcomplex_inverse_not_zero";
|
|
572 |
Addsimps [hcomplex_inverse_not_zero];
|
|
573 |
|
|
574 |
Goal "[| x ~= (0::hcomplex); y ~= 0 |] ==> x * y ~= 0";
|
|
575 |
by (Step_tac 1);
|
|
576 |
by (dres_inst_tac [("f","%z. inverse x*z")] arg_cong 1);
|
|
577 |
by (asm_full_simp_tac (simpset() addsimps [hcomplex_mult_assoc RS sym]) 1);
|
|
578 |
qed "hcomplex_mult_not_zero";
|
|
579 |
|
|
580 |
bind_thm ("hcomplex_mult_not_zeroE",hcomplex_mult_not_zero RS notE);
|
|
581 |
|
|
582 |
Goal "inverse(inverse x) = (x::hcomplex)";
|
|
583 |
by (hcomplex_div_undefined_case_tac "x = 0" 1);
|
|
584 |
by (res_inst_tac [("c1","inverse x")] (hcomplex_mult_right_cancel RS iffD1) 1);
|
|
585 |
by (etac hcomplex_inverse_not_zero 1);
|
|
586 |
by (auto_tac (claset() addDs [hcomplex_inverse_not_zero],simpset()));
|
|
587 |
qed "hcomplex_inverse_inverse";
|
|
588 |
Addsimps [hcomplex_inverse_inverse];
|
|
589 |
|
|
590 |
Goalw [hcomplex_one_def] "inverse((1::hcomplex)) = 1";
|
|
591 |
by (simp_tac (simpset() addsimps [hcomplex_inverse]) 1);
|
|
592 |
qed "hcomplex_inverse_one";
|
|
593 |
Addsimps [hcomplex_inverse_one];
|
|
594 |
|
|
595 |
Goal "inverse(-x) = -inverse(x::hcomplex)";
|
|
596 |
by (hcomplex_div_undefined_case_tac "x = 0" 1);
|
|
597 |
by (res_inst_tac [("c1","-x")] (hcomplex_mult_right_cancel RS iffD1) 1);
|
|
598 |
by (stac hcomplex_mult_inv_left 2);
|
|
599 |
by Auto_tac;
|
|
600 |
qed "hcomplex_minus_inverse";
|
|
601 |
|
|
602 |
Goal "inverse(x*y) = inverse x * inverse (y::hcomplex)";
|
|
603 |
by (hcomplex_div_undefined_case_tac "x = 0" 1);
|
|
604 |
by (hcomplex_div_undefined_case_tac "y = 0" 1);
|
|
605 |
by (res_inst_tac [("c1","x*y")] (hcomplex_mult_left_cancel RS iffD1) 1);
|
|
606 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult_not_zero]
|
|
607 |
@ hcomplex_mult_ac));
|
|
608 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult_not_zero,
|
|
609 |
hcomplex_mult_assoc RS sym]));
|
|
610 |
qed "hcomplex_inverse_distrib";
|
|
611 |
|
|
612 |
(*** division ***)
|
|
613 |
|
|
614 |
(* adding some of these theorems to simpset as for reals: not 100% convinced for some*)
|
|
615 |
|
|
616 |
Goal "(x::hcomplex) * (y/z) = (x*y)/z";
|
|
617 |
by (simp_tac (simpset() addsimps [hcomplex_divide_def, hcomplex_mult_assoc]) 1);
|
|
618 |
qed "hcomplex_times_divide1_eq";
|
|
619 |
|
|
620 |
Goal "(y/z) * (x::hcomplex) = (y*x)/z";
|
|
621 |
by (simp_tac (simpset() addsimps [hcomplex_divide_def] @ hcomplex_mult_ac) 1);
|
|
622 |
qed "hcomplex_times_divide2_eq";
|
|
623 |
|
|
624 |
Addsimps [hcomplex_times_divide1_eq, hcomplex_times_divide2_eq];
|
|
625 |
|
|
626 |
Goal "(x::hcomplex) / (y/z) = (x*z)/y";
|
|
627 |
by (simp_tac (simpset() addsimps [hcomplex_divide_def, hcomplex_inverse_distrib]@
|
|
628 |
hcomplex_mult_ac) 1);
|
|
629 |
qed "hcomplex_divide_divide1_eq";
|
|
630 |
|
|
631 |
Goal "((x::hcomplex) / y) / z = x/(y*z)";
|
|
632 |
by (simp_tac (simpset() addsimps [hcomplex_divide_def, hcomplex_inverse_distrib,
|
|
633 |
hcomplex_mult_assoc]) 1);
|
|
634 |
qed "hcomplex_divide_divide2_eq";
|
|
635 |
|
|
636 |
Addsimps [hcomplex_divide_divide1_eq, hcomplex_divide_divide2_eq];
|
|
637 |
|
|
638 |
(** As with multiplication, pull minus signs OUT of the / operator **)
|
|
639 |
|
|
640 |
Goal "(-x) / (y::hcomplex) = - (x/y)";
|
|
641 |
by (simp_tac (simpset() addsimps [hcomplex_divide_def]) 1);
|
|
642 |
qed "hcomplex_minus_divide_eq";
|
|
643 |
Addsimps [hcomplex_minus_divide_eq];
|
|
644 |
|
|
645 |
Goal "(x / -(y::hcomplex)) = - (x/y)";
|
|
646 |
by (simp_tac (simpset() addsimps [hcomplex_divide_def, hcomplex_minus_inverse]) 1);
|
|
647 |
qed "hcomplex_divide_minus_eq";
|
|
648 |
Addsimps [hcomplex_divide_minus_eq];
|
|
649 |
|
|
650 |
Goal "(x+y)/(z::hcomplex) = x/z + y/z";
|
|
651 |
by (simp_tac (simpset() addsimps [hcomplex_divide_def, hcomplex_add_mult_distrib]) 1);
|
|
652 |
qed "hcomplex_add_divide_distrib";
|
|
653 |
|
|
654 |
(*---------------------------------------------------------------------------*)
|
|
655 |
(* Embedding properties for hcomplex_of_hypreal map *)
|
|
656 |
(*---------------------------------------------------------------------------*)
|
|
657 |
|
|
658 |
Goalw [hcomplex_of_hypreal_def]
|
|
659 |
"hcomplex_of_hypreal (Abs_hypreal(hyprel `` {%n. X n})) = \
|
|
660 |
\ Abs_hcomplex(hcomplexrel `` {%n. complex_of_real (X n)})";
|
|
661 |
by (res_inst_tac [("f","Abs_hcomplex")] arg_cong 1);
|
|
662 |
by (Auto_tac THEN Ultra_tac 1);
|
|
663 |
qed "hcomplex_of_hypreal";
|
|
664 |
|
|
665 |
Goal "inj hcomplex_of_hypreal";
|
|
666 |
by (rtac injI 1);
|
|
667 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
668 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
669 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal]));
|
|
670 |
qed "inj_hcomplex_of_hypreal";
|
|
671 |
|
|
672 |
Goal "(hcomplex_of_hypreal x = hcomplex_of_hypreal y) = (x = y)";
|
|
673 |
by (auto_tac (claset() addDs [inj_hcomplex_of_hypreal RS injD],simpset()));
|
|
674 |
qed "hcomplex_of_hypreal_cancel_iff";
|
|
675 |
AddIffs [hcomplex_of_hypreal_cancel_iff];
|
|
676 |
|
|
677 |
Goal "hcomplex_of_hypreal(-x) = - hcomplex_of_hypreal x";
|
|
678 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
679 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
680 |
hcomplex_minus,hypreal_minus,complex_of_real_minus]));
|
|
681 |
qed "hcomplex_of_hypreal_minus";
|
|
682 |
|
|
683 |
Goal "hcomplex_of_hypreal(inverse x) = inverse(hcomplex_of_hypreal x)";
|
|
684 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
685 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
686 |
hypreal_inverse,hcomplex_inverse,complex_of_real_inverse]));
|
|
687 |
qed "hcomplex_of_hypreal_inverse";
|
|
688 |
|
|
689 |
Goal "hcomplex_of_hypreal x + hcomplex_of_hypreal y = \
|
|
690 |
\ hcomplex_of_hypreal (x + y)";
|
|
691 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
692 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
693 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
694 |
hypreal_add,hcomplex_add,complex_of_real_add]));
|
|
695 |
qed "hcomplex_of_hypreal_add";
|
|
696 |
|
|
697 |
Goalw [hcomplex_diff_def]
|
|
698 |
"hcomplex_of_hypreal x - hcomplex_of_hypreal y = \
|
|
699 |
\ hcomplex_of_hypreal (x - y)";
|
|
700 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal_minus
|
|
701 |
RS sym,hcomplex_of_hypreal_add,hypreal_diff_def]));
|
|
702 |
qed "hcomplex_of_hypreal_diff";
|
|
703 |
|
|
704 |
Goal "hcomplex_of_hypreal x * hcomplex_of_hypreal y = \
|
|
705 |
\ hcomplex_of_hypreal (x * y)";
|
|
706 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
707 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
708 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
709 |
hypreal_mult,hcomplex_mult,complex_of_real_mult]));
|
|
710 |
qed "hcomplex_of_hypreal_mult";
|
|
711 |
|
|
712 |
Goalw [hcomplex_divide_def]
|
|
713 |
"hcomplex_of_hypreal x / hcomplex_of_hypreal y = hcomplex_of_hypreal(x/y)";
|
|
714 |
by (hypreal_div_undefined_case_tac "y=0" 1);
|
|
715 |
by (simp_tac (simpset() addsimps [rename_numerals HYPREAL_DIVISION_BY_ZERO,
|
|
716 |
HCOMPLEX_INVERSE_ZERO]) 1);
|
|
717 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal_mult,
|
|
718 |
hcomplex_of_hypreal_inverse RS sym]));
|
|
719 |
by (simp_tac (simpset() addsimps [hypreal_divide_def]) 1);
|
|
720 |
qed "hcomplex_of_hypreal_divide";
|
|
721 |
|
|
722 |
Goalw [hcomplex_one_def]
|
|
723 |
"hcomplex_of_hypreal 1 = 1";
|
|
724 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,hypreal_one_num]));
|
|
725 |
qed "hcomplex_of_hypreal_one";
|
|
726 |
|
|
727 |
Goalw [hcomplex_zero_def,hypreal_zero_def]
|
|
728 |
"hcomplex_of_hypreal 0 = 0";
|
|
729 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal]));
|
|
730 |
qed "hcomplex_of_hypreal_zero";
|
|
731 |
|
|
732 |
Addsimps [hcomplex_of_hypreal_one,hcomplex_of_hypreal_zero,
|
|
733 |
rename_numerals hcomplex_of_hypreal_zero];
|
|
734 |
|
|
735 |
Goal "hcomplex_of_hypreal (x ^ n) = (hcomplex_of_hypreal x) ^ n";
|
|
736 |
by (induct_tac "n" 1);
|
|
737 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal_mult RS sym]));
|
|
738 |
qed "hcomplex_of_hypreal_pow";
|
|
739 |
|
|
740 |
Goal "hRe(hcomplex_of_hypreal z) = z";
|
|
741 |
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
|
|
742 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,hRe]));
|
|
743 |
qed "hRe_hcomplex_of_hypreal";
|
|
744 |
Addsimps [hRe_hcomplex_of_hypreal];
|
|
745 |
|
|
746 |
Goal "hIm(hcomplex_of_hypreal z) = 0";
|
|
747 |
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
|
|
748 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,hIm,
|
|
749 |
hypreal_zero_num]));
|
|
750 |
qed "hIm_hcomplex_of_hypreal";
|
|
751 |
Addsimps [hIm_hcomplex_of_hypreal];
|
|
752 |
|
|
753 |
Goal "hcomplex_of_hypreal epsilon ~= 0";
|
|
754 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
755 |
epsilon_def,hcomplex_zero_def]));
|
|
756 |
qed "hcomplex_of_hypreal_epsilon_not_zero";
|
|
757 |
Addsimps [hcomplex_of_hypreal_epsilon_not_zero];
|
|
758 |
|
|
759 |
(*---------------------------------------------------------------------------*)
|
|
760 |
(* Modulus (absolute value) of nonstandard complex number *)
|
|
761 |
(*---------------------------------------------------------------------------*)
|
|
762 |
|
|
763 |
Goalw [hcmod_def]
|
|
764 |
"hcmod (Abs_hcomplex(hcomplexrel `` {%n. X n})) = \
|
|
765 |
\ Abs_hypreal(hyprel `` {%n. cmod (X n)})";
|
|
766 |
by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1);
|
|
767 |
by (Auto_tac THEN Ultra_tac 1);
|
|
768 |
qed "hcmod";
|
|
769 |
|
|
770 |
Goalw [hcomplex_zero_def,hypreal_zero_def]
|
|
771 |
"hcmod(0) = 0";
|
|
772 |
by (auto_tac (claset(),simpset() addsimps [hcmod]));
|
|
773 |
qed "hcmod_zero";
|
|
774 |
Addsimps [hcmod_zero,rename_numerals hcmod_zero];
|
|
775 |
|
|
776 |
Goalw [hcomplex_one_def]
|
|
777 |
"hcmod(1) = 1";
|
|
778 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hypreal_one_num]));
|
|
779 |
qed "hcmod_one";
|
|
780 |
Addsimps [hcmod_one];
|
|
781 |
|
|
782 |
Goal "hcmod(hcomplex_of_hypreal x) = abs x";
|
|
783 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
784 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hcomplex_of_hypreal,
|
|
785 |
hypreal_hrabs]));
|
|
786 |
qed "hcmod_hcomplex_of_hypreal";
|
|
787 |
Addsimps [hcmod_hcomplex_of_hypreal];
|
|
788 |
|
|
789 |
Goal "hcomplex_of_hypreal (abs x) = \
|
|
790 |
\ hcomplex_of_hypreal(hcmod(hcomplex_of_hypreal x))";
|
|
791 |
by (Simp_tac 1);
|
|
792 |
qed "hcomplex_of_hypreal_abs";
|
|
793 |
|
|
794 |
(*---------------------------------------------------------------------------*)
|
|
795 |
(* conjugation *)
|
|
796 |
(*---------------------------------------------------------------------------*)
|
|
797 |
|
|
798 |
Goalw [hcnj_def]
|
|
799 |
"hcnj (Abs_hcomplex(hcomplexrel `` {%n. X n})) = \
|
|
800 |
\ Abs_hcomplex(hcomplexrel `` {%n. cnj(X n)})";
|
|
801 |
by (res_inst_tac [("f","Abs_hcomplex")] arg_cong 1);
|
|
802 |
by (Auto_tac THEN Ultra_tac 1);
|
|
803 |
qed "hcnj";
|
|
804 |
|
|
805 |
Goal "inj hcnj";
|
|
806 |
by (rtac injI 1);
|
|
807 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
808 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
809 |
by (auto_tac (claset(),simpset() addsimps [hcnj]));
|
|
810 |
qed "inj_hcnj";
|
|
811 |
|
|
812 |
Goal "(hcnj x = hcnj y) = (x = y)";
|
|
813 |
by (auto_tac (claset() addDs [inj_hcnj RS injD],simpset()));
|
|
814 |
qed "hcomplex_hcnj_cancel_iff";
|
|
815 |
Addsimps [hcomplex_hcnj_cancel_iff];
|
|
816 |
|
|
817 |
Goal "hcnj (hcnj z) = z";
|
|
818 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
819 |
by (auto_tac (claset(),simpset() addsimps [hcnj]));
|
|
820 |
qed "hcomplex_hcnj_hcnj";
|
|
821 |
Addsimps [hcomplex_hcnj_hcnj];
|
|
822 |
|
|
823 |
Goal "hcnj (hcomplex_of_hypreal x) = hcomplex_of_hypreal x";
|
|
824 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
825 |
by (auto_tac (claset(),simpset() addsimps [hcnj,hcomplex_of_hypreal]));
|
|
826 |
qed "hcomplex_hcnj_hcomplex_of_hypreal";
|
|
827 |
Addsimps [hcomplex_hcnj_hcomplex_of_hypreal];
|
|
828 |
|
|
829 |
Goal "hcmod (hcnj z) = hcmod z";
|
|
830 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
831 |
by (auto_tac (claset(),simpset() addsimps [hcnj,hcmod]));
|
|
832 |
qed "hcomplex_hmod_hcnj";
|
|
833 |
Addsimps [hcomplex_hmod_hcnj];
|
|
834 |
|
|
835 |
Goal "hcnj (-z) = - hcnj z";
|
|
836 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
837 |
by (auto_tac (claset(),simpset() addsimps [hcnj,hcomplex_minus,
|
|
838 |
complex_cnj_minus]));
|
|
839 |
qed "hcomplex_hcnj_minus";
|
|
840 |
|
|
841 |
Goal "hcnj(inverse z) = inverse(hcnj z)";
|
|
842 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
843 |
by (auto_tac (claset(),simpset() addsimps [hcnj,hcomplex_inverse,
|
|
844 |
complex_cnj_inverse]));
|
|
845 |
qed "hcomplex_hcnj_inverse";
|
|
846 |
|
|
847 |
Goal "hcnj(w + z) = hcnj(w) + hcnj(z)";
|
|
848 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
849 |
by (res_inst_tac [("z","w")] eq_Abs_hcomplex 1);
|
|
850 |
by (auto_tac (claset(),simpset() addsimps [hcnj,hcomplex_add,
|
|
851 |
complex_cnj_add]));
|
|
852 |
qed "hcomplex_hcnj_add";
|
|
853 |
|
|
854 |
Goal "hcnj(w - z) = hcnj(w) - hcnj(z)";
|
|
855 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
856 |
by (res_inst_tac [("z","w")] eq_Abs_hcomplex 1);
|
|
857 |
by (auto_tac (claset(),simpset() addsimps [hcnj,hcomplex_diff,
|
|
858 |
complex_cnj_diff]));
|
|
859 |
qed "hcomplex_hcnj_diff";
|
|
860 |
|
|
861 |
Goal "hcnj(w * z) = hcnj(w) * hcnj(z)";
|
|
862 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
863 |
by (res_inst_tac [("z","w")] eq_Abs_hcomplex 1);
|
|
864 |
by (auto_tac (claset(),simpset() addsimps [hcnj,hcomplex_mult,
|
|
865 |
complex_cnj_mult]));
|
|
866 |
qed "hcomplex_hcnj_mult";
|
|
867 |
|
|
868 |
Goalw [hcomplex_divide_def] "hcnj(w / z) = (hcnj w)/(hcnj z)";
|
|
869 |
by (simp_tac (simpset() addsimps [hcomplex_hcnj_mult,hcomplex_hcnj_inverse]) 1);
|
|
870 |
qed "hcomplex_hcnj_divide";
|
|
871 |
|
|
872 |
Goalw [hcomplex_one_def] "hcnj 1 = 1";
|
|
873 |
by (simp_tac (simpset() addsimps [hcnj]) 1);
|
|
874 |
qed "hcnj_one";
|
|
875 |
Addsimps [hcnj_one];
|
|
876 |
|
|
877 |
Goal "hcnj(z ^ n) = hcnj(z) ^ n";
|
|
878 |
by (induct_tac "n" 1);
|
|
879 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_hcnj_mult]));
|
|
880 |
qed "hcomplex_hcnj_pow";
|
|
881 |
|
|
882 |
(* MOVE to NSComplexBin
|
|
883 |
Goal "z + hcnj z = \
|
|
884 |
\ hcomplex_of_hypreal (2 * hRe(z))";
|
|
885 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
886 |
by (auto_tac (claset(),HOL_ss addsimps [hRe,hcnj,hcomplex_add,
|
|
887 |
hypreal_mult,hcomplex_of_hypreal,complex_add_cnj]));
|
|
888 |
qed "hcomplex_add_hcnj";
|
|
889 |
|
|
890 |
Goal "z - hcnj z = \
|
|
891 |
\ hcomplex_of_hypreal (hypreal_of_real 2 * hIm(z)) * iii";
|
|
892 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
893 |
by (auto_tac (claset(),simpset() addsimps [hIm,hcnj,hcomplex_diff,
|
|
894 |
hypreal_of_real_def,hypreal_mult,hcomplex_of_hypreal,
|
|
895 |
complex_diff_cnj,iii_def,hcomplex_mult]));
|
|
896 |
qed "hcomplex_diff_hcnj";
|
|
897 |
*)
|
|
898 |
|
|
899 |
Goalw [hcomplex_zero_def]
|
|
900 |
"hcnj 0 = 0";
|
|
901 |
by (auto_tac (claset(),simpset() addsimps [hcnj]));
|
|
902 |
qed "hcomplex_hcnj_zero";
|
|
903 |
Addsimps [hcomplex_hcnj_zero];
|
|
904 |
|
|
905 |
Goal "(hcnj z = 0) = (z = 0)";
|
|
906 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
907 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_zero_def,
|
|
908 |
hcnj]));
|
|
909 |
qed "hcomplex_hcnj_zero_iff";
|
|
910 |
AddIffs [hcomplex_hcnj_zero_iff];
|
|
911 |
|
|
912 |
Goal "z * hcnj z = hcomplex_of_hypreal (hRe(z) ^ 2 + hIm(z) ^ 2)";
|
|
913 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
914 |
by (auto_tac (claset(),simpset() addsimps [hcnj,hcomplex_mult,
|
|
915 |
hcomplex_of_hypreal,hRe,hIm,hypreal_add,hypreal_mult,
|
|
916 |
complex_mult_cnj,two_eq_Suc_Suc]));
|
|
917 |
qed "hcomplex_mult_hcnj";
|
|
918 |
|
|
919 |
|
|
920 |
(*---------------------------------------------------------------------------*)
|
|
921 |
(* some algebra etc. *)
|
|
922 |
(*---------------------------------------------------------------------------*)
|
|
923 |
|
|
924 |
Goal "(x*y = (0::hcomplex)) = (x = 0 | y = 0)";
|
|
925 |
by Auto_tac;
|
|
926 |
by (auto_tac (claset() addIs [ccontr] addDs
|
|
927 |
[hcomplex_mult_not_zero],simpset()));
|
|
928 |
qed "hcomplex_mult_zero_iff";
|
|
929 |
Addsimps [hcomplex_mult_zero_iff];
|
|
930 |
|
|
931 |
Goal "(x + y = x) = (y = (0::hcomplex))";
|
|
932 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
933 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
934 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_add,
|
|
935 |
hcomplex_zero_def]));
|
|
936 |
qed "hcomplex_add_left_cancel_zero";
|
|
937 |
Addsimps [hcomplex_add_left_cancel_zero];
|
|
938 |
|
|
939 |
Goalw [hcomplex_diff_def]
|
|
940 |
"((z1::hcomplex) - z2) * w = (z1 * w) - (z2 * w)";
|
|
941 |
by (simp_tac (simpset() addsimps [hcomplex_add_mult_distrib]) 1);
|
|
942 |
qed "hcomplex_diff_mult_distrib";
|
|
943 |
|
|
944 |
Goalw [hcomplex_diff_def]
|
|
945 |
"(w::hcomplex) * (z1 - z2) = (w * z1) - (w * z2)";
|
|
946 |
by (simp_tac (simpset() addsimps [hcomplex_add_mult_distrib2]) 1);
|
|
947 |
qed "hcomplex_diff_mult_distrib2";
|
|
948 |
|
|
949 |
(*---------------------------------------------------------------------------*)
|
|
950 |
(* More theorems about hcmod *)
|
|
951 |
(*---------------------------------------------------------------------------*)
|
|
952 |
|
|
953 |
Goal "(hcmod x = 0) = (x = 0)";
|
|
954 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
955 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hcomplex_zero_def,
|
|
956 |
hypreal_zero_num]));
|
|
957 |
qed "hcomplex_hcmod_eq_zero_cancel";
|
|
958 |
Addsimps [hcomplex_hcmod_eq_zero_cancel];
|
|
959 |
|
|
960 |
(* not proved already? strange! *)
|
|
961 |
Goalw [hypreal_le_def]
|
|
962 |
"(hypreal_of_nat n <= hypreal_of_nat m) = (n <= m)";
|
|
963 |
by Auto_tac;
|
|
964 |
qed "hypreal_of_nat_le_iff";
|
|
965 |
Addsimps [hypreal_of_nat_le_iff];
|
|
966 |
|
|
967 |
Goal "0 <= hypreal_of_nat n";
|
|
968 |
by (simp_tac (simpset() addsimps [hypreal_of_nat_zero RS sym]
|
|
969 |
delsimps [hypreal_of_nat_zero]) 1);
|
|
970 |
qed "hypreal_of_nat_ge_zero";
|
|
971 |
Addsimps [hypreal_of_nat_ge_zero];
|
|
972 |
|
|
973 |
Addsimps [hypreal_of_nat_ge_zero RS hrabs_eqI1];
|
|
974 |
|
|
975 |
Goal "0 <= hypreal_of_hypnat n";
|
|
976 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
|
|
977 |
by (asm_simp_tac (simpset() addsimps [hypreal_of_hypnat,
|
|
978 |
hypreal_zero_num,hypreal_le]) 1);
|
|
979 |
qed "hypreal_of_hypnat_ge_zero";
|
|
980 |
Addsimps [hypreal_of_hypnat_ge_zero];
|
|
981 |
|
|
982 |
Addsimps [hypreal_of_hypnat_ge_zero RS hrabs_eqI1];
|
|
983 |
|
|
984 |
Goal "hcmod (hcomplex_of_hypreal(hypreal_of_nat n)) = hypreal_of_nat n";
|
|
985 |
by Auto_tac;
|
|
986 |
qed "hcmod_hcomplex_of_hypreal_of_nat";
|
|
987 |
Addsimps [hcmod_hcomplex_of_hypreal_of_nat];
|
|
988 |
|
|
989 |
Goal "hcmod (hcomplex_of_hypreal(hypreal_of_hypnat n)) = hypreal_of_hypnat n";
|
|
990 |
by Auto_tac;
|
|
991 |
qed "hcmod_hcomplex_of_hypreal_of_hypnat";
|
|
992 |
Addsimps [hcmod_hcomplex_of_hypreal_of_hypnat];
|
|
993 |
|
|
994 |
Goal "hcmod (-x) = hcmod(x)";
|
|
995 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
996 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hcomplex_minus]));
|
|
997 |
qed "hcmod_minus";
|
|
998 |
Addsimps [hcmod_minus];
|
|
999 |
|
|
1000 |
Goal "hcmod(z * hcnj(z)) = hcmod(z) ^ 2";
|
|
1001 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
1002 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hcomplex_mult,
|
|
1003 |
hcnj,hypreal_mult,complex_mod_mult_cnj,two_eq_Suc_Suc]));
|
|
1004 |
qed "hcmod_mult_hcnj";
|
|
1005 |
|
|
1006 |
Goal "(0::hypreal) <= hcmod x";
|
|
1007 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
1008 |
by (auto_tac (claset(),simpset() addsimps [hcmod,
|
|
1009 |
hypreal_zero_num,hypreal_le]));
|
|
1010 |
qed "hcmod_ge_zero";
|
|
1011 |
Addsimps [hcmod_ge_zero];
|
|
1012 |
|
|
1013 |
Goal "abs(hcmod x) = hcmod x";
|
|
1014 |
by (auto_tac (claset() addIs [hrabs_eqI1],simpset()));
|
|
1015 |
qed "hrabs_hcmod_cancel";
|
|
1016 |
Addsimps [hrabs_hcmod_cancel];
|
|
1017 |
|
|
1018 |
Goal "hcmod(x*y) = hcmod(x) * hcmod(y)";
|
|
1019 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
1020 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
1021 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hcomplex_mult,
|
|
1022 |
hypreal_mult,complex_mod_mult]));
|
|
1023 |
qed "hcmod_mult";
|
|
1024 |
|
|
1025 |
Goal "hcmod(x + y) ^ 2 = hcmod(x) ^ 2 + hcmod(y) ^ 2 + 2 * hRe(x * hcnj y)";
|
|
1026 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
1027 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
1028 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hcomplex_add,
|
|
1029 |
hypreal_mult,hRe,hcnj,hcomplex_mult,two_eq_Suc_Suc,
|
|
1030 |
realpow_two RS sym] delsimps [realpow_Suc]));
|
|
1031 |
by (auto_tac (claset(),simpset() addsimps [two_eq_Suc_Suc RS sym,
|
|
1032 |
complex_mod_add_squared_eq,hypreal_add RS sym,hypreal_mult RS sym,
|
|
1033 |
symmetric hypreal_of_real_def]));
|
|
1034 |
qed "hcmod_add_squared_eq";
|
|
1035 |
|
|
1036 |
Goal "hRe(x * hcnj y) <= hcmod(x * hcnj y)";
|
|
1037 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
1038 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
1039 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hcnj,
|
|
1040 |
hcomplex_mult,hRe,hypreal_le]));
|
|
1041 |
qed "hcomplex_hRe_mult_hcnj_le_hcmod";
|
|
1042 |
Addsimps [hcomplex_hRe_mult_hcnj_le_hcmod];
|
|
1043 |
|
|
1044 |
Goal "hRe(x * hcnj y) <= hcmod(x * y)";
|
|
1045 |
by (cut_inst_tac [("x","x"),("y","y")] hcomplex_hRe_mult_hcnj_le_hcmod 1);
|
|
1046 |
by (asm_full_simp_tac (simpset() addsimps [hcmod_mult]) 1);
|
|
1047 |
qed "hcomplex_hRe_mult_hcnj_le_hcmod2";
|
|
1048 |
Addsimps [hcomplex_hRe_mult_hcnj_le_hcmod2];
|
|
1049 |
|
|
1050 |
Goal "hcmod (x + y) ^ 2 <= (hcmod(x) + hcmod(y)) ^ 2";
|
|
1051 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
1052 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
1053 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hcnj,
|
|
1054 |
hcomplex_add,hypreal_mult,hypreal_add,hypreal_le,
|
|
1055 |
realpow_two RS sym,two_eq_Suc_Suc] delsimps [realpow_Suc]));
|
|
1056 |
by (simp_tac (simpset() addsimps [two_eq_Suc_Suc RS sym]) 1);
|
|
1057 |
qed "hcmod_triangle_squared";
|
|
1058 |
Addsimps [hcmod_triangle_squared];
|
|
1059 |
|
|
1060 |
Goal "hcmod (x + y) <= hcmod(x) + hcmod(y)";
|
|
1061 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
1062 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
1063 |
by (auto_tac (claset(),simpset() addsimps [hcmod,
|
|
1064 |
hcomplex_add,hypreal_add,hypreal_le]));
|
|
1065 |
qed "hcmod_triangle_ineq";
|
|
1066 |
Addsimps [hcmod_triangle_ineq];
|
|
1067 |
|
|
1068 |
Goal "hcmod(b + a) - hcmod b <= hcmod a";
|
|
1069 |
by (cut_inst_tac [("x1","b"),("y1","a"),("x","-hcmod b")]
|
|
1070 |
(hcmod_triangle_ineq RS hypreal_add_le_mono1) 1);
|
|
1071 |
by (asm_full_simp_tac (simpset() addsimps hypreal_add_ac) 1);
|
|
1072 |
qed "hcmod_triangle_ineq2";
|
|
1073 |
Addsimps [hcmod_triangle_ineq2];
|
|
1074 |
|
|
1075 |
Goal "hcmod (x - y) = hcmod (y - x)";
|
|
1076 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
1077 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
1078 |
by (auto_tac (claset(),simpset() addsimps [hcmod,
|
|
1079 |
hcomplex_diff,complex_mod_diff_commute]));
|
|
1080 |
qed "hcmod_diff_commute";
|
|
1081 |
|
|
1082 |
Goal "[| hcmod x < r; hcmod y < s |] ==> hcmod (x + y) < r + s";
|
|
1083 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
1084 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
1085 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
|
|
1086 |
by (res_inst_tac [("z","s")] eq_Abs_hypreal 1);
|
|
1087 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hcomplex_add,
|
|
1088 |
hypreal_add,hypreal_less]));
|
|
1089 |
by (ultra_tac (claset() addIs [complex_mod_add_less],simpset()) 1);
|
|
1090 |
qed "hcmod_add_less";
|
|
1091 |
|
|
1092 |
Goal "[| hcmod x < r; hcmod y < s |] ==> hcmod (x * y) < r * s";
|
|
1093 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
1094 |
by (res_inst_tac [("z","y")] eq_Abs_hcomplex 1);
|
|
1095 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
|
|
1096 |
by (res_inst_tac [("z","s")] eq_Abs_hypreal 1);
|
|
1097 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hypreal_mult,
|
|
1098 |
hypreal_less,hcomplex_mult]));
|
|
1099 |
by (ultra_tac (claset() addIs [complex_mod_mult_less],simpset()) 1);
|
|
1100 |
qed "hcmod_mult_less";
|
|
1101 |
|
|
1102 |
goal NSComplex.thy "hcmod(a) - hcmod(b) <= hcmod(a + b)";
|
|
1103 |
by (res_inst_tac [("z","a")] eq_Abs_hcomplex 1);
|
|
1104 |
by (res_inst_tac [("z","b")] eq_Abs_hcomplex 1);
|
|
1105 |
by (auto_tac (claset(),simpset() addsimps [hcmod,hcomplex_add,
|
|
1106 |
hypreal_diff,hypreal_le]));
|
|
1107 |
qed "hcmod_diff_ineq";
|
|
1108 |
Addsimps [hcmod_diff_ineq];
|
|
1109 |
|
|
1110 |
|
|
1111 |
(*---------------------------------------------------------------------------*)
|
|
1112 |
(* a few nonlinear theorems *)
|
|
1113 |
(*---------------------------------------------------------------------------*)
|
|
1114 |
|
|
1115 |
Goalw [hcpow_def]
|
|
1116 |
"Abs_hcomplex(hcomplexrel``{%n. X n}) hcpow \
|
|
1117 |
\ Abs_hypnat(hypnatrel``{%n. Y n}) = \
|
|
1118 |
\ Abs_hcomplex(hcomplexrel``{%n. X n ^ Y n})";
|
|
1119 |
by (res_inst_tac [("f","Abs_hcomplex")] arg_cong 1);
|
|
1120 |
by (Auto_tac THEN Ultra_tac 1);
|
|
1121 |
qed "hcpow";
|
|
1122 |
|
|
1123 |
Goal "hcomplex_of_hypreal (x pow n) = (hcomplex_of_hypreal x) hcpow n";
|
|
1124 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
1125 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
|
|
1126 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
1127 |
hyperpow,hcpow,complex_of_real_pow]));
|
|
1128 |
qed "hcomplex_of_hypreal_hyperpow";
|
|
1129 |
|
|
1130 |
Goal "hcmod(x ^ n) = hcmod(x) ^ n";
|
|
1131 |
by (induct_tac "n" 1);
|
|
1132 |
by (auto_tac (claset(),simpset() addsimps [hcmod_mult]));
|
|
1133 |
qed "hcmod_hcomplexpow";
|
|
1134 |
|
|
1135 |
Goal "hcmod(x hcpow n) = hcmod(x) pow n";
|
|
1136 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
1137 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
|
|
1138 |
by (auto_tac (claset(),simpset() addsimps [hcpow,hyperpow,
|
|
1139 |
hcmod,complex_mod_complexpow]));
|
|
1140 |
qed "hcmod_hcpow";
|
|
1141 |
|
|
1142 |
Goal "(-x::hcomplex) ^ n = (if even n then (x ^ n) else -(x ^ n))";
|
|
1143 |
by (induct_tac "n" 1);
|
|
1144 |
by Auto_tac;
|
|
1145 |
qed "hcomplexpow_minus";
|
|
1146 |
|
|
1147 |
Goal "(-x::hcomplex) hcpow n = \
|
|
1148 |
\ (if ( *pNat* even) n then (x hcpow n) else -(x hcpow n))";
|
|
1149 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
1150 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
|
|
1151 |
by (auto_tac (claset(),simpset() addsimps [hcpow,hyperpow,starPNat,
|
|
1152 |
hcomplex_minus]));
|
|
1153 |
by (ALLGOALS(ultra_tac (claset(),simpset() addsimps [complexpow_minus])));
|
|
1154 |
qed "hcpow_minus";
|
|
1155 |
|
|
1156 |
Goal "inverse(-x) = - inverse (x::hcomplex)";
|
|
1157 |
by (res_inst_tac [("z","x")] eq_Abs_hcomplex 1);
|
|
1158 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_inverse,hcomplex_minus,
|
|
1159 |
complex_inverse_minus]));
|
|
1160 |
qed "hccomplex_inverse_minus";
|
|
1161 |
|
|
1162 |
Goalw [hcomplex_divide_def] "x / (1::hcomplex) = x";
|
|
1163 |
by (Simp_tac 1);
|
|
1164 |
qed "hcomplex_div_one";
|
|
1165 |
Addsimps [hcomplex_div_one];
|
|
1166 |
|
|
1167 |
Goal "hcmod(inverse x) = inverse(hcmod x)";
|
|
1168 |
by (hcomplex_div_undefined_case_tac "x = 0" 1);
|
|
1169 |
by (res_inst_tac [("c1","hcmod x")] (hypreal_mult_left_cancel RS iffD1) 1);
|
|
1170 |
by (auto_tac (claset(),simpset() addsimps [hcmod_mult RS sym]));
|
|
1171 |
qed "hcmod_hcomplex_inverse";
|
|
1172 |
|
|
1173 |
Goalw [hcomplex_divide_def,hypreal_divide_def]
|
|
1174 |
"hcmod(x/y) = hcmod(x)/(hcmod y)";
|
|
1175 |
by (auto_tac (claset(),simpset() addsimps [hcmod_mult,
|
|
1176 |
hcmod_hcomplex_inverse]));
|
|
1177 |
qed "hcmod_divide";
|
|
1178 |
|
|
1179 |
Goalw [hcomplex_divide_def]
|
|
1180 |
"inverse(x/y) = y/(x::hcomplex)";
|
|
1181 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_inverse_distrib,
|
|
1182 |
hcomplex_mult_commute]));
|
|
1183 |
qed "hcomplex_inverse_divide";
|
|
1184 |
Addsimps [hcomplex_inverse_divide];
|
|
1185 |
|
|
1186 |
Goal "((r::hcomplex) * s) ^ n = (r ^ n) * (s ^ n)";
|
|
1187 |
by (induct_tac "n" 1);
|
|
1188 |
by (auto_tac (claset(),simpset() addsimps hcomplex_mult_ac));
|
|
1189 |
qed "hcomplexpow_mult";
|
|
1190 |
|
|
1191 |
Goal "((r::hcomplex) * s) hcpow n = (r hcpow n) * (s hcpow n)";
|
|
1192 |
by (res_inst_tac [("z","r")] eq_Abs_hcomplex 1);
|
|
1193 |
by (res_inst_tac [("z","s")] eq_Abs_hcomplex 1);
|
|
1194 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
|
|
1195 |
by (auto_tac (claset(),simpset() addsimps [hcpow,hypreal_mult,
|
|
1196 |
hcomplex_mult,complexpow_mult]));
|
|
1197 |
qed "hcpow_mult";
|
|
1198 |
|
|
1199 |
Goal "(0::hcomplex) ^ (Suc n) = 0";
|
|
1200 |
by (Auto_tac);
|
|
1201 |
qed "hcomplexpow_zero";
|
|
1202 |
Addsimps [hcomplexpow_zero];
|
|
1203 |
|
|
1204 |
Goalw [hcomplex_zero_def,hypnat_one_def]
|
|
1205 |
"0 hcpow (n + 1) = 0";
|
|
1206 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
|
|
1207 |
by (auto_tac (claset(),simpset() addsimps [hcpow,hypnat_add]));
|
|
1208 |
qed "hcpow_zero";
|
|
1209 |
Addsimps [hcpow_zero];
|
|
1210 |
|
|
1211 |
Goalw [hSuc_def]
|
|
1212 |
"0 hcpow (hSuc n) = 0";
|
|
1213 |
by (Simp_tac 1);
|
|
1214 |
qed "hcpow_zero2";
|
|
1215 |
Addsimps [hcpow_zero2];
|
|
1216 |
|
|
1217 |
Goal "r ~= (0::hcomplex) --> r ^ n ~= 0";
|
|
1218 |
by (induct_tac "n" 1);
|
|
1219 |
by (auto_tac (claset(),simpset() addsimps
|
|
1220 |
[hcomplex_mult_not_zero]));
|
|
1221 |
qed_spec_mp "hcomplexpow_not_zero";
|
|
1222 |
Addsimps [hcomplexpow_not_zero];
|
|
1223 |
AddIs [hcomplexpow_not_zero];
|
|
1224 |
|
|
1225 |
Goal "r ~= 0 ==> r hcpow n ~= (0::hcomplex)";
|
|
1226 |
by (res_inst_tac [("z","r")] eq_Abs_hcomplex 1);
|
|
1227 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
|
|
1228 |
by (auto_tac (claset(),simpset() addsimps [hcpow,
|
|
1229 |
hcomplex_zero_def]));
|
|
1230 |
by (ultra_tac (claset() addDs [complexpow_zero_zero],simpset()) 1);
|
|
1231 |
qed "hcpow_not_zero";
|
|
1232 |
Addsimps [hcpow_not_zero];
|
|
1233 |
AddIs [hcpow_not_zero];
|
|
1234 |
|
|
1235 |
Goal "r ^ n = (0::hcomplex) ==> r = 0";
|
|
1236 |
by (blast_tac (claset() addIs [ccontr]
|
|
1237 |
addDs [hcomplexpow_not_zero]) 1);
|
|
1238 |
qed "hcomplexpow_zero_zero";
|
|
1239 |
|
|
1240 |
Goal "r hcpow n = (0::hcomplex) ==> r = 0";
|
|
1241 |
by (blast_tac (claset() addIs [ccontr]
|
|
1242 |
addDs [hcpow_not_zero]) 1);
|
|
1243 |
qed "hcpow_zero_zero";
|
|
1244 |
|
|
1245 |
Goalw [iii_def] "iii * iii = - 1";
|
|
1246 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult,
|
|
1247 |
hcomplex_one_def,hcomplex_minus]));
|
|
1248 |
qed "hcomplex_i_mult_eq";
|
|
1249 |
Addsimps [hcomplex_i_mult_eq];
|
|
1250 |
|
|
1251 |
Goal "iii ^ 2 = - 1";
|
|
1252 |
by (simp_tac (simpset() addsimps [two_eq_Suc_Suc]) 1);
|
|
1253 |
qed "hcomplexpow_i_squared";
|
|
1254 |
Addsimps [hcomplexpow_i_squared];
|
|
1255 |
|
|
1256 |
Goalw [iii_def,hcomplex_zero_def] "iii ~= 0";
|
|
1257 |
by Auto_tac;
|
|
1258 |
qed "hcomplex_i_not_zero";
|
|
1259 |
Addsimps [hcomplex_i_not_zero];
|
|
1260 |
|
|
1261 |
Goal "x * y ~= (0::hcomplex) ==> x ~= 0";
|
|
1262 |
by Auto_tac;
|
|
1263 |
qed "hcomplex_mult_eq_zero_cancel1";
|
|
1264 |
|
|
1265 |
Goal "x * y ~= (0::hcomplex) ==> y ~= 0";
|
|
1266 |
by Auto_tac;
|
|
1267 |
qed "hcomplex_mult_eq_zero_cancel2";
|
|
1268 |
|
|
1269 |
Goal "(x * y ~= (0::hcomplex)) = (x ~= 0 & y ~= 0)";
|
|
1270 |
by Auto_tac;
|
|
1271 |
qed "hcomplex_mult_not_eq_zero_iff";
|
|
1272 |
AddIffs [hcomplex_mult_not_eq_zero_iff];
|
|
1273 |
|
|
1274 |
Goalw [hcomplex_divide_def,complex_divide_def]
|
|
1275 |
"Abs_hcomplex(hcomplexrel``{%n. X n}) / Abs_hcomplex(hcomplexrel``{%n. Y n}) = \
|
|
1276 |
\ Abs_hcomplex(hcomplexrel``{%n. X n / Y n})";
|
|
1277 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_inverse,hcomplex_mult]));
|
|
1278 |
qed "hcomplex_divide";
|
|
1279 |
|
|
1280 |
(*---------------------------------------------------------------------------*)
|
|
1281 |
(* hsgn *)
|
|
1282 |
(*---------------------------------------------------------------------------*)
|
|
1283 |
|
|
1284 |
Goalw [hsgn_def]
|
|
1285 |
"hsgn (Abs_hcomplex(hcomplexrel `` {%n. X n})) = \
|
|
1286 |
\ Abs_hcomplex(hcomplexrel `` {%n. sgn (X n)})";
|
|
1287 |
by (res_inst_tac [("f","Abs_hcomplex")] arg_cong 1);
|
|
1288 |
by (Auto_tac THEN Ultra_tac 1);
|
|
1289 |
qed "hsgn";
|
|
1290 |
|
|
1291 |
Addsimps [rename_numerals sgn_zero];
|
|
1292 |
Goalw [hcomplex_zero_def] "hsgn 0 = 0";
|
|
1293 |
by (simp_tac (simpset() addsimps [hsgn]) 1);
|
|
1294 |
qed "hsgn_zero";
|
|
1295 |
Addsimps[hsgn_zero];
|
|
1296 |
|
|
1297 |
Addsimps [rename_numerals sgn_one];
|
|
1298 |
|
|
1299 |
Goalw [hcomplex_one_def] "hsgn 1 = 1";
|
|
1300 |
by (simp_tac (simpset() addsimps [hsgn]) 1);
|
|
1301 |
qed "hsgn_one";
|
|
1302 |
Addsimps[hsgn_one];
|
|
1303 |
|
|
1304 |
Goal "hsgn (-z) = - hsgn(z)";
|
|
1305 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
1306 |
by (auto_tac (claset(),simpset() addsimps [hsgn,hcomplex_minus,
|
|
1307 |
sgn_minus]));
|
|
1308 |
qed "hsgn_minus";
|
|
1309 |
|
|
1310 |
Goal "hsgn z = z / hcomplex_of_hypreal (hcmod z)";
|
|
1311 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
1312 |
by (auto_tac (claset(),simpset() addsimps [hsgn,hcomplex_divide,
|
|
1313 |
hcomplex_of_hypreal,hcmod,sgn_eq]));
|
|
1314 |
qed "hsgn_eq";
|
|
1315 |
|
|
1316 |
Goal "(EX (x::hypreal) y. P x y) = \
|
|
1317 |
\ (EX f g. P (Abs_hypreal(hyprel `` {f})) (Abs_hypreal(hyprel `` {g})))";
|
|
1318 |
by Auto_tac;
|
|
1319 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
1320 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1321 |
by Auto_tac;
|
|
1322 |
qed "lemma_hypreal_P_EX2";
|
|
1323 |
|
|
1324 |
Goal "ALL (n::nat). EX x y. (z n) = complex_of_real(x) + ii * complex_of_real(y)";
|
|
1325 |
by (blast_tac (claset() addIs [complex_split]) 1);
|
|
1326 |
qed "complex_split2";
|
|
1327 |
|
|
1328 |
(* Interesting proof! *)
|
|
1329 |
Goal "EX x y. z = hcomplex_of_hypreal(x) + iii * hcomplex_of_hypreal(y)";
|
|
1330 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
1331 |
by (auto_tac (claset(),simpset() addsimps [lemma_hypreal_P_EX2,
|
|
1332 |
hcomplex_of_hypreal,iii_def,hcomplex_add,hcomplex_mult]));
|
|
1333 |
by (cut_inst_tac [("z","x")] complex_split2 1);
|
|
1334 |
by (REPEAT(dtac choice 1 THEN Step_tac 1));
|
|
1335 |
by (res_inst_tac [("x","f")] exI 1);
|
|
1336 |
by (res_inst_tac [("x","fa")] exI 1);
|
|
1337 |
by Auto_tac;
|
|
1338 |
qed "hcomplex_split";
|
|
1339 |
|
|
1340 |
Goal "hRe(hcomplex_of_hypreal(x) + iii * hcomplex_of_hypreal(y)) = x";
|
|
1341 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
1342 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1343 |
by (auto_tac (claset(),simpset() addsimps [hRe,iii_def,hcomplex_add,
|
|
1344 |
hcomplex_mult,hcomplex_of_hypreal]));
|
|
1345 |
qed "hRe_hcomplex_i";
|
|
1346 |
Addsimps [hRe_hcomplex_i];
|
|
1347 |
|
|
1348 |
Goal "hIm(hcomplex_of_hypreal(x) + iii * hcomplex_of_hypreal(y)) = y";
|
|
1349 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
1350 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1351 |
by (auto_tac (claset(),simpset() addsimps [hIm,iii_def,hcomplex_add,
|
|
1352 |
hcomplex_mult,hcomplex_of_hypreal]));
|
|
1353 |
qed "hIm_hcomplex_i";
|
|
1354 |
Addsimps [hIm_hcomplex_i];
|
|
1355 |
|
|
1356 |
Goal "hcmod (hcomplex_of_hypreal(x) + iii * hcomplex_of_hypreal(y)) = \
|
|
1357 |
\ ( *f* sqrt) (x ^ 2 + y ^ 2)";
|
|
1358 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
1359 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1360 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
1361 |
iii_def,hcomplex_add,hcomplex_mult,starfun,hypreal_mult,
|
|
1362 |
hypreal_add,hcmod,cmod_i,two_eq_Suc_Suc]));
|
|
1363 |
qed "hcmod_i";
|
|
1364 |
|
|
1365 |
Goalw [iii_def]
|
|
1366 |
"hcomplex_of_hypreal xa + iii * hcomplex_of_hypreal ya = \
|
|
1367 |
\ hcomplex_of_hypreal xb + iii * hcomplex_of_hypreal yb \
|
|
1368 |
\ ==> xa = xb";
|
|
1369 |
by (res_inst_tac [("z","xa")] eq_Abs_hypreal 1);
|
|
1370 |
by (res_inst_tac [("z","ya")] eq_Abs_hypreal 1);
|
|
1371 |
by (res_inst_tac [("z","xb")] eq_Abs_hypreal 1);
|
|
1372 |
by (res_inst_tac [("z","yb")] eq_Abs_hypreal 1);
|
|
1373 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult,hcomplex_add,
|
|
1374 |
hcomplex_of_hypreal]));
|
|
1375 |
by (Ultra_tac 1);
|
|
1376 |
qed "hcomplex_eq_hRe_eq";
|
|
1377 |
|
|
1378 |
Goalw [iii_def]
|
|
1379 |
"hcomplex_of_hypreal xa + iii * hcomplex_of_hypreal ya = \
|
|
1380 |
\ hcomplex_of_hypreal xb + iii * hcomplex_of_hypreal yb \
|
|
1381 |
\ ==> ya = yb";
|
|
1382 |
by (res_inst_tac [("z","xa")] eq_Abs_hypreal 1);
|
|
1383 |
by (res_inst_tac [("z","ya")] eq_Abs_hypreal 1);
|
|
1384 |
by (res_inst_tac [("z","xb")] eq_Abs_hypreal 1);
|
|
1385 |
by (res_inst_tac [("z","yb")] eq_Abs_hypreal 1);
|
|
1386 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult,hcomplex_add,
|
|
1387 |
hcomplex_of_hypreal]));
|
|
1388 |
by (Ultra_tac 1);
|
|
1389 |
qed "hcomplex_eq_hIm_eq";
|
|
1390 |
|
|
1391 |
Goal "(hcomplex_of_hypreal xa + iii * hcomplex_of_hypreal ya = \
|
|
1392 |
\ hcomplex_of_hypreal xb + iii * hcomplex_of_hypreal yb) = \
|
|
1393 |
\ ((xa = xb) & (ya = yb))";
|
|
1394 |
by (auto_tac (claset() addIs [hcomplex_eq_hIm_eq,hcomplex_eq_hRe_eq],simpset()));
|
|
1395 |
qed "hcomplex_eq_cancel_iff";
|
|
1396 |
Addsimps [hcomplex_eq_cancel_iff];
|
|
1397 |
|
|
1398 |
Goal "(hcomplex_of_hypreal xa + hcomplex_of_hypreal ya * iii = \
|
|
1399 |
\ hcomplex_of_hypreal xb + hcomplex_of_hypreal yb * iii ) = ((xa = xb) & (ya = yb))";
|
|
1400 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult_commute]));
|
|
1401 |
qed "hcomplex_eq_cancel_iffA";
|
|
1402 |
AddIffs [hcomplex_eq_cancel_iffA];
|
|
1403 |
|
|
1404 |
Goal "(hcomplex_of_hypreal xa + hcomplex_of_hypreal ya * iii = \
|
|
1405 |
\ hcomplex_of_hypreal xb + iii * hcomplex_of_hypreal yb) = ((xa = xb) & (ya = yb))";
|
|
1406 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult_commute]));
|
|
1407 |
qed "hcomplex_eq_cancel_iffB";
|
|
1408 |
AddIffs [hcomplex_eq_cancel_iffB];
|
|
1409 |
|
|
1410 |
Goal "(hcomplex_of_hypreal xa + iii * hcomplex_of_hypreal ya = \
|
|
1411 |
\ hcomplex_of_hypreal xb + hcomplex_of_hypreal yb * iii) = ((xa = xb) & (ya = yb))";
|
|
1412 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult_commute]));
|
|
1413 |
qed "hcomplex_eq_cancel_iffC";
|
|
1414 |
AddIffs [hcomplex_eq_cancel_iffC];
|
|
1415 |
|
|
1416 |
Goal"(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y = \
|
|
1417 |
\ hcomplex_of_hypreal xa) = (x = xa & y = 0)";
|
|
1418 |
by (cut_inst_tac [("xa","x"),("ya","y"),("xb","xa"),("yb","0")]
|
|
1419 |
hcomplex_eq_cancel_iff 1);
|
|
1420 |
by (asm_full_simp_tac (simpset() delsimps [hcomplex_eq_cancel_iff]) 1);
|
|
1421 |
qed "hcomplex_eq_cancel_iff2";
|
|
1422 |
Addsimps [hcomplex_eq_cancel_iff2];
|
|
1423 |
|
|
1424 |
Goal"(hcomplex_of_hypreal x + hcomplex_of_hypreal y * iii = \
|
|
1425 |
\ hcomplex_of_hypreal xa) = (x = xa & y = 0)";
|
|
1426 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult_commute]));
|
|
1427 |
qed "hcomplex_eq_cancel_iff2a";
|
|
1428 |
Addsimps [hcomplex_eq_cancel_iff2a];
|
|
1429 |
|
|
1430 |
Goal "(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y = \
|
|
1431 |
\ iii * hcomplex_of_hypreal ya) = (x = 0 & y = ya)";
|
|
1432 |
by (cut_inst_tac [("xa","x"),("ya","y"),("xb","0"),("yb","ya")]
|
|
1433 |
hcomplex_eq_cancel_iff 1);
|
|
1434 |
by (asm_full_simp_tac (simpset() delsimps [hcomplex_eq_cancel_iff]) 1);
|
|
1435 |
qed "hcomplex_eq_cancel_iff3";
|
|
1436 |
Addsimps [hcomplex_eq_cancel_iff3];
|
|
1437 |
|
|
1438 |
Goal "(hcomplex_of_hypreal x + hcomplex_of_hypreal y * iii = \
|
|
1439 |
\ iii * hcomplex_of_hypreal ya) = (x = 0 & y = ya)";
|
|
1440 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult_commute]));
|
|
1441 |
qed "hcomplex_eq_cancel_iff3a";
|
|
1442 |
Addsimps [hcomplex_eq_cancel_iff3a];
|
|
1443 |
|
|
1444 |
Goalw [iii_def]
|
|
1445 |
"hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y = 0 \
|
|
1446 |
\ ==> x = 0";
|
|
1447 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
1448 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1449 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
1450 |
hcomplex_add,hcomplex_mult,hcomplex_zero_def,hypreal_zero_num]));
|
|
1451 |
by (ultra_tac (claset(),simpset() addsimps [complex_split_Re_zero]) 1);
|
|
1452 |
qed "hcomplex_split_hRe_zero";
|
|
1453 |
|
|
1454 |
Goalw [iii_def]
|
|
1455 |
"hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y = 0 \
|
|
1456 |
\ ==> y = 0";
|
|
1457 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
1458 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1459 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
1460 |
hcomplex_add,hcomplex_mult,hcomplex_zero_def,hypreal_zero_num]));
|
|
1461 |
by (ultra_tac (claset(),simpset() addsimps [complex_split_Im_zero]) 1);
|
|
1462 |
qed "hcomplex_split_hIm_zero";
|
|
1463 |
|
|
1464 |
Goal "hRe(hsgn z) = hRe(z)/hcmod z";
|
|
1465 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
1466 |
by (auto_tac (claset(),simpset() addsimps [hsgn,hcmod,hRe,hypreal_divide]));
|
|
1467 |
qed "hRe_hsgn";
|
|
1468 |
Addsimps [hRe_hsgn];
|
|
1469 |
|
|
1470 |
Goal "hIm(hsgn z) = hIm(z)/hcmod z";
|
|
1471 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
1472 |
by (auto_tac (claset(),simpset() addsimps [hsgn,hcmod,hIm,hypreal_divide]));
|
|
1473 |
qed "hIm_hsgn";
|
|
1474 |
Addsimps [hIm_hsgn];
|
|
1475 |
|
|
1476 |
Goal "(x*x + y*y = 0) = ((x::real) = 0 & y = 0)";
|
|
1477 |
by (auto_tac (claset() addIs [real_sum_squares_cancel],simpset()));
|
|
1478 |
qed "real_two_squares_add_zero_iff";
|
|
1479 |
Addsimps [real_two_squares_add_zero_iff];
|
|
1480 |
|
|
1481 |
Goal "inverse(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y) = \
|
|
1482 |
\ hcomplex_of_hypreal(x/(x ^ 2 + y ^ 2)) - \
|
|
1483 |
\ iii * hcomplex_of_hypreal(y/(x ^ 2 + y ^ 2))";
|
|
1484 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
1485 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1486 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
1487 |
hcomplex_mult,hcomplex_add,iii_def,starfun,hypreal_mult,
|
|
1488 |
hypreal_add,hcomplex_inverse,hypreal_divide,hcomplex_diff,
|
|
1489 |
complex_inverse_complex_split,two_eq_Suc_Suc]));
|
|
1490 |
qed "hcomplex_inverse_complex_split";
|
|
1491 |
|
|
1492 |
Goalw [iii_def]
|
|
1493 |
"hRe (iii * hcomplex_of_hypreal y) = 0";
|
|
1494 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1495 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
1496 |
hcomplex_mult,hRe,hypreal_zero_num]));
|
|
1497 |
qed "hRe_mult_i_eq";
|
|
1498 |
Addsimps [hRe_mult_i_eq];
|
|
1499 |
|
|
1500 |
Goalw [iii_def]
|
|
1501 |
"hIm (iii * hcomplex_of_hypreal y) = y";
|
|
1502 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1503 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
1504 |
hcomplex_mult,hIm,hypreal_zero_num]));
|
|
1505 |
qed "hIm_mult_i_eq";
|
|
1506 |
Addsimps [hIm_mult_i_eq];
|
|
1507 |
|
|
1508 |
Goal "hcmod (iii * hcomplex_of_hypreal y) = abs y";
|
|
1509 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1510 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
1511 |
hcmod,hypreal_hrabs,iii_def,hcomplex_mult]));
|
|
1512 |
qed "hcmod_mult_i";
|
|
1513 |
Addsimps [hcmod_mult_i];
|
|
1514 |
|
|
1515 |
Goal "hcmod (hcomplex_of_hypreal y * iii) = abs y";
|
|
1516 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_mult_commute]));
|
|
1517 |
qed "hcmod_mult_i2";
|
|
1518 |
Addsimps [hcmod_mult_i2];
|
|
1519 |
|
|
1520 |
(*---------------------------------------------------------------------------*)
|
|
1521 |
(* harg *)
|
|
1522 |
(*---------------------------------------------------------------------------*)
|
|
1523 |
|
|
1524 |
Goalw [harg_def]
|
|
1525 |
"harg (Abs_hcomplex(hcomplexrel `` {%n. X n})) = \
|
|
1526 |
\ Abs_hypreal(hyprel `` {%n. arg (X n)})";
|
|
1527 |
by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1);
|
|
1528 |
by (Auto_tac THEN Ultra_tac 1);
|
|
1529 |
qed "harg";
|
|
1530 |
|
|
1531 |
Goal "0 < y ==> ( *f* cos) (harg(iii * hcomplex_of_hypreal y)) = 0";
|
|
1532 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1533 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
1534 |
iii_def,hcomplex_mult,hypreal_zero_num,hypreal_less,starfun,
|
|
1535 |
harg]));
|
|
1536 |
by (Ultra_tac 1);
|
|
1537 |
qed "cos_harg_i_mult_zero";
|
|
1538 |
Addsimps [cos_harg_i_mult_zero];
|
|
1539 |
|
|
1540 |
Goal "y < 0 ==> ( *f* cos) (harg(iii * hcomplex_of_hypreal y)) = 0";
|
|
1541 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1542 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
1543 |
iii_def,hcomplex_mult,hypreal_zero_num,hypreal_less,starfun,
|
|
1544 |
harg]));
|
|
1545 |
by (Ultra_tac 1);
|
|
1546 |
qed "cos_harg_i_mult_zero2";
|
|
1547 |
Addsimps [cos_harg_i_mult_zero2];
|
|
1548 |
|
|
1549 |
Goal "(hcomplex_of_hypreal y ~= 0) = (y ~= 0)";
|
|
1550 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1551 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
1552 |
hypreal_zero_num,hcomplex_zero_def]));
|
|
1553 |
qed "hcomplex_of_hypreal_not_zero_iff";
|
|
1554 |
Addsimps [hcomplex_of_hypreal_not_zero_iff];
|
|
1555 |
|
|
1556 |
Goal "(hcomplex_of_hypreal y = 0) = (y = 0)";
|
|
1557 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
1558 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,
|
|
1559 |
hypreal_zero_num,hcomplex_zero_def]));
|
|
1560 |
qed "hcomplex_of_hypreal_zero_iff";
|
|
1561 |
Addsimps [hcomplex_of_hypreal_zero_iff];
|
|
1562 |
|
|
1563 |
Goal "y ~= 0 ==> ( *f* cos) (harg(iii * hcomplex_of_hypreal y)) = 0";
|
|
1564 |
by (cut_inst_tac [("x","y"),("y","0")] hypreal_linear 1);
|
|
1565 |
by Auto_tac;
|
|
1566 |
qed "cos_harg_i_mult_zero3";
|
|
1567 |
Addsimps [cos_harg_i_mult_zero3];
|
|
1568 |
|
|
1569 |
(*---------------------------------------------------------------------------*)
|
|
1570 |
(* Polar form for nonstandard complex numbers *)
|
|
1571 |
(*---------------------------------------------------------------------------*)
|
|
1572 |
|
|
1573 |
Goal "ALL n. EX r a. (z n) = complex_of_real r * \
|
|
1574 |
\ (complex_of_real(cos a) + ii * complex_of_real(sin a))";
|
|
1575 |
by (blast_tac (claset() addIs [complex_split_polar]) 1);
|
|
1576 |
qed "complex_split_polar2";
|
|
1577 |
|
|
1578 |
Goal
|
|
1579 |
"EX r a. z = hcomplex_of_hypreal r * \
|
|
1580 |
\ (hcomplex_of_hypreal(( *f* cos) a) + iii * hcomplex_of_hypreal(( *f* sin) a))";
|
|
1581 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1);
|
|
1582 |
by (auto_tac (claset(),simpset() addsimps [lemma_hypreal_P_EX2,
|
|
1583 |
hcomplex_of_hypreal,iii_def,starfun,hcomplex_add,hcomplex_mult]));
|
|
1584 |
by (cut_inst_tac [("z","x")] complex_split_polar2 1);
|
|
1585 |
by (REPEAT(dtac choice 1 THEN Step_tac 1));
|
|
1586 |
by (res_inst_tac [("x","f")] exI 1);
|
|
1587 |
by (res_inst_tac [("x","fa")] exI 1);
|
|
1588 |
by Auto_tac;
|
|
1589 |
qed "hcomplex_split_polar";
|
|
1590 |
|
|
1591 |
Goalw [hcis_def]
|
|
1592 |
"hcis (Abs_hypreal(hyprel `` {%n. X n})) = \
|
|
1593 |
\ Abs_hcomplex(hcomplexrel `` {%n. cis (X n)})";
|
|
1594 |
by (res_inst_tac [("f","Abs_hcomplex")] arg_cong 1);
|
|
1595 |
by (Auto_tac THEN Ultra_tac 1);
|
|
1596 |
qed "hcis";
|
|
1597 |
|
|
1598 |
Goal
|
|
1599 |
"hcis a = \
|
|
1600 |
\ (hcomplex_of_hypreal(( *f* cos) a) + \
|
|
1601 |
\ iii * hcomplex_of_hypreal(( *f* sin) a))";
|
|
1602 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
1603 |
by (auto_tac (claset(),simpset() addsimps [starfun, hcis,
|
|
1604 |
hcomplex_of_hypreal,iii_def,hcomplex_mult,hcomplex_add,
|
|
1605 |
cis_def]));
|
|
1606 |
qed "hcis_eq";
|
|
1607 |
|
|
1608 |
Goalw [hrcis_def]
|
|
1609 |
"hrcis (Abs_hypreal(hyprel `` {%n. X n})) (Abs_hypreal(hyprel `` {%n. Y n})) = \
|
|
1610 |
\ Abs_hcomplex(hcomplexrel `` {%n. rcis (X n) (Y n)})";
|
|
1611 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_of_hypreal,hcomplex_mult,
|
|
1612 |
hcis,rcis_def]));
|
|
1613 |
qed "hrcis";
|
|
1614 |
|
|
1615 |
Goal "EX r a. z = hrcis r a";
|
|
1616 |
by (simp_tac (simpset() addsimps [hrcis_def,hcis_eq]) 1);
|
|
1617 |
by (rtac hcomplex_split_polar 1);
|
|
1618 |
qed "hrcis_Ex";
|
|
1619 |
|
|
1620 |
Goal "hRe(hcomplex_of_hypreal r * \
|
|
1621 |
\ (hcomplex_of_hypreal(( *f* cos) a) + \
|
|
1622 |
\ iii * hcomplex_of_hypreal(( *f* sin) a))) = r * ( *f* cos) a";
|
|
1623 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_add_mult_distrib2,
|
|
1624 |
hcomplex_of_hypreal_mult] @ hcomplex_mult_ac));
|
|
1625 |
qed "hRe_hcomplex_polar";
|
|
1626 |
Addsimps [hRe_hcomplex_polar];
|
|
1627 |
|
|
1628 |
Goalw [hrcis_def] "hRe(hrcis r a) = r * ( *f* cos) a";
|
|
1629 |
by (auto_tac (claset(),simpset() addsimps [hcis_eq]));
|
|
1630 |
qed "hRe_hrcis";
|
|
1631 |
Addsimps [hRe_hrcis];
|
|
1632 |
|
|
1633 |
Goal "hIm(hcomplex_of_hypreal r * \
|
|
1634 |
\ (hcomplex_of_hypreal(( *f* cos) a) + \
|
|
1635 |
\ iii * hcomplex_of_hypreal(( *f* sin) a))) = r * ( *f* sin) a";
|
|
1636 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_add_mult_distrib2,
|
|
1637 |
hcomplex_of_hypreal_mult] @ hcomplex_mult_ac));
|
|
1638 |
qed "hIm_hcomplex_polar";
|
|
1639 |
Addsimps [hIm_hcomplex_polar];
|
|
1640 |
|
|
1641 |
Goalw [hrcis_def] "hIm(hrcis r a) = r * ( *f* sin) a";
|
|
1642 |
by (auto_tac (claset(),simpset() addsimps [hcis_eq]));
|
|
1643 |
qed "hIm_hrcis";
|
|
1644 |
Addsimps [hIm_hrcis];
|
|
1645 |
|
|
1646 |
Goal "hcmod (hcomplex_of_hypreal r * \
|
|
1647 |
\ (hcomplex_of_hypreal(( *f* cos) a) + \
|
|
1648 |
\ iii * hcomplex_of_hypreal(( *f* sin) a))) = abs r";
|
|
1649 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
|
|
1650 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
1651 |
by (auto_tac (claset(),simpset() addsimps [iii_def,starfun,
|
|
1652 |
hcomplex_of_hypreal,hcomplex_mult,hcmod,hcomplex_add,
|
|
1653 |
hypreal_hrabs]));
|
|
1654 |
qed "hcmod_complex_polar";
|
|
1655 |
Addsimps [hcmod_complex_polar];
|
|
1656 |
|
|
1657 |
Goalw [hrcis_def] "hcmod(hrcis r a) = abs r";
|
|
1658 |
by (auto_tac (claset(),simpset() addsimps [hcis_eq]));
|
|
1659 |
qed "hcmod_hrcis";
|
|
1660 |
Addsimps [hcmod_hrcis];
|
|
1661 |
|
|
1662 |
(*---------------------------------------------------------------------------*)
|
|
1663 |
(* (r1 * hrcis a) * (r2 * hrcis b) = r1 * r2 * hrcis (a + b) *)
|
|
1664 |
(*---------------------------------------------------------------------------*)
|
|
1665 |
|
|
1666 |
Goalw [hrcis_def] "hcis a = hrcis 1 a";
|
|
1667 |
by (Simp_tac 1);
|
|
1668 |
qed "hcis_hrcis_eq";
|
|
1669 |
Addsimps [hcis_hrcis_eq RS sym];
|
|
1670 |
|
|
1671 |
Goalw [hrcis_def]
|
|
1672 |
"hrcis r1 a * hrcis r2 b = hrcis (r1*r2) (a + b)";
|
|
1673 |
by (res_inst_tac [("z","r1")] eq_Abs_hypreal 1);
|
|
1674 |
by (res_inst_tac [("z","r2")] eq_Abs_hypreal 1);
|
|
1675 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
1676 |
by (res_inst_tac [("z","b")] eq_Abs_hypreal 1);
|
|
1677 |
by (auto_tac (claset(),simpset() addsimps [hrcis,hcis,
|
|
1678 |
hypreal_add,hypreal_mult,hcomplex_of_hypreal,
|
|
1679 |
hcomplex_mult,cis_mult RS sym,complex_of_real_mult
|
|
1680 |
RS sym] addsimps complex_mult_ac));
|
|
1681 |
qed "hrcis_mult";
|
|
1682 |
|
|
1683 |
Goal "hcis a * hcis b = hcis (a + b)";
|
|
1684 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
1685 |
by (res_inst_tac [("z","b")] eq_Abs_hypreal 1);
|
|
1686 |
by (auto_tac (claset(),simpset() addsimps [hcis,hcomplex_mult,
|
|
1687 |
hypreal_add,cis_mult]));
|
|
1688 |
qed "hcis_mult";
|
|
1689 |
|
|
1690 |
Goalw [hcomplex_one_def]
|
|
1691 |
"hcis 0 = 1";
|
|
1692 |
by (auto_tac (claset(),simpset() addsimps [hcis,hypreal_zero_num]));
|
|
1693 |
qed "hcis_zero";
|
|
1694 |
Addsimps [hcis_zero];
|
|
1695 |
|
|
1696 |
Goalw [hcomplex_zero_def]
|
|
1697 |
"hrcis 0 a = 0";
|
|
1698 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
1699 |
by (auto_tac (claset(),simpset() addsimps [hrcis,hypreal_zero_num]));
|
|
1700 |
qed "hrcis_zero_mod";
|
|
1701 |
Addsimps [hrcis_zero_mod];
|
|
1702 |
|
|
1703 |
Goal "hrcis r 0 = hcomplex_of_hypreal r";
|
|
1704 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
|
|
1705 |
by (auto_tac (claset(),simpset() addsimps [hrcis,
|
|
1706 |
hypreal_zero_num,hcomplex_of_hypreal]));
|
|
1707 |
qed "hrcis_zero_arg";
|
|
1708 |
Addsimps [hrcis_zero_arg];
|
|
1709 |
|
|
1710 |
Goal "iii * (iii * x) = - x";
|
|
1711 |
by (simp_tac (simpset() addsimps [hcomplex_mult_assoc RS sym]) 1);
|
|
1712 |
qed "hcomplex_i_mult_minus";
|
|
1713 |
Addsimps [hcomplex_i_mult_minus];
|
|
1714 |
|
|
1715 |
Goal "iii * iii * x = - x";
|
|
1716 |
by (Simp_tac 1);
|
|
1717 |
qed "hcomplex_i_mult_minus2";
|
|
1718 |
Addsimps [hcomplex_i_mult_minus2];
|
|
1719 |
|
|
1720 |
(* Move to one of the hyperreal theories *)
|
|
1721 |
Goal "hypreal_of_nat m = Abs_hypreal(hyprel `` {%n. real m})";
|
|
1722 |
by (induct_tac "m" 1);
|
|
1723 |
by (auto_tac (claset(),simpset() addsimps [hypreal_zero_def,
|
|
1724 |
hypreal_of_nat_Suc,hypreal_zero_num,
|
|
1725 |
hypreal_one_num,hypreal_add,real_of_nat_Suc]));
|
|
1726 |
qed "hypreal_of_nat";
|
|
1727 |
|
|
1728 |
Goal
|
|
1729 |
"hcis (hypreal_of_nat (Suc n) * a) = hcis a * hcis (hypreal_of_nat n * a)";
|
|
1730 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
1731 |
by (auto_tac (claset(),simpset() addsimps [hypreal_of_nat,hcis,
|
|
1732 |
hypreal_mult,hcomplex_mult,cis_real_of_nat_Suc_mult]));
|
|
1733 |
qed "hcis_hypreal_of_nat_Suc_mult";
|
|
1734 |
|
|
1735 |
Goal "(hcis a) ^ n = hcis (hypreal_of_nat n * a)";
|
|
1736 |
by (induct_tac "n" 1);
|
|
1737 |
by (auto_tac (claset(),simpset() addsimps [hcis_hypreal_of_nat_Suc_mult]));
|
|
1738 |
qed "NSDeMoivre";
|
|
1739 |
|
|
1740 |
Goal "hcis (hypreal_of_hypnat (n + 1) * a) = \
|
|
1741 |
\ hcis a * hcis (hypreal_of_hypnat n * a)";
|
|
1742 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
1743 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
|
|
1744 |
by (auto_tac (claset(),simpset() addsimps [hcis,hypreal_of_hypnat,
|
|
1745 |
hypnat_add,hypnat_one_def,hypreal_mult,hcomplex_mult,
|
|
1746 |
cis_real_of_nat_Suc_mult]));
|
|
1747 |
qed "hcis_hypreal_of_hypnat_Suc_mult";
|
|
1748 |
|
|
1749 |
Goal "(hcis a) hcpow n = hcis (hypreal_of_hypnat n * a)";
|
|
1750 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
1751 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
|
|
1752 |
by (auto_tac (claset(),simpset() addsimps [hcis,hypreal_of_hypnat,
|
|
1753 |
hypreal_mult,hcpow,DeMoivre]));
|
|
1754 |
qed "NSDeMoivre_ext";
|
|
1755 |
|
|
1756 |
Goalw [hrcis_def]
|
|
1757 |
"(hrcis r a) ^ n = hrcis (r ^ n) (hypreal_of_nat n * a)";
|
|
1758 |
by (auto_tac (claset(),simpset() addsimps [hcomplexpow_mult,
|
|
1759 |
NSDeMoivre,hcomplex_of_hypreal_pow]));
|
|
1760 |
qed "DeMoivre2";
|
|
1761 |
|
|
1762 |
Goalw [hrcis_def]
|
|
1763 |
"(hrcis r a) hcpow n = hrcis (r pow n) (hypreal_of_hypnat n * a)";
|
|
1764 |
by (auto_tac (claset(),simpset() addsimps [hcpow_mult,
|
|
1765 |
NSDeMoivre_ext,hcomplex_of_hypreal_hyperpow]));
|
|
1766 |
qed "DeMoivre2_ext";
|
|
1767 |
|
|
1768 |
Goal "inverse(hcis a) = hcis (-a)";
|
|
1769 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
1770 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_inverse,hcis,hypreal_minus]));
|
|
1771 |
qed "hcis_inverse";
|
|
1772 |
Addsimps [hcis_inverse];
|
|
1773 |
|
|
1774 |
Goal "inverse(hrcis r a) = hrcis (inverse r) (-a)";
|
|
1775 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
1776 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
|
|
1777 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_inverse,hrcis,hypreal_minus,
|
|
1778 |
hypreal_inverse,rcis_inverse]));
|
|
1779 |
by (Ultra_tac 1);
|
|
1780 |
by (rewtac real_divide_def);
|
|
1781 |
by (auto_tac (claset(),simpset() addsimps [INVERSE_ZERO]));
|
|
1782 |
qed "hrcis_inverse";
|
|
1783 |
|
|
1784 |
Goal "hRe(hcis a) = ( *f* cos) a";
|
|
1785 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
1786 |
by (auto_tac (claset(),simpset() addsimps [hcis,starfun,hRe]));
|
|
1787 |
qed "hRe_hcis";
|
|
1788 |
Addsimps [hRe_hcis];
|
|
1789 |
|
|
1790 |
Goal "hIm(hcis a) = ( *f* sin) a";
|
|
1791 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
1792 |
by (auto_tac (claset(),simpset() addsimps [hcis,starfun,hIm]));
|
|
1793 |
qed "hIm_hcis";
|
|
1794 |
Addsimps [hIm_hcis];
|
|
1795 |
|
|
1796 |
Goal "( *f* cos) (hypreal_of_nat n * a) = hRe(hcis a ^ n)";
|
|
1797 |
by (auto_tac (claset(),simpset() addsimps [NSDeMoivre]));
|
|
1798 |
qed "cos_n_hRe_hcis_pow_n";
|
|
1799 |
|
|
1800 |
Goal "( *f* sin) (hypreal_of_nat n * a) = hIm(hcis a ^ n)";
|
|
1801 |
by (auto_tac (claset(),simpset() addsimps [NSDeMoivre]));
|
|
1802 |
qed "sin_n_hIm_hcis_pow_n";
|
|
1803 |
|
|
1804 |
Goal "( *f* cos) (hypreal_of_hypnat n * a) = hRe(hcis a hcpow n)";
|
|
1805 |
by (auto_tac (claset(),simpset() addsimps [NSDeMoivre_ext]));
|
|
1806 |
qed "cos_n_hRe_hcis_hcpow_n";
|
|
1807 |
|
|
1808 |
Goal "( *f* sin) (hypreal_of_hypnat n * a) = hIm(hcis a hcpow n)";
|
|
1809 |
by (auto_tac (claset(),simpset() addsimps [NSDeMoivre_ext]));
|
|
1810 |
qed "sin_n_hIm_hcis_hcpow_n";
|
|
1811 |
|
|
1812 |
Goalw [hexpi_def] "hexpi(a + b) = hexpi(a) * hexpi(b)";
|
|
1813 |
by (res_inst_tac [("z","a")] eq_Abs_hcomplex 1);
|
|
1814 |
by (res_inst_tac [("z","b")] eq_Abs_hcomplex 1);
|
|
1815 |
by (auto_tac (claset(),simpset() addsimps [hcis,hRe,hIm,
|
|
1816 |
hcomplex_add,hcomplex_mult,hypreal_mult,starfun,
|
|
1817 |
hcomplex_of_hypreal,cis_mult RS sym,complex_Im_add,
|
|
1818 |
complex_Re_add,exp_add,complex_of_real_mult]));
|
|
1819 |
qed "hexpi_add";
|
|
1820 |
|
|
1821 |
(*----------------------------------------------------------------------------------*)
|
|
1822 |
(* hcomplex_of_complex preserves field and order properties *)
|
|
1823 |
(*----------------------------------------------------------------------------------*)
|
|
1824 |
|
|
1825 |
Goalw [hcomplex_of_complex_def]
|
|
1826 |
"hcomplex_of_complex (z1 + z2) = hcomplex_of_complex z1 + hcomplex_of_complex z2";
|
|
1827 |
by (simp_tac (simpset() addsimps [hcomplex_add]) 1);
|
|
1828 |
qed "hcomplex_of_complex_add";
|
|
1829 |
Addsimps [hcomplex_of_complex_add];
|
|
1830 |
|
|
1831 |
Goalw [hcomplex_of_complex_def]
|
|
1832 |
"hcomplex_of_complex (z1 * z2) = hcomplex_of_complex z1 * hcomplex_of_complex z2";
|
|
1833 |
by (simp_tac (simpset() addsimps [hcomplex_mult]) 1);
|
|
1834 |
qed "hcomplex_of_complex_mult";
|
|
1835 |
Addsimps [hcomplex_of_complex_mult];
|
|
1836 |
|
|
1837 |
Goalw [hcomplex_of_complex_def]
|
|
1838 |
"(hcomplex_of_complex z1 = hcomplex_of_complex z2) = (z1 = z2)";
|
|
1839 |
by Auto_tac;
|
|
1840 |
qed "hcomplex_of_complex_eq_iff";
|
|
1841 |
Addsimps [hcomplex_of_complex_eq_iff];
|
|
1842 |
|
|
1843 |
Goalw [hcomplex_of_complex_def] "hcomplex_of_complex (-r) = - hcomplex_of_complex r";
|
|
1844 |
by (auto_tac (claset(),simpset() addsimps [hcomplex_minus]));
|
|
1845 |
qed "hcomplex_of_complex_minus";
|
|
1846 |
Addsimps [hcomplex_of_complex_minus];
|
|
1847 |
|
|
1848 |
Goalw [hcomplex_of_complex_def,hcomplex_one_def]
|
|
1849 |
"hcomplex_of_complex 1 = 1";
|
|
1850 |
by Auto_tac;
|
|
1851 |
qed "hcomplex_of_complex_one";
|
|
1852 |
|
|
1853 |
Goalw [hcomplex_of_complex_def,hcomplex_zero_def]
|
|
1854 |
"hcomplex_of_complex 0 = 0";
|
|
1855 |
by (Simp_tac 1);
|
|
1856 |
qed "hcomplex_of_complex_zero";
|
|
1857 |
|
|
1858 |
Goal "(hcomplex_of_complex r = 0) = (r = 0)";
|
|
1859 |
by (auto_tac (claset() addIs [FreeUltrafilterNat_P],
|
|
1860 |
simpset() addsimps [hcomplex_of_complex_def,
|
|
1861 |
hcomplex_zero_def]));
|
|
1862 |
qed "hcomplex_of_complex_zero_iff";
|
|
1863 |
|
|
1864 |
Goal "hcomplex_of_complex (inverse r) = inverse (hcomplex_of_complex r)";
|
|
1865 |
by (case_tac "r=0" 1);
|
|
1866 |
by (asm_simp_tac (simpset() addsimps [COMPLEX_INVERSE_ZERO,
|
|
1867 |
HCOMPLEX_INVERSE_ZERO, hcomplex_of_complex_zero,
|
|
1868 |
COMPLEX_DIVIDE_ZERO]) 1);
|
|
1869 |
by (res_inst_tac [("c1","hcomplex_of_complex r")]
|
|
1870 |
(hcomplex_mult_left_cancel RS iffD1) 1);
|
|
1871 |
by (stac (hcomplex_of_complex_mult RS sym) 2);
|
|
1872 |
by (auto_tac (claset(),
|
|
1873 |
simpset() addsimps [hcomplex_of_complex_one, hcomplex_of_complex_zero_iff]));
|
|
1874 |
qed "hcomplex_of_complex_inverse";
|
|
1875 |
Addsimps [hcomplex_of_complex_inverse];
|
|
1876 |
|
|
1877 |
Goal "hcomplex_of_complex (z1 / z2) = hcomplex_of_complex z1 / hcomplex_of_complex z2";
|
|
1878 |
by (simp_tac (simpset() addsimps [hcomplex_divide_def, complex_divide_def]) 1);
|
|
1879 |
qed "hcomplex_of_complex_divide";
|
|
1880 |
Addsimps [hcomplex_of_complex_divide];
|
|
1881 |
|
|
1882 |
Goalw [hcomplex_of_complex_def,hypreal_of_real_def]
|
|
1883 |
"hRe (hcomplex_of_complex z) = hypreal_of_real (Re z)";
|
|
1884 |
by (auto_tac (claset(),simpset() addsimps [hRe]));
|
|
1885 |
qed "hRe_hcomplex_of_complex";
|
|
1886 |
|
|
1887 |
Goalw [hcomplex_of_complex_def,hypreal_of_real_def]
|
|
1888 |
"hIm (hcomplex_of_complex z) = hypreal_of_real (Im z)";
|
|
1889 |
by (auto_tac (claset(),simpset() addsimps [hIm]));
|
|
1890 |
qed "hIm_hcomplex_of_complex";
|
|
1891 |
|
|
1892 |
Goalw [hypreal_of_real_def,hcomplex_of_complex_def]
|
|
1893 |
"hcmod (hcomplex_of_complex x) = hypreal_of_real (cmod x)";
|
|
1894 |
by (auto_tac (claset(),simpset() addsimps [hcmod]));
|
|
1895 |
qed "hcmod_hcomplex_of_complex";
|