817 apply (rule complex_eqI) |
817 apply (rule complex_eqI) |
818 using t False ReIm |
818 using t False ReIm |
819 apply (auto simp: exp_Euler sin_of_real cos_of_real divide_simps) |
819 apply (auto simp: exp_Euler sin_of_real cos_of_real divide_simps) |
820 done |
820 done |
821 show ?thesis |
821 show ?thesis |
822 apply (simp add: Arg_def False) |
822 apply (simp add: Arg2pi_def False) |
823 apply (rule theI [where a=t]) |
823 apply (rule theI [where a=t]) |
824 using t z False |
824 using t z False |
825 apply (auto intro: Arg_unique_lemma) |
825 apply (auto intro: Arg2pi_unique_lemma) |
826 done |
826 done |
827 qed |
827 qed |
828 |
828 |
829 corollary |
829 corollary |
830 shows Arg_ge_0: "0 \<le> Arg z" |
830 shows Arg2pi_ge_0: "0 \<le> Arg2pi z" |
831 and Arg_lt_2pi: "Arg z < 2*pi" |
831 and Arg2pi_lt_2pi: "Arg2pi z < 2*pi" |
832 and Arg_eq: "z = of_real(norm z) * exp(\<i> * of_real(Arg z))" |
832 and Arg2pi_eq: "z = of_real(norm z) * exp(\<i> * of_real(Arg2pi z))" |
833 using Arg by auto |
833 using Arg2pi by auto |
834 |
834 |
835 lemma complex_norm_eq_1_exp: "norm z = 1 \<longleftrightarrow> exp(\<i> * of_real (Arg z)) = z" |
835 lemma complex_norm_eq_1_exp: "norm z = 1 \<longleftrightarrow> exp(\<i> * of_real (Arg2pi z)) = z" |
836 by (metis Arg_eq cis_conv_exp mult.left_neutral norm_cis of_real_1) |
836 by (metis Arg2pi_eq cis_conv_exp mult.left_neutral norm_cis of_real_1) |
837 |
837 |
838 lemma Arg_unique: "\<lbrakk>of_real r * exp(\<i> * of_real a) = z; 0 < r; 0 \<le> a; a < 2*pi\<rbrakk> \<Longrightarrow> Arg z = a" |
838 lemma Arg2pi_unique: "\<lbrakk>of_real r * exp(\<i> * of_real a) = z; 0 < r; 0 \<le> a; a < 2*pi\<rbrakk> \<Longrightarrow> Arg2pi z = a" |
839 by (rule Arg_unique_lemma [OF _ Arg_eq]) |
839 by (rule Arg2pi_unique_lemma [OF _ Arg2pi_eq]) |
840 (use Arg [of z] in \<open>auto simp: norm_mult\<close>) |
840 (use Arg2pi [of z] in \<open>auto simp: norm_mult\<close>) |
841 |
841 |
842 lemma Arg_minus: "z \<noteq> 0 \<Longrightarrow> Arg (-z) = (if Arg z < pi then Arg z + pi else Arg z - pi)" |
842 lemma Arg2pi_minus: "z \<noteq> 0 \<Longrightarrow> Arg2pi (-z) = (if Arg2pi z < pi then Arg2pi z + pi else Arg2pi z - pi)" |
843 apply (rule Arg_unique [of "norm z"]) |
843 apply (rule Arg2pi_unique [of "norm z"]) |
844 apply (rule complex_eqI) |
844 apply (rule complex_eqI) |
845 using Arg_ge_0 [of z] Arg_eq [of z] Arg_lt_2pi [of z] |
845 using Arg2pi_ge_0 [of z] Arg2pi_eq [of z] Arg2pi_lt_2pi [of z] |
846 apply (auto simp: Re_exp Im_exp cos_diff sin_diff cis_conv_exp [symmetric]) |
846 apply (auto simp: Re_exp Im_exp cos_diff sin_diff cis_conv_exp [symmetric]) |
847 apply (metis Re_rcis Im_rcis rcis_def)+ |
847 apply (metis Re_rcis Im_rcis rcis_def)+ |
848 done |
848 done |
849 |
849 |
850 lemma Arg_times_of_real [simp]: |
850 lemma Arg2pi_times_of_real [simp]: |
851 assumes "0 < r" shows "Arg (of_real r * z) = Arg z" |
851 assumes "0 < r" shows "Arg2pi (of_real r * z) = Arg2pi z" |
852 proof (cases "z=0") |
852 proof (cases "z=0") |
853 case False |
853 case False |
854 show ?thesis |
854 show ?thesis |
855 by (rule Arg_unique [of "r * norm z"]) (use Arg False assms in auto) |
855 by (rule Arg2pi_unique [of "r * norm z"]) (use Arg2pi False assms in auto) |
856 qed auto |
856 qed auto |
857 |
857 |
858 lemma Arg_times_of_real2 [simp]: "0 < r \<Longrightarrow> Arg (z * of_real r) = Arg z" |
858 lemma Arg2pi_times_of_real2 [simp]: "0 < r \<Longrightarrow> Arg2pi (z * of_real r) = Arg2pi z" |
859 by (metis Arg_times_of_real mult.commute) |
859 by (metis Arg2pi_times_of_real mult.commute) |
860 |
860 |
861 lemma Arg_divide_of_real [simp]: "0 < r \<Longrightarrow> Arg (z / of_real r) = Arg z" |
861 lemma Arg2pi_divide_of_real [simp]: "0 < r \<Longrightarrow> Arg2pi (z / of_real r) = Arg2pi z" |
862 by (metis Arg_times_of_real2 less_numeral_extra(3) nonzero_eq_divide_eq of_real_eq_0_iff) |
862 by (metis Arg2pi_times_of_real2 less_numeral_extra(3) nonzero_eq_divide_eq of_real_eq_0_iff) |
863 |
863 |
864 lemma Arg_le_pi: "Arg z \<le> pi \<longleftrightarrow> 0 \<le> Im z" |
864 lemma Arg2pi_le_pi: "Arg2pi z \<le> pi \<longleftrightarrow> 0 \<le> Im z" |
865 proof (cases "z=0") |
865 proof (cases "z=0") |
866 case False |
866 case False |
867 have "0 \<le> Im z \<longleftrightarrow> 0 \<le> Im (of_real (cmod z) * exp (\<i> * complex_of_real (Arg z)))" |
867 have "0 \<le> Im z \<longleftrightarrow> 0 \<le> Im (of_real (cmod z) * exp (\<i> * complex_of_real (Arg2pi z)))" |
868 by (metis Arg_eq) |
868 by (metis Arg2pi_eq) |
869 also have "... = (0 \<le> Im (exp (\<i> * complex_of_real (Arg z))))" |
869 also have "... = (0 \<le> Im (exp (\<i> * complex_of_real (Arg2pi z))))" |
870 using False by (simp add: zero_le_mult_iff) |
870 using False by (simp add: zero_le_mult_iff) |
871 also have "... \<longleftrightarrow> Arg z \<le> pi" |
871 also have "... \<longleftrightarrow> Arg2pi z \<le> pi" |
872 by (simp add: Im_exp) (metis Arg_ge_0 Arg_lt_2pi sin_lt_zero sin_ge_zero not_le) |
872 by (simp add: Im_exp) (metis Arg2pi_ge_0 Arg2pi_lt_2pi sin_lt_zero sin_ge_zero not_le) |
873 finally show ?thesis |
873 finally show ?thesis |
874 by blast |
874 by blast |
875 qed auto |
875 qed auto |
876 |
876 |
877 lemma Arg_lt_pi: "0 < Arg z \<and> Arg z < pi \<longleftrightarrow> 0 < Im z" |
877 lemma Arg2pi_lt_pi: "0 < Arg2pi z \<and> Arg2pi z < pi \<longleftrightarrow> 0 < Im z" |
878 proof (cases "z=0") |
878 proof (cases "z=0") |
879 case False |
879 case False |
880 have "0 < Im z \<longleftrightarrow> 0 < Im (of_real (cmod z) * exp (\<i> * complex_of_real (Arg z)))" |
880 have "0 < Im z \<longleftrightarrow> 0 < Im (of_real (cmod z) * exp (\<i> * complex_of_real (Arg2pi z)))" |
881 by (metis Arg_eq) |
881 by (metis Arg2pi_eq) |
882 also have "... = (0 < Im (exp (\<i> * complex_of_real (Arg z))))" |
882 also have "... = (0 < Im (exp (\<i> * complex_of_real (Arg2pi z))))" |
883 using False by (simp add: zero_less_mult_iff) |
883 using False by (simp add: zero_less_mult_iff) |
884 also have "... \<longleftrightarrow> 0 < Arg z \<and> Arg z < pi" |
884 also have "... \<longleftrightarrow> 0 < Arg2pi z \<and> Arg2pi z < pi" |
885 using Arg_ge_0 Arg_lt_2pi sin_le_zero sin_gt_zero |
885 using Arg2pi_ge_0 Arg2pi_lt_2pi sin_le_zero sin_gt_zero |
886 apply (auto simp: Im_exp) |
886 apply (auto simp: Im_exp) |
887 using le_less apply fastforce |
887 using le_less apply fastforce |
888 using not_le by blast |
888 using not_le by blast |
889 finally show ?thesis |
889 finally show ?thesis |
890 by blast |
890 by blast |
891 qed auto |
891 qed auto |
892 |
892 |
893 lemma Arg_eq_0: "Arg z = 0 \<longleftrightarrow> z \<in> \<real> \<and> 0 \<le> Re z" |
893 lemma Arg2pi_eq_0: "Arg2pi z = 0 \<longleftrightarrow> z \<in> \<real> \<and> 0 \<le> Re z" |
894 proof (cases "z=0") |
894 proof (cases "z=0") |
895 case False |
895 case False |
896 have "z \<in> \<real> \<and> 0 \<le> Re z \<longleftrightarrow> z \<in> \<real> \<and> 0 \<le> Re (of_real (cmod z) * exp (\<i> * complex_of_real (Arg z)))" |
896 have "z \<in> \<real> \<and> 0 \<le> Re z \<longleftrightarrow> z \<in> \<real> \<and> 0 \<le> Re (of_real (cmod z) * exp (\<i> * complex_of_real (Arg2pi z)))" |
897 by (metis Arg_eq) |
897 by (metis Arg2pi_eq) |
898 also have "... \<longleftrightarrow> z \<in> \<real> \<and> 0 \<le> Re (exp (\<i> * complex_of_real (Arg z)))" |
898 also have "... \<longleftrightarrow> z \<in> \<real> \<and> 0 \<le> Re (exp (\<i> * complex_of_real (Arg2pi z)))" |
899 using False by (simp add: zero_le_mult_iff) |
899 using False by (simp add: zero_le_mult_iff) |
900 also have "... \<longleftrightarrow> Arg z = 0" |
900 also have "... \<longleftrightarrow> Arg2pi z = 0" |
901 proof - |
901 proof - |
902 have [simp]: "Arg z = 0 \<Longrightarrow> z \<in> \<real>" |
902 have [simp]: "Arg2pi z = 0 \<Longrightarrow> z \<in> \<real>" |
903 using Arg_eq [of z] by (auto simp: Reals_def) |
903 using Arg2pi_eq [of z] by (auto simp: Reals_def) |
904 moreover have "\<lbrakk>z \<in> \<real>; 0 \<le> cos (Arg z)\<rbrakk> \<Longrightarrow> Arg z = 0" |
904 moreover have "\<lbrakk>z \<in> \<real>; 0 \<le> cos (Arg2pi z)\<rbrakk> \<Longrightarrow> Arg2pi z = 0" |
905 by (metis Arg_lt_pi Arg_ge_0 Arg_le_pi cos_pi complex_is_Real_iff leD less_linear less_minus_one_simps(2) minus_minus neg_less_eq_nonneg order_refl) |
905 by (metis Arg2pi_lt_pi Arg2pi_ge_0 Arg2pi_le_pi cos_pi complex_is_Real_iff leD less_linear less_minus_one_simps(2) minus_minus neg_less_eq_nonneg order_refl) |
906 ultimately show ?thesis |
906 ultimately show ?thesis |
907 by (auto simp: Re_exp) |
907 by (auto simp: Re_exp) |
908 qed |
908 qed |
909 finally show ?thesis |
909 finally show ?thesis |
910 by blast |
910 by blast |
911 qed auto |
911 qed auto |
912 |
912 |
913 corollary Arg_gt_0: |
913 corollary Arg2pi_gt_0: |
914 assumes "z \<in> \<real> \<Longrightarrow> Re z < 0" |
914 assumes "z \<in> \<real> \<Longrightarrow> Re z < 0" |
915 shows "Arg z > 0" |
915 shows "Arg2pi z > 0" |
916 using Arg_eq_0 Arg_ge_0 assms dual_order.strict_iff_order by fastforce |
916 using Arg2pi_eq_0 Arg2pi_ge_0 assms dual_order.strict_iff_order by fastforce |
917 |
917 |
918 lemma Arg_of_real: "Arg(of_real x) = 0 \<longleftrightarrow> 0 \<le> x" |
918 lemma Arg2pi_of_real: "Arg2pi(of_real x) = 0 \<longleftrightarrow> 0 \<le> x" |
919 by (simp add: Arg_eq_0) |
919 by (simp add: Arg2pi_eq_0) |
920 |
920 |
921 lemma Arg_eq_pi: "Arg z = pi \<longleftrightarrow> z \<in> \<real> \<and> Re z < 0" |
921 lemma Arg2pi_eq_pi: "Arg2pi z = pi \<longleftrightarrow> z \<in> \<real> \<and> Re z < 0" |
922 using Arg_eq_0 [of "-z"] |
922 using Arg2pi_eq_0 [of "-z"] |
923 by (metis Arg_eq_0 Arg_gt_0 Arg_le_pi Arg_lt_pi complex_is_Real_iff dual_order.order_iff_strict not_less pi_neq_zero) |
923 by (metis Arg2pi_eq_0 Arg2pi_gt_0 Arg2pi_le_pi Arg2pi_lt_pi complex_is_Real_iff dual_order.order_iff_strict not_less pi_neq_zero) |
924 |
924 |
925 lemma Arg_eq_0_pi: "Arg z = 0 \<or> Arg z = pi \<longleftrightarrow> z \<in> \<real>" |
925 lemma Arg2pi_eq_0_pi: "Arg2pi z = 0 \<or> Arg2pi z = pi \<longleftrightarrow> z \<in> \<real>" |
926 using Arg_eq_0 Arg_eq_pi not_le by auto |
926 using Arg2pi_eq_0 Arg2pi_eq_pi not_le by auto |
927 |
927 |
928 lemma Arg_inverse: "Arg(inverse z) = (if z \<in> \<real> \<and> 0 \<le> Re z then Arg z else 2*pi - Arg z)" |
928 lemma Arg2pi_inverse: "Arg2pi(inverse z) = (if z \<in> \<real> \<and> 0 \<le> Re z then Arg2pi z else 2*pi - Arg2pi z)" |
929 proof (cases "z=0") |
929 proof (cases "z=0") |
930 case False |
930 case False |
931 show ?thesis |
931 show ?thesis |
932 apply (rule Arg_unique [of "inverse (norm z)"]) |
932 apply (rule Arg2pi_unique [of "inverse (norm z)"]) |
933 using False Arg_ge_0 [of z] Arg_lt_2pi [of z] Arg_eq [of z] Arg_eq_0 [of z] |
933 using False Arg2pi_ge_0 [of z] Arg2pi_lt_2pi [of z] Arg2pi_eq [of z] Arg2pi_eq_0 [of z] |
934 apply (auto simp: exp_diff field_simps) |
934 apply (auto simp: exp_diff field_simps) |
935 done |
935 done |
936 qed auto |
936 qed auto |
937 |
937 |
938 lemma Arg_eq_iff: |
938 lemma Arg2pi_eq_iff: |
939 assumes "w \<noteq> 0" "z \<noteq> 0" |
939 assumes "w \<noteq> 0" "z \<noteq> 0" |
940 shows "Arg w = Arg z \<longleftrightarrow> (\<exists>x. 0 < x & w = of_real x * z)" |
940 shows "Arg2pi w = Arg2pi z \<longleftrightarrow> (\<exists>x. 0 < x & w = of_real x * z)" |
941 using assms Arg_eq [of z] Arg_eq [of w] |
941 using assms Arg2pi_eq [of z] Arg2pi_eq [of w] |
942 apply auto |
942 apply auto |
943 apply (rule_tac x="norm w / norm z" in exI) |
943 apply (rule_tac x="norm w / norm z" in exI) |
944 apply (simp add: divide_simps) |
944 apply (simp add: divide_simps) |
945 by (metis mult.commute mult.left_commute) |
945 by (metis mult.commute mult.left_commute) |
946 |
946 |
947 lemma Arg_inverse_eq_0: "Arg(inverse z) = 0 \<longleftrightarrow> Arg z = 0" |
947 lemma Arg2pi_inverse_eq_0: "Arg2pi(inverse z) = 0 \<longleftrightarrow> Arg2pi z = 0" |
948 by (metis Arg_eq_0 Arg_inverse inverse_inverse_eq) |
948 by (metis Arg2pi_eq_0 Arg2pi_inverse inverse_inverse_eq) |
949 |
949 |
950 lemma Arg_divide: |
950 lemma Arg2pi_divide: |
951 assumes "w \<noteq> 0" "z \<noteq> 0" "Arg w \<le> Arg z" |
951 assumes "w \<noteq> 0" "z \<noteq> 0" "Arg2pi w \<le> Arg2pi z" |
952 shows "Arg(z / w) = Arg z - Arg w" |
952 shows "Arg2pi(z / w) = Arg2pi z - Arg2pi w" |
953 apply (rule Arg_unique [of "norm(z / w)"]) |
953 apply (rule Arg2pi_unique [of "norm(z / w)"]) |
954 using assms Arg_eq Arg_ge_0 [of w] Arg_lt_2pi [of z] |
954 using assms Arg2pi_eq Arg2pi_ge_0 [of w] Arg2pi_lt_2pi [of z] |
955 apply (auto simp: exp_diff norm_divide field_simps) |
955 apply (auto simp: exp_diff norm_divide field_simps) |
956 done |
956 done |
957 |
957 |
958 lemma Arg_le_div_sum: |
958 lemma Arg2pi_le_div_sum: |
959 assumes "w \<noteq> 0" "z \<noteq> 0" "Arg w \<le> Arg z" |
959 assumes "w \<noteq> 0" "z \<noteq> 0" "Arg2pi w \<le> Arg2pi z" |
960 shows "Arg z = Arg w + Arg(z / w)" |
960 shows "Arg2pi z = Arg2pi w + Arg2pi(z / w)" |
961 by (simp add: Arg_divide assms) |
961 by (simp add: Arg2pi_divide assms) |
962 |
962 |
963 lemma Arg_le_div_sum_eq: |
963 lemma Arg2pi_le_div_sum_eq: |
964 assumes "w \<noteq> 0" "z \<noteq> 0" |
964 assumes "w \<noteq> 0" "z \<noteq> 0" |
965 shows "Arg w \<le> Arg z \<longleftrightarrow> Arg z = Arg w + Arg(z / w)" |
965 shows "Arg2pi w \<le> Arg2pi z \<longleftrightarrow> Arg2pi z = Arg2pi w + Arg2pi(z / w)" |
966 using assms by (auto simp: Arg_ge_0 intro: Arg_le_div_sum) |
966 using assms by (auto simp: Arg2pi_ge_0 intro: Arg2pi_le_div_sum) |
967 |
967 |
968 lemma Arg_diff: |
968 lemma Arg2pi_diff: |
969 assumes "w \<noteq> 0" "z \<noteq> 0" |
969 assumes "w \<noteq> 0" "z \<noteq> 0" |
970 shows "Arg w - Arg z = (if Arg z \<le> Arg w then Arg(w / z) else Arg(w/z) - 2*pi)" |
970 shows "Arg2pi w - Arg2pi z = (if Arg2pi z \<le> Arg2pi w then Arg2pi(w / z) else Arg2pi(w/z) - 2*pi)" |
971 using assms Arg_divide Arg_inverse [of "w/z"] |
971 using assms Arg2pi_divide Arg2pi_inverse [of "w/z"] |
972 apply (clarsimp simp add: Arg_ge_0 Arg_divide not_le) |
972 apply (clarsimp simp add: Arg2pi_ge_0 Arg2pi_divide not_le) |
973 by (metis Arg_eq_0 less_irrefl minus_diff_eq right_minus_eq) |
973 by (metis Arg2pi_eq_0 less_irrefl minus_diff_eq right_minus_eq) |
974 |
974 |
975 lemma Arg_add: |
975 lemma Arg2pi_add: |
976 assumes "w \<noteq> 0" "z \<noteq> 0" |
976 assumes "w \<noteq> 0" "z \<noteq> 0" |
977 shows "Arg w + Arg z = (if Arg w + Arg z < 2*pi then Arg(w * z) else Arg(w * z) + 2*pi)" |
977 shows "Arg2pi w + Arg2pi z = (if Arg2pi w + Arg2pi z < 2*pi then Arg2pi(w * z) else Arg2pi(w * z) + 2*pi)" |
978 using assms Arg_diff [of "w*z" z] Arg_le_div_sum_eq [of z "w*z"] |
978 using assms Arg2pi_diff [of "w*z" z] Arg2pi_le_div_sum_eq [of z "w*z"] |
979 apply (auto simp: Arg_ge_0 Arg_divide not_le) |
979 apply (auto simp: Arg2pi_ge_0 Arg2pi_divide not_le) |
980 apply (metis Arg_lt_2pi add.commute) |
980 apply (metis Arg2pi_lt_2pi add.commute) |
981 apply (metis (no_types) Arg add.commute diff_0 diff_add_cancel diff_less_eq diff_minus_eq_add not_less) |
981 apply (metis (no_types) Arg2pi add.commute diff_0 diff_add_cancel diff_less_eq diff_minus_eq_add not_less) |
982 done |
982 done |
983 |
983 |
984 lemma Arg_times: |
984 lemma Arg2pi_times: |
985 assumes "w \<noteq> 0" "z \<noteq> 0" |
985 assumes "w \<noteq> 0" "z \<noteq> 0" |
986 shows "Arg (w * z) = (if Arg w + Arg z < 2*pi then Arg w + Arg z |
986 shows "Arg2pi (w * z) = (if Arg2pi w + Arg2pi z < 2*pi then Arg2pi w + Arg2pi z |
987 else (Arg w + Arg z) - 2*pi)" |
987 else (Arg2pi w + Arg2pi z) - 2*pi)" |
988 using Arg_add [OF assms] |
988 using Arg2pi_add [OF assms] |
989 by auto |
989 by auto |
990 |
990 |
991 lemma Arg_cnj_eq_inverse: "z\<noteq>0 \<Longrightarrow> Arg (cnj z) = Arg (inverse z)" |
991 lemma Arg2pi_cnj_eq_inverse: "z\<noteq>0 \<Longrightarrow> Arg2pi (cnj z) = Arg2pi (inverse z)" |
992 apply (simp add: Arg_eq_iff divide_simps complex_norm_square [symmetric] mult.commute) |
992 apply (simp add: Arg2pi_eq_iff divide_simps complex_norm_square [symmetric] mult.commute) |
993 by (metis of_real_power zero_less_norm_iff zero_less_power) |
993 by (metis of_real_power zero_less_norm_iff zero_less_power) |
994 |
994 |
995 lemma Arg_cnj: "Arg(cnj z) = (if z \<in> \<real> \<and> 0 \<le> Re z then Arg z else 2*pi - Arg z)" |
995 lemma Arg2pi_cnj: "Arg2pi(cnj z) = (if z \<in> \<real> \<and> 0 \<le> Re z then Arg2pi z else 2*pi - Arg2pi z)" |
996 proof (cases "z=0") |
996 proof (cases "z=0") |
997 case False |
997 case False |
998 then show ?thesis |
998 then show ?thesis |
999 by (simp add: Arg_cnj_eq_inverse Arg_inverse) |
999 by (simp add: Arg2pi_cnj_eq_inverse Arg2pi_inverse) |
1000 qed auto |
1000 qed auto |
1001 |
1001 |
1002 lemma Arg_real: "z \<in> \<real> \<Longrightarrow> Arg z = (if 0 \<le> Re z then 0 else pi)" |
1002 lemma Arg2pi_real: "z \<in> \<real> \<Longrightarrow> Arg2pi z = (if 0 \<le> Re z then 0 else pi)" |
1003 using Arg_eq_0 Arg_eq_0_pi by auto |
1003 using Arg2pi_eq_0 Arg2pi_eq_0_pi by auto |
1004 |
1004 |
1005 lemma Arg_exp: "0 \<le> Im z \<Longrightarrow> Im z < 2*pi \<Longrightarrow> Arg(exp z) = Im z" |
1005 lemma Arg2pi_exp: "0 \<le> Im z \<Longrightarrow> Im z < 2*pi \<Longrightarrow> Arg2pi(exp z) = Im z" |
1006 by (rule Arg_unique [of "exp(Re z)"]) (auto simp: exp_eq_polar) |
1006 by (rule Arg2pi_unique [of "exp(Re z)"]) (auto simp: exp_eq_polar) |
1007 |
1007 |
1008 lemma complex_split_polar: |
1008 lemma complex_split_polar: |
1009 obtains r a::real where "z = complex_of_real r * (cos a + \<i> * sin a)" "0 \<le> r" "0 \<le> a" "a < 2*pi" |
1009 obtains r a::real where "z = complex_of_real r * (cos a + \<i> * sin a)" "0 \<le> r" "0 \<le> a" "a < 2*pi" |
1010 using Arg cis.ctr cis_conv_exp unfolding Complex_eq by fastforce |
1010 using Arg2pi cis.ctr cis_conv_exp unfolding Complex_eq by fastforce |
1011 |
1011 |
1012 lemma Re_Im_le_cmod: "Im w * sin \<phi> + Re w * cos \<phi> \<le> cmod w" |
1012 lemma Re_Im_le_cmod: "Im w * sin \<phi> + Re w * cos \<phi> \<le> cmod w" |
1013 proof (cases w rule: complex_split_polar) |
1013 proof (cases w rule: complex_split_polar) |
1014 case (1 r a) with sin_cos_le1 [of a \<phi>] show ?thesis |
1014 case (1 r a) with sin_cos_le1 [of a \<phi>] show ?thesis |
1015 apply (simp add: norm_mult cmod_unit_one) |
1015 apply (simp add: norm_mult cmod_unit_one) |
1527 assumes [measurable]: "f \<in> measurable M borel" "g \<in> measurable M borel" |
1527 assumes [measurable]: "f \<in> measurable M borel" "g \<in> measurable M borel" |
1528 shows "(\<lambda>x. f x powr g x :: complex) \<in> measurable M borel" |
1528 shows "(\<lambda>x. f x powr g x :: complex) \<in> measurable M borel" |
1529 using assms by (simp add: powr_def) |
1529 using assms by (simp add: powr_def) |
1530 |
1530 |
1531 |
1531 |
1532 subsection\<open>Relation between Ln and Arg, and hence continuity of Arg\<close> |
1532 subsection\<open>Relation between Ln and Arg2pi, and hence continuity of Arg2pi\<close> |
1533 |
1533 |
1534 lemma Arg_Ln: |
1534 lemma Arg2pi_Ln: |
1535 assumes "0 < Arg z" shows "Arg z = Im(Ln(-z)) + pi" |
1535 assumes "0 < Arg2pi z" shows "Arg2pi z = Im(Ln(-z)) + pi" |
1536 proof (cases "z = 0") |
1536 proof (cases "z = 0") |
1537 case True |
1537 case True |
1538 with assms show ?thesis |
1538 with assms show ?thesis |
1539 by simp |
1539 by simp |
1540 next |
1540 next |
1541 case False |
1541 case False |
1542 then have "z / of_real(norm z) = exp(\<i> * of_real(Arg z))" |
1542 then have "z / of_real(norm z) = exp(\<i> * of_real(Arg2pi z))" |
1543 using Arg [of z] |
1543 using Arg2pi [of z] |
1544 by (metis abs_norm_cancel nonzero_mult_div_cancel_left norm_of_real zero_less_norm_iff) |
1544 by (metis abs_norm_cancel nonzero_mult_div_cancel_left norm_of_real zero_less_norm_iff) |
1545 then have "- z / of_real(norm z) = exp (\<i> * (of_real (Arg z) - pi))" |
1545 then have "- z / of_real(norm z) = exp (\<i> * (of_real (Arg2pi z) - pi))" |
1546 using cis_conv_exp cis_pi |
1546 using cis_conv_exp cis_pi |
1547 by (auto simp: exp_diff algebra_simps) |
1547 by (auto simp: exp_diff algebra_simps) |
1548 then have "ln (- z / of_real(norm z)) = ln (exp (\<i> * (of_real (Arg z) - pi)))" |
1548 then have "ln (- z / of_real(norm z)) = ln (exp (\<i> * (of_real (Arg2pi z) - pi)))" |
1549 by simp |
1549 by simp |
1550 also have "... = \<i> * (of_real(Arg z) - pi)" |
1550 also have "... = \<i> * (of_real(Arg2pi z) - pi)" |
1551 using Arg [of z] assms pi_not_less_zero |
1551 using Arg2pi [of z] assms pi_not_less_zero |
1552 by auto |
1552 by auto |
1553 finally have "Arg z = Im (Ln (- z / of_real (cmod z))) + pi" |
1553 finally have "Arg2pi z = Im (Ln (- z / of_real (cmod z))) + pi" |
1554 by simp |
1554 by simp |
1555 also have "... = Im (Ln (-z) - ln (cmod z)) + pi" |
1555 also have "... = Im (Ln (-z) - ln (cmod z)) + pi" |
1556 by (metis diff_0_right minus_diff_eq zero_less_norm_iff Ln_divide_of_real False) |
1556 by (metis diff_0_right minus_diff_eq zero_less_norm_iff Ln_divide_of_real False) |
1557 also have "... = Im (Ln (-z)) + pi" |
1557 also have "... = Im (Ln (-z)) + pi" |
1558 by simp |
1558 by simp |
1559 finally show ?thesis . |
1559 finally show ?thesis . |
1560 qed |
1560 qed |
1561 |
1561 |
1562 lemma continuous_at_Arg: |
1562 lemma continuous_at_Arg2pi: |
1563 assumes "z \<notin> \<real>\<^sub>\<ge>\<^sub>0" |
1563 assumes "z \<notin> \<real>\<^sub>\<ge>\<^sub>0" |
1564 shows "continuous (at z) Arg" |
1564 shows "continuous (at z) Arg2pi" |
1565 proof - |
1565 proof - |
1566 have *: "isCont (\<lambda>z. Im (Ln (- z)) + pi) z" |
1566 have *: "isCont (\<lambda>z. Im (Ln (- z)) + pi) z" |
1567 by (rule Complex.isCont_Im isCont_Ln' continuous_intros | simp add: assms complex_is_Real_iff)+ |
1567 by (rule Complex.isCont_Im isCont_Ln' continuous_intros | simp add: assms complex_is_Real_iff)+ |
1568 have [simp]: "\<And>x. \<lbrakk>Im x \<noteq> 0\<rbrakk> \<Longrightarrow> Im (Ln (- x)) + pi = Arg x" |
1568 have [simp]: "\<And>x. \<lbrakk>Im x \<noteq> 0\<rbrakk> \<Longrightarrow> Im (Ln (- x)) + pi = Arg2pi x" |
1569 using Arg_Ln Arg_gt_0 complex_is_Real_iff by auto |
1569 using Arg2pi_Ln Arg2pi_gt_0 complex_is_Real_iff by auto |
1570 consider "Re z < 0" | "Im z \<noteq> 0" using assms |
1570 consider "Re z < 0" | "Im z \<noteq> 0" using assms |
1571 using complex_nonneg_Reals_iff not_le by blast |
1571 using complex_nonneg_Reals_iff not_le by blast |
1572 then have [simp]: "(\<lambda>z. Im (Ln (- z)) + pi) \<midarrow>z\<rightarrow> Arg z" |
1572 then have [simp]: "(\<lambda>z. Im (Ln (- z)) + pi) \<midarrow>z\<rightarrow> Arg2pi z" |
1573 using "*" by (simp add: isCont_def) (metis Arg_Ln Arg_gt_0 complex_is_Real_iff) |
1573 using "*" by (simp add: isCont_def) (metis Arg2pi_Ln Arg2pi_gt_0 complex_is_Real_iff) |
1574 show ?thesis |
1574 show ?thesis |
1575 unfolding continuous_at |
1575 unfolding continuous_at |
1576 proof (rule Lim_transform_within_open) |
1576 proof (rule Lim_transform_within_open) |
1577 show "\<And>x. \<lbrakk>x \<in> - \<real>\<^sub>\<ge>\<^sub>0; x \<noteq> z\<rbrakk> \<Longrightarrow> Im (Ln (- x)) + pi = Arg x" |
1577 show "\<And>x. \<lbrakk>x \<in> - \<real>\<^sub>\<ge>\<^sub>0; x \<noteq> z\<rbrakk> \<Longrightarrow> Im (Ln (- x)) + pi = Arg2pi x" |
1578 by (auto simp add: Arg_Ln [OF Arg_gt_0] complex_nonneg_Reals_iff) |
1578 by (auto simp add: Arg2pi_Ln [OF Arg2pi_gt_0] complex_nonneg_Reals_iff) |
1579 qed (use assms in auto) |
1579 qed (use assms in auto) |
1580 qed |
1580 qed |
1581 |
1581 |
1582 lemma Ln_series: |
1582 lemma Ln_series: |
1583 fixes z :: complex |
1583 fixes z :: complex |
1676 also have "norm z^2 * ... = norm z^2 / (1 - norm z)" by (simp add: divide_inverse) |
1676 also have "norm z^2 * ... = norm z^2 / (1 - norm z)" by (simp add: divide_inverse) |
1677 finally show ?thesis . |
1677 finally show ?thesis . |
1678 qed |
1678 qed |
1679 |
1679 |
1680 |
1680 |
1681 text\<open>Relation between Arg and arctangent in upper halfplane\<close> |
1681 text\<open>Relation between Arg2pi and arctangent in upper halfplane\<close> |
1682 lemma Arg_arctan_upperhalf: |
1682 lemma Arg2pi_arctan_upperhalf: |
1683 assumes "0 < Im z" |
1683 assumes "0 < Im z" |
1684 shows "Arg z = pi/2 - arctan(Re z / Im z)" |
1684 shows "Arg2pi z = pi/2 - arctan(Re z / Im z)" |
1685 proof (cases "z = 0") |
1685 proof (cases "z = 0") |
1686 case False |
1686 case False |
1687 show ?thesis |
1687 show ?thesis |
1688 proof (rule Arg_unique [of "norm z"]) |
1688 proof (rule Arg2pi_unique [of "norm z"]) |
1689 show "(cmod z) * exp (\<i> * (pi / 2 - arctan (Re z / Im z))) = z" |
1689 show "(cmod z) * exp (\<i> * (pi / 2 - arctan (Re z / Im z))) = z" |
1690 apply (auto simp: exp_Euler cos_diff sin_diff) |
1690 apply (auto simp: exp_Euler cos_diff sin_diff) |
1691 using assms norm_complex_def [of z, symmetric] |
1691 using assms norm_complex_def [of z, symmetric] |
1692 apply (simp add: sin_of_real cos_of_real sin_arctan cos_arctan field_simps real_sqrt_divide) |
1692 apply (simp add: sin_of_real cos_of_real sin_arctan cos_arctan field_simps real_sqrt_divide) |
1693 apply (metis complex_eq) |
1693 apply (metis complex_eq) |
1694 done |
1694 done |
1695 qed (use False arctan [of "Re z / Im z"] in auto) |
1695 qed (use False arctan [of "Re z / Im z"] in auto) |
1696 qed (use assms in auto) |
1696 qed (use assms in auto) |
1697 |
1697 |
1698 lemma Arg_eq_Im_Ln: |
1698 lemma Arg2pi_eq_Im_Ln: |
1699 assumes "0 \<le> Im z" "0 < Re z" |
1699 assumes "0 \<le> Im z" "0 < Re z" |
1700 shows "Arg z = Im (Ln z)" |
1700 shows "Arg2pi z = Im (Ln z)" |
1701 proof (cases "Im z = 0") |
1701 proof (cases "Im z = 0") |
1702 case True then show ?thesis |
1702 case True then show ?thesis |
1703 using Arg_eq_0 Ln_in_Reals assms(2) complex_is_Real_iff by auto |
1703 using Arg2pi_eq_0 Ln_in_Reals assms(2) complex_is_Real_iff by auto |
1704 next |
1704 next |
1705 case False |
1705 case False |
1706 then have *: "Arg z > 0" |
1706 then have *: "Arg2pi z > 0" |
1707 using Arg_gt_0 complex_is_Real_iff by blast |
1707 using Arg2pi_gt_0 complex_is_Real_iff by blast |
1708 then have "z \<noteq> 0" |
1708 then have "z \<noteq> 0" |
1709 by auto |
1709 by auto |
1710 with * assms False show ?thesis |
1710 with * assms False show ?thesis |
1711 by (subst Arg_Ln) (auto simp: Ln_minus) |
1711 by (subst Arg2pi_Ln) (auto simp: Ln_minus) |
1712 qed |
1712 qed |
1713 |
1713 |
1714 lemma continuous_within_upperhalf_Arg: |
1714 lemma continuous_within_upperhalf_Arg2pi: |
1715 assumes "z \<noteq> 0" |
1715 assumes "z \<noteq> 0" |
1716 shows "continuous (at z within {z. 0 \<le> Im z}) Arg" |
1716 shows "continuous (at z within {z. 0 \<le> Im z}) Arg2pi" |
1717 proof (cases "z \<in> \<real>\<^sub>\<ge>\<^sub>0") |
1717 proof (cases "z \<in> \<real>\<^sub>\<ge>\<^sub>0") |
1718 case False then show ?thesis |
1718 case False then show ?thesis |
1719 using continuous_at_Arg continuous_at_imp_continuous_within by auto |
1719 using continuous_at_Arg2pi continuous_at_imp_continuous_within by auto |
1720 next |
1720 next |
1721 case True |
1721 case True |
1722 then have z: "z \<in> \<real>" "0 < Re z" |
1722 then have z: "z \<in> \<real>" "0 < Re z" |
1723 using assms by (auto simp: complex_nonneg_Reals_iff complex_is_Real_iff complex_neq_0) |
1723 using assms by (auto simp: complex_nonneg_Reals_iff complex_is_Real_iff complex_neq_0) |
1724 then have [simp]: "Arg z = 0" "Im (Ln z) = 0" |
1724 then have [simp]: "Arg2pi z = 0" "Im (Ln z) = 0" |
1725 by (auto simp: Arg_eq_0 Im_Ln_eq_0 assms complex_is_Real_iff) |
1725 by (auto simp: Arg2pi_eq_0 Im_Ln_eq_0 assms complex_is_Real_iff) |
1726 show ?thesis |
1726 show ?thesis |
1727 proof (clarsimp simp add: continuous_within Lim_within dist_norm) |
1727 proof (clarsimp simp add: continuous_within Lim_within dist_norm) |
1728 fix e::real |
1728 fix e::real |
1729 assume "0 < e" |
1729 assume "0 < e" |
1730 moreover have "continuous (at z) (\<lambda>x. Im (Ln x))" |
1730 moreover have "continuous (at z) (\<lambda>x. Im (Ln x))" |
1737 then have "\<bar>Re x - Re z\<bar> < Re z / 2" |
1737 then have "\<bar>Re x - Re z\<bar> < Re z / 2" |
1738 by (metis le_less_trans abs_Re_le_cmod minus_complex.simps(1)) |
1738 by (metis le_less_trans abs_Re_le_cmod minus_complex.simps(1)) |
1739 then have "0 < Re x" |
1739 then have "0 < Re x" |
1740 using z by linarith |
1740 using z by linarith |
1741 } |
1741 } |
1742 then show "\<exists>d>0. \<forall>x. 0 \<le> Im x \<longrightarrow> x \<noteq> z \<and> cmod (x - z) < d \<longrightarrow> \<bar>Arg x\<bar> < e" |
1742 then show "\<exists>d>0. \<forall>x. 0 \<le> Im x \<longrightarrow> x \<noteq> z \<and> cmod (x - z) < d \<longrightarrow> \<bar>Arg2pi x\<bar> < e" |
1743 apply (rule_tac x="min d (Re z / 2)" in exI) |
1743 apply (rule_tac x="min d (Re z / 2)" in exI) |
1744 using z d |
1744 using z d |
1745 apply (auto simp: Arg_eq_Im_Ln) |
1745 apply (auto simp: Arg2pi_eq_Im_Ln) |
1746 done |
1746 done |
1747 qed |
1747 qed |
1748 qed |
1748 qed |
1749 |
1749 |
1750 lemma continuous_on_upperhalf_Arg: "continuous_on ({z. 0 \<le> Im z} - {0}) Arg" |
1750 lemma continuous_on_upperhalf_Arg2pi: "continuous_on ({z. 0 \<le> Im z} - {0}) Arg2pi" |
1751 unfolding continuous_on_eq_continuous_within |
1751 unfolding continuous_on_eq_continuous_within |
1752 by (metis DiffE Diff_subset continuous_within_subset continuous_within_upperhalf_Arg insertCI) |
1752 by (metis DiffE Diff_subset continuous_within_subset continuous_within_upperhalf_Arg2pi insertCI) |
1753 |
1753 |
1754 lemma open_Arg_less_Int: |
1754 lemma open_Arg2pi2pi_less_Int: |
1755 assumes "0 \<le> s" "t \<le> 2*pi" |
1755 assumes "0 \<le> s" "t \<le> 2*pi" |
1756 shows "open ({y. s < Arg y} \<inter> {y. Arg y < t})" |
1756 shows "open ({y. s < Arg2pi y} \<inter> {y. Arg2pi y < t})" |
1757 proof - |
1757 proof - |
1758 have 1: "continuous_on (UNIV - \<real>\<^sub>\<ge>\<^sub>0) Arg" |
1758 have 1: "continuous_on (UNIV - \<real>\<^sub>\<ge>\<^sub>0) Arg2pi" |
1759 using continuous_at_Arg continuous_at_imp_continuous_within |
1759 using continuous_at_Arg2pi continuous_at_imp_continuous_within |
1760 by (auto simp: continuous_on_eq_continuous_within) |
1760 by (auto simp: continuous_on_eq_continuous_within) |
1761 have 2: "open (UNIV - \<real>\<^sub>\<ge>\<^sub>0 :: complex set)" by (simp add: open_Diff) |
1761 have 2: "open (UNIV - \<real>\<^sub>\<ge>\<^sub>0 :: complex set)" by (simp add: open_Diff) |
1762 have "open ({z. s < z} \<inter> {z. z < t})" |
1762 have "open ({z. s < z} \<inter> {z. z < t})" |
1763 using open_lessThan [of t] open_greaterThan [of s] |
1763 using open_lessThan [of t] open_greaterThan [of s] |
1764 by (metis greaterThan_def lessThan_def open_Int) |
1764 by (metis greaterThan_def lessThan_def open_Int) |
1765 moreover have "{y. s < Arg y} \<inter> {y. Arg y < t} \<subseteq> - \<real>\<^sub>\<ge>\<^sub>0" |
1765 moreover have "{y. s < Arg2pi y} \<inter> {y. Arg2pi y < t} \<subseteq> - \<real>\<^sub>\<ge>\<^sub>0" |
1766 using assms by (auto simp: Arg_real complex_nonneg_Reals_iff complex_is_Real_iff) |
1766 using assms by (auto simp: Arg2pi_real complex_nonneg_Reals_iff complex_is_Real_iff) |
1767 ultimately show ?thesis |
1767 ultimately show ?thesis |
1768 using continuous_imp_open_vimage [OF 1 2, of "{z. Re z > s} \<inter> {z. Re z < t}"] |
1768 using continuous_imp_open_vimage [OF 1 2, of "{z. Re z > s} \<inter> {z. Re z < t}"] |
1769 by auto |
1769 by auto |
1770 qed |
1770 qed |
1771 |
1771 |
1772 lemma open_Arg_gt: "open {z. t < Arg z}" |
1772 lemma open_Arg2pi2pi_gt: "open {z. t < Arg2pi z}" |
1773 proof (cases "t < 0") |
1773 proof (cases "t < 0") |
1774 case True then have "{z. t < Arg z} = UNIV" |
1774 case True then have "{z. t < Arg2pi z} = UNIV" |
1775 using Arg_ge_0 less_le_trans by auto |
1775 using Arg2pi_ge_0 less_le_trans by auto |
1776 then show ?thesis |
1776 then show ?thesis |
1777 by simp |
1777 by simp |
1778 next |
1778 next |
1779 case False then show ?thesis |
1779 case False then show ?thesis |
1780 using open_Arg_less_Int [of t "2*pi"] Arg_lt_2pi |
1780 using open_Arg2pi2pi_less_Int [of t "2*pi"] Arg2pi_lt_2pi |
1781 by auto |
1781 by auto |
1782 qed |
1782 qed |
1783 |
1783 |
1784 lemma closed_Arg_le: "closed {z. Arg z \<le> t}" |
1784 lemma closed_Arg2pi2pi_le: "closed {z. Arg2pi z \<le> t}" |
1785 using open_Arg_gt [of t] |
1785 using open_Arg2pi2pi_gt [of t] |
1786 by (simp add: closed_def Set.Collect_neg_eq [symmetric] not_le) |
1786 by (simp add: closed_def Set.Collect_neg_eq [symmetric] not_le) |
1787 |
1787 |
1788 subsection\<open>Complex Powers\<close> |
1788 subsection\<open>Complex Powers\<close> |
1789 |
1789 |
1790 lemma powr_to_1 [simp]: "z powr 1 = (z::complex)" |
1790 lemma powr_to_1 [simp]: "z powr 1 = (z::complex)" |
3680 qed |
3680 qed |
3681 |
3681 |
3682 lemma homotopic_loops_imp_homotopic_circlemaps: |
3682 lemma homotopic_loops_imp_homotopic_circlemaps: |
3683 assumes "homotopic_loops S p q" |
3683 assumes "homotopic_loops S p q" |
3684 shows "homotopic_with (\<lambda>h. True) (sphere 0 1) S |
3684 shows "homotopic_with (\<lambda>h. True) (sphere 0 1) S |
3685 (p \<circ> (\<lambda>z. (Arg z / (2 * pi)))) |
3685 (p \<circ> (\<lambda>z. (Arg2pi z / (2 * pi)))) |
3686 (q \<circ> (\<lambda>z. (Arg z / (2 * pi))))" |
3686 (q \<circ> (\<lambda>z. (Arg2pi z / (2 * pi))))" |
3687 proof - |
3687 proof - |
3688 obtain h where conth: "continuous_on ({0..1::real} \<times> {0..1}) h" |
3688 obtain h where conth: "continuous_on ({0..1::real} \<times> {0..1}) h" |
3689 and him: "h ` ({0..1} \<times> {0..1}) \<subseteq> S" |
3689 and him: "h ` ({0..1} \<times> {0..1}) \<subseteq> S" |
3690 and h0: "(\<forall>x. h (0, x) = p x)" |
3690 and h0: "(\<forall>x. h (0, x) = p x)" |
3691 and h1: "(\<forall>x. h (1, x) = q x)" |
3691 and h1: "(\<forall>x. h (1, x) = q x)" |
3692 and h01: "(\<forall>t\<in>{0..1}. h (t, 1) = h (t, 0)) " |
3692 and h01: "(\<forall>t\<in>{0..1}. h (t, 1) = h (t, 0)) " |
3693 using assms |
3693 using assms |
3694 by (auto simp: homotopic_loops_def sphere_def homotopic_with_def pathstart_def pathfinish_def) |
3694 by (auto simp: homotopic_loops_def sphere_def homotopic_with_def pathstart_def pathfinish_def) |
3695 define j where "j \<equiv> \<lambda>z. if 0 \<le> Im (snd z) |
3695 define j where "j \<equiv> \<lambda>z. if 0 \<le> Im (snd z) |
3696 then h (fst z, Arg (snd z) / (2 * pi)) |
3696 then h (fst z, Arg2pi (snd z) / (2 * pi)) |
3697 else h (fst z, 1 - Arg (cnj (snd z)) / (2 * pi))" |
3697 else h (fst z, 1 - Arg2pi (cnj (snd z)) / (2 * pi))" |
3698 have Arg_eq: "1 - Arg (cnj y) / (2 * pi) = Arg y / (2 * pi) \<or> Arg y = 0 \<and> Arg (cnj y) = 0" if "cmod y = 1" for y |
3698 have Arg2pi_eq: "1 - Arg2pi (cnj y) / (2 * pi) = Arg2pi y / (2 * pi) \<or> Arg2pi y = 0 \<and> Arg2pi (cnj y) = 0" if "cmod y = 1" for y |
3699 using that Arg_eq_0_pi Arg_eq_pi by (force simp: Arg_cnj divide_simps) |
3699 using that Arg2pi_eq_0_pi Arg2pi_eq_pi by (force simp: Arg2pi_cnj divide_simps) |
3700 show ?thesis |
3700 show ?thesis |
3701 proof (simp add: homotopic_with; intro conjI ballI exI) |
3701 proof (simp add: homotopic_with; intro conjI ballI exI) |
3702 show "continuous_on ({0..1} \<times> sphere 0 1) (\<lambda>w. h (fst w, Arg (snd w) / (2 * pi)))" |
3702 show "continuous_on ({0..1} \<times> sphere 0 1) (\<lambda>w. h (fst w, Arg2pi (snd w) / (2 * pi)))" |
3703 proof (rule continuous_on_eq) |
3703 proof (rule continuous_on_eq) |
3704 show j: "j x = h (fst x, Arg (snd x) / (2 * pi))" if "x \<in> {0..1} \<times> sphere 0 1" for x |
3704 show j: "j x = h (fst x, Arg2pi (snd x) / (2 * pi))" if "x \<in> {0..1} \<times> sphere 0 1" for x |
3705 using Arg_eq that h01 by (force simp: j_def) |
3705 using Arg2pi_eq that h01 by (force simp: j_def) |
3706 have eq: "S = S \<inter> (UNIV \<times> {z. 0 \<le> Im z}) \<union> S \<inter> (UNIV \<times> {z. Im z \<le> 0})" for S :: "(real*complex)set" |
3706 have eq: "S = S \<inter> (UNIV \<times> {z. 0 \<le> Im z}) \<union> S \<inter> (UNIV \<times> {z. Im z \<le> 0})" for S :: "(real*complex)set" |
3707 by auto |
3707 by auto |
3708 have c1: "continuous_on ({0..1} \<times> sphere 0 1 \<inter> UNIV \<times> {z. 0 \<le> Im z}) (\<lambda>x. h (fst x, Arg (snd x) / (2 * pi)))" |
3708 have c1: "continuous_on ({0..1} \<times> sphere 0 1 \<inter> UNIV \<times> {z. 0 \<le> Im z}) (\<lambda>x. h (fst x, Arg2pi (snd x) / (2 * pi)))" |
3709 apply (intro continuous_intros continuous_on_compose2 [OF conth] continuous_on_compose2 [OF continuous_on_upperhalf_Arg]) |
3709 apply (intro continuous_intros continuous_on_compose2 [OF conth] continuous_on_compose2 [OF continuous_on_upperhalf_Arg2pi]) |
3710 apply (auto simp: Arg) |
3710 apply (auto simp: Arg2pi) |
3711 apply (meson Arg_lt_2pi linear not_le) |
3711 apply (meson Arg2pi_lt_2pi linear not_le) |
3712 done |
3712 done |
3713 have c2: "continuous_on ({0..1} \<times> sphere 0 1 \<inter> UNIV \<times> {z. Im z \<le> 0}) (\<lambda>x. h (fst x, 1 - Arg (cnj (snd x)) / (2 * pi)))" |
3713 have c2: "continuous_on ({0..1} \<times> sphere 0 1 \<inter> UNIV \<times> {z. Im z \<le> 0}) (\<lambda>x. h (fst x, 1 - Arg2pi (cnj (snd x)) / (2 * pi)))" |
3714 apply (intro continuous_intros continuous_on_compose2 [OF conth] continuous_on_compose2 [OF continuous_on_upperhalf_Arg]) |
3714 apply (intro continuous_intros continuous_on_compose2 [OF conth] continuous_on_compose2 [OF continuous_on_upperhalf_Arg2pi]) |
3715 apply (auto simp: Arg) |
3715 apply (auto simp: Arg2pi) |
3716 apply (meson Arg_lt_2pi linear not_le) |
3716 apply (meson Arg2pi_lt_2pi linear not_le) |
3717 done |
3717 done |
3718 show "continuous_on ({0..1} \<times> sphere 0 1) j" |
3718 show "continuous_on ({0..1} \<times> sphere 0 1) j" |
3719 apply (simp add: j_def) |
3719 apply (simp add: j_def) |
3720 apply (subst eq) |
3720 apply (subst eq) |
3721 apply (rule continuous_on_cases_local) |
3721 apply (rule continuous_on_cases_local) |
3722 apply (simp_all add: eq [symmetric] closedin_closed_Int closed_Times closed_halfspace_Im_le closed_halfspace_Im_ge c1 c2) |
3722 apply (simp_all add: eq [symmetric] closedin_closed_Int closed_Times closed_halfspace_Im_le closed_halfspace_Im_ge c1 c2) |
3723 using Arg_eq h01 |
3723 using Arg2pi_eq h01 |
3724 by force |
3724 by force |
3725 qed |
3725 qed |
3726 have "(\<lambda>w. h (fst w, Arg (snd w) / (2 * pi))) ` ({0..1} \<times> sphere 0 1) \<subseteq> h ` ({0..1} \<times> {0..1})" |
3726 have "(\<lambda>w. h (fst w, Arg2pi (snd w) / (2 * pi))) ` ({0..1} \<times> sphere 0 1) \<subseteq> h ` ({0..1} \<times> {0..1})" |
3727 by (auto simp: Arg_ge_0 Arg_lt_2pi less_imp_le) |
3727 by (auto simp: Arg2pi_ge_0 Arg2pi_lt_2pi less_imp_le) |
3728 also have "... \<subseteq> S" |
3728 also have "... \<subseteq> S" |
3729 using him by blast |
3729 using him by blast |
3730 finally show "(\<lambda>w. h (fst w, Arg (snd w) / (2 * pi))) ` ({0..1} \<times> sphere 0 1) \<subseteq> S" . |
3730 finally show "(\<lambda>w. h (fst w, Arg2pi (snd w) / (2 * pi))) ` ({0..1} \<times> sphere 0 1) \<subseteq> S" . |
3731 qed (auto simp: h0 h1) |
3731 qed (auto simp: h0 h1) |
3732 qed |
3732 qed |
3733 |
3733 |
3734 lemma simply_connected_homotopic_loops: |
3734 lemma simply_connected_homotopic_loops: |
3735 "simply_connected S \<longleftrightarrow> |
3735 "simply_connected S \<longleftrightarrow> |
3853 shows "(path_image \<gamma>) homeomorphic sphere a r" |
3853 shows "(path_image \<gamma>) homeomorphic sphere a r" |
3854 proof - |
3854 proof - |
3855 have "homotopic_loops (path_image \<gamma>) \<gamma> \<gamma>" |
3855 have "homotopic_loops (path_image \<gamma>) \<gamma> \<gamma>" |
3856 by (simp add: assms homotopic_loops_refl simple_path_imp_path) |
3856 by (simp add: assms homotopic_loops_refl simple_path_imp_path) |
3857 then have hom: "homotopic_with (\<lambda>h. True) (sphere 0 1) (path_image \<gamma>) |
3857 then have hom: "homotopic_with (\<lambda>h. True) (sphere 0 1) (path_image \<gamma>) |
3858 (\<gamma> \<circ> (\<lambda>z. Arg z / (2*pi))) (\<gamma> \<circ> (\<lambda>z. Arg z / (2*pi)))" |
3858 (\<gamma> \<circ> (\<lambda>z. Arg2pi z / (2*pi))) (\<gamma> \<circ> (\<lambda>z. Arg2pi z / (2*pi)))" |
3859 by (rule homotopic_loops_imp_homotopic_circlemaps) |
3859 by (rule homotopic_loops_imp_homotopic_circlemaps) |
3860 have "\<exists>g. homeomorphism (sphere 0 1) (path_image \<gamma>) (\<gamma> \<circ> (\<lambda>z. Arg z / (2*pi))) g" |
3860 have "\<exists>g. homeomorphism (sphere 0 1) (path_image \<gamma>) (\<gamma> \<circ> (\<lambda>z. Arg2pi z / (2*pi))) g" |
3861 proof (rule homeomorphism_compact) |
3861 proof (rule homeomorphism_compact) |
3862 show "continuous_on (sphere 0 1) (\<gamma> \<circ> (\<lambda>z. Arg z / (2*pi)))" |
3862 show "continuous_on (sphere 0 1) (\<gamma> \<circ> (\<lambda>z. Arg2pi z / (2*pi)))" |
3863 using hom homotopic_with_imp_continuous by blast |
3863 using hom homotopic_with_imp_continuous by blast |
3864 show "inj_on (\<gamma> \<circ> (\<lambda>z. Arg z / (2*pi))) (sphere 0 1)" |
3864 show "inj_on (\<gamma> \<circ> (\<lambda>z. Arg2pi z / (2*pi))) (sphere 0 1)" |
3865 proof |
3865 proof |
3866 fix x y |
3866 fix x y |
3867 assume xy: "x \<in> sphere 0 1" "y \<in> sphere 0 1" |
3867 assume xy: "x \<in> sphere 0 1" "y \<in> sphere 0 1" |
3868 and eq: "(\<gamma> \<circ> (\<lambda>z. Arg z / (2*pi))) x = (\<gamma> \<circ> (\<lambda>z. Arg z / (2*pi))) y" |
3868 and eq: "(\<gamma> \<circ> (\<lambda>z. Arg2pi z / (2*pi))) x = (\<gamma> \<circ> (\<lambda>z. Arg2pi z / (2*pi))) y" |
3869 then have "(Arg x / (2*pi)) = (Arg y / (2*pi))" |
3869 then have "(Arg2pi x / (2*pi)) = (Arg2pi y / (2*pi))" |
3870 proof - |
3870 proof - |
3871 have "(Arg x / (2*pi)) \<in> {0..1}" "(Arg y / (2*pi)) \<in> {0..1}" |
3871 have "(Arg2pi x / (2*pi)) \<in> {0..1}" "(Arg2pi y / (2*pi)) \<in> {0..1}" |
3872 using Arg_ge_0 Arg_lt_2pi dual_order.strict_iff_order by fastforce+ |
3872 using Arg2pi_ge_0 Arg2pi_lt_2pi dual_order.strict_iff_order by fastforce+ |
3873 with eq show ?thesis |
3873 with eq show ?thesis |
3874 using \<open>simple_path \<gamma>\<close> Arg_lt_2pi unfolding simple_path_def o_def |
3874 using \<open>simple_path \<gamma>\<close> Arg2pi_lt_2pi unfolding simple_path_def o_def |
3875 by (metis eq_divide_eq_1 not_less_iff_gr_or_eq) |
3875 by (metis eq_divide_eq_1 not_less_iff_gr_or_eq) |
3876 qed |
3876 qed |
3877 with xy show "x = y" |
3877 with xy show "x = y" |
3878 by (metis Arg Arg_0 dist_0_norm divide_cancel_right dual_order.strict_iff_order mem_sphere) |
3878 by (metis Arg2pi Arg2pi_0 dist_0_norm divide_cancel_right dual_order.strict_iff_order mem_sphere) |
3879 qed |
3879 qed |
3880 have "\<And>z. cmod z = 1 \<Longrightarrow> \<exists>x\<in>{0..1}. \<gamma> (Arg z / (2*pi)) = \<gamma> x" |
3880 have "\<And>z. cmod z = 1 \<Longrightarrow> \<exists>x\<in>{0..1}. \<gamma> (Arg2pi z / (2*pi)) = \<gamma> x" |
3881 by (metis Arg_ge_0 Arg_lt_2pi atLeastAtMost_iff divide_less_eq_1 less_eq_real_def zero_less_mult_iff pi_gt_zero zero_le_divide_iff zero_less_numeral) |
3881 by (metis Arg2pi_ge_0 Arg2pi_lt_2pi atLeastAtMost_iff divide_less_eq_1 less_eq_real_def zero_less_mult_iff pi_gt_zero zero_le_divide_iff zero_less_numeral) |
3882 moreover have "\<exists>z\<in>sphere 0 1. \<gamma> x = \<gamma> (Arg z / (2*pi))" if "0 \<le> x" "x \<le> 1" for x |
3882 moreover have "\<exists>z\<in>sphere 0 1. \<gamma> x = \<gamma> (Arg2pi z / (2*pi))" if "0 \<le> x" "x \<le> 1" for x |
3883 proof (cases "x=1") |
3883 proof (cases "x=1") |
3884 case True |
3884 case True |
3885 then show ?thesis |
3885 then show ?thesis |
3886 apply (rule_tac x=1 in bexI) |
3886 apply (rule_tac x=1 in bexI) |
3887 apply (metis loop Arg_of_real divide_eq_0_iff of_real_1 pathfinish_def pathstart_def \<open>0 \<le> x\<close>, auto) |
3887 apply (metis loop Arg2pi_of_real divide_eq_0_iff of_real_1 pathfinish_def pathstart_def \<open>0 \<le> x\<close>, auto) |
3888 done |
3888 done |
3889 next |
3889 next |
3890 case False |
3890 case False |
3891 then have *: "(Arg (exp (\<i>*(2* of_real pi* of_real x))) / (2*pi)) = x" |
3891 then have *: "(Arg2pi (exp (\<i>*(2* of_real pi* of_real x))) / (2*pi)) = x" |
3892 using that by (auto simp: Arg_exp divide_simps) |
3892 using that by (auto simp: Arg2pi_exp divide_simps) |
3893 show ?thesis |
3893 show ?thesis |
3894 by (rule_tac x="exp(\<i> * of_real(2*pi*x))" in bexI) (auto simp: *) |
3894 by (rule_tac x="exp(\<i> * of_real(2*pi*x))" in bexI) (auto simp: *) |
3895 qed |
3895 qed |
3896 ultimately show "(\<gamma> \<circ> (\<lambda>z. Arg z / (2*pi))) ` sphere 0 1 = path_image \<gamma>" |
3896 ultimately show "(\<gamma> \<circ> (\<lambda>z. Arg2pi z / (2*pi))) ` sphere 0 1 = path_image \<gamma>" |
3897 by (auto simp: path_image_def image_iff) |
3897 by (auto simp: path_image_def image_iff) |
3898 qed auto |
3898 qed auto |
3899 then have "path_image \<gamma> homeomorphic sphere (0::complex) 1" |
3899 then have "path_image \<gamma> homeomorphic sphere (0::complex) 1" |
3900 using homeomorphic_def homeomorphic_sym by blast |
3900 using homeomorphic_def homeomorphic_sym by blast |
3901 also have "... homeomorphic sphere a r" |
3901 also have "... homeomorphic sphere a r" |