src/HOL/Analysis/Henstock_Kurzweil_Integration.thy
changeset 66437 b868bb15edbe
parent 66429 beaeb40a1217
child 66487 307c19f24d5c
equal deleted inserted replaced
66431:8416c3a7a140 66437:b868bb15edbe
  5668 lemma henstock_lemma_part1:
  5668 lemma henstock_lemma_part1:
  5669   fixes f :: "'n::euclidean_space \<Rightarrow> 'a::banach"
  5669   fixes f :: "'n::euclidean_space \<Rightarrow> 'a::banach"
  5670   assumes "f integrable_on cbox a b"
  5670   assumes "f integrable_on cbox a b"
  5671     and "e > 0"
  5671     and "e > 0"
  5672     and "gauge d"
  5672     and "gauge d"
  5673     and "(\<forall>p. p tagged_division_of (cbox a b) \<and> d fine p \<longrightarrow>
  5673     and less_e: "\<And>p. \<lbrakk>p tagged_division_of (cbox a b); d fine p\<rbrakk> \<Longrightarrow>
  5674       norm (sum (\<lambda>(x,k). content k *\<^sub>R f x) p - integral(cbox a b) f) < e)"
  5674                      norm (sum (\<lambda>(x,K). content K *\<^sub>R f x) p - integral(cbox a b) f) < e"
  5675     and p: "p tagged_partial_division_of (cbox a b)" "d fine p"
  5675     and p: "p tagged_partial_division_of (cbox a b)" "d fine p"
  5676   shows "norm (sum (\<lambda>(x,k). content k *\<^sub>R f x - integral k f) p) \<le> e"
  5676   shows "norm (sum (\<lambda>(x,K). content K *\<^sub>R f x - integral K f) p) \<le> e"
  5677   (is "?x \<le> e")
  5677   (is "?x \<le> e")
  5678 proof -
  5678 proof -
  5679   { presume "\<And>k. 0<k \<Longrightarrow> ?x \<le> e + k" then show ?thesis by (blast intro: field_le_epsilon) }
  5679   { presume "\<And>k. 0<k \<Longrightarrow> ?x \<le> e + k" then show ?thesis by (blast intro: field_le_epsilon) }
  5680   fix k :: real
  5680   fix k :: real
  5681   assume k: "k > 0"
  5681   assume k: "k > 0"
  5718   qed
  5718   qed
  5719   from bchoice[OF this] guess qq..note qq=this[rule_format]
  5719   from bchoice[OF this] guess qq..note qq=this[rule_format]
  5720 
  5720 
  5721   let ?p = "p \<union> \<Union>(qq ` r)"
  5721   let ?p = "p \<union> \<Union>(qq ` r)"
  5722   have "norm ((\<Sum>(x, k)\<in>?p. content k *\<^sub>R f x) - integral (cbox a b) f) < e"
  5722   have "norm ((\<Sum>(x, k)\<in>?p. content k *\<^sub>R f x) - integral (cbox a b) f) < e"
  5723     apply (rule assms(4)[rule_format])
  5723   proof (rule less_e)
  5724   proof
       
  5725     show "d fine ?p"
  5724     show "d fine ?p"
  5726       apply (rule fine_Un)
  5725       by (metis (mono_tags, hide_lams) qq fine_Un fine_Union imageE p(2))
  5727       apply (rule p)
       
  5728       apply (rule fine_Union)
       
  5729       using qq
       
  5730       apply auto
       
  5731       done
       
  5732     note * = tagged_partial_division_of_union_self[OF p(1)]
  5726     note * = tagged_partial_division_of_union_self[OF p(1)]
  5733     have "p \<union> \<Union>(qq ` r) tagged_division_of \<Union>(snd ` p) \<union> \<Union>r"
  5727     have "p \<union> \<Union>(qq ` r) tagged_division_of \<Union>(snd ` p) \<union> \<Union>r"
  5734       using r
  5728       using r
  5735     proof (rule tagged_division_union[OF * tagged_division_unions], goal_cases)
  5729     proof (rule tagged_division_union[OF * tagged_division_unions], goal_cases)
  5736       case 1
  5730       case 1
  5900   finally show "?x \<le> e + k" .
  5894   finally show "?x \<le> e + k" .
  5901 qed
  5895 qed
  5902 
  5896 
  5903 lemma henstock_lemma_part2:
  5897 lemma henstock_lemma_part2:
  5904   fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
  5898   fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
  5905   assumes "f integrable_on cbox a b"
  5899   assumes fed: "f integrable_on cbox a b" "e > 0" "gauge d"
  5906     and "e > 0"
  5900     and less_e: "\<And>p. \<lbrakk>p tagged_division_of (cbox a b); d fine p\<rbrakk> \<Longrightarrow>
  5907     and "gauge d"
  5901                      norm (sum (\<lambda>(x,k). content k *\<^sub>R f x) p - integral (cbox a b) f) < e"
  5908     and "\<forall>p. p tagged_division_of (cbox a b) \<and> d fine p \<longrightarrow>
  5902     and tag: "p tagged_partial_division_of (cbox a b)"
  5909       norm (sum (\<lambda>(x,k). content k *\<^sub>R f x) p - integral (cbox a b) f) < e"
       
  5910     and "p tagged_partial_division_of (cbox a b)"
       
  5911     and "d fine p"
  5903     and "d fine p"
  5912   shows "sum (\<lambda>(x,k). norm (content k *\<^sub>R f x - integral k f)) p \<le> 2 * real (DIM('n)) * e"
  5904   shows "sum (\<lambda>(x,k). norm (content k *\<^sub>R f x - integral k f)) p \<le> 2 * real (DIM('n)) * e"
  5913   unfolding split_def
  5905 proof -
  5914   apply (rule sum_norm_allsubsets_bound)
  5906   have "finite p"
  5915   defer
  5907     using tag by blast
  5916   apply (rule henstock_lemma_part1[unfolded split_def,OF assms(1-3)])
  5908   then show ?thesis
  5917   apply safe
  5909     unfolding split_def
  5918   apply (rule assms[rule_format,unfolded split_def])
  5910   proof (rule sum_norm_allsubsets_bound)
  5919   defer
  5911     fix Q
  5920   apply (rule tagged_partial_division_subset)
  5912     assume Q: "Q \<subseteq> p"
  5921   apply (rule assms)
  5913     then have fine: "d fine Q"
  5922   apply assumption
  5914       by (simp add: \<open>d fine p\<close> fine_subset)
  5923   apply (rule fine_subset)
  5915     show "norm (\<Sum>x\<in>Q. content (snd x) *\<^sub>R f (fst x) - integral (snd x) f) \<le> e"
  5924   apply assumption
  5916       apply (rule henstock_lemma_part1[OF fed less_e, unfolded split_def])
  5925   apply (rule assms)
  5917       using Q tag tagged_partial_division_subset apply (force simp add: fine)+
  5926   using assms(5)
  5918       done
  5927   apply auto
  5919   qed
  5928   done
  5920 qed
  5929 
  5921 
  5930 lemma henstock_lemma:
  5922 lemma henstock_lemma:
  5931   fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
  5923   fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
  5932   assumes "f integrable_on cbox a b"
  5924   assumes intf: "f integrable_on cbox a b"
  5933     and "e > 0"
  5925     and "e > 0"
  5934   obtains d where "gauge d"
  5926   obtains \<gamma> where "gauge \<gamma>"
  5935     and "\<forall>p. p tagged_partial_division_of (cbox a b) \<and> d fine p \<longrightarrow>
  5927     and "\<And>p. \<lbrakk>p tagged_partial_division_of (cbox a b); \<gamma> fine p\<rbrakk> \<Longrightarrow>
  5936       sum (\<lambda>(x,k). norm(content k *\<^sub>R f x - integral k f)) p < e"
  5928              sum (\<lambda>(x,k). norm(content k *\<^sub>R f x - integral k f)) p < e"
  5937 proof -
  5929 proof -
  5938   have *: "e / (2 * (real DIM('n) + 1)) > 0" using assms(2) by simp
  5930   have *: "e / (2 * (real DIM('n) + 1)) > 0" using \<open>e > 0\<close> by simp
  5939   from integrable_integral[OF assms(1),unfolded has_integral[of f],rule_format,OF this]
  5931   with integrable_integral[OF intf, unfolded has_integral]
  5940   guess d..note d = conjunctD2[OF this]
  5932   obtain \<gamma> where "gauge \<gamma>"
       
  5933     and \<gamma>: "\<And>p. \<lbrakk>p tagged_division_of cbox a b; \<gamma> fine p\<rbrakk> \<Longrightarrow>
       
  5934          norm ((\<Sum>(x,K)\<in>p. content K *\<^sub>R f x) - integral (cbox a b) f)
       
  5935          < e / (2 * (real DIM('n) + 1))"
       
  5936     by metis
  5941   show thesis
  5937   show thesis
  5942     apply (rule that)
  5938   proof (rule that [OF \<open>gauge \<gamma>\<close>])
  5943     apply (rule d)
  5939     fix p
  5944   proof (safe, goal_cases)
  5940     assume p: "p tagged_partial_division_of cbox a b" "\<gamma> fine p"
  5945     case (1 p)
  5941     have "(\<Sum>(x,K)\<in>p. norm (content K *\<^sub>R f x - integral K f)) 
  5946     note * = henstock_lemma_part2[OF assms(1) * d this]
  5942           \<le> 2 * real DIM('n) * (e / (2 * (real DIM('n) + 1)))"
  5947     show ?case
  5943       using henstock_lemma_part2[OF intf * \<open>gauge \<gamma>\<close> \<gamma> p] by metis
  5948       apply (rule le_less_trans[OF *])
  5944     also have "... < e"
  5949       using \<open>e > 0\<close>
  5945       using \<open>e > 0\<close> by (auto simp add: field_simps)
  5950       apply (auto simp add: field_simps)
  5946     finally
  5951       done
  5947     show "(\<Sum>(x,K)\<in>p. norm (content K *\<^sub>R f x - integral K f)) < e" .
  5952   qed
  5948   qed
  5953 qed
  5949 qed
  5954 
  5950 
  5955 
  5951 
  5956 subsection \<open>Monotone convergence (bounded interval first)\<close>
  5952 subsection \<open>Monotone convergence (bounded interval first)\<close>
  6116               unfolding power2_eq_square
  6112               unfolding power2_eq_square
  6117               apply auto
  6113               apply auto
  6118               done
  6114               done
  6119             fix t
  6115             fix t
  6120             assume "t \<in> {0..s}"
  6116             assume "t \<in> {0..s}"
  6121             show "norm (\<Sum>(x, k)\<in>{xk \<in> p. m (fst xk) = t}. content k *\<^sub>R f (m x) x -
  6117             have "norm (\<Sum>(x,k)\<in>{xk \<in> p. m (fst xk) = t}. content k *\<^sub>R f (m x) x - integral k (f (m x))) =
  6122               integral k (f (m x))) \<le> e/2 ^ (t + 2)"
  6118                   norm (\<Sum>(x,k)\<in>{xk \<in> p. m (fst xk) = t}. content k *\<^sub>R f t x - integral k (f t))"
  6123               apply (rule order_trans
  6119               by (force intro!: sum.cong arg_cong[where f=norm])
  6124                 [of _ "norm (sum (\<lambda>(x,k). content k *\<^sub>R f t x - integral k (f t)) {xk \<in> p. m (fst xk) = t})"])
  6120             also have "... \<le> e/2 ^ (t + 2)"
  6125               apply (rule eq_refl)
  6121             proof (rule henstock_lemma_part1 [OF intf _ c])
  6126               apply (rule arg_cong[where f=norm])
  6122               show "{xk \<in> p. m (fst xk) = t} tagged_partial_division_of cbox a b"
  6127               apply (rule sum.cong)
  6123                 apply (rule tagged_partial_division_subset[of p])
  6128               apply (rule refl)
  6124                 using p by (auto simp: tagged_division_of_def)
  6129               defer
  6125               show "c t fine {xk \<in> p. m (fst xk) = t}"
  6130               apply (rule henstock_lemma_part1)
  6126                 using p(2) by (auto simp: fine_def d_def)
  6131               apply (rule assms(1)[rule_format])
  6127             qed (auto simp: e)
  6132               apply (simp add: e)
  6128             finally show "norm (\<Sum>(x, k)\<in>{xk \<in> p. m (fst xk) = t}. content k *\<^sub>R f (m x) x -
  6133               apply safe
  6129               integral k (f (m x))) \<le> e/2 ^ (t + 2)" .
  6134               apply (rule c)+
       
  6135               apply assumption+
       
  6136               apply (rule tagged_partial_division_subset[of p])
       
  6137               apply (rule p(1)[unfolded tagged_division_of_def,THEN conjunct1])
       
  6138               defer
       
  6139               unfolding fine_def
       
  6140               apply safe
       
  6141               apply (drule p(2)[unfolded fine_def,rule_format])
       
  6142               unfolding d_def
       
  6143               apply auto
       
  6144               done
       
  6145           qed
  6130           qed
  6146         qed (insert s, auto)
  6131         qed (insert s, auto)
  6147       next
  6132       next
  6148         case 3
  6133         case 3
  6149         note comb = integral_combine_tagged_division_topdown[OF assms(1)[rule_format] p(1)]
  6134         note comb = integral_combine_tagged_division_topdown[OF assms(1)[rule_format] p(1)]