# HG changeset patch # User paulson # Date 1513976407 0 # Node ID bdf25939a5508d44d8ec9b1aecf4cbee20433f42 # Parent 6c837185aa61d0bf8ce75fd6282009928a5d0310 new/improved theories involving convergence; better pretty-printing for bounded quantifiers and sum/product diff -r 6c837185aa61 -r bdf25939a550 src/HOL/Analysis/Complex_Transcendental.thy --- a/src/HOL/Analysis/Complex_Transcendental.thy Thu Dec 21 22:56:51 2017 +0100 +++ b/src/HOL/Analysis/Complex_Transcendental.thy Fri Dec 22 21:00:07 2017 +0000 @@ -1851,9 +1851,35 @@ using field_differentiable_def has_field_derivative_powr_right by blast lemma holomorphic_on_powr_right [holomorphic_intros]: - "f holomorphic_on s \ w \ 0 \ (\z. w powr (f z)) holomorphic_on s" - unfolding holomorphic_on_def field_differentiable_def - by (metis (full_types) DERIV_chain' has_field_derivative_powr_right) + assumes "f holomorphic_on s" + shows "(\z. w powr (f z)) holomorphic_on s" +proof (cases "w = 0") + case True + then show ?thesis + by simp +next + case False + with assms show ?thesis + unfolding holomorphic_on_def field_differentiable_def + by (metis (full_types) DERIV_chain' has_field_derivative_powr_right) +qed + +lemma holomorphic_on_divide_gen [holomorphic_intros]: + assumes f: "f holomorphic_on s" and g: "g holomorphic_on s" and 0: "\z z'. \z \ s; z' \ s\ \ g z = 0 \ g z' = 0" +shows "(\z. f z / g z) holomorphic_on s" +proof (cases "\z\s. g z = 0") + case True + with 0 have "g z = 0" if "z \ s" for z + using that by blast + then show ?thesis + using g holomorphic_transform by auto +next + case False + with 0 have "g z \ 0" if "z \ s" for z + using that by blast + with holomorphic_on_divide show ?thesis + using f g by blast +qed lemma norm_powr_real_powr: "w \ \ \ 0 \ Re w \ cmod (w powr z) = Re w powr Re z" diff -r 6c837185aa61 -r bdf25939a550 src/HOL/Analysis/Infinite_Set_Sum.thy --- a/src/HOL/Analysis/Infinite_Set_Sum.thy Thu Dec 21 22:56:51 2017 +0100 +++ b/src/HOL/Analysis/Infinite_Set_Sum.thy Fri Dec 22 21:00:07 2017 +0000 @@ -175,6 +175,9 @@ lemma abs_summable_on_normI: "f abs_summable_on A \ (\x. norm (f x)) abs_summable_on A" by simp +lemma abs_summable_complex_of_real [simp]: "(\n. complex_of_real (f n)) abs_summable_on A \ f abs_summable_on A" + by (simp add: abs_summable_on_def complex_of_real_integrable_eq) + lemma abs_summable_on_comparison_test: assumes "g abs_summable_on A" assumes "\x. x \ A \ norm (f x) \ norm (g x)" @@ -227,6 +230,23 @@ "f abs_summable_on (UNIV :: nat set) \ summable (\n. norm (f n))" by (subst abs_summable_on_nat_iff) auto +lemma nat_abs_summable_on_comparison_test: + fixes f :: "nat \ 'a :: {banach, second_countable_topology}" + assumes "g abs_summable_on I" + assumes "\n. \n\N; n \ I\ \ norm (f n) \ g n" + shows "f abs_summable_on I" + using assms by (fastforce simp add: abs_summable_on_nat_iff intro: summable_comparison_test') + +lemma abs_summable_comparison_test_ev: + assumes "g abs_summable_on I" + assumes "eventually (\x. x \ I \ norm (f x) \ g x) sequentially" + shows "f abs_summable_on I" + by (metis (no_types, lifting) nat_abs_summable_on_comparison_test eventually_at_top_linorder assms) + +lemma abs_summable_on_Cauchy: + "f abs_summable_on (UNIV :: nat set) \ (\e>0. \N. \m\N. \n. (\x = m.. f abs_summable_on A" unfolding abs_summable_on_def by (rule integrable_count_space) diff -r 6c837185aa61 -r bdf25939a550 src/HOL/Groups_Big.thy --- a/src/HOL/Groups_Big.thy Thu Dec 21 22:56:51 2017 +0100 +++ b/src/HOL/Groups_Big.thy Fri Dec 22 21:00:07 2017 +0000 @@ -495,12 +495,12 @@ end -text \Now: lot's of fancy syntax. First, @{term "sum (\x. e) A"} is written \\x\A. e\.\ +text \Now: lots of fancy syntax. First, @{term "sum (\x. e) A"} is written \\x\A. e\.\ syntax (ASCII) - "_sum" :: "pttrn \ 'a set \ 'b \ 'b::comm_monoid_add" ("(3SUM _:_./ _)" [0, 51, 10] 10) + "_sum" :: "pttrn \ 'a set \ 'b \ 'b::comm_monoid_add" ("(3SUM (_/:_)./ _)" [0, 51, 10] 10) syntax - "_sum" :: "pttrn \ 'a set \ 'b \ 'b::comm_monoid_add" ("(2\_\_./ _)" [0, 51, 10] 10) + "_sum" :: "pttrn \ 'a set \ 'b \ 'b::comm_monoid_add" ("(2\(_/\_)./ _)" [0, 51, 10] 10) translations \ \Beware of argument permutation!\ "\i\A. b" \ "CONST sum (\i. b) A" @@ -1062,9 +1062,9 @@ end syntax (ASCII) - "_prod" :: "pttrn => 'a set => 'b => 'b::comm_monoid_mult" ("(4PROD _:_./ _)" [0, 51, 10] 10) + "_prod" :: "pttrn => 'a set => 'b => 'b::comm_monoid_mult" ("(4PROD (_/:_)./ _)" [0, 51, 10] 10) syntax - "_prod" :: "pttrn => 'a set => 'b => 'b::comm_monoid_mult" ("(2\_\_./ _)" [0, 51, 10] 10) + "_prod" :: "pttrn => 'a set => 'b => 'b::comm_monoid_mult" ("(2\(_/\_)./ _)" [0, 51, 10] 10) translations \ \Beware of argument permutation!\ "\i\A. b" == "CONST prod (\i. b) A" diff -r 6c837185aa61 -r bdf25939a550 src/HOL/Series.thy --- a/src/HOL/Series.thy Thu Dec 21 22:56:51 2017 +0100 +++ b/src/HOL/Series.thy Fri Dec 22 21:00:07 2017 +0000 @@ -564,6 +564,9 @@ lemma suminf_divide: "summable f \ suminf (\n. f n / c) = suminf f / c" by (rule bounded_linear.suminf [OF bounded_linear_divide, symmetric]) +lemma summable_inverse_divide: "summable (inverse \ f) \ summable (\n. c / f n)" + by (auto dest: summable_mult [of _ c] simp: field_simps) + lemma sums_mult_D: "(\n. c * f n) sums a \ c \ 0 \ f sums (a/c)" using sums_mult_iff by fastforce @@ -657,31 +660,52 @@ text \Cauchy-type criterion for convergence of series (c.f. Harrison).\ -lemma summable_Cauchy: "summable f \ (\e>0. \N. \m\N. \n. norm (sum f {m.. (\e>0. \N. \m\N. \n. norm (sum f {m.. 'a::banach" - apply (simp only: summable_iff_convergent Cauchy_convergent_iff [symmetric] Cauchy_iff) - apply safe - apply (drule spec) - apply (drule (1) mp) - apply (erule exE) - apply (rule_tac x="M" in exI) - apply clarify - apply (rule_tac x="m" and y="n" in linorder_le_cases) - apply (frule (1) order_trans) - apply (drule_tac x="n" in spec) - apply (drule (1) mp) - apply (drule_tac x="m" in spec) - apply (drule (1) mp) - apply (simp_all add: sum_diff [symmetric]) - apply (drule spec) - apply (drule (1) mp) - apply (erule exE) - apply (rule_tac x="N" in exI) - apply clarify - apply (rule_tac x="m" and y="n" in linorder_le_cases) - apply (subst norm_minus_commute) - apply (simp_all add: sum_diff [symmetric]) - done +proof + assume f: "summable f" + show ?rhs + proof clarify + fix e :: real + assume "0 < e" + then obtain M where M: "\m n. \m\M; n\M\ \ norm (sum f {.. M" for m n + proof (cases m n rule: linorder_class.le_cases) + assume "m \ n" + then show ?thesis + by (metis (mono_tags, hide_lams) M atLeast0LessThan order_trans sum_diff_nat_ivl that zero_le) + next + assume "n \ m" + then show ?thesis + by (simp add: \0 < e\) + qed + then show "\N. \m\N. \n. norm (sum f {m..m n. m \ N \ norm (sum f {m..N" "n\N" for m n + 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\) + next + assume "n \ m" + then show ?thesis + by (metis Groups_Big.sum_diff N finite_lessThan lessThan_minus_lessThan lessThan_subset_iff \n\N\) + qed + then show "\M. \m\M. \n\M. norm (sum f {.. 'a::banach" @@ -708,23 +732,32 @@ text \Comparison tests.\ -lemma summable_comparison_test: "\N. \n\N. norm (f n) \ g n \ summable g \ summable f" - apply (simp add: summable_Cauchy) - apply safe - apply (drule_tac x="e" in spec) - apply safe - apply (rule_tac x = "N + Na" in exI) - apply safe - apply (rotate_tac 2) - apply (drule_tac x = m in spec) - apply auto - apply (rotate_tac 2) - apply (drule_tac x = n in spec) - apply (rule_tac y = "\k=m..N. \n\N. norm (f n) \ g n" and g: "summable g" + shows "summable f" +proof - + obtain N where N: "\n. n\N \ norm (f n) \ g n" + using assms by blast + show ?thesis + proof (clarsimp simp add: summable_Cauchy) + fix e :: real + assume "0 < e" + then obtain Ng where Ng: "\m n. m \ Ng \ norm (sum g {m..max N Ng" for m n + proof - + have "norm (sum f {m.. sum g {m.. norm (sum g {m..N. \m\N. \n. norm (sum f {m..n. norm (f n) \ g n) sequentially \ summable g \ summable f" diff -r 6c837185aa61 -r bdf25939a550 src/HOL/Set.thy --- a/src/HOL/Set.thy Thu Dec 21 22:56:51 2017 +0100 +++ b/src/HOL/Set.thy Fri Dec 22 21:00:07 2017 +0000 @@ -44,9 +44,9 @@ "{x. P}" \ "CONST Collect (\x. P)" syntax (ASCII) - "_Collect" :: "pttrn \ 'a set \ bool \ 'a set" ("(1{_ :/ _./ _})") + "_Collect" :: "pttrn \ 'a set \ bool \ 'a set" ("(1{(_/: _)./ _})") syntax - "_Collect" :: "pttrn \ 'a set \ bool \ 'a set" ("(1{_ \/ _./ _})") + "_Collect" :: "pttrn \ 'a set \ bool \ 'a set" ("(1{(_/\ _)./ _})") translations "{p:A. P}" \ "CONST Collect (\p. p \ A \ P)" @@ -187,21 +187,21 @@ where "Bex A P \ (\x. x \ A \ P x)" \ "bounded existential quantifiers" syntax (ASCII) - "_Ball" :: "pttrn \ 'a set \ bool \ bool" ("(3ALL _:_./ _)" [0, 0, 10] 10) - "_Bex" :: "pttrn \ 'a set \ bool \ bool" ("(3EX _:_./ _)" [0, 0, 10] 10) - "_Bex1" :: "pttrn \ 'a set \ bool \ bool" ("(3EX! _:_./ _)" [0, 0, 10] 10) - "_Bleast" :: "id \ 'a set \ bool \ 'a" ("(3LEAST _:_./ _)" [0, 0, 10] 10) + "_Ball" :: "pttrn \ 'a set \ bool \ bool" ("(3ALL (_/:_)./ _)" [0, 0, 10] 10) + "_Bex" :: "pttrn \ 'a set \ bool \ bool" ("(3EX (_/:_)./ _)" [0, 0, 10] 10) + "_Bex1" :: "pttrn \ 'a set \ bool \ bool" ("(3EX! (_/:_)./ _)" [0, 0, 10] 10) + "_Bleast" :: "id \ 'a set \ bool \ 'a" ("(3LEAST (_/:_)./ _)" [0, 0, 10] 10) syntax (input) - "_Ball" :: "pttrn \ 'a set \ bool \ bool" ("(3! _:_./ _)" [0, 0, 10] 10) - "_Bex" :: "pttrn \ 'a set \ bool \ bool" ("(3? _:_./ _)" [0, 0, 10] 10) - "_Bex1" :: "pttrn \ 'a set \ bool \ bool" ("(3?! _:_./ _)" [0, 0, 10] 10) + "_Ball" :: "pttrn \ 'a set \ bool \ bool" ("(3! (_/:_)./ _)" [0, 0, 10] 10) + "_Bex" :: "pttrn \ 'a set \ bool \ bool" ("(3? (_/:_)./ _)" [0, 0, 10] 10) + "_Bex1" :: "pttrn \ 'a set \ bool \ bool" ("(3?! (_/:_)./ _)" [0, 0, 10] 10) syntax - "_Ball" :: "pttrn \ 'a set \ bool \ bool" ("(3\_\_./ _)" [0, 0, 10] 10) - "_Bex" :: "pttrn \ 'a set \ bool \ bool" ("(3\_\_./ _)" [0, 0, 10] 10) - "_Bex1" :: "pttrn \ 'a set \ bool \ bool" ("(3\!_\_./ _)" [0, 0, 10] 10) - "_Bleast" :: "id \ 'a set \ bool \ 'a" ("(3LEAST_\_./ _)" [0, 0, 10] 10) + "_Ball" :: "pttrn \ 'a set \ bool \ bool" ("(3\(_/\_)./ _)" [0, 0, 10] 10) + "_Bex" :: "pttrn \ 'a set \ bool \ bool" ("(3\(_/\_)./ _)" [0, 0, 10] 10) + "_Bex1" :: "pttrn \ 'a set \ bool \ bool" ("(3\!(_/\_)./ _)" [0, 0, 10] 10) + "_Bleast" :: "id \ 'a set \ bool \ 'a" ("(3LEAST(_/\_)./ _)" [0, 0, 10] 10) translations "\x\A. P" \ "CONST Ball A (\x. P)" diff -r 6c837185aa61 -r bdf25939a550 src/HOL/Transcendental.thy --- a/src/HOL/Transcendental.thy Thu Dec 21 22:56:51 2017 +0100 +++ b/src/HOL/Transcendental.thy Fri Dec 22 21:00:07 2017 +0000 @@ -2522,7 +2522,7 @@ by (simp add: powr_def exp_minus [symmetric]) lemma powr_minus_divide: "x powr (- a) = 1/(x powr a)" - for x a :: real + for a x :: "'a::{ln,real_normed_field}" by (simp add: divide_inverse powr_minus) lemma divide_powr_uminus: "a / b powr c = a * b powr (- c)"