# HG changeset patch # User paulson # Date 1501949795 -7200 # Node ID ff60679dc21df4bd05d179e2397563140f7eae93 # Parent d8c7ca0e01c6a88ac266b7cca2a0839133904e0e finally rid of finite_product_dependent diff -r d8c7ca0e01c6 -r ff60679dc21d src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy --- a/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Sat Aug 05 16:18:35 2017 +0200 +++ b/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Sat Aug 05 18:16:35 2017 +0200 @@ -1,30 +1,13 @@ (* Title: HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Author: Johannes Hölzl, TU München Author: Robert Himmelmann, TU München + Huge cleanup by LCP *) theory Equivalence_Lebesgue_Henstock_Integration imports Lebesgue_Measure Henstock_Kurzweil_Integration Complete_Measure Set_Integral begin -lemma finite_product_dependent: (*FIXME DELETE*) - assumes "finite s" - and "\x. x \ s \ finite (t x)" - shows "finite {(i, j) |i j. i \ s \ j \ t i}" - using assms -proof induct - case (insert x s) - have *: "{(i, j) |i j. i \ insert x s \ j \ t i} = - (\y. (x,y)) ` (t x) \ {(i, j) |i j. i \ s \ j \ t i}" by auto - show ?case - unfolding * - apply (rule finite_UnI) - using insert - apply auto - done -qed auto - - lemma le_left_mono: "x \ y \ y \ a \ x \ (a::'a::preorder)" by (auto intro: order_trans) @@ -90,7 +73,7 @@ obtain d where "gauge d" and integral_f: "\p. p tagged_division_of cbox x y \ d fine p \ - norm ((\(x, k)\p. content k *\<^sub>R f x) - I) < e" + norm ((\(x,k) \ p. content k *\<^sub>R f x) - I) < e" using \0 f unfolding has_integral by auto define C where "C X m = X \ {x. ball x (1/Suc m) \ d x}" for X m @@ -194,14 +177,14 @@ then show "\{k. \x. (x, k) \ ?p} = cbox x y" using p(1) by auto qed - ultimately have I: "norm ((\(x, k)\?p. content k *\<^sub>R f x) - I) < e" + ultimately have I: "norm ((\(x,k) \ ?p. content k *\<^sub>R f x) - I) < e" using integral_f by auto - have "(\(x, k)\?p. content k *\<^sub>R f x) = - (\(x, k)\?T ` (p \ s). content k *\<^sub>R f x) + (\(x, k)\p - s. content k *\<^sub>R f x)" + have "(\(x,k) \ ?p. content k *\<^sub>R f x) = + (\(x,k) \ ?T ` (p \ s). content k *\<^sub>R f x) + (\(x,k) \ p - s. content k *\<^sub>R f x)" using p(1)[THEN tagged_division_ofD(1)] by (safe intro!: sum.union_inter_neutral) (auto simp: s_def T_def) - also have "(\(x, k)\?T ` (p \ s). content k *\<^sub>R f x) = (\(x, k)\p \ s. content k *\<^sub>R f (T X k))" + also have "(\(x,k) \ ?T ` (p \ s). content k *\<^sub>R f x) = (\(x,k) \ p \ s. content k *\<^sub>R f (T X k))" proof (subst sum.reindex_nontrivial, safe) fix x1 x2 k assume 1: "(x1, k) \ p" "(x1, k) \ s" and 2: "(x2, k) \ p" "(x2, k) \ s" and eq: "content k *\<^sub>R f (T X k) \ 0" @@ -209,8 +192,8 @@ show "x1 = x2" by (auto simp: content_eq_0_interior) qed (use p in \auto intro!: sum.cong\) - finally have eq: "(\(x, k)\?p. content k *\<^sub>R f x) = - (\(x, k)\p \ s. content k *\<^sub>R f (T X k)) + (\(x, k)\p - s. content k *\<^sub>R f x)" . + finally have eq: "(\(x,k) \ ?p. content k *\<^sub>R f x) = + (\(x,k) \ p \ s. content k *\<^sub>R f (T X k)) + (\(x,k) \ p - s. content k *\<^sub>R f x)" . have in_T: "(x, k) \ s \ T X k \ X" for x k using in_s[of x k] by (auto simp: C_def) @@ -224,7 +207,7 @@ have [simp]: "finite p" using tagged_division_ofD(1)[OF p(1)] . - have "(M - 3*e) * (b - a) \ (\(x, k)\p \ s. content k) * (b - a)" + have "(M - 3*e) * (b - a) \ (\(x,k) \ p \ s. content k) * (b - a)" proof (intro mult_right_mono) have fin: "?\ (E \ \{k\snd`p. k \ C X m = {}}) < \" for X using \?\ E < \\ by (rule le_less_trans[rotated]) (auto intro!: emeasure_mono \E \ sets ?L\) @@ -287,15 +270,15 @@ finally show "M - 3 * e \ (\(x, y)\p \ s. content y)" using \0 < e\ by (simp add: split_beta) qed (use \a < b\ in auto) - also have "\ = (\(x, k)\p \ s. content k * (b - a))" + also have "\ = (\(x,k) \ p \ s. content k * (b - a))" by (simp add: sum_distrib_right split_beta') - also have "\ \ (\(x, k)\p \ s. content k * (f (T ?F k) - f (T ?E k)))" + also have "\ \ (\(x,k) \ p \ s. content k * (f (T ?F k) - f (T ?E k)))" using parts(3) by (auto intro!: sum_mono mult_left_mono diff_mono) - also have "\ = (\(x, k)\p \ s. content k * f (T ?F k)) - (\(x, k)\p \ s. content k * f (T ?E k))" + also have "\ = (\(x,k) \ p \ s. content k * f (T ?F k)) - (\(x,k) \ p \ s. content k * f (T ?E k))" by (auto intro!: sum.cong simp: field_simps sum_subtractf[symmetric]) - also have "\ = (\(x, k)\?B. content k *\<^sub>R f x) - (\(x, k)\?A. content k *\<^sub>R f x)" + also have "\ = (\(x,k) \ ?B. content k *\<^sub>R f x) - (\(x,k) \ ?A. content k *\<^sub>R f x)" by (subst (1 2) parts) auto - also have "\ \ norm ((\(x, k)\?B. content k *\<^sub>R f x) - (\(x, k)\?A. content k *\<^sub>R f x))" + also have "\ \ norm ((\(x,k) \ ?B. content k *\<^sub>R f x) - (\(x,k) \ ?A. content k *\<^sub>R f x))" by auto also have "\ \ e + e" using parts(1)[of ?E] parts(1)[of ?F] by (intro norm_diff_triangle_le[of _ I]) auto @@ -1633,7 +1616,7 @@ have *: "\d. gauge d \ (\p. p tagged_division_of cbox a b \ d fine p \ - norm ((\(x, k)\p. content k *\<^sub>R norm (f x)) - ?S) < e)" + 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 @@ -1664,7 +1647,7 @@ 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 @@ -1689,6 +1672,7 @@ show "finite ((\(k, x, l). (x, k \ l)) ` (d \ p))" by (simp add: d'(1) p'(1)) qed + next fix x k assume "(x, k) \ p'" then have "\i l. x \ i \ i \ d \ (x, l) \ p \ k = i \ l" @@ -1752,7 +1736,7 @@ 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 have p'alt: "p' = {(x,(i \ l)) | x i l. (x,l) \ p \ i \ d \ i \ l \ {}}" @@ -1780,26 +1764,27 @@ then show "\y i l. (x, k) = (y, i \ l) \ (y, l) \ p \ i \ d \ i \ l \ {}" using p'(2) by fastforce qed - have sum_p': "(\(x, k)\p'. norm (integral k f)) = (\k\snd ` p'. norm (integral k f))" + 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)"]) apply (auto intro: integral_null simp: content_eq_0_interior) done note snd_p = division_ofD[OF division_of_tagged_division[OF p(1)]] + have fin_d_sndp: "finite (d \ snd ` p)" + by (simp add: d'(1) snd_p(1)) 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" + 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" using p'' sum_less_e2 unfolding split_def by (force intro!: absdiff_norm_less) - show "(\(x, k)\p'. norm (integral k f)) \?S" + 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))" + show "(\k\d. norm (integral k f)) \ (\(x,k) \ p'. norm (integral k f))" proof - - have *: "{k \ l | k l. k \ d \ l \ snd ` p} = - (\(k,l). k \ l) ` {(k,l)|k l. k \ d \ l \ snd ` p}" + have *: "{k \ l | k l. k \ d \ l \ snd ` p} = (\(k,l). k \ l) ` (d \ snd ` p)" by auto have "(\k\d. norm (integral k f)) \ (\i\d. \l\snd ` p. norm (integral (i \ l) f))" proof (rule sum_mono, goal_cases) @@ -1858,10 +1843,10 @@ qed finally show ?case . qed - also have "\ = (\(i,l) \ d \ (snd ` p). norm (integral (i\l) f))" + also have "\ = (\(i,l) \ d \ snd ` p. norm (integral (i\l) f))" by (simp add: sum.cartesian_product) - also have "\ = (\x\{(i, l) |i l. i \ d \ l \ snd ` p}. norm (integral (case_prod op \ x) f))" - by (force simp: split_def Sigma_def intro!: sum.cong) + also have "\ = (\x \ d \ snd ` p. norm (integral (case_prod op \ x) f))" + by (force simp: split_def intro!: sum.cong) also have "\ = (\k\{i \ l |i l. i \ d \ l \ snd ` p}. norm (integral k f))" proof - have eq0: " (integral (l1 \ k1) f) = 0" @@ -1884,16 +1869,14 @@ qed show ?thesis unfolding * - apply (rule sum.reindex_nontrivial [symmetric, unfolded o_def]) - apply (rule finite_product_dependent [OF \finite d\]) - apply (rule finite_imageI [OF \finite p\]) + apply (rule sum.reindex_nontrivial [OF fin_d_sndp, symmetric, unfolded o_def]) apply clarsimp by (metis eq0 fst_conv snd_conv) qed - also have "\ = (\(x, k)\p'. norm (integral k f))" + also have "\ = (\(x,k) \ p'. norm (integral k f))" proof - have 0: "integral (ia \ snd (a, b)) f = 0" - if "ia \ snd (a, b) \ snd ` p'" "ia \ d" "(a, b) \ p" for ia a b + if "ia \ snd (a, b) \ snd ` p'" "ia \ d" "(a, b) \ p" for ia a b proof - have "ia \ b = {}" using that @@ -1914,33 +1897,28 @@ show ?thesis unfolding sum_p' apply (rule sum.mono_neutral_right) - apply (subst *) - apply (rule finite_imageI[OF finite_product_dependent]) - apply fact - apply (rule finite_imageI[OF p'(1)]) + apply (metis * finite_imageI[OF fin_d_sndp]) using 0 1 by auto qed finally show ?thesis . qed - show "(\(x, k)\p'. norm (content k *\<^sub>R f x)) = (\(x, k)\p. content k *\<^sub>R norm (f x))" + show "(\(x,k) \ p'. norm (content k *\<^sub>R f x)) = (\(x,k) \ p. content k *\<^sub>R norm (f x))" proof - let ?S = "{(x, i \ l) |x i l. (x, l) \ p \ i \ d}" have *: "?S = (\(xl,i). (fst xl, snd xl \ i)) ` (p \ d)" by force - have pdfin: "finite (p \ d)" + have fin_pd: "finite (p \ d)" using finite_cartesian_product[OF p'(1) d'(1)] by metis - have "(\(x, k)\p'. norm (content k *\<^sub>R f x)) = (\(x, k)\?S. \content k\ * norm (f x))" + have "(\(x,k) \ p'. norm (content k *\<^sub>R f x)) = (\(x,k) \ ?S. \content k\ * norm (f x))" unfolding norm_scaleR apply (rule sum.mono_neutral_left) apply (subst *) - apply (rule finite_imageI) - apply fact - unfolding p'alt apply blast + apply (rule finite_imageI [OF fin_pd]) + unfolding p'alt apply auto by fastforce also have "\ = (\((x,l),i)\p \ d. \content (l \ i)\ * norm (f x))" unfolding * - apply (subst sum.reindex_nontrivial) - apply fact + apply (subst sum.reindex_nontrivial [OF fin_pd]) unfolding split_paired_all unfolding o_def split_def snd_conv fst_conv mem_Sigma_iff prod.inject apply (elim conjE) @@ -1952,16 +1930,8 @@ from as have "l1 \ l2 \ k1 \ k2" by auto then have "interior k1 \ interior k2 = {} \ interior l1 \ interior l2 = {}" - apply - - apply (erule disjE) - apply (rule disjI2) - defer - apply (rule disjI1) - apply (rule d'(5)[OF as(3-4)]) - apply assumption - apply (rule p'(5)[OF as(1-2)]) - apply auto - done + apply (rule disjE) + using as(1) as(2) p'(5) as(3) as(4) d'(5) by auto moreover have "interior (l1 \ k1) = interior (l2 \ k2)" unfolding as .. ultimately have "interior (l1 \ k1) = {}" @@ -1971,55 +1941,53 @@ unfolding content_eq_0_interior[symmetric] by auto qed safe - also have "\ = (\(x, k)\p. content k *\<^sub>R norm (f x))" - apply (subst sum_Sigma_product[symmetric]) - apply (rule p') - apply (rule d') - apply (rule sum.cong) - apply (rule refl) - unfolding split_paired_all split_conv + also have "\ = (\(x,k) \ p. content k *\<^sub>R norm (f x))" proof - - fix x l - assume as: "(x, l) \ p" - 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))" - by (simp add: Int_commute uv) - also have "\ = sum content {k \ cbox u v| k. k \ d}" + have sumeq: "(\i\d. content (l \ i) * norm (f x)) = content l * norm (f x)" + if "(x, l) \ p" for x l proof - - have eq0: "content (k \ cbox u v) = 0" - if "k \ d" "y \ d" "k \ y" and eq: "k \ cbox u v = y \ cbox u v" for k y + note xl = p'(2-4)[OF that] + 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))" + by (simp add: Int_commute uv) + also have "\ = sum content {k \ cbox u v| k. k \ d}" proof - - from d'(4)[OF that(1)] d'(4)[OF that(2)] - obtain \ \ where \: "k \ cbox u v = cbox \ \" - by (meson Int_interval) - have "{} = interior ((k \ y) \ cbox u v)" - by (simp add: d'(5) that) - also have "\ = interior (y \ (k \ cbox u v))" - by auto - also have "\ = interior (k \ cbox u v)" - unfolding eq by auto - finally show ?thesis - unfolding \ content_eq_0_interior .. + have eq0: "content (k \ cbox u v) = 0" + if "k \ d" "y \ d" "k \ y" and eq: "k \ cbox u v = y \ cbox u v" for k y + proof - + from d'(4)[OF that(1)] d'(4)[OF that(2)] + obtain \ \ where \: "k \ cbox u v = cbox \ \" + by (meson Int_interval) + have "{} = interior ((k \ y) \ cbox u v)" + by (simp add: d'(5) that) + also have "\ = interior (y \ (k \ cbox u v))" + by auto + also have "\ = interior (k \ cbox u v)" + unfolding eq by auto + finally show ?thesis + unfolding \ content_eq_0_interior .. + qed + then show ?thesis + unfolding Setcompr_eq_image + apply (rule sum.reindex_nontrivial [OF \finite d\, unfolded o_def, symmetric]) + by auto + qed + also have "\ = sum content {cbox u v \ k |k. k \ d \ cbox u v \ k \ {}}" + apply (rule sum.mono_neutral_right) + unfolding Setcompr_eq_image + apply (rule finite_imageI [OF \finite d\]) + apply (fastforce simp: inf.commute)+ + done + finally show "(\i\d. content (l \ i) * norm (f x)) = content l * norm (f x)" + unfolding sum_distrib_right[symmetric] real_scaleR_def + apply (subst(asm) additive_content_division[OF division_inter_1[OF d(1)]]) + using xl(2)[unfolded uv] unfolding uv apply auto + done qed - then show ?thesis - unfolding Setcompr_eq_image - apply (rule sum.reindex_nontrivial [OF \finite d\, unfolded o_def, symmetric]) - by auto + show ?thesis + by (subst sum_Sigma_product[symmetric]) (auto intro!: sumeq sum.cong p' d') qed - also have "\ = sum content {cbox u v \ k |k. k \ d \ cbox u v \ k \ {}}" - apply (rule sum.mono_neutral_right) - unfolding Setcompr_eq_image - apply (rule finite_imageI [OF \finite d\]) - apply (fastforce simp: inf.commute)+ - done - finally show "(\i\d. \content (l \ i)\ * norm (f x)) = content l *\<^sub>R norm (f x)" - unfolding sum_distrib_right[symmetric] real_scaleR_def - apply (subst(asm) additive_content_division[OF division_inter_1[OF d(1)]]) - using xl(2)[unfolded uv] unfolding uv apply auto - done - qed - finally show ?thesis . + finally show ?thesis . qed qed (rule d) qed @@ -2135,11 +2103,11 @@ 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]) @@ -2159,10 +2127,10 @@ 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))" + show "(\(x,k) \ p. content k *\<^sub>R norm (f x)) = (\(x,k) \ p. norm (content k *\<^sub>R f x))" apply (rule sum.cong) apply (rule refl) unfolding split_paired_all split_conv @@ -2171,7 +2139,7 @@ apply (subst abs_of_nonneg) apply auto done - show "(\(x, k)\p. norm (integral k f)) \ ?S" + show "(\(x,k) \ p. norm (integral k f)) \ ?S" using partial_division_of_tagged_division[of p "cbox a b"] p(1) apply (subst sum.over_tagged_division_lemma[OF p(1)]) apply (simp add: content_eq_0_interior)