3813 qed |
3813 qed |
3814 have **: "norm (\<Sum>(x, k)\<in>p \<inter> {t. fst t \<in> {a, b}}. content k *\<^sub>R f' x - (f (Sup k) - f (Inf k))) \<le> e * (b - a) / 2" |
3814 have **: "norm (\<Sum>(x, k)\<in>p \<inter> {t. fst t \<in> {a, b}}. content k *\<^sub>R f' x - (f (Sup k) - f (Inf k))) \<le> e * (b - a) / 2" |
3815 proof - |
3815 proof - |
3816 have *: "\<And>s f t e. sum f s = sum f t \<Longrightarrow> norm (sum f t) \<le> e \<Longrightarrow> norm (sum f s) \<le> e" |
3816 have *: "\<And>s f t e. sum f s = sum f t \<Longrightarrow> norm (sum f t) \<le> e \<Longrightarrow> norm (sum f s) \<le> e" |
3817 by auto |
3817 by auto |
|
3818 |
|
3819 |
3818 show "norm (\<Sum>(x, k)\<in>p \<inter> ?A. content k *\<^sub>R f' x - |
3820 show "norm (\<Sum>(x, k)\<in>p \<inter> ?A. content k *\<^sub>R f' x - |
3819 (f ((Sup k)) - f ((Inf k)))) \<le> e * (b - a) / 2" |
3821 (f ((Sup k)) - f ((Inf k)))) \<le> e * (b - a) / 2" |
3820 apply (rule *[where t1="p \<inter> {t. fst t \<in> {a, b} \<and> content(snd t) \<noteq> 0}"]) |
3822 apply (rule *[where t1="p \<inter> {t. fst t \<in> {a, b} \<and> content(snd t) \<noteq> 0}"]) |
3821 apply (rule sum.mono_neutral_right[OF pA(2)]) |
3823 apply (rule sum.mono_neutral_right[OF pA(2)]) |
3822 defer |
3824 defer |
3838 next |
3840 next |
3839 have *: "p \<inter> {t. fst t \<in> {a, b} \<and> content(snd t) \<noteq> 0} = |
3841 have *: "p \<inter> {t. fst t \<in> {a, b} \<and> content(snd t) \<noteq> 0} = |
3840 {t. t\<in>p \<and> fst t = a \<and> content(snd t) \<noteq> 0} \<union> {t. t\<in>p \<and> fst t = b \<and> content(snd t) \<noteq> 0}" |
3842 {t. t\<in>p \<and> fst t = a \<and> content(snd t) \<noteq> 0} \<union> {t. t\<in>p \<and> fst t = b \<and> content(snd t) \<noteq> 0}" |
3841 by blast |
3843 by blast |
3842 have **: "norm (sum f s) \<le> e" |
3844 have **: "norm (sum f s) \<le> e" |
3843 if "\<forall>x y. x \<in> s \<and> y \<in> s \<longrightarrow> x = y" |
3845 if "\<forall>x y. x \<in> s \<and> y \<in> s \<longrightarrow> x = y" "\<forall>x. x \<in> s \<longrightarrow> norm (f x) \<le> e" "e > 0" |
3844 and "\<forall>x. x \<in> s \<longrightarrow> norm (f x) \<le> e" |
|
3845 and "e > 0" |
|
3846 for s f and e :: real |
3846 for s f and e :: real |
3847 proof (cases "s = {}") |
3847 proof (cases "s = {}") |
3848 case True |
3848 case True |
3849 with that show ?thesis by auto |
3849 with that show ?thesis by auto |
3850 next |
3850 next |
3970 { assume "x \<in> k" then show "x \<in> k'" unfolding * . } |
3970 { assume "x \<in> k" then show "x \<in> k'" unfolding * . } |
3971 { assume "x \<in> k'" then show "x\<in>k" unfolding * . } |
3971 { assume "x \<in> k'" then show "x\<in>k" unfolding * . } |
3972 qed |
3972 qed |
3973 |
3973 |
3974 let ?a = a and ?b = b (* a is something else while proofing the next theorem. *) |
3974 let ?a = a and ?b = b (* a is something else while proofing the next theorem. *) |
3975 show "\<forall>x. x \<in> ?B a \<longrightarrow> norm ((\<lambda>(x, k). content k *\<^sub>R f' x - (f (Sup k) - |
3975 have "norm (content c *\<^sub>R f' a - (f (Sup c) - f (Inf c))) \<le> e * (b - a) / 4" |
|
3976 if "(a, c) \<in> p" and ne0: "content c \<noteq> 0" for c |
|
3977 proof - |
|
3978 obtain v where v: "c = cbox a v" and "a \<le> v" |
|
3979 using pa[OF \<open>(a, c) \<in> p\<close>] by metis |
|
3980 then have "?a \<in> {?a..v}" "v \<le> ?b" |
|
3981 using p(3)[OF \<open>(a, c) \<in> p\<close>] by auto |
|
3982 moreover have "{?a..v} \<subseteq> ball ?a da" |
|
3983 using fineD[OF \<open>?d fine p\<close> \<open>(a, c) \<in> p\<close>] by (simp add: v split: if_split_asm) |
|
3984 ultimately show ?thesis |
|
3985 unfolding v interval_bounds_real[OF \<open>a \<le> v\<close>] box_real |
|
3986 using da \<open>a \<le> v\<close> by auto |
|
3987 qed |
|
3988 then show "\<forall>x. x \<in> ?B a \<longrightarrow> norm ((\<lambda>(x, k). content k *\<^sub>R f' x - (f (Sup k) - |
3976 f (Inf k))) x) \<le> e * (b - a) / 4" |
3989 f (Inf k))) x) \<le> e * (b - a) / 4" |
3977 apply rule |
3990 by auto |
3978 apply rule |
3991 |
3979 unfolding mem_Collect_eq |
3992 have "norm (content c *\<^sub>R f' b - (f (Sup c) - f (Inf c))) \<le> e * (b - a) / 4" |
3980 unfolding split_paired_all fst_conv snd_conv |
3993 if "(b, c) \<in> p" and ne0: "content c \<noteq> 0" for c |
3981 proof (safe, goal_cases) |
3994 proof - |
3982 case prems: 1 |
3995 obtain v where v: "c = cbox v b" and "v \<le> b" |
3983 guess v using pa[OF prems(1)] .. note v = conjunctD2[OF this] |
3996 using \<open>(b, c) \<in> p\<close> pb by blast |
3984 have "?a \<in> {?a..v}" |
3997 then have "v \<ge> ?a""?b \<in> {v.. ?b}" |
3985 using v(2) by auto |
3998 using p(3)[OF \<open>(b, c) \<in> p\<close>] by auto |
3986 then have "v \<le> ?b" |
3999 moreover have "{v..?b} \<subseteq> ball ?b db" |
3987 using p(3)[OF prems(1)] unfolding subset_eq v by auto |
4000 using fineD[OF \<open>?d fine p\<close> \<open>(b, c) \<in> p\<close>] box_real(2) v False by force |
3988 moreover have "{?a..v} \<subseteq> ball ?a da" |
4001 ultimately show ?thesis |
3989 using fineD[OF as(2) prems(1)] |
4002 using db v by auto |
3990 apply - |
|
3991 apply (subst(asm) if_P) |
|
3992 apply (rule refl) |
|
3993 unfolding subset_eq |
|
3994 apply safe |
|
3995 apply (erule_tac x=" x" in ballE) |
|
3996 apply (auto simp add:subset_eq dist_real_def v) |
|
3997 done |
|
3998 ultimately show ?case |
|
3999 unfolding v interval_bounds_real[OF v(2)] box_real |
|
4000 apply - |
|
4001 apply(rule da[of "v"]) |
|
4002 using prems fineD[OF as(2) prems(1)] |
|
4003 unfolding v content_eq_0 |
|
4004 apply auto |
|
4005 done |
|
4006 qed |
4003 qed |
4007 show "\<forall>x. x \<in> ?B b \<longrightarrow> norm ((\<lambda>(x, k). content k *\<^sub>R f' x - |
4004 then show "\<forall>x. x \<in> ?B b \<longrightarrow> |
4008 (f (Sup k) - f (Inf k))) x) \<le> e * (b - a) / 4" |
4005 norm ((\<lambda>(x, k). content k *\<^sub>R f' x - (f (Sup k) - f (Inf k))) x) |
4009 apply rule |
4006 \<le> e * (b - a) / 4" |
4010 apply rule |
4007 by auto |
4011 unfolding mem_Collect_eq |
|
4012 unfolding split_paired_all fst_conv snd_conv |
|
4013 proof (safe, goal_cases) |
|
4014 case prems: 1 |
|
4015 guess v using pb[OF prems(1)] .. note v = conjunctD2[OF this] |
|
4016 have "?b \<in> {v.. ?b}" |
|
4017 using v(2) by auto |
|
4018 then have "v \<ge> ?a" using p(3)[OF prems(1)] |
|
4019 unfolding subset_eq v by auto |
|
4020 moreover have "{v..?b} \<subseteq> ball ?b db" |
|
4021 using fineD[OF as(2) prems(1)] |
|
4022 apply - |
|
4023 apply (subst(asm) if_P, rule refl) |
|
4024 unfolding subset_eq |
|
4025 apply safe |
|
4026 apply (erule_tac x=" x" in ballE) |
|
4027 using ab |
|
4028 apply (auto simp add:subset_eq v dist_real_def) |
|
4029 done |
|
4030 ultimately show ?case |
|
4031 unfolding v |
|
4032 unfolding interval_bounds_real[OF v(2)] box_real |
|
4033 apply - |
|
4034 apply(rule db[of "v"]) |
|
4035 using prems fineD[OF as(2) prems(1)] |
|
4036 unfolding v content_eq_0 |
|
4037 apply auto |
|
4038 done |
|
4039 qed |
|
4040 qed (insert p(1) ab e, auto simp add: field_simps) |
4008 qed (insert p(1) ab e, auto simp add: field_simps) |
4041 qed auto |
4009 qed auto |
|
4010 |
|
4011 |
4042 qed |
4012 qed |
4043 have *: "\<And>x s1 s2::real. 0 \<le> s1 \<Longrightarrow> x \<le> (s1 + s2) / 2 \<Longrightarrow> x - s1 \<le> s2 / 2" |
4013 have *: "\<And>x s1 s2::real. 0 \<le> s1 \<Longrightarrow> x \<le> (s1 + s2) / 2 \<Longrightarrow> x - s1 \<le> s2 / 2" |
4044 by auto |
4014 by auto |
4045 show ?thesis |
4015 show ?thesis |
4046 apply (rule * [OF sum_nonneg]) |
4016 apply (rule * [OF sum_nonneg]) |