# HG changeset patch # User hoelzl # Date 1450367016 -3600 # Node ID ff4d33058566de5dbb933ca24f22a245e37d39af # Parent e4f9d8f094fe9248147481d063cc07dc04e5905a moved some theorems from the CLT proof; reordered some theorems / notation diff -r e4f9d8f094fe -r ff4d33058566 src/HOL/Library/ContNotDenum.thy --- a/src/HOL/Library/ContNotDenum.thy Sun Dec 20 13:56:02 2015 +0100 +++ b/src/HOL/Library/ContNotDenum.thy Thu Dec 17 16:43:36 2015 +0100 @@ -143,4 +143,20 @@ using uncountable_open_interval [of a b] by (metis countable_Un_iff ivl_disj_un_singleton(4)) +lemma real_interval_avoid_countable_set: + fixes a b :: real and A :: "real set" + assumes "a < b" and "countable A" + shows "\x\{a<.. A" +proof - + from `countable A` have "countable (A \ {a<.. countable {a<.. {a<.. {a<.. {a<.. {a<..x. x \ {a<.. {a<..n. ereal (f n)) ---> ereal x) net \ (f ---> x) net" by (auto dest!: lim_real_of_ereal) +lemma convergent_real_imp_convergent_ereal: + assumes "convergent a" + shows "convergent (\n. ereal (a n))" and "lim (\n. ereal (a n)) = ereal (lim a)" +proof - + from assms obtain L where L: "a ----> L" unfolding convergent_def .. + hence lim: "(\n. ereal (a n)) ----> ereal L" using lim_ereal by auto + thus "convergent (\n. ereal (a n))" unfolding convergent_def .. + thus "lim (\n. ereal (a n)) = ereal (lim a)" using lim L limI by metis +qed + lemma tendsto_PInfty: "(f ---> \) F \ (\r. eventually (\x. ereal r < f x) F)" proof - { @@ -3223,7 +3233,6 @@ thus "(\x. ereal (f x)) \ -\" by simp_all qed - lemma SUP_ereal_add_directed: fixes f g :: "'a \ ereal" assumes nonneg: "\i. i \ I \ 0 \ f i" "\i. i \ I \ 0 \ g i" @@ -3293,50 +3302,6 @@ done qed -subsection \More Limits\ - -lemma convergent_limsup_cl: - fixes X :: "nat \ 'a::{complete_linorder,linorder_topology}" - shows "convergent X \ limsup X = lim X" - by (auto simp: convergent_def limI lim_imp_Limsup) - -lemma lim_increasing_cl: - assumes "\n m. n \ m \ f n \ f m" - obtains l where "f ----> (l::'a::{complete_linorder,linorder_topology})" -proof - show "f ----> (SUP n. f n)" - using assms - by (intro increasing_tendsto) - (auto simp: SUP_upper eventually_sequentially less_SUP_iff intro: less_le_trans) -qed - -lemma lim_decreasing_cl: - assumes "\n m. n \ m \ f n \ f m" - obtains l where "f ----> (l::'a::{complete_linorder,linorder_topology})" -proof - show "f ----> (INF n. f n)" - using assms - by (intro decreasing_tendsto) - (auto simp: INF_lower eventually_sequentially INF_less_iff intro: le_less_trans) -qed - -lemma compact_complete_linorder: - fixes X :: "nat \ 'a::{complete_linorder,linorder_topology}" - shows "\l r. subseq r \ (X \ r) ----> l" -proof - - obtain r where "subseq r" and mono: "monoseq (X \ r)" - using seq_monosub[of X] - unfolding comp_def - by auto - then have "(\n m. m \ n \ (X \ r) m \ (X \ r) n) \ (\n m. m \ n \ (X \ r) n \ (X \ r) m)" - by (auto simp add: monoseq_def) - then obtain l where "(X \ r) ----> l" - using lim_increasing_cl[of "X \ r"] lim_decreasing_cl[of "X \ r"] - by auto - then show ?thesis - using \subseq r\ by auto -qed - lemma ereal_dense3: fixes x y :: ereal shows "x < y \ \r::rat. x < real_of_rat r \ real_of_rat r < y" diff -r e4f9d8f094fe -r ff4d33058566 src/HOL/Library/Liminf_Limsup.thy --- a/src/HOL/Library/Liminf_Limsup.thy Sun Dec 20 13:56:02 2015 +0100 +++ b/src/HOL/Library/Liminf_Limsup.thy Thu Dec 17 16:43:36 2015 +0100 @@ -351,5 +351,53 @@ finally show ?thesis by (auto simp: Liminf_def) qed +subsection \More Limits\ + +lemma convergent_limsup_cl: + fixes X :: "nat \ 'a::{complete_linorder,linorder_topology}" + shows "convergent X \ limsup X = lim X" + by (auto simp: convergent_def limI lim_imp_Limsup) + +lemma convergent_liminf_cl: + fixes X :: "nat \ 'a::{complete_linorder,linorder_topology}" + shows "convergent X \ liminf X = lim X" + by (auto simp: convergent_def limI lim_imp_Liminf) + +lemma lim_increasing_cl: + assumes "\n m. n \ m \ f n \ f m" + obtains l where "f ----> (l::'a::{complete_linorder,linorder_topology})" +proof + show "f ----> (SUP n. f n)" + using assms + by (intro increasing_tendsto) + (auto simp: SUP_upper eventually_sequentially less_SUP_iff intro: less_le_trans) +qed + +lemma lim_decreasing_cl: + assumes "\n m. n \ m \ f n \ f m" + obtains l where "f ----> (l::'a::{complete_linorder,linorder_topology})" +proof + show "f ----> (INF n. f n)" + using assms + by (intro decreasing_tendsto) + (auto simp: INF_lower eventually_sequentially INF_less_iff intro: le_less_trans) +qed + +lemma compact_complete_linorder: + fixes X :: "nat \ 'a::{complete_linorder,linorder_topology}" + shows "\l r. subseq r \ (X \ r) ----> l" +proof - + obtain r where "subseq r" and mono: "monoseq (X \ r)" + using seq_monosub[of X] + unfolding comp_def + by auto + then have "(\n m. m \ n \ (X \ r) m \ (X \ r) n) \ (\n m. m \ n \ (X \ r) n \ (X \ r) m)" + by (auto simp add: monoseq_def) + then obtain l where "(X \ r) ----> l" + using lim_increasing_cl[of "X \ r"] lim_decreasing_cl[of "X \ r"] + by auto + then show ?thesis + using \subseq r\ by auto +qed end diff -r e4f9d8f094fe -r ff4d33058566 src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Sun Dec 20 13:56:02 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Thu Dec 17 16:43:36 2015 +0100 @@ -3391,6 +3391,60 @@ ultimately show ?thesis by auto qed +lemma continuous_ge_on_Ioo: + assumes "continuous_on {c..d} g" "\x. x \ {c<.. g x \ a" "c < d" "x \ {c..d}" + shows "g (x::real) \ (a::real)" +proof- + from assms(3) have "{c..d} = closure {c<.. (g -` {a..} \ {c..d})" by auto + hence "closure {c<.. closure (g -` {a..} \ {c..d})" by (rule closure_mono) + also from assms(1) have "closed (g -` {a..} \ {c..d})" + by (auto simp: continuous_on_closed_vimage) + hence "closure (g -` {a..} \ {c..d}) = g -` {a..} \ {c..d}" by simp + finally show ?thesis using \x \ {c..d}\ by auto +qed + +lemma interior_real_semiline': + fixes a :: real + shows "interior {..a} = {.. y" + then have "y \ interior {..a}" + apply (simp add: mem_interior) + apply (rule_tac x="(a-y)" in exI) + apply (auto simp add: dist_norm) + done + } + moreover + { + fix y + assume "y \ interior {..a}" + then obtain e where e: "e > 0" "cball y e \ {..a}" + using mem_interior_cball[of y "{..a}"] by auto + moreover from e have "y + e \ cball y e" + by (auto simp add: cball_def dist_norm) + ultimately have "a \ y + e" by auto + then have "a > y" using e by auto + } + ultimately show ?thesis by auto +qed + +lemma interior_atLeastAtMost_real: "interior {a..b} = {a<.. {..b}" by auto + also have "interior ... = {a<..} \ {.. s" "s \ t" + and "\x. x \ s \ f x = g x" + shows "(g has_vector_derivative D) (at x within s)" +proof - + have "(f has_vector_derivative D) (at x within s) \ (g has_vector_derivative D) (at x within s)" + unfolding has_vector_derivative_def has_derivative_iff_norm + using assms by (intro conj_cong Lim_cong_within refl) auto + then show ?thesis + using has_vector_derivative_within_subset[OF f `s \ t`] by simp +qed + lemma has_vector_derivative_transform_within: assumes "0 < d" and "x \ s" diff -r e4f9d8f094fe -r ff4d33058566 src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Sun Dec 20 13:56:02 2015 +0100 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Thu Dec 17 16:43:36 2015 +0100 @@ -8,11 +8,12 @@ theory Topology_Euclidean_Space imports - Complex_Main + "~~/src/HOL/Library/Indicator_Function" "~~/src/HOL/Library/Countable_Set" "~~/src/HOL/Library/FuncSet" Linear_Algebra Norm_Arith + begin lemma image_affinity_interval: @@ -5736,6 +5737,60 @@ done qed +lemma isCont_indicator: + fixes x :: "'a::t2_space" + shows "isCont (indicator A :: 'a \ real) x = (x \ frontier A)" +proof auto + fix x + assume cts_at: "isCont (indicator A :: 'a \ real) x" and fr: "x \ frontier A" + with continuous_at_open have 1: "\V::real set. open V \ indicator A x \ V \ + (\U::'a set. open U \ x \ U \ (\y\U. indicator A y \ V))" by auto + show False + proof (cases "x \ A") + assume x: "x \ A" + hence "indicator A x \ ({0<..<2} :: real set)" by simp + hence "\U. open U \ x \ U \ (\y\U. indicator A y \ ({0<..<2} :: real set))" + using 1 open_greaterThanLessThan by blast + then guess U .. note U = this + hence "\y\U. indicator A y > (0::real)" + unfolding greaterThanLessThan_def by auto + hence "U \ A" using indicator_eq_0_iff by force + hence "x \ interior A" using U interiorI by auto + thus ?thesis using fr unfolding frontier_def by simp + next + assume x: "x \ A" + hence "indicator A x \ ({-1<..<1} :: real set)" by simp + hence "\U. open U \ x \ U \ (\y\U. indicator A y \ ({-1<..<1} :: real set))" + using 1 open_greaterThanLessThan by blast + then guess U .. note U = this + hence "\y\U. indicator A y < (1::real)" + unfolding greaterThanLessThan_def by auto + hence "U \ -A" by auto + hence "x \ interior (-A)" using U interiorI by auto + thus ?thesis using fr interior_complement unfolding frontier_def by auto + qed +next + assume nfr: "x \ frontier A" + hence "x \ interior A \ x \ interior (-A)" + by (auto simp: frontier_def closure_interior) + thus "isCont ((indicator A)::'a \ real) x" + proof + assume int: "x \ interior A" + hence "\U. open U \ x \ U \ U \ A" unfolding interior_def by auto + then guess U .. note U = this + hence "\y\U. indicator A y = (1::real)" unfolding indicator_def by auto + hence "continuous_on U (indicator A)" by (simp add: continuous_on_const indicator_eq_1_iff) + thus ?thesis using U continuous_on_eq_continuous_at by auto + next + assume ext: "x \ interior (-A)" + hence "\U. open U \ x \ U \ U \ -A" unfolding interior_def by auto + then guess U .. note U = this + hence "\y\U. indicator A y = (0::real)" unfolding indicator_def by auto + hence "continuous_on U (indicator A)" by (smt U continuous_on_topological indicator_def) + thus ?thesis using U continuous_on_eq_continuous_at by auto + qed +qed + text \Making a continuous function avoid some value in a neighbourhood.\ lemma continuous_within_avoid: diff -r e4f9d8f094fe -r ff4d33058566 src/HOL/Probability/Bochner_Integration.thy --- a/src/HOL/Probability/Bochner_Integration.thy Sun Dec 20 13:56:02 2015 +0100 +++ b/src/HOL/Probability/Bochner_Integration.thy Thu Dec 17 16:43:36 2015 +0100 @@ -904,6 +904,12 @@ translations "\ x. f \M" == "CONST lebesgue_integral M (\x. f)" +syntax + "_ascii_lebesgue_integral" :: "pttrn \ 'a measure \ real \ real" ("(3LINT (1_)/|(_)./ _)" [0,110,60] 60) + +translations + "LINT x|M. f" == "CONST lebesgue_integral M (\x. f)" + lemma has_bochner_integral_integral_eq: "has_bochner_integral M f x \ integral\<^sup>L M f = x" by (metis the_equality has_bochner_integral_eq lebesgue_integral_def) @@ -2581,6 +2587,33 @@ by (simp add: integral_distr[symmetric, OF measurable_pair_swap' f] distr_pair_swap[symmetric]) qed +lemma (in pair_sigma_finite) Fubini_integrable: + fixes f :: "_ \ _::{banach, second_countable_topology}" + assumes f[measurable]: "f \ borel_measurable (M1 \\<^sub>M M2)" + and integ1: "integrable M1 (\x. \ y. norm (f (x, y)) \M2)" + and integ2: "AE x in M1. integrable M2 (\y. f (x, y))" + shows "integrable (M1 \\<^sub>M M2) f" +proof (rule integrableI_bounded) + have "(\\<^sup>+ p. norm (f p) \(M1 \\<^sub>M M2)) = (\\<^sup>+ x. (\\<^sup>+ y. norm (f (x, y)) \M2) \M1)" + by (simp add: M2.nn_integral_fst [symmetric]) + also have "\ = (\\<^sup>+ x. \\y. norm (f (x, y)) \M2\ \M1)" + apply (intro nn_integral_cong_AE) + using integ2 + proof eventually_elim + fix x assume "integrable M2 (\y. f (x, y))" + then have f: "integrable M2 (\y. norm (f (x, y)))" + by simp + then have "(\\<^sup>+y. ereal (norm (f (x, y))) \M2) = ereal (LINT y|M2. norm (f (x, y)))" + by (rule nn_integral_eq_integral) simp + also have "\ = ereal \LINT y|M2. norm (f (x, y))\" + using f by (auto intro!: abs_of_nonneg[symmetric] integral_nonneg_AE) + finally show "(\\<^sup>+y. ereal (norm (f (x, y))) \M2) = ereal \LINT y|M2. norm (f (x, y))\" . + qed + also have "\ < \" + using integ1 by (simp add: integrable_iff_bounded integral_nonneg_AE) + finally show "(\\<^sup>+ p. norm (f p) \(M1 \\<^sub>M M2)) < \" . +qed fact + lemma (in pair_sigma_finite) emeasure_pair_measure_finite: assumes A: "A \ sets (M1 \\<^sub>M M2)" and finite: "emeasure (M1 \\<^sub>M M2) A < \" shows "AE x in M1. emeasure M2 {y\space M2. (x, y) \ A} < \" diff -r e4f9d8f094fe -r ff4d33058566 src/HOL/Probability/Borel_Space.thy --- a/src/HOL/Probability/Borel_Space.thy Sun Dec 20 13:56:02 2015 +0100 +++ b/src/HOL/Probability/Borel_Space.thy Thu Dec 17 16:43:36 2015 +0100 @@ -1467,6 +1467,35 @@ by simp qed +lemma is_real_interval: + assumes S: "is_interval S" + shows "\a b::real. S = {} \ S = UNIV \ S = {.. S = {..b} \ S = {a<..} \ S = {a..} \ + S = {a<.. S = {a<..b} \ S = {a.. S = {a..b}" + using S unfolding is_interval_1 by (blast intro: interval_cases) + +lemma real_interval_borel_measurable: + assumes "is_interval (S::real set)" + shows "S \ sets borel" +proof - + from assms is_real_interval have "\a b::real. S = {} \ S = UNIV \ S = {.. S = {..b} \ + S = {a<..} \ S = {a..} \ S = {a<.. S = {a<..b} \ S = {a.. S = {a..b}" by auto + then guess a .. + then guess b .. + thus ?thesis + by auto +qed + +lemma borel_measurable_mono: + fixes f :: "real \ real" + assumes "mono f" + shows "f \ borel_measurable borel" +proof (subst borel_measurable_iff_ge, auto simp add:) + fix a :: real + have "is_interval {w. a \ f w}" + unfolding is_interval_1 using assms by (auto dest: monoD intro: order.trans) + thus "{w. a \ f w} \ sets borel" using real_interval_borel_measurable by auto +qed + no_notation eucl_less (infix "x. x \ {a<.. g' x \ 0" - by (rule mono_on_imp_deriv_nonneg) (auto simp: interior_atLeastAtMost_real) + by (rule mono_on_imp_deriv_nonneg) auto from contg' this have derivg_nonneg: "\x. x \ {a..b} \ g' x \ 0" - by (rule continuous_ge_on_Iii) (simp_all add: \a < b\) + by (rule continuous_ge_on_Ioo) (simp_all add: \a < b\) from derivg have contg: "continuous_on {a..b} g" by (rule has_real_derivative_imp_continuous_on) have A: "h -` {a..b} = {g a..g b}" diff -r e4f9d8f094fe -r ff4d33058566 src/HOL/Probability/Lebesgue_Integral_Substitution.thy --- a/src/HOL/Probability/Lebesgue_Integral_Substitution.thy Sun Dec 20 13:56:02 2015 +0100 +++ b/src/HOL/Probability/Lebesgue_Integral_Substitution.thy Thu Dec 17 16:43:36 2015 +0100 @@ -16,65 +16,6 @@ "\f \ measurable borel M; A \ sets M\ \ f -` A \ sets borel" by (drule (1) measurable_sets) simp -lemma closure_Iii: - assumes "a < b" - shows "closure {a<..x. x \ {c<.. g x \ a" "c < d" "x \ {c..d}" - shows "g (x::real) \ (a::real)" -proof- - from assms(3) have "{c..d} = closure {c<.. (g -` {a..} \ {c..d})" by auto - hence "closure {c<.. closure (g -` {a..} \ {c..d})" by (rule closure_mono) - also from assms(1) have "closed (g -` {a..} \ {c..d})" - by (auto simp: continuous_on_closed_vimage) - hence "closure (g -` {a..} \ {c..d}) = g -` {a..} \ {c..d}" by simp - finally show ?thesis using \x \ {c..d}\ by auto -qed - -lemma interior_real_semiline': - fixes a :: real - shows "interior {..a} = {.. y" - then have "y \ interior {..a}" - apply (simp add: mem_interior) - apply (rule_tac x="(a-y)" in exI) - apply (auto simp add: dist_norm) - done - } - moreover - { - fix y - assume "y \ interior {..a}" - then obtain e where e: "e > 0" "cball y e \ {..a}" - using mem_interior_cball[of y "{..a}"] by auto - moreover from e have "y + e \ cball y e" - by (auto simp add: cball_def dist_norm) - ultimately have "a \ y + e" by auto - then have "a > y" using e by auto - } - ultimately show ?thesis by auto -qed - -lemma interior_atLeastAtMost_real: "interior {a..b} = {a<.. {..b}" by auto - also have "interior ... = {a<..} \ {.. sets M" shows "(\\<^sup>+x. f x * indicator {y} x \M) = max 0 (f y) * emeasure M {y}" diff -r e4f9d8f094fe -r ff4d33058566 src/HOL/Probability/Measure_Space.thy --- a/src/HOL/Probability/Measure_Space.thy Sun Dec 20 13:56:02 2015 +0100 +++ b/src/HOL/Probability/Measure_Space.thy Thu Dec 17 16:43:36 2015 +0100 @@ -1410,6 +1410,9 @@ lemma measure_nonneg: "0 \ measure M A" using emeasure_nonneg[of M A] unfolding measure_def by (auto intro: real_of_ereal_pos) +lemma zero_less_measure_iff: "0 < measure M A \ measure M A \ 0" + using measure_nonneg[of M A] by (auto simp add: le_less) + lemma measure_le_0_iff: "measure M X \ 0 \ measure M X = 0" using measure_nonneg[of M X] by auto diff -r e4f9d8f094fe -r ff4d33058566 src/HOL/Probability/Set_Integral.thy --- a/src/HOL/Probability/Set_Integral.thy Sun Dec 20 13:56:02 2015 +0100 +++ b/src/HOL/Probability/Set_Integral.thy Thu Dec 17 16:43:36 2015 +0100 @@ -14,13 +14,6 @@ Notation *) -syntax -"_ascii_lebesgue_integral" :: "pttrn \ 'a measure \ real \ real" -("(3LINT (1_)/|(_)./ _)" [0,110,60] 60) - -translations -"LINT x|M. f" == "CONST lebesgue_integral M (\x. f)" - abbreviation "set_borel_measurable M A f \ (\x. indicator A x *\<^sub>R f x) \ borel_measurable M" abbreviation "set_integrable M A f \ integrable M (\x. indicator A x *\<^sub>R f x)"