# HG changeset patch # User paulson # Date 1503700236 -3600 # Node ID 89b6455b63b6f1bd20c369cac17681f9d8f6a7b8 # Parent 65b6d48fc9a90aba13376f81033d84135a520fbd starting to unscramble bounded_variation_absolutely_integrable_interval diff -r 65b6d48fc9a9 -r 89b6455b63b6 src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy --- a/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Fri Aug 25 13:01:13 2017 +0100 +++ b/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Fri Aug 25 23:30:36 2017 +0100 @@ -1623,20 +1623,16 @@ unfolding less_cSUP_iff[OF D] by auto note d' = division_ofD[OF this(1)] - have "\x. \e>0. \i\d. x \ i \ ball x e \ i = {}" - proof - fix x - have "\da>0. \xa\\{i \ d. x \ i}. da \ dist x xa" + have "\e>0. \i\d. x \ i \ ball x e \ i = {}" for x + proof - + have "\d'>0. \x'\\{i \ d. x \ i}. d' \ dist x x'" proof (rule separate_point_closed) show "closed (\{i \ d. x \ i})" - apply (rule closed_Union) - apply (simp add: d'(1)) - using d'(4) apply auto - done + using d' by force show "x \ \{i \ d. x \ i}" by auto qed - then show "\e>0. \i\d. x \ i \ ball x e \ i = {}" + then show ?thesis by force qed then obtain k where k: "\x. 0 < k x" "\i x. \i \ d; x \ i\ \ ball x (k x) \ i = {}" @@ -1680,8 +1676,7 @@ show "x \ K" and "K \ cbox a b" using p'(2-3)[OF il(3)] il by auto show "\a b. K = cbox a b" - unfolding il using p'(4)[OF il(3)] d'(4)[OF il(2)] - by (meson Int_interval) + unfolding il using p'(4)[OF il(3)] d'(4)[OF il(2)] by (meson Int_interval) next fix x1 K1 assume "(x1, K1) \ p'" @@ -1710,8 +1705,7 @@ have "x \ i" using fineD[OF p(3) xl(1)] using k(2) i xl by auto then show ?thesis - unfolding p'_def - by (rule_tac X="i \ l" in UnionI) (use i xl in auto) + unfolding p'_def by (rule_tac X="i \ l" in UnionI) (use i xl in auto) qed show "\{K. \x. (x, K) \ p'} = cbox a b" proof @@ -1738,22 +1732,23 @@ then have sum_less_e2: "(\(x,K) \ p'. norm (content K *\<^sub>R f x - integral K f)) < e/2" using g(2) gp' tagged_division_of_def by blast - have p'alt: "p' = {(x, I \ L) | x I L. (x,L) \ p \ I \ d \ I \ L \ {}}" + have XX: "(x, I \ L) \ p'" if "(x, L) \ p" "I \ d" "y \ I" "y \ L" + for x I L y + proof - + have "x \ I" + using fineD[OF p(3) that(1)] k(2)[OF that(2), of x] that(3-) by auto + then have "(\i l. x \ i \ i \ d \ (x, l) \ p \ I \ L = i \ l)" + using that(1) that(2) by blast + then have "(x, I \ L) \ p'" + by (simp add: p'_def) + then show ?thesis + using that(3) by auto + qed + have p'alt: "p' = {(x, I \ L) | x I L. (x,L) \ p \ I \ d \ I \ L \ {}}" proof (safe, goal_cases) case prems: (2 _ _ x i l) - have "x \ i" - using fineD[OF p(3) prems(1)] k(2)[OF prems(2), of x] prems(4-) - by auto - then have "(x, i \ l) \ p'" - unfolding p'_def - using prems - apply safe - apply (rule_tac x=x in exI) - apply (rule_tac x="i \ l" in exI) - apply auto - done then show ?case - using prems(3) by auto + using XX by auto next fix x K assume "(x, K) \ p'" @@ -2027,14 +2022,13 @@ then show False using prems by auto qed - then obtain K where *: "\x\{d. d division_of \d}. K = (\k\x. norm (integral k f))" + then obtain d K where ddiv: "d division_of \d" and "K = (\k\d. norm (integral k f))" "SUPREMUM {d. d division_of \d} (sum (\k. norm (integral k f))) - e < K" by (auto simp add: image_iff not_le) - from this(1) obtain d where "d division_of \d" - and "K = (\k\d. norm (integral k f))" + then have d: "SUPREMUM {d. d division_of \d} (sum (\k. norm (integral k f))) - e + < (\k\d. norm (integral k f))" by auto - note d = this(1) *(2)[unfolded this(2)] - note d'=division_ofD[OF this(1)] + note d'=division_ofD[OF ddiv] have "bounded (\d)" by (rule elementary_bounded,fact) from this[unfolded bounded_pos] obtain K where @@ -2051,7 +2045,7 @@ unfolding real_norm_def apply (rule *[rule_format]) apply safe - apply (rule d(2)) + apply (rule d) proof goal_cases case 1 have "(\k\d. norm (integral k f)) \ sum (\k. integral k (\x. norm (f x))) d" @@ -2061,31 +2055,15 @@ by (auto simp: absolutely_integrable_on_def integral_norm_bound_integral) done also have "\ = integral (\d) (\x. norm (f x))" - apply (rule integral_combine_division_bottomup[symmetric]) - apply (rule d) - unfolding forall_in_division[OF d(1)] - using f_int unfolding absolutely_integrable_on_def - apply auto - done + apply (rule integral_combine_division_bottomup[OF ddiv, symmetric]) + using absolutely_integrable_on_def d'(4) f_int by blast also have "\ \ integral (cbox a b) (\x. if x \ UNIV then norm (f x) else 0)" proof - have "\d \ cbox a b" - apply rule - apply (drule K(2)[rule_format]) - apply (rule ab[unfolded subset_eq,rule_format]) - apply (auto simp add: dist_norm) - done + using K(2) ab by fastforce then show ?thesis - apply - - apply (subst if_P) - apply rule - apply (rule integral_subset_le) - defer - apply (rule integrable_on_subdivision[of _ _ _ "cbox a b"]) - apply (rule d) - using f_int[of a b] unfolding absolutely_integrable_on_def - apply auto - done + using integrable_on_subdivision[OF ddiv] f_int[of a b] unfolding absolutely_integrable_on_def + by (auto intro!: integral_subset_le) qed finally show ?case . next @@ -2119,11 +2097,7 @@ show "\(\(x,k) \ p. content k *\<^sub>R norm (f x)) - integral (cbox a b) (\x. norm(f x))\ < e/2" using d1[OF p(1,2)] by (simp only: real_norm_def) show "(\(x,k) \ p. content k *\<^sub>R norm (f x)) = (\(x,k) \ p. norm (content k *\<^sub>R f x))" - apply (rule sum.cong) - apply (rule refl) - unfolding split_paired_all split_conv - apply (drule tagged_division_ofD(4)[OF p(1)]) - by simp + by (auto simp: split_paired_all sum.cong [OF refl]) show "(\(x,k) \ p. norm (integral k f)) \ ?S" using partial_division_of_tagged_division[of p "cbox a b"] p(1) apply (subst sum.over_tagged_division_lemma[OF p(1)]) diff -r 65b6d48fc9a9 -r 89b6455b63b6 src/HOL/Analysis/Gamma_Function.thy --- a/src/HOL/Analysis/Gamma_Function.thy Fri Aug 25 13:01:13 2017 +0100 +++ b/src/HOL/Analysis/Gamma_Function.thy Fri Aug 25 23:30:36 2017 +0100 @@ -719,22 +719,22 @@ hence "(\n. of_real (ln (real n / (real n + 1)))) \ (0 :: 'a)" by (simp add: add_ac) hence lim: "(\n. of_real (ln (real n)) - of_real (ln (real n + 1))) \ (0::'a)" proof (rule Lim_transform_eventually [rotated]) - show "eventually (\n. of_real (ln (real n / (real n + 1))) = + show "eventually (\n. of_real (ln (real n / (real n + 1))) = of_real (ln (real n)) - (of_real (ln (real n + 1)) :: 'a)) at_top" using eventually_gt_at_top[of "0::nat"] by eventually_elim (simp add: ln_div) qed from summable_Digamma[OF z] - have "(\n. inverse (of_nat (n+1)) - inverse (z + of_nat n)) + have "(\n. inverse (of_nat (n+1)) - inverse (z + of_nat n)) sums (Digamma z + euler_mascheroni)" by (simp add: Digamma_def summable_sums) from sums_diff[OF this euler_mascheroni_sum] have "(\n. of_real (ln (real (Suc n) + 1)) - of_real (ln (real n + 1)) - inverse (z + of_nat n)) sums Digamma z" by (simp add: add_ac) - hence "(\m. (\nm. (\nn Digamma z" by (simp add: sums_def sum_subtractf) - also have "(\m. (\nm. (\nm. of_real (ln (m + 1)) :: 'a)" by (subst sum_lessThan_telescope) simp_all finally show ?thesis by (rule Lim_transform) (insert lim, simp) @@ -977,17 +977,17 @@ shows "A \ \\<^sub>\\<^sub>0 = {} \ continuous_on A ln_Gamma" by (intro continuous_at_imp_continuous_on ballI isCont_ln_Gamma_complex[OF continuous_ident]) fastforce - + lemma deriv_Polygamma: assumes "z \ \\<^sub>\\<^sub>0" - shows "deriv (Polygamma m) z = + shows "deriv (Polygamma m) z = Polygamma (Suc m) (z :: 'a :: {real_normed_field,euclidean_space})" by (intro DERIV_imp_deriv has_field_derivative_Polygamma assms) thm has_field_derivative_Polygamma lemma higher_deriv_Polygamma: assumes "z \ \\<^sub>\\<^sub>0" - shows "(deriv ^^ n) (Polygamma m) z = + shows "(deriv ^^ n) (Polygamma m) z = Polygamma (m + n) (z :: 'a :: {real_normed_field,euclidean_space})" proof - have "eventually (\u. (deriv ^^ n) (Polygamma m) u = Polygamma (m + n) u) (nhds z)" @@ -995,7 +995,7 @@ case (Suc n) from Suc.IH have "eventually (\z. eventually (\u. (deriv ^^ n) (Polygamma m) u = Polygamma (m + n) u) (nhds z)) (nhds z)" by (simp add: eventually_eventually) - hence "eventually (\z. deriv ((deriv ^^ n) (Polygamma m)) z = + hence "eventually (\z. deriv ((deriv ^^ n) (Polygamma m)) z = deriv (Polygamma (m + n)) z) (nhds z)" by eventually_elim (intro deriv_cong_ev refl) moreover have "eventually (\z. z \ UNIV - \\<^sub>\\<^sub>0) (nhds z)" using assms @@ -1478,9 +1478,9 @@ lemma analytic_Gamma: "A \ \\<^sub>\\<^sub>0 = {} \ Gamma analytic_on A" by (rule analytic_on_subset[of _ "UNIV - \\<^sub>\\<^sub>0"], subst analytic_on_open) (auto intro!: holomorphic_Gamma) - - -lemma field_differentiable_ln_Gamma_complex: + + +lemma field_differentiable_ln_Gamma_complex: "z \ \\<^sub>\\<^sub>0 \ ln_Gamma field_differentiable (at (z::complex) within A)" by (rule field_differentiable_within_subset[of _ _ UNIV]) (force simp: field_differentiable_def intro!: derivative_intros)+ @@ -1648,8 +1648,8 @@ lemma ln_Gamma_complex_conv_fact: "n > 0 \ ln_Gamma (of_nat n :: complex) = ln (fact (n - 1))" using ln_Gamma_complex_of_real[of "real n"] Gamma_fact[of "n - 1", where 'a = real] - by (simp add: ln_Gamma_real_pos of_nat_diff Ln_of_real [symmetric]) - + by (simp add: ln_Gamma_real_pos of_nat_diff Ln_of_real [symmetric]) + lemma ln_Gamma_real_conv_fact: "n > 0 \ ln_Gamma (real n) = ln (fact (n - 1))" using Gamma_fact[of "n - 1", where 'a = real] by (simp add: ln_Gamma_real_pos of_nat_diff Ln_of_real [symmetric]) @@ -1668,14 +1668,14 @@ show "eventually (\y. ln_Gamma y = (Re \ ln_Gamma \ of_real) y) (nhds x)" by (auto elim!: eventually_mono simp: ln_Gamma_complex_of_real interior_open) qed - -lemma field_differentiable_ln_Gamma_real: + +lemma field_differentiable_ln_Gamma_real: "x > 0 \ ln_Gamma field_differentiable (at (x::real) within A)" by (rule field_differentiable_within_subset[of _ _ UNIV]) (auto simp: field_differentiable_def intro!: derivative_intros)+ declare has_field_derivative_ln_Gamma_real[THEN DERIV_chain2, derivative_intros] - + lemma deriv_ln_Gamma_real: assumes "z > 0" shows "deriv ln_Gamma z = Digamma (z :: real)" @@ -1785,12 +1785,12 @@ subsection \The uniqueness of the real Gamma function\ text \ - The following is a proof of the Bohr--Mollerup theorem, which states that + The following is a proof of the Bohr--Mollerup theorem, which states that any log-convex function $G$ on the positive reals that fulfils $G(1) = 1$ and - satisfies the functional equation $G(x+1) = x G(x)$ must be equal to the + satisfies the functional equation $G(x+1) = x G(x)$ must be equal to the Gamma function. - In principle, if $G$ is a holomorphic complex function, one could then extend - this from the positive reals to the entire complex plane (minus the non-positive + In principle, if $G$ is a holomorphic complex function, one could then extend + this from the positive reals to the entire complex plane (minus the non-positive integers, where the Gamma function is not defined). \ @@ -1809,7 +1809,7 @@ private definition S :: "real \ real \ real" where "S x y = (ln (G y) - ln (G x)) / (y - x)" -private lemma S_eq: +private lemma S_eq: "n \ 2 \ S (of_nat n) (of_nat n + x) = (ln (G (real n + x)) - ln (fact (n - 1))) / x" by (subst G_fact [symmetric]) (simp add: S_def add_ac of_nat_diff) @@ -1821,16 +1821,16 @@ (ln \ G) (real (Suc n) - 1)) / (real (Suc n) + x - (real (Suc n) - 1)) * (real (Suc n) - (real (Suc n) - 1)) + (ln \ G) (real (Suc n) - 1)" using x n by (intro convex_onD_Icc' convex_on_subset[OF log_convex_G]) auto - hence "S (of_nat n) (of_nat (Suc n)) \ S (of_nat (Suc n)) (of_nat (Suc n) + x)" + hence "S (of_nat n) (of_nat (Suc n)) \ S (of_nat (Suc n)) (of_nat (Suc n) + x)" unfolding S_def using x by (simp add: field_simps) also have "S (of_nat n) (of_nat (Suc n)) = ln (fact n) - ln (fact (n-1))" - unfolding S_def using n + unfolding S_def using n by (subst (1 2) G_fact [symmetric]) (simp_all add: add_ac of_nat_diff) also have "\ = ln (fact n / fact (n-1))" by (subst ln_div) simp_all also from n have "fact n / fact (n - 1) = n" by (cases n) simp_all finally have "x * ln (real n) + ln (fact n) \ ln (G (real (Suc n) + x))" using x n by (subst (asm) S_eq) (simp_all add: field_simps) - also have "x * ln (real n) + ln (fact n) = ln (exp (x * ln (real n)) * fact n)" + also have "x * ln (real n) + ln (fact n) = ln (exp (x * ln (real n)) * fact n)" using x by (simp add: ln_mult) finally have "exp (x * ln (real n)) * fact n \ G (real (Suc n) + x)" using x by (subst (asm) ln_le_cancel_iff) (simp_all add: G_pos) @@ -1847,15 +1847,15 @@ proof - have "(ln \ G) (real n + x) \ ((ln \ G) (real n + 1) - (ln \ G) (real n)) / (real n + 1 - (real n)) * - ((real n + x) - real n) + (ln \ G) (real n)" + ((real n + x) - real n) + (ln \ G) (real n)" using x n by (intro convex_onD_Icc' convex_on_subset[OF log_convex_G]) auto - hence "S (of_nat n) (of_nat n + x) \ S (of_nat n) (of_nat n + 1)" + hence "S (of_nat n) (of_nat n + x) \ S (of_nat n) (of_nat n + 1)" unfolding S_def using x by (simp add: field_simps) also from n have "S (of_nat n) (of_nat n + 1) = ln (fact n) - ln (fact (n-1))" by (subst (1 2) G_fact [symmetric]) (simp add: S_def add_ac of_nat_diff) also have "\ = ln (fact n / (fact (n-1)))" using n by (subst ln_div) simp_all also from n have "fact n / fact (n - 1) = n" by (cases n) simp_all - finally have "ln (G (real n + x)) \ x * ln (real n) + ln (fact (n - 1))" + finally have "ln (G (real n + x)) \ x * ln (real n) + ln (fact (n - 1))" using x n by (subst (asm) S_eq) (simp_all add: field_simps) also have "\ = ln (exp (x * ln (real n)) * fact (n - 1))" using x by (simp add: ln_mult) @@ -1867,7 +1867,7 @@ finally have "G x \ exp (x * ln (real n)) * fact (n- 1) / pochhammer x n" using x by (simp add: field_simps pochhammer_pos) also from n have "fact (n - 1) = fact n / n" by (cases n) simp_all - also have "exp (x * ln (real n)) * \ / pochhammer x n = + also have "exp (x * ln (real n)) * \ / pochhammer x n = Gamma_series x n * (1 + x / real n)" using n x by (simp add: Gamma_series_def divide_simps pochhammer_Suc) finally show ?thesis . @@ -1886,7 +1886,7 @@ show "G x \ Gamma x" proof (rule tendsto_lowerbound) have "(\n. Gamma_series x n * (1 + x / real n)) \ Gamma x * (1 + 0)" - by (rule tendsto_intros real_tendsto_divide_at_top + by (rule tendsto_intros real_tendsto_divide_at_top Gamma_series_LIMSEQ filterlim_real_sequentially)+ thus "(\n. Gamma_series x n * (1 + x / real n)) \ Gamma x" by simp next @@ -1907,7 +1907,7 @@ with Suc show ?case using G_plus1[of "real n + x"] Gamma_plus1[of "real n + x"] by (auto simp: add_ac) qed (simp_all add: G_eq_Gamma_aux) - + show ?thesis proof (cases "frac x = 0") case True @@ -2129,9 +2129,9 @@ also have "g \ (\x. x - of_int n) = g" by (intro ext) (simp add: g.minus_of_int) finally show "(g has_field_derivative (h z * g z)) (at z)" by (simp add: z h_def) qed - + have g_holo [holomorphic_intros]: "g holomorphic_on A" for A - by (rule holomorphic_on_subset[of _ UNIV]) + by (rule holomorphic_on_subset[of _ UNIV]) (force simp: holomorphic_on_open intro!: derivative_intros)+ have g_eq: "g (z/2) * g ((z+1)/2) = Gamma (1/2)^2 * g z" if "Re z > -1" "Re z < 2" for z @@ -2193,10 +2193,10 @@ have g_nz [simp]: "g z \ 0" for z :: complex unfolding g_def using Ints_diff[of 1 "1 - z"] by (auto simp: Gamma_eq_zero_iff sin_eq_0 dest!: nonpos_Ints_Int) - + have h_altdef: "h z = deriv g z / g z" for z :: complex using DERIV_imp_deriv[OF g_g', of z] by simp - + have h_eq: "h z = (h (z/2) + h ((z+1)/2)) / 2" for z proof - have "((\t. g (t/2) * g ((t+1)/2)) has_field_derivative @@ -2485,7 +2485,7 @@ let ?r' = "\n. exp (z * of_real (ln (of_nat (Suc n) / of_nat n)))" from z have z': "z \ 0" by auto - have "eventually (\n. ?r' n = ?r n) sequentially" + have "eventually (\n. ?r' n = ?r n) sequentially" using z by (auto simp: divide_simps Gamma_series_def ring_distribs exp_diff ln_div add_ac intro: eventually_mono eventually_gt_at_top[of "0::nat"] dest: pochhammer_eq_0_imp_nonpos_Int) moreover have "?r' \ exp (z * of_real (ln 1))" @@ -2711,7 +2711,7 @@ have "f integrable_on {c..}" by (rule integrable_spike_finite[of "{c}", OF _ _ A]) (simp_all add: f_def) ultimately show "f integrable_on {0..}" - by (rule integrable_union') (insert c, auto simp: max_def) + by (rule integrable_Un') (insert c, auto simp: max_def) qed lemma Gamma_integral_complex: @@ -2948,9 +2948,9 @@ theorem wallis: "(\n. \k=1..n. (4*real k^2) / (4*real k^2 - 1)) \ pi / 2" proof - - from tendsto_inverse[OF tendsto_mult[OF + from tendsto_inverse[OF tendsto_mult[OF sin_product_formula_real[of "1/2"] tendsto_const[of "2/pi"]]] - have "(\n. (\k=1..n. inverse (1 - (1 / 2)\<^sup>2 / (real k)\<^sup>2))) \ pi/2" + have "(\n. (\k=1..n. inverse (1 - (1 / 2)\<^sup>2 / (real k)\<^sup>2))) \ pi/2" by (simp add: prod_inversef [symmetric]) also have "(\n. (\k=1..n. inverse (1 - (1 / 2)\<^sup>2 / (real k)\<^sup>2))) = (\n. (\k=1..n. (4*real k^2)/(4*real k^2 - 1)))" diff -r 65b6d48fc9a9 -r 89b6455b63b6 src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Fri Aug 25 13:01:13 2017 +0100 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Fri Aug 25 23:30:36 2017 +0100 @@ -1,5 +1,6 @@ (* Author: John Harrison - Author: Robert Himmelmann, TU Muenchen (Translation from HOL light); proofs reworked by LCP + Author: Robert Himmelmann, TU Muenchen (Translation from HOL light) + Huge cleanup by LCP *) section \Henstock-Kurzweil gauge integration in many dimensions.\ @@ -165,23 +166,23 @@ qed lemma division_of_content_0: - assumes "content (cbox a b) = 0" "d division_of (cbox a b)" - shows "\k\d. content k = 0" + assumes "content (cbox a b) = 0" "d division_of (cbox a b)" "K \ d" + shows "content K = 0" unfolding forall_in_division[OF assms(2)] - by (metis antisym_conv assms content_pos_le content_subset division_ofD(2)) + by (meson assms content_0_subset division_of_def) lemma sum_content_null: assumes "content (cbox a b) = 0" and "p tagged_division_of (cbox a b)" - shows "(\(x,k)\p. content k *\<^sub>R f x) = (0::'a::real_normed_vector)" + shows "(\(x,K)\p. content K *\<^sub>R f x) = (0::'a::real_normed_vector)" proof (rule sum.neutral, rule) fix y assume y: "y \ p" - obtain x k where xk: "y = (x, k)" + obtain x K where xk: "y = (x, K)" using surj_pair[of y] by blast - then obtain c d where k: "k = cbox c d" "k \ cbox a b" + then obtain c d where k: "K = cbox c d" "K \ cbox a b" by (metis assms(2) tagged_division_ofD(3) tagged_division_ofD(4) y) - have "(\(x, k). content k *\<^sub>R f x) y = content k *\<^sub>R f x" + have "(\(x',K'). content K' *\<^sub>R f x') y = content K *\<^sub>R f x" unfolding xk by auto also have "\ = 0" using assms(1) content_0_subset k(2) by auto @@ -5337,11 +5338,10 @@ subsection \Adding integrals over several sets\ -lemma has_integral_union: +lemma has_integral_Un: fixes f :: "'n::euclidean_space \ 'a::banach" - assumes "(f has_integral i) s" - and "(f has_integral j) t" - and "negligible (s \ t)" + assumes f: "(f has_integral i) s" "(f has_integral j) t" + and neg: "negligible (s \ t)" shows "(f has_integral (i + j)) (s \ t)" proof - note * = has_integral_restrict_UNIV[symmetric, of f] @@ -5349,28 +5349,28 @@ unfolding * apply (rule has_integral_spike[OF assms(3)]) defer - apply (rule has_integral_add[OF assms(1-2)[unfolded *]]) + apply (rule has_integral_add[OF f[unfolded *]]) apply auto done qed -lemma integrable_union: +lemma integrable_Un: fixes f :: "'a::euclidean_space \ 'b :: banach" assumes "negligible (A \ B)" "f integrable_on A" "f integrable_on B" shows "f integrable_on (A \ B)" proof - from assms obtain y z where "(f has_integral y) A" "(f has_integral z) B" by (auto simp: integrable_on_def) - from has_integral_union[OF this assms(1)] show ?thesis by (auto simp: integrable_on_def) + from has_integral_Un[OF this assms(1)] show ?thesis by (auto simp: integrable_on_def) qed -lemma integrable_union': +lemma integrable_Un': fixes f :: "'a::euclidean_space \ 'b :: banach" assumes "f integrable_on A" "f integrable_on B" "negligible (A \ B)" "C = A \ B" shows "f integrable_on C" - using integrable_union[of A B f] assms by simp - -lemma has_integral_unions: + using integrable_Un[of A B f] assms by simp + +lemma has_integral_Union: fixes f :: "'n::euclidean_space \ 'a::banach" assumes "finite t" and "\s\t. (f has_integral (i s)) s" @@ -5401,22 +5401,12 @@ then show ?case proof (cases "x \ \t") case True - then guess s unfolding Union_iff..note s=this - then have *: "\b\t. x \ b \ b = s" + then obtain s where "s \ t" "x \ s" + by blast + moreover then have "\b\t. x \ b \ b = s" using prems(3) by blast - show ?thesis - unfolding if_P[OF True] - apply (rule trans) - defer - apply (rule sum.cong) - apply (rule refl) - apply (subst *) - apply assumption - apply (rule refl) - unfolding sum.delta[OF assms(1)] - using s - apply auto - done + ultimately show ?thesis + by (simp add: sum.delta[OF assms(1)]) qed auto qed qed @@ -5426,36 +5416,29 @@ lemma has_integral_combine_division: fixes f :: "'n::euclidean_space \ 'a::banach" - assumes "d division_of s" - and "\k\d. (f has_integral (i k)) k" - shows "(f has_integral (sum i d)) s" + assumes "d division_of S" + and "\k. k \ d \ (f has_integral (i k)) k" + shows "(f has_integral (sum i d)) S" proof - note d = division_ofD[OF assms(1)] + have neg: "negligible (S \ s')" if "S \ d" "s' \ d" "S \ s'" for S s' + proof - + obtain a c b d where obt: "S = cbox a b" "s' = cbox c d" + by (meson \S \ d\ \s' \ d\ d(4)) + from d(5)[OF that] show ?thesis + unfolding obt interior_cbox + by (metis (no_types, lifting) Diff_empty Int_interval box_Int_box negligible_frontier_interval) + qed show ?thesis unfolding d(6)[symmetric] - apply (rule has_integral_unions) - apply (rule d assms)+ - apply rule - apply rule - apply rule - proof goal_cases - case prems: (1 s s') - from d(4)[OF this(1)] d(4)[OF this(2)] guess a c b d by (elim exE) note obt=this - from d(5)[OF prems] show ?case - unfolding obt interior_cbox - apply - - apply (rule negligible_subset[of "(cbox a b-box a b) \ (cbox c d-box c d)"]) - apply (rule negligible_Un negligible_frontier_interval)+ - apply auto - done - qed + by (auto intro: d neg assms has_integral_Union) qed lemma integral_combine_division_bottomup: fixes f :: "'n::euclidean_space \ 'a::banach" - assumes "d division_of s" - and "\k\d. f integrable_on k" - shows "integral s f = sum (\i. integral i f) d" + assumes "d division_of S" + and "\k. k \ d \ f integrable_on k" + shows "integral S f = sum (\i. integral i f) d" apply (rule integral_unique) apply (rule has_integral_combine_division[OF assms(1)]) using assms(2) @@ -5465,12 +5448,11 @@ lemma has_integral_combine_division_topdown: fixes f :: "'n::euclidean_space \ 'a::banach" - assumes "f integrable_on s" + assumes "f integrable_on S" and "d division_of k" - and "k \ s" + and "k \ S" shows "(f has_integral (sum (\i. integral i f) d)) k" apply (rule has_integral_combine_division[OF assms(2)]) - apply safe unfolding has_integral_integral[symmetric] proof goal_cases case (1 k) @@ -5486,9 +5468,9 @@ lemma integral_combine_division_topdown: fixes f :: "'n::euclidean_space \ 'a::banach" - assumes "f integrable_on s" - and "d division_of s" - shows "integral s f = sum (\i. integral i f) d" + assumes "f integrable_on S" + and "d division_of S" + shows "integral S f = sum (\i. integral i f) d" apply (rule integral_unique) apply (rule has_integral_combine_division_topdown) using assms @@ -5497,9 +5479,9 @@ lemma integrable_combine_division: fixes f :: "'n::euclidean_space \ 'a::banach" - assumes "d division_of s" + assumes "d division_of S" and "\i\d. f integrable_on i" - shows "f integrable_on s" + shows "f integrable_on S" using assms(2) unfolding integrable_on_def by (metis has_integral_combine_division[OF assms(1)]) @@ -5507,8 +5489,8 @@ lemma integrable_on_subdivision: fixes f :: "'n::euclidean_space \ 'a::banach" assumes "d division_of i" - and "f integrable_on s" - and "i \ s" + and "f integrable_on S" + and "i \ S" shows "f integrable_on i" apply (rule integrable_combine_division assms)+ apply safe @@ -5526,16 +5508,16 @@ subsection \Also tagged divisions\ -lemma has_integral_iff: "(f has_integral i) s \ (f integrable_on s \ integral s f = i)" +lemma has_integral_iff: "(f has_integral i) S \ (f integrable_on S \ integral S f = i)" by blast lemma has_integral_combine_tagged_division: fixes f :: "'n::euclidean_space \ 'a::banach" - assumes "p tagged_division_of s" + assumes "p tagged_division_of S" and "\(x,k) \ p. (f has_integral (i k)) k" - shows "(f has_integral (\(x,k)\p. i k)) s" + shows "(f has_integral (\(x,k)\p. i k)) S" proof - - have *: "(f has_integral (\k\snd`p. integral k f)) s" + have *: "(f has_integral (\k\snd`p. integral k f)) S" using assms(2) apply (intro has_integral_combine_division) apply (auto simp: has_integral_integral[symmetric] intro: division_of_tagged_division[OF assms(1)]) @@ -5603,8 +5585,9 @@ note p' = tagged_partial_division_ofD[OF p(1)] have "\(snd ` p) \ cbox a b" using p'(3) by fastforce - note partial_division_of_tagged_division[OF p(1)] this - from partial_division_extend_interval[OF this] guess q . note q=this and q' = division_ofD[OF this(2)] + then obtain q where q: "snd ` p \ q" "q division_of cbox a b" + by (meson p(1) partial_division_extend_interval partial_division_of_tagged_division) + note q' = division_ofD[OF this(2)] define r where "r = q - snd ` p" have "snd ` p \ r = {}" unfolding r_def by auto