src/HOL/Analysis/Henstock_Kurzweil_Integration.thy
changeset 66539 0ad3fc48c9ec
parent 66537 e2249cd6df67
child 66552 507a42c0a0ff
equal deleted inserted replaced
66538:6e50b550adf5 66539:0ad3fc48c9ec
  1998     show "gauge (\<lambda>x. ball x d)"
  1998     show "gauge (\<lambda>x. ball x d)"
  1999       using \<open>0 < d\<close> by blast
  1999       using \<open>0 < d\<close> by blast
  2000   next
  2000   next
  2001     fix \<D>
  2001     fix \<D>
  2002     assume p: "\<D> tagged_division_of (cbox a b)" "(\<lambda>x. ball x d) fine \<D>"
  2002     assume p: "\<D> tagged_division_of (cbox a b)" "(\<lambda>x. ball x d) fine \<D>"
  2003     have "content l = content (l \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d})" 
  2003     have "content L = content (L \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d})" 
  2004       if "(x, l) \<in> \<D>" "?i x \<noteq> 0" for x l
  2004       if "(x, L) \<in> \<D>" "?i x \<noteq> 0" for x L
  2005     proof -
  2005     proof -
  2006       have xk: "x\<bullet>k = c"
  2006       have xk: "x\<bullet>k = c"
  2007         using that by (simp add: indicator_def split: if_split_asm)
  2007         using that by (simp add: indicator_def split: if_split_asm)
  2008       show "content l = content (l \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d})"
  2008       have "L \<subseteq> {x. \<bar>x \<bullet> k - c\<bar> \<le> d}"
  2009         apply (rule arg_cong[where f=content])
  2009       proof 
  2010         apply (rule set_eqI)
       
  2011         apply rule
       
  2012          apply rule
       
  2013         unfolding mem_Collect_eq
       
  2014       proof -
       
  2015         fix y
  2010         fix y
  2016         assume y: "y \<in> l"
  2011         assume y: "y \<in> L"
  2017         note p(2)[unfolded fine_def,rule_format,OF that(1),unfolded split_conv]
  2012         have "L \<subseteq> ball x d"
  2018         note this[unfolded subset_eq mem_ball dist_norm,rule_format,OF y]
  2013           using p(2) that(1) by auto
  2019         note le_less_trans[OF Basis_le_norm[OF k] this]
  2014         then have "norm (x - y) < d"
  2020         then show "\<bar>y \<bullet> k - c\<bar> \<le> d"
  2015           by (simp add: dist_norm subset_iff y)
       
  2016         then have "\<bar>(x - y) \<bullet> k\<bar> < d"
       
  2017           using k norm_bound_Basis_lt by blast
       
  2018         then show "y \<in> {x. \<bar>x \<bullet> k - c\<bar> \<le> d}"
  2021           unfolding inner_simps xk by auto
  2019           unfolding inner_simps xk by auto
  2022       qed auto
  2020       qed 
       
  2021       then show "content L = content (L \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d})"
       
  2022         by (metis inf.orderE)
  2023     qed
  2023     qed
  2024     then have *: "(\<Sum>(x,K)\<in>\<D>. content K * ?i x) = (\<Sum>(x,K)\<in>\<D>. content (K \<inter> {x. \<bar>x\<bullet>k - c\<bar> \<le> d}) *\<^sub>R ?i x)"
  2024     then have *: "(\<Sum>(x,K)\<in>\<D>. content K * ?i x) = (\<Sum>(x,K)\<in>\<D>. content (K \<inter> {x. \<bar>x\<bullet>k - c\<bar> \<le> d}) *\<^sub>R ?i x)"
  2025       by (force simp add: split_paired_all intro!: sum.cong [OF refl])
  2025       by (force simp add: split_paired_all intro!: sum.cong [OF refl])
  2026     note p'= tagged_division_ofD[OF p(1)] and p''=division_of_tagged_division[OF p(1)]
  2026     note p'= tagged_division_ofD[OF p(1)] and p''=division_of_tagged_division[OF p(1)]
  2027     have "(\<Sum>(x,K)\<in>\<D>. content (K \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d}) * indicator {x. x \<bullet> k = c} x) < e"
  2027     have "(\<Sum>(x,K)\<in>\<D>. content (K \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d}) * indicator {x. x \<bullet> k = c} x) < e"
  2028     proof -
  2028     proof -
  2029       have "(\<Sum>(x,K)\<in>\<D>. content (K \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d}) * ?i x) \<le>
  2029       have "(\<Sum>(x,K)\<in>\<D>. content (K \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d}) * ?i x) \<le> (\<Sum>(x,K)\<in>\<D>. content (K \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d}))"
  2030         (\<Sum>(x,K)\<in>\<D>. content (K \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d}))"
  2030         by (force simp add: indicator_def intro!: sum_mono)
  2031         apply (rule sum_mono)
       
  2032         unfolding split_paired_all split_conv
       
  2033         apply (rule mult_right_le_one_le)
       
  2034           apply (drule p'(4))
       
  2035           apply (auto simp add:interval_doublesplit[OF k])
       
  2036         done
       
  2037       also have "\<dots> < e"
  2031       also have "\<dots> < e"
  2038       proof (subst sum.over_tagged_division_lemma[OF p(1)], goal_cases)
  2032       proof (subst sum.over_tagged_division_lemma[OF p(1)])
  2039         case prems: (1 u v)
  2033         fix u v::'a
       
  2034         assume "box u v = {}"
  2040         then have *: "content (cbox u v) = 0"
  2035         then have *: "content (cbox u v) = 0"
  2041           unfolding content_eq_0_interior by simp
  2036           unfolding content_eq_0_interior by simp
  2042         have "cbox u v \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d} \<subseteq> cbox u v"
  2037         have "cbox u v \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d} \<subseteq> cbox u v"
  2043           by auto
  2038           by auto
  2044         then have "content (cbox u v \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d}) \<le> content (cbox u v)"
  2039         then have "content (cbox u v \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d}) \<le> content (cbox u v)"
  2045           unfolding interval_doublesplit[OF k] by (rule content_subset)
  2040           unfolding interval_doublesplit[OF k] by (rule content_subset)
  2046         then show ?case
  2041         then show "content (cbox u v \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d}) = 0"
  2047           unfolding * interval_doublesplit[OF k]
  2042           unfolding * interval_doublesplit[OF k]
  2048           by (blast intro: antisym)
  2043           by (blast intro: antisym)
  2049       next
  2044       next
  2050         have "(\<Sum>l\<in>snd ` \<D>. content (l \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d})) =
  2045         have "(\<Sum>l\<in>snd ` \<D>. content (l \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d})) =
  2051           sum content ((\<lambda>l. l \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d})`{l\<in>snd ` \<D>. l \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d} \<noteq> {}})"
  2046           sum content ((\<lambda>l. l \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d})`{l\<in>snd ` \<D>. l \<inter> {x. \<bar>x \<bullet> k - c\<bar> \<le> d} \<noteq> {}})"
  2393 subsection \<open>In particular, the boundary of an interval is negligible.\<close>
  2388 subsection \<open>In particular, the boundary of an interval is negligible.\<close>
  2394 
  2389 
  2395 lemma negligible_frontier_interval: "negligible(cbox (a::'a::euclidean_space) b - box a b)"
  2390 lemma negligible_frontier_interval: "negligible(cbox (a::'a::euclidean_space) b - box a b)"
  2396 proof -
  2391 proof -
  2397   let ?A = "\<Union>((\<lambda>k. {x. x\<bullet>k = a\<bullet>k} \<union> {x::'a. x\<bullet>k = b\<bullet>k}) ` Basis)"
  2392   let ?A = "\<Union>((\<lambda>k. {x. x\<bullet>k = a\<bullet>k} \<union> {x::'a. x\<bullet>k = b\<bullet>k}) ` Basis)"
  2398   have "cbox a b - box a b \<subseteq> ?A"
  2393   have "negligible ?A"
  2399     apply rule unfolding Diff_iff mem_box
  2394     by (force simp add: negligible_Union[OF finite_imageI])
  2400     apply simp
  2395   moreover have "cbox a b - box a b \<subseteq> ?A"
  2401     apply(erule conjE bexE)+
  2396     by (force simp add: mem_box)
  2402     apply(rule_tac x=i in bexI)
  2397   ultimately show ?thesis
  2403     apply auto
  2398     by (rule negligible_subset)
  2404     done
       
  2405   then show ?thesis
       
  2406     apply -
       
  2407     apply (rule negligible_subset[of ?A])
       
  2408     apply (rule negligible_Union[OF finite_imageI])
       
  2409     apply auto
       
  2410     done
       
  2411 qed
  2399 qed
  2412 
  2400 
  2413 lemma has_integral_spike_interior:
  2401 lemma has_integral_spike_interior:
  2414   assumes "\<forall>x\<in>box a b. g x = f x"
  2402   assumes f: "(f has_integral y) (cbox a b)" and gf: "\<And>x. x \<in> box a b \<Longrightarrow> g x = f x"
  2415     and "(f has_integral y) (cbox a b)"
       
  2416   shows "(g has_integral y) (cbox a b)"
  2403   shows "(g has_integral y) (cbox a b)"
  2417   apply (rule has_integral_spike[OF negligible_frontier_interval _ assms(2)])
  2404   apply (rule has_integral_spike[OF negligible_frontier_interval _ f])
  2418   using assms(1)
  2405   using gf by auto
  2419   apply auto
       
  2420   done
       
  2421 
  2406 
  2422 lemma has_integral_spike_interior_eq:
  2407 lemma has_integral_spike_interior_eq:
  2423   assumes "\<forall>x\<in>box a b. g x = f x"
  2408   assumes "\<And>x. x \<in> box a b \<Longrightarrow> g x = f x"
  2424   shows "(f has_integral y) (cbox a b) \<longleftrightarrow> (g has_integral y) (cbox a b)"
  2409   shows "(f has_integral y) (cbox a b) \<longleftrightarrow> (g has_integral y) (cbox a b)"
  2425   apply rule
  2410   by (metis assms has_integral_spike_interior)
  2426   apply (rule_tac[!] has_integral_spike_interior)
       
  2427   using assms
       
  2428   apply auto
       
  2429   done
       
  2430 
  2411 
  2431 lemma integrable_spike_interior:
  2412 lemma integrable_spike_interior:
  2432   assumes "\<forall>x\<in>box a b. g x = f x"
  2413   assumes "\<And>x. x \<in> box a b \<Longrightarrow> g x = f x"
  2433     and "f integrable_on cbox a b"
  2414     and "f integrable_on cbox a b"
  2434   shows "g integrable_on cbox a b"
  2415   shows "g integrable_on cbox a b"
  2435   using assms
  2416   using assms has_integral_spike_interior_eq by blast
  2436   unfolding integrable_on_def
       
  2437   using has_integral_spike_interior[OF assms(1)]
       
  2438   by auto
       
  2439 
  2417 
  2440 
  2418 
  2441 subsection \<open>Integrability of continuous functions.\<close>
  2419 subsection \<open>Integrability of continuous functions.\<close>
  2442 
  2420 
  2443 lemma operative_approximableI:
  2421 lemma operative_approximableI:
  4383     have intg: "g integrable_on cbox c d"
  4361     have intg: "g integrable_on cbox c d"
  4384       using integrable_spike_interior[where f=f]
  4362       using integrable_spike_interior[where f=f]
  4385       by (meson g_def has_integral_integrable intf)
  4363       by (meson g_def has_integral_integrable intf)
  4386     moreover have "integral (cbox c d) g = i"
  4364     moreover have "integral (cbox c d) g = i"
  4387     proof (rule has_integral_unique[OF has_integral_spike_interior intf])
  4365     proof (rule has_integral_unique[OF has_integral_spike_interior intf])
  4388       show "\<forall>x\<in>box c d. f x = g x"
  4366       show "\<And>x. x \<in> box c d \<Longrightarrow> f x = g x"
  4389         by (auto simp: g_def)
  4367         by (auto simp: g_def)
  4390       show "(g has_integral integral (cbox c d) g) (cbox c d)"
  4368       show "(g has_integral integral (cbox c d) g) (cbox c d)"
  4391         by (rule integrable_integral[OF intg])
  4369         by (rule integrable_integral[OF intg])
  4392     qed
  4370     qed
  4393     ultimately have "F (\<lambda>A. if g integrable_on A then Some (integral A g) else None) p = Some i"
  4371     ultimately have "F (\<lambda>A. if g integrable_on A then Some (integral A g) else None) p = Some i"