src/HOL/Analysis/Henstock_Kurzweil_Integration.thy
changeset 66089 def95e0bc529
parent 65680 378a2f11bec9
child 66112 0e640e04fc56
equal deleted inserted replaced
66088:c9c9438cfc0f 66089:def95e0bc529
    53   by simp
    53   by simp
    54 
    54 
    55 lemma content_unit[iff]: "content (cbox 0 (One::'a::euclidean_space)) = 1"
    55 lemma content_unit[iff]: "content (cbox 0 (One::'a::euclidean_space)) = 1"
    56   by simp
    56   by simp
    57 
    57 
    58 lemma content_pos_le[intro]: "0 \<le> content (cbox a b)"
    58 lemma content_pos_le [iff]: "0 \<le> content X"
    59   by simp
    59   by simp
    60 
    60 
    61 corollary content_nonneg [simp]: "~ content (cbox a b) < 0"
    61 corollary content_nonneg [simp]: "~ content (cbox a b) < 0"
    62   using not_le by blast
    62   using not_le by blast
    63 
    63 
   155   by (metis antisym_conv assms content_pos_le content_subset division_ofD(2))
   155   by (metis antisym_conv assms content_pos_le content_subset division_ofD(2))
   156 
   156 
   157 lemma sum_content_null:
   157 lemma sum_content_null:
   158   assumes "content (cbox a b) = 0"
   158   assumes "content (cbox a b) = 0"
   159     and "p tagged_division_of (cbox a b)"
   159     and "p tagged_division_of (cbox a b)"
   160   shows "sum (\<lambda>(x,k). content k *\<^sub>R f x) p = (0::'a::real_normed_vector)"
   160   shows "(\<Sum>(x,k)\<in>p. content k *\<^sub>R f x) = (0::'a::real_normed_vector)"
   161 proof (rule sum.neutral, rule)
   161 proof (rule sum.neutral, rule)
   162   fix y
   162   fix y
   163   assume y: "y \<in> p"
   163   assume y: "y \<in> p"
   164   obtain x k where xk: "y = (x, k)"
   164   obtain x k where xk: "y = (x, k)"
   165     using surj_pair[of y] by blast
   165     using surj_pair[of y] by blast
   166   note assm = tagged_division_ofD(3-4)[OF assms(2) y[unfolded xk]]
   166   then obtain c d where k: "k = cbox c d" "k \<subseteq> cbox a b"
   167   from this(2) obtain c d where k: "k = cbox c d" by blast
   167     by (metis assms(2) tagged_division_ofD(3) tagged_division_ofD(4) y)
   168   have "(\<lambda>(x, k). content k *\<^sub>R f x) y = content k *\<^sub>R f x"
   168   have "(\<lambda>(x, k). content k *\<^sub>R f x) y = content k *\<^sub>R f x"
   169     unfolding xk by auto
   169     unfolding xk by auto
   170   also have "\<dots> = 0"
   170   also have "\<dots> = 0"
   171     using content_subset[OF assm(1)[unfolded k]] content_pos_le[of c d]
   171     using assms(1) content_0_subset k(2) by auto
   172     unfolding assms(1) k
       
   173     by auto
       
   174   finally show "(\<lambda>(x, k). content k *\<^sub>R f x) y = 0" .
   172   finally show "(\<lambda>(x, k). content k *\<^sub>R f x) y = 0" .
   175 qed
   173 qed
   176 
   174 
   177 lemma operative_content[intro]: "add.operative content"
   175 lemma operative_content[intro]: "add.operative content"
   178   by (force simp add: add.operative_def content_split[symmetric] content_eq_0_interior)
   176   by (force simp add: add.operative_def content_split[symmetric] content_eq_0_interior)
   443 qed
   441 qed
   444 
   442 
   445 lemma has_integral_scaleR_left:
   443 lemma has_integral_scaleR_left:
   446   "(f has_integral y) s \<Longrightarrow> ((\<lambda>x. f x *\<^sub>R c) has_integral (y *\<^sub>R c)) s"
   444   "(f has_integral y) s \<Longrightarrow> ((\<lambda>x. f x *\<^sub>R c) has_integral (y *\<^sub>R c)) s"
   447   using has_integral_linear[OF _ bounded_linear_scaleR_left] by (simp add: comp_def)
   445   using has_integral_linear[OF _ bounded_linear_scaleR_left] by (simp add: comp_def)
       
   446 
       
   447 lemma integrable_on_scaleR_left:
       
   448   assumes "f integrable_on A" 
       
   449   shows "(\<lambda>x. f x *\<^sub>R y) integrable_on A" 
       
   450   using assms has_integral_scaleR_left unfolding integrable_on_def by blast
   448 
   451 
   449 lemma has_integral_mult_left:
   452 lemma has_integral_mult_left:
   450   fixes c :: "_ :: real_normed_algebra"
   453   fixes c :: "_ :: real_normed_algebra"
   451   shows "(f has_integral y) s \<Longrightarrow> ((\<lambda>x. f x * c) has_integral (y * c)) s"
   454   shows "(f has_integral y) s \<Longrightarrow> ((\<lambda>x. f x * c) has_integral (y * c)) s"
   452   using has_integral_linear[OF _ bounded_linear_mult_left] by (simp add: comp_def)
   455   using has_integral_linear[OF _ bounded_linear_mult_left] by (simp add: comp_def)
   668   "\<lbrakk>finite t;  \<forall>a\<in>t. (f a) integrable_on s\<rbrakk> \<Longrightarrow>
   671   "\<lbrakk>finite t;  \<forall>a\<in>t. (f a) integrable_on s\<rbrakk> \<Longrightarrow>
   669    integral s (\<lambda>x. sum (\<lambda>a. f a x) t) = sum (\<lambda>a. integral s (f a)) t"
   672    integral s (\<lambda>x. sum (\<lambda>a. f a x) t) = sum (\<lambda>a. integral s (f a)) t"
   670   by (auto intro: has_integral_sum integrable_integral)
   673   by (auto intro: has_integral_sum integrable_integral)
   671 
   674 
   672 lemma integrable_sum:
   675 lemma integrable_sum:
   673   "\<lbrakk>finite t;  \<forall>a\<in>t. (f a) integrable_on s\<rbrakk> \<Longrightarrow> (\<lambda>x. sum (\<lambda>a. f a x) t) integrable_on s"
   676   "\<lbrakk>finite I;  \<And>a. a \<in> I \<Longrightarrow> f a integrable_on S\<rbrakk> \<Longrightarrow> (\<lambda>x. \<Sum>a\<in>I. f a x) integrable_on S"
   674   unfolding integrable_on_def
   677   unfolding integrable_on_def using has_integral_sum[of I] by metis
   675   apply (drule bchoice)
       
   676   using has_integral_sum[of t]
       
   677   apply auto
       
   678   done
       
   679 
   678 
   680 lemma has_integral_eq:
   679 lemma has_integral_eq:
   681   assumes "\<And>x. x \<in> s \<Longrightarrow> f x = g x"
   680   assumes "\<And>x. x \<in> s \<Longrightarrow> f x = g x"
   682     and "(f has_integral k) s"
   681     and "(f has_integral k) s"
   683   shows "(g has_integral k) s"
   682   shows "(g has_integral k) s"
  5491       unfolding sum_subtractf[symmetric]
  5490       unfolding sum_subtractf[symmetric]
  5492       apply -
  5491       apply -
  5493       apply (rule_tac[!] sum_nonneg)
  5492       apply (rule_tac[!] sum_nonneg)
  5494       apply safe
  5493       apply safe
  5495       unfolding real_scaleR_def right_diff_distrib[symmetric]
  5494       unfolding real_scaleR_def right_diff_distrib[symmetric]
  5496       apply (rule_tac[!] mult_nonneg_nonneg)
  5495          apply (rule_tac[!] mult_nonneg_nonneg)
  5497     proof -
  5496         apply simp_all
  5498       fix a b
  5497       using obt(4) prems(1) prems(4) apply (blast intro:  elim: dest!: bspec)+
  5499       assume ab: "(a, b) \<in> p1"
       
  5500       show "0 \<le> content b"
       
  5501         using *(3)[OF ab]
       
  5502         apply safe
       
  5503         apply (rule content_pos_le)
       
  5504         done
  5498         done
  5505       then show "0 \<le> content b" .
       
  5506       show "0 \<le> f a - g a" "0 \<le> h a - f a"
       
  5507         using *(1-2)[OF ab]
       
  5508         using obt(4)[rule_format,of a]
       
  5509         by auto
       
  5510     next
       
  5511       fix a b
       
  5512       assume ab: "(a, b) \<in> p2"
       
  5513       show "0 \<le> content b"
       
  5514         using *(6)[OF ab]
       
  5515         apply safe
       
  5516         apply (rule content_pos_le)
       
  5517         done
       
  5518       then show "0 \<le> content b" .
       
  5519       show "0 \<le> f a - g a" and "0 \<le> h a - f a"
       
  5520         using *(4-5)[OF ab] using obt(4)[rule_format,of a] by auto
       
  5521     qed
       
  5522     then show ?case
  5499     then show ?case
  5523       apply -
  5500       apply -
  5524       unfolding real_norm_def
  5501       unfolding real_norm_def
  5525       apply (rule **)
  5502       apply (rule **)
  5526       defer
  5503       defer
  6315     have "\<forall>x\<in>cbox a b. \<exists>n\<ge>r. \<forall>k\<ge>n. 0 \<le> (g x)\<bullet>1 - (f k x)\<bullet>1 \<and>
  6292     have "\<forall>x\<in>cbox a b. \<exists>n\<ge>r. \<forall>k\<ge>n. 0 \<le> (g x)\<bullet>1 - (f k x)\<bullet>1 \<and>
  6316       (g x)\<bullet>1 - (f k x)\<bullet>1 < e / (4 * content(cbox a b))"
  6293       (g x)\<bullet>1 - (f k x)\<bullet>1 < e / (4 * content(cbox a b))"
  6317     proof (rule, goal_cases)
  6294     proof (rule, goal_cases)
  6318       case prems: (1 x)
  6295       case prems: (1 x)
  6319       have "e / (4 * content (cbox a b)) > 0"
  6296       have "e / (4 * content (cbox a b)) > 0"
  6320         using \<open>e>0\<close> False content_pos_le[of a b] by (simp add: less_le)
  6297         by (simp add: False content_lt_nz e)
  6321       from assms(3)[rule_format, OF prems, THEN LIMSEQ_D, OF this]
  6298       from assms(3)[rule_format, OF prems, THEN LIMSEQ_D, OF this]
  6322       guess n .. note n=this
  6299       guess n .. note n=this
  6323       then show ?case
  6300       then show ?case
  6324         apply (rule_tac x="n + r" in exI)
  6301         apply (rule_tac x="n + r" in exI)
  6325         apply safe
  6302         apply safe
  7092           (auto intro!: continuous_intros integrable_diff integrable_f2
  7069           (auto intro!: continuous_intros integrable_diff integrable_f2
  7093             intro: integrable_continuous)
  7070             intro: integrable_continuous)
  7094       also have "\<dots> = content (cbox a b) * e * norm (x - x0)"
  7071       also have "\<dots> = content (cbox a b) * e * norm (x - x0)"
  7095         by simp
  7072         by simp
  7096       also have "\<dots> < e' * norm (x - x0)"
  7073       also have "\<dots> < e' * norm (x - x0)"
  7097         using \<open>e' > 0\<close> content_pos_le[of a b]
  7074         using \<open>e' > 0\<close>
  7098         by (intro mult_strict_right_mono[OF _ \<open>0 < norm (x - x0)\<close>])
  7075         apply (intro mult_strict_right_mono[OF _ \<open>0 < norm (x - x0)\<close>])  
  7099            (auto simp: divide_simps e_def simp del: measure_nonneg)
  7076         apply  (auto simp: divide_simps e_def)
       
  7077         by (metis \<open>0 < e\<close> e_def order.asym zero_less_divide_iff)
  7100       finally have "norm (?F x - ?F x0 - ?dF (x - x0)) < e' * norm (x - x0)" .
  7078       finally have "norm (?F x - ?F x0 - ?dF (x - x0)) < e' * norm (x - x0)" .
  7101       then show ?case
  7079       then show ?case
  7102         by (auto simp: divide_simps)
  7080         by (auto simp: divide_simps)
  7103     qed
  7081     qed
  7104   qed (rule blinfun.bounded_linear_right)
  7082   qed (rule blinfun.bounded_linear_right)
  7205       fix e::real
  7183       fix e::real
  7206       assume "e > 0"
  7184       assume "e > 0"
  7207       define e' where "e' = e / 2"
  7185       define e' where "e' = e / 2"
  7208       with \<open>e > 0\<close> have "e' > 0" by simp
  7186       with \<open>e > 0\<close> have "e' > 0" by simp
  7209       then have "\<forall>\<^sub>F n in F. \<forall>x\<in>cbox a b. norm (f n x - g x) < e' / content (cbox a b)"
  7187       then have "\<forall>\<^sub>F n in F. \<forall>x\<in>cbox a b. norm (f n x - g x) < e' / content (cbox a b)"
  7210         using u content_nonzero content_pos_le[of a b]
  7188         using u content_nonzero by (auto simp: uniform_limit_iff dist_norm zero_less_measure_iff)
  7211         by (auto simp: uniform_limit_iff dist_norm simp del: measure_nonneg)
       
  7212       then show "\<forall>\<^sub>F n in F. dist (I n) J < e"
  7189       then show "\<forall>\<^sub>F n in F. dist (I n) J < e"
  7213       proof eventually_elim
  7190       proof eventually_elim
  7214         case (elim n)
  7191         case (elim n)
  7215         have "I n = integral (cbox a b) (f n)"
  7192         have "I n = integral (cbox a b) (f n)"
  7216             "J = integral (cbox a b) g"
  7193             "J = integral (cbox a b) g"