# HG changeset patch # User paulson # Date 1568298765 -3600 # Node ID 7e93a10b21f0f9c6654e56c9d6f19dbd7023f219 # Parent 086575316fd57a89753f92dfccc8c5a839fb7dd5# Parent 8518a750f7bb5b53744518d8932df4dbb40707db merged diff -r 086575316fd5 -r 7e93a10b21f0 src/HOL/Analysis/Borel_Space.thy --- a/src/HOL/Analysis/Borel_Space.thy Thu Sep 12 16:21:44 2019 +0200 +++ b/src/HOL/Analysis/Borel_Space.thy Thu Sep 12 15:32:45 2019 +0100 @@ -2101,7 +2101,7 @@ fixes p::real assumes [measurable]: "f \ borel_measurable M" shows "(\x. \f x\ powr p) \ borel_measurable M" -unfolding powr_def by auto + by simp text \The next one is a variation around \measurable_restrict_space\.\ @@ -2115,6 +2115,12 @@ measurable_restrict_space2[of f, of "restrict_space M A", of B, of N] assms(2) space_restrict_space) qed +lemma measurable_restrict_mono: + assumes f: "f \ restrict_space M A \\<^sub>M N" and "B \ A" + shows "f \ restrict_space M B \\<^sub>M N" +by (rule measurable_compose[OF measurable_restrict_space3 f]) + (insert \B \ A\, auto) + text \The next one is a variation around \measurable_piecewise_restrict\.\ lemma measurable_piecewise_restrict2: diff -r 086575316fd5 -r 7e93a10b21f0 src/HOL/Analysis/Elementary_Normed_Spaces.thy --- a/src/HOL/Analysis/Elementary_Normed_Spaces.thy Thu Sep 12 16:21:44 2019 +0200 +++ b/src/HOL/Analysis/Elementary_Normed_Spaces.thy Thu Sep 12 15:32:45 2019 +0100 @@ -9,7 +9,7 @@ theory Elementary_Normed_Spaces imports "HOL-Library.FuncSet" - Elementary_Metric_Spaces + Elementary_Metric_Spaces Linear_Algebra Connected begin @@ -1100,34 +1100,6 @@ by (simp add: fun_Compl_def uniformly_continuous_on_minus) -subsection\<^marker>\tag unimportant\ \Topological properties of linear functions\ - -lemma linear_lim_0: - assumes "bounded_linear f" - shows "(f \ 0) (at (0))" -proof - - interpret f: bounded_linear f by fact - have "(f \ f 0) (at 0)" - using tendsto_ident_at by (rule f.tendsto) - then show ?thesis unfolding f.zero . -qed - -lemma linear_continuous_at: - assumes "bounded_linear f" - shows "continuous (at a) f" - unfolding continuous_at using assms - apply (rule bounded_linear.tendsto) - apply (rule tendsto_ident_at) - done - -lemma linear_continuous_within: - "bounded_linear f \ continuous (at x within s) f" - using continuous_at_imp_continuous_within[of x f s] using linear_continuous_at[of f] by auto - -lemma linear_continuous_on: - "bounded_linear f \ continuous_on s f" - using continuous_at_imp_continuous_on[of s f] using linear_continuous_at[of f] by auto - subsection\<^marker>\tag unimportant\ \Arithmetic Preserves Topological Properties\ lemma open_scaling[intro]: diff -r 086575316fd5 -r 7e93a10b21f0 src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy --- a/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Thu Sep 12 16:21:44 2019 +0200 +++ b/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Thu Sep 12 15:32:45 2019 +0100 @@ -4226,13 +4226,6 @@ qed -lemma borel_measurable_vimage_halfspace_component_lt: - "f \ borel_measurable (lebesgue_on S) \ - (\a i. i \ Basis \ {x \ S. f x \ i < a} \ sets (lebesgue_on S))" - apply (rule trans [OF borel_measurable_iff_halfspace_less]) - apply (fastforce simp add: space_restrict_space) - done - lemma borel_measurable_simple_function_limit: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" shows "f \ borel_measurable (lebesgue_on S) \ @@ -4298,174 +4291,6 @@ using borel_measurable_vimage_halfspace_component_lt by blast qed -lemma borel_measurable_vimage_halfspace_component_ge: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - shows "f \ borel_measurable (lebesgue_on S) \ - (\a i. i \ Basis \ {x \ S. f x \ i \ a} \ sets (lebesgue_on S))" - apply (rule trans [OF borel_measurable_iff_halfspace_ge]) - apply (fastforce simp add: space_restrict_space) - done - -lemma borel_measurable_vimage_halfspace_component_gt: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - shows "f \ borel_measurable (lebesgue_on S) \ - (\a i. i \ Basis \ {x \ S. f x \ i > a} \ sets (lebesgue_on S))" - apply (rule trans [OF borel_measurable_iff_halfspace_greater]) - apply (fastforce simp add: space_restrict_space) - done - -lemma borel_measurable_vimage_halfspace_component_le: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - shows "f \ borel_measurable (lebesgue_on S) \ - (\a i. i \ Basis \ {x \ S. f x \ i \ a} \ sets (lebesgue_on S))" - apply (rule trans [OF borel_measurable_iff_halfspace_le]) - apply (fastforce simp add: space_restrict_space) - done - -lemma - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - shows borel_measurable_vimage_open_interval: - "f \ borel_measurable (lebesgue_on S) \ - (\a b. {x \ S. f x \ box a b} \ sets (lebesgue_on S))" (is ?thesis1) - and borel_measurable_vimage_open: - "f \ borel_measurable (lebesgue_on S) \ - (\T. open T \ {x \ S. f x \ T} \ sets (lebesgue_on S))" (is ?thesis2) -proof - - have "{x \ S. f x \ box a b} \ sets (lebesgue_on S)" if "f \ borel_measurable (lebesgue_on S)" for a b - proof - - have "S = S \ space lebesgue" - by simp - then have "S \ (f -` box a b) \ sets (lebesgue_on S)" - by (metis (no_types) box_borel in_borel_measurable_borel inf_sup_aci(1) space_restrict_space that) - then show ?thesis - by (simp add: Collect_conj_eq vimage_def) - qed - moreover - have "{x \ S. f x \ T} \ sets (lebesgue_on S)" - if T: "\a b. {x \ S. f x \ box a b} \ sets (lebesgue_on S)" "open T" for T - proof - - obtain \ where "countable \" and \: "\X. X \ \ \ \a b. X = box a b" "\\ = T" - using open_countable_Union_open_box that \open T\ by metis - then have eq: "{x \ S. f x \ T} = (\U \ \. {x \ S. f x \ U})" - by blast - have "{x \ S. f x \ U} \ sets (lebesgue_on S)" if "U \ \" for U - using that T \ by blast - then show ?thesis - by (auto simp: eq intro: Sigma_Algebra.sets.countable_UN' [OF \countable \\]) - qed - moreover - have eq: "{x \ S. f x \ i < a} = {x \ S. f x \ {y. y \ i < a}}" for i a - by auto - have "f \ borel_measurable (lebesgue_on S)" - if "\T. open T \ {x \ S. f x \ T} \ sets (lebesgue_on S)" - by (metis (no_types) eq borel_measurable_vimage_halfspace_component_lt open_halfspace_component_lt that) - ultimately show "?thesis1" "?thesis2" - by blast+ -qed - - -lemma borel_measurable_vimage_closed: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - shows "f \ borel_measurable (lebesgue_on S) \ - (\T. closed T \ {x \ S. f x \ T} \ sets (lebesgue_on S))" - (is "?lhs = ?rhs") -proof - - have eq: "{x \ S. f x \ T} = S - {x \ S. f x \ (- T)}" for T - by auto - show ?thesis - apply (simp add: borel_measurable_vimage_open, safe) - apply (simp_all (no_asm) add: eq) - apply (intro sets.Diff sets_lebesgue_on_refl, force simp: closed_open) - apply (intro sets.Diff sets_lebesgue_on_refl, force simp: open_closed) - done -qed - -lemma borel_measurable_vimage_closed_interval: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - shows "f \ borel_measurable (lebesgue_on S) \ - (\a b. {x \ S. f x \ cbox a b} \ sets (lebesgue_on S))" - (is "?lhs = ?rhs") -proof - assume ?lhs then show ?rhs - using borel_measurable_vimage_closed by blast -next - assume RHS: ?rhs - have "{x \ S. f x \ T} \ sets (lebesgue_on S)" if "open T" for T - proof - - obtain \ where "countable \" and \: "\ \ Pow T" "\X. X \ \ \ \a b. X = cbox a b" "\\ = T" - using open_countable_Union_open_cbox that \open T\ by metis - then have eq: "{x \ S. f x \ T} = (\U \ \. {x \ S. f x \ U})" - by blast - have "{x \ S. f x \ U} \ sets (lebesgue_on S)" if "U \ \" for U - using that \ by (metis RHS) - then show ?thesis - by (auto simp: eq intro: Sigma_Algebra.sets.countable_UN' [OF \countable \\]) - qed - then show ?lhs - by (simp add: borel_measurable_vimage_open) -qed - -lemma borel_measurable_UNIV_eq: "borel_measurable (lebesgue_on UNIV) = borel_measurable lebesgue" - by auto - -lemma borel_measurable_vimage_borel: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - shows "f \ borel_measurable (lebesgue_on S) \ - (\T. T \ sets borel \ {x \ S. f x \ T} \ sets (lebesgue_on S))" - (is "?lhs = ?rhs") -proof - assume f: ?lhs - then show ?rhs - using measurable_sets [OF f] - by (simp add: Collect_conj_eq inf_sup_aci(1) space_restrict_space vimage_def) -qed (simp add: borel_measurable_vimage_open_interval) - -lemma lebesgue_measurable_vimage_borel: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - assumes "f \ borel_measurable lebesgue" "T \ sets borel" - shows "{x. f x \ T} \ sets lebesgue" - using assms borel_measurable_vimage_borel [of f UNIV] by auto - -lemma borel_measurable_if_I: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - assumes f: "f \ borel_measurable (lebesgue_on S)" and S: "S \ sets lebesgue" - shows "(\x. if x \ S then f x else 0) \ borel_measurable lebesgue" -proof - - have eq: "{x. x \ S} \ {x. f x \ Y} = {x. x \ S} \ {x. f x \ Y} \ S" for Y - by blast - show ?thesis - using f S - apply (simp add: vimage_def in_borel_measurable_borel Ball_def) - apply (elim all_forward imp_forward asm_rl) - apply (simp only: Collect_conj_eq Collect_disj_eq imp_conv_disj eq) - apply (auto simp: Compl_eq [symmetric] Compl_in_sets_lebesgue sets_restrict_space_iff) - done -qed - -lemma borel_measurable_if_D: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - assumes "(\x. if x \ S then f x else 0) \ borel_measurable lebesgue" - shows "f \ borel_measurable (lebesgue_on S)" - using assms - apply (simp add: in_borel_measurable_borel Ball_def) - apply (elim all_forward imp_forward asm_rl) - apply (force simp: space_restrict_space sets_restrict_space image_iff intro: rev_bexI) - done - -lemma borel_measurable_if: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - assumes "S \ sets lebesgue" - shows "(\x. if x \ S then f x else 0) \ borel_measurable lebesgue \ f \ borel_measurable (lebesgue_on S)" - using assms borel_measurable_if_D borel_measurable_if_I by blast - -lemma borel_measurable_lebesgue_preimage_borel: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - shows "f \ borel_measurable lebesgue \ - (\T. T \ sets borel \ {x. f x \ T} \ sets lebesgue)" - apply (intro iffI allI impI lebesgue_measurable_vimage_borel) - apply (auto simp: in_borel_measurable_borel vimage_def) - done - subsection \Lebesgue sets and continuous images\ proposition lebesgue_regular_inner: diff -r 086575316fd5 -r 7e93a10b21f0 src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Thu Sep 12 16:21:44 2019 +0200 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Thu Sep 12 15:32:45 2019 +0100 @@ -494,6 +494,11 @@ shows "(f has_integral y) S \ ((\x. f x * c) has_integral (y * c)) S" using has_integral_linear[OF _ bounded_linear_mult_left] by (simp add: comp_def) +lemma has_integral_divide: + fixes c :: "_ :: real_normed_div_algebra" + shows "(f has_integral y) S \ ((\x. f x / c) has_integral (y / c)) S" + unfolding divide_inverse by (simp add: has_integral_mult_left) + text\The case analysis eliminates the condition \<^term>\f integrable_on S\ at the cost of the type class constraint \division_ring\\ corollary integral_mult_left [simp]: @@ -2735,6 +2740,34 @@ shows "(\x. x) integrable_on {a..b}" by (metis atLeastatMost_empty_iff integrable_on_def has_integral_empty ident_has_integral) +lemma integral_sin [simp]: + fixes a::real + assumes "a \ b" shows "integral {a..b} sin = cos a - cos b" +proof - + have "(sin has_integral (- cos b - - cos a)) {a..b}" + proof (rule fundamental_theorem_of_calculus) + show "((\a. - cos a) has_vector_derivative sin x) (at x within {a..b})" for x + unfolding has_field_derivative_iff_has_vector_derivative [symmetric] + by (rule derivative_eq_intros | force)+ + qed (use assms in auto) + then show ?thesis + by (simp add: integral_unique) +qed + +lemma integral_cos [simp]: + fixes a::real + assumes "a \ b" shows "integral {a..b} cos = sin b - sin a" +proof - + have "(cos has_integral (sin b - sin a)) {a..b}" + proof (rule fundamental_theorem_of_calculus) + show "(sin has_vector_derivative cos x) (at x within {a..b})" for x + unfolding has_field_derivative_iff_has_vector_derivative [symmetric] + by (rule derivative_eq_intros | force)+ + qed (use assms in auto) + then show ?thesis + by (simp add: integral_unique) +qed + subsection \Taylor series expansion\ diff -r 086575316fd5 -r 7e93a10b21f0 src/HOL/Analysis/Lebesgue_Measure.thy --- a/src/HOL/Analysis/Lebesgue_Measure.thy Thu Sep 12 16:21:44 2019 +0200 +++ b/src/HOL/Analysis/Lebesgue_Measure.thy Thu Sep 12 15:32:45 2019 +0100 @@ -462,8 +462,232 @@ using integral_restrict_Int [of S UNIV f] assms by (simp add: lebesgue_on_UNIV_eq) +lemma integrable_lebesgue_on_empty [iff]: + fixes f :: "'a::euclidean_space \ 'b::{second_countable_topology,banach}" + shows "integrable (lebesgue_on {}) f" + by (simp add: integrable_restrict_space) -text\<^marker>\tag unimportant\ \Measurability of continuous functions\ +lemma integral_lebesgue_on_empty [simp]: + fixes f :: "'a::euclidean_space \ 'b::{second_countable_topology,banach}" + shows "integral\<^sup>L (lebesgue_on {}) f = 0" + by (simp add: Bochner_Integration.integral_empty) +lemma has_bochner_integral_restrict_space: + fixes f :: "'a \ 'b::{banach, second_countable_topology}" + assumes \: "\ \ space M \ sets M" + shows "has_bochner_integral (restrict_space M \) f i + \ has_bochner_integral M (\x. indicator \ x *\<^sub>R f x) i" + by (simp add: integrable_restrict_space [OF assms] integral_restrict_space [OF assms] has_bochner_integral_iff) + +lemma integrable_restrict_UNIV: + fixes f :: "'a::euclidean_space \ 'b::{banach, second_countable_topology}" + assumes S: "S \ sets lebesgue" + shows "integrable lebesgue (\x. if x \ S then f x else 0) \ integrable (lebesgue_on S) f" + using has_bochner_integral_restrict_space [of S lebesgue f] assms + by (simp add: integrable.simps indicator_scaleR_eq_if) + +lemma integral_mono_lebesgue_on_AE: + fixes f::"_ \ real" + assumes f: "integrable (lebesgue_on T) f" + and gf: "AE x in (lebesgue_on S). g x \ f x" + and f0: "AE x in (lebesgue_on T). 0 \ f x" + and "S \ T" and S: "S \ sets lebesgue" and T: "T \ sets lebesgue" + shows "(\x. g x \(lebesgue_on S)) \ (\x. f x \(lebesgue_on T))" +proof - + have "(\x. g x \(lebesgue_on S)) = (\x. (if x \ S then g x else 0) \lebesgue)" + by (simp add: Lebesgue_Measure.integral_restrict_UNIV S) + also have "\ \ (\x. (if x \ T then f x else 0) \lebesgue)" + proof (rule Bochner_Integration.integral_mono_AE') + show "integrable lebesgue (\x. if x \ T then f x else 0)" + by (simp add: integrable_restrict_UNIV T f) + show "AE x in lebesgue. (if x \ S then g x else 0) \ (if x \ T then f x else 0)" + using assms by (auto simp: AE_restrict_space_iff) + show "AE x in lebesgue. 0 \ (if x \ T then f x else 0)" + using f0 by (simp add: AE_restrict_space_iff T) + qed + also have "\ = (\x. f x \(lebesgue_on T))" + using Lebesgue_Measure.integral_restrict_UNIV T by blast + finally show ?thesis . +qed + + +subsection \Borel measurability\ + +lemma borel_measurable_if_I: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + assumes f: "f \ borel_measurable (lebesgue_on S)" and S: "S \ sets lebesgue" + shows "(\x. if x \ S then f x else 0) \ borel_measurable lebesgue" +proof - + have eq: "{x. x \ S} \ {x. f x \ Y} = {x. x \ S} \ {x. f x \ Y} \ S" for Y + by blast + show ?thesis + using f S + apply (simp add: vimage_def in_borel_measurable_borel Ball_def) + apply (elim all_forward imp_forward asm_rl) + apply (simp only: Collect_conj_eq Collect_disj_eq imp_conv_disj eq) + apply (auto simp: Compl_eq [symmetric] Compl_in_sets_lebesgue sets_restrict_space_iff) + done +qed + +lemma borel_measurable_if_D: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + assumes "(\x. if x \ S then f x else 0) \ borel_measurable lebesgue" + shows "f \ borel_measurable (lebesgue_on S)" + using assms + apply (simp add: in_borel_measurable_borel Ball_def) + apply (elim all_forward imp_forward asm_rl) + apply (force simp: space_restrict_space sets_restrict_space image_iff intro: rev_bexI) + done + +lemma borel_measurable_if: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + assumes "S \ sets lebesgue" + shows "(\x. if x \ S then f x else 0) \ borel_measurable lebesgue \ f \ borel_measurable (lebesgue_on S)" + using assms borel_measurable_if_D borel_measurable_if_I by blast + +lemma borel_measurable_vimage_halfspace_component_lt: + "f \ borel_measurable (lebesgue_on S) \ + (\a i. i \ Basis \ {x \ S. f x \ i < a} \ sets (lebesgue_on S))" + apply (rule trans [OF borel_measurable_iff_halfspace_less]) + apply (fastforce simp add: space_restrict_space) + done + +lemma borel_measurable_vimage_halfspace_component_ge: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + shows "f \ borel_measurable (lebesgue_on S) \ + (\a i. i \ Basis \ {x \ S. f x \ i \ a} \ sets (lebesgue_on S))" + apply (rule trans [OF borel_measurable_iff_halfspace_ge]) + apply (fastforce simp add: space_restrict_space) + done + +lemma borel_measurable_vimage_halfspace_component_gt: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + shows "f \ borel_measurable (lebesgue_on S) \ + (\a i. i \ Basis \ {x \ S. f x \ i > a} \ sets (lebesgue_on S))" + apply (rule trans [OF borel_measurable_iff_halfspace_greater]) + apply (fastforce simp add: space_restrict_space) + done + +lemma borel_measurable_vimage_halfspace_component_le: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + shows "f \ borel_measurable (lebesgue_on S) \ + (\a i. i \ Basis \ {x \ S. f x \ i \ a} \ sets (lebesgue_on S))" + apply (rule trans [OF borel_measurable_iff_halfspace_le]) + apply (fastforce simp add: space_restrict_space) + done + +lemma + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + shows borel_measurable_vimage_open_interval: + "f \ borel_measurable (lebesgue_on S) \ + (\a b. {x \ S. f x \ box a b} \ sets (lebesgue_on S))" (is ?thesis1) + and borel_measurable_vimage_open: + "f \ borel_measurable (lebesgue_on S) \ + (\T. open T \ {x \ S. f x \ T} \ sets (lebesgue_on S))" (is ?thesis2) +proof - + have "{x \ S. f x \ box a b} \ sets (lebesgue_on S)" if "f \ borel_measurable (lebesgue_on S)" for a b + proof - + have "S = S \ space lebesgue" + by simp + then have "S \ (f -` box a b) \ sets (lebesgue_on S)" + by (metis (no_types) box_borel in_borel_measurable_borel inf_sup_aci(1) space_restrict_space that) + then show ?thesis + by (simp add: Collect_conj_eq vimage_def) + qed + moreover + have "{x \ S. f x \ T} \ sets (lebesgue_on S)" + if T: "\a b. {x \ S. f x \ box a b} \ sets (lebesgue_on S)" "open T" for T + proof - + obtain \ where "countable \" and \: "\X. X \ \ \ \a b. X = box a b" "\\ = T" + using open_countable_Union_open_box that \open T\ by metis + then have eq: "{x \ S. f x \ T} = (\U \ \. {x \ S. f x \ U})" + by blast + have "{x \ S. f x \ U} \ sets (lebesgue_on S)" if "U \ \" for U + using that T \ by blast + then show ?thesis + by (auto simp: eq intro: Sigma_Algebra.sets.countable_UN' [OF \countable \\]) + qed + moreover + have eq: "{x \ S. f x \ i < a} = {x \ S. f x \ {y. y \ i < a}}" for i a + by auto + have "f \ borel_measurable (lebesgue_on S)" + if "\T. open T \ {x \ S. f x \ T} \ sets (lebesgue_on S)" + by (metis (no_types) eq borel_measurable_vimage_halfspace_component_lt open_halfspace_component_lt that) + ultimately show "?thesis1" "?thesis2" + by blast+ +qed + +lemma borel_measurable_vimage_closed: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + shows "f \ borel_measurable (lebesgue_on S) \ + (\T. closed T \ {x \ S. f x \ T} \ sets (lebesgue_on S))" + (is "?lhs = ?rhs") +proof - + have eq: "{x \ S. f x \ T} = S - {x \ S. f x \ (- T)}" for T + by auto + show ?thesis + apply (simp add: borel_measurable_vimage_open, safe) + apply (simp_all (no_asm) add: eq) + apply (intro sets.Diff sets_lebesgue_on_refl, force simp: closed_open) + apply (intro sets.Diff sets_lebesgue_on_refl, force simp: open_closed) + done +qed + +lemma borel_measurable_vimage_closed_interval: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + shows "f \ borel_measurable (lebesgue_on S) \ + (\a b. {x \ S. f x \ cbox a b} \ sets (lebesgue_on S))" + (is "?lhs = ?rhs") +proof + assume ?lhs then show ?rhs + using borel_measurable_vimage_closed by blast +next + assume RHS: ?rhs + have "{x \ S. f x \ T} \ sets (lebesgue_on S)" if "open T" for T + proof - + obtain \ where "countable \" and \: "\ \ Pow T" "\X. X \ \ \ \a b. X = cbox a b" "\\ = T" + using open_countable_Union_open_cbox that \open T\ by metis + then have eq: "{x \ S. f x \ T} = (\U \ \. {x \ S. f x \ U})" + by blast + have "{x \ S. f x \ U} \ sets (lebesgue_on S)" if "U \ \" for U + using that \ by (metis RHS) + then show ?thesis + by (auto simp: eq intro: Sigma_Algebra.sets.countable_UN' [OF \countable \\]) + qed + then show ?lhs + by (simp add: borel_measurable_vimage_open) +qed + +lemma borel_measurable_UNIV_eq: "borel_measurable (lebesgue_on UNIV) = borel_measurable lebesgue" + by auto + +lemma borel_measurable_vimage_borel: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + shows "f \ borel_measurable (lebesgue_on S) \ + (\T. T \ sets borel \ {x \ S. f x \ T} \ sets (lebesgue_on S))" + (is "?lhs = ?rhs") +proof + assume f: ?lhs + then show ?rhs + using measurable_sets [OF f] + by (simp add: Collect_conj_eq inf_sup_aci(1) space_restrict_space vimage_def) +qed (simp add: borel_measurable_vimage_open_interval) + +lemma lebesgue_measurable_vimage_borel: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + assumes "f \ borel_measurable lebesgue" "T \ sets borel" + shows "{x. f x \ T} \ sets lebesgue" + using assms borel_measurable_vimage_borel [of f UNIV] by auto + +lemma borel_measurable_lebesgue_preimage_borel: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + shows "f \ borel_measurable lebesgue \ + (\T. T \ sets borel \ {x. f x \ T} \ sets lebesgue)" + apply (intro iffI allI impI lebesgue_measurable_vimage_borel) + apply (auto simp: in_borel_measurable_borel vimage_def) + done + + +subsection \<^marker>\tag unimportant\ \Measurability of continuous functions\ lemma continuous_imp_measurable_on_sets_lebesgue: assumes f: "continuous_on S f" and S: "S \ sets lebesgue" diff -r 086575316fd5 -r 7e93a10b21f0 src/HOL/Analysis/Linear_Algebra.thy --- a/src/HOL/Analysis/Linear_Algebra.thy Thu Sep 12 16:21:44 2019 +0200 +++ b/src/HOL/Analysis/Linear_Algebra.thy Thu Sep 12 15:32:45 2019 +0100 @@ -1879,4 +1879,88 @@ orthogonal_commute orthogonal_def) qed +subsection\Linear functions are (uniformly) continuous on any set\ + +subsection\<^marker>\tag unimportant\ \Topological properties of linear functions\ + +lemma linear_lim_0: + assumes "bounded_linear f" + shows "(f \ 0) (at (0))" +proof - + interpret f: bounded_linear f by fact + have "(f \ f 0) (at 0)" + using tendsto_ident_at by (rule f.tendsto) + then show ?thesis unfolding f.zero . +qed + +lemma linear_continuous_at: + assumes "bounded_linear f" + shows "continuous (at a) f" + unfolding continuous_at using assms + apply (rule bounded_linear.tendsto) + apply (rule tendsto_ident_at) + done + +lemma linear_continuous_within: + "bounded_linear f \ continuous (at x within s) f" + using continuous_at_imp_continuous_at_within linear_continuous_at by blast + +lemma linear_continuous_on: + "bounded_linear f \ continuous_on s f" + using continuous_at_imp_continuous_on[of s f] using linear_continuous_at[of f] by auto + +lemma Lim_linear: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" and h :: "'b \ 'c::real_normed_vector" + assumes "(f \ l) F" "linear h" + shows "((\x. h(f x)) \ h l) F" +proof - + obtain B where B: "B > 0" "\x. norm (h x) \ B * norm x" + using linear_bounded_pos [OF \linear h\] by blast + show ?thesis + unfolding tendsto_iff + proof (intro allI impI) + show "\\<^sub>F x in F. dist (h (f x)) (h l) < e" if "e > 0" for e + proof - + have "\\<^sub>F x in F. dist (f x) l < e/B" + by (simp add: \0 < B\ assms(1) tendstoD that) + then show ?thesis + unfolding dist_norm + proof (rule eventually_mono) + show "norm (h (f x) - h l) < e" if "norm (f x - l) < e / B" for x + using that B + apply (simp add: divide_simps) + by (metis \linear h\ le_less_trans linear_diff mult.commute) + qed + qed + qed +qed + +lemma linear_continuous_compose: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" and g :: "'b \ 'c::real_normed_vector" + assumes "continuous F f" "linear g" + shows "continuous F (\x. g(f x))" + using assms unfolding continuous_def by (rule Lim_linear) + +lemma linear_continuous_on_compose: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" and g :: "'b \ 'c::real_normed_vector" + assumes "continuous_on S f" "linear g" + shows "continuous_on S (\x. g(f x))" + using assms by (simp add: continuous_on_eq_continuous_within linear_continuous_compose) + +text\Also bilinear functions, in composition form\ + +lemma bilinear_continuous_compose: + fixes h :: "'a::euclidean_space \ 'b::euclidean_space \ 'c::real_normed_vector" + assumes "continuous F f" "continuous F g" "bilinear h" + shows "continuous F (\x. h (f x) (g x))" + using assms bilinear_conv_bounded_bilinear bounded_bilinear.continuous by blast + +lemma bilinear_continuous_on_compose: + fixes h :: "'a::euclidean_space \ 'b::euclidean_space \ 'c::real_normed_vector" + and f :: "'d::t2_space \ 'a" + assumes "continuous_on S f" "continuous_on S g" "bilinear h" + shows "continuous_on S (\x. h (f x) (g x))" + using assms by (simp add: continuous_on_eq_continuous_within bilinear_continuous_compose) + + end diff -r 086575316fd5 -r 7e93a10b21f0 src/HOL/Library/Landau_Symbols.thy --- a/src/HOL/Library/Landau_Symbols.thy Thu Sep 12 16:21:44 2019 +0200 +++ b/src/HOL/Library/Landau_Symbols.thy Thu Sep 12 15:32:45 2019 +0100 @@ -1641,10 +1641,6 @@ subsection \Asymptotic Equivalence\ -(* TODO Move *) -lemma tendsto_eventually: "eventually (\x. f x = c) F \ filterlim f (nhds c) F" - by (simp add: eventually_mono eventually_nhds_x_imp_x filterlim_iff) - named_theorems asymp_equiv_intros named_theorems asymp_equiv_simps @@ -1676,7 +1672,7 @@ by (intro always_eventually) simp moreover have "((\_. 1) \ 1) F" by simp ultimately show "((\x. if f x = 0 \ f x = 0 then 1 else f x / f x) \ 1) F" - by (simp add: Landau_Symbols.tendsto_eventually) + by (simp add: tendsto_eventually) qed lemma asymp_equiv_symI: diff -r 086575316fd5 -r 7e93a10b21f0 src/HOL/Limits.thy --- a/src/HOL/Limits.thy Thu Sep 12 16:21:44 2019 +0200 +++ b/src/HOL/Limits.thy Thu Sep 12 15:32:45 2019 +0100 @@ -779,6 +779,14 @@ for c :: "'a::topological_semigroup_mult" by (rule tendsto_mult [OF _ tendsto_const]) +lemma real_tendsto_mult_left_iff: + "c \ 0 \ tendsto(\x. c * f x) (c * l) F \ tendsto f l F" for c :: real + by (auto simp: tendsto_mult_left dest: tendsto_mult_left [where c = "1/c"]) + +lemma real_tendsto_mult_right_iff: + "c \ 0 \ tendsto(\x. f x * c) (l * c) F \ tendsto f l F" for c :: real + by (simp add: mult.commute real_tendsto_mult_left_iff) + lemma lim_const_over_n [tendsto_intros]: fixes a :: "'a::real_normed_field" shows "(\n. a / of_nat n) \ 0" diff -r 086575316fd5 -r 7e93a10b21f0 src/HOL/Power.thy --- a/src/HOL/Power.thy Thu Sep 12 16:21:44 2019 +0200 +++ b/src/HOL/Power.thy Thu Sep 12 15:32:45 2019 +0100 @@ -895,6 +895,11 @@ apply simp done +lemma dvd_power_iff_le: + fixes k::nat + shows "2 \ k \ ((k ^ m) dvd (k ^ n) \ m \ n)" + using le_imp_power_dvd power_dvd_imp_le by force + lemma power2_nat_le_eq_le: "m\<^sup>2 \ n\<^sup>2 \ m \ n" for m n :: nat by (auto intro: power2_le_imp_le power_mono) diff -r 086575316fd5 -r 7e93a10b21f0 src/HOL/Probability/Tree_Space.thy --- a/src/HOL/Probability/Tree_Space.thy Thu Sep 12 16:21:44 2019 +0200 +++ b/src/HOL/Probability/Tree_Space.thy Thu Sep 12 15:32:45 2019 +0100 @@ -247,13 +247,6 @@ by (auto simp: sets_restrict_space_iff space_restrict_space) qed -lemma measurable_restrict_mono: - assumes f: "f \ restrict_space M A \\<^sub>M N" and "B \ A" - shows "f \ restrict_space M B \\<^sub>M N" -by (rule measurable_compose[OF measurable_restrict_space3 f]) - (insert \B \ A\, auto) - - lemma measurable_value[measurable (raw)]: assumes "f \ X \\<^sub>M tree_sigma M" and "\x. x \ space X \ f x \ Leaf"