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" |
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" |