# HG changeset patch # User paulson # Date 1501942715 -7200 # Node ID d8c7ca0e01c6a88ac266b7cca2a0839133904e0e # Parent 1072edd475dcaebf7710ca3ec5943698901e88b4 more cleanup diff -r 1072edd475dc -r d8c7ca0e01c6 src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy --- a/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Sat Aug 05 12:18:25 2017 +0200 +++ b/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Sat Aug 05 16:18:35 2017 +0200 @@ -1202,13 +1202,13 @@ assume "0 < e" have "S \ lmeasurable" using \negligible S\ by (simp add: negligible_iff_null_sets fmeasurableI_null_sets) - have e22: "0 < e / 2 / (2 * B * real DIM('M)) ^ DIM('N)" + have e22: "0 < e/2 / (2 * B * real DIM('M)) ^ DIM('N)" using \0 < e\ \0 < B\ by (simp add: divide_simps) obtain T where "open T" "S \ T" "T \ lmeasurable" - and "measure lebesgue T \ measure lebesgue S + e / 2 / (2 * B * DIM('M)) ^ DIM('N)" + and "measure lebesgue T \ measure lebesgue S + e/2 / (2 * B * DIM('M)) ^ DIM('N)" by (rule lmeasurable_outer_open [OF \S \ lmeasurable\ e22]) - then have T: "measure lebesgue T \ e / 2 / (2 * B * DIM('M)) ^ DIM('N)" + then have T: "measure lebesgue T \ e/2 / (2 * B * DIM('M)) ^ DIM('N)" using \negligible S\ by (simp add: negligible_iff_null_sets measure_eq_0_null_sets) have "\r. 0 < r \ r \ 1/2 \ (x \ S \ (\y. norm(y - x) < r @@ -1289,7 +1289,7 @@ qed have countbl: "countable (fbx ` \)" using \countable \\ by blast - have "(\k\fbx`\'. measure lebesgue k) \ e / 2" if "\' \ \" "finite \'" for \' + have "(\k\fbx`\'. measure lebesgue k) \ e/2" if "\' \ \" "finite \'" for \' proof - have BM_ge0: "0 \ B * (DIM('M) * prj1 (vf X - uf X))" if "X \ \'" for X using \0 < B\ \\' \ \\ that vu_pos by fastforce @@ -1333,7 +1333,7 @@ qed also have "\ = (2 * B * DIM('M)) ^ DIM('N) * sum (measure lebesgue) \'" by (simp add: sum_distrib_left) - also have "\ \ e / 2" + also have "\ \ e/2" proof - have div: "\' division_of \\'" apply (auto simp: \finite \'\ \{} \ \'\ division_of_def) @@ -1366,13 +1366,13 @@ using \0 < B\ apply (simp add: algebra_simps) done - also have "\ \ e / 2" + also have "\ \ e/2" using T \0 < B\ by (simp add: field_simps) finally show ?thesis . qed finally show ?thesis . qed - then have e2: "sum (measure lebesgue) \ \ e / 2" if "\ \ fbx ` \" "finite \" for \ + then have e2: "sum (measure lebesgue) \ \ e/2" if "\ \ fbx ` \" "finite \" for \ by (metis finite_subset_image that) show "\W\lmeasurable. f ` S \ W \ measure lebesgue W < e" proof (intro bexI conjI) @@ -1636,8 +1636,8 @@ norm ((\(x, k)\p. content k *\<^sub>R norm (f x)) - ?S) < e)" if e: "e > 0" for e proof - - have "?S - e / 2 < ?S" using \e > 0\ by simp - then obtain d where d: "d division_of (cbox a b)" "?S - e / 2 < (\k\d. norm (integral k f))" + have "?S - e/2 < ?S" using \e > 0\ by simp + then obtain d where d: "d division_of (cbox a b)" "?S - e/2 < (\k\d. norm (integral k f))" unfolding less_cSUP_iff[OF D] by auto note d' = division_ofD[OF this(1)] @@ -1661,42 +1661,34 @@ by metis have "e/2 > 0" using e by auto - from henstock_lemma[OF assms(1) this] + with henstock_lemma[OF f] obtain g where g: "gauge g" "\p. \p tagged_partial_division_of cbox a b; g fine p\ - \ (\(x, k)\p. norm (content k *\<^sub>R f x - integral k f)) < e / 2" + \ (\(x, k)\p. norm (content k *\<^sub>R f x - integral k f)) < e/2" by (metis (no_types, lifting)) let ?g = "\x. g x \ ball x (k x)" show ?thesis - apply (rule_tac x="?g" in exI) - apply safe - proof - + proof (intro exI conjI allI impI) show "gauge ?g" - using g(1) k(1) - unfolding gauge_def - by auto + using g(1) k(1) by (auto simp: gauge_def) + next fix p - assume "p tagged_division_of (cbox a b)" and "?g fine p" - note p = this(1) conjunctD2[OF this(2)[unfolded fine_Int]] + assume "p tagged_division_of (cbox a b) \ ?g fine p" + then have p: "p tagged_division_of cbox a b" "g fine p" "(\x. ball x (k x)) fine p" + by (auto simp: fine_Int) note p' = tagged_division_ofD[OF p(1)] define p' where "p' = {(x,k) | x k. \i l. x \ i \ i \ d \ (x,l) \ p \ k = i \ l}" have gp': "g fine p'" - using p(2) - unfolding p'_def fine_def - by auto + using p(2) by (auto simp: p'_def fine_def) have p'': "p' tagged_division_of (cbox a b)" proof (rule tagged_division_ofI) show "finite p'" - apply (rule finite_subset[of _ "(\(k,(x,l)). (x,k \ l)) ` - {(k,xl) | k xl. k \ d \ xl \ p}"]) - unfolding p'_def - defer - apply (rule finite_imageI,rule finite_product_dependent[OF d'(1) p'(1)]) - apply safe - unfolding image_iff - apply (rule_tac x="(i,x,l)" in bexI) - apply auto - done + proof (rule finite_subset) + show "p' \ (\(k, x, l). (x, k \ l)) ` (d \ p)" + by (force simp: p'_def image_iff) + show "finite ((\(k, x, l). (x, k \ l)) ` (d \ p))" + by (simp add: d'(1) p'(1)) + qed fix x k assume "(x, k) \ p'" then have "\i l. x \ i \ i \ d \ (x, l) \ p \ k = i \ l" @@ -1714,7 +1706,7 @@ unfolding p'_def by auto then obtain i1 l1 where il1: "x1 \ i1" "i1 \ d" "(x1, l1) \ p" "k1 = i1 \ l1" by blast fix x2 k2 - assume "(x2,k2)\p'" + assume "(x2,k2) \ p'" then have "\i l. x2 \ i \ i \ d \ (x2, l) \ p \ k2 = i \ l" unfolding p'_def by auto then obtain i2 l2 where il2: "x2 \ i2" "i2 \ d" "(x2, l2) \ p" "k2 = i2 \ l2" by blast @@ -1735,8 +1727,8 @@ have "x \ i" using fineD[OF p(3) xl(1)] using k(2) i xl by auto then show ?thesis - apply (rule_tac X="i \ l" in UnionI) - using i xl by (auto simp: p'_def) + unfolding p'_def + by (rule_tac X="i \ l" in UnionI) (use i xl in auto) qed show "\{k. \x. (x, k) \ p'} = cbox a b" proof @@ -1760,11 +1752,8 @@ qed qed - then have sum_less_e2: "(\(x, k)\p'. norm (content k *\<^sub>R f x - integral k f)) < e / 2" + then have sum_less_e2: "(\(x, k)\p'. norm (content k *\<^sub>R f x - integral k f)) < e/2" using g(2) gp' tagged_division_of_def by blast - then have XXX: "\(\(x,k)\p'. norm (content k *\<^sub>R f x)) - (\(x,k)\p'. norm (integral k f))\ < e / 2" - unfolding split_def - using p'' by (force intro!: absdiff_norm_less) have p'alt: "p' = {(x,(i \ l)) | x i l. (x,l) \ p \ i \ d \ i \ l \ {}}" proof (safe, goal_cases) @@ -1797,15 +1786,14 @@ done note snd_p = division_ofD[OF division_of_tagged_division[OF p(1)]] - - have *: "\sni sni' sf sf'. \\sf' - sni'\ < e / 2; ?S - e / 2 < sni; sni' \ ?S; + have *: "\sni sni' sf sf'. \\sf' - sni'\ < e/2; ?S - e/2 < sni; sni' \ ?S; sni \ sni'; sf' = sf\ \ \sf - ?S\ < e" by arith show "norm ((\(x, k)\p. content k *\<^sub>R norm (f x)) - ?S) < e" unfolding real_norm_def proof (rule *) - show "\(\(x,k)\p'. norm (content k *\<^sub>R f x)) - (\(x,k)\p'. norm (integral k f))\ < e / 2" - by (rule XXX) + show "\(\(x,k)\p'. norm (content k *\<^sub>R f x)) - (\(x,k)\p'. norm (integral k f))\ < e/2" + using p'' sum_less_e2 unfolding split_def by (force intro!: absdiff_norm_less) show "(\(x, k)\p'. norm (integral k f)) \?S" by (auto simp: sum_p' division_of_tagged_division[OF p''] D intro!: cSUP_upper) show "(\k\d. norm (integral k f)) \ (\(x, k)\p'. norm (integral k f))" @@ -2147,23 +2135,23 @@ using \e > 0\ by auto from * [OF this] obtain d1 where d1: "gauge d1" "\p. p tagged_division_of (cbox a b) \ d1 fine p \ - norm ((\(x, k)\p. content k *\<^sub>R norm (f x)) - integral (cbox a b) (\x. norm (f x))) < e / 2" + norm ((\(x, k)\p. content k *\<^sub>R norm (f x)) - integral (cbox a b) (\x. norm (f x))) < e/2" by auto from henstock_lemma [OF f(1) \e/2>0\] obtain d2 where d2: "gauge d2" "\p. p tagged_partial_division_of (cbox a b) \ d2 fine p \ - (\(x, k)\p. norm (content k *\<^sub>R f x - integral k f)) < e / 2" . + (\(x, k)\p. norm (content k *\<^sub>R f x - integral k f)) < e/2" . obtain p where p: "p tagged_division_of (cbox a b)" "d1 fine p" "d2 fine p" by (rule fine_division_exists [OF gauge_Int [OF d1(1) d2(1)], of a b]) (auto simp add: fine_Int) - have *: "\sf sf' si di. sf' = sf \ si \ ?S \ \sf - si\ < e / 2 \ - \sf' - di\ < e / 2 \ di < ?S + e" + have *: "\sf sf' si di. sf' = sf \ si \ ?S \ \sf - si\ < e/2 \ + \sf' - di\ < e/2 \ di < ?S + e" by arith show "integral (cbox a b) (\x. if x \ UNIV then norm (f x) else 0) < ?S + e" apply (subst if_P) apply rule proof (rule *[rule_format]) - show "\(\(x,k)\p. norm (content k *\<^sub>R f x)) - (\(x,k)\p. norm (integral k f))\ < e / 2" + show "\(\(x,k)\p. norm (content k *\<^sub>R f x)) - (\(x,k)\p. norm (integral k f))\ < e/2" unfolding split_def apply (rule absdiff_norm_less) using d2(2)[rule_format,of p] @@ -2171,7 +2159,7 @@ unfolding tagged_division_of_def split_def apply auto done - show "\(\(x, k)\p. content k *\<^sub>R norm (f x)) - integral (cbox a b) (\x. norm(f x))\ < e / 2" + show "\(\(x, k)\p. content k *\<^sub>R norm (f x)) - integral (cbox a b) (\x. norm(f x))\ < e/2" using d1(2)[rule_format,OF conjI[OF p(1,2)]] by (simp only: real_norm_def) show "(\(x, k)\p. content k *\<^sub>R norm (f x)) = (\(x, k)\p. norm (content k *\<^sub>R f x))"