132 done |
132 done |
133 |
133 |
134 lemma SComplex_hcmod_SReal: |
134 lemma SComplex_hcmod_SReal: |
135 "z \<in> SComplex ==> hcmod z \<in> Reals" |
135 "z \<in> SComplex ==> hcmod z \<in> Reals" |
136 apply (simp add: SComplex_def SReal_def) |
136 apply (simp add: SComplex_def SReal_def) |
137 apply (rule_tac z = z in eq_Abs_hcomplex) |
137 apply (rule_tac z = z in eq_Abs_star) |
138 apply (auto simp add: hcmod hypreal_of_real_def star_of_def star_n_def hcomplex_of_complex_def cmod_def) |
138 apply (auto simp add: hcmod hypreal_of_real_def star_of_def star_n_def hcomplex_of_complex_def cmod_def) |
139 apply (rule_tac x = "cmod r" in exI) |
139 apply (rule_tac x = "cmod r" in exI) |
140 apply (simp add: cmod_def, ultra) |
140 apply (simp add: cmod_def, ultra) |
141 done |
141 done |
142 |
142 |
143 lemma SComplex_zero [simp]: "0 \<in> SComplex" |
143 lemma SComplex_zero [simp]: "0 \<in> SComplex" |
144 by (simp add: SComplex_def hcomplex_of_complex_zero_iff) |
144 by (simp add: SComplex_def hcomplex_of_complex_zero_iff) |
145 |
145 |
146 lemma SComplex_one [simp]: "1 \<in> SComplex" |
146 lemma SComplex_one [simp]: "1 \<in> SComplex" |
147 by (simp add: SComplex_def hcomplex_of_complex_def hcomplex_one_def) |
147 by (simp add: SComplex_def hcomplex_of_complex_def star_of_def star_n_def hypreal_one_def) |
148 |
148 |
149 (* |
149 (* |
150 Goalw [SComplex_def,SReal_def] "hcmod z \<in> Reals ==> z \<in> SComplex" |
150 Goalw [SComplex_def,SReal_def] "hcmod z \<in> Reals ==> z \<in> SComplex" |
151 by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
151 by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
152 by (auto_tac (claset(),simpset() addsimps [hcmod,hypreal_of_real_def, |
152 by (auto_tac (claset(),simpset() addsimps [hcmod,hypreal_of_real_def, |
657 lemma capprox_unique_complex: |
657 lemma capprox_unique_complex: |
658 "[| r \<in> SComplex; s \<in> SComplex; r @c= x; s @c= x|] ==> r = s" |
658 "[| r \<in> SComplex; s \<in> SComplex; r @c= x; s @c= x|] ==> r = s" |
659 by (blast intro: SComplex_capprox_iff [THEN iffD1] capprox_trans2) |
659 by (blast intro: SComplex_capprox_iff [THEN iffD1] capprox_trans2) |
660 |
660 |
661 lemma hcomplex_capproxD1: |
661 lemma hcomplex_capproxD1: |
662 "Abs_hcomplex(hcomplexrel ``{%n. X n}) @c= Abs_hcomplex(hcomplexrel``{%n. Y n}) |
662 "Abs_star(starrel ``{%n. X n}) @c= Abs_star(starrel``{%n. Y n}) |
663 ==> Abs_star(starrel `` {%n. Re(X n)}) @= |
663 ==> Abs_star(starrel `` {%n. Re(X n)}) @= |
664 Abs_star(starrel `` {%n. Re(Y n)})" |
664 Abs_star(starrel `` {%n. Re(Y n)})" |
665 apply (auto simp add: approx_FreeUltrafilterNat_iff) |
665 apply (auto simp add: approx_FreeUltrafilterNat_iff) |
666 apply (drule capprox_minus_iff [THEN iffD1]) |
666 apply (drule capprox_minus_iff [THEN iffD1]) |
667 apply (auto simp add: hcomplex_minus hcomplex_add mem_cinfmal_iff [symmetric] CInfinitesimal_hcmod_iff hcmod Infinitesimal_FreeUltrafilterNat_iff2) |
667 apply (auto simp add: hcomplex_minus hcomplex_add mem_cinfmal_iff [symmetric] CInfinitesimal_hcmod_iff hcmod Infinitesimal_FreeUltrafilterNat_iff2) |
697 lemma hcomplex_capproxI: |
697 lemma hcomplex_capproxI: |
698 "[| Abs_star(starrel `` {%n. Re(X n)}) @= |
698 "[| Abs_star(starrel `` {%n. Re(X n)}) @= |
699 Abs_star(starrel `` {%n. Re(Y n)}); |
699 Abs_star(starrel `` {%n. Re(Y n)}); |
700 Abs_star(starrel `` {%n. Im(X n)}) @= |
700 Abs_star(starrel `` {%n. Im(X n)}) @= |
701 Abs_star(starrel `` {%n. Im(Y n)}) |
701 Abs_star(starrel `` {%n. Im(Y n)}) |
702 |] ==> Abs_hcomplex(hcomplexrel ``{%n. X n}) @c= Abs_hcomplex(hcomplexrel``{%n. Y n})" |
702 |] ==> Abs_star(starrel ``{%n. X n}) @c= Abs_star(starrel``{%n. Y n})" |
703 apply (drule approx_minus_iff [THEN iffD1]) |
703 apply (drule approx_minus_iff [THEN iffD1]) |
704 apply (drule approx_minus_iff [THEN iffD1]) |
704 apply (drule approx_minus_iff [THEN iffD1]) |
705 apply (rule capprox_minus_iff [THEN iffD2]) |
705 apply (rule capprox_minus_iff [THEN iffD2]) |
706 apply (auto simp add: mem_cinfmal_iff [symmetric] mem_infmal_iff [symmetric] hypreal_minus hypreal_add hcomplex_minus hcomplex_add CInfinitesimal_hcmod_iff hcmod Infinitesimal_FreeUltrafilterNat_iff) |
706 apply (auto simp add: mem_cinfmal_iff [symmetric] mem_infmal_iff [symmetric] hypreal_minus hypreal_add hcomplex_minus hcomplex_add CInfinitesimal_hcmod_iff hcmod Infinitesimal_FreeUltrafilterNat_iff) |
707 apply (rule bexI, rule_tac [2] lemma_starrel_refl, auto) |
707 apply (rule bexI, rule_tac [2] lemma_starrel_refl, auto) |
729 apply (rule_tac z=x in eq_Abs_star, rule_tac z=z in eq_Abs_star) |
729 apply (rule_tac z=x in eq_Abs_star, rule_tac z=z in eq_Abs_star) |
730 apply (simp add: hcomplex_of_hypreal capprox_approx_iff) |
730 apply (simp add: hcomplex_of_hypreal capprox_approx_iff) |
731 done |
731 done |
732 |
732 |
733 lemma CFinite_HFinite_Re: |
733 lemma CFinite_HFinite_Re: |
734 "Abs_hcomplex(hcomplexrel ``{%n. X n}) \<in> CFinite |
734 "Abs_star(starrel ``{%n. X n}) \<in> CFinite |
735 ==> Abs_star(starrel `` {%n. Re(X n)}) \<in> HFinite" |
735 ==> Abs_star(starrel `` {%n. Re(X n)}) \<in> HFinite" |
736 apply (auto simp add: CFinite_hcmod_iff hcmod HFinite_FreeUltrafilterNat_iff) |
736 apply (auto simp add: CFinite_hcmod_iff hcmod HFinite_FreeUltrafilterNat_iff) |
737 apply (rule bexI, rule_tac [2] lemma_starrel_refl) |
737 apply (rule bexI, rule_tac [2] lemma_starrel_refl) |
738 apply (rule_tac x = u in exI, ultra) |
738 apply (rule_tac x = u in exI, ultra) |
739 apply (drule sym, case_tac "X x") |
739 apply (drule sym, case_tac "X x") |
776 apply (rule_tac [2] lemma_sqrt_hcomplex_capprox, auto) |
776 apply (rule_tac [2] lemma_sqrt_hcomplex_capprox, auto) |
777 apply (simp add: power2_eq_square) |
777 apply (simp add: power2_eq_square) |
778 done |
778 done |
779 |
779 |
780 lemma CFinite_HFinite_iff: |
780 lemma CFinite_HFinite_iff: |
781 "(Abs_hcomplex(hcomplexrel ``{%n. X n}) \<in> CFinite) = |
781 "(Abs_star(starrel ``{%n. X n}) \<in> CFinite) = |
782 (Abs_star(starrel `` {%n. Re(X n)}) \<in> HFinite & |
782 (Abs_star(starrel `` {%n. Re(X n)}) \<in> HFinite & |
783 Abs_star(starrel `` {%n. Im(X n)}) \<in> HFinite)" |
783 Abs_star(starrel `` {%n. Im(X n)}) \<in> HFinite)" |
784 by (blast intro: HFinite_Re_Im_CFinite CFinite_HFinite_Im CFinite_HFinite_Re) |
784 by (blast intro: HFinite_Re_Im_CFinite CFinite_HFinite_Im CFinite_HFinite_Re) |
785 |
785 |
786 lemma SComplex_Re_SReal: |
786 lemma SComplex_Re_SReal: |
787 "Abs_hcomplex(hcomplexrel ``{%n. X n}) \<in> SComplex |
787 "Abs_star(starrel ``{%n. X n}) \<in> SComplex |
788 ==> Abs_star(starrel `` {%n. Re(X n)}) \<in> Reals" |
788 ==> Abs_star(starrel `` {%n. Re(X n)}) \<in> Reals" |
789 apply (auto simp add: SComplex_def hcomplex_of_complex_def SReal_def hypreal_of_real_def star_of_def star_n_def) |
789 apply (auto simp add: SComplex_def hcomplex_of_complex_def SReal_def hypreal_of_real_def star_of_def star_n_def) |
790 apply (rule_tac x = "Re r" in exI, ultra) |
790 apply (rule_tac x = "Re r" in exI, ultra) |
791 done |
791 done |
792 |
792 |
793 lemma SComplex_Im_SReal: |
793 lemma SComplex_Im_SReal: |
794 "Abs_hcomplex(hcomplexrel ``{%n. X n}) \<in> SComplex |
794 "Abs_star(starrel ``{%n. X n}) \<in> SComplex |
795 ==> Abs_star(starrel `` {%n. Im(X n)}) \<in> Reals" |
795 ==> Abs_star(starrel `` {%n. Im(X n)}) \<in> Reals" |
796 apply (auto simp add: SComplex_def hcomplex_of_complex_def SReal_def hypreal_of_real_def star_of_def star_n_def) |
796 apply (auto simp add: SComplex_def hcomplex_of_complex_def SReal_def hypreal_of_real_def star_of_def star_n_def) |
797 apply (rule_tac x = "Im r" in exI, ultra) |
797 apply (rule_tac x = "Im r" in exI, ultra) |
798 done |
798 done |
799 |
799 |
800 lemma Reals_Re_Im_SComplex: |
800 lemma Reals_Re_Im_SComplex: |
801 "[| Abs_star(starrel `` {%n. Re(X n)}) \<in> Reals; |
801 "[| Abs_star(starrel `` {%n. Re(X n)}) \<in> Reals; |
802 Abs_star(starrel `` {%n. Im(X n)}) \<in> Reals |
802 Abs_star(starrel `` {%n. Im(X n)}) \<in> Reals |
803 |] ==> Abs_hcomplex(hcomplexrel ``{%n. X n}) \<in> SComplex" |
803 |] ==> Abs_star(starrel ``{%n. X n}) \<in> SComplex" |
804 apply (auto simp add: SComplex_def hcomplex_of_complex_def SReal_def hypreal_of_real_def star_of_def star_n_def) |
804 apply (auto simp add: SComplex_def hcomplex_of_complex_def SReal_def hypreal_of_real_def star_of_def star_n_def) |
805 apply (rule_tac x = "Complex r ra" in exI, ultra) |
805 apply (rule_tac x = "Complex r ra" in exI, ultra) |
806 done |
806 done |
807 |
807 |
808 lemma SComplex_SReal_iff: |
808 lemma SComplex_SReal_iff: |
809 "(Abs_hcomplex(hcomplexrel ``{%n. X n}) \<in> SComplex) = |
809 "(Abs_star(starrel ``{%n. X n}) \<in> SComplex) = |
810 (Abs_star(starrel `` {%n. Re(X n)}) \<in> Reals & |
810 (Abs_star(starrel `` {%n. Re(X n)}) \<in> Reals & |
811 Abs_star(starrel `` {%n. Im(X n)}) \<in> Reals)" |
811 Abs_star(starrel `` {%n. Im(X n)}) \<in> Reals)" |
812 by (blast intro: SComplex_Re_SReal SComplex_Im_SReal Reals_Re_Im_SComplex) |
812 by (blast intro: SComplex_Re_SReal SComplex_Im_SReal Reals_Re_Im_SComplex) |
813 |
813 |
814 lemma CInfinitesimal_Infinitesimal_iff: |
814 lemma CInfinitesimal_Infinitesimal_iff: |
815 "(Abs_hcomplex(hcomplexrel ``{%n. X n}) \<in> CInfinitesimal) = |
815 "(Abs_star(starrel ``{%n. X n}) \<in> CInfinitesimal) = |
816 (Abs_star(starrel `` {%n. Re(X n)}) \<in> Infinitesimal & |
816 (Abs_star(starrel `` {%n. Re(X n)}) \<in> Infinitesimal & |
817 Abs_star(starrel `` {%n. Im(X n)}) \<in> Infinitesimal)" |
817 Abs_star(starrel `` {%n. Im(X n)}) \<in> Infinitesimal)" |
818 by (simp add: mem_cinfmal_iff mem_infmal_iff hcomplex_zero_num hypreal_zero_num capprox_approx_iff) |
818 by (simp add: mem_cinfmal_iff mem_infmal_iff hcomplex_zero_num hypreal_zero_num capprox_approx_iff) |
819 |
819 |
820 lemma eq_Abs_hcomplex_EX: |
820 lemma eq_Abs_star_EX: |
821 "(\<exists>t. P t) = (\<exists>X. P (Abs_hcomplex(hcomplexrel `` {X})))" |
821 "(\<exists>t. P t) = (\<exists>X. P (Abs_star(starrel `` {X})))" |
822 apply auto |
822 apply auto |
823 apply (rule_tac z = t in eq_Abs_hcomplex, auto) |
823 apply (rule_tac z = t in eq_Abs_star, auto) |
824 done |
824 done |
825 |
825 |
826 lemma eq_Abs_hcomplex_Bex: |
826 lemma eq_Abs_star_Bex: |
827 "(\<exists>t \<in> A. P t) = (\<exists>X. (Abs_hcomplex(hcomplexrel `` {X})) \<in> A & |
827 "(\<exists>t \<in> A. P t) = (\<exists>X. (Abs_star(starrel `` {X})) \<in> A & |
828 P (Abs_hcomplex(hcomplexrel `` {X})))" |
828 P (Abs_star(starrel `` {X})))" |
829 apply auto |
829 apply auto |
830 apply (rule_tac z = t in eq_Abs_hcomplex, auto) |
830 apply (rule_tac z = t in eq_Abs_star, auto) |
831 done |
831 done |
832 |
832 |
833 (* Here we go - easy proof now!! *) |
833 (* Here we go - easy proof now!! *) |
834 lemma stc_part_Ex: "x:CFinite ==> \<exists>t \<in> SComplex. x @c= t" |
834 lemma stc_part_Ex: "x:CFinite ==> \<exists>t \<in> SComplex. x @c= t" |
835 apply (rule_tac z = x in eq_Abs_hcomplex) |
835 apply (rule_tac z = x in eq_Abs_star) |
836 apply (auto simp add: CFinite_HFinite_iff eq_Abs_hcomplex_Bex SComplex_SReal_iff capprox_approx_iff) |
836 apply (auto simp add: CFinite_HFinite_iff eq_Abs_star_Bex SComplex_SReal_iff capprox_approx_iff) |
837 apply (drule st_part_Ex, safe)+ |
837 apply (drule st_part_Ex, safe)+ |
838 apply (rule_tac z = t in eq_Abs_star) |
838 apply (rule_tac z = t in eq_Abs_star) |
839 apply (rule_tac z = ta in eq_Abs_star, auto) |
839 apply (rule_tac z = ta in eq_Abs_star, auto) |
840 apply (rule_tac x = "%n. Complex (xa n) (xb n) " in exI) |
840 apply (rule_tac x = "%n. Complex (xa n) (xb n) " in exI) |
841 apply auto |
841 apply auto |
1382 val SComplex_Re_SReal = thm "SComplex_Re_SReal"; |
1382 val SComplex_Re_SReal = thm "SComplex_Re_SReal"; |
1383 val SComplex_Im_SReal = thm "SComplex_Im_SReal"; |
1383 val SComplex_Im_SReal = thm "SComplex_Im_SReal"; |
1384 val Reals_Re_Im_SComplex = thm "Reals_Re_Im_SComplex"; |
1384 val Reals_Re_Im_SComplex = thm "Reals_Re_Im_SComplex"; |
1385 val SComplex_SReal_iff = thm "SComplex_SReal_iff"; |
1385 val SComplex_SReal_iff = thm "SComplex_SReal_iff"; |
1386 val CInfinitesimal_Infinitesimal_iff = thm "CInfinitesimal_Infinitesimal_iff"; |
1386 val CInfinitesimal_Infinitesimal_iff = thm "CInfinitesimal_Infinitesimal_iff"; |
1387 val eq_Abs_hcomplex_Bex = thm "eq_Abs_hcomplex_Bex"; |
1387 val eq_Abs_star_Bex = thm "eq_Abs_star_Bex"; |
1388 val stc_part_Ex = thm "stc_part_Ex"; |
1388 val stc_part_Ex = thm "stc_part_Ex"; |
1389 val stc_part_Ex1 = thm "stc_part_Ex1"; |
1389 val stc_part_Ex1 = thm "stc_part_Ex1"; |
1390 val CFinite_Int_CInfinite_empty = thm "CFinite_Int_CInfinite_empty"; |
1390 val CFinite_Int_CInfinite_empty = thm "CFinite_Int_CInfinite_empty"; |
1391 val CFinite_not_CInfinite = thm "CFinite_not_CInfinite"; |
1391 val CFinite_not_CInfinite = thm "CFinite_not_CInfinite"; |
1392 val not_CFinite_CInfinite = thm "not_CFinite_CInfinite"; |
1392 val not_CFinite_CInfinite = thm "not_CFinite_CInfinite"; |