# HG changeset patch # User huffman # Date 1315852769 25200 # Node ID 8f3625167c76643bdd13ad1c82efd66d86182209 # Parent 3e8cc9046731598a8c499c3a93b8791f310276cf simplify proofs using LIMSEQ lemmas diff -r 3e8cc9046731 -r 8f3625167c76 src/HOL/Multivariate_Analysis/Integration.thy --- a/src/HOL/Multivariate_Analysis/Integration.thy Mon Sep 12 10:43:36 2011 -0700 +++ b/src/HOL/Multivariate_Analysis/Integration.thy Mon Sep 12 11:39:29 2011 -0700 @@ -1439,7 +1439,7 @@ apply(rule less_trans[OF _ N[THEN conjunct2,THEN conjunct2]]) apply(subst *) apply(rule d(2)) using dp p(1) using mn by auto qed qed - then guess y unfolding convergent_eq_cauchy[THEN sym] .. note y=this[unfolded Lim_sequentially,rule_format] + then guess y unfolding convergent_eq_cauchy[THEN sym] .. note y=this[THEN LIMSEQ_D] show ?l unfolding integrable_on_def has_integral apply(rule_tac x=y in exI) proof(rule,rule) fix e::real assume "e>0" hence *:"e/2 > 0" by auto then guess N1 unfolding real_arch_inv[of "e/2"] .. note N1=this hence N1':"N1 = N1 - 1 + 1" by auto @@ -1451,7 +1451,7 @@ have *:"inverse (real (N1 + N2 + 1)) < e / 2" apply(rule less_trans) using N1 by auto show "norm ((\(x, k)\q. content k *\<^sub>R f x) - y) < e" apply(rule norm_triangle_half_r) apply(rule less_trans[OF _ *]) apply(subst N1', rule d(2)[of "p (N1+N2)"]) defer - using N2[rule_format,unfolded dist_norm,of "N1+N2"] + using N2[rule_format,of "N1+N2"] using as dp[of "N1 - 1 + 1 + N2" "N1 + N2"] using p(1)[of "N1 + N2"] using N1 by auto qed qed qed subsection {* Additivity of integral on abutting intervals. *} @@ -2435,7 +2435,7 @@ show ?thesis unfolding integrable_on_def apply(rule_tac x=s in exI) unfolding has_integral proof(rule,rule) case goal1 hence *:"e/3 > 0" by auto - from s[unfolded Lim_sequentially,rule_format,OF this] guess N1 .. note N1=this + from LIMSEQ_D [OF s this] guess N1 .. note N1=this from goal1 as have "e / 3 / content {a..b} > 0" by(auto simp add:field_simps) from real_arch_invD[OF this] guess N2 apply-by(erule exE conjE)+ note N2=this from i[of "N1 + N2",unfolded has_integral,rule_format,OF *] guess g' .. note g'=conjunctD2[OF this,rule_format] @@ -2456,7 +2456,7 @@ apply-apply(rule less_le_trans,assumption) using `e>0` by auto thus "inverse (real (N1 + N2) + 1) * content {a..b} \ e / 3" unfolding inverse_eq_divide by(auto simp add:field_simps) - show "norm (i (N1 + N2) - s) < e / 3" by(rule N1[rule_format,unfolded dist_norm],auto) + show "norm (i (N1 + N2) - s) < e / 3" by(rule N1[rule_format],auto) qed qed qed qed subsection {* Negligible sets. *} @@ -3066,7 +3066,7 @@ apply(rule division_ofI) defer apply(rule_tac[1-4] s) using assm(1) by auto moreover have "{ka \ s - {k}. content ka \ 0} = {k \ s. content k \ 0}" using k by auto ultimately show ?thesis by auto qed -subsection {* Integrabibility on subintervals. *} +subsection {* Integrability on subintervals. *} lemma operative_integrable: fixes f::"'b::ordered_euclidean_space \ 'a::banach" shows "operative op \ (\i. f integrable_on i)" @@ -4104,7 +4104,7 @@ using n N by(auto simp add:field_simps) qed } thus ?case apply-apply(rule_tac x=N in exI) apply safe unfolding dist_norm apply(rule B(2)) by auto qed from this[unfolded convergent_eq_cauchy[THEN sym]] guess i .. - note i = this[unfolded Lim_sequentially, rule_format] + note i = this[THEN LIMSEQ_D] show ?l unfolding integrable_on_def has_integral_alt'[of f] apply(rule_tac x=i in exI) apply safe apply(rule as(1)[unfolded integrable_on_def]) @@ -4117,7 +4117,7 @@ from real_arch_simple[of ?B] guess n .. note n=this show "norm (integral {a..b} (\x. if x \ s then f x else 0) - i) < e" apply(rule norm_triangle_half_l) apply(rule B(2)) defer apply(subst norm_minus_commute) - apply(rule N[unfolded dist_norm, of n]) + apply(rule N[of n]) proof safe show "N \ n" using n by auto fix x::"'n::ordered_euclidean_space" assume x:"x \ ball 0 B" hence "x\ ball 0 ?B" by auto thus "x\{a..b}" using ab by blast @@ -4555,17 +4555,17 @@ have "\r. \k\r. 0 \ i$$0 - (integral {a..b} (f k)) \ i$$0 - (integral {a..b} (f k)) < e / 4" proof- case goal1 have "e/4 > 0" using e by auto - from i[unfolded Lim_sequentially,rule_format,OF this] guess r .. + from LIMSEQ_D [OF i this] guess r .. thus ?case apply(rule_tac x=r in exI) apply rule apply(erule_tac x=k in allE) - proof- case goal1 thus ?case using i'[of k] unfolding dist_real_def by auto qed qed + proof- case goal1 thus ?case using i'[of k] by auto qed qed then guess r .. note r=conjunctD2[OF this[rule_format]] have "\x\{a..b}. \n\r. \k\n. 0 \ (g x)$$0 - (f k x)$$0 \ (g x)$$0 - (f k x)$$0 < e / (4 * content({a..b}))" proof case goal1 have "e / (4 * content {a..b}) > 0" apply(rule divide_pos_pos,fact) using ab content_pos_le[of a b] by auto - from assms(3)[rule_format,OF goal1,unfolded Lim_sequentially,rule_format,OF this] + from assms(3)[rule_format, OF goal1, THEN LIMSEQ_D, OF this] guess n .. note n=this thus ?case apply(rule_tac x="n + r" in exI) apply safe apply(erule_tac[2-3] x=k in allE) unfolding dist_real_def using fg[rule_format,OF goal1] by(auto simp add:field_simps) qed @@ -4697,22 +4697,22 @@ have "(g has_integral i) s" unfolding has_integral_alt' apply safe apply(rule g(1)) proof- case goal1 hence "e/4>0" by auto - from i[unfolded Lim_sequentially,rule_format,OF this] guess N .. note N=this + from LIMSEQ_D [OF i this] guess N .. note N=this note assms(2)[of N,unfolded has_integral_integral has_integral_alt'[of "f N"]] from this[THEN conjunct2,rule_format,OF `e/4>0`] guess B .. note B=conjunctD2[OF this] show ?case apply(rule,rule,rule B,safe) proof- fix a b::"'n::ordered_euclidean_space" assume ab:"ball 0 B \ {a..b}" from `e>0` have "e/2>0" by auto - from g(2)[unfolded Lim_sequentially,of a b,rule_format,OF this] guess M .. note M=this + from LIMSEQ_D [OF g(2)[of a b] this] guess M .. note M=this have **:"norm (integral {a..b} (\x. if x \ s then f N x else 0) - i) < e/2" apply(rule norm_triangle_half_l) using B(2)[rule_format,OF ab] N[rule_format,of N] - unfolding dist_norm apply-defer apply(subst norm_minus_commute) by auto + apply-defer apply(subst norm_minus_commute) by auto have *:"\f1 f2 g. abs(f1 - i) < e / 2 \ abs(f2 - g) < e / 2 \ f1 \ f2 \ f2 \ i \ abs(g - i) < e" unfolding Eucl_real_simps by arith show "norm (integral {a..b} (\x. if x \ s then g x else 0) - i) < e" unfolding real_norm_def apply(rule *[rule_format]) apply(rule **[unfolded real_norm_def]) - apply(rule M[rule_format,of "M + N",unfolded dist_real_def]) apply(rule le_add1) + apply(rule M[rule_format,of "M + N",unfolded real_norm_def]) apply(rule le_add1) apply(rule integral_le[OF int int]) defer apply(rule order_trans[OF _ i'[rule_format,of "M + N",unfolded Eucl_real_simps]]) proof safe case goal2 have "\m. x\s \ \n\m. (f m x)$$0 \ (f n x)$$0" @@ -5440,23 +5440,22 @@ apply(rule_tac x=xa in bexI) by auto let ?S = "{f j x| j. m \ j}" def i \ "Inf ?S" show "((\k. Inf {f j x |j. j \ {m..m + k}}) ---> i) sequentially" - unfolding Lim_sequentially - proof safe case goal1 note e=this have i:"isGlb UNIV ?S i" unfolding i_def apply(rule Inf) + proof (rule LIMSEQ_I) case goal1 note r=this have i:"isGlb UNIV ?S i" unfolding i_def apply(rule Inf) defer apply(rule_tac x="- h x - 1" in exI) unfolding setge_def proof safe case goal1 thus ?case using assms(3)[rule_format,OF x, of j] by auto qed auto - have "\y\?S. \ y \ i + e" - proof(rule ccontr) case goal1 hence "i \ i + e" apply- + have "\y\?S. \ y \ i + r" + proof(rule ccontr) case goal1 hence "i \ i + r" apply- apply(rule isGlb_le_isLb[OF i]) apply(rule isLbI) unfolding setge_def by fastforce+ - thus False using e by auto + thus False using r by auto qed then guess y .. note y=this[unfolded not_le] from this(1)[unfolded mem_Collect_eq] guess N .. note N=conjunctD2[OF this] show ?case apply(rule_tac x=N in exI) proof safe case goal1 - have *:"\y ix. y < i + e \ i \ ix \ ix \ y \ abs(ix - i) < e" by arith - show ?case unfolding dist_real_def apply(rule *[rule_format,OF y(2)]) + have *:"\y ix. y < i + r \ i \ ix \ ix \ y \ abs(ix - i) < r" by arith + show ?case unfolding real_norm_def apply(rule *[rule_format,OF y(2)]) unfolding i_def apply(rule real_le_inf_subset) prefer 3 apply(rule,rule isGlbD1[OF i]) prefer 3 apply(subst Inf_finite_le_iff) prefer 3 apply(rule_tac x=y in bexI) using N goal1 by auto @@ -5484,23 +5483,22 @@ defer apply rule apply(subst Sup_finite_ge_iff) prefer 3 apply(rule_tac x=y in bexI) by auto let ?S = "{f j x| j. m \ j}" def i \ "Sup ?S" show "((\k. Sup {f j x |j. j \ {m..m + k}}) ---> i) sequentially" - unfolding Lim_sequentially - proof safe case goal1 note e=this have i:"isLub UNIV ?S i" unfolding i_def apply(rule Sup) + proof (rule LIMSEQ_I) case goal1 note r=this have i:"isLub UNIV ?S i" unfolding i_def apply(rule Sup) defer apply(rule_tac x="h x" in exI) unfolding setle_def proof safe case goal1 thus ?case using assms(3)[rule_format,OF x, of j] by auto qed auto - have "\y\?S. \ y \ i - e" - proof(rule ccontr) case goal1 hence "i \ i - e" apply- + have "\y\?S. \ y \ i - r" + proof(rule ccontr) case goal1 hence "i \ i - r" apply- apply(rule isLub_le_isUb[OF i]) apply(rule isUbI) unfolding setle_def by fastforce+ - thus False using e by auto + thus False using r by auto qed then guess y .. note y=this[unfolded not_le] from this(1)[unfolded mem_Collect_eq] guess N .. note N=conjunctD2[OF this] show ?case apply(rule_tac x=N in exI) proof safe case goal1 - have *:"\y ix. i - e < y \ ix \ i \ y \ ix \ abs(ix - i) < e" by arith - show ?case unfolding dist_real_def apply(rule *[rule_format,OF y(2)]) + have *:"\y ix. i - r < y \ ix \ i \ y \ ix \ abs(ix - i) < r" by arith + show ?case unfolding real_norm_def apply(rule *[rule_format,OF y(2)]) unfolding i_def apply(rule real_ge_sup_subset) prefer 3 apply(rule,rule isLubD1[OF i]) prefer 3 apply(subst Sup_finite_ge_iff) prefer 3 apply(rule_tac x=y in bexI) using N goal1 by auto @@ -5521,12 +5519,12 @@ apply(rule real_le_inf_subset) prefer 3 unfolding setge_def apply(rule_tac x="- h x" in exI) apply safe apply(rule *) using assms(3)[rule_format,OF x] unfolding real_norm_def abs_le_iff by auto - show "((\k. Inf {f j x |j. k \ j}) ---> g x) sequentially" unfolding Lim_sequentially - proof safe case goal1 hence "0k. Inf {f j x |j. k \ j}) ---> g x) sequentially" + proof (rule LIMSEQ_I) case goal1 hence "0 ((\k. integral s (\x. Sup {f j x |j. k \ j})) ---> integral s g) sequentially" @@ -5543,23 +5541,23 @@ apply(rule real_ge_sup_subset) prefer 3 unfolding setle_def apply(rule_tac x="h x" in exI) apply safe using assms(3)[rule_format,OF x] unfolding real_norm_def abs_le_iff by auto - show "((\k. Sup {f j x |j. k \ j}) ---> g x) sequentially" unfolding Lim_sequentially - proof safe case goal1 hence "0k. Sup {f j x |j. k \ j}) ---> g x) sequentially" + proof (rule LIMSEQ_I) case goal1 hence "0k. integral s (f k)) ---> integral s g) sequentially" unfolding Lim_sequentially - proof safe case goal1 - from inc2(2)[unfolded Lim_sequentially,rule_format,OF goal1] guess N1 .. note N1=this[unfolded dist_real_def] - from dec2(2)[unfolded Lim_sequentially,rule_format,OF goal1] guess N2 .. note N2=this[unfolded dist_real_def] + show "((\k. integral s (f k)) ---> integral s g) sequentially" + proof (rule LIMSEQ_I) case goal1 + from LIMSEQ_D [OF inc2(2) goal1] guess N1 .. note N1=this[unfolded real_norm_def] + from LIMSEQ_D [OF dec2(2) goal1] guess N2 .. note N2=this[unfolded real_norm_def] show ?case apply(rule_tac x="N1+N2" in exI,safe) proof- fix n assume n:"n \ N1 + N2" - have *:"\i0 i i1 g. \i0 - g\ < e \ \i1 - g\ < e \ i0 \ i \ i \ i1 \ \i - g\ < e" by arith - show "dist (integral s (f n)) (integral s g) < e" unfolding dist_real_def + have *:"\i0 i i1 g. \i0 - g\ < r \ \i1 - g\ < r \ i0 \ i \ i \ i1 \ \i - g\ < r" by arith + show "norm (integral s (f n) - integral s g) < r" unfolding real_norm_def apply(rule *[rule_format,OF N1[rule_format] N2[rule_format], of n n]) proof- show "integral s (\x. Inf {f j x |j. n \ j}) \ integral s (f n)" proof(rule integral_le[OF dec1(1) assms(1)],safe)