diff -r 96a43caa4902 -r 689997a8a582 src/HOL/Analysis/Interval_Integral.thy --- a/src/HOL/Analysis/Interval_Integral.thy Thu Jan 17 16:22:21 2019 -0500 +++ b/src/HOL/Analysis/Interval_Integral.thy Thu Jan 17 16:28:07 2019 -0500 @@ -4,15 +4,15 @@ Lebesgue integral over an interval (with endpoints possibly +-\) *) -theory Interval_Integral +theory Interval_Integral (*FIX ME rename? Lebesgue *) imports Equivalence_Lebesgue_Henstock_Integration begin -lemma%important continuous_on_vector_derivative: +lemma continuous_on_vector_derivative: "(\x. x \ S \ (f has_vector_derivative f' x) (at x within S)) \ continuous_on S f" - by%unimportant (auto simp: continuous_on_eq_continuous_within intro!: has_vector_derivative_continuous) + by (auto simp: continuous_on_eq_continuous_within intro!: has_vector_derivative_continuous) -definition%important "einterval a b = {x. a < ereal x \ ereal x < b}" +definition "einterval a b = {x. a < ereal x \ ereal x < b}" lemma einterval_eq[simp]: shows einterval_eq_Icc: "einterval (ereal a) (ereal b) = {a <..< b}" @@ -37,16 +37,16 @@ lemma borel_einterval[measurable]: "einterval a b \ sets borel" unfolding einterval_def by measurable -subsection\Approximating a (possibly infinite) interval\ +subsection%important \Approximating a (possibly infinite) interval\ lemma filterlim_sup1: "(LIM x F. f x :> G1) \ (LIM x F. f x :> (sup G1 G2))" unfolding filterlim_def by (auto intro: le_supI1) -lemma%important ereal_incseq_approx: +lemma ereal_incseq_approx: fixes a b :: ereal assumes "a < b" obtains X :: "nat \ real" where "incseq X" "\i. a < X i" "\i. X i < b" "X \ b" -proof%unimportant (cases b) +proof (cases b) case PInf with \a < b\ have "a = -\ \ (\r. a = ereal r)" by (cases a) auto @@ -78,12 +78,12 @@ (auto simp: real incseq_def intro!: divide_left_mono) qed (insert \a < b\, auto) -lemma%important ereal_decseq_approx: +lemma ereal_decseq_approx: fixes a b :: ereal assumes "a < b" obtains X :: "nat \ real" where "decseq X" "\i. a < X i" "\i. X i < b" "X \ a" -proof%unimportant - +proof - have "-b < -a" using \a < b\ by simp from ereal_incseq_approx[OF this] guess X . then show thesis @@ -93,14 +93,14 @@ done qed -lemma%important einterval_Icc_approximation: +proposition einterval_Icc_approximation: fixes a b :: ereal assumes "a < b" obtains u l :: "nat \ real" where "einterval a b = (\i. {l i .. u i})" "incseq u" "decseq l" "\i. l i < u i" "\i. a < l i" "\i. u i < b" "l \ a" "u \ b" -proof%unimportant - +proof - from dense[OF \a < b\] obtain c where "a < c" "c < b" by safe from ereal_incseq_approx[OF \c < b\] guess u . note u = this from ereal_decseq_approx[OF \a < c\] guess l . note l = this @@ -202,17 +202,17 @@ interval_lebesgue_integrable M a b (\x. c * f x)" by (simp add: interval_lebesgue_integrable_def) -lemma%important interval_lebesgue_integrable_mult_left [intro, simp]: +lemma interval_lebesgue_integrable_mult_left [intro, simp]: fixes M a b c and f :: "real \ 'a::{banach, real_normed_field, second_countable_topology}" shows "(c \ 0 \ interval_lebesgue_integrable M a b f) \ interval_lebesgue_integrable M a b (\x. f x * c)" - by%unimportant (simp add: interval_lebesgue_integrable_def) + by (simp add: interval_lebesgue_integrable_def) -lemma%important interval_lebesgue_integrable_divide [intro, simp]: +lemma interval_lebesgue_integrable_divide [intro, simp]: fixes M a b c and f :: "real \ 'a::{banach, real_normed_field, field, second_countable_topology}" shows "(c \ 0 \ interval_lebesgue_integrable M a b f) \ interval_lebesgue_integrable M a b (\x. f x / c)" - by%unimportant (simp add: interval_lebesgue_integrable_def) + by (simp add: interval_lebesgue_integrable_def) lemma interval_lebesgue_integral_mult_right [simp]: fixes M a b c and f :: "real \ 'a::{banach, real_normed_field, second_countable_topology}" @@ -220,11 +220,11 @@ c * interval_lebesgue_integral M a b f" by (simp add: interval_lebesgue_integral_def) -lemma%important interval_lebesgue_integral_mult_left [simp]: +lemma interval_lebesgue_integral_mult_left [simp]: fixes M a b c and f :: "real \ 'a::{banach, real_normed_field, second_countable_topology}" shows "interval_lebesgue_integral M a b (\x. f x * c) = interval_lebesgue_integral M a b f * c" - by%unimportant (simp add: interval_lebesgue_integral_def) + by (simp add: interval_lebesgue_integral_def) lemma interval_lebesgue_integral_divide [simp]: fixes M a b c and f :: "real \ 'a::{banach, real_normed_field, field, second_countable_topology}" @@ -242,11 +242,11 @@ unfolding interval_lebesgue_integral_def by (auto simp: interval_lebesgue_integral_def set_integral_complex_of_real) -lemma%important interval_lebesgue_integral_le_eq: +lemma interval_lebesgue_integral_le_eq: fixes a b f assumes "a \ b" shows "interval_lebesgue_integral M a b f = (LINT x : einterval a b | M. f x)" -using%unimportant assms by (auto simp: interval_lebesgue_integral_def) + using assms by (auto simp: interval_lebesgue_integral_def) lemma interval_lebesgue_integral_gt_eq: fixes a b f @@ -271,9 +271,9 @@ interval_lebesgue_integrable lborel b a f" by (cases a b rule: linorder_cases) (auto simp: interval_lebesgue_integrable_def einterval_same) -lemma%important interval_integral_reflect: +lemma interval_integral_reflect: "(LBINT x=a..b. f x) = (LBINT x=-b..-a. f (-x))" -proof%unimportant (induct a b rule: linorder_wlog) +proof (induct a b rule: linorder_wlog) case (sym a b) then show ?case by (auto simp: interval_lebesgue_integral_def interval_integrable_endpoints_reverse split: if_split_asm) @@ -299,7 +299,7 @@ lemma interval_integral_to_infinity_eq: "(LINT x=ereal a..\ | M. f x) = (LINT x : {a<..} | M. f x)" unfolding interval_lebesgue_integral_def by auto -lemma%important interval_integrable_to_infinity_eq: "(interval_lebesgue_integrable M a \ f) = +proposition interval_integrable_to_infinity_eq: "(interval_lebesgue_integrable M a \ f) = (set_integrable M {a<..} f)" unfolding%unimportant interval_lebesgue_integrable_def by auto @@ -317,12 +317,12 @@ unfolding interval_lebesgue_integral_def interval_lebesgue_integrable_def einterval_eq by (auto simp: less_imp_le field_simps measure_def set_integrable_def set_lebesgue_integral_def) -lemma%important interval_integral_cong_AE: +lemma interval_integral_cong_AE: assumes [measurable]: "f \ borel_measurable borel" "g \ borel_measurable borel" assumes "AE x \ einterval (min a b) (max a b) in lborel. f x = g x" shows "interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g" using assms -proof%unimportant (induct a b rule: linorder_wlog) +proof (induct a b rule: linorder_wlog) case (sym a b) then show ?case by (simp add: min.commute max.commute interval_integral_endpoints_reverse[of a b]) next @@ -331,11 +331,11 @@ intro!: set_lebesgue_integral_cong_AE) qed -lemma%important interval_integral_cong: +lemma interval_integral_cong: assumes "\x. x \ einterval (min a b) (max a b) \ f x = g x" shows "interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g" using assms -proof%unimportant (induct a b rule: linorder_wlog) +proof (induct a b rule: linorder_wlog) case (sym a b) then show ?case by (simp add: min.commute max.commute interval_integral_endpoints_reverse[of a b]) next @@ -407,11 +407,11 @@ apply (auto simp: eq anti_eq einterval_iff split: split_indicator) done -lemma%important interval_integral_sum: +lemma interval_integral_sum: fixes a b c :: ereal assumes integrable: "interval_lebesgue_integrable lborel (min a (min b c)) (max a (max b c)) f" shows "(LBINT x=a..b. f x) + (LBINT x=b..c. f x) = (LBINT x=a..c. f x)" -proof%unimportant - +proof - let ?I = "\a b. LBINT x=a..b. f x" { fix a b c :: ereal assume "interval_lebesgue_integrable lborel a c f" "a \ b" "b \ c" then have ord: "a \ b" "b \ c" "a \ c" and f': "set_integrable lborel (einterval a c) f" @@ -446,11 +446,11 @@ (simp_all add: min_absorb1 min_absorb2 max_absorb1 max_absorb2 field_simps 1 2 3) qed -lemma%important interval_integrable_isCont: +lemma interval_integrable_isCont: fixes a b and f :: "real \ 'a::{banach, second_countable_topology}" shows "(\x. min a b \ x \ x \ max a b \ isCont f x) \ interval_lebesgue_integrable lborel a b f" -proof%unimportant (induct a b rule: linorder_wlog) +proof (induct a b rule: linorder_wlog) case (le a b) then show ?case unfolding interval_lebesgue_integrable_def set_integrable_def by (auto simp: interval_lebesgue_integrable_def @@ -478,7 +478,7 @@ subsection%important\General limit approximation arguments\ -lemma%important interval_integral_Icc_approx_nonneg: +proposition interval_integral_Icc_approx_nonneg: fixes a b :: ereal assumes "a < b" fixes u l :: "nat \ real" @@ -493,7 +493,7 @@ shows "set_integrable lborel (einterval a b) f" "(LBINT x=a..b. f x) = C" -proof%unimportant - +proof - have 1 [unfolded set_integrable_def]: "\i. set_integrable lborel {l i..u i} f" by (rule f_integrable) have 2: "AE x in lborel. mono (\n. indicator {l n..u n} x *\<^sub>R f x)" proof - @@ -534,7 +534,7 @@ by (rule integrable_monotone_convergence[OF 1 2 3 4 5]) qed -lemma%important interval_integral_Icc_approx_integrable: +proposition interval_integral_Icc_approx_integrable: fixes u l :: "nat \ real" and a b :: ereal fixes f :: "real \ 'a::{banach, second_countable_topology}" assumes "a < b" @@ -543,7 +543,7 @@ "l \ a" "u \ b" assumes f_integrable: "set_integrable lborel (einterval a b) f" shows "(\i. LBINT x=l i.. u i. f x) \ (LBINT x=a..b. f x)" -proof%unimportant - +proof - have "(\i. LBINT x:{l i.. u i}. f x) \ (LBINT x:einterval a b. f x)" unfolding set_lebesgue_integral_def proof (rule integral_dominated_convergence) @@ -580,13 +580,13 @@ TODO: make the older versions corollaries of these (using continuous_at_imp_continuous_on, etc.) *) -lemma%important interval_integral_FTC_finite: +lemma interval_integral_FTC_finite: fixes f F :: "real \ 'a::euclidean_space" and a b :: real assumes f: "continuous_on {min a b..max a b} f" assumes F: "\x. min a b \ x \ x \ max a b \ (F has_vector_derivative (f x)) (at x within {min a b..max a b})" shows "(LBINT x=a..b. f x) = F b - F a" -proof%unimportant (cases "a \ b") +proof (cases "a \ b") case True have "(LBINT x=a..b. f x) = (LBINT x. indicat_real {a..b} x *\<^sub>R f x)" by (simp add: True interval_integral_Icc set_lebesgue_integral_def) @@ -617,7 +617,7 @@ qed -lemma%important interval_integral_FTC_nonneg: +lemma interval_integral_FTC_nonneg: fixes f F :: "real \ real" and a b :: ereal assumes "a < b" assumes F: "\x. a < ereal x \ ereal x < b \ DERIV F x :> f x" @@ -628,7 +628,7 @@ shows "set_integrable lborel (einterval a b) f" "(LBINT x=a..b. f x) = B - A" -proof%unimportant - +proof - obtain u l where approx: "einterval a b = (\i. {l i .. u i})" "incseq u" "decseq l" "\i. l i < u i" "\i. a < l i" "\i. u i < b" @@ -669,7 +669,7 @@ by (rule interval_integral_Icc_approx_nonneg [OF \a < b\ approx 1 f_nonneg 2 3]) qed -lemma%important interval_integral_FTC_integrable: +theorem interval_integral_FTC_integrable: fixes f F :: "real \ 'a::euclidean_space" and a b :: ereal assumes "a < b" assumes F: "\x. a < ereal x \ ereal x < b \ (F has_vector_derivative f x) (at x)" @@ -678,7 +678,7 @@ assumes A: "((F \ real_of_ereal) \ A) (at_right a)" assumes B: "((F \ real_of_ereal) \ B) (at_left b)" shows "(LBINT x=a..b. f x) = B - A" -proof%unimportant - +proof - obtain u l where approx: "einterval a b = (\i. {l i .. u i})" "incseq u" "decseq l" "\i. l i < u i" "\i. a < l i" "\i. u i < b" @@ -714,14 +714,14 @@ einterval. *) -lemma%important interval_integral_FTC2: +theorem interval_integral_FTC2: fixes a b c :: real and f :: "real \ 'a::euclidean_space" assumes "a \ c" "c \ b" and contf: "continuous_on {a..b} f" fixes x :: real assumes "a \ x" and "x \ b" shows "((\u. LBINT y=c..u. f y) has_vector_derivative (f x)) (at x within {a..b})" -proof%unimportant - +proof - let ?F = "(\u. LBINT y=a..u. f y)" have intf: "set_integrable lborel {a..b} f" by (rule borel_integrable_atLeastAtMost', rule contf) @@ -746,11 +746,11 @@ qed (insert assms, auto) qed -lemma%important einterval_antiderivative: +proposition einterval_antiderivative: fixes a b :: ereal and f :: "real \ 'a::euclidean_space" assumes "a < b" and contf: "\x :: real. a < x \ x < b \ isCont f x" shows "\F. \x :: real. a < x \ x < b \ (F has_vector_derivative f x) (at x)" -proof%unimportant - +proof - from einterval_nonempty [OF \a < b\] obtain c :: real where [simp]: "a < c" "c < b" by (auto simp: einterval_def) let ?F = "(\u. LBINT y=c..u. f y)" @@ -786,14 +786,14 @@ text\Once again, three versions: first, for finite intervals, and then two versions for arbitrary intervals.\ -lemma%important interval_integral_substitution_finite: +theorem interval_integral_substitution_finite: fixes a b :: real and f :: "real \ 'a::euclidean_space" assumes "a \ b" and derivg: "\x. a \ x \ x \ b \ (g has_real_derivative (g' x)) (at x within {a..b})" and contf : "continuous_on (g ` {a..b}) f" and contg': "continuous_on {a..b} g'" shows "LBINT x=a..b. g' x *\<^sub>R f (g x) = LBINT y=g a..g b. f y" -proof%unimportant- +proof- have v_derivg: "\x. a \ x \ x \ b \ (g has_vector_derivative (g' x)) (at x within {a..b})" using derivg unfolding has_field_derivative_iff_has_vector_derivative . then have contg [simp]: "continuous_on {a..b} g" @@ -833,7 +833,7 @@ (* TODO: is it possible to lift the assumption here that g' is nonnegative? *) -lemma%important interval_integral_substitution_integrable: +theorem interval_integral_substitution_integrable: fixes f :: "real \ 'a::euclidean_space" and a b u v :: ereal assumes "a < b" and deriv_g: "\x. a < ereal x \ ereal x < b \ DERIV g x :> g' x" @@ -845,7 +845,7 @@ and integrable: "set_integrable lborel (einterval a b) (\x. g' x *\<^sub>R f (g x))" and integrable2: "set_integrable lborel (einterval A B) (\x. f x)" shows "(LBINT x=A..B. f x) = (LBINT x=a..b. g' x *\<^sub>R f (g x))" -proof%unimportant - +proof - obtain u l where approx [simp]: "einterval a b = (\i. {l i .. u i})" "incseq u" "decseq l" "\i. l i < u i" "\i. a < l i" "\i. u i < b" @@ -932,7 +932,7 @@ An alternative: make the second one the main one, and then have another lemma that says that if f is nonnegative and all the other hypotheses hold, then it is integrable. *) -lemma%important interval_integral_substitution_nonneg: +theorem interval_integral_substitution_nonneg: fixes f g g':: "real \ real" and a b u v :: ereal assumes "a < b" and deriv_g: "\x. a < ereal x \ ereal x < b \ DERIV g x :> g' x" @@ -946,7 +946,7 @@ shows "set_integrable lborel (einterval A B) f" "(LBINT x=A..B. f x) = (LBINT x=a..b. (f (g x) * g' x))" -proof%unimportant - +proof - from einterval_Icc_approximation[OF \a < b\] guess u l . note approx [simp] = this note less_imp_le [simp] have aless[simp]: "\x i. l i \ x \ a < ereal x" @@ -1079,17 +1079,17 @@ translations "CLBINT x=a..b. f" == "CONST complex_interval_lebesgue_integral CONST lborel a b (\x. f)" -lemma%important interval_integral_norm: +proposition interval_integral_norm: fixes f :: "real \ 'a :: {banach, second_countable_topology}" shows "interval_lebesgue_integrable lborel a b f \ a \ b \ norm (LBINT t=a..b. f t) \ LBINT t=a..b. norm (f t)" using%unimportant integral_norm_bound[of lborel "\x. indicator (einterval a b) x *\<^sub>R f x"] by%unimportant (auto simp: interval_lebesgue_integral_def interval_lebesgue_integrable_def set_lebesgue_integral_def) -lemma%important interval_integral_norm2: +proposition interval_integral_norm2: "interval_lebesgue_integrable lborel a b f \ norm (LBINT t=a..b. f t) \ \LBINT t=a..b. norm (f t)\" -proof%unimportant (induct a b rule: linorder_wlog) +proof (induct a b rule: linorder_wlog) case (sym a b) then show ?case by (simp add: interval_integral_endpoints_reverse[of a b] interval_integrable_endpoints_reverse[of a b]) next