# HG changeset patch # User paulson # Date 1498572613 -3600 # Node ID 994322c172745fa4950e89b9748599bc8504bdf2 # Parent 4a5589dd8e1a8747fc63a0a499d2df6beb1bb996 Removed more "guess", etc. diff -r 4a5589dd8e1a -r 994322c17274 src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy --- a/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Tue Jun 27 00:07:34 2017 +0200 +++ b/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Tue Jun 27 15:10:13 2017 +0100 @@ -1770,19 +1770,11 @@ unfolding p'_def by auto then obtain i l where il: "x \ i" "i \ d" "(x, l) \ p" "k = i \ l" by blast then show "\y i l. (x, k) = (y, i \ l) \ (y, l) \ p \ i \ d \ i \ l \ {}" - apply (rule_tac x=x in exI) - apply (rule_tac x=i in exI) - apply (rule_tac x=l in exI) - using p'(2)[OF il(3)] - apply auto - done + using p'(2) by fastforce qed have sum_p': "(\(x, k)\p'. norm (integral k f)) = (\k\snd ` p'. norm (integral k f))" apply (subst sum.over_tagged_division_lemma[OF p'',of "\k. norm (integral k f)"]) - unfolding norm_eq_zero - apply (rule integral_null) - apply (simp add: content_eq_0_interior) - apply rule + apply (auto intro: integral_null simp: content_eq_0_interior) done note snd_p = division_ofD[OF division_of_tagged_division[OF p(1)]] @@ -1849,11 +1841,7 @@ case prems: (1 l y) have "interior (k \ l) \ interior (l \ y)" apply (subst(2) interior_Int) - apply (rule Int_greatest) - defer - apply (subst prems(4)) - apply auto - done + by (metis Int_lower2 Int_subset_iff interior_mono prems(4)) then have *: "interior (k \ l) = {}" using snd_p(5)[OF prems(1-3)] by auto from d'(4)[OF k] snd_p(4)[OF prems(1)] guess u1 v1 u2 v2 by (elim exE) note uv=this @@ -1894,16 +1882,7 @@ have "l1 \ l2 \ k1 \ k2" using as by auto then have "interior k1 \ interior k2 = {} \ interior l1 \ interior l2 = {}" - apply - - apply (erule disjE) - apply (rule disjI2) - apply (rule d'(5)) - prefer 4 - apply (rule disjI1) - apply (rule *) - using as - apply auto - done + by (metis Pair_inject \k1 \ snd ` p\ \l1 \ d\ as(4) d'(5) snd_p(5)) moreover have "interior (l1 \ k1) = interior (l2 \ k2)" using as(2) by auto ultimately have "interior(l1 \ k1) = {}" @@ -1934,14 +1913,13 @@ case (1 x a b) then show ?case unfolding p'_def - apply safe - apply (rule_tac x=i in exI) - apply (rule_tac x=l in exI) - unfolding snd_conv image_iff - apply safe - apply (rule_tac x="(a,l)" in bexI) - apply auto - done + proof - + assume "(a, b) \ {(x, k) |x k. \i l. x \ i \ i \ d \ (x, l) \ p \ k = i \ l}" + then have "\n N. (a, b) = (n, N) \ (\Na Nb. n \ Na \ Na \ d \ (n, Nb) \ p \ N = Na \ Nb)" + by force + then show ?thesis + by (metis (no_types) image_iff snd_conv) + qed qed finally show ?case . next @@ -2019,15 +1997,7 @@ note xl = p'(2-4)[OF this] from this(3) guess u v by (elim exE) note uv=this have "(\i\d. \content (l \ i)\) = (\k\d. content (k \ cbox u v))" - apply (rule sum.cong) - apply (rule refl) - apply (drule d'(4)) - apply safe - apply (subst Int_commute) - unfolding Int_interval uv - apply (subst abs_of_nonneg) - apply auto - done + by (simp add: Int_commute uv) also have "\ = sum content {k \ cbox u v| k. k \ d}" unfolding Setcompr_eq_image apply (rule sum.reindex_nontrivial [unfolded o_def, symmetric]) @@ -2095,13 +2065,11 @@ by (intro bdd_aboveI2[where M=B] assms(2)[rule_format]) simp note D = D_1 D_2 let ?S = "SUP d:?D. ?f d" - have f_int: "\a b. f absolutely_integrable_on cbox a b" + have "\a b. f integrable_on cbox a b" + using assms(1) integrable_on_subcbox by blast + then have f_int: "\a b. f absolutely_integrable_on cbox a b" apply (rule bounded_variation_absolutely_integrable_interval[where B=B]) - apply (rule integrable_on_subcbox[OF assms(1)]) - defer - apply safe - apply (rule assms(2)[rule_format]) - apply auto + using assms(2) apply blast done have "((\x. norm (f x)) has_integral ?S) UNIV" apply (subst has_integral_alt') diff -r 4a5589dd8e1a -r 994322c17274 src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Tue Jun 27 00:07:34 2017 +0200 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Tue Jun 27 15:10:13 2017 +0100 @@ -11,7 +11,6 @@ (*FIXME DELETE*) lemma conjunctD2: assumes "a \ b" shows a b using assms by auto -lemma conjunctD3: assumes "a \ b \ c" shows a b c using assms by auto (* try instead structured proofs below *) lemma norm_diff2: "\y = y1 + y2; x = x1 + x2; e = e1 + e2; norm(y1 - x1) \ e1; norm(y2 - x2) \ e2\ @@ -1570,11 +1569,11 @@ lemma has_integral_component_le: fixes f g :: "'a::euclidean_space \ 'b::euclidean_space" assumes k: "k \ Basis" - assumes "(f has_integral i) s" "(g has_integral j) s" - and "\x\s. (f x)\k \ (g x)\k" + assumes "(f has_integral i) S" "(g has_integral j) S" + and f_le_g: "\x. x \ S \ (f x)\k \ (g x)\k" shows "i\k \ j\k" proof - - have lem: "i\k \ j\k" + have ik_le_jk: "i\k \ j\k" if f_i: "(f has_integral i) (cbox a b)" and g_j: "(g has_integral j) (cbox a b)" and le: "\x\cbox a b. (f x)\k \ (g x)\k" @@ -1583,25 +1582,29 @@ assume "\ ?thesis" then have *: "0 < (i\k - j\k) / 3" by auto - guess d1 using f_i[unfolded has_integral,rule_format,OF *] by (elim exE conjE) note d1=this[rule_format] - guess d2 using g_j[unfolded has_integral,rule_format,OF *] by (elim exE conjE) note d2=this[rule_format] - obtain p where p: "p tagged_division_of cbox a b" "d1 fine p" "d2 fine p" - using fine_division_exists[OF gauge_Int[OF d1(1) d2(1)], of a b] unfolding fine_Int + obtain \1 where "gauge \1" + and \1: "\p. \p tagged_division_of cbox a b; \1 fine p\ + \ norm ((\(x, k)\p. content k *\<^sub>R f x) - i) < (i \ k - j \ k) / 3" + using f_i[unfolded has_integral,rule_format,OF *] by fastforce + obtain \2 where "gauge \2" + and \2: "\p. \p tagged_division_of cbox a b; \2 fine p\ + \ norm ((\(x, k)\p. content k *\<^sub>R g x) - j) < (i \ k - j \ k) / 3" + using g_j[unfolded has_integral,rule_format,OF *] by fastforce + obtain p where p: "p tagged_division_of cbox a b" and "\1 fine p" "\2 fine p" + using fine_division_exists[OF gauge_Int[OF \gauge \1\ \gauge \2\], of a b] unfolding fine_Int by metis - note le_less_trans[OF Basis_le_norm[OF k]] then have "\((\(x, k)\p. content k *\<^sub>R f x) - i) \ k\ < (i \ k - j \ k) / 3" - "\((\(x, k)\p. content k *\<^sub>R g x) - j) \ k\ < (i \ k - j \ k) / 3" - using k norm_bound_Basis_lt d1 d2 p - by blast+ + "\((\(x, k)\p. content k *\<^sub>R g x) - j) \ k\ < (i \ k - j \ k) / 3" + using le_less_trans[OF Basis_le_norm[OF k]] k \1 \2 by metis+ then show False unfolding inner_simps - using rsum_component_le[OF p(1)] le - by (force simp add: abs_real_def split: if_split_asm) + using rsum_component_le[OF p] le + by (fastforce simp add: abs_real_def split: if_split_asm) qed show ?thesis - proof (cases "\a b. s = cbox a b") + proof (cases "\a b. S = cbox a b") case True - with lem assms show ?thesis + with ik_le_jk assms show ?thesis by auto next case False @@ -1610,22 +1613,34 @@ assume "\ i\k \ j\k" then have ij: "(i\k - j\k) / 3 > 0" by auto - note has_integral_altD[OF _ False this] - from this[OF assms(2)] this[OF assms(3)] guess B1 B2 . note B=this[rule_format] + obtain B1 where "0 < B1" + and 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 - i) < (i \ k - j \ k) / 3" + using has_integral_altD[OF _ False ij] assms by blast + obtain B2 where "0 < B2" + and B2: "\a b. ball 0 B2 \ cbox a b \ + \z. ((\x. if x \ S then g x else 0) has_integral z) (cbox a b) \ + norm (z - j) < (i \ k - j \ k) / 3" + using has_integral_altD[OF _ False ij] assms by blast have "bounded (ball 0 B1 \ ball (0::'a) B2)" unfolding bounded_Un by(rule conjI bounded_ball)+ - from bounded_subset_cbox[OF this] guess a b by (elim exE) - then have ab: "ball 0 B1 \ cbox a b" "ball 0 B2 \ cbox a b" + from bounded_subset_cbox[OF this] + obtain a b::'a where ab: "ball 0 B1 \ cbox a b" "ball 0 B2 \ cbox a b" by blast+ - guess w1 using B(2)[OF ab(1)] .. note w1=conjunctD2[OF this] - guess w2 using B(4)[OF ab(2)] .. note w2=conjunctD2[OF this] + then obtain w1 w2 where int_w1: "((\x. if x \ S then f x else 0) has_integral w1) (cbox a b)" + and norm_w1: "norm (w1 - i) < (i \ k - j \ k) / 3" + and int_w2: "((\x. if x \ S then g x else 0) has_integral w2) (cbox a b)" + and norm_w2: "norm (w2 - j) < (i \ k - j \ k) / 3" + using B1 B2 by blast have *: "\w1 w2 j i::real .\w1 - i\ < (i - j) / 3 \ \w2 - j\ < (i - j) / 3 \ w1 \ w2 \ False" by (simp add: abs_real_def split: if_split_asm) - note le_less_trans[OF Basis_le_norm[OF k]] - note this[OF w1(2)] this[OF w2(2)] + have "\(w1 - i) \ k\ < (i \ k - j \ k) / 3" + "\(w2 - j) \ k\ < (i \ k - j \ k) / 3" + using Basis_le_norm k le_less_trans norm_w1 norm_w2 by blast+ moreover have "w1\k \ w2\k" - by (rule lem[OF w1(1) w2(1)]) (simp add: assms(4)) + using ik_le_jk int_w1 int_w2 f_le_g by auto ultimately show False unfolding inner_simps by(rule *) qed @@ -1635,9 +1650,9 @@ lemma integral_component_le: fixes g f :: "'a::euclidean_space \ 'b::euclidean_space" assumes "k \ Basis" - and "f integrable_on s" "g integrable_on s" - and "\x\s. (f x)\k \ (g x)\k" - shows "(integral s f)\k \ (integral s g)\k" + and "f integrable_on S" "g integrable_on S" + and "\x. x \ S \ (f x)\k \ (g x)\k" + shows "(integral S f)\k \ (integral S g)\k" apply (rule has_integral_component_le) using integrable_integral assms apply auto @@ -1646,8 +1661,8 @@ lemma has_integral_component_nonneg: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes "k \ Basis" - and "(f has_integral i) s" - and "\x\s. 0 \ (f x)\k" + and "(f has_integral i) S" + and "\x. x \ S \ 0 \ (f x)\k" shows "0 \ i\k" using has_integral_component_le[OF assms(1) has_integral_0 assms(2)] using assms(3-) @@ -1656,9 +1671,9 @@ lemma integral_component_nonneg: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes "k \ Basis" - and "\x\s. 0 \ (f x)\k" - shows "0 \ (integral s f)\k" -proof (cases "f integrable_on s") + and "\x. x \ S \ 0 \ (f x)\k" + shows "0 \ (integral S f)\k" +proof (cases "f integrable_on S") case True show ?thesis apply (rule has_integral_component_nonneg) using assms True @@ -1671,8 +1686,8 @@ lemma has_integral_component_neg: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes "k \ Basis" - and "(f has_integral i) s" - and "\x\s. (f x)\k \ 0" + and "(f has_integral i) S" + and "\x. x \ S \ (f x)\k \ 0" shows "i\k \ 0" using has_integral_component_le[OF assms(1,2) has_integral_0] assms(2-) by auto @@ -2149,7 +2164,11 @@ by (meson Max_ge as(1) dual_order.trans finite_imageI tagged_division_of_finite) have "\i. \q. q tagged_division_of (cbox a b) \ (d i) fine q \ (\(x, k)\p. k \ (d i) x \ (x, k) \ q)" by (auto intro: tagged_division_finer[OF as(1) d(1)]) - from choice[OF this] guess q .. note q=conjunctD3[OF this[rule_format]] + from choice[OF this] + obtain q where q: "\n. q n tagged_division_of cbox a b" + "\n. d n fine q n" + "\n x k. \(x, k) \ p; k \ d n x\ \ (x, k) \ q n" + by fastforce have *: "\i. (\(x, k)\q i. content k *\<^sub>R indicator s x) \ (0::real)" apply (rule sum_nonneg) apply safe @@ -2159,14 +2178,7 @@ done have **: "finite s \ finite t \ (\(x,y) \ t. (0::real) \ g(x,y)) \ (\y\s. \x. (x,y) \ t \ f(y) \ g(x,y)) \ sum f s \ sum g t" for f g s t - apply (rule sum_le_included[of s t g snd f]) - prefer 4 - apply safe - apply (erule_tac x=x in ballE) - apply (erule exE) - apply (rule_tac x="(xa,x)" in bexI) - apply auto - done + by (rule sum_le_included[of s t g snd f]; force) have "norm ((\(x, k)\p. content k *\<^sub>R f x) - 0) \ sum (\i. (real i + 1) * norm (sum (\(x,k). content k *\<^sub>R indicator s x :: real) (q i))) {..N+1}" unfolding real_norm_def sum_distrib_left abs_of_nonneg[OF *] diff_0_right @@ -2228,13 +2240,7 @@ qed ultimately show "\y. (y, x, k) \ {(i, j) |i j. i \ {..N + 1} \ j \ q i} \ norm (content k *\<^sub>R f x) \ (real y + 1) * (content k *\<^sub>R indicator s x)" - apply (rule_tac x=n in exI) - apply safe - apply (rule_tac x=n in exI) - apply (rule_tac x="(x,k)" in exI) - apply safe - apply auto - done + by force qed (insert as, auto) also have "\ \ sum (\i. e / 2 / 2 ^ i) {..N+1}" proof (rule sum_mono, goal_cases)