# HG changeset patch # User paulson # Date 1711632777 0 # Node ID 35b2143aeec6234a36fc7d871a16dc88215a77ea # Parent 19cc354ba62533a01b8d60549da984d716592544 An assortment of new material, mostly due to Manuel diff -r 19cc354ba625 -r 35b2143aeec6 src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Thu Mar 28 08:30:42 2024 +0100 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Thu Mar 28 13:32:57 2024 +0000 @@ -763,6 +763,10 @@ (simp_all add: integral_linear[OF _ bounded_linear_cnj, symmetric] o_def integrable_on_cnj_iff not_integrable_integral) +lemma has_integral_cnj: "(cnj \ f has_integral (cnj I)) A = (f has_integral I) A" + unfolding has_integral_iff comp_def + by (metis integral_cnj complex_cnj_cancel_iff integrable_on_cnj_iff) + lemma integral_component_eq[simp]: fixes f :: "'n::euclidean_space \ 'm::euclidean_space" assumes "f integrable_on S" @@ -2395,6 +2399,12 @@ shows "g integrable_on T" using assms has_integral_spike_finite by blast +lemma integrable_spike_finite_eq: + assumes "finite S" + and "\x. x \ T - S \ f x = g x" + shows "f integrable_on T \ g integrable_on T" + by (metis assms integrable_spike_finite) + lemma has_integral_bound_spike_finite: fixes f :: "'a::euclidean_space \ 'b::real_normed_vector" assumes "0 \ B" "finite S" diff -r 19cc354ba625 -r 35b2143aeec6 src/HOL/Analysis/Homotopy.thy --- a/src/HOL/Analysis/Homotopy.thy Thu Mar 28 08:30:42 2024 +0100 +++ b/src/HOL/Analysis/Homotopy.thy Thu Mar 28 13:32:57 2024 +0000 @@ -623,6 +623,15 @@ by (metis homotopic_paths_reversepath path_image_reversepath path_reversepath pathfinish_linepath pathfinish_reversepath reversepath_joinpaths reversepath_linepath) +lemma homotopic_paths_rid': + assumes "path p" "path_image p \ s" "x = pathfinish p" + shows "homotopic_paths s (p +++ linepath x x) p" + using homotopic_paths_rid[of p s] assms by simp + +lemma homotopic_paths_lid': + "\path p; path_image p \ s; x = pathstart p\ \ homotopic_paths s (linepath x x +++ p) p" + using homotopic_paths_lid[of p s] by simp + proposition homotopic_paths_assoc: "\path p; path_image p \ S; path q; path_image q \ S; path r; path_image r \ S; pathfinish p = pathstart q; pathfinish q = pathstart r\ diff -r 19cc354ba625 -r 35b2143aeec6 src/HOL/Analysis/Path_Connected.thy --- a/src/HOL/Analysis/Path_Connected.thy Thu Mar 28 08:30:42 2024 +0100 +++ b/src/HOL/Analysis/Path_Connected.thy Thu Mar 28 13:32:57 2024 +0000 @@ -121,6 +121,20 @@ using assms by (simp add: loop_free_linear_image_eq path_linear_image_eq simple_path_def) +lemma simple_pathI [intro?]: + assumes "path p" + assumes "\x y. 0 \ x \ x < y \ y \ 1 \ p x = p y \ x = 0 \ y = 1" + shows "simple_path p" + unfolding simple_path_def loop_free_def +proof (intro ballI conjI impI) + fix x y assume "x \ {0..1}" "y \ {0..1}" "p x = p y" + thus "x = y \ x = 0 \ y = 1 \ x = 1 \ y = 0" + by (metis assms(2) atLeastAtMost_iff linorder_less_linear) +qed fact+ + +lemma arcD: "arc p \ p x = p y \ x \ {0..1} \ y \ {0..1} \ x = y" + by (auto simp: arc_def inj_on_def) + lemma arc_translation_eq: fixes g :: "real \ 'a::euclidean_space" shows "arc((\x. a + x) \ g) \ arc g" @@ -670,6 +684,38 @@ using pathfinish_in_path_image by (fastforce simp: arc_join_eq) +subsubsection\<^marker>\tag unimportant\\Symmetry and loops\ + +lemma path_sym: + "\pathfinish p = pathstart q; pathfinish q = pathstart p\ \ path(p +++ q) \ path(q +++ p)" + by auto + +lemma simple_path_sym: + "\pathfinish p = pathstart q; pathfinish q = pathstart p\ + \ simple_path(p +++ q) \ simple_path(q +++ p)" + by (metis (full_types) inf_commute insert_commute simple_path_joinE simple_path_join_loop) + +lemma path_image_sym: + "\pathfinish p = pathstart q; pathfinish q = pathstart p\ + \ path_image(p +++ q) = path_image(q +++ p)" + by (simp add: path_image_join sup_commute) + +lemma simple_path_joinI: + assumes "arc p1" "arc p2" "pathfinish p1 = pathstart p2" + assumes "path_image p1 \ path_image p2 + \ insert (pathstart p2) (if pathstart p1 = pathfinish p2 then {pathstart p1} else {})" + shows "simple_path (p1 +++ p2)" + by (smt (verit, best) Int_commute arc_imp_simple_path arc_join assms insert_commute simple_path_join_loop simple_path_sym) + +lemma simple_path_join3I: + assumes "arc p1" "arc p2" "arc p3" + assumes "path_image p1 \ path_image p2 \ {pathstart p2}" + assumes "path_image p2 \ path_image p3 \ {pathstart p3}" + assumes "path_image p1 \ path_image p3 \ {pathstart p1} \ {pathfinish p3}" + assumes "pathfinish p1 = pathstart p2" "pathfinish p2 = pathstart p3" + shows "simple_path (p1 +++ p2 +++ p3)" + using assms by (intro simple_path_joinI arc_join) (auto simp: path_image_join) + subsection\<^marker>\tag unimportant\\The joining of paths is associative\ lemma path_assoc: @@ -720,22 +766,6 @@ \ arc(p +++ (q +++ r)) \ arc((p +++ q) +++ r)" by (simp add: arc_simple_path simple_path_assoc) -subsubsection\<^marker>\tag unimportant\\Symmetry and loops\ - -lemma path_sym: - "\pathfinish p = pathstart q; pathfinish q = pathstart p\ \ path(p +++ q) \ path(q +++ p)" - by auto - -lemma simple_path_sym: - "\pathfinish p = pathstart q; pathfinish q = pathstart p\ - \ simple_path(p +++ q) \ simple_path(q +++ p)" - by (metis (full_types) inf_commute insert_commute simple_path_joinE simple_path_join_loop) - -lemma path_image_sym: - "\pathfinish p = pathstart q; pathfinish q = pathstart p\ - \ path_image(p +++ q) = path_image(q +++ p)" - by (simp add: path_image_join sup_commute) - subsection\Subpath\ diff -r 19cc354ba625 -r 35b2143aeec6 src/HOL/Analysis/Smooth_Paths.thy --- a/src/HOL/Analysis/Smooth_Paths.thy Thu Mar 28 08:30:42 2024 +0100 +++ b/src/HOL/Analysis/Smooth_Paths.thy Thu Mar 28 13:32:57 2024 +0000 @@ -3,8 +3,7 @@ *) section\<^marker>\tag unimportant\ \Smooth paths\ theory Smooth_Paths - imports - Retracts + imports Retracts begin subsection\<^marker>\tag unimportant\ \Homeomorphisms of arc images\ @@ -439,4 +438,97 @@ lemma valid_path_rectpath [simp, intro]: "valid_path (rectpath a b)" by (simp add: Let_def rectpath_def) +lemma linear_image_valid_path: + fixes p :: "real \ 'a :: euclidean_space" + assumes "valid_path p" "linear f" + shows "valid_path (f \ p)" + unfolding valid_path_def piecewise_C1_differentiable_on_def +proof (intro conjI) + from assms have "path p" + by (simp add: valid_path_imp_path) + thus "continuous_on {0..1} (f \ p)" + unfolding o_def path_def by (intro linear_continuous_on_compose[OF _ assms(2)]) + from assms(1) obtain S where S: "finite S" "p C1_differentiable_on {0..1} - S" + by (auto simp: valid_path_def piecewise_C1_differentiable_on_def) + from S(2) obtain p' :: "real \ 'a" + where p': "\x. x \ {0..1} - S \ (p has_vector_derivative p' x) (at x)" + "continuous_on ({0..1} - S) p'" + by (fastforce simp: C1_differentiable_on_def) + + have "(f \ p has_vector_derivative f (p' x)) (at x)" if "x \ {0..1} - S" for x + by (rule vector_derivative_diff_chain_within [OF p'(1)[OF that]] + linear_imp_has_derivative assms)+ + moreover have "continuous_on ({0..1} - S) (\x. f (p' x))" + by (rule linear_continuous_on_compose [OF p'(2) assms(2)]) + ultimately have "f \ p C1_differentiable_on {0..1} - S" + unfolding C1_differentiable_on_def by (intro exI[of _ "\x. f (p' x)"]) fast + thus "\S. finite S \ f \ p C1_differentiable_on {0..1} - S" + using \finite S\ by blast +qed + +lemma valid_path_times: + fixes \::"real \ 'a ::real_normed_field" + assumes "c\0" + shows "valid_path ((*) c \ \) = valid_path \" +proof + assume "valid_path ((*) c \ \)" + then have "valid_path ((*) (1/c) \ ((*) c \ \))" + by (simp add: valid_path_compose) + then show "valid_path \" + unfolding comp_def using \c\0\ by auto +next + assume "valid_path \" + then show "valid_path ((*) c \ \)" + by (simp add: valid_path_compose) +qed + +lemma path_compose_cnj_iff [simp]: "path (cnj \ p) \ path p" +proof - + have "path (cnj \ p)" if "path p" for p + by (intro path_continuous_image continuous_intros that) + from this[of p] and this[of "cnj \ p"] show ?thesis + by (auto simp: o_def) +qed + +lemma valid_path_cnj: + fixes g::"real \ complex" + shows "valid_path (cnj \ g) = valid_path g" +proof + show valid:"valid_path (cnj \ g)" if "valid_path g" for g + proof - + obtain S where "finite S" and g_diff: "g C1_differentiable_on {0..1} - S" + using \valid_path g\ unfolding valid_path_def piecewise_C1_differentiable_on_def by auto + + have g_diff':"g differentiable at t" when "t\{0..1} - S" for t + by (meson C1_differentiable_on_eq \g C1_differentiable_on {0..1} - S\ that) + then have "(cnj \ g) differentiable at t" when "t\{0..1} - S" for t + using bounded_linear_cnj bounded_linear_imp_differentiable differentiable_chain_at that by blast + moreover have "continuous_on ({0..1} - S) + (\x. vector_derivative (cnj \ g) (at x))" + proof - + have "continuous_on ({0..1} - S) + (\x. vector_derivative (cnj \ g) (at x)) + = continuous_on ({0..1} - S) + (\x. cnj (vector_derivative g (at x)))" + apply (rule continuous_on_cong[OF refl]) + unfolding comp_def using g_diff' + using has_vector_derivative_cnj vector_derivative_at vector_derivative_works by blast + also have "\" + apply (intro continuous_intros) + using C1_differentiable_on_eq g_diff by blast + finally show ?thesis . + qed + ultimately have "cnj \ g C1_differentiable_on {0..1} - S" + using C1_differentiable_on_eq by blast + moreover have "path (cnj \ g)" + apply (rule path_continuous_image[OF valid_path_imp_path[OF \valid_path g\]]) + by (intro continuous_intros) + ultimately show ?thesis unfolding valid_path_def piecewise_C1_differentiable_on_def path_def + using \finite S\ by auto + qed + from this[of "cnj o g"] + show "valid_path (cnj \ g) \ valid_path g" + unfolding comp_def by simp +qed + end diff -r 19cc354ba625 -r 35b2143aeec6 src/HOL/Complex_Analysis/Contour_Integration.thy --- a/src/HOL/Complex_Analysis/Contour_Integration.thy Thu Mar 28 08:30:42 2024 +0100 +++ b/src/HOL/Complex_Analysis/Contour_Integration.thy Thu Mar 28 13:32:57 2024 +0000 @@ -1278,6 +1278,80 @@ lemma part_circlepath_cnj: "cnj (part_circlepath c r a b x) = part_circlepath (cnj c) r (-a) (-b) x" by (simp add: part_circlepath_def exp_cnj linepath_def algebra_simps) +lemma contour_integrable_on_compose_cnj_iff: + assumes "valid_path \" + shows "f contour_integrable_on (cnj \ \) \ (cnj \ f \ cnj) contour_integrable_on \" +proof - + from assms obtain S where S: "finite S" "\ C1_differentiable_on {0..1} - S" + unfolding valid_path_def piecewise_C1_differentiable_on_def by blast + have "f contour_integrable_on (cnj \ \) \ + ((\t. cnj (cnj (f (cnj (\ t))) * vector_derivative \ (at t))) integrable_on {0..1})" + unfolding contour_integrable_on o_def + proof (intro integrable_spike_finite_eq [OF S(1)]) + fix t :: real assume "t \ {0..1} - S" + hence "\ differentiable at t" + using S(2) by (meson C1_differentiable_on_eq) + hence "vector_derivative (\x. cnj (\ x)) (at t) = cnj (vector_derivative \ (at t))" + by (rule vector_derivative_cnj) + thus "f (cnj (\ t)) * vector_derivative (\x. cnj (\ x)) (at t) = + cnj (cnj (f (cnj (\ t))) * vector_derivative \ (at t))" + by simp + qed + also have "\ \ ((\t. cnj (f (cnj (\ t))) * vector_derivative \ (at t)) integrable_on {0..1})" + by (rule integrable_on_cnj_iff) + also have "\ \ (cnj \ f \ cnj) contour_integrable_on \" + by (simp add: contour_integrable_on o_def) + finally show ?thesis . +qed + +lemma contour_integral_cnj: + assumes "valid_path \" + shows "contour_integral (cnj \ \) f = cnj (contour_integral \ (cnj \ f \ cnj))" +proof - + from assms obtain S where S: "finite S" "\ C1_differentiable_on {0..1} - S" + unfolding valid_path_def piecewise_C1_differentiable_on_def by blast + have "contour_integral (cnj \ \) f = + integral {0..1} (\t. cnj (cnj (f (cnj (\ t))) * vector_derivative \ (at t)))" + unfolding contour_integral_integral + proof (intro integral_spike) + fix t assume "t \ {0..1} - S" + hence "\ differentiable at t" + using S(2) by (meson C1_differentiable_on_eq) + hence "vector_derivative (\x. cnj (\ x)) (at t) = cnj (vector_derivative \ (at t))" + by (rule vector_derivative_cnj) + thus "cnj (cnj (f (cnj (\ t))) * vector_derivative \ (at t)) = + f ((cnj \ \) t) * vector_derivative (cnj \ \) (at t)" + by (simp add: o_def) + qed (use S(1) in auto) + also have "\ = cnj (integral {0..1} (\t. cnj (f (cnj (\ t))) * vector_derivative \ (at t)))" + by (subst integral_cnj [symmetric]) auto + also have "\ = cnj (contour_integral \ (cnj \ f \ cnj))" + by (simp add: contour_integral_integral) + finally show ?thesis . +qed + +lemma contour_integral_negatepath: + assumes "valid_path \" + shows "contour_integral (uminus \ \) f = -(contour_integral \ (\x. f (-x)))" (is "?lhs = ?rhs") +proof (cases "f contour_integrable_on (uminus \ \)") + case True + hence *: "(f has_contour_integral ?lhs) (uminus \ \)" + using has_contour_integral_integral by blast + have "((\z. f (-z)) has_contour_integral - contour_integral (uminus \ \) f) + (uminus \ (uminus \ \))" + by (rule has_contour_integral_negatepath) (use * assms in auto) + hence "((\x. f (-x)) has_contour_integral -?lhs) \" + by (simp add: o_def) + thus ?thesis + by (simp add: contour_integral_unique) +next + case False + hence "\(\z. f (- z)) contour_integrable_on \" + using contour_integrable_negatepath[of \ f] assms by auto + with False show ?thesis + by (simp add: not_integrable_contour_integral) +qed + lemma contour_integral_bound_part_circlepath: assumes "f contour_integrable_on part_circlepath c r a b" assumes "B \ 0" "r \ 0" "\x. x \ path_image (part_circlepath c r a b) \ norm (f x) \ B" @@ -1687,12 +1761,11 @@ { fix e::real assume "0 < e" then have "0 < e / (\B\ + 1)" by simp - then have "\\<^sub>F n in F. \x\path_image \. cmod (f n x - l x) < e / (\B\ + 1)" + then have \
: "\\<^sub>F n in F. \x\path_image \. cmod (f n x - l x) < e / (\B\ + 1)" using ul_f [unfolded uniform_limit_iff dist_norm] by auto - with ev_fint obtain a where fga: "\x. x \ {0..1} \ cmod (f a (\ x) - l (\ x)) < e / (\B\ + 1)" and inta: "(\t. f a (\ t) * vector_derivative \ (at t)) integrable_on {0..1}" - using eventually_happens [OF eventually_conj] + using eventually_happens [OF eventually_conj [OF ev_fint \
]] by (fastforce simp: contour_integrable_on path_image_def) have "\h. (\x\{0..1}. cmod (l (\ x) * vector_derivative \ (at x) - h x) \ e) \ h integrable_on {0..1}" proof (intro exI conjI ballI) diff -r 19cc354ba625 -r 35b2143aeec6 src/HOL/Complex_Analysis/Winding_Numbers.thy --- a/src/HOL/Complex_Analysis/Winding_Numbers.thy Thu Mar 28 08:30:42 2024 +0100 +++ b/src/HOL/Complex_Analysis/Winding_Numbers.thy Thu Mar 28 13:32:57 2024 +0000 @@ -87,6 +87,30 @@ by simp qed +lemma winding_number_prop_reversepath: + assumes "winding_number_prop \ z e p n" + shows "winding_number_prop (reversepath \) z e (reversepath p) (-n)" +proof - + have p: "valid_path p" "z \ path_image p" "pathstart p = pathstart \" + "pathfinish p = pathfinish \" "\t. t \ {0..1} \ norm (\ t - p t) < e" + "contour_integral p (\w. 1 / (w - z)) = 2 * complex_of_real pi * \ * n" + using assms by (auto simp: winding_number_prop_def) + show ?thesis + unfolding winding_number_prop_def + proof (intro conjI strip) + show "norm (reversepath \ t - reversepath p t) < e" if "t \ {0..1}" for t + unfolding reversepath_def using p(5)[of "1 - t"] that by auto + show "contour_integral (reversepath p) (\w. 1 / (w - z)) = + complex_of_real (2 * pi) * \ * - n" + using p by (subst contour_integral_reversepath) auto + qed (use p in auto) +qed + +lemma winding_number_prop_reversepath_iff: + "winding_number_prop (reversepath \) z e p n \ winding_number_prop \ z e (reversepath p) (-n)" + using winding_number_prop_reversepath[of "reversepath \" z e p n] + winding_number_prop_reversepath[of \ z e "reversepath p" "-n"] by auto + (*NB not winding_number_prop here due to the loop in p*) lemma winding_number_unique_loop: assumes \: "path \" "z \ path_image \" @@ -274,6 +298,63 @@ using assms by (simp add: winding_number_valid_path valid_path_negatepath image_def path_defs) qed +lemma winding_number_cnj: + assumes "path \" "z \ path_image \" + shows "winding_number (cnj \ \) (cnj z) = -cnj (winding_number \ z)" +proof (rule winding_number_unique) + show "\p. winding_number_prop (cnj \ \) (cnj z) e p (-cnj (winding_number \ z))" + if "e > 0" for e + proof - + from winding_number[OF assms(1,2) \e > 0\] + obtain p where "winding_number_prop \ z e p (winding_number \ z)" + by blast + then have p: "valid_path p" "z \ path_image p" + "pathstart p = pathstart \" + "pathfinish p = pathfinish \" + "\t. t \ {0..1} \ cmod (\ t - p t) < e" and + p_cont:"contour_integral p (\w. 1 / (w - z)) = + complex_of_real (2 * pi) * \ * winding_number \ z" + unfolding winding_number_prop_def by auto + + have "valid_path (cnj \ p)" + using p(1) by (subst valid_path_cnj) auto + moreover have "cnj z \ path_image (cnj \ p)" + using p(2) by (auto simp: path_image_def) + moreover have "pathstart (cnj \ p) = pathstart (cnj \ \)" + using p(3) by (simp add: pathstart_compose) + moreover have "pathfinish (cnj \ p) = pathfinish (cnj \ \)" + using p(4) by (simp add: pathfinish_compose) + moreover have "cmod ((cnj \ \) t - (cnj \ p) t) < e" + if t: "t \ {0..1}" for t + proof - + have "(cnj \ \) t - (cnj \ p) t = cnj (\ t - p t)" + by simp + also have "norm \ = norm (\ t - p t)" + by (subst complex_mod_cnj) auto + also have "\ < e" + using p(5)[OF t] by simp + finally show ?thesis . + qed + moreover have "contour_integral (cnj \ p) (\w. 1 / (w - cnj z)) = + cnj (complex_of_real (2 * pi) * \ * winding_number \ z)" (is "?L=?R") + proof - + have "?L = contour_integral (cnj \ p) (cnj \ (\w. 1 / (cnj w - z)))" + by (simp add: o_def) + also have "\ = cnj (contour_integral p (\x. 1 / (x - z)))" + using p(1) by (subst contour_integral_cnj) (auto simp: o_def) + also have "\ = ?R" + using p_cont by simp + finally show ?thesis . + qed + ultimately show ?thesis + by (intro exI[of _ "cnj \ p"]) (auto simp: winding_number_prop_def) + qed + show "path (cnj \ \)" + by (intro path_continuous_image continuous_intros) (use assms in auto) + show "cnj z \ path_image (cnj \ \)" + using \z \ path_image \\ unfolding path_image_def by auto +qed + text \A combined theorem deducing several things piecewise.\ lemma winding_number_join_pos_combined: "\valid_path \1; z \ path_image \1; 0 < Re(winding_number \1 z); diff -r 19cc354ba625 -r 35b2143aeec6 src/HOL/Transcendental.thy --- a/src/HOL/Transcendental.thy Thu Mar 28 08:30:42 2024 +0100 +++ b/src/HOL/Transcendental.thy Thu Mar 28 13:32:57 2024 +0000 @@ -2994,14 +2994,20 @@ by (auto simp: powr_minus field_simps) qed +lemma powr_mono': "a \ (b::real) \ x \ 0 \ x \ 1 \ x powr b \ x powr a" + using powr_mono[of "-b" "-a" "inverse x"] by (auto simp: powr_def ln_inverse ln_div field_split_simps) + lemma powr_mono_both: fixes x :: real assumes "0 \ a" "a \ b" "1 \ x" "x \ y" shows "x powr a \ y powr b" by (meson assms order.trans powr_mono powr_mono2 zero_le_one) -lemma powr_mono': "a \ (b::real) \ x \ 0 \ x \ 1 \ x powr b \ x powr a" - using powr_mono[of "-b" "-a" "inverse x"] by (auto simp: powr_def ln_inverse ln_div field_split_simps) +lemma powr_mono_both': + fixes x :: real + assumes "a \ b" "b\0" "0 < x" "x \ y" "y \ 1" + shows "x powr a \ y powr b" + by (meson assms nless_le order.trans powr_mono' powr_mono2) lemma powr_less_mono': assumes "(x::real) > 0" "x < 1" "a < b"