src/HOL/Multivariate_Analysis/Integration.thy
changeset 48069 e9b2782c4f99
parent 47317 432b29a96f61
child 49194 85116a86d99f
equal deleted inserted replaced
48068:04aeda922be2 48069:e9b2782c4f99
  2317   have "bounded (ball 0 B1 \<union> ball (0::'a) B2)" unfolding bounded_Un by(rule conjI bounded_ball)+
  2317   have "bounded (ball 0 B1 \<union> ball (0::'a) B2)" unfolding bounded_Un by(rule conjI bounded_ball)+
  2318   from bounded_subset_closed_interval[OF this] guess a b apply- by(erule exE)+
  2318   from bounded_subset_closed_interval[OF this] guess a b apply- by(erule exE)+
  2319   note ab = conjunctD2[OF this[unfolded Un_subset_iff]]
  2319   note ab = conjunctD2[OF this[unfolded Un_subset_iff]]
  2320   guess w1 using B(2)[OF ab(1)] .. note w1=conjunctD2[OF this]
  2320   guess w1 using B(2)[OF ab(1)] .. note w1=conjunctD2[OF this]
  2321   guess w2 using B(4)[OF ab(2)] .. note w2=conjunctD2[OF this]
  2321   guess w2 using B(4)[OF ab(2)] .. note w2=conjunctD2[OF this]
  2322   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" by smt
  2322   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" using [[z3_with_extensions]] by smt
  2323   note le_less_trans[OF component_le_norm[of _ k]] note this[OF w1(2)] this[OF w2(2)] moreover
  2323   note le_less_trans[OF component_le_norm[of _ k]] note this[OF w1(2)] this[OF w2(2)] moreover
  2324   have "w1$$k \<le> w2$$k" apply(rule lem[OF w1(1) w2(1)]) using assms by auto ultimately
  2324   have "w1$$k \<le> w2$$k" apply(rule lem[OF w1(1) w2(1)]) using assms by auto ultimately
  2325   show False unfolding euclidean_simps by(rule *) qed
  2325   show False unfolding euclidean_simps by(rule *) qed
  2326 
  2326 
  2327 lemma integral_component_le: fixes g f::"'a::ordered_euclidean_space \<Rightarrow> 'b::euclidean_space"
  2327 lemma integral_component_le: fixes g f::"'a::ordered_euclidean_space \<Rightarrow> 'b::euclidean_space"
  3048     show "\<exists>x'\<in>\<Union>(s - {k}). x' \<noteq> x \<and> dist x' x < e" apply(rule_tac x=y in bexI) 
  3048     show "\<exists>x'\<in>\<Union>(s - {k}). x' \<noteq> x \<and> dist x' x < e" apply(rule_tac x=y in bexI) 
  3049     proof have "d \<in> {c..d}" using s(3)[OF k(1)] unfolding k interval_eq_empty mem_interval by(fastforce simp add: not_less)
  3049     proof have "d \<in> {c..d}" using s(3)[OF k(1)] unfolding k interval_eq_empty mem_interval by(fastforce simp add: not_less)
  3050       hence "d \<in> {a..b}" using s(2)[OF k(1)] unfolding k by auto note di = this[unfolded mem_interval,THEN spec[where x=i]]
  3050       hence "d \<in> {a..b}" using s(2)[OF k(1)] unfolding k by auto note di = this[unfolded mem_interval,THEN spec[where x=i]]
  3051       hence xyi:"y$$i \<noteq> x$$i" unfolding y_def unfolding i xi euclidean_lambda_beta'[OF i(2)] if_P[OF refl]
  3051       hence xyi:"y$$i \<noteq> x$$i" unfolding y_def unfolding i xi euclidean_lambda_beta'[OF i(2)] if_P[OF refl]
  3052         apply(cases) apply(subst if_P,assumption) unfolding if_not_P not_le using as(2)
  3052         apply(cases) apply(subst if_P,assumption) unfolding if_not_P not_le using as(2)
  3053         using assms(2)[unfolded content_eq_0] using i(2) by smt+ 
  3053         using assms(2)[unfolded content_eq_0] using i(2) using [[z3_with_extensions]] by smt+
  3054       thus "y \<noteq> x" unfolding euclidean_eq[where 'a='a] using i by auto
  3054       thus "y \<noteq> x" unfolding euclidean_eq[where 'a='a] using i by auto
  3055       have *:"{..<DIM('a)} = insert i ({..<DIM('a)} - {i})" using i by auto
  3055       have *:"{..<DIM('a)} = insert i ({..<DIM('a)} - {i})" using i by auto
  3056       have "norm (y - x) < e + setsum (\<lambda>i. 0) {..<DIM('a)}" apply(rule le_less_trans[OF norm_le_l1])
  3056       have "norm (y - x) < e + setsum (\<lambda>i. 0) {..<DIM('a)}" apply(rule le_less_trans[OF norm_le_l1])
  3057         apply(subst *,subst setsum_insert) prefer 3 apply(rule add_less_le_mono)
  3057         apply(subst *,subst setsum_insert) prefer 3 apply(rule add_less_le_mono)
  3058       proof- show "\<bar>(y - x) $$ i\<bar> < e" unfolding y_def euclidean_simps euclidean_lambda_beta'[OF i(2)] if_P[OF refl]
  3058       proof- show "\<bar>(y - x) $$ i\<bar> < e" unfolding y_def euclidean_simps euclidean_lambda_beta'[OF i(2)] if_P[OF refl]
  4234     note h = this(1) and this(2)[OF *] from this(2) guess B2 .. note B2 = conjunctD2[OF this,rule_format]
  4234     note h = this(1) and this(2)[OF *] from this(2) guess B2 .. note B2 = conjunctD2[OF this,rule_format]
  4235     show ?case apply(rule_tac x="max B1 B2" in exI) apply safe apply(rule min_max.less_supI1,rule B1)
  4235     show ?case apply(rule_tac x="max B1 B2" in exI) apply safe apply(rule min_max.less_supI1,rule B1)
  4236     proof- fix a b c d::"'n::ordered_euclidean_space" assume as:"ball 0 (max B1 B2) \<subseteq> {a..b}" "ball 0 (max B1 B2) \<subseteq> {c..d}"
  4236     proof- fix a b c d::"'n::ordered_euclidean_space" assume as:"ball 0 (max B1 B2) \<subseteq> {a..b}" "ball 0 (max B1 B2) \<subseteq> {c..d}"
  4237       have **:"ball 0 B1 \<subseteq> ball (0::'n::ordered_euclidean_space) (max B1 B2)" "ball 0 B2 \<subseteq> ball (0::'n::ordered_euclidean_space) (max B1 B2)" by auto
  4237       have **:"ball 0 B1 \<subseteq> ball (0::'n::ordered_euclidean_space) (max B1 B2)" "ball 0 B2 \<subseteq> ball (0::'n::ordered_euclidean_space) (max B1 B2)" by auto
  4238       have *:"\<And>ga gc ha hc fa fc::real. abs(ga - i) < e / 3 \<and> abs(gc - i) < e / 3 \<and> abs(ha - j) < e / 3 \<and>
  4238       have *:"\<And>ga gc ha hc fa fc::real. abs(ga - i) < e / 3 \<and> abs(gc - i) < e / 3 \<and> abs(ha - j) < e / 3 \<and>
  4239         abs(hc - j) < e / 3 \<and> abs(i - j) < e / 3 \<and> ga \<le> fa \<and> fa \<le> ha \<and> gc \<le> fc \<and> fc \<le> hc\<Longrightarrow> abs(fa - fc) < e" by smt
  4239         abs(hc - j) < e / 3 \<and> abs(i - j) < e / 3 \<and> ga \<le> fa \<and> fa \<le> ha \<and> gc \<le> fc \<and> fc \<le> hc\<Longrightarrow> abs(fa - fc) < e" using [[z3_with_extensions]] by smt
  4240       show "norm (integral {a..b} (\<lambda>x. if x \<in> s then f x else 0) - integral {c..d} (\<lambda>x. if x \<in> s then f x else 0)) < e"
  4240       show "norm (integral {a..b} (\<lambda>x. if x \<in> s then f x else 0) - integral {c..d} (\<lambda>x. if x \<in> s then f x else 0)) < e"
  4241         unfolding real_norm_def apply(rule *, safe) unfolding real_norm_def[THEN sym]
  4241         unfolding real_norm_def apply(rule *, safe) unfolding real_norm_def[THEN sym]
  4242         apply(rule B1(2),rule order_trans,rule **,rule as(1)) 
  4242         apply(rule B1(2),rule order_trans,rule **,rule as(1)) 
  4243         apply(rule B1(2),rule order_trans,rule **,rule as(2)) 
  4243         apply(rule B1(2),rule order_trans,rule **,rule as(2)) 
  4244         apply(rule B2(2),rule order_trans,rule **,rule as(1)) 
  4244         apply(rule B2(2),rule order_trans,rule **,rule as(1))