# HG changeset patch # User blanchet # Date 1527757194 -7200 # Node ID 9946707cf32978ed0d300baafde22a02a9df1bed # Parent 0d751da653d9dc2cbeb7e1716eec6ecb2b714b1e# Parent 7d946d8bc05812da7e4684302ffaf06615ba49f4 merge diff -r 0d751da653d9 -r 9946707cf329 src/HOL/Analysis/Cauchy_Integral_Theorem.thy --- a/src/HOL/Analysis/Cauchy_Integral_Theorem.thy Thu May 31 10:59:36 2018 +0200 +++ b/src/HOL/Analysis/Cauchy_Integral_Theorem.thy Thu May 31 10:59:54 2018 +0200 @@ -3336,21 +3336,21 @@ subsection\Winding Numbers\ +definition winding_number_prop :: "[real \ complex, complex, real, real \ complex, complex] \ bool" where + "winding_number_prop \ z e p n \ + valid_path p \ z \ path_image p \ + pathstart p = pathstart \ \ + pathfinish p = pathfinish \ \ + (\t \ {0..1}. norm(\ t - p t) < e) \ + contour_integral p (\w. 1/(w - z)) = 2 * pi * \ * n" + definition winding_number:: "[real \ complex, complex] \ complex" where - "winding_number \ z \ - SOME n. \e > 0. \p. valid_path p \ z \ path_image p \ - pathstart p = pathstart \ \ - pathfinish p = pathfinish \ \ - (\t \ {0..1}. norm(\ t - p t) < e) \ - contour_integral p (\w. 1/(w - z)) = 2 * pi * \ * n" + "winding_number \ z \ SOME n. \e > 0. \p. winding_number_prop \ z e p n" + lemma winding_number: assumes "path \" "z \ path_image \" "0 < e" - shows "\p. valid_path p \ z \ path_image p \ - pathstart p = pathstart \ \ - pathfinish p = pathfinish \ \ - (\t \ {0..1}. norm (\ t - p t) < e) \ - contour_integral p (\w. 1/(w - z)) = 2 * pi * \ * winding_number \ z" + shows "\p. winding_number_prop \ z e p (winding_number \ z)" proof - have "path_image \ \ UNIV - {z}" using assms by blast @@ -3366,11 +3366,7 @@ (\t \ {0..1}. norm(h t - \ t) < d/2)" using path_approx_polynomial_function [OF \path \\, of "d/2"] d by auto define nn where "nn = 1/(2* pi*\) * contour_integral h (\w. 1/(w - z))" - have "\n. \e > 0. \p. valid_path p \ z \ path_image p \ - pathstart p = pathstart \ \ pathfinish p = pathfinish \ \ - (\t \ {0..1}. norm(\ t - p t) < e) \ - contour_integral p (\w. 1/(w - z)) = 2 * pi * \ * n" - (is "\n. \e > 0. ?PP e n") + have "\n. \e > 0. \p. winding_number_prop \ z e p n" proof (rule_tac x=nn in exI, clarify) fix e::real assume e: "e>0" @@ -3379,26 +3375,19 @@ using path_approx_polynomial_function [OF \path \\, of "min e (d/2)"] d \0 by auto have "(\w. 1 / (w - z)) holomorphic_on UNIV - {z}" by (auto simp: intro!: holomorphic_intros) - then show "?PP e nn" + then show "\p. winding_number_prop \ z e p nn" apply (rule_tac x=p in exI) using pi_eq [of h p] h p d - apply (auto simp: valid_path_polynomial_function norm_minus_commute nn_def) + apply (auto simp: valid_path_polynomial_function norm_minus_commute nn_def winding_number_prop_def) done qed then show ?thesis - unfolding winding_number_def - apply (rule someI2_ex) - apply (blast intro: \0) - done + unfolding winding_number_def by (rule someI2_ex) (blast intro: \0) qed lemma winding_number_unique: assumes \: "path \" "z \ path_image \" - and pi: - "\e. e>0 \ \p. valid_path p \ z \ path_image p \ - pathstart p = pathstart \ \ pathfinish p = pathfinish \ \ - (\t \ {0..1}. norm (\ t - p t) < e) \ - contour_integral p (\w. 1/(w - z)) = 2 * pi * \ * n" + and pi: "\e. e>0 \ \p. winding_number_prop \ z e p n" shows "winding_number \ z = n" proof - have "path_image \ \ UNIV - {z}" @@ -3410,31 +3399,25 @@ pathstart h2 = pathstart h1; pathfinish h2 = pathfinish h1; f holomorphic_on UNIV - {z}\ \ contour_integral h2 f = contour_integral h1 f" using contour_integral_nearby_ends [of "UNIV - {z}" \] assms by (auto simp: open_delete) - obtain p where p: - "valid_path p \ z \ path_image p \ - pathstart p = pathstart \ \ pathfinish p = pathfinish \ \ - (\t \ {0..1}. norm (\ t - p t) < e) \ - contour_integral p (\w. 1/(w - z)) = 2 * pi * \ * n" + obtain p where p: "winding_number_prop \ z e p n" using pi [OF e] by blast - obtain q where q: - "valid_path q \ z \ path_image q \ - pathstart q = pathstart \ \ pathfinish q = pathfinish \ \ - (\t\{0..1}. cmod (\ t - q t) < e) \ contour_integral q (\w. 1 / (w - z)) = complex_of_real (2 * pi) * \ * winding_number \ z" + obtain q where q: "winding_number_prop \ z e q (winding_number \ z)" using winding_number [OF \ e] by blast have "2 * complex_of_real pi * \ * n = contour_integral p (\w. 1 / (w - z))" - using p by auto + using p by (auto simp: winding_number_prop_def) also have "... = contour_integral q (\w. 1 / (w - z))" proof (rule pi_eq) show "(\w. 1 / (w - z)) holomorphic_on UNIV - {z}" by (auto intro!: holomorphic_intros) - qed (use p q in \auto simp: norm_minus_commute\) + qed (use p q in \auto simp: winding_number_prop_def norm_minus_commute\) also have "... = 2 * complex_of_real pi * \ * winding_number \ z" - using q by auto + using q by (auto simp: winding_number_prop_def) finally have "2 * complex_of_real pi * \ * n = 2 * complex_of_real pi * \ * winding_number \ z" . then show ?thesis by simp qed +(*NB not winding_number_prop here due to the loop in p*) lemma winding_number_unique_loop: assumes \: "path \" "z \ path_image \" and loop: "pathfinish \ = pathstart \" @@ -3455,15 +3438,11 @@ contour_integral h2 f = contour_integral h1 f" using contour_integral_nearby_loops [of "UNIV - {z}" \] assms by (auto simp: open_delete) obtain p where p: - "valid_path p \ z \ path_image p \ - pathfinish p = pathstart p \ + "valid_path p \ z \ path_image p \ pathfinish p = pathstart p \ (\t \ {0..1}. norm (\ t - p t) < e) \ contour_integral p (\w. 1/(w - z)) = 2 * pi * \ * n" using pi [OF e] by blast - obtain q where q: - "valid_path q \ z \ path_image q \ - pathstart q = pathstart \ \ pathfinish q = pathfinish \ \ - (\t\{0..1}. cmod (\ t - q t) < e) \ contour_integral q (\w. 1 / (w - z)) = complex_of_real (2 * pi) * \ * winding_number \ z" + obtain q where q: "winding_number_prop \ z e q (winding_number \ z)" using winding_number [OF \ e] by blast have "2 * complex_of_real pi * \ * n = contour_integral p (\w. 1 / (w - z))" using p by auto @@ -3471,9 +3450,9 @@ proof (rule pi_eq) show "(\w. 1 / (w - z)) holomorphic_on UNIV - {z}" by (auto intro!: holomorphic_intros) - qed (use p q loop in \auto simp: norm_minus_commute\) + qed (use p q loop in \auto simp: winding_number_prop_def norm_minus_commute\) also have "... = 2 * complex_of_real pi * \ * winding_number \ z" - using q by auto + using q by (auto simp: winding_number_prop_def) finally have "2 * complex_of_real pi * \ * n = 2 * complex_of_real pi * \ * winding_number \ z" . then show ?thesis by simp @@ -3481,8 +3460,9 @@ lemma winding_number_valid_path: assumes "valid_path \" "z \ path_image \" - shows "winding_number \ z = 1/(2*pi*\) * contour_integral \ (\w. 1/(w - z))" - using assms by (auto simp: valid_path_imp_path intro!: winding_number_unique) + shows "winding_number \ z = 1/(2*pi*\) * contour_integral \ (\w. 1/(w - z))" + by (rule winding_number_unique) + (use assms in \auto simp: valid_path_imp_path winding_number_prop_def\) lemma has_contour_integral_winding_number: assumes \: "valid_path \" "z \ path_image \" @@ -3496,44 +3476,69 @@ by (simp add: path_image_subpath winding_number_valid_path) lemma winding_number_join: - assumes g1: "path g1" "z \ path_image g1" - and g2: "path g2" "z \ path_image g2" - and "pathfinish g1 = pathstart g2" - shows "winding_number(g1 +++ g2) z = winding_number g1 z + winding_number g2 z" - apply (rule winding_number_unique) - using assms apply (simp_all add: not_in_path_image_join) - apply (frule winding_number [OF g2]) - apply (frule winding_number [OF g1], clarify) - apply (rename_tac p2 p1) - apply (rule_tac x="p1+++p2" in exI) - apply (simp add: not_in_path_image_join contour_integrable_inversediff algebra_simps) - apply (auto simp: joinpaths_def) - done + assumes \1: "path \1" "z \ path_image \1" + and \2: "path \2" "z \ path_image \2" + and "pathfinish \1 = pathstart \2" + shows "winding_number(\1 +++ \2) z = winding_number \1 z + winding_number \2 z" +proof (rule winding_number_unique) + show "\p. winding_number_prop (\1 +++ \2) z e p + (winding_number \1 z + winding_number \2 z)" if "e > 0" for e + proof - + obtain p1 where "winding_number_prop \1 z e p1 (winding_number \1 z)" + using \0 < e\ \1 winding_number by blast + moreover + obtain p2 where "winding_number_prop \2 z e p2 (winding_number \2 z)" + using \0 < e\ \2 winding_number by blast + ultimately + have "winding_number_prop (\1+++\2) z e (p1+++p2) (winding_number \1 z + winding_number \2 z)" + using assms + apply (simp add: winding_number_prop_def not_in_path_image_join contour_integrable_inversediff algebra_simps) + apply (auto simp: joinpaths_def) + done + then show ?thesis + by blast + qed +qed (use assms in \auto simp: not_in_path_image_join\) lemma winding_number_reversepath: assumes "path \" "z \ path_image \" shows "winding_number(reversepath \) z = - (winding_number \ z)" - apply (rule winding_number_unique) - using assms - apply simp_all - apply (frule winding_number [OF assms], clarify) - apply (rule_tac x="reversepath p" in exI) - apply (simp add: contour_integral_reversepath contour_integrable_inversediff valid_path_imp_reverse) - apply (auto simp: reversepath_def) - done +proof (rule winding_number_unique) + show "\p. winding_number_prop (reversepath \) z e p (- winding_number \ z)" if "e > 0" for e + proof - + obtain p where "winding_number_prop \ z e p (winding_number \ z)" + using \0 < e\ assms winding_number by blast + then have "winding_number_prop (reversepath \) z e (reversepath p) (- winding_number \ z)" + using assms + apply (simp add: winding_number_prop_def contour_integral_reversepath contour_integrable_inversediff valid_path_imp_reverse) + apply (auto simp: reversepath_def) + done + then show ?thesis + by blast + qed +qed (use assms in auto) lemma winding_number_shiftpath: assumes \: "path \" "z \ path_image \" and "pathfinish \ = pathstart \" "a \ {0..1}" shows "winding_number(shiftpath a \) z = winding_number \ z" - apply (rule winding_number_unique_loop) - using assms - apply (simp_all add: path_shiftpath path_image_shiftpath pathfinish_shiftpath pathstart_shiftpath) - apply (frule winding_number [OF \], clarify) - apply (rule_tac x="shiftpath a p" in exI) - apply (simp add: contour_integral_shiftpath path_image_shiftpath pathfinish_shiftpath pathstart_shiftpath valid_path_shiftpath) - apply (auto simp: shiftpath_def) - done +proof (rule winding_number_unique_loop) + show "\p. valid_path p \ z \ path_image p \ pathfinish p = pathstart p \ + (\t\{0..1}. cmod (shiftpath a \ t - p t) < e) \ + contour_integral p (\w. 1 / (w - z)) = + complex_of_real (2 * pi) * \ * winding_number \ z" + if "e > 0" for e + proof - + obtain p where "winding_number_prop \ z e p (winding_number \ z)" + using \0 < e\ assms winding_number by blast + then show ?thesis + apply (rule_tac x="shiftpath a p" in exI) + using assms that + apply (auto simp: winding_number_prop_def path_image_shiftpath pathfinish_shiftpath pathstart_shiftpath contour_integral_shiftpath) + apply (simp add: shiftpath_def) + done + qed +qed (use assms in \auto simp: path_shiftpath path_image_shiftpath pathfinish_shiftpath pathstart_shiftpath\) lemma winding_number_split_linepath: assumes "c \ closed_segment a b" "z \ closed_segment a b" @@ -3548,10 +3553,10 @@ lemma winding_number_cong: "(\t. \0 \ t; t \ 1\ \ p t = q t) \ winding_number p z = winding_number q z" - by (simp add: winding_number_def pathstart_def pathfinish_def) + by (simp add: winding_number_def winding_number_prop_def pathstart_def pathfinish_def) lemma winding_number_offset: "winding_number p z = winding_number (\w. p w - z) 0" - apply (simp add: winding_number_def contour_integral_integral path_image_def valid_path_def pathstart_def pathfinish_def) + apply (simp add: winding_number_def winding_number_prop_def contour_integral_integral path_image_def valid_path_def pathstart_def pathfinish_def) apply (intro ext arg_cong [where f = Eps] arg_cong [where f = All] imp_cong refl, safe) apply (rename_tac g) apply (rule_tac x="\t. g t - z" in exI) @@ -3834,7 +3839,7 @@ corollary winding_number_exp_2pi: "\path p; z \ path_image p\ \ pathfinish p - z = exp (2 * pi * \ * winding_number p z) * (pathstart p - z)" -using winding_number [of p z 1] unfolding valid_path_def path_image_def pathstart_def pathfinish_def +using winding_number [of p z 1] unfolding valid_path_def path_image_def pathstart_def pathfinish_def winding_number_prop_def by (force dest: winding_number_exp_integral(2) [of _ 0 1 z] simp: field_simps contour_integral_integral exp_minus) @@ -3849,7 +3854,7 @@ obtain p where p: "valid_path p" "z \ path_image p" "pathstart p = pathstart \" "pathfinish p = pathfinish \" "contour_integral p (\w. 1 / (w - z)) = complex_of_real (2 * pi) * \ * winding_number \ z" - using winding_number [OF assms, of 1] by auto + using winding_number [OF assms, of 1] unfolding winding_number_prop_def by auto have [simp]: "(winding_number \ z \ \) = (exp (contour_integral p (\w. 1 / (w - z))) = 1)" using p by (simp add: exp_eq_1 complex_is_Int_iff) have "winding_number p z \ \ \ pathfinish p = pathstart p" @@ -4002,7 +4007,7 @@ "pathstart p = pathstart \ \ pathfinish p = pathfinish \" and pg: "\t. t\{0..1} \ cmod (\ t - p t) < min d e / 2" and pi: "contour_integral p (\x. 1 / (x - z)) = complex_of_real (2 * pi) * \ * winding_number \ z" - using winding_number [OF \ z, of "min d e / 2"] \d>0\ \e>0\ by auto + using winding_number [OF \ z, of "min d e / 2"] \d>0\ \e>0\ by (auto simp: winding_number_prop_def) { fix w assume d2: "cmod (w - z) < d/2" and e2: "cmod (w - z) < e/2" then have wnotp: "w \ path_image p" @@ -4021,7 +4026,7 @@ and qg: "\t. t \ {0..1} \ cmod (\ t - q t) < min k (min d e) / 2" and qi: "contour_integral q (\u. 1 / (u - w)) = complex_of_real (2 * pi) * \ * winding_number \ w" using winding_number [OF \ wnotg, of "min k (min d e) / 2"] \d>0\ \e>0\ k - by (force simp: min_divide_distrib_right) + by (force simp: min_divide_distrib_right winding_number_prop_def) have "contour_integral p (\u. 1 / (u - w)) = contour_integral q (\u. 1 / (u - w))" apply (rule pi_eq [OF \valid_path q\ \valid_path p\, THEN conjunct2, THEN conjunct2, rule_format]) apply (frule pg) @@ -4037,7 +4042,7 @@ then have "winding_number p w = winding_number \ w" apply (rule winding_number_unique [OF _ wnotp]) apply (rule_tac x=p in exI) - apply (simp add: p wnotp min_divide_distrib_right pip) + apply (simp add: p wnotp min_divide_distrib_right pip winding_number_prop_def) done } note wnwn = this obtain pe where "pe>0" and cbp: "cball z (3 / 4 * pe) \ - path_image p" @@ -4224,7 +4229,7 @@ done } then show ?thesis - by (auto intro: winding_number_unique [OF \] simp add: wnot) + by (auto intro: winding_number_unique [OF \] simp add: winding_number_prop_def wnot) qed finally show ?thesis . qed @@ -4716,13 +4721,13 @@ "pathstart p = pathstart g" "pathfinish p = pathfinish g" and gp_less:"\t\{0..1}. cmod (g t - p t) < d" and pap: "contour_integral p (\w. 1 / (w - z)) = complex_of_real (2 * pi) * \ * winding_number g z" - using winding_number [OF \path g\ pag \0 < d\] by blast + using winding_number [OF \path g\ pag \0 < d\] unfolding winding_number_prop_def by blast obtain q where q: "valid_path q" "z \ path_image q" "pathstart q = pathstart h" "pathfinish q = pathfinish h" and hq_less: "\t\{0..1}. cmod (h t - q t) < e" and paq: "contour_integral q (\w. 1 / (w - z)) = complex_of_real (2 * pi) * \ * winding_number h z" - using winding_number [OF \path h\ pah \0 < e\] by blast + using winding_number [OF \path h\ pah \0 < e\] unfolding winding_number_prop_def by blast have gp: "homotopic_paths (- {z}) g p" by (simp add: d p valid_path_imp_path norm_minus_commute gp_less) have hq: "homotopic_paths (- {z}) h q" @@ -4756,13 +4761,13 @@ "pathstart p = pathstart g" "pathfinish p = pathfinish g" and gp_less:"\t\{0..1}. cmod (g t - p t) < d" and pap: "contour_integral p (\w. 1 / (w - z)) = complex_of_real (2 * pi) * \ * winding_number g z" - using winding_number [OF \path g\ pag \0 < d\] by blast + using winding_number [OF \path g\ pag \0 < d\] unfolding winding_number_prop_def by blast obtain q where q: "valid_path q" "z \ path_image q" "pathstart q = pathstart h" "pathfinish q = pathfinish h" and hq_less: "\t\{0..1}. cmod (h t - q t) < e" and paq: "contour_integral q (\w. 1 / (w - z)) = complex_of_real (2 * pi) * \ * winding_number h z" - using winding_number [OF \path h\ pah \0 < e\] by blast + using winding_number [OF \path h\ pah \0 < e\] unfolding winding_number_prop_def by blast have gp: "homotopic_loops (- {z}) g p" by (simp add: gloop d gp_less norm_minus_commute p valid_path_imp_path) have hq: "homotopic_loops (- {z}) h q"