# HG changeset patch # User hoelzl # Date 1306171265 -7200 # Node ID 6e5c2a3c69da902760669ca57d1e71edb5df0c4f # Parent 618adb3584e513dc850e213f8c7cbf43ebca249a move lemmas to Extended_Reals and Extended_Real_Limits diff -r 618adb3584e5 -r 6e5c2a3c69da src/HOL/Library/Extended_Reals.thy --- a/src/HOL/Library/Extended_Reals.thy Mon May 23 10:58:21 2011 +0200 +++ b/src/HOL/Library/Extended_Reals.thy Mon May 23 19:21:05 2011 +0200 @@ -189,6 +189,9 @@ qed end +lemma real_of_extreal_0[simp]: "real (0::extreal) = 0" + unfolding real_of_extreal_def zero_extreal_def by simp + lemma abs_extreal_zero[simp]: "\0\ = (0::extreal)" unfolding zero_extreal_def abs_extreal.simps by simp @@ -300,6 +303,10 @@ by (cases rule: extreal3_cases[of a b c]) auto qed +lemma real_of_extreal_positive_mono: + "\0 \ x; x \ y; y \ \\ \ real x \ real y" + by (cases rule: extreal2_cases[of x y]) auto + lemma extreal_MInfty_lessI[intro, simp]: "a \ -\ \ -\ < a" by (cases a) auto @@ -351,17 +358,38 @@ "real y < x \ ((\y\ \ \ \ y < extreal x) \ (\y\ = \ \ 0 < x))" by (cases y) auto -lemma real_of_extreal_positive_mono: - assumes "x \ \" "y \ \" "0 \ x" "x \ y" - shows "real x \ real y" - using assms by (cases rule: extreal2_cases[of x y]) auto - lemma real_of_extreal_pos: fixes x :: extreal shows "0 \ x \ 0 \ real x" by (cases x) auto lemmas real_of_extreal_ord_simps = extreal_le_real_iff real_le_extreal_iff extreal_less_real_iff real_less_extreal_iff +lemma abs_extreal_ge0[simp]: "0 \ x \ \x :: extreal\ = x" + by (cases x) auto + +lemma abs_extreal_less0[simp]: "x < 0 \ \x :: extreal\ = -x" + by (cases x) auto + +lemma abs_extreal_pos[simp]: "0 \ \x :: extreal\" + by (cases x) auto + +lemma real_of_extreal_le_0[simp]: "real (X :: extreal) \ 0 \ (X \ 0 \ X = \)" + by (cases X) auto + +lemma abs_real_of_extreal[simp]: "\real (X :: extreal)\ = real \X\" + by (cases X) auto + +lemma zero_less_real_of_extreal: "0 < real X \ (0 < X \ X \ \)" + by (cases X) auto + +lemma extreal_0_le_uminus_iff[simp]: + fixes a :: extreal shows "0 \ -a \ a \ 0" + by (cases rule: extreal2_cases[of a]) auto + +lemma extreal_uminus_le_0_iff[simp]: + fixes a :: extreal shows "-a \ 0 \ 0 \ a" + by (cases rule: extreal2_cases[of a]) auto + lemma extreal_dense: fixes x y :: extreal assumes "x < y" shows "EX z. x < z & z < y" @@ -444,6 +472,9 @@ and decseq_uminus[simp]: "decseq (\x. - f x) \ incseq f" unfolding decseq_def incseq_def by auto +lemma incseq_extreal: "incseq f \ incseq (\x. extreal (f x))" + unfolding incseq_def by auto + lemma extreal_add_nonneg_nonneg: fixes a b :: extreal shows "0 \ a \ 0 \ b \ 0 \ a + b" using add_mono[of 0 a 0 b] by simp @@ -511,6 +542,10 @@ qed end +lemma real_of_extreal_le_1: + fixes a :: extreal shows "a \ 1 \ real a \ 1" + by (cases a) (auto simp: one_extreal_def) + lemma abs_extreal_one[simp]: "\1\ = (1::extreal)" unfolding one_extreal_def by simp @@ -702,6 +737,44 @@ shows "x >= y" by (metis assms extreal_dense leD linorder_le_less_linear) +lemma setprod_extreal_0: + fixes f :: "'a \ extreal" + shows "(\i\A. f i) = 0 \ (finite A \ (\i\A. f i = 0))" +proof cases + assume "finite A" + then show ?thesis by (induct A) auto +qed auto + +lemma setprod_extreal_pos: + fixes f :: "'a \ extreal" assumes pos: "\i. i \ I \ 0 \ f i" shows "0 \ (\i\I. f i)" +proof cases + assume "finite I" from this pos show ?thesis by induct auto +qed simp + +lemma setprod_PInf: + assumes "\i. i \ I \ 0 \ f i" + shows "(\i\I. f i) = \ \ finite I \ (\i\I. f i = \) \ (\i\I. f i \ 0)" +proof cases + assume "finite I" from this assms show ?thesis + proof (induct I) + case (insert i I) + then have pos: "0 \ f i" "0 \ setprod f I" by (auto intro!: setprod_extreal_pos) + from insert have "(\j\insert i I. f j) = \ \ setprod f I * f i = \" by auto + also have "\ \ (setprod f I = \ \ f i = \) \ f i \ 0 \ setprod f I \ 0" + using setprod_extreal_pos[of I f] pos + by (cases rule: extreal2_cases[of "f i" "setprod f I"]) auto + also have "\ \ finite (insert i I) \ (\j\insert i I. f j = \) \ (\j\insert i I. f j \ 0)" + using insert by (auto simp: setprod_extreal_0) + finally show ?case . + qed simp +qed simp + +lemma setprod_extreal: "(\i\A. extreal (f i)) = extreal (setprod f A)" +proof cases + assume "finite A" then show ?thesis + by induct (auto simp: one_extreal_def) +qed (simp add: one_extreal_def) + subsubsection {* Power *} instantiation extreal :: power @@ -890,6 +963,11 @@ instance proof qed end +lemma real_of_extreal_inverse[simp]: + fixes a :: extreal + shows "real (inverse a) = 1 / real a" + by (cases a) (auto simp: inverse_eq_divide) + lemma extreal_inverse[simp]: "inverse 0 = \" "inverse (1::extreal) = 1" @@ -1620,6 +1698,28 @@ unfolding SUPR_def INFI_def image_image by auto +lemma uminus_extreal_add_uminus_uminus: + fixes a b :: extreal shows "a \ \ \ b \ \ \ - (- a + - b) = a + b" + by (cases rule: extreal2_cases[of a b]) auto + +lemma INFI_extreal_add: + assumes "decseq f" "decseq g" and fin: "\i. f i \ \" "\i. g i \ \" + shows "(INF i. f i + g i) = INFI UNIV f + INFI UNIV g" +proof - + have INF_less: "(INF i. f i) < \" "(INF i. g i) < \" + using assms unfolding INF_less_iff by auto + { fix i from fin[of i] have "- ((- f i) + (- g i)) = f i + g i" + by (rule uminus_extreal_add_uminus_uminus) } + then have "(INF i. f i + g i) = (INF i. - ((- f i) + (- g i)))" + by simp + also have "\ = INFI UNIV f + INFI UNIV g" + unfolding extreal_INFI_uminus + using assms INF_less + by (subst SUPR_extreal_add) + (auto simp: extreal_SUPR_uminus intro!: uminus_extreal_add_uminus_uminus) + finally show ?thesis . +qed + subsection "Limits on @{typ extreal}" subsubsection "Topological space" @@ -1936,9 +2036,6 @@ } ultimately show ?thesis by blast qed -lemma real_of_extreal_0[simp]: "real (0::extreal) = 0" - unfolding real_of_extreal_def zero_extreal_def by simp - lemma real_of_extreal_mult[simp]: fixes a b :: extreal shows "real (a * b) = real a * real b" by (cases rule: extreal2_cases[of a b]) auto @@ -2406,7 +2503,6 @@ from this show ?thesis using ext by blast qed - lemma open_image_extreal: "open(UNIV-{\,(-\)})" by (metis range_extreal open_extreal open_UNIV) diff -r 618adb3584e5 -r 6e5c2a3c69da src/HOL/Multivariate_Analysis/Extended_Real_Limits.thy --- a/src/HOL/Multivariate_Analysis/Extended_Real_Limits.thy Mon May 23 10:58:21 2011 +0200 +++ b/src/HOL/Multivariate_Analysis/Extended_Real_Limits.thy Mon May 23 19:21:05 2011 +0200 @@ -805,6 +805,21 @@ } ultimately show ?thesis by auto qed +lemma liminf_extreal_cminus: + fixes f :: "nat \ extreal" assumes "c \ -\" + shows "liminf (\x. c - f x) = c - limsup f" +proof (cases c) + case PInf then show ?thesis by (simp add: Liminf_const) +next + case (real r) then show ?thesis + unfolding liminf_SUPR_INFI limsup_INFI_SUPR + apply (subst INFI_extreal_cminus) + apply auto + apply (subst SUPR_extreal_cminus) + apply auto + done +qed (insert `c \ -\`, simp) + subsubsection {* Continuity *} lemma continuous_imp_tendsto: @@ -1259,4 +1274,20 @@ finally show "\r. (\i. real (f i)) sums r" by (auto simp: sums_extreal) qed +lemma suminf_SUP_eq: + fixes f :: "nat \ nat \ extreal" + assumes "\i. incseq (\n. f n i)" "\n i. 0 \ f n i" + shows "(\i. SUP n. f n i) = (SUP n. \i. f n i)" +proof - + { fix n :: nat + have "(\ii B = C \ D \ A = C \ B = D \ ((A = {} \ B = {}) \ (C = {} \ D = {}))" + by auto + lemma times_Int_times: "A \ B \ C \ D = (A \ C) \ (B \ D)" by auto @@ -318,9 +321,6 @@ sublocale pair_sigma_finite \ pair_sigma_algebra M1 M2 by default -lemma times_eq_iff: "A \ B = C \ D \ A = C \ B = D \ ((A = {} \ B = {}) \ (C = {} \ D = {}))" - by auto - lemma sigma_sets_subseteq: assumes "A \ B" shows "sigma_sets X A \ sigma_sets X B" proof fix x assume "x \ sigma_sets X A" then show "x \ sigma_sets X B" diff -r 618adb3584e5 -r 6e5c2a3c69da src/HOL/Probability/Borel_Space.thy --- a/src/HOL/Probability/Borel_Space.thy Mon May 23 10:58:21 2011 +0200 +++ b/src/HOL/Probability/Borel_Space.thy Mon May 23 19:21:05 2011 +0200 @@ -1346,15 +1346,6 @@ by induct auto qed (simp add: borel_measurable_const) -lemma abs_extreal_ge0[simp]: "0 \ x \ \x :: extreal\ = x" - by (cases x) auto - -lemma abs_extreal_less0[simp]: "x < 0 \ \x :: extreal\ = -x" - by (cases x) auto - -lemma abs_extreal_pos[simp]: "0 \ \x :: extreal\" - by (cases x) auto - lemma (in sigma_algebra) borel_measurable_extreal_abs[intro, simp]: fixes f :: "'a \ extreal" assumes "f \ borel_measurable M" shows "(\x. \f x\) \ borel_measurable M" diff -r 618adb3584e5 -r 6e5c2a3c69da src/HOL/Probability/Caratheodory.thy --- a/src/HOL/Probability/Caratheodory.thy Mon May 23 10:58:21 2011 +0200 +++ b/src/HOL/Probability/Caratheodory.thy Mon May 23 19:21:05 2011 +0200 @@ -9,6 +9,12 @@ imports Sigma_Algebra Extended_Real_Limits begin +lemma sums_def2: + "f sums x \ (\n. (\i\n. f i)) ----> x" + unfolding sums_def + apply (subst LIMSEQ_Suc_iff[symmetric]) + unfolding atLeastLessThanSuc_atLeastAtMost atLeast0AtMost .. + text {* Originally from the Hurd/Coble measure theory development, translated by Lawrence Paulson. *} @@ -853,12 +859,6 @@ subsubsection {*Alternative instances of caratheodory*} -lemma sums_def2: - "f sums x \ (\n. (\i\n. f i)) ----> x" - unfolding sums_def - apply (subst LIMSEQ_Suc_iff[symmetric]) - unfolding atLeastLessThanSuc_atLeastAtMost atLeast0AtMost .. - lemma (in ring_of_sets) countably_additive_iff_continuous_from_below: assumes f: "positive M f" "additive M f" shows "countably_additive M f \ @@ -900,28 +900,6 @@ show "(\i. f (A i)) = f (\i. A i)" by simp qed -lemma uminus_extreal_add_uminus_uminus: - fixes a b :: extreal shows "a \ \ \ b \ \ \ - (- a + - b) = a + b" - by (cases rule: extreal2_cases[of a b]) auto - -lemma INFI_extreal_add: - assumes "decseq f" "decseq g" and fin: "\i. f i \ \" "\i. g i \ \" - shows "(INF i. f i + g i) = INFI UNIV f + INFI UNIV g" -proof - - have INF_less: "(INF i. f i) < \" "(INF i. g i) < \" - using assms unfolding INF_less_iff by auto - { fix i from fin[of i] have "- ((- f i) + (- g i)) = f i + g i" - by (rule uminus_extreal_add_uminus_uminus) } - then have "(INF i. f i + g i) = (INF i. - ((- f i) + (- g i)))" - by simp - also have "\ = INFI UNIV f + INFI UNIV g" - unfolding extreal_INFI_uminus - using assms INF_less - by (subst SUPR_extreal_add) - (auto simp: extreal_SUPR_uminus intro!: uminus_extreal_add_uminus_uminus) - finally show ?thesis . -qed - lemma (in ring_of_sets) continuous_from_above_iff_empty_continuous: assumes f: "positive M f" "additive M f" shows "(\A. range A \ sets M \ decseq A \ (\i. A i) \ sets M \ (\i. f (A i) \ \) \ (\i. f (A i)) ----> f (\i. A i)) diff -r 618adb3584e5 -r 6e5c2a3c69da src/HOL/Probability/Finite_Product_Measure.thy --- a/src/HOL/Probability/Finite_Product_Measure.thy Mon May 23 10:58:21 2011 +0200 +++ b/src/HOL/Probability/Finite_Product_Measure.thy Mon May 23 19:21:05 2011 +0200 @@ -495,44 +495,6 @@ sublocale finite_product_sigma_finite \ finite_product_sigma_algebra by default (fact finite_index') -lemma setprod_extreal_0: - fixes f :: "'a \ extreal" - shows "(\i\A. f i) = 0 \ (finite A \ (\i\A. f i = 0))" -proof cases - assume "finite A" - then show ?thesis by (induct A) auto -qed auto - -lemma setprod_extreal_pos: - fixes f :: "'a \ extreal" assumes pos: "\i. i \ I \ 0 \ f i" shows "0 \ (\i\I. f i)" -proof cases - assume "finite I" from this pos show ?thesis by induct auto -qed simp - -lemma setprod_PInf: - assumes "\i. i \ I \ 0 \ f i" - shows "(\i\I. f i) = \ \ finite I \ (\i\I. f i = \) \ (\i\I. f i \ 0)" -proof cases - assume "finite I" from this assms show ?thesis - proof (induct I) - case (insert i I) - then have pos: "0 \ f i" "0 \ setprod f I" by (auto intro!: setprod_extreal_pos) - from insert have "(\j\insert i I. f j) = \ \ setprod f I * f i = \" by auto - also have "\ \ (setprod f I = \ \ f i = \) \ f i \ 0 \ setprod f I \ 0" - using setprod_extreal_pos[of I f] pos - by (cases rule: extreal2_cases[of "f i" "setprod f I"]) auto - also have "\ \ finite (insert i I) \ (\j\insert i I. f j = \) \ (\j\insert i I. f j \ 0)" - using insert by (auto simp: setprod_extreal_0) - finally show ?case . - qed simp -qed simp - -lemma setprod_extreal: "(\i\A. extreal (f i)) = extreal (setprod f A)" -proof cases - assume "finite A" then show ?thesis - by induct (auto simp: one_extreal_def) -qed (simp add: one_extreal_def) - lemma (in finite_product_sigma_finite) product_algebra_generator_measure: assumes "Pi\<^isub>E I F \ sets G" shows "measure G (Pi\<^isub>E I F) = (\i\I. M.\ i (F i))" diff -r 618adb3584e5 -r 6e5c2a3c69da src/HOL/Probability/Infinite_Product_Measure.thy --- a/src/HOL/Probability/Infinite_Product_Measure.thy Mon May 23 10:58:21 2011 +0200 +++ b/src/HOL/Probability/Infinite_Product_Measure.thy Mon May 23 19:21:05 2011 +0200 @@ -223,11 +223,6 @@ done qed -lemma (in prob_space) measure_le_1: "X \ sets M \ \ X \ 1" - unfolding measure_space_1[symmetric] - using sets_into_space - by (intro measure_mono) auto - definition (in product_prob_space) "\G A = (THE x. \J. J \ {} \ finite J \ J \ I \ (\X\sets (Pi\<^isub>M J M). A = emb I J X \ x = measure (Pi\<^isub>M J M) X))" diff -r 618adb3584e5 -r 6e5c2a3c69da src/HOL/Probability/Lebesgue_Integration.thy --- a/src/HOL/Probability/Lebesgue_Integration.thy Mon May 23 10:58:21 2011 +0200 +++ b/src/HOL/Probability/Lebesgue_Integration.thy Mon May 23 19:21:05 2011 +0200 @@ -45,9 +45,6 @@ then show ?thesis using assms by (auto intro: measurable_sets) qed -lemma incseq_extreal: "incseq f \ incseq (\x. extreal (f x))" - unfolding incseq_def by auto - lemma incseq_Suc_iff: "incseq f \ (\n. f n \ f (Suc n))" proof assume "\n. f n \ f (Suc n)" then show "incseq f" by (auto intro!: incseq_SucI) @@ -2184,21 +2181,6 @@ using assms unfolding lebesgue_integral_def by (subst (1 2) positive_integral_cong_AE) (auto simp add: extreal_real) -lemma liminf_extreal_cminus: - fixes f :: "nat \ extreal" assumes "c \ -\" - shows "liminf (\x. c - f x) = c - limsup f" -proof (cases c) - case PInf then show ?thesis by (simp add: Liminf_const) -next - case (real r) then show ?thesis - unfolding liminf_SUPR_INFI limsup_INFI_SUPR - apply (subst INFI_extreal_cminus) - apply auto - apply (subst SUPR_extreal_cminus) - apply auto - done -qed (insert `c \ -\`, simp) - lemma (in measure_space) integral_dominated_convergence: assumes u: "\i. integrable M (u i)" and bound: "\x j. x\space M \ \u j x\ \ w x" and w: "integrable M w" diff -r 618adb3584e5 -r 6e5c2a3c69da src/HOL/Probability/Lebesgue_Measure.thy --- a/src/HOL/Probability/Lebesgue_Measure.thy Mon May 23 10:58:21 2011 +0200 +++ b/src/HOL/Probability/Lebesgue_Measure.thy Mon May 23 19:21:05 2011 +0200 @@ -116,22 +116,6 @@ qed (auto intro: LIMSEQ_indicator_UN simp: cube_def) qed simp -lemma suminf_SUP_eq: - fixes f :: "nat \ nat \ extreal" - assumes "\i. incseq (\n. f n i)" "\n i. 0 \ f n i" - shows "(\i. SUP n. f n i) = (SUP n. \i. f n i)" -proof - - { fix n :: nat - have "(\iix. 0 :: real)" by (simp add: fun_eq_iff) @@ -558,10 +542,6 @@ subsection {* Lebesgue integrable implies Gauge integrable *} -lemma positive_not_Inf: - "0 \ x \ x \ \ \ \x\ \ \" - by (cases x) auto - lemma has_integral_cmult_real: fixes c :: real assumes "c \ 0 \ (f has_integral x) A" @@ -648,10 +628,6 @@ qed qed -lemma real_of_extreal_positive_mono: - "\0 \ x; x \ y; y \ \\ \ real x \ real y" - by (cases rule: extreal2_cases[of x y]) auto - lemma positive_integral_has_integral: fixes f :: "'a::ordered_euclidean_space \ extreal" assumes f: "f \ borel_measurable lebesgue" "range f \ {0..<\}" "integral\<^isup>P lebesgue f \ \" diff -r 618adb3584e5 -r 6e5c2a3c69da src/HOL/Probability/Measure.thy --- a/src/HOL/Probability/Measure.thy Mon May 23 10:58:21 2011 +0200 +++ b/src/HOL/Probability/Measure.thy Mon May 23 19:21:05 2011 +0200 @@ -1162,16 +1162,11 @@ using finite_measure_of_space by auto qed -lemma (in finite_measure) measure_not_inf: - assumes A: "A \ sets M" - shows "\\ A\ \ \" - using finite_measure[OF A] positive_measure[OF A] by auto - definition (in finite_measure) "\' A = (if A \ sets M then real (\ A) else 0)" lemma (in finite_measure) finite_measure_eq: "A \ sets M \ \ A = extreal (\' A)" - using measure_not_inf[of A] by (auto simp: \'_def) + by (auto simp: \'_def extreal_real) lemma (in finite_measure) positive_measure': "0 \ \' A" unfolding \'_def by (auto simp: real_of_extreal_pos) @@ -1182,8 +1177,7 @@ moreover then have "\ A \ \ (space M)" using sets_into_space by (auto intro!: measure_mono) ultimately show ?thesis - using measure_not_inf[of A] measure_not_inf[of "space M"] - by (auto simp: \'_def) + by (auto simp: \'_def intro!: real_of_extreal_positive_mono) qed (simp add: \'_def real_of_extreal_pos) lemma (in finite_measure) restricted_finite_measure: diff -r 618adb3584e5 -r 6e5c2a3c69da src/HOL/Probability/Probability_Measure.thy --- a/src/HOL/Probability/Probability_Measure.thy Mon May 23 10:58:21 2011 +0200 +++ b/src/HOL/Probability/Probability_Measure.thy Mon May 23 19:21:05 2011 +0200 @@ -9,23 +9,6 @@ imports Lebesgue_Integration Radon_Nikodym Finite_Product_Measure Lebesgue_Measure begin -lemma real_of_extreal_inverse[simp]: - fixes X :: extreal - shows "real (inverse X) = 1 / real X" - by (cases X) (auto simp: inverse_eq_divide) - -lemma real_of_extreal_le_0[simp]: "real (X :: extreal) \ 0 \ (X \ 0 \ X = \)" - by (cases X) auto - -lemma abs_real_of_extreal[simp]: "\real (X :: extreal)\ = real \X\" - by (cases X) auto - -lemma zero_less_real_of_extreal: "0 < real X \ (0 < X \ X \ \)" - by (cases X) auto - -lemma real_of_extreal_le_1: fixes X :: extreal shows "X \ 1 \ real X \ 1" - by (cases X) (auto simp: one_extreal_def) - locale prob_space = measure_space + assumes measure_space_1: "measure M (space M) = 1" @@ -83,6 +66,11 @@ "joint_distribution X X {(x, x)} = distribution X {x}" unfolding distribution_def by (auto intro!: arg_cong[where f=\']) +lemma (in prob_space) measure_le_1: "X \ sets M \ \ X \ 1" + unfolding measure_space_1[symmetric] + using sets_into_space + by (intro measure_mono) auto + lemma (in prob_space) distribution_1: "distribution X A \ 1" unfolding distribution_def by simp @@ -1017,10 +1005,6 @@ qed qed -lemma extreal_0_le_iff_le_0[simp]: - fixes a :: extreal shows "0 \ -a \ a \ 0" - by (cases rule: extreal2_cases[of a]) auto - lemma (in sigma_algebra) factorize_measurable_function: fixes Z :: "'a \ extreal" and Y :: "'a \ 'c" assumes "sigma_algebra M'" and "Y \ measurable M M'" "Z \ borel_measurable M"