1365 |
1365 |
1366 lemma continuous_on_Ln' [continuous_intros]: |
1366 lemma continuous_on_Ln' [continuous_intros]: |
1367 "continuous_on S f \<Longrightarrow> (\<And>z. z \<in> S \<Longrightarrow> f z \<notin> \<real>\<^sub>\<le>\<^sub>0) \<Longrightarrow> continuous_on S (\<lambda>x. Ln (f x))" |
1367 "continuous_on S f \<Longrightarrow> (\<And>z. z \<in> S \<Longrightarrow> f z \<notin> \<real>\<^sub>\<le>\<^sub>0) \<Longrightarrow> continuous_on S (\<lambda>x. Ln (f x))" |
1368 by (rule continuous_on_compose2[OF continuous_on_Ln, of "UNIV - nonpos_Reals" S f]) auto |
1368 by (rule continuous_on_compose2[OF continuous_on_Ln, of "UNIV - nonpos_Reals" S f]) auto |
1369 |
1369 |
1370 lemma holomorphic_on_Ln [holomorphic_intros]: "(\<And>z. z \<in> S \<Longrightarrow> z \<notin> \<real>\<^sub>\<le>\<^sub>0) \<Longrightarrow> Ln holomorphic_on S" |
1370 lemma holomorphic_on_Ln [holomorphic_intros]: "S \<inter> \<real>\<^sub>\<le>\<^sub>0 = {} \<Longrightarrow> Ln holomorphic_on S" |
1371 by (simp add: field_differentiable_within_Ln holomorphic_on_def) |
1371 by (simp add: disjoint_iff field_differentiable_within_Ln holomorphic_on_def) |
1372 |
1372 |
1373 lemma holomorphic_on_Ln' [holomorphic_intros]: |
1373 lemma holomorphic_on_Ln' [holomorphic_intros]: |
1374 "(\<And>z. z \<in> A \<Longrightarrow> f z \<notin> \<real>\<^sub>\<le>\<^sub>0) \<Longrightarrow> f holomorphic_on A \<Longrightarrow> (\<lambda>z. Ln (f z)) holomorphic_on A" |
1374 "(\<And>z. z \<in> A \<Longrightarrow> f z \<notin> \<real>\<^sub>\<le>\<^sub>0) \<Longrightarrow> f holomorphic_on A \<Longrightarrow> (\<lambda>z. Ln (f z)) holomorphic_on A" |
1375 using holomorphic_on_compose_gen[OF _ holomorphic_on_Ln, of f A "- \<real>\<^sub>\<le>\<^sub>0"] |
1375 using holomorphic_on_compose_gen[OF _ holomorphic_on_Ln, of f A "- \<real>\<^sub>\<le>\<^sub>0"] |
1376 by (auto simp: o_def) |
1376 by (auto simp: o_def) |
1693 corollary\<^marker>\<open>tag unimportant\<close> Ln_times_of_real: |
1693 corollary\<^marker>\<open>tag unimportant\<close> Ln_times_of_real: |
1694 "\<lbrakk>r > 0; z \<noteq> 0\<rbrakk> \<Longrightarrow> Ln(of_real r * z) = ln r + Ln(z)" |
1694 "\<lbrakk>r > 0; z \<noteq> 0\<rbrakk> \<Longrightarrow> Ln(of_real r * z) = ln r + Ln(z)" |
1695 using mpi_less_Im_Ln Im_Ln_le_pi |
1695 using mpi_less_Im_Ln Im_Ln_le_pi |
1696 by (force simp: Ln_times) |
1696 by (force simp: Ln_times) |
1697 |
1697 |
|
1698 corollary\<^marker>\<open>tag unimportant\<close> Ln_times_of_nat: |
|
1699 "\<lbrakk>r > 0; z \<noteq> 0\<rbrakk> \<Longrightarrow> Ln(of_nat r * z :: complex) = ln (of_nat r) + Ln(z)" |
|
1700 using Ln_times_of_real[of "of_nat r" z] by simp |
|
1701 |
1698 corollary\<^marker>\<open>tag unimportant\<close> Ln_times_Reals: |
1702 corollary\<^marker>\<open>tag unimportant\<close> Ln_times_Reals: |
1699 "\<lbrakk>r \<in> Reals; Re r > 0; z \<noteq> 0\<rbrakk> \<Longrightarrow> Ln(r * z) = ln (Re r) + Ln(z)" |
1703 "\<lbrakk>r \<in> Reals; Re r > 0; z \<noteq> 0\<rbrakk> \<Longrightarrow> Ln(r * z) = ln (Re r) + Ln(z)" |
1700 using Ln_Reals_eq Ln_times_of_real by fastforce |
1704 using Ln_Reals_eq Ln_times_of_real by fastforce |
1701 |
1705 |
1702 corollary\<^marker>\<open>tag unimportant\<close> Ln_divide_of_real: |
1706 corollary\<^marker>\<open>tag unimportant\<close> Ln_divide_of_real: |
1776 finally show ?thesis . |
1780 finally show ?thesis . |
1777 qed |
1781 qed |
1778 |
1782 |
1779 subsection\<open>The Argument of a Complex Number\<close> |
1783 subsection\<open>The Argument of a Complex Number\<close> |
1780 |
1784 |
1781 text\<open>Finally: it's is defined for the same interval as the complex logarithm: \<open>(-\<pi>,\<pi>]\<close>.\<close> |
1785 text\<open>Unlike in HOL Light, it's defined for the same interval as the complex logarithm: \<open>(-\<pi>,\<pi>]\<close>.\<close> |
1782 |
1786 |
1783 definition\<^marker>\<open>tag important\<close> Arg :: "complex \<Rightarrow> real" where "Arg z \<equiv> (if z = 0 then 0 else Im (Ln z))" |
1787 lemma Arg_eq_Im_Ln: |
1784 |
1788 assumes "z \<noteq> 0" shows "Arg z = Im (Ln z)" |
1785 lemma Arg_of_real: "Arg (of_real r) = (if r<0 then pi else 0)" |
1789 proof (rule cis_Arg_unique) |
|
1790 show "sgn z = cis (Im (Ln z))" |
|
1791 by (metis assms exp_Ln exp_eq_polar nonzero_mult_div_cancel_left norm_eq_zero |
|
1792 norm_exp_eq_Re of_real_eq_0_iff sgn_eq) |
|
1793 show "- pi < Im (Ln z)" |
|
1794 by (simp add: assms mpi_less_Im_Ln) |
|
1795 show "Im (Ln z) \<le> pi" |
|
1796 by (simp add: Im_Ln_le_pi assms) |
|
1797 qed |
|
1798 |
|
1799 text \<open>The 1990s definition of argument coincides with the more recent one\<close> |
|
1800 lemma\<^marker>\<open>tag important\<close> Arg_def: |
|
1801 shows "Arg z = (if z = 0 then 0 else Im (Ln z))" |
|
1802 by (simp add: Arg_eq_Im_Ln Arg_zero) |
|
1803 |
|
1804 lemma Arg_of_real [simp]: "Arg (of_real r) = (if r<0 then pi else 0)" |
1786 by (simp add: Im_Ln_eq_pi Arg_def) |
1805 by (simp add: Im_Ln_eq_pi Arg_def) |
1787 |
1806 |
1788 lemma mpi_less_Arg: "-pi < Arg z" |
1807 lemma mpi_less_Arg: "-pi < Arg z" |
1789 and Arg_le_pi: "Arg z \<le> pi" |
1808 and Arg_le_pi: "Arg z \<le> pi" |
1790 by (auto simp: Arg_def mpi_less_Im_Ln Im_Ln_le_pi) |
1809 by (auto simp: Arg_def mpi_less_Im_Ln Im_Ln_le_pi) |
2029 |
2048 |
2030 lemma Ln_times_unwinding: |
2049 lemma Ln_times_unwinding: |
2031 "w \<noteq> 0 \<Longrightarrow> z \<noteq> 0 \<Longrightarrow> Ln(w * z) = Ln(w) + Ln(z) - (2*pi) * \<i> * unwinding(Ln w + Ln z)" |
2050 "w \<noteq> 0 \<Longrightarrow> z \<noteq> 0 \<Longrightarrow> Ln(w * z) = Ln(w) + Ln(z) - (2*pi) * \<i> * unwinding(Ln w + Ln z)" |
2032 using unwinding_2pi by (simp add: exp_add) |
2051 using unwinding_2pi by (simp add: exp_add) |
2033 |
2052 |
|
2053 |
|
2054 lemma arg_conv_arctan: |
|
2055 assumes "Re z > 0" |
|
2056 shows "Arg z = arctan (Im z / Re z)" |
|
2057 proof (rule cis_Arg_unique) |
|
2058 show "sgn z = cis (arctan (Im z / Re z))" |
|
2059 proof (rule complex_eqI) |
|
2060 have "Re (cis (arctan (Im z / Re z))) = 1 / sqrt (1 + (Im z)\<^sup>2 / (Re z)\<^sup>2)" |
|
2061 by (simp add: cos_arctan power_divide) |
|
2062 also have "1 + Im z ^ 2 / Re z ^ 2 = norm z ^ 2 / Re z ^ 2" |
|
2063 using assms by (simp add: cmod_def field_simps) |
|
2064 also have "1 / sqrt \<dots> = Re z / norm z" |
|
2065 using assms by (simp add: real_sqrt_divide) |
|
2066 finally show "Re (sgn z) = Re (cis (arctan (Im z / Re z)))" |
|
2067 by simp |
|
2068 next |
|
2069 have "Im (cis (arctan (Im z / Re z))) = Im z / (Re z * sqrt (1 + (Im z)\<^sup>2 / (Re z)\<^sup>2))" |
|
2070 by (simp add: sin_arctan field_simps) |
|
2071 also have "1 + Im z ^ 2 / Re z ^ 2 = norm z ^ 2 / Re z ^ 2" |
|
2072 using assms by (simp add: cmod_def field_simps) |
|
2073 also have "Im z / (Re z * sqrt \<dots>) = Im z / norm z" |
|
2074 using assms by (simp add: real_sqrt_divide) |
|
2075 finally show "Im (sgn z) = Im (cis (arctan (Im z / Re z)))" |
|
2076 by simp |
|
2077 qed |
|
2078 next |
|
2079 show "arctan (Im z / Re z) > -pi" |
|
2080 by (rule le_less_trans[OF _ arctan_lbound]) auto |
|
2081 next |
|
2082 have "arctan (Im z / Re z) < pi / 2" |
|
2083 by (rule arctan_ubound) |
|
2084 also have "\<dots> \<le> pi" by simp |
|
2085 finally show "arctan (Im z / Re z) \<le> pi" |
|
2086 by simp |
|
2087 qed |
2034 |
2088 |
2035 subsection\<^marker>\<open>tag unimportant\<close>\<open>Relation between Ln and Arg2pi, and hence continuity of Arg2pi\<close> |
2089 subsection\<^marker>\<open>tag unimportant\<close>\<open>Relation between Ln and Arg2pi, and hence continuity of Arg2pi\<close> |
2036 |
2090 |
2037 lemma Arg2pi_Ln: |
2091 lemma Arg2pi_Ln: |
2038 assumes "0 < Arg2pi z" shows "Arg2pi z = Im(Ln(-z)) + pi" |
2092 assumes "0 < Arg2pi z" shows "Arg2pi z = Im(Ln(-z)) + pi" |