src/HOL/Analysis/Henstock_Kurzweil_Integration.thy
changeset 66193 6e6eeef63589
parent 66192 e5b84854baa4
child 66199 994322c17274
equal deleted inserted replaced
66192:e5b84854baa4 66193:6e6eeef63589
     6 
     6 
     7 theory Henstock_Kurzweil_Integration
     7 theory Henstock_Kurzweil_Integration
     8 imports
     8 imports
     9   Lebesgue_Measure Tagged_Division
     9   Lebesgue_Measure Tagged_Division
    10 begin
    10 begin
       
    11 
       
    12 (*FIXME DELETE*)
       
    13 lemma conjunctD2: assumes "a \<and> b" shows a b using assms by auto
       
    14 lemma conjunctD3: assumes "a \<and> b \<and> c" shows a b c using assms by auto
    11 
    15 
    12 (* try instead structured proofs below *)
    16 (* try instead structured proofs below *)
    13 lemma norm_diff2: "\<lbrakk>y = y1 + y2; x = x1 + x2; e = e1 + e2; norm(y1 - x1) \<le> e1; norm(y2 - x2) \<le> e2\<rbrakk>
    17 lemma norm_diff2: "\<lbrakk>y = y1 + y2; x = x1 + x2; e = e1 + e2; norm(y1 - x1) \<le> e1; norm(y2 - x2) \<le> e2\<rbrakk>
    14   \<Longrightarrow> norm(y - x) \<le> e"
    18   \<Longrightarrow> norm(y - x) \<le> e"
    15   using norm_triangle_mono [of "y1 - x1" "e1" "y2 - x2" "e2"]
    19   using norm_triangle_mono [of "y1 - x1" "e1" "y2 - x2" "e2"]
  1609       note has_integral_altD[OF _ False this]
  1613       note has_integral_altD[OF _ False this]
  1610       from this[OF assms(2)] this[OF assms(3)] guess B1 B2 . note B=this[rule_format]
  1614       from this[OF assms(2)] this[OF assms(3)] guess B1 B2 . note B=this[rule_format]
  1611       have "bounded (ball 0 B1 \<union> ball (0::'a) B2)"
  1615       have "bounded (ball 0 B1 \<union> ball (0::'a) B2)"
  1612         unfolding bounded_Un by(rule conjI bounded_ball)+
  1616         unfolding bounded_Un by(rule conjI bounded_ball)+
  1613       from bounded_subset_cbox[OF this] guess a b by (elim exE)
  1617       from bounded_subset_cbox[OF this] guess a b by (elim exE)
  1614       note ab = conjunctD2[OF this[unfolded Un_subset_iff]]
  1618       then have ab: "ball 0 B1 \<subseteq> cbox a b" "ball 0 B2 \<subseteq> cbox a b"
       
  1619         by blast+
  1615       guess w1 using B(2)[OF ab(1)] .. note w1=conjunctD2[OF this]
  1620       guess w1 using B(2)[OF ab(1)] .. note w1=conjunctD2[OF this]
  1616       guess w2 using B(4)[OF ab(2)] .. note w2=conjunctD2[OF this]
  1621       guess w2 using B(4)[OF ab(2)] .. note w2=conjunctD2[OF this]
  1617       have *: "\<And>w1 w2 j i::real .\<bar>w1 - i\<bar> < (i - j) / 3 \<Longrightarrow> \<bar>w2 - j\<bar> < (i - j) / 3 \<Longrightarrow> w1 \<le> w2 \<Longrightarrow> False"
  1622       have *: "\<And>w1 w2 j i::real .\<bar>w1 - i\<bar> < (i - j) / 3 \<Longrightarrow> \<bar>w2 - j\<bar> < (i - j) / 3 \<Longrightarrow> w1 \<le> w2 \<Longrightarrow> False"
  1618         by (simp add: abs_real_def split: if_split_asm)
  1623         by (simp add: abs_real_def split: if_split_asm)
  1619       note le_less_trans[OF Basis_le_norm[OF k]]
  1624       note le_less_trans[OF Basis_le_norm[OF k]]
  6265     note * = Lim_component_ge[OF assms(3)[rule_format, OF x] trivial_limit_sequentially]
  6270     note * = Lim_component_ge[OF assms(3)[rule_format, OF x] trivial_limit_sequentially]
  6266     show "f k x \<bullet> 1 \<le> g x \<bullet> 1"
  6271     show "f k x \<bullet> 1 \<le> g x \<bullet> 1"
  6267       apply (rule *)
  6272       apply (rule *)
  6268       unfolding eventually_sequentially
  6273       unfolding eventually_sequentially
  6269       apply (rule_tac x=k in exI)
  6274       apply (rule_tac x=k in exI)
  6270       apply -
  6275       apply clarify
  6271       apply (rule transitive_stepwise_le)
  6276       apply (rule transitive_stepwise_le)
  6272       using assms(2)[rule_format, OF x]
  6277       using assms(2)[rule_format, OF x]
  6273       apply auto
  6278       apply auto
  6274       done
  6279       done
  6275   qed
  6280   qed
  6288     apply (rule Lim_component_ge)
  6293     apply (rule Lim_component_ge)
  6289     apply (rule i)
  6294     apply (rule i)
  6290     apply (rule trivial_limit_sequentially)
  6295     apply (rule trivial_limit_sequentially)
  6291     unfolding eventually_sequentially
  6296     unfolding eventually_sequentially
  6292     apply (rule_tac x=k in exI)
  6297     apply (rule_tac x=k in exI)
  6293     apply (rule transitive_stepwise_le)
  6298     apply clarify
       
  6299     apply (erule transitive_stepwise_le)
  6294     prefer 3
  6300     prefer 3
  6295     unfolding inner_simps real_inner_1_right
  6301     unfolding inner_simps real_inner_1_right
  6296     apply (rule integral_le)
  6302     apply (rule integral_le)
  6297     apply (rule assms(1-2)[rule_format])+
  6303     apply (rule assms(1-2)[rule_format])+
  6298     using assms(2)
  6304     using assms(2)
  6488           fix y
  6494           fix y
  6489           assume "y \<in> k"
  6495           assume "y \<in> k"
  6490           then have "y \<in> cbox a b"
  6496           then have "y \<in> cbox a b"
  6491             using p'(3)[OF xk] by auto
  6497             using p'(3)[OF xk] by auto
  6492           then have *: "\<And>m. \<forall>n\<ge>m. f m y \<le> f n y"
  6498           then have *: "\<And>m. \<forall>n\<ge>m. f m y \<le> f n y"
  6493             apply -
  6499             using assms(2) by (auto intro: transitive_stepwise_le)
  6494             apply (rule transitive_stepwise_le)
       
  6495             using assms(2)
       
  6496             apply auto
       
  6497             done
       
  6498           show "f r y \<le> f (m x) y" and "f (m x) y \<le> f s y"
  6500           show "f r y \<le> f (m x) y" and "f (m x) y \<le> f s y"
  6499             apply (rule_tac[!] *[rule_format])
  6501             apply (rule_tac[!] *[rule_format])
  6500             using s[rule_format,OF xk] m(1)[of x] p'(2-3)[OF xk]
  6502             using s[rule_format,OF xk] m(1)[of x] p'(2-3)[OF xk]
  6501             apply auto
  6503             apply auto
  6502             done
  6504             done
  6534       apply (rule that(4)[rule_format])
  6536       apply (rule that(4)[rule_format])
  6535       apply assumption
  6537       apply assumption
  6536       apply (rule trivial_limit_sequentially)
  6538       apply (rule trivial_limit_sequentially)
  6537       unfolding eventually_sequentially
  6539       unfolding eventually_sequentially
  6538       apply (rule_tac x=k in exI)
  6540       apply (rule_tac x=k in exI)
  6539       apply (rule transitive_stepwise_le)
  6541       using assms(3) by (force intro: transitive_stepwise_le)
  6540       using that(3)
       
  6541       apply auto
       
  6542       done
       
  6543     note fg=this[rule_format]
  6542     note fg=this[rule_format]
  6544 
  6543 
  6545     have "\<exists>i. ((\<lambda>k. integral s (f k)) \<longlongrightarrow> i) sequentially"
  6544     have "\<exists>i. ((\<lambda>k. integral s (f k)) \<longlongrightarrow> i) sequentially"
  6546       apply (rule bounded_increasing_convergent)
  6545       apply (rule bounded_increasing_convergent)
  6547       apply (rule that(5))
  6546       apply (rule that(5))
  6551       using that(3)
  6550       using that(3)
  6552       apply auto
  6551       apply auto
  6553       done
  6552       done
  6554     then guess i .. note i=this
  6553     then guess i .. note i=this
  6555     have "\<And>k. \<forall>x\<in>s. \<forall>n\<ge>k. f k x \<le> f n x"
  6554     have "\<And>k. \<forall>x\<in>s. \<forall>n\<ge>k. f k x \<le> f n x"
  6556       apply rule
  6555       using assms(3) by (force intro: transitive_stepwise_le)
  6557       apply (rule transitive_stepwise_le)
       
  6558       using that(3)
       
  6559       apply auto
       
  6560       done
       
  6561     then have i': "\<forall>k. (integral s (f k))\<bullet>1 \<le> i\<bullet>1"
  6556     then have i': "\<forall>k. (integral s (f k))\<bullet>1 \<le> i\<bullet>1"
  6562       apply -
  6557       apply -
  6563       apply rule
  6558       apply rule
  6564       apply (rule Lim_component_ge)
  6559       apply (rule Lim_component_ge)
  6565       apply (rule i)
  6560       apply (rule i)
  6680           defer
  6675           defer
  6681           apply (rule order_trans[OF _ i'[rule_format,of "M + N",unfolded real_inner_1_right]])
  6676           apply (rule order_trans[OF _ i'[rule_format,of "M + N",unfolded real_inner_1_right]])
  6682         proof (safe, goal_cases)
  6677         proof (safe, goal_cases)
  6683           case (2 x)
  6678           case (2 x)
  6684           have "\<And>m. x \<in> s \<Longrightarrow> \<forall>n\<ge>m. (f m x)\<bullet>1 \<le> (f n x)\<bullet>1"
  6679           have "\<And>m. x \<in> s \<Longrightarrow> \<forall>n\<ge>m. (f m x)\<bullet>1 \<le> (f n x)\<bullet>1"
  6685             apply (rule transitive_stepwise_le)
  6680             using assms(3) by (force intro: transitive_stepwise_le)
  6686             using assms(3)
       
  6687             apply auto
       
  6688             done
       
  6689           then show ?case
  6681           then show ?case
  6690             by auto
  6682             by auto
  6691         next
  6683         next
  6692           case 1
  6684           case 1
  6693           show ?case
  6685           show ?case
  6713     apply (subst integral_diff)
  6705     apply (subst integral_diff)
  6714     apply (rule assms(1)[rule_format])+
  6706     apply (rule assms(1)[rule_format])+
  6715     apply rule
  6707     apply rule
  6716     done
  6708     done
  6717   have "\<And>x m. x \<in> s \<Longrightarrow> \<forall>n\<ge>m. f m x \<le> f n x"
  6709   have "\<And>x m. x \<in> s \<Longrightarrow> \<forall>n\<ge>m. f m x \<le> f n x"
  6718     apply (rule transitive_stepwise_le)
  6710     using assms(2) by (force intro: transitive_stepwise_le)
  6719     using assms(2)
       
  6720     apply auto
       
  6721     done
       
  6722   note * = this[rule_format]
  6711   note * = this[rule_format]
  6723   have "(\<lambda>x. g x - f 0 x) integrable_on s \<and> ((\<lambda>k. integral s (\<lambda>x. f (Suc k) x - f 0 x)) \<longlongrightarrow>
  6712   have "(\<lambda>x. g x - f 0 x) integrable_on s \<and> ((\<lambda>k. integral s (\<lambda>x. f (Suc k) x - f 0 x)) \<longlongrightarrow>
  6724     integral s (\<lambda>x. g x - f 0 x)) sequentially"
  6713     integral s (\<lambda>x. g x - f 0 x)) sequentially"
  6725     apply (rule lem)
  6714     apply (rule lem)
  6726     apply safe
  6715     apply safe