# HG changeset patch # User paulson # Date 1453478403 0 # Node ID 527488dc8b902a9bb0b56247740dc19bd3a57e43 # Parent 5fb86150a579eca00622c1b1d4f5af902dc2bd98 Reorganised a huge proof diff -r 5fb86150a579 -r 527488dc8b90 src/HOL/IMP/Denotational.thy --- a/src/HOL/IMP/Denotational.thy Wed Jan 20 20:19:05 2016 +0100 +++ b/src/HOL/IMP/Denotational.thy Fri Jan 22 16:00:03 2016 +0000 @@ -105,7 +105,7 @@ by(simp add: cont_def) also have "\ = (f^^0){} \ \" by simp also have "\ = ?U" - by(auto simp del: funpow.simps) (metis not0_implies_Suc) + using assms funpow_decreasing le_SucI mono_if_cont by blast finally show "f ?U \ ?U" by simp qed next diff -r 5fb86150a579 -r 527488dc8b90 src/HOL/Library/Product_Vector.thy --- a/src/HOL/Library/Product_Vector.thy Wed Jan 20 20:19:05 2016 +0100 +++ b/src/HOL/Library/Product_Vector.thy Fri Jan 22 16:00:03 2016 +0000 @@ -218,6 +218,20 @@ lemma continuous_on_swap[continuous_intros]: "continuous_on A prod.swap" by (simp add: prod.swap_def continuous_on_fst continuous_on_snd continuous_on_Pair continuous_on_id) +lemma continuous_on_swap_args: + assumes "continuous_on (A\B) (\(x,y). d x y)" + shows "continuous_on (B\A) (\(x,y). d y x)" +proof - + have "(\(x,y). d y x) = (\(x,y). d x y) o prod.swap" + by force + then show ?thesis + apply (rule ssubst) + apply (rule continuous_on_compose) + apply (force intro: continuous_on_subset [OF continuous_on_swap]) + apply (force intro: continuous_on_subset [OF assms]) + done +qed + lemma isCont_fst [simp]: "isCont f a \ isCont (\x. fst (f x)) a" by (fact continuous_fst) diff -r 5fb86150a579 -r 527488dc8b90 src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy --- a/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy Wed Jan 20 20:19:05 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy Fri Jan 22 16:00:03 2016 +0000 @@ -5722,8 +5722,8 @@ lemma higher_deriv_ident [simp]: "(deriv ^^ n) (\w. w) z = (if n = 0 then z else if n = 1 then 1 else 0)" - apply (induction n) - apply (simp_all add: deriv_ident funpow_Suc_right del: funpow.simps, simp) + apply (induction n, simp) + apply (metis higher_deriv_linear lambda_one) done corollary higher_deriv_id [simp]: @@ -6893,6 +6893,60 @@ text\Proof is based on Dixon's, as presented in Lang's "Complex Analysis" book (page 147).\ +lemma contour_integral_continuous_on_linepath_2D: + assumes "open u" and cont_dw: "\w. w \ u \ F w contour_integrable_on (linepath a b)" + and cond_uu: "continuous_on (u \ u) (\(x,y). F x y)" + and abu: "closed_segment a b \ u" + shows "continuous_on u (\w. contour_integral (linepath a b) (F w))" +proof - + have *: "\d>0. \x'\u. dist x' w < d \ + dist (contour_integral (linepath a b) (F x')) + (contour_integral (linepath a b) (F w)) \ \" + if "w \ u" "0 < \" "a \ b" for w \ + proof - + obtain \ where "\>0" and \: "cball w \ \ u" using open_contains_cball \open u\ \w \ u\ by force + let ?TZ = "{(t,z) |t z. t \ cball w \ \ z \ closed_segment a b}" + have "uniformly_continuous_on ?TZ (\(x,y). F x y)" + apply (rule compact_uniformly_continuous) + apply (rule continuous_on_subset[OF cond_uu]) + using abu \ + apply (auto simp: compact_Times simp del: mem_cball) + done + then obtain \ where "\>0" + and \: "\x x'. \x\?TZ; x'\?TZ; dist x' x < \\ \ + dist ((\(x,y). F x y) x') ((\(x,y). F x y) x) < \/norm(b - a)" + apply (rule uniformly_continuous_onE [where e = "\/norm(b - a)"]) + using \0 < \\ \a \ b\ by auto + have \: "\norm (w - x1) \ \; x2 \ closed_segment a b; + norm (w - x1') \ \; x2' \ closed_segment a b; norm ((x1', x2') - (x1, x2)) < \\ + \ norm (F x1' x2' - F x1 x2) \ \ / cmod (b - a)" + for x1 x2 x1' x2' + using \ [of "(x1,x2)" "(x1',x2')"] by (force simp add: dist_norm) + have le_ee: "cmod (contour_integral (linepath a b) (\x. F x' x - F w x)) \ \" + if "x' \ u" "cmod (x' - w) < \" "cmod (x' - w) < \" for x' + proof - + have "cmod (contour_integral (linepath a b) (\x. F x' x - F w x)) \ \/norm(b - a) * norm(b - a)" + apply (rule has_contour_integral_bound_linepath [OF has_contour_integral_integral _ \]) + apply (rule contour_integrable_diff [OF cont_dw cont_dw]) + using \0 < \\ \a \ b\ \0 < \\ \w \ u\ that + apply (auto simp: norm_minus_commute) + done + also have "... = \" using \a \ b\ by simp + finally show ?thesis . + qed + show ?thesis + apply (rule_tac x="min \ \" in exI) + using \0 < \\ \0 < \\ + apply (auto simp: dist_norm contour_integral_diff [OF cont_dw cont_dw, symmetric] \w \ u\ intro: le_ee) + done + qed + show ?thesis + apply (rule continuous_onI) + apply (cases "a=b") + apply (auto intro: *) + done +qed + text\This version has @{term"polynomial_function \"} as an additional assumption.\ lemma Cauchy_integral_formula_global_weak: assumes u: "open u" and holf: "f holomorphic_on u" @@ -7065,10 +7119,10 @@ by (meson Lim_at_infinityI) moreover have "h holomorphic_on UNIV" proof - - have con_ff: "continuous (at (x,z)) (\y. (f(snd y) - f(fst y)) / (snd y - fst y))" + have con_ff: "continuous (at (x,z)) (\(x,y). (f y - f x) / (y - x))" if "x \ u" "z \ u" "x \ z" for x z using that conf - apply (simp add: continuous_on_eq_continuous_at u) + apply (simp add: split_def continuous_on_eq_continuous_at u) apply (simp | rule continuous_intros continuous_within_compose2 [where g=f])+ done have con_fstsnd: "continuous_on UNIV (\x. (fst x - snd x) ::complex)" @@ -7083,8 +7137,8 @@ apply (rule continuous_on_interior [of u]) apply (simp add: holf holomorphic_deriv holomorphic_on_imp_continuous_on u) by (simp add: interior_open that u) - have tendsto_f': "((\x. if snd x = fst x then deriv f (fst x) - else (f (snd x) - f (fst x)) / (snd x - fst x)) \ deriv f x) + have tendsto_f': "((\(x,y). if y = x then deriv f (x) + else (f (y) - f (x)) / (y - x)) \ deriv f x) (at (x, x) within u \ u)" if "x \ u" for x proof (rule Lim_withinI) fix e::real assume "0 < e" @@ -7120,8 +7174,7 @@ qed show "\d>0. \xa\u \ u. 0 < dist xa (x, x) \ dist xa (x, x) < d \ - dist (if snd xa = fst xa then deriv f (fst xa) else (f (snd xa) - f (fst xa)) / (snd xa - fst xa)) - (deriv f x) \ e" + dist (case xa of (x, y) \ if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \ e" apply (rule_tac x="min k1 k2" in exI) using \k1>0\ \k2>0\ \e>0\ apply (force simp: dist_norm neq intro: dual_order.strict_trans2 k1 less_imp_le norm_fst_le) @@ -7134,16 +7187,16 @@ using \' using path_image_def vector_derivative_at by fastforce have f_has_cint: "\w. w \ v - path_image \ \ ((\u. f u / (u - w) ^ 1) has_contour_integral h w) \" by (simp add: V) - have cond_uu: "continuous_on (u \ u) (\y. d (fst y) (snd y))" + have cond_uu: "continuous_on (u \ u) (\(x,y). d x y)" apply (simp add: continuous_on_eq_continuous_within d_def continuous_within tendsto_f') apply (simp add: Lim_within_open_NO_MATCH open_Times u, clarify) - apply (rule Lim_transform_within_open [OF _ open_uu_Id, where f = "(\x. (f (snd x) - f (fst x)) / (snd x - fst x))"]) + apply (rule Lim_transform_within_open [OF _ open_uu_Id, where f = "(\(x,y). (f y - f x) / (y - x))"]) using con_ff apply (auto simp: continuous_within) done have hol_dw: "(\z. d z w) holomorphic_on u" if "w \ u" for w proof - - have "continuous_on u ((\y. d (fst y) (snd y)) o (\z. (w,z)))" + have "continuous_on u ((\(x,y). d x y) o (\z. (w,z)))" by (rule continuous_on_compose continuous_intros continuous_on_subset [OF cond_uu] | force intro: that)+ then have *: "continuous_on u (\z. if w = z then deriv f z else (f w - f z) / (w - z))" by (rule rev_iffD1 [OF _ continuous_on_cong [OF refl]]) (simp add: d_def field_simps) @@ -7159,53 +7212,11 @@ qed { fix a b assume abu: "closed_segment a b \ u" - then have cont_dw: "\w. w \ u \ (\z. d z w) contour_integrable_on (linepath a b)" + then have "\w. w \ u \ (\z. d z w) contour_integrable_on (linepath a b)" by (metis hol_dw continuous_on_subset contour_integrable_continuous_linepath holomorphic_on_imp_continuous_on) - have *: "\da>0. \x'\u. dist x' w < da \ - dist (contour_integral (linepath a b) (\z. d z x')) - (contour_integral (linepath a b) (\z. d z w)) \ ee" - if "w \ u" "0 < ee" "a \ b" for w ee - proof - - obtain dd where "dd>0" and dd: "cball w dd \ u" using open_contains_cball u \w \ u\ by force - let ?abdd = "{(z,t) |z t. z \ closed_segment a b \ t \ cball w dd}" - have "uniformly_continuous_on ?abdd (\y. d (fst y) (snd y))" - apply (rule compact_uniformly_continuous) - apply (rule continuous_on_subset[OF cond_uu]) - using abu dd - apply (auto simp: compact_Times simp del: mem_cball) - done - then obtain kk where "kk>0" - and kk: "\x x'. \x\?abdd; x'\?abdd; dist x' x < kk\ \ - dist ((\y. d (fst y) (snd y)) x') ((\y. d (fst y) (snd y)) x) < ee/norm(b - a)" - apply (rule uniformly_continuous_onE [where e = "ee/norm(b - a)"]) - using \0 < ee\ \a \ b\ by auto - have kk: "\x1 \ closed_segment a b; norm (w - x2) \ dd; - x1' \ closed_segment a b; norm (w - x2') \ dd; norm ((x1', x2') - (x1, x2)) < kk\ - \ norm (d x1' x2' - d x1 x2) \ ee / cmod (b - a)" - for x1 x2 x1' x2' - using kk [of "(x1,x2)" "(x1',x2')"] by (force simp add: dist_norm) - have le_ee: "cmod (contour_integral (linepath a b) (\x. d x x' - d x w)) \ ee" - if "x' \ u" "cmod (x' - w) < dd" "cmod (x' - w) < kk" for x' - proof - - have "cmod (contour_integral (linepath a b) (\x. d x x' - d x w)) \ ee/norm(b - a) * norm(b - a)" - apply (rule has_contour_integral_bound_linepath [OF has_contour_integral_integral _ kk]) - apply (rule contour_integrable_diff [OF cont_dw cont_dw]) - using \0 < ee\ \a \ b\ \0 < dd\ \w \ u\ that - apply (auto simp: norm_minus_commute) - done - also have "... = ee" using \a \ b\ by simp - finally show ?thesis . - qed - show ?thesis - apply (rule_tac x="min dd kk" in exI) - using \0 < dd\ \0 < kk\ - apply (auto simp: dist_norm contour_integral_diff [OF cont_dw cont_dw, symmetric] \w \ u\ intro: le_ee) - done - qed - have cont_cint_d: "continuous_on u (\w. contour_integral (linepath a b) (\z. d z w))" - apply (rule continuous_onI) - apply (cases "a=b") - apply (auto intro: *) + then have cont_cint_d: "continuous_on u (\w. contour_integral (linepath a b) (\z. d z w))" + apply (rule contour_integral_continuous_on_linepath_2D [OF \open u\ _ _ abu]) + apply (auto simp: intro: continuous_on_swap_args cond_uu) done have cont_cint_d\: "continuous_on {0..1} ((\w. contour_integral (linepath a b) (\z. d z w)) o \)" apply (rule continuous_on_compose) @@ -7223,7 +7234,6 @@ using abu by (force simp add: h_def intro: contour_integral_eq) also have "... = contour_integral \ (\w. contour_integral (linepath a b) (\z. d z w))" apply (rule contour_integral_swap) - apply (simp add: split_def) apply (rule continuous_on_subset [OF cond_uu]) using abu pasz \valid_path \\ apply (auto intro!: continuous_intros) @@ -7243,17 +7253,16 @@ have A2: "\\<^sub>F n in sequentially. \xa\path_image \. cmod (d (a n) xa - d x xa) < ee" if "0 < ee" for ee proof - let ?ddpa = "{(w,z) |w z. w \ cball x dd \ z \ path_image \}" - have "uniformly_continuous_on ?ddpa (\y. d (fst y) (snd y))" + have "uniformly_continuous_on ?ddpa (\(x,y). d x y)" apply (rule compact_uniformly_continuous [OF continuous_on_subset[OF cond_uu]]) using dd pasz \valid_path \\ apply (auto simp: compact_Times compact_valid_path_image simp del: mem_cball) done then obtain kk where "kk>0" and kk: "\x x'. \x\?ddpa; x'\?ddpa; dist x' x < kk\ \ - dist ((\y. d (fst y) (snd y)) x') ((\y. d (fst y) (snd y)) x) < ee" + dist ((\(x,y). d x y) x') ((\(x,y). d x y) x) < ee" apply (rule uniformly_continuous_onE [where e = ee]) using \0 < ee\ by auto - have kk: "\norm (w - x) \ dd; z \ path_image \; norm ((w, z) - (x, z)) < kk\ \ norm (d w z - d x z) < ee" for w z using \dd>0\ kk [of "(x,z)" "(w,z)"] by (force simp add: norm_minus_commute dist_norm) diff -r 5fb86150a579 -r 527488dc8b90 src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy --- a/src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy Wed Jan 20 20:19:05 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy Fri Jan 22 16:00:03 2016 +0000 @@ -447,16 +447,16 @@ lemma holomorphic_cong: "s = t ==> (\x. x \ s \ f x = g x) \ f holomorphic_on s \ g holomorphic_on t" by (metis holomorphic_transform) -lemma holomorphic_on_linear [holomorphic_intros]: "(op * c) holomorphic_on s" +lemma holomorphic_on_linear [simp, holomorphic_intros]: "(op * c) holomorphic_on s" unfolding holomorphic_on_def by (metis complex_differentiable_linear) -lemma holomorphic_on_const [holomorphic_intros]: "(\z. c) holomorphic_on s" +lemma holomorphic_on_const [simp, holomorphic_intros]: "(\z. c) holomorphic_on s" unfolding holomorphic_on_def by (metis complex_differentiable_const) -lemma holomorphic_on_ident [holomorphic_intros]: "(\x. x) holomorphic_on s" +lemma holomorphic_on_ident [simp, holomorphic_intros]: "(\x. x) holomorphic_on s" unfolding holomorphic_on_def by (metis complex_differentiable_ident) -lemma holomorphic_on_id [holomorphic_intros]: "id holomorphic_on s" +lemma holomorphic_on_id [simp, holomorphic_intros]: "id holomorphic_on s" unfolding id_def by (rule holomorphic_on_ident) lemma holomorphic_on_compose: @@ -545,6 +545,11 @@ unfolding DERIV_deriv_iff_complex_differentiable[symmetric] by (auto intro!: DERIV_imp_deriv derivative_eq_intros) +lemma complex_derivative_cdivide_right: + "f complex_differentiable at z \ deriv (\w. f w / c) z = deriv f z / c" + unfolding Fields.field_class.field_divide_inverse + by (blast intro: complex_derivative_cmult_right) + lemma complex_derivative_transform_within_open: "\f holomorphic_on s; g holomorphic_on s; open s; z \ s; \w. w \ s \ f w = g w\ \ deriv f z = deriv g z" diff -r 5fb86150a579 -r 527488dc8b90 src/HOL/Nat.thy --- a/src/HOL/Nat.thy Wed Jan 20 20:19:05 2016 +0100 +++ b/src/HOL/Nat.thy Fri Jan 22 16:00:03 2016 +0000 @@ -1329,6 +1329,9 @@ end +lemma funpow_0 [simp]: "(f ^^ 0) x = x" + by simp + lemma funpow_Suc_right: "f ^^ Suc n = f ^^ n \ f" proof (induct n) diff -r 5fb86150a579 -r 527488dc8b90 src/HOL/Series.thy --- a/src/HOL/Series.thy Wed Jan 20 20:19:05 2016 +0100 +++ b/src/HOL/Series.thy Fri Jan 22 16:00:03 2016 +0000 @@ -129,6 +129,10 @@ (simp add: eq atLeast0LessThan del: add_Suc_right) qed +corollary sums_0: + "(\n. f n = 0) \ (f sums 0)" + by (metis (no_types) finite.emptyI setsum.empty sums_finite) + lemma summable_finite: "finite N \ (\n. n \ N \ f n = 0) \ summable f" by (rule sums_summable) (rule sums_finite) diff -r 5fb86150a579 -r 527488dc8b90 src/HOL/Topological_Spaces.thy --- a/src/HOL/Topological_Spaces.thy Wed Jan 20 20:19:05 2016 +0100 +++ b/src/HOL/Topological_Spaces.thy Fri Jan 22 16:00:03 2016 +0000 @@ -1076,6 +1076,9 @@ lemma lim_le: "convergent f \ (\n. f n \ (x::'a::linorder_topology)) \ lim f \ x" using LIMSEQ_le_const2[of f "lim f" x] by (simp add: convergent_LIMSEQ_iff) +lemma lim_const [simp]: "lim (\m. a) = a" + by (simp add: limI) + subsubsection\Increasing and Decreasing Series\ lemma incseq_le: "incseq X \ X \ L \ X n \ (L::'a::linorder_topology)"