180 using integral_f by auto |
180 using integral_f by auto |
181 |
181 |
182 have "(\<Sum>(x, k)\<in>?p. content k *\<^sub>R f x) = |
182 have "(\<Sum>(x, k)\<in>?p. content k *\<^sub>R f x) = |
183 (\<Sum>(x, k)\<in>?T ` (p \<inter> s). content k *\<^sub>R f x) + (\<Sum>(x, k)\<in>p - s. content k *\<^sub>R f x)" |
183 (\<Sum>(x, k)\<in>?T ` (p \<inter> s). content k *\<^sub>R f x) + (\<Sum>(x, k)\<in>p - s. content k *\<^sub>R f x)" |
184 using p(1)[THEN tagged_division_ofD(1)] |
184 using p(1)[THEN tagged_division_ofD(1)] |
185 by (safe intro!: setsum.union_inter_neutral) (auto simp: s_def T_def) |
185 by (safe intro!: sum.union_inter_neutral) (auto simp: s_def T_def) |
186 also have "(\<Sum>(x, k)\<in>?T ` (p \<inter> s). content k *\<^sub>R f x) = (\<Sum>(x, k)\<in>p \<inter> s. content k *\<^sub>R f (T X k))" |
186 also have "(\<Sum>(x, k)\<in>?T ` (p \<inter> s). content k *\<^sub>R f x) = (\<Sum>(x, k)\<in>p \<inter> s. content k *\<^sub>R f (T X k))" |
187 proof (subst setsum.reindex_nontrivial, safe) |
187 proof (subst sum.reindex_nontrivial, safe) |
188 fix x1 x2 k assume 1: "(x1, k) \<in> p" "(x1, k) \<in> s" and 2: "(x2, k) \<in> p" "(x2, k) \<in> s" |
188 fix x1 x2 k assume 1: "(x1, k) \<in> p" "(x1, k) \<in> s" and 2: "(x2, k) \<in> p" "(x2, k) \<in> s" |
189 and eq: "content k *\<^sub>R f (T X k) \<noteq> 0" |
189 and eq: "content k *\<^sub>R f (T X k) \<noteq> 0" |
190 with tagged_division_ofD(5)[OF p(1), of x1 k x2 k] tagged_division_ofD(4)[OF p(1), of x1 k] |
190 with tagged_division_ofD(5)[OF p(1), of x1 k x2 k] tagged_division_ofD(4)[OF p(1), of x1 k] |
191 show "x1 = x2" |
191 show "x1 = x2" |
192 by (auto simp: content_eq_0_interior) |
192 by (auto simp: content_eq_0_interior) |
193 qed (use p in \<open>auto intro!: setsum.cong\<close>) |
193 qed (use p in \<open>auto intro!: sum.cong\<close>) |
194 finally have eq: "(\<Sum>(x, k)\<in>?p. content k *\<^sub>R f x) = |
194 finally have eq: "(\<Sum>(x, k)\<in>?p. content k *\<^sub>R f x) = |
195 (\<Sum>(x, k)\<in>p \<inter> s. content k *\<^sub>R f (T X k)) + (\<Sum>(x, k)\<in>p - s. content k *\<^sub>R f x)" . |
195 (\<Sum>(x, k)\<in>p \<inter> s. content k *\<^sub>R f (T X k)) + (\<Sum>(x, k)\<in>p - s. content k *\<^sub>R f x)" . |
196 |
196 |
197 have in_T: "(x, k) \<in> s \<Longrightarrow> T X k \<in> X" for x k |
197 have in_T: "(x, k) \<in> s \<Longrightarrow> T X k \<in> X" for x k |
198 using in_s[of x k] by (auto simp: C_def) |
198 using in_s[of x k] by (auto simp: C_def) |
268 dest!: p(1)[THEN tagged_division_ofD(4)]) |
268 dest!: p(1)[THEN tagged_division_ofD(4)]) |
269 finally show "M - 3 * e \<le> (\<Sum>(x, y)\<in>p \<inter> s. content y)" |
269 finally show "M - 3 * e \<le> (\<Sum>(x, y)\<in>p \<inter> s. content y)" |
270 using \<open>0 < e\<close> by (simp add: split_beta) |
270 using \<open>0 < e\<close> by (simp add: split_beta) |
271 qed (use \<open>a < b\<close> in auto) |
271 qed (use \<open>a < b\<close> in auto) |
272 also have "\<dots> = (\<Sum>(x, k)\<in>p \<inter> s. content k * (b - a))" |
272 also have "\<dots> = (\<Sum>(x, k)\<in>p \<inter> s. content k * (b - a))" |
273 by (simp add: setsum_distrib_right split_beta') |
273 by (simp add: sum_distrib_right split_beta') |
274 also have "\<dots> \<le> (\<Sum>(x, k)\<in>p \<inter> s. content k * (f (T ?F k) - f (T ?E k)))" |
274 also have "\<dots> \<le> (\<Sum>(x, k)\<in>p \<inter> s. content k * (f (T ?F k) - f (T ?E k)))" |
275 using parts(3) by (auto intro!: setsum_mono mult_left_mono diff_mono) |
275 using parts(3) by (auto intro!: sum_mono mult_left_mono diff_mono) |
276 also have "\<dots> = (\<Sum>(x, k)\<in>p \<inter> s. content k * f (T ?F k)) - (\<Sum>(x, k)\<in>p \<inter> s. content k * f (T ?E k))" |
276 also have "\<dots> = (\<Sum>(x, k)\<in>p \<inter> s. content k * f (T ?F k)) - (\<Sum>(x, k)\<in>p \<inter> s. content k * f (T ?E k))" |
277 by (auto intro!: setsum.cong simp: field_simps setsum_subtractf[symmetric]) |
277 by (auto intro!: sum.cong simp: field_simps sum_subtractf[symmetric]) |
278 also have "\<dots> = (\<Sum>(x, k)\<in>?B. content k *\<^sub>R f x) - (\<Sum>(x, k)\<in>?A. content k *\<^sub>R f x)" |
278 also have "\<dots> = (\<Sum>(x, k)\<in>?B. content k *\<^sub>R f x) - (\<Sum>(x, k)\<in>?A. content k *\<^sub>R f x)" |
279 by (subst (1 2) parts) auto |
279 by (subst (1 2) parts) auto |
280 also have "\<dots> \<le> norm ((\<Sum>(x, k)\<in>?B. content k *\<^sub>R f x) - (\<Sum>(x, k)\<in>?A. content k *\<^sub>R f x))" |
280 also have "\<dots> \<le> norm ((\<Sum>(x, k)\<in>?B. content k *\<^sub>R f x) - (\<Sum>(x, k)\<in>?A. content k *\<^sub>R f x))" |
281 by auto |
281 by auto |
282 also have "\<dots> \<le> e + e" |
282 also have "\<dots> \<le> e + e" |
399 by (simp add: borel_eq_box subset_eq) |
399 by (simp add: borel_eq_box subset_eq) |
400 have "((\<lambda>x. if x \<in> UNION UNIV F \<inter> box a b then 1 else 0) has_integral ?M (\<Union>i. F i)) (box a b)" |
400 have "((\<lambda>x. if x \<in> UNION UNIV F \<inter> box a b then 1 else 0) has_integral ?M (\<Union>i. F i)) (box a b)" |
401 proof (rule has_integral_monotone_convergence_increasing) |
401 proof (rule has_integral_monotone_convergence_increasing) |
402 let ?f = "\<lambda>k x. \<Sum>i<k. if x \<in> F i \<inter> box a b then 1 else 0 :: real" |
402 let ?f = "\<lambda>k x. \<Sum>i<k. if x \<in> F i \<inter> box a b then 1 else 0 :: real" |
403 show "\<And>k. (?f k has_integral (\<Sum>i<k. ?M (F i))) (box a b)" |
403 show "\<And>k. (?f k has_integral (\<Sum>i<k. ?M (F i))) (box a b)" |
404 using union.IH by (auto intro!: has_integral_setsum simp del: Int_iff) |
404 using union.IH by (auto intro!: has_integral_sum simp del: Int_iff) |
405 show "\<And>k x. ?f k x \<le> ?f (Suc k) x" |
405 show "\<And>k x. ?f k x \<le> ?f (Suc k) x" |
406 by (intro setsum_mono2) auto |
406 by (intro sum_mono2) auto |
407 from union(1) have *: "\<And>x i j. x \<in> F i \<Longrightarrow> x \<in> F j \<longleftrightarrow> j = i" |
407 from union(1) have *: "\<And>x i j. x \<in> F i \<Longrightarrow> x \<in> F j \<longleftrightarrow> j = i" |
408 by (auto simp add: disjoint_family_on_def) |
408 by (auto simp add: disjoint_family_on_def) |
409 show "\<And>x. (\<lambda>k. ?f k x) \<longlonglongrightarrow> (if x \<in> UNION UNIV F \<inter> box a b then 1 else 0)" |
409 show "\<And>x. (\<lambda>k. ?f k x) \<longlonglongrightarrow> (if x \<in> UNION UNIV F \<inter> box a b then 1 else 0)" |
410 apply (auto simp: * setsum.If_cases Iio_Int_singleton) |
410 apply (auto simp: * sum.If_cases Iio_Int_singleton) |
411 apply (rule_tac k="Suc xa" in LIMSEQ_offset) |
411 apply (rule_tac k="Suc xa" in LIMSEQ_offset) |
412 apply simp |
412 apply simp |
413 done |
413 done |
414 have *: "emeasure lborel ((\<Union>x. F x) \<inter> box a b) \<le> emeasure lborel (box a b)" |
414 have *: "emeasure lborel ((\<Union>x. F x) \<inter> box a b) \<le> emeasure lborel (box a b)" |
415 by (intro emeasure_mono) auto |
415 by (intro emeasure_mono) auto |
755 lemma has_integral_integral_lborel: |
755 lemma has_integral_integral_lborel: |
756 assumes f: "integrable lborel f" |
756 assumes f: "integrable lborel f" |
757 shows "(f has_integral (integral\<^sup>L lborel f)) UNIV" |
757 shows "(f has_integral (integral\<^sup>L lborel f)) UNIV" |
758 proof - |
758 proof - |
759 have "((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. integral\<^sup>L lborel (\<lambda>x. f x \<bullet> b) *\<^sub>R b)) UNIV" |
759 have "((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. integral\<^sup>L lborel (\<lambda>x. f x \<bullet> b) *\<^sub>R b)) UNIV" |
760 using f by (intro has_integral_setsum finite_Basis ballI has_integral_scaleR_left has_integral_integral_real) auto |
760 using f by (intro has_integral_sum finite_Basis ballI has_integral_scaleR_left has_integral_integral_real) auto |
761 also have eq_f: "(\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) = f" |
761 also have eq_f: "(\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) = f" |
762 by (simp add: fun_eq_iff euclidean_representation) |
762 by (simp add: fun_eq_iff euclidean_representation) |
763 also have "(\<Sum>b\<in>Basis. integral\<^sup>L lborel (\<lambda>x. f x \<bullet> b) *\<^sub>R b) = integral\<^sup>L lborel f" |
763 also have "(\<Sum>b\<in>Basis. integral\<^sup>L lborel (\<lambda>x. f x \<bullet> b) *\<^sub>R b) = integral\<^sup>L lborel f" |
764 using f by (subst (2) eq_f[symmetric]) simp |
764 using f by (subst (2) eq_f[symmetric]) simp |
765 finally show ?thesis . |
765 finally show ?thesis . |
802 fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
802 fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
803 assumes f: "integrable lebesgue f" |
803 assumes f: "integrable lebesgue f" |
804 shows "(f has_integral (integral\<^sup>L lebesgue f)) UNIV" |
804 shows "(f has_integral (integral\<^sup>L lebesgue f)) UNIV" |
805 proof - |
805 proof - |
806 have "((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. integral\<^sup>L lebesgue (\<lambda>x. f x \<bullet> b) *\<^sub>R b)) UNIV" |
806 have "((\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) has_integral (\<Sum>b\<in>Basis. integral\<^sup>L lebesgue (\<lambda>x. f x \<bullet> b) *\<^sub>R b)) UNIV" |
807 using f by (intro has_integral_setsum finite_Basis ballI has_integral_scaleR_left has_integral_integral_lebesgue_real) auto |
807 using f by (intro has_integral_sum finite_Basis ballI has_integral_scaleR_left has_integral_integral_lebesgue_real) auto |
808 also have eq_f: "(\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) = f" |
808 also have eq_f: "(\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) = f" |
809 by (simp add: fun_eq_iff euclidean_representation) |
809 by (simp add: fun_eq_iff euclidean_representation) |
810 also have "(\<Sum>b\<in>Basis. integral\<^sup>L lebesgue (\<lambda>x. f x \<bullet> b) *\<^sub>R b) = integral\<^sup>L lebesgue f" |
810 also have "(\<Sum>b\<in>Basis. integral\<^sup>L lebesgue (\<lambda>x. f x \<bullet> b) *\<^sub>R b) = integral\<^sup>L lebesgue f" |
811 using f by (subst (2) eq_f[symmetric]) simp |
811 using f by (subst (2) eq_f[symmetric]) simp |
812 finally show ?thesis . |
812 finally show ?thesis . |
1243 proof - |
1243 proof - |
1244 have BM_ge0: "0 \<le> B * (DIM('M) * prj1 (vf X - uf X))" if "X \<in> \<D>'" for X |
1244 have BM_ge0: "0 \<le> B * (DIM('M) * prj1 (vf X - uf X))" if "X \<in> \<D>'" for X |
1245 using \<open>0 < B\<close> \<open>\<D>' \<subseteq> \<D>\<close> that vu_pos by fastforce |
1245 using \<open>0 < B\<close> \<open>\<D>' \<subseteq> \<D>\<close> that vu_pos by fastforce |
1246 have "{} \<notin> \<D>'" |
1246 have "{} \<notin> \<D>'" |
1247 using cbox \<open>\<D>' \<subseteq> \<D>\<close> interior_empty by blast |
1247 using cbox \<open>\<D>' \<subseteq> \<D>\<close> interior_empty by blast |
1248 have "(\<Sum>k\<in>fbx`\<D>'. measure lebesgue k) \<le> setsum (measure lebesgue o fbx) \<D>'" |
1248 have "(\<Sum>k\<in>fbx`\<D>'. measure lebesgue k) \<le> sum (measure lebesgue o fbx) \<D>'" |
1249 by (rule setsum_image_le [OF \<open>finite \<D>'\<close>]) (force simp: fbx_def) |
1249 by (rule sum_image_le [OF \<open>finite \<D>'\<close>]) (force simp: fbx_def) |
1250 also have "\<dots> \<le> (\<Sum>X\<in>\<D>'. (2 * B * DIM('M)) ^ DIM('N) * measure lebesgue X)" |
1250 also have "\<dots> \<le> (\<Sum>X\<in>\<D>'. (2 * B * DIM('M)) ^ DIM('N) * measure lebesgue X)" |
1251 proof (rule setsum_mono) |
1251 proof (rule sum_mono) |
1252 fix X assume "X \<in> \<D>'" |
1252 fix X assume "X \<in> \<D>'" |
1253 then have "X \<in> \<D>" using \<open>\<D>' \<subseteq> \<D>\<close> by blast |
1253 then have "X \<in> \<D>" using \<open>\<D>' \<subseteq> \<D>\<close> by blast |
1254 then have ufvf: "cbox (uf X) (vf X) = X" |
1254 then have ufvf: "cbox (uf X) (vf X) = X" |
1255 using uvz by blast |
1255 using uvz by blast |
1256 have "prj1 (vf X - uf X) ^ DIM('M) = (\<Prod>i::'M \<in> Basis. prj1 (vf X - uf X))" |
1256 have "prj1 (vf X - uf X) ^ DIM('M) = (\<Prod>i::'M \<in> Basis. prj1 (vf X - uf X))" |
1279 done |
1279 done |
1280 also have "\<dots> = (2 * B * DIM('M)) ^ DIM('N) * measure lebesgue X" |
1280 also have "\<dots> = (2 * B * DIM('M)) ^ DIM('N) * measure lebesgue X" |
1281 by (subst (3) ufvf[symmetric]) simp |
1281 by (subst (3) ufvf[symmetric]) simp |
1282 finally show "(measure lebesgue \<circ> fbx) X \<le> (2 * B * DIM('M)) ^ DIM('N) * measure lebesgue X" . |
1282 finally show "(measure lebesgue \<circ> fbx) X \<le> (2 * B * DIM('M)) ^ DIM('N) * measure lebesgue X" . |
1283 qed |
1283 qed |
1284 also have "\<dots> = (2 * B * DIM('M)) ^ DIM('N) * setsum (measure lebesgue) \<D>'" |
1284 also have "\<dots> = (2 * B * DIM('M)) ^ DIM('N) * sum (measure lebesgue) \<D>'" |
1285 by (simp add: setsum_distrib_left) |
1285 by (simp add: sum_distrib_left) |
1286 also have "\<dots> \<le> e / 2" |
1286 also have "\<dots> \<le> e / 2" |
1287 proof - |
1287 proof - |
1288 have div: "\<D>' division_of \<Union>\<D>'" |
1288 have div: "\<D>' division_of \<Union>\<D>'" |
1289 apply (auto simp: \<open>finite \<D>'\<close> \<open>{} \<notin> \<D>'\<close> division_of_def) |
1289 apply (auto simp: \<open>finite \<D>'\<close> \<open>{} \<notin> \<D>'\<close> division_of_def) |
1290 using cbox that apply blast |
1290 using cbox that apply blast |
1304 using Ksub [OF \<open>D \<in> \<D>\<close>] |
1304 using Ksub [OF \<open>D \<in> \<D>\<close>] |
1305 by (metis \<open>x \<in> D\<close> Int_iff dist_norm mem_ball norm_minus_commute subsetD RT) |
1305 by (metis \<open>x \<in> D\<close> Int_iff dist_norm mem_ball norm_minus_commute subsetD RT) |
1306 qed |
1306 qed |
1307 finally show "\<Union>\<D>' \<subseteq> T" . |
1307 finally show "\<Union>\<D>' \<subseteq> T" . |
1308 qed |
1308 qed |
1309 have "setsum (measure lebesgue) \<D>' = setsum content \<D>'" |
1309 have "sum (measure lebesgue) \<D>' = sum content \<D>'" |
1310 using \<open>\<D>' \<subseteq> \<D>\<close> cbox by (force intro: setsum.cong) |
1310 using \<open>\<D>' \<subseteq> \<D>\<close> cbox by (force intro: sum.cong) |
1311 then have "(2 * B * DIM('M)) ^ DIM('N) * setsum (measure lebesgue) \<D>' = |
1311 then have "(2 * B * DIM('M)) ^ DIM('N) * sum (measure lebesgue) \<D>' = |
1312 (2 * B * real DIM('M)) ^ DIM('N) * measure lebesgue (\<Union>\<D>')" |
1312 (2 * B * real DIM('M)) ^ DIM('N) * measure lebesgue (\<Union>\<D>')" |
1313 using content_division [OF div] by auto |
1313 using content_division [OF div] by auto |
1314 also have "\<dots> \<le> (2 * B * real DIM('M)) ^ DIM('N) * measure lebesgue T" |
1314 also have "\<dots> \<le> (2 * B * real DIM('M)) ^ DIM('N) * measure lebesgue T" |
1315 apply (rule mult_left_mono [OF le_meaT]) |
1315 apply (rule mult_left_mono [OF le_meaT]) |
1316 using \<open>0 < B\<close> |
1316 using \<open>0 < B\<close> |
1337 have yin: "y \<in> cbox (uf X) (vf X)" and zin: "(zf X) \<in> cbox (uf X) (vf X)" |
1337 have yin: "y \<in> cbox (uf X) (vf X)" and zin: "(zf X) \<in> cbox (uf X) (vf X)" |
1338 using uvz \<open>X \<in> \<D>\<close> \<open>y \<in> X\<close> by auto |
1338 using uvz \<open>X \<in> \<D>\<close> \<open>y \<in> X\<close> by auto |
1339 have "norm (y - zf X) \<le> (\<Sum>i\<in>Basis. \<bar>(y - zf X) \<bullet> i\<bar>)" |
1339 have "norm (y - zf X) \<le> (\<Sum>i\<in>Basis. \<bar>(y - zf X) \<bullet> i\<bar>)" |
1340 by (rule norm_le_l1) |
1340 by (rule norm_le_l1) |
1341 also have "\<dots> \<le> real DIM('M) * prj1 (vf X - uf X)" |
1341 also have "\<dots> \<le> real DIM('M) * prj1 (vf X - uf X)" |
1342 proof (rule setsum_bounded_above) |
1342 proof (rule sum_bounded_above) |
1343 fix j::'M assume j: "j \<in> Basis" |
1343 fix j::'M assume j: "j \<in> Basis" |
1344 show "\<bar>(y - zf X) \<bullet> j\<bar> \<le> prj1 (vf X - uf X)" |
1344 show "\<bar>(y - zf X) \<bullet> j\<bar> \<le> prj1 (vf X - uf X)" |
1345 using yin zin j |
1345 using yin zin j |
1346 by (fastforce simp add: mem_box prj1_idem [OF \<open>X \<in> \<D>\<close> j] inner_diff_left) |
1346 by (fastforce simp add: mem_box prj1_idem [OF \<open>X \<in> \<D>\<close> j] inner_diff_left) |
1347 qed |
1347 qed |
1531 using integrable_norm[OF f] by simp |
1531 using integrable_norm[OF f] by simp |
1532 |
1532 |
1533 lemma absolutely_integrable_bounded_variation: |
1533 lemma absolutely_integrable_bounded_variation: |
1534 fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
1534 fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
1535 assumes f: "f absolutely_integrable_on UNIV" |
1535 assumes f: "f absolutely_integrable_on UNIV" |
1536 obtains B where "\<forall>d. d division_of (\<Union>d) \<longrightarrow> setsum (\<lambda>k. norm (integral k f)) d \<le> B" |
1536 obtains B where "\<forall>d. d division_of (\<Union>d) \<longrightarrow> sum (\<lambda>k. norm (integral k f)) d \<le> B" |
1537 proof (rule that[of "integral UNIV (\<lambda>x. norm (f x))"]; safe) |
1537 proof (rule that[of "integral UNIV (\<lambda>x. norm (f x))"]; safe) |
1538 fix d :: "'a set set" assume d: "d division_of \<Union>d" |
1538 fix d :: "'a set set" assume d: "d division_of \<Union>d" |
1539 have *: "k \<in> d \<Longrightarrow> f absolutely_integrable_on k" for k |
1539 have *: "k \<in> d \<Longrightarrow> f absolutely_integrable_on k" for k |
1540 using f[THEN set_integrable_subset, of k] division_ofD(2,4)[OF d, of k] by auto |
1540 using f[THEN set_integrable_subset, of k] division_ofD(2,4)[OF d, of k] by auto |
1541 note d' = division_ofD[OF d] |
1541 note d' = division_ofD[OF d] |
1542 |
1542 |
1543 have "(\<Sum>k\<in>d. norm (integral k f)) = (\<Sum>k\<in>d. norm (LINT x:k|lebesgue. f x))" |
1543 have "(\<Sum>k\<in>d. norm (integral k f)) = (\<Sum>k\<in>d. norm (LINT x:k|lebesgue. f x))" |
1544 by (intro setsum.cong refl arg_cong[where f=norm] set_lebesgue_integral_eq_integral(2)[symmetric] *) |
1544 by (intro sum.cong refl arg_cong[where f=norm] set_lebesgue_integral_eq_integral(2)[symmetric] *) |
1545 also have "\<dots> \<le> (\<Sum>k\<in>d. LINT x:k|lebesgue. norm (f x))" |
1545 also have "\<dots> \<le> (\<Sum>k\<in>d. LINT x:k|lebesgue. norm (f x))" |
1546 by (intro setsum_mono set_integral_norm_bound *) |
1546 by (intro sum_mono set_integral_norm_bound *) |
1547 also have "\<dots> = (\<Sum>k\<in>d. integral k (\<lambda>x. norm (f x)))" |
1547 also have "\<dots> = (\<Sum>k\<in>d. integral k (\<lambda>x. norm (f x)))" |
1548 by (intro setsum.cong refl set_lebesgue_integral_eq_integral(2) set_integrable_norm *) |
1548 by (intro sum.cong refl set_lebesgue_integral_eq_integral(2) set_integrable_norm *) |
1549 also have "\<dots> \<le> integral (\<Union>d) (\<lambda>x. norm (f x))" |
1549 also have "\<dots> \<le> integral (\<Union>d) (\<lambda>x. norm (f x))" |
1550 using integrable_on_subdivision[OF d] assms f unfolding absolutely_integrable_on_def |
1550 using integrable_on_subdivision[OF d] assms f unfolding absolutely_integrable_on_def |
1551 by (subst integral_combine_division_topdown[OF _ d]) auto |
1551 by (subst integral_combine_division_topdown[OF _ d]) auto |
1552 also have "\<dots> \<le> integral UNIV (\<lambda>x. norm (f x))" |
1552 also have "\<dots> \<le> integral UNIV (\<lambda>x. norm (f x))" |
1553 using integrable_on_subdivision[OF d] assms unfolding absolutely_integrable_on_def |
1553 using integrable_on_subdivision[OF d] assms unfolding absolutely_integrable_on_def |
1554 by (intro integral_subset_le) auto |
1554 by (intro integral_subset_le) auto |
1555 finally show "(\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))" . |
1555 finally show "(\<Sum>k\<in>d. norm (integral k f)) \<le> integral UNIV (\<lambda>x. norm (f x))" . |
1556 qed |
1556 qed |
1557 |
1557 |
1558 lemma helplemma: |
1558 lemma helplemma: |
1559 assumes "setsum (\<lambda>x. norm (f x - g x)) s < e" |
1559 assumes "sum (\<lambda>x. norm (f x - g x)) s < e" |
1560 and "finite s" |
1560 and "finite s" |
1561 shows "\<bar>setsum (\<lambda>x. norm(f x)) s - setsum (\<lambda>x. norm(g x)) s\<bar> < e" |
1561 shows "\<bar>sum (\<lambda>x. norm(f x)) s - sum (\<lambda>x. norm(g x)) s\<bar> < e" |
1562 unfolding setsum_subtractf[symmetric] |
1562 unfolding sum_subtractf[symmetric] |
1563 apply (rule le_less_trans[OF setsum_abs]) |
1563 apply (rule le_less_trans[OF sum_abs]) |
1564 apply (rule le_less_trans[OF _ assms(1)]) |
1564 apply (rule le_less_trans[OF _ assms(1)]) |
1565 apply (rule setsum_mono) |
1565 apply (rule sum_mono) |
1566 apply (rule norm_triangle_ineq3) |
1566 apply (rule norm_triangle_ineq3) |
1567 done |
1567 done |
1568 |
1568 |
1569 lemma bounded_variation_absolutely_integrable_interval: |
1569 lemma bounded_variation_absolutely_integrable_interval: |
1570 fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space" |
1570 fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space" |
1571 assumes f: "f integrable_on cbox a b" |
1571 assumes f: "f integrable_on cbox a b" |
1572 and *: "\<forall>d. d division_of (cbox a b) \<longrightarrow> setsum (\<lambda>k. norm(integral k f)) d \<le> B" |
1572 and *: "\<forall>d. d division_of (cbox a b) \<longrightarrow> sum (\<lambda>k. norm(integral k f)) d \<le> B" |
1573 shows "f absolutely_integrable_on cbox a b" |
1573 shows "f absolutely_integrable_on cbox a b" |
1574 proof - |
1574 proof - |
1575 let ?f = "\<lambda>d. \<Sum>k\<in>d. norm (integral k f)" and ?D = "{d. d division_of (cbox a b)}" |
1575 let ?f = "\<lambda>d. \<Sum>k\<in>d. norm (integral k f)" and ?D = "{d. d division_of (cbox a b)}" |
1576 have D_1: "?D \<noteq> {}" |
1576 have D_1: "?D \<noteq> {}" |
1577 by (rule elementary_interval[of a b]) auto |
1577 by (rule elementary_interval[of a b]) auto |
1773 case 2 |
1773 case 2 |
1774 have *: "{k \<inter> l | k l. k \<in> d \<and> l \<in> snd ` p} = |
1774 have *: "{k \<inter> l | k l. k \<in> d \<and> l \<in> snd ` p} = |
1775 (\<lambda>(k,l). k \<inter> l) ` {(k,l)|k l. k \<in> d \<and> l \<in> snd ` p}" |
1775 (\<lambda>(k,l). k \<inter> l) ` {(k,l)|k l. k \<in> d \<and> l \<in> snd ` p}" |
1776 by auto |
1776 by auto |
1777 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))" |
1777 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))" |
1778 proof (rule setsum_mono, goal_cases) |
1778 proof (rule sum_mono, goal_cases) |
1779 case k: (1 k) |
1779 case k: (1 k) |
1780 from d'(4)[OF this] guess u v by (elim exE) note uv=this |
1780 from d'(4)[OF this] guess u v by (elim exE) note uv=this |
1781 define d' where "d' = {cbox u v \<inter> l |l. l \<in> snd ` p \<and> cbox u v \<inter> l \<noteq> {}}" |
1781 define d' where "d' = {cbox u v \<inter> l |l. l \<in> snd ` p \<and> cbox u v \<inter> l \<noteq> {}}" |
1782 note uvab = d'(2)[OF k[unfolded uv]] |
1782 note uvab = d'(2)[OF k[unfolded uv]] |
1783 have "d' division_of cbox u v" |
1783 have "d' division_of cbox u v" |
1784 apply (subst d'_def) |
1784 apply (subst d'_def) |
1785 apply (rule division_inter_1) |
1785 apply (rule division_inter_1) |
1786 apply (rule division_of_tagged_division[OF p(1)]) |
1786 apply (rule division_of_tagged_division[OF p(1)]) |
1787 apply (rule uvab) |
1787 apply (rule uvab) |
1788 done |
1788 done |
1789 then have "norm (integral k f) \<le> setsum (\<lambda>k. norm (integral k f)) d'" |
1789 then have "norm (integral k f) \<le> sum (\<lambda>k. norm (integral k f)) d'" |
1790 unfolding uv |
1790 unfolding uv |
1791 apply (subst integral_combine_division_topdown[of _ _ d']) |
1791 apply (subst integral_combine_division_topdown[of _ _ d']) |
1792 apply (rule integrable_on_subcbox[OF assms(1) uvab]) |
1792 apply (rule integrable_on_subcbox[OF assms(1) uvab]) |
1793 apply assumption |
1793 apply assumption |
1794 apply (rule setsum_norm_le) |
1794 apply (rule sum_norm_le) |
1795 apply auto |
1795 apply auto |
1796 done |
1796 done |
1797 also have "\<dots> = (\<Sum>k\<in>{k \<inter> l |l. l \<in> snd ` p}. norm (integral k f))" |
1797 also have "\<dots> = (\<Sum>k\<in>{k \<inter> l |l. l \<in> snd ` p}. norm (integral k f))" |
1798 apply (rule setsum.mono_neutral_left) |
1798 apply (rule sum.mono_neutral_left) |
1799 apply (subst Setcompr_eq_image) |
1799 apply (subst Setcompr_eq_image) |
1800 apply (rule finite_imageI)+ |
1800 apply (rule finite_imageI)+ |
1801 apply fact |
1801 apply fact |
1802 unfolding d'_def uv |
1802 unfolding d'_def uv |
1803 apply blast |
1803 apply blast |
1979 unfolding Sigma_alt |
1979 unfolding Sigma_alt |
1980 apply (subst sum_sum_product[symmetric]) |
1980 apply (subst sum_sum_product[symmetric]) |
1981 apply (rule p') |
1981 apply (rule p') |
1982 apply rule |
1982 apply rule |
1983 apply (rule d') |
1983 apply (rule d') |
1984 apply (rule setsum.cong) |
1984 apply (rule sum.cong) |
1985 apply (rule refl) |
1985 apply (rule refl) |
1986 unfolding split_paired_all split_conv |
1986 unfolding split_paired_all split_conv |
1987 proof - |
1987 proof - |
1988 fix x l |
1988 fix x l |
1989 assume as: "(x, l) \<in> p" |
1989 assume as: "(x, l) \<in> p" |
1990 note xl = p'(2-4)[OF this] |
1990 note xl = p'(2-4)[OF this] |
1991 from this(3) guess u v by (elim exE) note uv=this |
1991 from this(3) guess u v by (elim exE) note uv=this |
1992 have "(\<Sum>i\<in>d. \<bar>content (l \<inter> i)\<bar>) = (\<Sum>k\<in>d. content (k \<inter> cbox u v))" |
1992 have "(\<Sum>i\<in>d. \<bar>content (l \<inter> i)\<bar>) = (\<Sum>k\<in>d. content (k \<inter> cbox u v))" |
1993 apply (rule setsum.cong) |
1993 apply (rule sum.cong) |
1994 apply (rule refl) |
1994 apply (rule refl) |
1995 apply (drule d'(4)) |
1995 apply (drule d'(4)) |
1996 apply safe |
1996 apply safe |
1997 apply (subst Int_commute) |
1997 apply (subst Int_commute) |
1998 unfolding Int_interval uv |
1998 unfolding Int_interval uv |
1999 apply (subst abs_of_nonneg) |
1999 apply (subst abs_of_nonneg) |
2000 apply auto |
2000 apply auto |
2001 done |
2001 done |
2002 also have "\<dots> = setsum content {k \<inter> cbox u v| k. k \<in> d}" |
2002 also have "\<dots> = sum content {k \<inter> cbox u v| k. k \<in> d}" |
2003 unfolding Setcompr_eq_image |
2003 unfolding Setcompr_eq_image |
2004 apply (rule setsum.reindex_nontrivial [unfolded o_def, symmetric]) |
2004 apply (rule sum.reindex_nontrivial [unfolded o_def, symmetric]) |
2005 apply (rule d') |
2005 apply (rule d') |
2006 proof goal_cases |
2006 proof goal_cases |
2007 case prems: (1 k y) |
2007 case prems: (1 k y) |
2008 from d'(4)[OF this(1)] d'(4)[OF this(2)] |
2008 from d'(4)[OF this(1)] d'(4)[OF this(2)] |
2009 guess u1 v1 u2 v2 by (elim exE) note uv=this |
2009 guess u1 v1 u2 v2 by (elim exE) note uv=this |
2054 qed |
2054 qed |
2055 |
2055 |
2056 lemma bounded_variation_absolutely_integrable: |
2056 lemma bounded_variation_absolutely_integrable: |
2057 fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space" |
2057 fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space" |
2058 assumes "f integrable_on UNIV" |
2058 assumes "f integrable_on UNIV" |
2059 and "\<forall>d. d division_of (\<Union>d) \<longrightarrow> setsum (\<lambda>k. norm (integral k f)) d \<le> B" |
2059 and "\<forall>d. d division_of (\<Union>d) \<longrightarrow> sum (\<lambda>k. norm (integral k f)) d \<le> B" |
2060 shows "f absolutely_integrable_on UNIV" |
2060 shows "f absolutely_integrable_on UNIV" |
2061 proof (rule absolutely_integrable_onI, fact, rule) |
2061 proof (rule absolutely_integrable_onI, fact, rule) |
2062 let ?f = "\<lambda>d. \<Sum>k\<in>d. norm (integral k f)" and ?D = "{d. d division_of (\<Union>d)}" |
2062 let ?f = "\<lambda>d. \<Sum>k\<in>d. norm (integral k f)" and ?D = "{d. d division_of (\<Union>d)}" |
2063 have D_1: "?D \<noteq> {}" |
2063 have D_1: "?D \<noteq> {}" |
2064 by (rule elementary_interval) auto |
2064 by (rule elementary_interval) auto |
2081 case (1 a b) |
2081 case (1 a b) |
2082 show ?case |
2082 show ?case |
2083 using f_int[of a b] unfolding absolutely_integrable_on_def by auto |
2083 using f_int[of a b] unfolding absolutely_integrable_on_def by auto |
2084 next |
2084 next |
2085 case prems: (2 e) |
2085 case prems: (2 e) |
2086 have "\<exists>y\<in>setsum (\<lambda>k. norm (integral k f)) ` {d. d division_of \<Union>d}. \<not> y \<le> ?S - e" |
2086 have "\<exists>y\<in>sum (\<lambda>k. norm (integral k f)) ` {d. d division_of \<Union>d}. \<not> y \<le> ?S - e" |
2087 proof (rule ccontr) |
2087 proof (rule ccontr) |
2088 assume "\<not> ?thesis" |
2088 assume "\<not> ?thesis" |
2089 then have "?S \<le> ?S - e" |
2089 then have "?S \<le> ?S - e" |
2090 by (intro cSUP_least[OF D(1)]) auto |
2090 by (intro cSUP_least[OF D(1)]) auto |
2091 then show False |
2091 then show False |
2092 using prems by auto |
2092 using prems by auto |
2093 qed |
2093 qed |
2094 then obtain K where *: "\<exists>x\<in>{d. d division_of \<Union>d}. K = (\<Sum>k\<in>x. norm (integral k f))" |
2094 then obtain K where *: "\<exists>x\<in>{d. d division_of \<Union>d}. K = (\<Sum>k\<in>x. norm (integral k f))" |
2095 "SUPREMUM {d. d division_of \<Union>d} (setsum (\<lambda>k. norm (integral k f))) - e < K" |
2095 "SUPREMUM {d. d division_of \<Union>d} (sum (\<lambda>k. norm (integral k f))) - e < K" |
2096 by (auto simp add: image_iff not_le) |
2096 by (auto simp add: image_iff not_le) |
2097 from this(1) obtain d where "d division_of \<Union>d" |
2097 from this(1) obtain d where "d division_of \<Union>d" |
2098 and "K = (\<Sum>k\<in>d. norm (integral k f))" |
2098 and "K = (\<Sum>k\<in>d. norm (integral k f))" |
2099 by auto |
2099 by auto |
2100 note d = this(1) *(2)[unfolded this(2)] |
2100 note d = this(1) *(2)[unfolded this(2)] |
2186 done |
2186 done |
2187 show "\<bar>(\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x)) - integral (cbox a b) (\<lambda>x. norm(f x))\<bar> < e / 2" |
2187 show "\<bar>(\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x)) - integral (cbox a b) (\<lambda>x. norm(f x))\<bar> < e / 2" |
2188 using d1(2)[rule_format,OF conjI[OF p(1,2)]] |
2188 using d1(2)[rule_format,OF conjI[OF p(1,2)]] |
2189 by (simp only: real_norm_def) |
2189 by (simp only: real_norm_def) |
2190 show "(\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x)) = (\<Sum>(x, k)\<in>p. norm (content k *\<^sub>R f x))" |
2190 show "(\<Sum>(x, k)\<in>p. content k *\<^sub>R norm (f x)) = (\<Sum>(x, k)\<in>p. norm (content k *\<^sub>R f x))" |
2191 apply (rule setsum.cong) |
2191 apply (rule sum.cong) |
2192 apply (rule refl) |
2192 apply (rule refl) |
2193 unfolding split_paired_all split_conv |
2193 unfolding split_paired_all split_conv |
2194 apply (drule tagged_division_ofD(4)[OF p(1)]) |
2194 apply (drule tagged_division_ofD(4)[OF p(1)]) |
2195 unfolding norm_scaleR |
2195 unfolding norm_scaleR |
2196 apply (subst abs_of_nonneg) |
2196 apply (subst abs_of_nonneg) |
2197 apply auto |
2197 apply auto |
2198 done |
2198 done |
2199 show "(\<Sum>(x, k)\<in>p. norm (integral k f)) \<le> ?S" |
2199 show "(\<Sum>(x, k)\<in>p. norm (integral k f)) \<le> ?S" |
2200 using partial_division_of_tagged_division[of p "cbox a b"] p(1) |
2200 using partial_division_of_tagged_division[of p "cbox a b"] p(1) |
2201 apply (subst setsum.over_tagged_division_lemma[OF p(1)]) |
2201 apply (subst sum.over_tagged_division_lemma[OF p(1)]) |
2202 apply (simp add: content_eq_0_interior) |
2202 apply (simp add: content_eq_0_interior) |
2203 apply (intro cSUP_upper2[OF D(2), of "snd ` p"]) |
2203 apply (intro cSUP_upper2[OF D(2), of "snd ` p"]) |
2204 apply (auto simp: tagged_partial_division_of_def) |
2204 apply (auto simp: tagged_partial_division_of_def) |
2205 done |
2205 done |
2206 qed |
2206 qed |
2228 and h :: "'n::euclidean_space \<Rightarrow> 'p::euclidean_space" |
2228 and h :: "'n::euclidean_space \<Rightarrow> 'p::euclidean_space" |
2229 shows "f absolutely_integrable_on s \<Longrightarrow> bounded_linear h \<Longrightarrow> (h \<circ> f) absolutely_integrable_on s" |
2229 shows "f absolutely_integrable_on s \<Longrightarrow> bounded_linear h \<Longrightarrow> (h \<circ> f) absolutely_integrable_on s" |
2230 using integrable_bounded_linear[of h lebesgue "\<lambda>x. indicator s x *\<^sub>R f x"] |
2230 using integrable_bounded_linear[of h lebesgue "\<lambda>x. indicator s x *\<^sub>R f x"] |
2231 by (simp add: linear_simps[of h]) |
2231 by (simp add: linear_simps[of h]) |
2232 |
2232 |
2233 lemma absolutely_integrable_setsum: |
2233 lemma absolutely_integrable_sum: |
2234 fixes f :: "'a \<Rightarrow> 'n::euclidean_space \<Rightarrow> 'm::euclidean_space" |
2234 fixes f :: "'a \<Rightarrow> 'n::euclidean_space \<Rightarrow> 'm::euclidean_space" |
2235 assumes "finite t" and "\<And>a. a \<in> t \<Longrightarrow> (f a) absolutely_integrable_on s" |
2235 assumes "finite t" and "\<And>a. a \<in> t \<Longrightarrow> (f a) absolutely_integrable_on s" |
2236 shows "(\<lambda>x. setsum (\<lambda>a. f a x) t) absolutely_integrable_on s" |
2236 shows "(\<lambda>x. sum (\<lambda>a. f a x) t) absolutely_integrable_on s" |
2237 using assms(1,2) by induct auto |
2237 using assms(1,2) by induct auto |
2238 |
2238 |
2239 lemma absolutely_integrable_integrable_bound: |
2239 lemma absolutely_integrable_integrable_bound: |
2240 fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space" |
2240 fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space" |
2241 assumes le: "\<forall>x\<in>s. norm (f x) \<le> g x" and f: "f integrable_on s" and g: "g integrable_on s" |
2241 assumes le: "\<forall>x\<in>s. norm (f x) \<le> g x" and f: "f integrable_on s" and g: "g integrable_on s" |