# HG changeset patch # User paulson # Date 1625255019 -3600 # Node ID 5b5e015189a4c871dfda515753ced5f9c83e60c7 # Parent 3556303bd38553d37d1a51e9b5d3ba219ad58652# Parent 5f71c16f0b37a2d0b26a713fa06a82aaa4df56d2 merged diff -r 3556303bd385 -r 5b5e015189a4 src/HOL/Analysis/Complex_Transcendental.thy --- a/src/HOL/Analysis/Complex_Transcendental.thy Fri Jul 02 14:08:45 2021 +0200 +++ b/src/HOL/Analysis/Complex_Transcendental.thy Fri Jul 02 20:43:39 2021 +0100 @@ -1781,7 +1781,7 @@ text\Unlike in HOL Light, it's defined for the same interval as the complex logarithm: \(-\,\]\.\ lemma Arg_eq_Im_Ln: - assumes "z \ 0" shows "arg z = Im (Ln z)" + assumes "z \ 0" shows "Arg z = Im (Ln z)" proof (rule arg_unique) show "sgn z = cis (Im (Ln z))" by (metis assms exp_Ln exp_eq_polar nonzero_mult_div_cancel_left norm_eq_zero @@ -1793,11 +1793,9 @@ qed text \The 1990s definition of argument coincides with the more recent one\ -lemma Arg_definition_equivalence: - shows "arg z = (if z = 0 then 0 else Im (Ln z))" - by (simp add: Arg_eq_Im_Ln arg_zero) - -definition\<^marker>\tag important\ Arg :: "complex \ real" where "Arg z \ (if z = 0 then 0 else Im (Ln z))" +lemma\<^marker>\tag important\ Arg_def: + shows "Arg z = (if z = 0 then 0 else Im (Ln z))" + by (simp add: Arg_eq_Im_Ln Arg_zero) lemma Arg_of_real: "Arg (of_real r) = (if r<0 then pi else 0)" by (simp add: Im_Ln_eq_pi Arg_def) diff -r 3556303bd385 -r 5b5e015189a4 src/HOL/Complex.thy --- a/src/HOL/Complex.thy Fri Jul 02 14:08:45 2021 +0200 +++ b/src/HOL/Complex.thy Fri Jul 02 20:43:39 2021 +0100 @@ -888,7 +888,6 @@ lemma rcis_divide: "rcis r1 a / rcis r2 b = rcis (r1 / r2) (a - b)" by (simp add: rcis_def cis_divide [symmetric]) - subsubsection \Complex exponential\ lemma exp_Reals_eq: @@ -957,15 +956,15 @@ subsubsection \Complex argument\ -definition arg :: "complex \ real" - where "arg z = (if z = 0 then 0 else (SOME a. sgn z = cis a \ - pi < a \ a \ pi))" +definition Arg :: "complex \ real" + where "Arg z = (if z = 0 then 0 else (SOME a. sgn z = cis a \ - pi < a \ a \ pi))" -lemma arg_zero: "arg 0 = 0" - by (simp add: arg_def) +lemma Arg_zero: "Arg 0 = 0" + by (simp add: Arg_def) lemma arg_unique: assumes "sgn z = cis x" and "-pi < x" and "x \ pi" - shows "arg z = x" + shows "Arg z = x" proof - from assms have "z \ 0" by auto have "(SOME a. sgn z = cis a \ -pi < a \ a \ pi) = x" @@ -987,14 +986,14 @@ then show "a = x" by (simp add: d_def) qed (simp add: assms del: Re_sgn Im_sgn) - with \z \ 0\ show "arg z = x" - by (simp add: arg_def) + with \z \ 0\ show "Arg z = x" + by (simp add: Arg_def) qed lemma arg_correct: assumes "z \ 0" - shows "sgn z = cis (arg z) \ -pi < arg z \ arg z \ pi" -proof (simp add: arg_def assms, rule someI_ex) + shows "sgn z = cis (Arg z) \ -pi < Arg z \ Arg z \ pi" +proof (simp add: Arg_def assms, rule someI_ex) obtain r a where z: "z = rcis r a" using rcis_Ex by fast with assms have "r \ 0" by auto @@ -1016,22 +1015,26 @@ by fast qed -lemma arg_bounded: "- pi < arg z \ arg z \ pi" - by (cases "z = 0") (simp_all add: arg_zero arg_correct) +lemma Arg_bounded: "- pi < Arg z \ Arg z \ pi" + by (cases "z = 0") (simp_all add: Arg_zero arg_correct) -lemma cis_arg: "z \ 0 \ cis (arg z) = sgn z" +lemma cis_Arg: "z \ 0 \ cis (Arg z) = sgn z" by (simp add: arg_correct) -lemma rcis_cmod_arg: "rcis (cmod z) (arg z) = z" - by (cases "z = 0") (simp_all add: rcis_def cis_arg sgn_div_norm of_real_def) +lemma rcis_cmod_Arg: "rcis (cmod z) (Arg z) = z" + by (cases "z = 0") (simp_all add: rcis_def cis_Arg sgn_div_norm of_real_def) -lemma cos_arg_i_mult_zero [simp]: "y \ 0 \ Re y = 0 \ cos (arg y) = 0" - using cis_arg [of y] by (simp add: complex_eq_iff) +lemma rcis_cnj: + shows "cnj a = rcis (cmod a) (- Arg a)" + by (metis cis_cnj complex_cnj_complex_of_real complex_cnj_mult rcis_cmod_Arg rcis_def) -lemma arg_ii [simp]: "arg \ = pi/2" +lemma cos_Arg_i_mult_zero [simp]: "y \ 0 \ Re y = 0 \ cos (Arg y) = 0" + using cis_Arg [of y] by (simp add: complex_eq_iff) + +lemma Arg_ii [simp]: "Arg \ = pi/2" by (rule arg_unique; simp add: sgn_eq) -lemma arg_minus_ii [simp]: "arg (-\) = -pi/2" +lemma Arg_minus_ii [simp]: "Arg (-\) = -pi/2" proof (rule arg_unique) show "sgn (- \) = cis (- pi / 2)" by (simp add: sgn_eq) @@ -1097,23 +1100,23 @@ lemma bij_betw_nth_root_unity: fixes c :: complex and n :: nat assumes c: "c \ 0" and n: "n > 0" - defines "c' \ root n (norm c) * cis (arg c / n)" + defines "c' \ root n (norm c) * cis (Arg c / n)" shows "bij_betw (\z. c' * z) {z. z ^ n = 1} {z. z ^ n = c}" proof - - have "c' ^ n = of_real (root n (norm c) ^ n) * cis (arg c)" + have "c' ^ n = of_real (root n (norm c) ^ n) * cis (Arg c)" unfolding of_real_power using n by (simp add: c'_def power_mult_distrib DeMoivre) also from n have "root n (norm c) ^ n = norm c" by simp - also from c have "of_real \ * cis (arg c) = c" by (simp add: cis_arg Complex.sgn_eq) + also from c have "of_real \ * cis (Arg c) = c" by (simp add: cis_Arg Complex.sgn_eq) finally have [simp]: "c' ^ n = c" . show ?thesis unfolding bij_betw_def inj_on_def proof safe fix z :: complex assume "z ^ n = 1" hence "(c' * z) ^ n = c' ^ n" by (simp add: power_mult_distrib) - also have "c' ^ n = of_real (root n (norm c) ^ n) * cis (arg c)" + also have "c' ^ n = of_real (root n (norm c) ^ n) * cis (Arg c)" unfolding of_real_power using n by (simp add: c'_def power_mult_distrib DeMoivre) also from n have "root n (norm c) ^ n = norm c" by simp - also from c have "\ * cis (arg c) = c" by (simp add: cis_arg Complex.sgn_eq) + also from c have "\ * cis (Arg c) = c" by (simp add: cis_Arg Complex.sgn_eq) finally show "(c' * z) ^ n = c" . next fix z assume z: "c = z ^ n" @@ -1188,7 +1191,7 @@ finally show ?thesis . next case False - define c' where "c' = root n (norm c) * cis (arg c / n)" + define c' where "c' = root n (norm c) * cis (Arg c / n)" from False and assms have "(\{z. z ^ n = c}) = (\z | z ^ n = 1. c' * z)" by (subst sum.reindex_bij_betw [OF bij_betw_nth_root_unity, symmetric]) (auto simp: sum_distrib_left finite_roots_unity c'_def) diff -r 3556303bd385 -r 5b5e015189a4 src/HOL/Complex_Analysis/Complex_Residues.thy --- a/src/HOL/Complex_Analysis/Complex_Residues.thy Fri Jul 02 14:08:45 2021 +0200 +++ b/src/HOL/Complex_Analysis/Complex_Residues.thy Fri Jul 02 20:43:39 2021 +0100 @@ -11,11 +11,6 @@ "residue f z = (SOME int. \e>0. \\>0. \ (f has_contour_integral 2*pi* \ *int) (circlepath z \))" -lemma Eps_cong: - assumes "\x. P x = Q x" - shows "Eps P = Eps Q" - using ext[of P Q, OF assms] by simp - lemma residue_cong: assumes eq: "eventually (\z. f z = g z) (at z)" and "z = z'" shows "residue f z = residue g z'" @@ -542,4 +537,4 @@ using Gamma_residues[of n] by simp qed auto -end \ No newline at end of file +end diff -r 3556303bd385 -r 5b5e015189a4 src/HOL/Nonstandard_Analysis/NSComplex.thy --- a/src/HOL/Nonstandard_Analysis/NSComplex.thy Fri Jul 02 14:08:45 2021 +0200 +++ b/src/HOL/Nonstandard_Analysis/NSComplex.thy Fri Jul 02 20:43:39 2021 +0100 @@ -45,7 +45,7 @@ where "hsgn = *f* sgn" definition harg :: "hcomplex \ hypreal" - where "harg = *f* arg" + where "harg = *f* Arg" definition \ \abbreviation for \cos a + i sin a\\ hcis :: "hypreal \ hcomplex" diff -r 3556303bd385 -r 5b5e015189a4 src/HOL/Series.thy --- a/src/HOL/Series.thy Fri Jul 02 14:08:45 2021 +0200 +++ b/src/HOL/Series.thy Fri Jul 02 20:43:39 2021 +0100 @@ -58,7 +58,7 @@ by simp lemma sums_cong: "(\n. f n = g n) \ f sums c \ g sums c" - by (drule ext) simp + by presburger lemma sums_summable: "f sums l \ summable f" by (simp add: sums_def summable_def, blast) @@ -67,8 +67,7 @@ by (simp add: summable_def sums_def convergent_def) lemma summable_iff_convergent': "summable f \ convergent (\n. sum f {..n})" - by (simp_all only: summable_iff_convergent convergent_def - lessThan_Suc_atMost [symmetric] filterlim_sequentially_Suc[of "\n. sum f {..n. \i 0 < k \ (\n. sum f {n * k ..< n * k + k}) sums s" apply (simp only: sums_def sum.nat_group tendsto_def eventually_sequentially) apply (erule all_forward imp_forward exE| assumption)+ - apply (rule_tac x="N" in exI) by (metis le_square mult.commute mult.left_neutral mult_le_cancel2 mult_le_mono) lemma suminf_cong: "(\n. f n = g n) \ suminf f = suminf g" - by (rule arg_cong[of f g], rule ext) simp + by presburger lemma summable_cong: fixes f g :: "nat \ 'a::real_normed_vector" @@ -225,16 +223,13 @@ assumes "summable f" and pos: "\n. 0 \ f n" shows "suminf f = 0 \ (\n. f n = 0)" proof - assume "suminf f = 0" + assume L: "suminf f = 0" then have f: "(\n. \i 0" using summable_LIMSEQ[of f] assms by simp then have "\i. (\n\{i}. f n) \ 0" - proof (rule LIMSEQ_le_const) - show "\N. \n\N. (\n\{i}. f n) \ sum f {..summable f\ order_refl pos sum.infinite sum_le_suminf) with pos show "\n. f n = 0" - by (auto intro!: antisym) + by (simp add: order.antisym) qed (metis suminf_zero fun_eq_iff) lemma suminf_pos_iff: "summable f \ (\n. 0 \ f n) \ 0 < suminf f \ (\i. 0 < f i)" @@ -735,11 +730,11 @@ proof (cases m n rule: linorder_class.le_cases) assume "m \ n" then show ?thesis - by (metis Groups_Big.sum_diff N finite_lessThan lessThan_minus_lessThan lessThan_subset_iff norm_minus_commute \m\N\) + by (metis N finite_lessThan lessThan_minus_lessThan lessThan_subset_iff norm_minus_commute sum_diff \m\N\) next assume "n \ m" then show ?thesis - by (metis Groups_Big.sum_diff N finite_lessThan lessThan_minus_lessThan lessThan_subset_iff \n\N\) + by (metis N finite_lessThan lessThan_minus_lessThan lessThan_subset_iff sum_diff \n\N\) qed then show "\M. \m\M. \n\M. norm (sum f {.. 'a :: banach" - assumes "eventually (\m. \n\m. norm (sum f {m.. g m) sequentially" - assumes "filterlim g (nhds 0) sequentially" + assumes ev: "eventually (\m. \n\m. norm (sum f {m.. g m) sequentially" + assumes g0: "g \ 0" shows "summable f" proof (subst summable_Cauchy, intro allI impI, goal_cases) case (1 e) - from order_tendstoD(2)[OF assms(2) this] and assms(1) - have "eventually (\m. \n. norm (sum f {m..\<^sub>F x in sequentially. g x < e" + using g0 order_tendstoD(2) by blast + with ev have "eventually (\m. \n. norm (sum f {m..