# HG changeset patch # User paulson # Date 1677846127 0 # Node ID fd9422c110ed0565a3718bdd815c48ec511fe8a5 # Parent 8a28ab58d155e20b46bc55dab0c3e0b9ff0f5a9b# Parent 9d431c939a7fff11ebafd032827f832caf47d4f2 merged diff -r 8a28ab58d155 -r fd9422c110ed src/HOL/Analysis/Convex.thy --- a/src/HOL/Analysis/Convex.thy Fri Mar 03 11:25:29 2023 +0100 +++ b/src/HOL/Analysis/Convex.thy Fri Mar 03 12:22:07 2023 +0000 @@ -2369,9 +2369,6 @@ using hull_inc u by fastforce qed -lemma inner_sum_Basis[simp]: "i \ Basis \ (\Basis) \ i = 1" - by (simp add: inner_sum_left sum.If_cases inner_Basis) - lemma convex_set_plus: assumes "convex S" and "convex T" shows "convex (S + T)" proof - diff -r 8a28ab58d155 -r fd9422c110ed src/HOL/Analysis/Elementary_Metric_Spaces.thy --- a/src/HOL/Analysis/Elementary_Metric_Spaces.thy Fri Mar 03 11:25:29 2023 +0100 +++ b/src/HOL/Analysis/Elementary_Metric_Spaces.thy Fri Mar 03 12:22:07 2023 +0000 @@ -895,6 +895,17 @@ by (rule bounded_subset) qed +lemma continuous_on_compact_bound: + assumes "compact A" "continuous_on A f" + obtains B where "B \ 0" "\x. x \ A \ norm (f x) \ B" +proof - + have "compact (f ` A)" by (metis assms compact_continuous_image) + then obtain B where "\x\A. norm (f x) \ B" + by (auto dest!: compact_imp_bounded simp: bounded_iff) + hence "max B 0 \ 0" and "\x\A. norm (f x) \ max B 0" by auto + thus ?thesis using that by blast +qed + lemma closure_Int_ball_not_empty: assumes "S \ closure T" "x \ S" "r > 0" shows "T \ ball x r \ {}" diff -r 8a28ab58d155 -r fd9422c110ed src/HOL/Analysis/Euclidean_Space.thy --- a/src/HOL/Analysis/Euclidean_Space.thy Fri Mar 03 11:25:29 2023 +0100 +++ b/src/HOL/Analysis/Euclidean_Space.thy Fri Mar 03 12:22:07 2023 +0000 @@ -53,6 +53,9 @@ lemma (in euclidean_space) sgn_Basis: "u \ Basis \ sgn u = u" unfolding sgn_div_norm by (simp add: scaleR_one) +lemma inner_sum_Basis[simp]: "i \ Basis \ inner (\Basis) i = 1" + by (simp add: inner_sum_left sum.If_cases inner_Basis) + lemma (in euclidean_space) Basis_zero [simp]: "0 \ Basis" proof assume "0 \ Basis" thus "False" diff -r 8a28ab58d155 -r fd9422c110ed src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Fri Mar 03 11:25:29 2023 +0100 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Fri Mar 03 12:22:07 2023 +0000 @@ -12,8 +12,7 @@ lemma norm_diff2: "\y = y1 + y2; x = x1 + x2; e = e1 + e2; norm(y1 - x1) \ e1; norm(y2 - x2) \ e2\ \ norm(y-x) \ e" - using norm_triangle_mono [of "y1 - x1" "e1" "y2 - x2" "e2"] - by (simp add: add_diff_add) + by (smt (verit, ccfv_SIG) norm_diff_triangle_ineq) lemma setcomp_dot1: "{z. P (z \ (i,0))} = {(x,y). P(x \ i)}" by auto @@ -2326,11 +2325,9 @@ qed lemma has_integral_spike_eq: - assumes "negligible S" - and gf: "\x. x \ T - S \ g x = f x" + assumes "negligible S" and "\x. x \ T - S \ g x = f x" shows "(f has_integral y) T \ (g has_integral y) T" - using has_integral_spike [OF \negligible S\] gf - by metis + by (metis assms has_integral_spike) lemma integrable_spike: assumes "f integrable_on T" "negligible S" "\x. x \ T - S \ g x = f x" @@ -4878,13 +4875,22 @@ lemma integrable_on_superset: fixes f :: "'n::euclidean_space \ 'a::banach" - assumes "f integrable_on S" - and "\x. x \ S \ f x = 0" - and "S \ t" + assumes "f integrable_on S" and "\x. x \ S \ f x = 0" and "S \ t" shows "f integrable_on t" - using assms - unfolding integrable_on_def - by (auto intro:has_integral_on_superset) + by (meson assms has_integral_on_superset integrable_integral integrable_on_def) + +lemma integral_subset_negligible: + fixes f :: "'a :: euclidean_space \ 'b :: banach" + assumes "S \ T" "negligible (T - S)" + shows "integral S f = integral T f" +proof - + have "integral T f = integral T (\x. if x \ S then f x else 0)" + by (rule integral_spike[of "T - S"]) (use assms in auto) + also have "\ = integral (S \ T) f" + by (subst integral_restrict_Int) auto + also have "S \ T = S" using assms by auto + finally show ?thesis .. +qed lemma integral_restrict_UNIV: fixes f :: "'n::euclidean_space \ 'a::banach" diff -r 8a28ab58d155 -r fd9422c110ed src/HOL/Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Analysis/Topology_Euclidean_Space.thy Fri Mar 03 11:25:29 2023 +0100 +++ b/src/HOL/Analysis/Topology_Euclidean_Space.thy Fri Mar 03 12:22:07 2023 +0000 @@ -840,6 +840,76 @@ by (metis assms continuous_on_compose continuous_on_swap swap_cbox_Pair) qed +lemma open_contains_cbox: + fixes x :: "'a :: euclidean_space" + assumes "open A" "x \ A" + obtains a b where "cbox a b \ A" "x \ box a b" "\i\Basis. a \ i < b \ i" +proof - + from assms obtain R where R: "R > 0" "ball x R \ A" + by (auto simp: open_contains_ball) + define r :: real where "r = R / (2 * sqrt DIM('a))" + from \R > 0\ have [simp]: "r > 0" by (auto simp: r_def) + define d :: 'a where "d = r *\<^sub>R Topology_Euclidean_Space.One" + have "cbox (x - d) (x + d) \ A" + proof safe + fix y assume y: "y \ cbox (x - d) (x + d)" + have "dist x y = sqrt (\i\Basis. (dist (x \ i) (y \ i))\<^sup>2)" + by (subst euclidean_dist_l2) (auto simp: L2_set_def) + also from y have "sqrt (\i\Basis. (dist (x \ i) (y \ i))\<^sup>2) \ sqrt (\i\(Basis::'a set). r\<^sup>2)" + by (intro real_sqrt_le_mono sum_mono power_mono) + (auto simp: dist_norm d_def cbox_def algebra_simps) + also have "\ = sqrt (DIM('a) * r\<^sup>2)" by simp + also have "DIM('a) * r\<^sup>2 = (R / 2) ^ 2" + by (simp add: r_def power_divide) + also have "sqrt \ = R / 2" + using \R > 0\ by simp + also from \R > 0\ have "\ < R" by simp + finally have "y \ ball x R" by simp + with R show "y \ A" by blast + qed + thus ?thesis + using that[of "x - d" "x + d"] by (auto simp: algebra_simps d_def box_def) +qed + +lemma open_contains_box: + fixes x :: "'a :: euclidean_space" + assumes "open A" "x \ A" + obtains a b where "box a b \ A" "x \ box a b" "\i\Basis. a \ i < b \ i" + by (meson assms box_subset_cbox dual_order.trans open_contains_cbox) + +lemma inner_image_box: + assumes "(i :: 'a :: euclidean_space) \ Basis" + assumes "\i\Basis. a \ i < b \ i" + shows "(\x. x \ i) ` box a b = {a \ i<.. i}" +proof safe + fix x assume x: "x \ {a \ i<.. i}" + let ?y = "(\j\Basis. (if i = j then x else (a + b) \ j / 2) *\<^sub>R j)" + from x assms have "?y \ i \ (\x. x \ i) ` box a b" + by (intro imageI) (auto simp: box_def algebra_simps) + also have "?y \ i = (\j\Basis. (if i = j then x else (a + b) \ j / 2) * (j \ i))" + by (simp add: inner_sum_left) + also have "\ = (\j\Basis. if i = j then x else 0)" + by (intro sum.cong) (auto simp: inner_not_same_Basis assms) + also have "\ = x" using assms by simp + finally show "x \ (\x. x \ i) ` box a b" . +qed (insert assms, auto simp: box_def) + +lemma inner_image_cbox: + assumes "(i :: 'a :: euclidean_space) \ Basis" + assumes "\i\Basis. a \ i \ b \ i" + shows "(\x. x \ i) ` cbox a b = {a \ i..b \ i}" +proof safe + fix x assume x: "x \ {a \ i..b \ i}" + let ?y = "(\j\Basis. (if i = j then x else a \ j) *\<^sub>R j)" + from x assms have "?y \ i \ (\x. x \ i) ` cbox a b" + by (intro imageI) (auto simp: cbox_def) + also have "?y \ i = (\j\Basis. (if i = j then x else a \ j) * (j \ i))" + by (simp add: inner_sum_left) + also have "\ = (\j\Basis. if i = j then x else 0)" + by (intro sum.cong) (auto simp: inner_not_same_Basis assms) + also have "\ = x" using assms by simp + finally show "x \ (\x. x \ i) ` cbox a b" . +qed (insert assms, auto simp: cbox_def) subsection \General Intervals\ diff -r 8a28ab58d155 -r fd9422c110ed src/HOL/Archimedean_Field.thy --- a/src/HOL/Archimedean_Field.thy Fri Mar 03 11:25:29 2023 +0100 +++ b/src/HOL/Archimedean_Field.thy Fri Mar 03 12:22:07 2023 +0000 @@ -417,33 +417,7 @@ lemma floor_divide_of_nat_eq: "\of_nat m / of_nat n\ = of_nat (m div n)" for m n :: nat -proof (cases "n = 0") - case True - then show ?thesis by simp -next - case False - then have *: "\of_nat (m mod n) / of_nat n :: 'a\ = 0" - by (auto intro: floor_unique) - have "(of_nat m :: 'a) = of_nat (m div n * n + m mod n)" - by simp - also have "\ = (of_nat (m div n) + of_nat (m mod n) / of_nat n) * of_nat n" - using False by (simp only: of_nat_add) (simp add: field_simps) - finally have "(of_nat m / of_nat n :: 'a) = \ / of_nat n" - by simp - then have "(of_nat m / of_nat n :: 'a) = of_nat (m div n) + of_nat (m mod n) / of_nat n" - using False by (simp only:) simp - then have "\of_nat m / of_nat n :: 'a\ = \of_nat (m div n) + of_nat (m mod n) / of_nat n :: 'a\" - by simp - then have "\of_nat m / of_nat n :: 'a\ = \of_nat (m mod n) / of_nat n + of_nat (m div n) :: 'a\" - by (simp add: ac_simps) - moreover have "(of_nat (m div n) :: 'a) = of_int (of_nat (m div n))" - by simp - ultimately have "\of_nat m / of_nat n :: 'a\ = - \of_nat (m mod n) / of_nat n :: 'a\ + of_nat (m div n)" - by (simp only: floor_add_int) - with * show ?thesis - by simp -qed + by (metis floor_divide_of_int_eq of_int_of_nat_eq unique_euclidean_semiring_with_nat_class.of_nat_div) lemma floor_divide_lower: fixes q :: "'a::floor_ceiling" diff -r 8a28ab58d155 -r fd9422c110ed src/HOL/Complex_Analysis/Contour_Integration.thy --- a/src/HOL/Complex_Analysis/Contour_Integration.thy Fri Mar 03 11:25:29 2023 +0100 +++ b/src/HOL/Complex_Analysis/Contour_Integration.thy Fri Mar 03 12:22:07 2023 +0000 @@ -23,7 +23,7 @@ subsection\Definition\ text\ - This definition is for complex numbers only, and does not generalise to + This definition is for complex numbers only, and does not generalise to line integrals in a vector field \ @@ -92,6 +92,47 @@ (\t. f(g t) * vector_derivative g (at t)) integrable_on {0..1}" by (simp add: has_contour_integral integrable_on_def contour_integrable_on_def) +lemma has_contour_integral_mirror_iff: + assumes "valid_path g" + shows "(f has_contour_integral I) (-g) \ ((\x. -f (- x)) has_contour_integral I) g" +proof - + from assms have "g piecewise_differentiable_on {0..1}" + by (auto simp: valid_path_def piecewise_C1_imp_differentiable) + then obtain S where "finite S" and S: "\x. x \ {0..1} - S \ g differentiable at x within {0..1}" + unfolding piecewise_differentiable_on_def by blast + have S': "g differentiable at x" if "x \ {0..1} - ({0, 1} \ S)" for x + proof - + from that have "x \ interior {0..1}" by auto + with S[of x] that show ?thesis by (auto simp: at_within_interior[of _ "{0..1}"]) + qed + + have "(f has_contour_integral I) (-g) \ + ((\x. f (- g x) * vector_derivative (-g) (at x)) has_integral I) {0..1}" + by (simp add: has_contour_integral) + also have "\ \ ((\x. -f (- g x) * vector_derivative g (at x)) has_integral I) {0..1}" + by (intro has_integral_spike_finite_eq[of "S \ {0, 1}"]) + (insert \finite S\ S', auto simp: o_def fun_Compl_def) + also have "\ \ ((\x. -f (-x)) has_contour_integral I) g" + by (simp add: has_contour_integral) + finally show ?thesis . +qed + +lemma contour_integral_on_mirror_iff: + assumes "valid_path g" + shows "f contour_integrable_on (-g) \ (\x. -f (- x)) contour_integrable_on g" + by (auto simp: contour_integrable_on_def has_contour_integral_mirror_iff assms) + +lemma contour_integral_mirror: + assumes "valid_path g" + shows "contour_integral (-g) f = contour_integral g (\x. -f (- x))" +proof (cases "f contour_integrable_on (-g)") + case True with contour_integral_unique assms show ?thesis + by (auto simp: contour_integrable_on_def has_contour_integral_mirror_iff) +next + case False then show ?thesis + by (simp add: assms contour_integral_on_mirror_iff not_integrable_contour_integral) +qed + subsection\<^marker>\tag unimportant\ \Reversing a path\ lemma has_contour_integral_reversepath: @@ -170,12 +211,12 @@ has_integral_affinity01 [OF 2, where m= 2 and c="-1", THEN has_integral_cmul [where c=2]] by (simp_all only: image_affinity_atLeastAtMost_div_diff, simp_all add: scaleR_conv_of_real mult_ac) have g1: "vector_derivative (\x. if x*2 \ 1 then g1 (2*x) else g2 (2*x - 1)) (at z) = - 2 *\<^sub>R vector_derivative g1 (at (z*2))" + 2 *\<^sub>R vector_derivative g1 (at (z*2))" if "0 \ z" "z*2 < 1" "z*2 \ s1" for z proof (rule vector_derivative_at [OF has_vector_derivative_transform_within]) show "0 < \z - 1/2\" using that by auto - have "((*) 2 has_vector_derivative 2) (at z)" + have "((*) 2 has_vector_derivative 2) (at z)" by (simp add: has_vector_derivative_def has_derivative_def bounded_linear_mult_left) moreover have "(g1 has_vector_derivative vector_derivative g1 (at (z * 2))) (at (2 * z))" using s1 that by (auto simp: algebra_simps vector_derivative_works) @@ -185,7 +226,7 @@ qed (use that in \simp_all add: dist_real_def abs_if split: if_split_asm\) have g2: "vector_derivative (\x. if x*2 \ 1 then g1 (2*x) else g2 (2*x - 1)) (at z) = - 2 *\<^sub>R vector_derivative g2 (at (z*2 - 1))" + 2 *\<^sub>R vector_derivative g2 (at (z*2 - 1))" if "1 < z*2" "z \ 1" "z*2 - 1 \ s2" for z proof (rule vector_derivative_at [OF has_vector_derivative_transform_within]) show "0 < \z - 1/2\" @@ -234,7 +275,7 @@ then have *: "(\x. (f ((g1 +++ g2) (x/2))/2) * vector_derivative (g1 +++ g2) (at (x/2))) integrable_on {0..1}" by (auto dest: integrable_cmul [where c="1/2"] simp: scaleR_conv_of_real) have g1: "vector_derivative (\x. if x*2 \ 1 then g1 (2*x) else g2 (2*x - 1)) (at (z/2)) = - 2 *\<^sub>R vector_derivative g1 (at z)" + 2 *\<^sub>R vector_derivative g1 (at z)" if "0 < z" "z < 1" "z \ s1" for z proof (rule vector_derivative_at [OF has_vector_derivative_transform_within]) show "0 < \(z - 1)/2\" @@ -261,14 +302,14 @@ where s2: "finite s2" "\x\{0..1} - s2. g2 differentiable at x" using assms by (auto simp: valid_path_def piecewise_C1_differentiable_on_def C1_differentiable_on_eq) have "(\x. f ((g1 +++ g2) (x/2 + 1/2)) * vector_derivative (g1 +++ g2) (at (x/2 + 1/2))) integrable_on {0..1}" - using assms integrable_affinity [of _ "1/2::real" 1 "1/2" "1/2"] + using assms integrable_affinity [of _ "1/2::real" 1 "1/2" "1/2"] integrable_on_subcbox [where a="1/2" and b=1] by (fastforce simp: contour_integrable_on image_affinity_atLeastAtMost_diff) then have *: "(\x. (f ((g1 +++ g2) (x/2 + 1/2))/2) * vector_derivative (g1 +++ g2) (at (x/2 + 1/2))) integrable_on {0..1}" by (auto dest: integrable_cmul [where c="1/2"] simp: scaleR_conv_of_real) have g2: "vector_derivative (\x. if x*2 \ 1 then g1 (2*x) else g2 (2*x - 1)) (at (z/2+1/2)) = - 2 *\<^sub>R vector_derivative g2 (at z)" + 2 *\<^sub>R vector_derivative g2 (at z)" if "0 < z" "z < 1" "z \ s2" for z proof (rule vector_derivative_at [OF has_vector_derivative_transform_within]) show "0 < \z/2\" @@ -600,6 +641,22 @@ unfolding contour_integral_integral using assms by (intro integral_cong) (auto simp: path_image_def) +lemma contour_integral_spike_finite_simple_path: + assumes "finite A" "simple_path g" "g = g'" "\x. x \ path_image g - A \ f x = f' x" + shows "contour_integral g f = contour_integral g' f'" + unfolding contour_integral_integral +proof (rule integral_spike) + have "finite (g -` A \ {0<..<1})" using \simple_path g\ \finite A\ + by (intro finite_vimage_IntI simple_path_inj_on) auto + hence "finite ({0, 1} \ g -` A \ {0<..<1})" by auto + thus "negligible ({0, 1} \ g -` A \ {0<..<1})" by (rule negligible_finite) +next + fix x assume "x \ {0..1} - ({0, 1} \ g -` A \ {0<..<1})" + hence "g x \ path_image g - A" by (auto simp: path_image_def) + from assms(4)[OF this] and assms(3) + show "f' (g' x) * vector_derivative g' (at x) = f (g x) * vector_derivative g (at x)" by simp + qed + text \Contour integral along a segment on the real axis\ @@ -619,7 +676,7 @@ also have "(\x. f (a + b * of_real x - a * of_real x)) = (\x. (f (a + b * of_real x - a * of_real x) * (b - a)) /\<^sub>R (Re b - Re a))" using \a \ b\ by (auto simp: field_simps fun_eq_iff scaleR_conv_of_real) - also have "(\ has_integral I /\<^sub>R (Re b - Re a)) {0..1} \ + also have "(\ has_integral I /\<^sub>R (Re b - Re a)) {0..1} \ ((\x. f (linepath a b x) * (b - a)) has_integral I) {0..1}" using assms by (subst has_integral_cmul_iff) (auto simp: linepath_def scaleR_conv_of_real algebra_simps) also have "\ \ (f has_contour_integral I) (linepath a b)" unfolding has_contour_integral_def @@ -846,8 +903,7 @@ "\f contour_integrable_on (linepath a b); 0 \ B; \x. x \ closed_segment a b \ norm(f x) \ B\ \ norm(contour_integral (linepath a b) f) \ B*norm(b - a)" - using has_contour_integral_bound_linepath [of f] - by (auto simp: has_contour_integral_integral) + by (meson has_contour_integral_bound_linepath has_contour_integral_integral) lemma contour_integral_0 [simp]: "contour_integral g (\x. 0) = 0" by (simp add: contour_integral_unique has_contour_integral_0) @@ -900,6 +956,10 @@ unfolding contour_integrable_on_def by (metis has_contour_integral_sum) +lemma contour_integrable_neg_iff: + "(\x. -f x) contour_integrable_on g \ f contour_integrable_on g" + using contour_integrable_neg[of f g] contour_integrable_neg[of "\x. -f x" g] by auto + lemma contour_integrable_lmul_iff: "c \ 0 \ (\x. c * f x) contour_integrable_on g \ f contour_integrable_on g" using contour_integrable_lmul[of f g c] contour_integrable_lmul[of "\x. c * f x" g "inverse c"] @@ -952,8 +1012,8 @@ then have "\x. ((k - x) / k) *\<^sub>R a + (x / k) *\<^sub>R c = (1 - x) *\<^sub>R a + x *\<^sub>R b" using False by (simp add: c' algebra_simps) then have "((\x. f ((1 - x) *\<^sub>R a + x *\<^sub>R b) * (b - a)) has_integral i) {0..k}" - using k has_integral_affinity01 [OF *, of "inverse k" "0"] - by (force dest: has_integral_cmul [where c = "inverse k"] + using k has_integral_affinity01 [OF *, of "inverse k" "0"] + by (force dest: has_integral_cmul [where c = "inverse k"] simp add: divide_simps mult.commute [of _ "k"] image_affinity_atLeastAtMost c) } note fi = this { assume *: "((\x. f ((1 - x) *\<^sub>R c + x *\<^sub>R b) * (b - c)) has_integral j) {0..1}" @@ -1148,9 +1208,9 @@ lemma reversepath_part_circlepath[simp]: "reversepath (part_circlepath z r s t) = part_circlepath z r t s" - unfolding part_circlepath_def reversepath_def linepath_def + unfolding part_circlepath_def reversepath_def linepath_def by (auto simp:algebra_simps) - + lemma has_vector_derivative_part_circlepath [derivative_intros]: "((part_circlepath z r s t) has_vector_derivative (\ * r * (of_real t - of_real s) * exp(\ * linepath s t x))) @@ -1209,7 +1269,7 @@ lemma path_image_part_circlepath': "path_image (part_circlepath z r s t) = (\x. z + r * cis x) ` closed_segment s t" proof - - have "path_image (part_circlepath z r s t) = + have "path_image (part_circlepath z r s t) = (\x. z + r * exp(\ * of_real x)) ` linepath s t ` {0..1}" by (simp add: image_image path_image_def part_circlepath_def) also have "linepath s t ` {0..1} = closed_segment s t" @@ -1283,7 +1343,7 @@ (simp_all add: cis_conv_exp) also have "\ \ ((\x. f (c + r * exp (\ * linepath (of_real a) (of_real b) x)) * r * \ * exp (\ * linepath (of_real a) (of_real b) x) * - vector_derivative (linepath (of_real a) (of_real b)) + vector_derivative (linepath (of_real a) (of_real b)) (at x within {0..1})) has_integral I) {0..1}" by (intro has_integral_cong, subst vector_derivative_linepath_within) (auto simp: part_circlepath_def cis_conv_exp of_real_linepath [symmetric]) @@ -1299,7 +1359,7 @@ assumes "a < b" shows "f contour_integrable_on (part_circlepath c r a b) \ (\t. f (c + r * cis t) * r * \ * cis t) integrable_on {a..b}" - using assms by (auto simp: contour_integrable_on_def integrable_on_def + using assms by (auto simp: contour_integrable_on_def integrable_on_def has_contour_integral_part_circlepath_iff) lemma contour_integral_part_circlepath_eq: @@ -1308,14 +1368,14 @@ integral {a..b} (\t. f (c + r * cis t) * r * \ * cis t)" proof (cases "f contour_integrable_on part_circlepath c r a b") case True - hence "(\t. f (c + r * cis t) * r * \ * cis t) integrable_on {a..b}" + hence "(\t. f (c + r * cis t) * r * \ * cis t) integrable_on {a..b}" using assms by (simp add: contour_integrable_part_circlepath_iff) with True show ?thesis using has_contour_integral_part_circlepath_iff[OF assms] contour_integral_unique has_integral_integrable_integral by blast next case False - hence "\(\t. f (c + r * cis t) * r * \ * cis t) integrable_on {a..b}" + hence "\(\t. f (c + r * cis t) * r * \ * cis t) integrable_on {a..b}" using assms by (simp add: contour_integrable_part_circlepath_iff) with False show ?thesis by (simp add: not_integrable_contour_integral not_integrable_integral) @@ -1323,10 +1383,10 @@ lemma contour_integral_part_circlepath_reverse: "contour_integral (part_circlepath c r a b) f = -contour_integral (part_circlepath c r b a) f" - by (subst reversepath_part_circlepath [symmetric], subst contour_integral_reversepath) simp_all + by (metis contour_integral_reversepath reversepath_part_circlepath valid_path_part_circlepath) lemma contour_integral_part_circlepath_reverse': - "b < a \ contour_integral (part_circlepath c r a b) f = + "b < a \ contour_integral (part_circlepath c r a b) f = -contour_integral (part_circlepath c r b a) f" by (rule contour_integral_part_circlepath_reverse) @@ -1382,7 +1442,7 @@ proof - let ?w = "(y - z)/of_real r / exp(\ * of_real s)" have fin: "finite (of_real -` {z. cmod z \ 1 \ exp (\ * complex_of_real (t - s) * z) = ?w})" - using \s < t\ + using \s < t\ by (intro finite_vimageI [OF finite_bounded_log2]) (auto simp: inj_of_real) show ?thesis unfolding part_circlepath_def linepath_def vimage_def @@ -1396,13 +1456,20 @@ vector_derivative (part_circlepath z r s t) (at x)) has_integral i) {0..1}" by (rule has_integral_spike [OF negligible_finite [OF fin01]]) (use fi has_contour_integral in auto) have *: "\x. \0 \ x; x \ 1; part_circlepath z r s t x \ k\ \ cmod (f (part_circlepath z r s t x)) \ B" - by (auto intro!: B [unfolded path_image_def image_def, simplified]) + by (auto intro!: B [unfolded path_image_def image_def]) show ?thesis apply (rule has_integral_bound [where 'a=real, simplified, OF _ **, simplified]) using assms le * "2" \r > 0\ by (auto simp add: norm_mult vector_derivative_part_circlepath) qed qed +corollary contour_integral_bound_part_circlepath_strong: + assumes "f contour_integrable_on part_circlepath z r s t" + and "finite k" and "0 \ B" "0 < r" "s \ t" + and "\x. x \ path_image(part_circlepath z r s t) - k \ norm(f x) \ B" + shows "cmod (contour_integral (part_circlepath z r s t) f) \ B * r * (t - s)" + using assms has_contour_integral_bound_part_circlepath_strong has_contour_integral_integral by blast + lemma has_contour_integral_bound_part_circlepath: "\(f has_contour_integral i) (part_circlepath z r s t); 0 \ B; 0 < r; s \ t; @@ -1414,9 +1481,8 @@ "continuous_on (path_image (part_circlepath z r s t)) f \ f contour_integrable_on (part_circlepath z r s t)" unfolding contour_integrable_on has_contour_integral_def vector_derivative_part_circlepath path_image_def - apply (rule integrable_continuous_real) - apply (fast intro: path_part_circlepath [unfolded path_def] continuous_intros continuous_on_compose2 [where g=f, OF _ _ order_refl]) - done + by (best intro: integrable_continuous_real path_part_circlepath [unfolded path_def] continuous_intros + continuous_on_compose2 [where g=f, OF _ _ order_refl]) lemma simple_path_part_circlepath: "simple_path(part_circlepath z r s t) \ (r \ 0 \ s \ t \ \s - t\ \ 2*pi)" @@ -1686,7 +1752,7 @@ then show ?thesis by (simp add: left_diff_distrib [symmetric] norm_mult) qed - have le_e: "\x. \\xa\{0..1}. 2 * cmod (f x (\ xa) - l (\ xa)) < e / B'; f x contour_integrable_on \\ + have le_e: "\x. \\u\{0..1}. 2 * cmod (f x (\ u) - l (\ u)) < e / B'; f x contour_integrable_on \\ \ cmod (integral {0..1} (\u. f x (\ u) * vector_derivative \ (at u) - l (\ u) * vector_derivative \ (at u))) < e" apply (rule le_less_trans [OF integral_norm_bound_integral ie]) @@ -1711,4 +1777,4 @@ "((\n. contour_integral (circlepath z r) (f n)) \ contour_integral (circlepath z r) l) F" using assms by (auto simp: vector_derivative_circlepath norm_mult intro!: contour_integral_uniform_limit) -end \ No newline at end of file +end diff -r 8a28ab58d155 -r fd9422c110ed src/HOL/Library/Landau_Symbols.thy --- a/src/HOL/Library/Landau_Symbols.thy Fri Mar 03 11:25:29 2023 +0100 +++ b/src/HOL/Library/Landau_Symbols.thy Fri Mar 03 12:22:07 2023 +0000 @@ -1499,6 +1499,21 @@ shows "(\x. sum (\y. f y x) A) \ O[F](g)" using assms by (induction A rule: infinite_finite_induct) (auto intro: sum_in_bigo) +lemma le_imp_bigo_real: + assumes "c \ 0" "eventually (\x. f x \ c * (g x :: real)) F" "eventually (\x. 0 \ f x) F" + shows "f \ O[F](g)" +proof - + have "eventually (\x. norm (f x) \ c * norm (g x)) F" + using assms(2,3) + proof eventually_elim + case (elim x) + have "norm (f x) \ c * g x" using elim by simp + also have "\ \ c * norm (g x)" by (intro mult_left_mono assms) auto + finally show ?case . + qed + thus ?thesis by (intro bigoI[of _ c]) auto +qed + context landau_symbol begin @@ -2052,6 +2067,17 @@ shows "(\x. f1 x / f2 x) \[F] (\x. g1 x / g2 x)" using asymp_equiv_mult[OF assms(1) asymp_equiv_inverse[OF assms(2)]] by (simp add: field_simps) +lemma asymp_equivD_strong: + assumes "f \[F] g" "eventually (\x. f x \ 0 \ g x \ 0) F" + shows "((\x. f x / g x) \ 1) F" +proof - + from assms(1) have "((\x. if f x = 0 \ g x = 0 then 1 else f x / g x) \ 1) F" + by (rule asymp_equivD) + also have "?this \ ?thesis" + by (intro filterlim_cong eventually_mono[OF assms(2)]) auto + finally show ?thesis . +qed + lemma asymp_equiv_compose [asymp_equiv_intros]: assumes "f \[G] g" "filterlim h G F" shows "f \ h \[F] g \ h" diff -r 8a28ab58d155 -r fd9422c110ed src/HOL/Real.thy --- a/src/HOL/Real.thy Fri Mar 03 11:25:29 2023 +0100 +++ b/src/HOL/Real.thy Fri Mar 03 12:22:07 2023 +0000 @@ -1067,11 +1067,7 @@ by (metis floor_divide_of_nat_eq of_int_floor_le of_int_of_nat_eq) lemma real_of_nat_div3: "real n / real x - real (n div x) \ 1" for n x :: nat -proof (cases "x = 0") - case False - then show ?thesis - by (metis of_int_of_nat_eq real_of_int_div3 zdiv_int) -qed auto + by (metis of_int_of_nat_eq real_of_int_div3 of_nat_div) lemma real_of_nat_div4: "real (n div x) \ real n / real x" for n x :: nat using real_of_nat_div2 [of n x] by simp diff -r 8a28ab58d155 -r fd9422c110ed src/HOL/Series.thy --- a/src/HOL/Series.thy Fri Mar 03 11:25:29 2023 +0100 +++ b/src/HOL/Series.thy Fri Mar 03 12:22:07 2023 +0000 @@ -1023,6 +1023,17 @@ for f :: "nat \ real" by (fold real_norm_def) (rule summable_norm) +lemma norm_suminf_le: + assumes "\n. norm (f n :: 'a :: banach) \ g n" "summable g" + shows "norm (suminf f) \ suminf g" +proof - + have *: "summable (\n. norm (f n))" + using assms summable_norm_comparison_test by blast + hence "norm (suminf f) \ (\n. norm (f n))" by (intro summable_norm) auto + also have "\ \ suminf g" by (intro suminf_le * assms allI) + finally show ?thesis . +qed + lemma summable_zero_power [simp]: "summable (\n. 0 ^ n :: 'a::{comm_ring_1,topological_space})" proof - have "(\n. 0 ^ n :: 'a) = (\n. if n = 0 then 0^0 else 0)" @@ -1054,12 +1065,7 @@ qed lemma summable_0_powser: "summable (\n. f n * 0 ^ n :: 'a::real_normed_div_algebra)" -proof - - have A: "(\n. f n * 0 ^ n) = (\n. if n = 0 then f n else 0)" - by (intro ext) auto - then show ?thesis - by (subst A) simp_all -qed + by simp lemma summable_powser_split_head: "summable (\n. f (Suc n) * z ^ n :: 'a::real_normed_div_algebra) = summable (\n. f n * z ^ n)" diff -r 8a28ab58d155 -r fd9422c110ed src/HOL/Transcendental.thy --- a/src/HOL/Transcendental.thy Fri Mar 03 11:25:29 2023 +0100 +++ b/src/HOL/Transcendental.thy Fri Mar 03 12:22:07 2023 +0000 @@ -2492,6 +2492,9 @@ for a x :: "'a::{ln,real_normed_field}" by (simp add: divide_inverse powr_minus) +lemma powr_sum: "x \ 0 \ finite A \ x powr sum f A = (\y\A. x powr f y)" + by (simp add: powr_def exp_sum sum_distrib_right) + lemma divide_powr_uminus: "a / b powr c = a * b powr (- c)" for a b c :: real by (simp add: powr_minus_divide)