diff -r 7d3e4cedf824 -r 46cfd348c373 src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Sat Aug 12 23:11:26 2017 +0100 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Sun Aug 13 19:24:33 2017 +0100 @@ -6018,12 +6018,19 @@ subsection \Monotone convergence (bounded interval first)\ +(* TODO: is this lemma necessary? *) +lemma bounded_increasing_convergent: + fixes f :: "nat \ real" + shows "\bounded (range f); \n. f n \ f (Suc n)\ \ \l. f \ l" + using Bseq_mono_convergent[of f] incseq_Suc_iff[of f] + by (auto simp: image_def Bseq_eq_bounded convergent_def incseq_def) + lemma monotone_convergence_interval: fixes f :: "nat \ 'n::euclidean_space \ real" assumes "\k. (f k) integrable_on cbox a b" and "\k. \x\cbox a b.(f k x) \ f (Suc k) x" and "\x\cbox a b. ((\k. f k x) \ g x) sequentially" - and "bounded {integral (cbox a b) (f k) | k . k \ UNIV}" + and bounded: "bounded (range (\k. integral (cbox a b) (f k)))" shows "g integrable_on cbox a b \ ((\k. integral (cbox a b) (f k)) \ integral (cbox a b) g) sequentially" proof (cases "content (cbox a b) = 0") case True @@ -6049,45 +6056,31 @@ apply auto done qed - have "\i. ((\k. integral (cbox a b) (f k)) \ i) sequentially" - apply (rule bounded_increasing_convergent) - defer - apply rule - apply (rule integral_le) - apply safe - apply (rule assms(1-2)[rule_format])+ - using assms(4) - apply auto - done - then guess i..note i=this - have i': "\k. (integral(cbox a b) (f k)) \ i\1" - apply (rule Lim_component_ge) - apply (rule i) - apply (rule trivial_limit_sequentially) + have int_inc: "\n. integral (cbox a b) (f n) \ integral (cbox a b) (f (Suc n))" + by (metis integral_le assms(1-2)) + then obtain i where i: "(\k. integral (cbox a b) (f k)) \ i" + using bounded_increasing_convergent bounded by blast + have "\k. \\<^sub>F x in sequentially. integral (cbox a b) (f k) \ integral (cbox a b) (f x) \ 1" unfolding eventually_sequentially - apply (rule_tac x=k in exI) - apply clarify - apply (erule transitive_stepwise_le) - prefer 3 - unfolding inner_simps real_inner_1_right - apply (rule integral_le) - apply (rule assms(1-2)[rule_format])+ - using assms(2) - apply auto - done - + by (force intro: transitive_stepwise_le int_inc) + then have i': "\k. (integral(cbox a b) (f k)) \ i\1" + using Lim_component_ge [OF i] trivial_limit_sequentially by blast have "(g has_integral i) (cbox a b)" unfolding has_integral proof (safe, goal_cases) - case e: (1 e) - then have "\k. (\d. gauge d \ (\p. p tagged_division_of (cbox a b) \ d fine p \ + fix e::real + assume e: "e > 0" + have "\k. (\d. gauge d \ (\p. p tagged_division_of (cbox a b) \ d fine p \ norm ((\(x, ka)\p. content ka *\<^sub>R f k x) - integral (cbox a b) (f k)) < e/2 ^ (k + 2)))" - apply - - apply rule apply (rule assms(1)[unfolded has_integral_integral has_integral,rule_format]) - apply auto + using e apply auto done - from choice[OF this] guess c..note c=conjunctD2[OF this[rule_format],rule_format] + then obtain c where c: + "\x. gauge (c x)" + "\x p. \p tagged_division_of cbox a b; c x fine p\ \ + norm ((\(u, ka)\p. content ka *\<^sub>R f x u) - integral (cbox a b) (f x)) + < e / 2 ^ (x + 2)" + by metis have "\r. \k\r. 0 \ i\1 - (integral (cbox a b) (f k)) \ i\1 - (integral (cbox a b) (f k)) < e / 4" proof - @@ -6095,11 +6088,7 @@ using e by auto from LIMSEQ_D [OF i this] guess r .. then show ?thesis - apply (rule_tac x=r in exI) - apply rule - apply (erule_tac x=k in allE) - subgoal for k using i'[of k] by auto - done + using i' by auto qed then guess r..note r=conjunctD2[OF this[rule_format]] @@ -6122,7 +6111,14 @@ qed from bchoice[OF this] guess m..note m=conjunctD2[OF this[rule_format],rule_format] define d where "d x = c (m x) x" for x - show ?case + show "\d. gauge d \ + (\p. p tagged_division_of cbox a b \ + d fine p \ + norm + ((\(x, k)\p. + content k *\<^sub>R g x) - + i) + < e)" apply (rule_tac x=d in exI) proof safe show "gauge d" @@ -6215,7 +6211,6 @@ apply (simp add: e) apply safe apply (rule c)+ - apply rule apply assumption+ apply (rule tagged_partial_division_subset[of p]) apply (rule p(1)[unfolded tagged_division_of_def,THEN conjunct1]) @@ -6286,22 +6281,22 @@ lemma monotone_convergence_increasing: fixes f :: "nat \ 'n::euclidean_space \ real" - assumes "\k. (f k) integrable_on s" - and "\k. \x\s. (f k x) \ (f (Suc k) x)" - and "\x\s. ((\k. f k x) \ g x) sequentially" - and "bounded {integral s (f k)| k. True}" - shows "g integrable_on s \ ((\k. integral s (f k)) \ integral s g) sequentially" + assumes "\k. (f k) integrable_on S" + and "\k x. x \ S \ (f k x) \ (f (Suc k) x)" + and "\x. x \ S \ ((\k. f k x) \ g x) sequentially" + and "bounded (range (\k. integral S (f k)))" + shows "g integrable_on S \ ((\k. integral S (f k)) \ integral S g) sequentially" proof - - have lem: "g integrable_on s \ ((\k. integral s (f k)) \ integral s g) sequentially" - if "\k. \x\s. 0 \ f k x" - and "\k. (f k) integrable_on s" - and "\k. \x\s. f k x \ f (Suc k) x" - and "\x\s. ((\k. f k x) \ g x) sequentially" - and "bounded {integral s (f k)| k. True}" - for f :: "nat \ 'n::euclidean_space \ real" and g s + have lem: "g integrable_on S \ ((\k. integral S (f k)) \ integral S g) sequentially" + if "\k. \x\S. 0 \ f k x" + and "\k. (f k) integrable_on S" + and "\k. \x\S. f k x \ f (Suc k) x" + and "\x\S. ((\k. f k x) \ g x) sequentially" + and bou: "bounded (range(\k. integral S (f k)))" + for f :: "nat \ 'n::euclidean_space \ real" and g S proof - note assms=that[rule_format] - have "\x\s. \k. (f k x)\1 \ (g x)\1" + have "\x\S. \k. (f k x)\1 \ (g x)\1" apply safe apply (rule Lim_component_ge) apply (rule that(4)[rule_format]) @@ -6312,19 +6307,12 @@ using assms(3) by (force intro: transitive_stepwise_le) note fg=this[rule_format] - have "\i. ((\k. integral s (f k)) \ i) sequentially" - apply (rule bounded_increasing_convergent) - apply (rule that(5)) - apply rule - apply (rule integral_le) - apply (rule that(2)[rule_format])+ - using that(3) - apply auto - done - then guess i..note i=this - have "\k. \x\s. \n\k. f k x \ f n x" + obtain i where i: "(\k. integral S (f k)) \ i" + using bounded_increasing_convergent [OF bou] + using \\k. \x\S. f k x \ f (Suc k) x\ assms(2) integral_le by blast + have "\k. \x\S. \n\k. f k x \ f n x" using assms(3) by (force intro: transitive_stepwise_le) - then have i': "\k. (integral s (f k))\1 \ i\1" + then have i': "\k. (integral S (f k))\1 \ i\1" apply - apply rule apply (rule Lim_component_ge) @@ -6339,45 +6327,45 @@ apply auto done - note int = assms(2)[unfolded integrable_alt[of _ s],THEN conjunct1,rule_format] - have ifif: "\k t. (\x. if x \ t then if x \ s then f k x else 0 else 0) = - (\x. if x \ t \ s then f k x else 0)" + note int = assms(2)[unfolded integrable_alt[of _ S],THEN conjunct1,rule_format] + have ifif: "\k t. (\x. if x \ t then if x \ S then f k x else 0 else 0) = + (\x. if x \ t \ S then f k x else 0)" by (rule ext) auto - have int': "\k a b. f k integrable_on cbox a b \ s" + have int': "\k a b. f k integrable_on cbox a b \ S" apply (subst integrable_restrict_UNIV[symmetric]) apply (subst ifif[symmetric]) apply (subst integrable_restrict_UNIV) apply (rule int) done - have "\a b. (\x. if x \ s then g x else 0) integrable_on cbox a b \ - ((\k. integral (cbox a b) (\x. if x \ s then f k x else 0)) \ - integral (cbox a b) (\x. if x \ s then g x else 0)) sequentially" + have "\a b. (\x. if x \ S then g x else 0) integrable_on cbox a b \ + ((\k. integral (cbox a b) (\x. if x \ S then f k x else 0)) \ + integral (cbox a b) (\x. if x \ S then g x else 0)) sequentially" proof (rule monotone_convergence_interval, safe, goal_cases) case 1 show ?case by (rule int) next case (2 _ _ _ x) then show ?case - apply (cases "x \ s") + apply (cases "x \ S") using assms(3) apply auto done next case (3 _ _ x) then show ?case - apply (cases "x \ s") + apply (cases "x \ S") using assms(4) apply auto done next case (4 a b) note * = integral_nonneg - have "\k. norm (integral (cbox a b) (\x. if x \ s then f k x else 0)) \ norm (integral s (f k))" + have "\k. norm (integral (cbox a b) (\x. if x \ S then f k x else 0)) \ norm (integral S (f k))" unfolding real_norm_def apply (subst abs_of_nonneg) apply (rule *[OF int]) apply safe - apply (case_tac "x \ s") + apply (case_tac "x \ S") apply (drule assms(1)) prefer 3 apply (subst abs_of_nonneg) @@ -6395,7 +6383,7 @@ apply safe apply (rule_tac x=aa in exI) apply safe - apply (erule_tac x="integral s (f k)" in ballE) + apply (erule_tac x="integral S (f k)" in ballE) apply (rule order_trans) apply assumption apply auto @@ -6403,7 +6391,7 @@ qed note g = conjunctD2[OF this] - have "(g has_integral i) s" + have "(g has_integral i) S" unfolding has_integral_alt' apply safe apply (rule g(1)) @@ -6425,7 +6413,7 @@ from \e > 0\ have "e/2 > 0" by auto from LIMSEQ_D [OF g(2)[of a b] this] guess M..note M=this - have **: "norm (integral (cbox a b) (\x. if x \ s then f N x else 0) - i) < e/2" + have **: "norm (integral (cbox a b) (\x. if x \ S then f N x else 0) - i) < e/2" apply (rule norm_triangle_half_l) using B(2)[rule_format,OF ab] N[rule_format,of N] apply - @@ -6436,7 +6424,7 @@ have *: "\f1 f2 g. \f1 - i\ < e/2 \ \f2 - g\ < e/2 \ f1 \ f2 \ f2 \ i \ \g - i\ < e" unfolding real_inner_1_right by arith - show "norm (integral (cbox a b) (\x. if x \ s then g x else 0) - i) < e" + show "norm (integral (cbox a b) (\x. if x \ S then g x else 0) - i) < e" unfolding real_norm_def apply (rule *[rule_format]) apply (rule **[unfolded real_norm_def]) @@ -6447,7 +6435,7 @@ apply (rule order_trans[OF _ i'[rule_format,of "M + N",unfolded real_inner_1_right]]) proof (safe, goal_cases) case (2 x) - have "\m. x \ s \ \n\m. (f m x)\1 \ (f n x)\1" + have "\m. x \ S \ \n\m. (f m x)\1 \ (f n x)\1" using assms(3) by (force intro: transitive_stepwise_le) then show ?case by auto @@ -6472,16 +6460,16 @@ done qed - have sub: "\k. integral s (\x. f k x - f 0 x) = integral s (f k) - integral s (f 0)" + have sub: "\k. integral S (\x. f k x - f 0 x) = integral S (f k) - integral S (f 0)" apply (subst integral_diff) apply (rule assms(1)[rule_format])+ apply rule done - have "\x m. x \ s \ \n\m. f m x \ f n x" + have "\x m. x \ S \ \n\m. f m x \ f n x" using assms(2) by (force intro: transitive_stepwise_le) note * = this[rule_format] - have "(\x. g x - f 0 x) integrable_on s \ ((\k. integral s (\x. f (Suc k) x - f 0 x)) \ - integral s (\x. g x - f 0 x)) sequentially" + have "(\x. g x - f 0 x) integrable_on S \ ((\k. integral S (\x. f (Suc k) x - f 0 x)) \ + integral S (\x. g x - f 0 x)) sequentially" apply (rule lem) apply safe proof goal_cases @@ -6513,16 +6501,16 @@ using assms(4) unfolding bounded_iff apply safe - apply (rule_tac x="a + norm (integral s (\x. f 0 x))" in exI) + apply (rule_tac x="a + norm (integral S (\x. f 0 x))" in exI) apply safe - apply (erule_tac x="integral s (\x. f (Suc k) x)" in ballE) + apply (erule_tac x="integral S (\x. f (Suc k) x)" in ballE) unfolding sub apply (rule order_trans[OF norm_triangle_ineq4]) apply auto done qed note conjunctD2[OF this] - note tendsto_add[OF this(2) tendsto_const[of "integral s (f 0)"]] + note tendsto_add[OF this(2) tendsto_const[of "integral S (f 0)"]] integrable_add[OF this(1) assms(1)[rule_format,of 0]] then show ?thesis unfolding sub @@ -6547,13 +6535,12 @@ proof - have x_eq: "x = (\i. integral s (f i))" by (simp add: integral_unique[OF f]) - then have x: "{integral s (f k) |k. True} = range x" + then have x: "range(\k. integral s (f k)) = range x" by auto - have *: "g integrable_on s \ (\k. integral s (f k)) \ integral s g" proof (intro monotone_convergence_increasing allI ballI assms) - show "bounded {integral s (f k) |k. True}" - unfolding x by (rule convergent_imp_bounded) fact + show "bounded (range(\k. integral s (f k)))" + using x convergent_imp_bounded assms by metis qed (use f in auto) then have "integral s g = x'" by (intro LIMSEQ_unique[OF _ \x \ x'\]) (simp add: x_eq) @@ -6563,40 +6550,34 @@ lemma monotone_convergence_decreasing: fixes f :: "nat \ 'n::euclidean_space \ real" - assumes "\k. (f k) integrable_on s" - and "\k. \x\s. f (Suc k) x \ f k x" - and "\x\s. ((\k. f k x) \ g x) sequentially" - and "bounded {integral s (f k)| k. True}" - shows "g integrable_on s \ ((\k. integral s (f k)) \ integral s g) sequentially" + assumes "\k. (f k) integrable_on S" + and "\k x. x \ S \ f (Suc k) x \ f k x" + and "\x. x \ S \ ((\k. f k x) \ g x) sequentially" + and "bounded (range(\k. integral S (f k)))" + shows "g integrable_on S \ ((\k. integral S (f k)) \ integral S g) sequentially" proof - - note assm = assms[rule_format] - have *: "{integral s (\x. - f k x) |k. True} = op *\<^sub>R (- 1) ` {integral s (f k)| k. True}" + have *: "{integral S (\x. - f k x) |k. True} = op *\<^sub>R (- 1) ` (range(\k. integral S (f k)))" apply safe unfolding image_iff - apply (rule_tac x="integral s (f k)" in bexI) + apply (rule_tac x="integral S (f k)" in bexI) prefer 3 apply (rule_tac x=k in exI) apply auto done - have "(\x. - g x) integrable_on s \ - ((\k. integral s (\x. - f k x)) \ integral s (\x. - g x)) sequentially" - apply (rule monotone_convergence_increasing) - apply safe - apply (rule integrable_neg) - apply (rule assm) - defer - apply (rule tendsto_minus) - apply (rule assm) - apply assumption - unfolding * - apply (rule bounded_scaling) - using assm - apply auto - done - note * = conjunctD2[OF this] - show ?thesis - using integrable_neg[OF *(1)] tendsto_minus[OF *(2)] - by auto + have "(\x. - g x) integrable_on S \ + ((\k. integral S (\x. - f k x)) \ integral S (\x. - g x)) sequentially" + proof (rule monotone_convergence_increasing) + show "\k. (\x. - f k x) integrable_on S" + by (blast intro: integrable_neg assms) + show "\k x. x \ S \ - f k x \ - f (Suc k) x" + by (simp add: assms) + show "\x. x \ S \ (\k. - f k x) \ - g x" + by (simp add: assms tendsto_minus) + show "bounded (range(\k. integral S (\x. - f k x)))" + using "*" assms(4) bounded_scaling by auto + qed + then show ?thesis + by (force dest: integrable_neg tendsto_minus) qed lemma integral_norm_bound_integral: @@ -7553,7 +7534,7 @@ also have "\ \ exp (- a * c) / a" using a by simp finally show ?thesis . qed (insert a, simp_all add: integral_f) - thus "bounded {integral {c..} (f k) |k. True}" + thus "bounded (range(\k. integral {c..} (f k)))" by (intro boundedI[of _ "exp (-a*c)/a"]) auto qed (auto simp: f_def) @@ -7646,7 +7627,7 @@ hence "F k = abs (F k)" by simp finally have "abs (F k) \ c powr (a + 1) / (a + 1)" . } - thus "bounded {integral {0..c} (f k) |k. True}" + thus "bounded (range(\k. integral {0..c} (f k)))" by (intro boundedI[of _ "c powr (a+1) / (a+1)"]) (auto simp: integral_f) qed @@ -7732,7 +7713,7 @@ by (intro powr_mono2') simp_all with assms show ?thesis by (auto simp: divide_simps F_def integral_f) qed (insert assms, simp add: integral_f F_def divide_simps) - thus "bounded {integral {a..} (f n) |n. True}" + thus "bounded (range(\k. integral {a..} (f k)))" unfolding bounded_iff by (intro exI[of _ "-F a"]) auto qed