# HG changeset patch # User paulson # Date 1503788270 -3600 # Node ID b757c1cc8868e1a8cf9596a4d7d51dcae263748a # Parent 5e65236e95aa42e29009520166383f2de8f3a8d4 Elimination of some "presume" diff -r 5e65236e95aa -r b757c1cc8868 src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Sat Aug 26 18:04:27 2017 +0100 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Sat Aug 26 23:57:50 2017 +0100 @@ -314,61 +314,46 @@ lemma has_integral_eq_rhs: "(f has_integral j) S \ i = j \ (f has_integral i) S" by (rule forw_subst) +lemma has_integral_unique_cbox: + fixes f :: "'n::euclidean_space \ 'a::real_normed_vector" + shows "(f has_integral k1) (cbox a b) \ (f has_integral k2) (cbox a b) \ k1 = k2" + by (auto simp: has_integral_cbox intro: tendsto_unique[OF division_filter_not_empty]) + lemma has_integral_unique: fixes f :: "'n::euclidean_space \ 'a::real_normed_vector" - assumes "(f has_integral k1) i" - and "(f has_integral k2) i" + assumes "(f has_integral k1) i" "(f has_integral k2) i" shows "k1 = k2" proof (rule ccontr) let ?e = "norm (k1 - k2) / 2" - assume as: "k1 \ k2" + let ?F = "(\x. if x \ i then f x else 0)" + assume "k1 \ k2" then have e: "?e > 0" by auto - have lem: "(f has_integral k1) (cbox a b) \ (f has_integral k2) (cbox a b) \ k1 = k2" - for f :: "'n \ 'a" and a b k1 k2 - by (auto simp: has_integral_cbox intro: tendsto_unique[OF division_filter_not_empty]) - { - presume "\ (\a b. i = cbox a b) \ False" - then show False - using as assms lem by blast - } - assume as: "\ (\a b. i = cbox a b)" + have nonbox: "\ (\a b. i = cbox a b)" + using \k1 \ k2\ assms has_integral_unique_cbox by blast obtain B1 where B1: "0 < B1" "\a b. ball 0 B1 \ cbox a b \ - \z. ((\x. if x \ i then f x else 0) has_integral z) (cbox a b) \ - norm (z - k1) < norm (k1 - k2) / 2" - by (rule has_integral_altD[OF assms(1) as,OF e]) blast + \z. (?F has_integral z) (cbox a b) \ norm (z - k1) < norm (k1 - k2) / 2" + by (rule has_integral_altD[OF assms(1) nonbox,OF e]) blast obtain B2 where B2: "0 < B2" "\a b. ball 0 B2 \ cbox a b \ - \z. ((\x. if x \ i then f x else 0) has_integral z) (cbox a b) \ - norm (z - k2) < norm (k1 - k2) / 2" - by (rule has_integral_altD[OF assms(2) as,OF e]) blast - have "\a b::'n. ball 0 B1 \ ball 0 B2 \ cbox a b" - apply (rule bounded_subset_cbox) - using bounded_Un bounded_ball - apply auto - done - then obtain a b :: 'n where ab: "ball 0 B1 \ cbox a b" "ball 0 B2 \ cbox a b" - by blast - obtain w where w: - "((\x. if x \ i then f x else 0) has_integral w) (cbox a b)" - "norm (w - k1) < norm (k1 - k2) / 2" + \z. (?F has_integral z) (cbox a b) \ norm (z - k2) < norm (k1 - k2) / 2" + by (rule has_integral_altD[OF assms(2) nonbox,OF e]) blast + obtain a b :: 'n where ab: "ball 0 B1 \ cbox a b" "ball 0 B2 \ cbox a b" + by (metis Un_subset_iff bounded_Un bounded_ball bounded_subset_cbox) + obtain w where w: "(?F has_integral w) (cbox a b)" "norm (w - k1) < norm (k1 - k2) / 2" using B1(2)[OF ab(1)] by blast - obtain z where z: - "((\x. if x \ i then f x else 0) has_integral z) (cbox a b)" - "norm (z - k2) < norm (k1 - k2) / 2" + obtain z where z: "(?F has_integral z) (cbox a b)" "norm (z - k2) < norm (k1 - k2) / 2" using B2(2)[OF ab(2)] by blast have "z = w" - using lem[OF w(1) z(1)] by auto + using has_integral_unique_cbox[OF w(1) z(1)] by auto then have "norm (k1 - k2) \ norm (z - k2) + norm (w - k1)" using norm_triangle_ineq4 [of "k1 - w" "k2 - z"] by (auto simp add: norm_minus_commute) also have "\ < norm (k1 - k2) / 2 + norm (k1 - k2) / 2" - apply (rule add_strict_mono) - apply (rule_tac[!] z(2) w(2)) - done + by (metis add_strict_mono z(2) w(2)) finally show False by auto qed @@ -408,29 +393,28 @@ shows "integral {a..b} (\x. c) = content {a..b} *\<^sub>R c" by (metis box_real(2) integral_const) -lemma has_integral_is_0: +lemma has_integral_is_0_cbox: fixes f :: "'n::euclidean_space \ 'a::real_normed_vector" - assumes "\x\s. f x = 0" - shows "(f has_integral 0) s" -proof - - have lem: "(\x\cbox a b. f x = 0) \ (f has_integral 0) (cbox a b)" for a b and f :: "'n \ 'a" + assumes "\x. x \ cbox a b \ f x = 0" + shows "(f has_integral 0) (cbox a b)" unfolding has_integral_cbox - using eventually_division_filter_tagged_division[of "cbox a b"] + using eventually_division_filter_tagged_division[of "cbox a b"] assms by (subst tendsto_cong[where g="\_. 0"]) (auto elim!: eventually_mono intro!: sum.neutral simp: tag_in_interval) - { - presume "\ (\a b. s = cbox a b) \ ?thesis" - with assms lem show ?thesis - by blast - } - have *: "(\x. if x \ s then f x else 0) = (\x. 0)" - apply (rule ext) - using assms - apply auto - done - assume "\ (\a b. s = cbox a b)" - then show ?thesis - using lem + +lemma has_integral_is_0: + fixes f :: "'n::euclidean_space \ 'a::real_normed_vector" + assumes "\x. x \ S \ f x = 0" + shows "(f has_integral 0) S" +proof (cases "(\a b. S = cbox a b)") + case True with assms has_integral_is_0_cbox show ?thesis + by blast +next + case False + have *: "(\x. if x \ S then f x else 0) = (\x. 0)" + by (auto simp add: assms) + show ?thesis + using has_integral_is_0_cbox False by (subst has_integral_alt) (force simp add: *) qed @@ -440,47 +424,56 @@ lemma has_integral_0_eq[simp]: "((\x. 0) has_integral i) S \ i = 0" using has_integral_unique[OF has_integral_0] by auto +lemma has_integral_linear_cbox: + fixes f :: "'n::euclidean_space \ 'a::real_normed_vector" + assumes f: "(f has_integral y) (cbox a b)" + and h: "bounded_linear h" + shows "((h \ f) has_integral (h y)) (cbox a b)" +proof - + interpret bounded_linear h using h . + show ?thesis + unfolding has_integral_cbox using tendsto [OF f [unfolded has_integral_cbox]] + by (simp add: sum scaleR split_beta') +qed + lemma has_integral_linear: fixes f :: "'n::euclidean_space \ 'a::real_normed_vector" - assumes "(f has_integral y) S" - and "bounded_linear h" - shows "((h \ f) has_integral ((h y))) S" -proof - - interpret bounded_linear h - using assms(2) . + assumes f: "(f has_integral y) S" + and h: "bounded_linear h" + shows "((h \ f) has_integral (h y)) S" +proof (cases "(\a b. S = cbox a b)") + case True with f h has_integral_linear_cbox show ?thesis + by blast +next + case False + interpret bounded_linear h using h . from pos_bounded obtain B where B: "0 < B" "\x. norm (h x) \ norm x * B" by blast - have lem: "\a b y f::'n\'a. (f has_integral y) (cbox a b) \ ((h \ f) has_integral h y) (cbox a b)" - unfolding has_integral_cbox by (drule tendsto) (simp add: sum scaleR split_beta') - { - presume "\ (\a b. S = cbox a b) \ ?thesis" - then show ?thesis - using assms(1) lem by blast - } - assume as: "\ (\a b. S = cbox a b)" - then show ?thesis - proof (subst has_integral_alt, clarsimp) + let ?S = "\f x. if x \ S then f x else 0" + show ?thesis + proof (subst has_integral_alt, clarsimp simp: False) fix e :: real assume e: "e > 0" have *: "0 < e/B" using e B(1) by simp obtain M where M: "M > 0" "\a b. ball 0 M \ cbox a b \ - \z. ((\x. if x \ S then f x else 0) has_integral z) (cbox a b) \ norm (z - y) < e/B" - using has_integral_altD[OF assms(1) as *] by blast + \z. (?S f has_integral z) (cbox a b) \ norm (z - y) < e/B" + using has_integral_altD[OF f False *] by blast show "\B>0. \a b. ball 0 B \ cbox a b \ - (\z. ((\x. if x \ S then (h \ f) x else 0) has_integral z) (cbox a b) \ norm (z - h y) < e)" - proof (rule_tac x=M in exI, clarsimp simp add: M, goal_cases) - case prems: (1 a b) - obtain z where z: - "((\x. if x \ S then f x else 0) has_integral z) (cbox a b)" - "norm (z - y) < e/B" - using M(2)[OF prems(1)] by blast - have *: "(\x. if x \ S then (h \ f) x else 0) = h \ (\x. if x \ S then f x else 0)" + (\z. (?S(h \ f) has_integral z) (cbox a b) \ norm (z - h y) < e)" + proof (rule exI, intro allI conjI impI) + show "M > 0" using M by metis + next + fix a b::'n + assume sb: "ball 0 M \ cbox a b" + obtain z where z: "(?S f has_integral z) (cbox a b)" "norm (z - y) < e/B" + using M(2)[OF sb] by blast + have *: "?S(h \ f) = h \ ?S f" using zero by auto - show ?case + show "\z. (?S(h \ f) has_integral z) (cbox a b) \ norm (z - h y) < e" apply (rule_tac x="h z" in exI) - apply (simp add: * lem[OF z(1)]) + apply (simp add: * has_integral_linear_cbox[OF z(1) h]) apply (metis B diff le_less_trans pos_less_divide_eq z(2)) done qed @@ -571,19 +564,19 @@ then show ?thesis using assms lem by force } - assume as: "\ (\a b. S = cbox a b)" + assume nonbox: "\ (\a b. S = cbox a b)" then show ?thesis proof (subst has_integral_alt, clarsimp, goal_cases) case (1 e) then have *: "e/2 > 0" by auto - from has_integral_altD[OF assms(1) as *] + from has_integral_altD[OF assms(1) nonbox *] obtain B1 where B1: "0 < B1" "\a b. ball 0 B1 \ cbox a b \ \z. ((\x. if x \ S then f x else 0) has_integral z) (cbox a b) \ norm (z - k) < e/2" by blast - from has_integral_altD[OF assms(2) as *] + from has_integral_altD[OF assms(2) nonbox *] obtain B2 where B2: "0 < B2" "\a b. ball 0 B2 \ (cbox a b) \ @@ -804,7 +797,7 @@ by (simp add: has_integral_integrable) lemma has_integral_empty[intro]: "(f has_integral 0) {}" - by (simp add: has_integral_is_0) + by (meson ex_in_conv has_integral_is_0) lemma has_integral_empty_eq[simp]: "(f has_integral i) {} \ i = 0" by (auto simp add: has_integral_empty has_integral_unique) @@ -6022,7 +6015,7 @@ using bounded_increasing_convergent [OF bou] le int_f integral_le by blast have i': "(integral S (f k)) \ i" for k proof - - have "\k. \x\S. \n\k. f k x \ f n x" + have "\k. \x. x \ S \ \n\k. f k x \ f n x" using le by (force intro: transitive_stepwise_le) then show ?thesis using tendsto_lowerbound [OF i eventually_sequentiallyI trivial_limit_sequentially] @@ -6199,7 +6192,7 @@ fixes f :: "'n::euclidean_space \ 'a::banach" assumes int_f: "f integrable_on S" and int_g: "g integrable_on S" - and le_g: "\x\S. norm (f x) \ g x" + and le_g: "\x. x \ S \ norm (f x) \ g x" shows "norm (integral S f) \ integral S g" proof - have norm: "norm \ \ y + e" @@ -6306,31 +6299,29 @@ lemma integral_norm_bound_integral_component: fixes f :: "'n::euclidean_space \ 'a::banach" fixes g :: "'n \ 'b::euclidean_space" - assumes "f integrable_on s" - and "g integrable_on s" - and "\x\s. norm(f x) \ (g x)\k" - shows "norm (integral s f) \ (integral s g)\k" + assumes f: "f integrable_on S" and g: "g integrable_on S" + and fg: "\x. x \ S \ norm(f x) \ (g x)\k" + shows "norm (integral S f) \ (integral S g)\k" proof - - have "norm (integral s f) \ integral s ((\x. x \ k) \ g)" - apply (rule integral_norm_bound_integral[OF assms(1)]) - apply (rule integrable_linear[OF assms(2)]) - apply rule + have "norm (integral S f) \ integral S ((\x. x \ k) \ g)" + apply (rule integral_norm_bound_integral[OF f integrable_linear[OF g]]) + apply (simp add: bounded_linear_inner_left) unfolding o_def - apply (rule assms) + apply (metis fg) done then show ?thesis - unfolding o_def integral_component_eq[OF assms(2)] . + unfolding o_def integral_component_eq[OF g] . qed lemma has_integral_norm_bound_integral_component: fixes f :: "'n::euclidean_space \ 'a::banach" fixes g :: "'n \ 'b::euclidean_space" - assumes "(f has_integral i) s" - and "(g has_integral j) s" - and "\x\s. norm (f x) \ (g x)\k" + assumes f: "(f has_integral i) S" + and g: "(g has_integral j) S" + and "\x. x \ S \ norm (f x) \ (g x)\k" shows "norm i \ j\k" - using integral_norm_bound_integral_component[of f s g k] - unfolding integral_unique[OF assms(1)] integral_unique[OF assms(2)] + using integral_norm_bound_integral_component[of f S g k] + unfolding integral_unique[OF f] integral_unique[OF g] using assms by auto