src/HOL/Analysis/Improper_Integral.thy
changeset 69678 0f4d4a13dc16
parent 69508 2a4c8a2a3f8e
child 69680 96a43caa4902
equal deleted inserted replaced
69677:a06b204527e6 69678:0f4d4a13dc16
    26     
    26     
    27 lemma equiintegrable_on_subset: "\<lbrakk>F equiintegrable_on I; G \<subseteq> F\<rbrakk> \<Longrightarrow> G equiintegrable_on I"
    27 lemma equiintegrable_on_subset: "\<lbrakk>F equiintegrable_on I; G \<subseteq> F\<rbrakk> \<Longrightarrow> G equiintegrable_on I"
    28   unfolding equiintegrable_on_def Ball_def
    28   unfolding equiintegrable_on_def Ball_def
    29   by (erule conj_forward imp_forward all_forward ex_forward | blast)+
    29   by (erule conj_forward imp_forward all_forward ex_forward | blast)+
    30 
    30 
    31 lemma%important equiintegrable_on_Un:
    31 lemma equiintegrable_on_Un:
    32   assumes "F equiintegrable_on I" "G equiintegrable_on I"
    32   assumes "F equiintegrable_on I" "G equiintegrable_on I"
    33   shows "(F \<union> G) equiintegrable_on I"
    33   shows "(F \<union> G) equiintegrable_on I"
    34   unfolding equiintegrable_on_def
    34   unfolding equiintegrable_on_def
    35 proof%unimportant (intro conjI impI allI)
    35 proof (intro conjI impI allI)
    36   show "\<forall>f\<in>F \<union> G. f integrable_on I"
    36   show "\<forall>f\<in>F \<union> G. f integrable_on I"
    37     using assms unfolding equiintegrable_on_def by blast
    37     using assms unfolding equiintegrable_on_def by blast
    38   show "\<exists>\<gamma>. gauge \<gamma> \<and>
    38   show "\<exists>\<gamma>. gauge \<gamma> \<and>
    39             (\<forall>f \<D>. f \<in> F \<union> G \<and>
    39             (\<forall>f \<D>. f \<in> F \<union> G \<and>
    40                    \<D> tagged_division_of I \<and> \<gamma> fine \<D> \<longrightarrow>
    40                    \<D> tagged_division_of I \<and> \<gamma> fine \<D> \<longrightarrow>
    74   by (metis gauge_trivial norm_eq_zero sum_content_null)
    74   by (metis gauge_trivial norm_eq_zero sum_content_null)
    75 
    75 
    76 
    76 
    77 text\<open> Main limit theorem for an equiintegrable sequence.\<close>
    77 text\<open> Main limit theorem for an equiintegrable sequence.\<close>
    78 
    78 
    79 theorem%important equiintegrable_limit:
    79 theorem equiintegrable_limit:
    80   fixes g :: "'a :: euclidean_space \<Rightarrow> 'b :: banach"
    80   fixes g :: "'a :: euclidean_space \<Rightarrow> 'b :: banach"
    81   assumes feq: "range f equiintegrable_on cbox a b"
    81   assumes feq: "range f equiintegrable_on cbox a b"
    82       and to_g: "\<And>x. x \<in> cbox a b \<Longrightarrow> (\<lambda>n. f n x) \<longlonglongrightarrow> g x"
    82       and to_g: "\<And>x. x \<in> cbox a b \<Longrightarrow> (\<lambda>n. f n x) \<longlonglongrightarrow> g x"
    83     shows "g integrable_on cbox a b \<and> (\<lambda>n. integral (cbox a b) (f n)) \<longlonglongrightarrow> integral (cbox a b) g"
    83     shows "g integrable_on cbox a b \<and> (\<lambda>n. integral (cbox a b) (f n)) \<longlonglongrightarrow> integral (cbox a b) g"
    84 proof%unimportant -
    84 proof -
    85   have "Cauchy (\<lambda>n. integral(cbox a b) (f n))"
    85   have "Cauchy (\<lambda>n. integral(cbox a b) (f n))"
    86   proof (clarsimp simp add: Cauchy_def)
    86   proof (clarsimp simp add: Cauchy_def)
    87     fix e::real
    87     fix e::real
    88     assume "0 < e"
    88     assume "0 < e"
    89     then have e3: "0 < e/3"
    89     then have e3: "0 < e/3"
   149   with L show ?thesis
   149   with L show ?thesis
   150     by (simp add: \<open>(\<lambda>n. integral (cbox a b) (f n)) \<longlonglongrightarrow> L\<close> has_integral_integrable_integral)
   150     by (simp add: \<open>(\<lambda>n. integral (cbox a b) (f n)) \<longlonglongrightarrow> L\<close> has_integral_integrable_integral)
   151 qed
   151 qed
   152 
   152 
   153 
   153 
   154 lemma%important equiintegrable_reflect:
   154 lemma equiintegrable_reflect:
   155   assumes "F equiintegrable_on cbox a b"
   155   assumes "F equiintegrable_on cbox a b"
   156   shows "(\<lambda>f. f \<circ> uminus) ` F equiintegrable_on cbox (-b) (-a)"
   156   shows "(\<lambda>f. f \<circ> uminus) ` F equiintegrable_on cbox (-b) (-a)"
   157 proof%unimportant -
   157 proof -
   158   have "\<exists>\<gamma>. gauge \<gamma> \<and>
   158   have "\<exists>\<gamma>. gauge \<gamma> \<and>
   159             (\<forall>f \<D>. f \<in> (\<lambda>f. f \<circ> uminus) ` F \<and> \<D> tagged_division_of cbox (- b) (- a) \<and> \<gamma> fine \<D> \<longrightarrow>
   159             (\<forall>f \<D>. f \<in> (\<lambda>f. f \<circ> uminus) ` F \<and> \<D> tagged_division_of cbox (- b) (- a) \<and> \<gamma> fine \<D> \<longrightarrow>
   160                    norm ((\<Sum>(x,K) \<in> \<D>. content K *\<^sub>R f x) - integral (cbox (- b) (- a)) f) < e)"
   160                    norm ((\<Sum>(x,K) \<in> \<D>. content K *\<^sub>R f x) - integral (cbox (- b) (- a)) f) < e)"
   161        if "gauge \<gamma>" and
   161        if "gauge \<gamma>" and
   162            \<gamma>: "\<And>f \<D>. \<lbrakk>f \<in> F; \<D> tagged_division_of cbox a b; \<gamma> fine \<D>\<rbrakk> \<Longrightarrow>
   162            \<gamma>: "\<And>f \<D>. \<lbrakk>f \<in> F; \<D> tagged_division_of cbox a b; \<gamma> fine \<D>\<rbrakk> \<Longrightarrow>
   244     using prod.subset_diff [of "{i}" Basis] assms
   244     using prod.subset_diff [of "{i}" Basis] assms
   245       by (force simp: content_cbox_if divide_simps  split: if_split_asm)
   245       by (force simp: content_cbox_if divide_simps  split: if_split_asm)
   246 qed
   246 qed
   247 
   247 
   248 
   248 
   249 lemma%important content_division_lemma1:
   249 lemma content_division_lemma1:
   250   assumes div: "\<D> division_of S" and S: "S \<subseteq> cbox a b" and i: "i \<in> Basis"
   250   assumes div: "\<D> division_of S" and S: "S \<subseteq> cbox a b" and i: "i \<in> Basis"
   251       and mt: "\<And>K. K \<in> \<D> \<Longrightarrow> content K \<noteq> 0"
   251       and mt: "\<And>K. K \<in> \<D> \<Longrightarrow> content K \<noteq> 0"
   252       and disj: "(\<forall>K \<in> \<D>. K \<inter> {x. x \<bullet> i = a \<bullet> i} \<noteq> {}) \<or> (\<forall>K \<in> \<D>. K \<inter> {x. x \<bullet> i = b \<bullet> i} \<noteq> {})"
   252       and disj: "(\<forall>K \<in> \<D>. K \<inter> {x. x \<bullet> i = a \<bullet> i} \<noteq> {}) \<or> (\<forall>K \<in> \<D>. K \<inter> {x. x \<bullet> i = b \<bullet> i} \<noteq> {})"
   253    shows "(b \<bullet> i - a \<bullet> i) * (\<Sum>K\<in>\<D>. content K / (interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i))
   253    shows "(b \<bullet> i - a \<bullet> i) * (\<Sum>K\<in>\<D>. content K / (interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i))
   254           \<le> content(cbox a b)"   (is "?lhs \<le> ?rhs")
   254           \<le> content(cbox a b)"   (is "?lhs \<le> ?rhs")
   255 proof%unimportant -
   255 proof -
   256   have "finite \<D>"
   256   have "finite \<D>"
   257     using div by blast
   257     using div by blast
   258   define extend where
   258   define extend where
   259     "extend \<equiv> \<lambda>K. cbox (\<Sum>j \<in> Basis. if j = i then (a \<bullet> i) *\<^sub>R i else (interval_lowerbound K \<bullet> j) *\<^sub>R j)
   259     "extend \<equiv> \<lambda>K. cbox (\<Sum>j \<in> Basis. if j = i then (a \<bullet> i) *\<^sub>R i else (interval_lowerbound K \<bullet> j) *\<^sub>R j)
   260                        (\<Sum>j \<in> Basis. if j = i then (b \<bullet> i) *\<^sub>R i else (interval_upperbound K \<bullet> j) *\<^sub>R j)"
   260                        (\<Sum>j \<in> Basis. if j = i then (b \<bullet> i) *\<^sub>R i else (interval_upperbound K \<bullet> j) *\<^sub>R j)"
   407   qed
   407   qed
   408   finally show ?thesis .
   408   finally show ?thesis .
   409 qed
   409 qed
   410 
   410 
   411 
   411 
   412 proposition%important sum_content_area_over_thin_division:
   412 proposition sum_content_area_over_thin_division:
   413   assumes div: "\<D> division_of S" and S: "S \<subseteq> cbox a b" and i: "i \<in> Basis"
   413   assumes div: "\<D> division_of S" and S: "S \<subseteq> cbox a b" and i: "i \<in> Basis"
   414     and "a \<bullet> i \<le> c" "c \<le> b \<bullet> i"
   414     and "a \<bullet> i \<le> c" "c \<le> b \<bullet> i"
   415     and nonmt: "\<And>K. K \<in> \<D> \<Longrightarrow> K \<inter> {x. x \<bullet> i = c} \<noteq> {}"
   415     and nonmt: "\<And>K. K \<in> \<D> \<Longrightarrow> K \<inter> {x. x \<bullet> i = c} \<noteq> {}"
   416   shows "(b \<bullet> i - a \<bullet> i) * (\<Sum>K\<in>\<D>. content K / (interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i))
   416   shows "(b \<bullet> i - a \<bullet> i) * (\<Sum>K\<in>\<D>. content K / (interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i))
   417           \<le> 2 * content(cbox a b)"
   417           \<le> 2 * content(cbox a b)"
   418 proof%unimportant (cases "content(cbox a b) = 0")
   418 proof (cases "content(cbox a b) = 0")
   419   case True
   419   case True
   420   have "(\<Sum>K\<in>\<D>. content K / (interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i)) = 0"
   420   have "(\<Sum>K\<in>\<D>. content K / (interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i)) = 0"
   421     using S div by (force intro!: sum.neutral content_0_subset [OF True])
   421     using S div by (force intro!: sum.neutral content_0_subset [OF True])
   422   then show ?thesis
   422   then show ?thesis
   423     by (auto simp: True)
   423     by (auto simp: True)
   607 qed
   607 qed
   608 
   608 
   609 
   609 
   610 
   610 
   611 
   611 
   612 proposition%important bounded_equiintegral_over_thin_tagged_partial_division:
   612 proposition bounded_equiintegral_over_thin_tagged_partial_division:
   613   fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
   613   fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
   614   assumes F: "F equiintegrable_on cbox a b" and f: "f \<in> F" and "0 < \<epsilon>"
   614   assumes F: "F equiintegrable_on cbox a b" and f: "f \<in> F" and "0 < \<epsilon>"
   615       and norm_f: "\<And>h x. \<lbrakk>h \<in> F; x \<in> cbox a b\<rbrakk> \<Longrightarrow> norm(h x) \<le> norm(f x)"
   615       and norm_f: "\<And>h x. \<lbrakk>h \<in> F; x \<in> cbox a b\<rbrakk> \<Longrightarrow> norm(h x) \<le> norm(f x)"
   616   obtains \<gamma> where "gauge \<gamma>"
   616   obtains \<gamma> where "gauge \<gamma>"
   617              "\<And>c i S h. \<lbrakk>c \<in> cbox a b; i \<in> Basis; S tagged_partial_division_of cbox a b;
   617              "\<And>c i S h. \<lbrakk>c \<in> cbox a b; i \<in> Basis; S tagged_partial_division_of cbox a b;
   618                          \<gamma> fine S; h \<in> F; \<And>x K. (x,K) \<in> S \<Longrightarrow> (K \<inter> {x. x \<bullet> i = c \<bullet> i} \<noteq> {})\<rbrakk>
   618                          \<gamma> fine S; h \<in> F; \<And>x K. (x,K) \<in> S \<Longrightarrow> (K \<inter> {x. x \<bullet> i = c \<bullet> i} \<noteq> {})\<rbrakk>
   619                         \<Longrightarrow> (\<Sum>(x,K) \<in> S. norm (integral K h)) < \<epsilon>"
   619                         \<Longrightarrow> (\<Sum>(x,K) \<in> S. norm (integral K h)) < \<epsilon>"
   620 proof%unimportant (cases "content(cbox a b) = 0")
   620 proof (cases "content(cbox a b) = 0")
   621   case True
   621   case True
   622   show ?thesis
   622   show ?thesis
   623   proof
   623   proof
   624     show "gauge (\<lambda>x. ball x 1)"
   624     show "gauge (\<lambda>x. ball x 1)"
   625       by (simp add: gauge_trivial)
   625       by (simp add: gauge_trivial)
   811   ultimately show ?thesis using that by auto
   811   ultimately show ?thesis using that by auto
   812 qed
   812 qed
   813 
   813 
   814 
   814 
   815 
   815 
   816 proposition%important equiintegrable_halfspace_restrictions_le:
   816 proposition equiintegrable_halfspace_restrictions_le:
   817   fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
   817   fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
   818   assumes F: "F equiintegrable_on cbox a b" and f: "f \<in> F"
   818   assumes F: "F equiintegrable_on cbox a b" and f: "f \<in> F"
   819     and norm_f: "\<And>h x. \<lbrakk>h \<in> F; x \<in> cbox a b\<rbrakk> \<Longrightarrow> norm(h x) \<le> norm(f x)"
   819     and norm_f: "\<And>h x. \<lbrakk>h \<in> F; x \<in> cbox a b\<rbrakk> \<Longrightarrow> norm(h x) \<le> norm(f x)"
   820   shows "(\<Union>i \<in> Basis. \<Union>c. \<Union>h \<in> F. {(\<lambda>x. if x \<bullet> i \<le> c then h x else 0)})
   820   shows "(\<Union>i \<in> Basis. \<Union>c. \<Union>h \<in> F. {(\<lambda>x. if x \<bullet> i \<le> c then h x else 0)})
   821          equiintegrable_on cbox a b"
   821          equiintegrable_on cbox a b"
   822 proof%unimportant (cases "content(cbox a b) = 0")
   822 proof (cases "content(cbox a b) = 0")
   823   case True
   823   case True
   824   then show ?thesis by simp
   824   then show ?thesis by simp
   825 next
   825 next
   826   case False
   826   case False
   827   then have "content(cbox a b) > 0"
   827   then have "content(cbox a b) > 0"
  1170   qed
  1170   qed
  1171 qed
  1171 qed
  1172 
  1172 
  1173 
  1173 
  1174 
  1174 
  1175 corollary%important equiintegrable_halfspace_restrictions_ge:
  1175 corollary equiintegrable_halfspace_restrictions_ge:
  1176   fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  1176   fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  1177   assumes F: "F equiintegrable_on cbox a b" and f: "f \<in> F"
  1177   assumes F: "F equiintegrable_on cbox a b" and f: "f \<in> F"
  1178     and norm_f: "\<And>h x. \<lbrakk>h \<in> F; x \<in> cbox a b\<rbrakk> \<Longrightarrow> norm(h x) \<le> norm(f x)"
  1178     and norm_f: "\<And>h x. \<lbrakk>h \<in> F; x \<in> cbox a b\<rbrakk> \<Longrightarrow> norm(h x) \<le> norm(f x)"
  1179   shows "(\<Union>i \<in> Basis. \<Union>c. \<Union>h \<in> F. {(\<lambda>x. if x \<bullet> i \<ge> c then h x else 0)})
  1179   shows "(\<Union>i \<in> Basis. \<Union>c. \<Union>h \<in> F. {(\<lambda>x. if x \<bullet> i \<ge> c then h x else 0)})
  1180          equiintegrable_on cbox a b"
  1180          equiintegrable_on cbox a b"
  1181 proof%unimportant -
  1181 proof -
  1182   have *: "(\<Union>i\<in>Basis. \<Union>c. \<Union>h\<in>(\<lambda>f. f \<circ> uminus) ` F. {\<lambda>x. if x \<bullet> i \<le> c then h x else 0})
  1182   have *: "(\<Union>i\<in>Basis. \<Union>c. \<Union>h\<in>(\<lambda>f. f \<circ> uminus) ` F. {\<lambda>x. if x \<bullet> i \<le> c then h x else 0})
  1183            equiintegrable_on  cbox (- b) (- a)"
  1183            equiintegrable_on  cbox (- b) (- a)"
  1184   proof (rule equiintegrable_halfspace_restrictions_le)
  1184   proof (rule equiintegrable_halfspace_restrictions_le)
  1185     show "(\<lambda>f. f \<circ> uminus) ` F equiintegrable_on cbox (- b) (- a)"
  1185     show "(\<lambda>f. f \<circ> uminus) ` F equiintegrable_on cbox (- b) (- a)"
  1186       using F equiintegrable_reflect by blast
  1186       using F equiintegrable_reflect by blast
  1201   show ?thesis
  1201   show ?thesis
  1202     using equiintegrable_reflect [OF *] by (auto simp: eq)
  1202     using equiintegrable_reflect [OF *] by (auto simp: eq)
  1203 qed
  1203 qed
  1204 
  1204 
  1205 
  1205 
  1206 proposition%important equiintegrable_closed_interval_restrictions:
  1206 proposition equiintegrable_closed_interval_restrictions:
  1207   fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  1207   fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  1208   assumes f: "f integrable_on cbox a b"
  1208   assumes f: "f integrable_on cbox a b"
  1209   shows "(\<Union>c d. {(\<lambda>x. if x \<in> cbox c d then f x else 0)}) equiintegrable_on cbox a b"
  1209   shows "(\<Union>c d. {(\<lambda>x. if x \<in> cbox c d then f x else 0)}) equiintegrable_on cbox a b"
  1210 proof%unimportant -
  1210 proof -
  1211   let ?g = "\<lambda>B c d x. if \<forall>i\<in>B. c \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> d \<bullet> i then f x else 0"
  1211   let ?g = "\<lambda>B c d x. if \<forall>i\<in>B. c \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> d \<bullet> i then f x else 0"
  1212   have *: "insert f (\<Union>c d. {?g B c d}) equiintegrable_on cbox a b" if "B \<subseteq> Basis" for B
  1212   have *: "insert f (\<Union>c d. {?g B c d}) equiintegrable_on cbox a b" if "B \<subseteq> Basis" for B
  1213   proof -
  1213   proof -
  1214     have "finite B"
  1214     have "finite B"
  1215       using finite_Basis finite_subset \<open>B \<subseteq> Basis\<close> by blast
  1215       using finite_Basis finite_subset \<open>B \<subseteq> Basis\<close> by blast
  1264   
  1264   
  1265 
  1265 
  1266 
  1266 
  1267 subsection%important\<open>Continuity of the indefinite integral\<close>
  1267 subsection%important\<open>Continuity of the indefinite integral\<close>
  1268 
  1268 
  1269 proposition%important indefinite_integral_continuous:
  1269 proposition indefinite_integral_continuous:
  1270   fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: euclidean_space"
  1270   fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: euclidean_space"
  1271   assumes int_f: "f integrable_on cbox a b"
  1271   assumes int_f: "f integrable_on cbox a b"
  1272       and c: "c \<in> cbox a b" and d: "d \<in> cbox a b" "0 < \<epsilon>"
  1272       and c: "c \<in> cbox a b" and d: "d \<in> cbox a b" "0 < \<epsilon>"
  1273   obtains \<delta> where "0 < \<delta>"
  1273   obtains \<delta> where "0 < \<delta>"
  1274               "\<And>c' d'. \<lbrakk>c' \<in> cbox a b; d' \<in> cbox a b; norm(c' - c) \<le> \<delta>; norm(d' - d) \<le> \<delta>\<rbrakk>
  1274               "\<And>c' d'. \<lbrakk>c' \<in> cbox a b; d' \<in> cbox a b; norm(c' - c) \<le> \<delta>; norm(d' - d) \<le> \<delta>\<rbrakk>
  1275                         \<Longrightarrow> norm(integral(cbox c' d') f - integral(cbox c d) f) < \<epsilon>"
  1275                         \<Longrightarrow> norm(integral(cbox c' d') f - integral(cbox c d) f) < \<epsilon>"
  1276 proof%unimportant -
  1276 proof -
  1277   { assume "\<exists>c' d'. c' \<in> cbox a b \<and> d' \<in> cbox a b \<and> norm(c' - c) \<le> \<delta> \<and> norm(d' - d) \<le> \<delta> \<and>
  1277   { assume "\<exists>c' d'. c' \<in> cbox a b \<and> d' \<in> cbox a b \<and> norm(c' - c) \<le> \<delta> \<and> norm(d' - d) \<le> \<delta> \<and>
  1278                     norm(integral(cbox c' d') f - integral(cbox c d) f) \<ge> \<epsilon>"
  1278                     norm(integral(cbox c' d') f - integral(cbox c d) f) \<ge> \<epsilon>"
  1279                     (is "\<exists>c' d'. ?\<Phi> c' d' \<delta>") if "0 < \<delta>" for \<delta>
  1279                     (is "\<exists>c' d'. ?\<Phi> c' d' \<delta>") if "0 < \<delta>" for \<delta>
  1280     then have "\<exists>c' d'. ?\<Phi> c' d' (1 / Suc n)" for n
  1280     then have "\<exists>c' d'. ?\<Phi> c' d' (1 / Suc n)" for n
  1281       by simp
  1281       by simp
  1356   }
  1356   }
  1357   then show ?thesis
  1357   then show ?thesis
  1358     by (meson not_le that)
  1358     by (meson not_le that)
  1359 qed
  1359 qed
  1360 
  1360 
  1361 corollary%important indefinite_integral_uniformly_continuous:
  1361 corollary indefinite_integral_uniformly_continuous:
  1362   fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: euclidean_space"
  1362   fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: euclidean_space"
  1363   assumes "f integrable_on cbox a b"
  1363   assumes "f integrable_on cbox a b"
  1364   shows "uniformly_continuous_on (cbox (Pair a a) (Pair b b)) (\<lambda>y. integral (cbox (fst y) (snd y)) f)"
  1364   shows "uniformly_continuous_on (cbox (Pair a a) (Pair b b)) (\<lambda>y. integral (cbox (fst y) (snd y)) f)"
  1365 proof%unimportant -
  1365 proof -
  1366   show ?thesis
  1366   show ?thesis
  1367   proof (rule compact_uniformly_continuous, clarsimp simp add: continuous_on_iff)
  1367   proof (rule compact_uniformly_continuous, clarsimp simp add: continuous_on_iff)
  1368     fix c d and \<epsilon>::real
  1368     fix c d and \<epsilon>::real
  1369     assume c: "c \<in> cbox a b" and d: "d \<in> cbox a b" and "0 < \<epsilon>"
  1369     assume c: "c \<in> cbox a b" and d: "d \<in> cbox a b" and "0 < \<epsilon>"
  1370     obtain \<delta> where "0 < \<delta>" and \<delta>:
  1370     obtain \<delta> where "0 < \<delta>" and \<delta>:
  1381       by (force simp: dist_norm intro: \<delta> order_trans [OF norm_fst_le] order_trans [OF norm_snd_le] less_imp_le)
  1381       by (force simp: dist_norm intro: \<delta> order_trans [OF norm_fst_le] order_trans [OF norm_snd_le] less_imp_le)
  1382   qed auto
  1382   qed auto
  1383 qed
  1383 qed
  1384 
  1384 
  1385 
  1385 
  1386 corollary%important bounded_integrals_over_subintervals:
  1386 corollary bounded_integrals_over_subintervals:
  1387   fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: euclidean_space"
  1387   fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: euclidean_space"
  1388   assumes "f integrable_on cbox a b"
  1388   assumes "f integrable_on cbox a b"
  1389   shows "bounded {integral (cbox c d) f |c d. cbox c d \<subseteq> cbox a b}"
  1389   shows "bounded {integral (cbox c d) f |c d. cbox c d \<subseteq> cbox a b}"
  1390 proof%unimportant -
  1390 proof -
  1391   have "bounded ((\<lambda>y. integral (cbox (fst y) (snd y)) f) ` cbox (a, a) (b, b))"
  1391   have "bounded ((\<lambda>y. integral (cbox (fst y) (snd y)) f) ` cbox (a, a) (b, b))"
  1392        (is "bounded ?I")
  1392        (is "bounded ?I")
  1393     by (blast intro: bounded_cbox bounded_uniformly_continuous_image indefinite_integral_uniformly_continuous [OF assms])
  1393     by (blast intro: bounded_cbox bounded_uniformly_continuous_image indefinite_integral_uniformly_continuous [OF assms])
  1394   then obtain B where "B > 0" and B: "\<And>x. x \<in> ?I \<Longrightarrow> norm x \<le> B"
  1394   then obtain B where "B > 0" and B: "\<And>x. x \<in> ?I \<Longrightarrow> norm x \<le> B"
  1395     by (auto simp: bounded_pos)
  1395     by (auto simp: bounded_pos)
  1412 text\<open>An existence theorem for "improper" integrals.
  1412 text\<open>An existence theorem for "improper" integrals.
  1413 Hake's theorem implies that if the integrals over subintervals have a limit, the integral exists.
  1413 Hake's theorem implies that if the integrals over subintervals have a limit, the integral exists.
  1414 We only need to assume that the integrals are bounded, and we get absolute integrability,
  1414 We only need to assume that the integrals are bounded, and we get absolute integrability,
  1415 but we also need a (rather weak) bound assumption on the function.\<close>
  1415 but we also need a (rather weak) bound assumption on the function.\<close>
  1416 
  1416 
  1417 theorem%important absolutely_integrable_improper:
  1417 theorem absolutely_integrable_improper:
  1418   fixes f :: "'M::euclidean_space \<Rightarrow> 'N::euclidean_space"
  1418   fixes f :: "'M::euclidean_space \<Rightarrow> 'N::euclidean_space"
  1419   assumes int_f: "\<And>c d. cbox c d \<subseteq> box a b \<Longrightarrow> f integrable_on cbox c d"
  1419   assumes int_f: "\<And>c d. cbox c d \<subseteq> box a b \<Longrightarrow> f integrable_on cbox c d"
  1420       and bo: "bounded {integral (cbox c d) f |c d. cbox c d \<subseteq> box a b}"
  1420       and bo: "bounded {integral (cbox c d) f |c d. cbox c d \<subseteq> box a b}"
  1421       and absi: "\<And>i. i \<in> Basis
  1421       and absi: "\<And>i. i \<in> Basis
  1422           \<Longrightarrow> \<exists>g. g absolutely_integrable_on cbox a b \<and>
  1422           \<Longrightarrow> \<exists>g. g absolutely_integrable_on cbox a b \<and>
  1423                   ((\<forall>x \<in> cbox a b. f x \<bullet> i \<le> g x) \<or> (\<forall>x \<in> cbox a b. f x \<bullet> i \<ge> g x))"
  1423                   ((\<forall>x \<in> cbox a b. f x \<bullet> i \<le> g x) \<or> (\<forall>x \<in> cbox a b. f x \<bullet> i \<ge> g x))"
  1424       shows "f absolutely_integrable_on cbox a b"
  1424       shows "f absolutely_integrable_on cbox a b"
  1425 proof%unimportant (cases "content(cbox a b) = 0")
  1425 proof (cases "content(cbox a b) = 0")
  1426   case True
  1426   case True
  1427   then show ?thesis
  1427   then show ?thesis
  1428     by auto
  1428     by auto
  1429 next
  1429 next
  1430   case False
  1430   case False