70 |
70 |
71 lemma HFinite_hcmod_hcomplex_of_complex [simp]: |
71 lemma HFinite_hcmod_hcomplex_of_complex [simp]: |
72 "hcmod (hcomplex_of_complex r) \<in> HFinite" |
72 "hcmod (hcomplex_of_complex r) \<in> HFinite" |
73 by (auto intro!: SReal_subset_HFinite [THEN subsetD]) |
73 by (auto intro!: SReal_subset_HFinite [THEN subsetD]) |
74 |
74 |
75 lemma HFinite_hcmod_iff: "(x \<in> HFinite) = (hcmod x \<in> HFinite)" |
75 lemma HFinite_hcmod_iff [simp]: "hcmod x \<in> HFinite \<longleftrightarrow> x \<in> HFinite" |
76 by (simp add: HFinite_def) |
76 by (simp add: HFinite_def) |
77 |
77 |
78 lemma HFinite_bounded_hcmod: |
78 lemma HFinite_bounded_hcmod: |
79 "\<lbrakk>x \<in> HFinite; y \<le> hcmod x; 0 \<le> y\<rbrakk> \<Longrightarrow> y \<in> HFinite" |
79 "\<lbrakk>x \<in> HFinite; y \<le> hcmod x; 0 \<le> y\<rbrakk> \<Longrightarrow> y \<in> HFinite" |
80 by (auto intro: HFinite_bounded simp add: HFinite_hcmod_iff) |
80 using HFinite_bounded HFinite_hcmod_iff by blast |
81 |
81 |
82 |
82 |
83 subsection\<open>The Complex Infinitesimals form a Subring\<close> |
83 subsection\<open>The Complex Infinitesimals form a Subring\<close> |
84 |
84 |
85 lemma Infinitesimal_hcmod_iff: |
85 lemma Infinitesimal_hcmod_iff: |
89 lemma HInfinite_hcmod_iff: "(z \<in> HInfinite) = (hcmod z \<in> HInfinite)" |
89 lemma HInfinite_hcmod_iff: "(z \<in> HInfinite) = (hcmod z \<in> HInfinite)" |
90 by (simp add: HInfinite_def) |
90 by (simp add: HInfinite_def) |
91 |
91 |
92 lemma HFinite_diff_Infinitesimal_hcmod: |
92 lemma HFinite_diff_Infinitesimal_hcmod: |
93 "x \<in> HFinite - Infinitesimal \<Longrightarrow> hcmod x \<in> HFinite - Infinitesimal" |
93 "x \<in> HFinite - Infinitesimal \<Longrightarrow> hcmod x \<in> HFinite - Infinitesimal" |
94 by (simp add: HFinite_hcmod_iff Infinitesimal_hcmod_iff) |
94 by (simp add: Infinitesimal_hcmod_iff) |
95 |
95 |
96 lemma hcmod_less_Infinitesimal: |
96 lemma hcmod_less_Infinitesimal: |
97 "\<lbrakk>e \<in> Infinitesimal; hcmod x < hcmod e\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal" |
97 "\<lbrakk>e \<in> Infinitesimal; hcmod x < hcmod e\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal" |
98 by (auto elim: hrabs_less_Infinitesimal simp add: Infinitesimal_hcmod_iff) |
98 by (auto elim: hrabs_less_Infinitesimal simp add: Infinitesimal_hcmod_iff) |
99 |
99 |
191 |
191 |
192 lemma Infinitesimal_hIm: "x \<in> Infinitesimal \<Longrightarrow> hIm x \<in> Infinitesimal" |
192 lemma Infinitesimal_hIm: "x \<in> Infinitesimal \<Longrightarrow> hIm x \<in> Infinitesimal" |
193 using Infinitesimal_hcmod_iff abs_hIm_le_hcmod hrabs_le_Infinitesimal by blast |
193 using Infinitesimal_hcmod_iff abs_hIm_le_hcmod hrabs_le_Infinitesimal by blast |
194 |
194 |
195 lemma Infinitesimal_HComplex: |
195 lemma Infinitesimal_HComplex: |
196 "\<lbrakk>x \<in> Infinitesimal; y \<in> Infinitesimal\<rbrakk> \<Longrightarrow> HComplex x y \<in> Infinitesimal" |
196 assumes x: "x \<in> Infinitesimal" and y: "y \<in> Infinitesimal" |
197 apply (rule Infinitesimal_hcmod_iff [THEN iffD2]) |
197 shows "HComplex x y \<in> Infinitesimal" |
198 apply (simp add: hcmod_i) |
198 proof - |
199 apply (rule Infinitesimal_add) |
199 have "hcmod (HComplex 0 y) \<in> Infinitesimal" |
200 apply (erule Infinitesimal_hrealpow, simp) |
200 by (simp add: hcmod_i y) |
201 apply (erule Infinitesimal_hrealpow, simp) |
201 moreover have "hcmod (hcomplex_of_hypreal x) \<in> Infinitesimal" |
202 done |
202 using Infinitesimal_hcmod_iff Infinitesimal_of_hypreal_iff x by blast |
|
203 ultimately have "hcmod (HComplex x y) \<in> Infinitesimal" |
|
204 by (metis Infinitesimal_add Infinitesimal_hcmod_iff add.right_neutral hcomplex_of_hypreal_add_HComplex) |
|
205 then show ?thesis |
|
206 by (simp add: Infinitesimal_hnorm_iff) |
|
207 qed |
203 |
208 |
204 lemma hcomplex_Infinitesimal_iff: |
209 lemma hcomplex_Infinitesimal_iff: |
205 "(x \<in> Infinitesimal) = (hRe x \<in> Infinitesimal \<and> hIm x \<in> Infinitesimal)" |
210 "(x \<in> Infinitesimal) \<longleftrightarrow> (hRe x \<in> Infinitesimal \<and> hIm x \<in> Infinitesimal)" |
206 using Infinitesimal_HComplex Infinitesimal_hIm Infinitesimal_hRe by fastforce |
211 using Infinitesimal_HComplex Infinitesimal_hIm Infinitesimal_hRe by fastforce |
207 |
212 |
208 lemma hRe_diff [simp]: "\<And>x y. hRe (x - y) = hRe x - hRe y" |
213 lemma hRe_diff [simp]: "\<And>x y. hRe (x - y) = hRe x - hRe y" |
209 by transfer simp |
214 by transfer simp |
210 |
215 |
230 |
235 |
231 lemma HFinite_hIm: "x \<in> HFinite \<Longrightarrow> hIm x \<in> HFinite" |
236 lemma HFinite_hIm: "x \<in> HFinite \<Longrightarrow> hIm x \<in> HFinite" |
232 using HFinite_bounded_hcmod abs_ge_zero abs_hIm_le_hcmod by blast |
237 using HFinite_bounded_hcmod abs_ge_zero abs_hIm_le_hcmod by blast |
233 |
238 |
234 lemma HFinite_HComplex: |
239 lemma HFinite_HComplex: |
235 "\<lbrakk>x \<in> HFinite; y \<in> HFinite\<rbrakk> \<Longrightarrow> HComplex x y \<in> HFinite" |
240 assumes "x \<in> HFinite" "y \<in> HFinite" |
236 apply (subgoal_tac "HComplex x 0 + HComplex 0 y \<in> HFinite", simp) |
241 shows "HComplex x y \<in> HFinite" |
237 apply (rule HFinite_add) |
242 proof - |
238 apply (simp add: HFinite_hcmod_iff hcmod_i) |
243 have "HComplex x 0 \<in> HFinite" "HComplex 0 y \<in> HFinite" |
239 apply (simp add: HFinite_hcmod_iff hcmod_i) |
244 using HFinite_hcmod_iff assms hcmod_i by fastforce+ |
240 done |
245 then have "HComplex x 0 + HComplex 0 y \<in> HFinite" |
|
246 using HFinite_add by blast |
|
247 then show ?thesis |
|
248 by simp |
|
249 qed |
241 |
250 |
242 lemma hcomplex_HFinite_iff: |
251 lemma hcomplex_HFinite_iff: |
243 "(x \<in> HFinite) = (hRe x \<in> HFinite \<and> hIm x \<in> HFinite)" |
252 "(x \<in> HFinite) = (hRe x \<in> HFinite \<and> hIm x \<in> HFinite)" |
244 using HFinite_HComplex HFinite_hIm HFinite_hRe by fastforce |
253 using HFinite_HComplex HFinite_hIm HFinite_hRe by fastforce |
245 |
254 |
250 lemma hcomplex_of_hypreal_approx_iff [simp]: |
259 lemma hcomplex_of_hypreal_approx_iff [simp]: |
251 "(hcomplex_of_hypreal x \<approx> hcomplex_of_hypreal z) = (x \<approx> z)" |
260 "(hcomplex_of_hypreal x \<approx> hcomplex_of_hypreal z) = (x \<approx> z)" |
252 by (simp add: hcomplex_approx_iff) |
261 by (simp add: hcomplex_approx_iff) |
253 |
262 |
254 (* Here we go - easy proof now!! *) |
263 (* Here we go - easy proof now!! *) |
255 lemma stc_part_Ex: "x \<in> HFinite \<Longrightarrow> \<exists>t \<in> SComplex. x \<approx> t" |
264 lemma stc_part_Ex: |
256 apply (simp add: hcomplex_HFinite_iff hcomplex_approx_iff) |
265 assumes "x \<in> HFinite" |
257 apply (rule_tac x="HComplex (st (hRe x)) (st (hIm x))" in bexI) |
266 shows "\<exists>t \<in> SComplex. x \<approx> t" |
258 apply (simp add: st_approx_self [THEN approx_sym]) |
267 proof - |
259 apply (simp add: Standard_HComplex st_SReal [unfolded Reals_eq_Standard]) |
268 let ?t = "HComplex (st (hRe x)) (st (hIm x))" |
260 done |
269 have "?t \<in> SComplex" |
|
270 using HFinite_hIm HFinite_hRe Reals_eq_Standard assms st_SReal by auto |
|
271 moreover have "x \<approx> ?t" |
|
272 by (simp add: HFinite_hIm HFinite_hRe assms hcomplex_approx_iff st_HFinite st_eq_approx) |
|
273 ultimately show ?thesis .. |
|
274 qed |
261 |
275 |
262 lemma stc_part_Ex1: "x \<in> HFinite \<Longrightarrow> \<exists>!t. t \<in> SComplex \<and> x \<approx> t" |
276 lemma stc_part_Ex1: "x \<in> HFinite \<Longrightarrow> \<exists>!t. t \<in> SComplex \<and> x \<approx> t" |
263 using approx_sym approx_unique_complex stc_part_Ex by blast |
277 using approx_sym approx_unique_complex stc_part_Ex by blast |
264 |
278 |
265 |
279 |
340 lemma stc_not_Infinitesimal: "stc(x) \<noteq> 0 \<Longrightarrow> x \<notin> Infinitesimal" |
354 lemma stc_not_Infinitesimal: "stc(x) \<noteq> 0 \<Longrightarrow> x \<notin> Infinitesimal" |
341 by (fast intro: stc_Infinitesimal) |
355 by (fast intro: stc_Infinitesimal) |
342 |
356 |
343 lemma stc_inverse: |
357 lemma stc_inverse: |
344 "\<lbrakk>x \<in> HFinite; stc x \<noteq> 0\<rbrakk> \<Longrightarrow> stc(inverse x) = inverse (stc x)" |
358 "\<lbrakk>x \<in> HFinite; stc x \<noteq> 0\<rbrakk> \<Longrightarrow> stc(inverse x) = inverse (stc x)" |
345 apply (drule stc_not_Infinitesimal) |
359 by (simp add: stc_unique stc_SComplex stc_approx_self approx_inverse stc_not_Infinitesimal) |
346 apply (simp add: stc_unique stc_SComplex stc_approx_self approx_inverse) |
|
347 done |
|
348 |
360 |
349 lemma stc_divide [simp]: |
361 lemma stc_divide [simp]: |
350 "\<lbrakk>x \<in> HFinite; y \<in> HFinite; stc y \<noteq> 0\<rbrakk> |
362 "\<lbrakk>x \<in> HFinite; y \<in> HFinite; stc y \<noteq> 0\<rbrakk> |
351 \<Longrightarrow> stc(x/y) = (stc x) / (stc y)" |
363 \<Longrightarrow> stc(x/y) = (stc x) / (stc y)" |
352 by (simp add: divide_inverse stc_mult stc_not_Infinitesimal HFinite_inverse stc_inverse) |
364 by (simp add: divide_inverse stc_mult stc_not_Infinitesimal HFinite_inverse stc_inverse) |
362 "x \<in> \<real> \<Longrightarrow> hcomplex_of_hypreal x \<in> SComplex" |
374 "x \<in> \<real> \<Longrightarrow> hcomplex_of_hypreal x \<in> SComplex" |
363 by (simp add: Reals_eq_Standard) |
375 by (simp add: Reals_eq_Standard) |
364 |
376 |
365 lemma stc_hcomplex_of_hypreal: |
377 lemma stc_hcomplex_of_hypreal: |
366 "z \<in> HFinite \<Longrightarrow> stc(hcomplex_of_hypreal z) = hcomplex_of_hypreal (st z)" |
378 "z \<in> HFinite \<Longrightarrow> stc(hcomplex_of_hypreal z) = hcomplex_of_hypreal (st z)" |
367 apply (rule stc_unique) |
379 by (simp add: SComplex_SReal_hcomplex_of_hypreal st_SReal st_approx_self stc_unique) |
368 apply (rule SComplex_SReal_hcomplex_of_hypreal) |
380 |
369 apply (erule st_SReal) |
381 lemma hmod_stc_eq: |
370 apply (simp add: hcomplex_of_hypreal_approx_iff st_approx_self) |
382 assumes "x \<in> HFinite" |
371 done |
383 shows "hcmod(stc x) = st(hcmod x)" |
372 |
384 by (metis SReal_hcmod_SComplex approx_HFinite approx_hnorm assms st_unique stc_SComplex_eq stc_eq_approx_iff stc_part_Ex) |
373 (* |
|
374 Goal "x \<in> HFinite \<Longrightarrow> hcmod(stc x) = st(hcmod x)" |
|
375 by (dtac stc_approx_self 1) |
|
376 by (auto_tac (claset(),simpset() addsimps [bex_Infinitesimal_iff2 RS sym])); |
|
377 |
|
378 |
|
379 approx_hcmod_add_hcmod |
|
380 *) |
|
381 |
385 |
382 lemma Infinitesimal_hcnj_iff [simp]: |
386 lemma Infinitesimal_hcnj_iff [simp]: |
383 "(hcnj z \<in> Infinitesimal) = (z \<in> Infinitesimal)" |
387 "(hcnj z \<in> Infinitesimal) \<longleftrightarrow> (z \<in> Infinitesimal)" |
384 by (simp add: Infinitesimal_hcmod_iff) |
388 by (simp add: Infinitesimal_hcmod_iff) |
385 |
|
386 lemma Infinitesimal_hcomplex_of_hypreal_epsilon [simp]: |
|
387 "hcomplex_of_hypreal \<epsilon> \<in> Infinitesimal" |
|
388 by (simp add: Infinitesimal_hcmod_iff) |
|
389 |
389 |
390 end |
390 end |