src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy
changeset 66341 1072edd475dc
parent 66339 1c5e521a98f1
child 66342 d8c7ca0e01c6
equal deleted inserted replaced
66340:91257fbcabee 66341:1072edd475dc
  1603     using integrable_on_subdivision[OF d] assms unfolding absolutely_integrable_on_def
  1603     using integrable_on_subdivision[OF d] assms unfolding absolutely_integrable_on_def
  1604     by (intro integral_subset_le) auto
  1604     by (intro integral_subset_le) auto
  1605   finally show "(\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))" .
  1605   finally show "(\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))" .
  1606 qed
  1606 qed
  1607 
  1607 
  1608 lemma helplemma:
  1608 lemma absdiff_norm_less:
  1609   assumes "sum (\<lambda>x. norm (f x - g x)) s < e"
  1609   assumes "sum (\<lambda>x. norm (f x - g x)) s < e"
  1610     and "finite s"
  1610     and "finite s"
  1611   shows "\<bar>sum (\<lambda>x. norm(f x)) s - sum (\<lambda>x. norm(g x)) s\<bar> < e"
  1611   shows "\<bar>sum (\<lambda>x. norm(f x)) s - sum (\<lambda>x. norm(g x)) s\<bar> < e"
  1612   unfolding sum_subtractf[symmetric]
  1612   unfolding sum_subtractf[symmetric]
  1613   apply (rule le_less_trans[OF sum_abs])
  1613   apply (rule le_less_trans[OF sum_abs])
  1628     by (rule elementary_interval[of a b]) auto
  1628     by (rule elementary_interval[of a b]) auto
  1629   have D_2: "bdd_above (?f`?D)"
  1629   have D_2: "bdd_above (?f`?D)"
  1630     by (metis * mem_Collect_eq bdd_aboveI2)
  1630     by (metis * mem_Collect_eq bdd_aboveI2)
  1631   note D = D_1 D_2
  1631   note D = D_1 D_2
  1632   let ?S = "SUP x:?D. ?f x"
  1632   let ?S = "SUP x:?D. ?f x"
  1633   show ?thesis
  1633   have *: "\<exists>d. gauge d \<and>
  1634     apply (rule absolutely_integrable_onI [OF f has_integral_integrable])
  1634              (\<forall>p. p tagged_division_of cbox a b \<and>
  1635     apply (subst has_integral[of _ ?S])
  1635                   d fine p \<longrightarrow>
  1636     apply safe
  1636                   norm ((\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x)) - ?S) < e)"
  1637   proof goal_cases
  1637     if e: "e > 0" for e
  1638     case e: (1 e)
  1638   proof -
  1639     then have "?S - e / 2 < ?S" by simp
  1639     have "?S - e / 2 < ?S" using \<open>e > 0\<close> by simp
  1640     then obtain d where d: "d division_of (cbox a b)" "?S - e / 2 < (\<Sum>k\<in>d. norm (integral k f))"
  1640     then obtain d where d: "d division_of (cbox a b)" "?S - e / 2 < (\<Sum>k\<in>d. norm (integral k f))"
  1641       unfolding less_cSUP_iff[OF D] by auto
  1641       unfolding less_cSUP_iff[OF D] by auto
  1642     note d' = division_ofD[OF this(1)]
  1642     note d' = division_ofD[OF this(1)]
  1643 
  1643 
  1644     have "\<forall>x. \<exists>e>0. \<forall>i\<in>d. x \<notin> i \<longrightarrow> ball x e \<inter> i = {}"
  1644     have "\<forall>x. \<exists>e>0. \<forall>i\<in>d. x \<notin> i \<longrightarrow> ball x e \<inter> i = {}"
  1645     proof
  1645     proof
  1646       fix x
  1646       fix x
  1647       have "\<exists>da>0. \<forall>xa\<in>\<Union>{i \<in> d. x \<notin> i}. da \<le> dist x xa"
  1647       have "\<exists>da>0. \<forall>xa\<in>\<Union>{i \<in> d. x \<notin> i}. da \<le> dist x xa"
  1648         apply (rule separate_point_closed)
  1648       proof (rule separate_point_closed)
  1649          apply (rule closed_Union)
  1649         show "closed (\<Union>{i \<in> d. x \<notin> i})"
  1650           apply (rule finite_subset[OF _ d'(1)])
  1650           apply (rule closed_Union)
  1651         using d'(4)
  1651            apply (simp add: d'(1))
  1652           apply auto
  1652           using d'(4) apply auto
  1653         done
  1653           done
       
  1654         show "x \<notin> \<Union>{i \<in> d. x \<notin> i}"
       
  1655           by auto
       
  1656       qed 
  1654       then show "\<exists>e>0. \<forall>i\<in>d. x \<notin> i \<longrightarrow> ball x e \<inter> i = {}"
  1657       then show "\<exists>e>0. \<forall>i\<in>d. x \<notin> i \<longrightarrow> ball x e \<inter> i = {}"
  1655         by force
  1658         by force
  1656     qed
  1659     qed
  1657     then obtain k where k: "\<And>x. 0 < k x"
  1660     then obtain k where k: "\<And>x. 0 < k x" "\<And>i x. \<lbrakk>i \<in> d; x \<notin> i\<rbrakk> \<Longrightarrow> ball x (k x) \<inter> i = {}"
  1658       "\<And>i x. \<lbrakk>i \<in> d; x \<notin> i\<rbrakk> \<Longrightarrow> ball x (k x) \<inter> i = {}"
       
  1659       by metis
  1661       by metis
  1660     have "e/2 > 0"
  1662     have "e/2 > 0"
  1661       using e by auto
  1663       using e by auto
  1662     from henstock_lemma[OF assms(1) this] 
  1664     from henstock_lemma[OF assms(1) this] 
  1663     obtain g where g: "gauge g"
  1665     obtain g where g: "gauge g"
  1664       "\<And>p. \<lbrakk>p tagged_partial_division_of cbox a b; g fine p\<rbrakk> 
  1666       "\<And>p. \<lbrakk>p tagged_partial_division_of cbox a b; g fine p\<rbrakk> 
  1665                 \<Longrightarrow> (\<Sum>(x, k)\<in>p. norm (content k *\<^sub>R f x - integral k f)) < e / 2"
  1667                 \<Longrightarrow> (\<Sum>(x, k)\<in>p. norm (content k *\<^sub>R f x - integral k f)) < e / 2"
  1666       by (metis (no_types, lifting))      
  1668       by (metis (no_types, lifting))      
  1667     let ?g = "\<lambda>x. g x \<inter> ball x (k x)"
  1669     let ?g = "\<lambda>x. g x \<inter> ball x (k x)"
  1668     show ?case
  1670     show ?thesis 
  1669       apply (rule_tac x="?g" in exI)
  1671       apply (rule_tac x="?g" in exI)
  1670       apply safe
  1672       apply safe
  1671     proof -
  1673     proof -
  1672       show "gauge ?g"
  1674       show "gauge ?g"
  1673         using g(1) k(1)
  1675         using g(1) k(1)
  1681       have gp': "g fine p'"
  1683       have gp': "g fine p'"
  1682         using p(2)
  1684         using p(2)
  1683         unfolding p'_def fine_def
  1685         unfolding p'_def fine_def
  1684         by auto
  1686         by auto
  1685       have p'': "p' tagged_division_of (cbox a b)"
  1687       have p'': "p' tagged_division_of (cbox a b)"
  1686         apply (rule tagged_division_ofI)
  1688       proof (rule tagged_division_ofI)
  1687       proof -
       
  1688         show "finite p'"
  1689         show "finite p'"
  1689           apply (rule finite_subset[of _ "(\<lambda>(k,(x,l)). (x,k \<inter> l)) `
  1690           apply (rule finite_subset[of _ "(\<lambda>(k,(x,l)). (x,k \<inter> l)) `
  1690             {(k,xl) | k xl. k \<in> d \<and> xl \<in> p}"])
  1691             {(k,xl) | k xl. k \<in> d \<and> xl \<in> p}"])
  1691           unfolding p'_def
  1692           unfolding p'_def
  1692            defer
  1693            defer
  1703         then obtain i l where il: "x \<in> i" "i \<in> d" "(x, l) \<in> p" "k = i \<inter> l" by blast
  1704         then obtain i l where il: "x \<in> i" "i \<in> d" "(x, l) \<in> p" "k = i \<inter> l" by blast
  1704         show "x \<in> k" and "k \<subseteq> cbox a b"
  1705         show "x \<in> k" and "k \<subseteq> cbox a b"
  1705           using p'(2-3)[OF il(3)] il by auto
  1706           using p'(2-3)[OF il(3)] il by auto
  1706         show "\<exists>a b. k = cbox a b"
  1707         show "\<exists>a b. k = cbox a b"
  1707           unfolding il using p'(4)[OF il(3)] d'(4)[OF il(2)]
  1708           unfolding il using p'(4)[OF il(3)] d'(4)[OF il(2)]
  1708           apply safe
  1709           by (meson Int_interval)
  1709           unfolding Int_interval
       
  1710           apply auto
       
  1711           done
       
  1712       next
  1710       next
  1713         fix x1 k1
  1711         fix x1 k1
  1714         assume "(x1, k1) \<in> p'"
  1712         assume "(x1, k1) \<in> p'"
  1715         then have "\<exists>i l. x1 \<in> i \<and> i \<in> d \<and> (x1, l) \<in> p \<and> k1 = i \<inter> l"
  1713         then have "\<exists>i l. x1 \<in> i \<and> i \<in> d \<and> (x1, l) \<in> p \<and> k1 = i \<inter> l"
  1716           unfolding p'_def by auto
  1714           unfolding p'_def by auto
  1720         then have "\<exists>i l. x2 \<in> i \<and> i \<in> d \<and> (x2, l) \<in> p \<and> k2 = i \<inter> l"
  1718         then have "\<exists>i l. x2 \<in> i \<and> i \<in> d \<and> (x2, l) \<in> p \<and> k2 = i \<inter> l"
  1721           unfolding p'_def by auto
  1719           unfolding p'_def by auto
  1722         then obtain i2 l2 where il2: "x2 \<in> i2" "i2 \<in> d" "(x2, l2) \<in> p" "k2 = i2 \<inter> l2" by blast
  1720         then obtain i2 l2 where il2: "x2 \<in> i2" "i2 \<in> d" "(x2, l2) \<in> p" "k2 = i2 \<inter> l2" by blast
  1723         assume "(x1, k1) \<noteq> (x2, k2)"
  1721         assume "(x1, k1) \<noteq> (x2, k2)"
  1724         then have "interior i1 \<inter> interior i2 = {} \<or> interior l1 \<inter> interior l2 = {}"
  1722         then have "interior i1 \<inter> interior i2 = {} \<or> interior l1 \<inter> interior l2 = {}"
  1725           using d'(5)[OF il1(2) il2(2)] p'(5)[OF il1(3) il2(3)]
  1723           using d'(5)[OF il1(2) il2(2)] p'(5)[OF il1(3) il2(3)]  by (auto simp: il1 il2)
  1726           unfolding il1 il2
       
  1727           by auto
       
  1728         then show "interior k1 \<inter> interior k2 = {}"
  1724         then show "interior k1 \<inter> interior k2 = {}"
  1729           unfolding il1 il2 by auto
  1725           unfolding il1 il2 by auto
  1730       next
  1726       next
  1731         have *: "\<forall>(x, X) \<in> p'. X \<subseteq> cbox a b"
  1727         have *: "\<forall>(x, X) \<in> p'. X \<subseteq> cbox a b"
  1732           unfolding p'_def using d' by auto
  1728           unfolding p'_def using d' by auto
  1733         show "\<Union>{k. \<exists>x. (x, k) \<in> p'} = cbox a b"
  1729         have "y \<in> \<Union>{k. \<exists>x. (x, k) \<in> p'}" if y: "y \<in> cbox a b" for y
  1734           apply rule
       
  1735            apply (rule Union_least)
       
  1736           unfolding mem_Collect_eq
       
  1737            apply (erule exE)
       
  1738            apply (drule *[rule_format])
       
  1739            apply safe
       
  1740         proof -
  1730         proof -
  1741           fix y
  1731           obtain x l where xl: "(x, l) \<in> p" "y \<in> l" 
  1742           assume y: "y \<in> cbox a b"
  1732             using y unfolding p'(6)[symmetric] by auto
  1743           then have "\<exists>x l. (x, l) \<in> p \<and> y\<in>l"
  1733           obtain i where i: "i \<in> d" "y \<in> i" 
  1744             unfolding p'(6)[symmetric] by auto
       
  1745           then obtain x l where xl: "(x, l) \<in> p" "y \<in> l" by metis
       
  1746           then have "\<exists>k. k \<in> d \<and> y \<in> k"
       
  1747             using y unfolding d'(6)[symmetric] by auto
  1734             using y unfolding d'(6)[symmetric] by auto
  1748           then obtain i where i: "i \<in> d" "y \<in> i" by metis
       
  1749           have "x \<in> i"
  1735           have "x \<in> i"
  1750             using fineD[OF p(3) xl(1)] using k(2) i xl by auto
  1736             using fineD[OF p(3) xl(1)] using k(2) i xl by auto
  1751           then show "y \<in> \<Union>{k. \<exists>x. (x, k) \<in> p'}"
  1737           then show ?thesis
  1752             unfolding p'_def Union_iff
  1738             apply (rule_tac X="i \<inter> l" in UnionI)
  1753             apply (rule_tac x="i \<inter> l" in bexI)
  1739             using i xl by (auto simp: p'_def)
  1754             using i xl
  1740         qed
  1755              apply auto
  1741         show "\<Union>{k. \<exists>x. (x, k) \<in> p'} = cbox a b"
  1756             done
  1742         proof
       
  1743           show "\<Union>{k. \<exists>x. (x, k) \<in> p'} \<subseteq> cbox a b"
       
  1744             using * by auto
       
  1745         next
       
  1746           show "cbox a b \<subseteq> \<Union>{k. \<exists>x. (x, k) \<in> p'}"
       
  1747           proof 
       
  1748             fix y
       
  1749             assume y: "y \<in> cbox a b"
       
  1750             obtain x l where xl: "(x, l) \<in> p" "y \<in> l" 
       
  1751               using y unfolding p'(6)[symmetric] by auto
       
  1752             obtain i where i: "i \<in> d" "y \<in> i" 
       
  1753               using y unfolding d'(6)[symmetric] by auto
       
  1754             have "x \<in> i"
       
  1755               using fineD[OF p(3) xl(1)] using k(2) i xl by auto
       
  1756             then show "y \<in> \<Union>{k. \<exists>x. (x, k) \<in> p'}"
       
  1757               apply (rule_tac X="i \<inter> l" in UnionI)
       
  1758               using i xl by (auto simp: p'_def)
       
  1759           qed
  1757         qed
  1760         qed
  1758       qed
  1761       qed
  1759 
  1762 
  1760       then have "(\<Sum>(x, k)\<in>p'. norm (content k *\<^sub>R f x - integral k f)) < e / 2"
  1763       then have sum_less_e2: "(\<Sum>(x, k)\<in>p'. norm (content k *\<^sub>R f x - integral k f)) < e / 2"
  1761         using g(2) gp' tagged_division_of_def by blast
  1764         using g(2) gp' tagged_division_of_def by blast
  1762       then have **: "\<bar>(\<Sum>(x,k)\<in>p'. norm (content k *\<^sub>R f x)) - (\<Sum>(x,k)\<in>p'. norm (integral k f))\<bar> < e / 2"
  1765       then have XXX: "\<bar>(\<Sum>(x,k)\<in>p'. norm (content k *\<^sub>R f x)) - (\<Sum>(x,k)\<in>p'. norm (integral k f))\<bar> < e / 2"
  1763         unfolding split_def
  1766         unfolding split_def
  1764         using p''
  1767         using p'' by (force intro!: absdiff_norm_less)
  1765         by (force intro!: helplemma)
       
  1766 
  1768 
  1767       have p'alt: "p' = {(x,(i \<inter> l)) | x i l. (x,l) \<in> p \<and> i \<in> d \<and> i \<inter> l \<noteq> {}}"
  1769       have p'alt: "p' = {(x,(i \<inter> l)) | x i l. (x,l) \<in> p \<and> i \<in> d \<and> i \<inter> l \<noteq> {}}"
  1768       proof (safe, goal_cases)
  1770       proof (safe, goal_cases)
  1769         case prems: (2 _ _ x i l)
  1771         case prems: (2 _ _ x i l)
  1770         have "x \<in> i"
  1772         have "x \<in> i"
  1774           unfolding p'_def
  1776           unfolding p'_def
  1775           using prems
  1777           using prems
  1776           apply safe
  1778           apply safe
  1777           apply (rule_tac x=x in exI)
  1779           apply (rule_tac x=x in exI)
  1778           apply (rule_tac x="i \<inter> l" in exI)
  1780           apply (rule_tac x="i \<inter> l" in exI)
  1779           apply safe
       
  1780           using prems
       
  1781           apply auto
  1781           apply auto
  1782           done
  1782           done
  1783         then show ?case
  1783         then show ?case
  1784           using prems(3) by auto
  1784           using prems(3) by auto
  1785       next
  1785       next
  1795         apply (subst sum.over_tagged_division_lemma[OF p'',of "\<lambda>k. norm (integral k f)"])
  1795         apply (subst sum.over_tagged_division_lemma[OF p'',of "\<lambda>k. norm (integral k f)"])
  1796          apply (auto intro: integral_null simp: content_eq_0_interior)
  1796          apply (auto intro: integral_null simp: content_eq_0_interior)
  1797         done
  1797         done
  1798       note snd_p = division_ofD[OF division_of_tagged_division[OF p(1)]]
  1798       note snd_p = division_ofD[OF division_of_tagged_division[OF p(1)]]
  1799 
  1799 
  1800       have *: "\<And>sni sni' sf sf'. \<bar>sf' - sni'\<bar> < e / 2 \<longrightarrow> ?S - e / 2 < sni \<and> sni' \<le> ?S \<and>
  1800 
  1801         sni \<le> sni' \<and> sf' = sf \<longrightarrow> \<bar>sf - ?S\<bar> < e"
  1801       have *: "\<And>sni sni' sf sf'. \<lbrakk>\<bar>sf' - sni'\<bar> < e / 2; ?S - e / 2 < sni; sni' \<le> ?S;
       
  1802         sni \<le> sni'; sf' = sf\<rbrakk> \<Longrightarrow> \<bar>sf - ?S\<bar> < e"
  1802         by arith
  1803         by arith
  1803       show "norm ((\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x)) - ?S) < e"
  1804       show "norm ((\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x)) - ?S) < e"
  1804         unfolding real_norm_def
  1805         unfolding real_norm_def
  1805         apply (rule *[rule_format,OF **])
  1806       proof (rule *)
  1806         apply safe
  1807         show "\<bar>(\<Sum>(x,k)\<in>p'. norm (content k *\<^sub>R f x)) - (\<Sum>(x,k)\<in>p'. norm (integral k f))\<bar> < e / 2"
  1807            apply(rule d(2))
  1808           by (rule XXX)
  1808       proof goal_cases
  1809         show "(\<Sum>(x, k)\<in>p'. norm (integral k f)) \<le>?S"
  1809         case 1
       
  1810         show ?case
       
  1811           by (auto simp: sum_p' division_of_tagged_division[OF p''] D intro!: cSUP_upper)
  1810           by (auto simp: sum_p' division_of_tagged_division[OF p''] D intro!: cSUP_upper)
  1812       next
  1811         show "(\<Sum>k\<in>d. norm (integral k f)) \<le> (\<Sum>(x, k)\<in>p'. norm (integral k f))"
  1813         case 2
  1812         proof -
  1814         have *: "{k \<inter> l | k l. k \<in> d \<and> l \<in> snd ` p} =
  1813           have *: "{k \<inter> l | k l. k \<in> d \<and> l \<in> snd ` p} =
  1815           (\<lambda>(k,l). k \<inter> l) ` {(k,l)|k l. k \<in> d \<and> l \<in> snd ` p}"
  1814           (\<lambda>(k,l). k \<inter> l) ` {(k,l)|k l. k \<in> d \<and> l \<in> snd ` p}"
  1816           by auto
  1815             by auto
  1817         have "(\<Sum>k\<in>d. norm (integral k f)) \<le> (\<Sum>i\<in>d. \<Sum>l\<in>snd ` p. norm (integral (i \<inter> l) f))"
  1816           have "(\<Sum>k\<in>d. norm (integral k f)) \<le> (\<Sum>i\<in>d. \<Sum>l\<in>snd ` p. norm (integral (i \<inter> l) f))"
  1818         proof (rule sum_mono, goal_cases)
  1817           proof (rule sum_mono, goal_cases)
  1819           case k: (1 k)
  1818             case k: (1 k)
  1820           from d'(4)[OF this] obtain u v where uv: "k = cbox u v" by metis
  1819             from d'(4)[OF this] obtain u v where uv: "k = cbox u v" by metis
  1821           define d' where "d' = {cbox u v \<inter> l |l. l \<in> snd ` p \<and>  cbox u v \<inter> l \<noteq> {}}"
  1820             define d' where "d' = {cbox u v \<inter> l |l. l \<in> snd ` p \<and>  cbox u v \<inter> l \<noteq> {}}"
  1822           note uvab = d'(2)[OF k[unfolded uv]]
  1821             note uvab = d'(2)[OF k[unfolded uv]]
  1823           have "d' division_of cbox u v"
  1822             have "d' division_of cbox u v"
  1824             apply (subst d'_def)
  1823               apply (subst d'_def)
  1825             apply (rule division_inter_1)
  1824               apply (rule division_inter_1)
  1826              apply (rule division_of_tagged_division[OF p(1)])
  1825                apply (rule division_of_tagged_division[OF p(1)])
  1827             apply (rule uvab)
  1826               apply (rule uvab)
  1828             done
  1827               done
  1829           then have "norm (integral k f) \<le> sum (\<lambda>k. norm (integral k f)) d'"
  1828             then have "norm (integral k f) \<le> sum (\<lambda>k. norm (integral k f)) d'"
  1830             unfolding uv
  1829               unfolding uv
  1831             apply (subst integral_combine_division_topdown[of _ _ d'])
  1830               apply (subst integral_combine_division_topdown[of _ _ d'])
  1832               apply (rule integrable_on_subcbox[OF assms(1) uvab])
  1831                 apply (rule integrable_on_subcbox[OF assms(1) uvab])
  1833              apply assumption
  1832                apply assumption
  1834             apply (rule sum_norm_le)
  1833               apply (rule sum_norm_le)
  1835             apply auto
  1834               apply auto
  1836             done
  1835               done
  1837           also have "\<dots> = (\<Sum>k\<in>{k \<inter> l |l. l \<in> snd ` p}. norm (integral k f))"
  1836             also have "\<dots> = (\<Sum>k\<in>{k \<inter> l |l. l \<in> snd ` p}. norm (integral k f))"
       
  1837             proof -
       
  1838               have *: "norm (integral i f) = 0"
       
  1839                 if "i \<in> {cbox u v \<inter> l |l. l \<in> snd ` p}"
       
  1840                   "i \<notin> {cbox u v \<inter> l |l. l \<in> snd ` p \<and> cbox u v \<inter> l \<noteq> {}}" for i
       
  1841                 using that by auto
       
  1842               show ?thesis
       
  1843                 apply (rule sum.mono_neutral_left)
       
  1844                   apply (simp add: snd_p(1))
       
  1845                 unfolding d'_def uv using * by auto 
       
  1846             qed
       
  1847             also have "\<dots> = (\<Sum>l\<in>snd ` p. norm (integral (k \<inter> l) f))"
       
  1848             proof -
       
  1849               have *: "norm (integral (k \<inter> l) f) = 0"
       
  1850                 if "l \<in> snd ` p" "y \<in> snd ` p" "l \<noteq> y" "k \<inter> l = k \<inter> y" for l y
       
  1851               proof -
       
  1852                 have "interior (k \<inter> l) \<subseteq> interior (l \<inter> y)"
       
  1853                   by (metis Int_lower2 interior_mono le_inf_iff that(4))
       
  1854                 then have "interior (k \<inter> l) = {}"
       
  1855                   by (simp add: snd_p(5) that) 
       
  1856                 moreover from d'(4)[OF k] snd_p(4)[OF that(1)] 
       
  1857                 obtain u1 v1 u2 v2
       
  1858                   where uv: "k = cbox u1 u2" "l = cbox v1 v2" by metis
       
  1859                 ultimately show ?thesis
       
  1860                   using that integral_null
       
  1861                   unfolding uv Int_interval content_eq_0_interior
       
  1862                   by (metis (mono_tags, lifting) norm_eq_zero)
       
  1863               qed
       
  1864               show ?thesis
       
  1865                 unfolding Setcompr_eq_image
       
  1866                 apply (rule sum.reindex_nontrivial [unfolded o_def])
       
  1867                  apply (rule finite_imageI)
       
  1868                  apply (rule p')
       
  1869                 using * by auto
       
  1870             qed
       
  1871             finally show ?case .
       
  1872           qed
       
  1873           also have "\<dots> = (\<Sum>(i,l) \<in> d \<times> (snd ` p). norm (integral (i\<inter>l) f))"
       
  1874             by (simp add: sum.cartesian_product)
       
  1875           also have "\<dots> = (\<Sum>x\<in>{(i, l) |i l. i \<in> d \<and> l \<in> snd ` p}. norm (integral (case_prod op \<inter> x) f))"
       
  1876             by (force simp: split_def Sigma_def intro!: sum.cong)
       
  1877           also have "\<dots> = (\<Sum>k\<in>{i \<inter> l |i l. i \<in> d \<and> l \<in> snd ` p}. norm (integral k f))"
  1838           proof -
  1878           proof -
  1839             have *: "norm (integral i f) = 0"
  1879             have eq0: " (integral (l1 \<inter> k1) f) = 0"
  1840               if "i \<in> {cbox u v \<inter> l |l. l \<in> snd ` p}"
  1880               if "l1 \<inter> k1 = l2 \<inter> k2" "(l1, k1) \<noteq> (l2, k2)"
  1841                 "i \<notin> {cbox u v \<inter> l |l. l \<in> snd ` p \<and> cbox u v \<inter> l \<noteq> {}}" for i
  1881                 "l1 \<in> d" "(j1,k1) \<in> p" "l2 \<in> d" "(j2,k2) \<in> p"
  1842               using that by auto
  1882               for l1 l2 k1 k2 j1 j2
  1843             show ?thesis
       
  1844               apply (rule sum.mono_neutral_left)
       
  1845                 apply (simp add: snd_p(1))
       
  1846               unfolding d'_def uv using * by auto 
       
  1847           qed
       
  1848           also have "\<dots> = (\<Sum>l\<in>snd ` p. norm (integral (k \<inter> l) f))"
       
  1849           proof -
       
  1850             have *: "norm (integral (k \<inter> l) f) = 0"
       
  1851               if "l \<in> snd ` p" "y \<in> snd ` p" "l \<noteq> y" "k \<inter> l = k \<inter> y" for l y
       
  1852             proof -
  1883             proof -
  1853               have "interior (k \<inter> l) \<subseteq> interior (l \<inter> y)"
  1884               obtain u1 v1 u2 v2 where uv: "l1 = cbox u1 u2" "k1 = cbox v1 v2"
  1854                 by (metis Int_lower2 interior_mono le_inf_iff that(4))
  1885                 using \<open>(j1, k1) \<in> p\<close> \<open>l1 \<in> d\<close> d'(4) p'(4) by blast
  1855               then have "interior (k \<inter> l) = {}"
  1886               have "l1 \<noteq> l2 \<or> k1 \<noteq> k2"
  1856                 by (simp add: snd_p(5) that) 
  1887                 using that by auto
  1857               moreover from d'(4)[OF k] snd_p(4)[OF that(1)] 
  1888               then have "interior k1 \<inter> interior k2 = {} \<or> interior l1 \<inter> interior l2 = {}"
  1858               obtain u1 v1 u2 v2
  1889                 by (meson d'(5) old.prod.inject p'(5) that(3) that(4) that(5) that(6))
  1859                 where uv: "k = cbox u1 u2" "l = cbox v1 v2" by metis
  1890               moreover have "interior (l1 \<inter> k1) = interior (l2 \<inter> k2)"
  1860               ultimately show ?thesis
  1891                 by (simp add: that(1))
  1861                 using that integral_null
  1892               ultimately have "interior(l1 \<inter> k1) = {}"
  1862                 unfolding uv Int_interval content_eq_0_interior
  1893                 by auto
  1863                 by (metis (mono_tags, lifting) norm_eq_zero)
  1894               then show ?thesis
       
  1895                 unfolding uv Int_interval content_eq_0_interior[symmetric] by auto
  1864             qed
  1896             qed
  1865             show ?thesis
  1897             show ?thesis
  1866               unfolding Setcompr_eq_image
  1898               unfolding *
  1867               apply (rule sum.reindex_nontrivial [unfolded o_def])
  1899               apply (rule sum.reindex_nontrivial [symmetric, unfolded o_def])
  1868                apply (rule finite_imageI)
  1900                apply (rule finite_product_dependent [OF \<open>finite d\<close>])
  1869                apply (rule p')
  1901                apply (rule finite_imageI [OF \<open>finite p\<close>])
  1870               using * by auto
  1902               apply clarsimp
       
  1903               by (metis eq0 fst_conv snd_conv)
  1871           qed
  1904           qed
  1872           finally show ?case .
  1905           also have "\<dots> = (\<Sum>(x, k)\<in>p'. norm (integral k f))"
       
  1906           proof -
       
  1907             have 0: "integral (ia \<inter> snd (a, b)) f = 0"
       
  1908               if "ia \<inter> snd (a, b) \<notin> snd ` p'" "ia \<in> d" "(a, b) \<in> p" for  ia a b
       
  1909             proof -
       
  1910               have "ia \<inter> b = {}"
       
  1911                 using that
       
  1912                 unfolding p'alt image_iff Bex_def not_ex
       
  1913                 apply (erule_tac x="(a, ia \<inter> b)" in allE)
       
  1914                 apply auto
       
  1915                 done
       
  1916               then show ?thesis
       
  1917                 by auto
       
  1918             qed
       
  1919             have 1: "\<exists>i l. snd (a, b) = i \<inter> l \<and> i \<in> d \<and> l \<in> snd ` p" if "(a, b) \<in> p'" for a b
       
  1920             proof -
       
  1921               have "\<exists>n N Na. (a, b) = (n, N \<inter> Na) \<and> (n, Na) \<in> p \<and> N \<in> d \<and> N \<inter> Na \<noteq> {}"
       
  1922                 using that p'alt by blast
       
  1923               then show "\<exists>N Na. snd (a, b) = N \<inter> Na \<and> N \<in> d \<and> Na \<in> snd ` p"
       
  1924                 by (metis (no_types) imageI prod.sel(2))
       
  1925             qed
       
  1926             show ?thesis
       
  1927               unfolding sum_p'
       
  1928               apply (rule sum.mono_neutral_right)
       
  1929                 apply (subst *)
       
  1930                 apply (rule finite_imageI[OF finite_product_dependent])
       
  1931                  apply fact
       
  1932                 apply (rule finite_imageI[OF p'(1)])
       
  1933               using 0 1 by auto
       
  1934           qed
       
  1935           finally show ?thesis .
  1873         qed
  1936         qed
  1874         also have "\<dots> = (\<Sum>(i,l) \<in> d \<times> (snd ` p). norm (integral (i\<inter>l) f))"
  1937         show "(\<Sum>(x, k)\<in>p'. norm (content k *\<^sub>R f x)) = (\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x))"
  1875           by (simp add: sum.cartesian_product)
       
  1876         also have "\<dots> = (\<Sum>x\<in>{(i, l) |i l. i \<in> d \<and> l \<in> snd ` p}. norm (integral (case_prod op \<inter> x) f))"
       
  1877           by (force simp: split_def Sigma_def intro!: sum.cong)
       
  1878         also have "\<dots> = (\<Sum>k\<in>{i \<inter> l |i l. i \<in> d \<and> l \<in> snd ` p}. norm (integral k f))"
       
  1879         proof -
  1938         proof -
  1880           have eq0: " (integral (l1 \<inter> k1) f) = 0"
  1939           let ?S = "{(x, i \<inter> l) |x i l. (x, l) \<in> p \<and> i \<in> d}"
  1881             if "l1 \<inter> k1 = l2 \<inter> k2" "(l1, k1) \<noteq> (l2, k2)"
  1940           have *: "?S = (\<lambda>(xl,i). (fst xl, snd xl \<inter> i)) ` (p \<times> d)"
  1882               "l1 \<in> d" "(j1,k1) \<in> p" "l2 \<in> d" "(j2,k2) \<in> p"
  1941             by force
  1883             for l1 l2 k1 k2 j1 j2
  1942           have pdfin: "finite (p \<times> d)"
       
  1943             using finite_cartesian_product[OF p'(1) d'(1)] by metis
       
  1944           have "(\<Sum>(x, k)\<in>p'. norm (content k *\<^sub>R f x)) = (\<Sum>(x, k)\<in>?S. \<bar>content k\<bar> * norm (f x))"
       
  1945             unfolding norm_scaleR
       
  1946             apply (rule sum.mono_neutral_left)
       
  1947               apply (subst *)
       
  1948               apply (rule finite_imageI)
       
  1949               apply fact
       
  1950             unfolding p'alt apply blast
       
  1951             by fastforce
       
  1952           also have "\<dots> = (\<Sum>((x,l),i)\<in>p \<times> d. \<bar>content (l \<inter> i)\<bar> * norm (f x))"
       
  1953             unfolding *
       
  1954             apply (subst sum.reindex_nontrivial)
       
  1955               apply fact
       
  1956             unfolding split_paired_all
       
  1957             unfolding o_def split_def snd_conv fst_conv mem_Sigma_iff prod.inject
       
  1958              apply (elim conjE)
  1884           proof -
  1959           proof -
  1885             obtain u1 v1 u2 v2 where uv: "l1 = cbox u1 u2" "k1 = cbox v1 v2"
  1960             fix x1 l1 k1 x2 l2 k2
  1886               using \<open>(j1, k1) \<in> p\<close> \<open>l1 \<in> d\<close> d'(4) p'(4) by blast
  1961             assume as: "(x1, l1) \<in> p" "(x2, l2) \<in> p" "k1 \<in> d" "k2 \<in> d"
  1887             have "l1 \<noteq> l2 \<or> k1 \<noteq> k2"
  1962               "x1 = x2" "l1 \<inter> k1 = l2 \<inter> k2" "\<not> ((x1 = x2 \<and> l1 = l2) \<and> k1 = k2)"
  1888               using that by auto
  1963             from d'(4)[OF as(3)] p'(4)[OF as(1)] guess u1 v1 u2 v2 by (elim exE) note uv=this
       
  1964             from as have "l1 \<noteq> l2 \<or> k1 \<noteq> k2"
       
  1965               by auto
  1889             then have "interior k1 \<inter> interior k2 = {} \<or> interior l1 \<inter> interior l2 = {}"
  1966             then have "interior k1 \<inter> interior k2 = {} \<or> interior l1 \<inter> interior l2 = {}"
  1890               by (meson d'(5) old.prod.inject p'(5) that(3) that(4) that(5) that(6))
  1967               apply -
  1891             moreover have "interior (l1 \<inter> k1) = interior (l2 \<inter> k2)"
  1968               apply (erule disjE)
  1892               by (simp add: that(1))
  1969                apply (rule disjI2)
  1893             ultimately have "interior(l1 \<inter> k1) = {}"
  1970                defer
  1894               by auto
  1971                apply (rule disjI1)
  1895             then show ?thesis
  1972                apply (rule d'(5)[OF as(3-4)])
  1896               unfolding uv Int_interval content_eq_0_interior[symmetric] by auto
  1973                apply assumption
  1897           qed
  1974               apply (rule p'(5)[OF as(1-2)])
  1898           show ?thesis
       
  1899             unfolding *
       
  1900             apply (rule sum.reindex_nontrivial [symmetric, unfolded o_def])
       
  1901              apply (rule finite_product_dependent [OF \<open>finite d\<close>])
       
  1902              apply (rule finite_imageI [OF \<open>finite p\<close>])
       
  1903             apply clarsimp
       
  1904             by (metis eq0 fst_conv snd_conv)
       
  1905         qed
       
  1906         also have "\<dots> = (\<Sum>(x, k)\<in>p'. norm (integral k f))"
       
  1907         proof -
       
  1908           have 0: "integral (ia \<inter> snd (a, b)) f = 0"
       
  1909             if "ia \<inter> snd (a, b) \<notin> snd ` p'" "ia \<in> d" "(a, b) \<in> p" for  ia a b
       
  1910           proof -
       
  1911             have "ia \<inter> b = {}"
       
  1912               using that
       
  1913               unfolding p'alt image_iff Bex_def not_ex
       
  1914               apply (erule_tac x="(a, ia \<inter> b)" in allE)
       
  1915               apply auto
  1975               apply auto
  1916               done
  1976               done
       
  1977             moreover have "interior (l1 \<inter> k1) = interior (l2 \<inter> k2)"
       
  1978               unfolding  as ..
       
  1979             ultimately have "interior (l1 \<inter> k1) = {}"
       
  1980               by auto
       
  1981             then show "\<bar>content (l1 \<inter> k1)\<bar> * norm (f x1) = 0"
       
  1982               unfolding uv Int_interval
       
  1983               unfolding content_eq_0_interior[symmetric]
       
  1984               by auto
       
  1985           qed safe
       
  1986           also have "\<dots> = (\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x))"
       
  1987             apply (subst sum_Sigma_product[symmetric])
       
  1988               apply (rule p')
       
  1989              apply (rule d')
       
  1990             apply (rule sum.cong)
       
  1991              apply (rule refl)
       
  1992             unfolding split_paired_all split_conv
       
  1993           proof -
       
  1994             fix x l
       
  1995             assume as: "(x, l) \<in> p"
       
  1996             note xl = p'(2-4)[OF this]
       
  1997             from this(3) guess u v by (elim exE) note uv=this
       
  1998             have "(\<Sum>i\<in>d. \<bar>content (l \<inter> i)\<bar>) = (\<Sum>k\<in>d. content (k \<inter> cbox u v))"
       
  1999               by (simp add: Int_commute uv)
       
  2000             also have "\<dots> = sum content {k \<inter> cbox u v| k. k \<in> d}"
       
  2001             proof -
       
  2002               have eq0: "content (k \<inter> cbox u v) = 0"
       
  2003                 if "k \<in> d" "y \<in> d" "k \<noteq> y" and eq: "k \<inter> cbox u v = y \<inter> cbox u v" for k y
       
  2004               proof -
       
  2005               from d'(4)[OF that(1)] d'(4)[OF that(2)]
       
  2006               obtain \<alpha> \<beta> where \<alpha>: "k \<inter> cbox u v = cbox \<alpha> \<beta>"
       
  2007                 by (meson Int_interval)
       
  2008               have "{} = interior ((k \<inter> y) \<inter> cbox u v)"
       
  2009                 by (simp add: d'(5) that)
       
  2010               also have "\<dots> = interior (y \<inter> (k \<inter> cbox u v))"
       
  2011                 by auto
       
  2012               also have "\<dots> = interior (k \<inter> cbox u v)"
       
  2013                 unfolding eq by auto
       
  2014               finally show ?thesis
       
  2015                 unfolding \<alpha> content_eq_0_interior ..
       
  2016             qed
  1917             then show ?thesis
  2017             then show ?thesis
       
  2018               unfolding Setcompr_eq_image
       
  2019               apply (rule sum.reindex_nontrivial [OF \<open>finite d\<close>, unfolded o_def, symmetric])
  1918               by auto
  2020               by auto
  1919           qed
       
  1920           have 1: "\<exists>i l. snd (a, b) = i \<inter> l \<and> i \<in> d \<and> l \<in> snd ` p" if "(a, b) \<in> p'" for a b
       
  1921           proof -
       
  1922             have "\<exists>n N Na. (a, b) = (n, N \<inter> Na) \<and> (n, Na) \<in> p \<and> N \<in> d \<and> N \<inter> Na \<noteq> {}"
       
  1923               using that p'alt by blast
       
  1924             then show "\<exists>N Na. snd (a, b) = N \<inter> Na \<and> N \<in> d \<and> Na \<in> snd ` p"
       
  1925               by (metis (no_types) imageI prod.sel(2))
       
  1926           qed
       
  1927           show ?thesis
       
  1928             unfolding sum_p'
       
  1929             apply (rule sum.mono_neutral_right)
       
  1930               apply (subst *)
       
  1931               apply (rule finite_imageI[OF finite_product_dependent])
       
  1932                apply fact
       
  1933               apply (rule finite_imageI[OF p'(1)])
       
  1934             using 0 1 by auto
       
  1935         qed
       
  1936         finally show ?case .
       
  1937       next
       
  1938         case 3
       
  1939         let ?S = "{(x, i \<inter> l) |x i l. (x, l) \<in> p \<and> i \<in> d}"
       
  1940         have *: "?S = (\<lambda>(xl,i). (fst xl, snd xl \<inter> i)) ` (p \<times> d)"
       
  1941           by force
       
  1942         have pdfin: "finite (p \<times> d)"
       
  1943           using finite_cartesian_product[OF p'(1) d'(1)] by metis
       
  1944         have "(\<Sum>(x, k)\<in>p'. norm (content k *\<^sub>R f x)) = (\<Sum>(x, k)\<in>?S. \<bar>content k\<bar> * norm (f x))"
       
  1945           unfolding norm_scaleR
       
  1946           apply (rule sum.mono_neutral_left)
       
  1947             apply (subst *)
       
  1948             apply (rule finite_imageI)
       
  1949             apply fact
       
  1950           unfolding p'alt apply blast
       
  1951           by fastforce
       
  1952         also have "\<dots> = (\<Sum>((x,l),i)\<in>p \<times> d. \<bar>content (l \<inter> i)\<bar> * norm (f x))"
       
  1953           unfolding *
       
  1954           apply (subst sum.reindex_nontrivial)
       
  1955             apply fact
       
  1956           unfolding split_paired_all
       
  1957           unfolding o_def split_def snd_conv fst_conv mem_Sigma_iff prod.inject
       
  1958            apply (elim conjE)
       
  1959         proof -
       
  1960           fix x1 l1 k1 x2 l2 k2
       
  1961           assume as: "(x1, l1) \<in> p" "(x2, l2) \<in> p" "k1 \<in> d" "k2 \<in> d"
       
  1962             "x1 = x2" "l1 \<inter> k1 = l2 \<inter> k2" "\<not> ((x1 = x2 \<and> l1 = l2) \<and> k1 = k2)"
       
  1963           from d'(4)[OF as(3)] p'(4)[OF as(1)] guess u1 v1 u2 v2 by (elim exE) note uv=this
       
  1964           from as have "l1 \<noteq> l2 \<or> k1 \<noteq> k2"
       
  1965             by auto
       
  1966           then have "interior k1 \<inter> interior k2 = {} \<or> interior l1 \<inter> interior l2 = {}"
       
  1967             apply -
       
  1968             apply (erule disjE)
       
  1969              apply (rule disjI2)
       
  1970              defer
       
  1971              apply (rule disjI1)
       
  1972              apply (rule d'(5)[OF as(3-4)])
       
  1973              apply assumption
       
  1974             apply (rule p'(5)[OF as(1-2)])
       
  1975             apply auto
       
  1976             done
       
  1977           moreover have "interior (l1 \<inter> k1) = interior (l2 \<inter> k2)"
       
  1978             unfolding  as ..
       
  1979           ultimately have "interior (l1 \<inter> k1) = {}"
       
  1980             by auto
       
  1981           then show "\<bar>content (l1 \<inter> k1)\<bar> * norm (f x1) = 0"
       
  1982             unfolding uv Int_interval
       
  1983             unfolding content_eq_0_interior[symmetric]
       
  1984             by auto
       
  1985         qed safe
       
  1986         also have "\<dots> = (\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x))"
       
  1987           apply (subst sum_Sigma_product[symmetric])
       
  1988             apply (rule p')
       
  1989            apply (rule d')
       
  1990           apply (rule sum.cong)
       
  1991            apply (rule refl)
       
  1992           unfolding split_paired_all split_conv
       
  1993         proof -
       
  1994           fix x l
       
  1995           assume as: "(x, l) \<in> p"
       
  1996           note xl = p'(2-4)[OF this]
       
  1997           from this(3) guess u v by (elim exE) note uv=this
       
  1998           have "(\<Sum>i\<in>d. \<bar>content (l \<inter> i)\<bar>) = (\<Sum>k\<in>d. content (k \<inter> cbox u v))"
       
  1999             by (simp add: Int_commute uv)
       
  2000           also have "\<dots> = sum content {k \<inter> cbox u v| k. k \<in> d}"
       
  2001             unfolding Setcompr_eq_image
       
  2002             apply (rule sum.reindex_nontrivial [unfolded o_def, symmetric])
       
  2003              apply (rule d')
       
  2004           proof goal_cases
       
  2005             case prems: (1 k y)
       
  2006             from d'(4)[OF this(1)] d'(4)[OF this(2)]
       
  2007             guess u1 v1 u2 v2 by (elim exE) note uv=this
       
  2008             have "{} = interior ((k \<inter> y) \<inter> cbox u v)"
       
  2009               apply (subst interior_Int)
       
  2010               using d'(5)[OF prems(1-3)]
       
  2011               apply auto
       
  2012               done
       
  2013             also have "\<dots> = interior (y \<inter> (k \<inter> cbox u v))"
       
  2014               by auto
       
  2015             also have "\<dots> = interior (k \<inter> cbox u v)"
       
  2016               unfolding prems(4) by auto
       
  2017             finally show ?case
       
  2018               unfolding uv Int_interval content_eq_0_interior ..
       
  2019           qed
  2021           qed
  2020           also have "\<dots> = sum content {cbox u v \<inter> k |k. k \<in> d \<and> cbox u v \<inter> k \<noteq> {}}"
  2022           also have "\<dots> = sum content {cbox u v \<inter> k |k. k \<in> d \<and> cbox u v \<inter> k \<noteq> {}}"
  2021             apply (rule sum.mono_neutral_right)
  2023             apply (rule sum.mono_neutral_right)
  2022             unfolding Setcompr_eq_image
  2024             unfolding Setcompr_eq_image
  2023               apply (rule finite_imageI)
  2025               apply (rule finite_imageI [OF \<open>finite d\<close>])
  2024               apply (rule d')
       
  2025              apply (fastforce simp: inf.commute)+
  2026              apply (fastforce simp: inf.commute)+
  2026             done
  2027             done
  2027           finally show "(\<Sum>i\<in>d. \<bar>content (l \<inter> i)\<bar> * norm (f x)) = content l *\<^sub>R norm (f x)"
  2028           finally show "(\<Sum>i\<in>d. \<bar>content (l \<inter> i)\<bar> * norm (f x)) = content l *\<^sub>R norm (f x)"
  2028             unfolding sum_distrib_right[symmetric] real_scaleR_def
  2029             unfolding sum_distrib_right[symmetric] real_scaleR_def
  2029             apply (subst(asm) additive_content_division[OF division_inter_1[OF d(1)]])
  2030             apply (subst(asm) additive_content_division[OF division_inter_1[OF d(1)]])
  2030             using xl(2)[unfolded uv]
  2031             using xl(2)[unfolded uv] unfolding uv apply auto
  2031             unfolding uv
       
  2032              apply auto
       
  2033             done
  2032             done
  2034         qed
  2033         qed
  2035         finally show ?case .
  2034         finally show ?thesis .
  2036       qed
  2035         qed
  2037     qed
  2036       qed (rule d)
  2038   qed
  2037     qed 
  2039 qed
  2038   qed
       
  2039   then show ?thesis
       
  2040     using absolutely_integrable_onI [OF f has_integral_integrable] has_integral[of _ ?S]
       
  2041     by blast
       
  2042 qed
       
  2043 
  2040 
  2044 
  2041 lemma bounded_variation_absolutely_integrable:
  2045 lemma bounded_variation_absolutely_integrable:
  2042   fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
  2046   fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
  2043   assumes "f integrable_on UNIV"
  2047   assumes "f integrable_on UNIV"
  2044     and "\<forall>d. d division_of (\<Union>d) \<longrightarrow> sum (\<lambda>k. norm (integral k f)) d \<le> B"
  2048     and "\<forall>d. d division_of (\<Union>d) \<longrightarrow> sum (\<lambda>k. norm (integral k f)) d \<le> B"
  2159           apply (subst if_P)
  2163           apply (subst if_P)
  2160           apply rule
  2164           apply rule
  2161         proof (rule *[rule_format])
  2165         proof (rule *[rule_format])
  2162           show "\<bar>(\<Sum>(x,k)\<in>p. norm (content k *\<^sub>R f x)) - (\<Sum>(x,k)\<in>p. norm (integral k f))\<bar> < e / 2"
  2166           show "\<bar>(\<Sum>(x,k)\<in>p. norm (content k *\<^sub>R f x)) - (\<Sum>(x,k)\<in>p. norm (integral k f))\<bar> < e / 2"
  2163             unfolding split_def
  2167             unfolding split_def
  2164             apply (rule helplemma)
  2168             apply (rule absdiff_norm_less)
  2165             using d2(2)[rule_format,of p]
  2169             using d2(2)[rule_format,of p]
  2166             using p(1,3)
  2170             using p(1,3)
  2167             unfolding tagged_division_of_def split_def
  2171             unfolding tagged_division_of_def split_def
  2168             apply auto
  2172             apply auto
  2169             done
  2173             done