# HG changeset patch # User hoelzl # Date 1430830337 -7200 # Node ID 831ddb69db9b70917576c5ab96082a9356a7a0be # Parent 70d8f7abde8f5a1bcf5d344a9c880a3a560bcad6 add lfp/gfp rule for nn_integral diff -r 70d8f7abde8f -r 831ddb69db9b src/HOL/Nat.thy --- a/src/HOL/Nat.thy Mon May 04 18:49:51 2015 +0200 +++ b/src/HOL/Nat.thy Tue May 05 14:52:17 2015 +0200 @@ -1877,6 +1877,11 @@ shows "mono Q \ mono (\i. (Q ^^ i) \)" by (auto intro!: funpow_decreasing simp: mono_def) +lemma antimono_funpow: + fixes Q :: "('i \ 'a::{lattice, order_top}) \ ('i \ 'a)" + shows "mono Q \ antimono (\i. (Q ^^ i) \)" + by (auto intro!: funpow_increasing simp: antimono_def) + subsection {* The divides relation on @{typ nat} *} lemma dvd_1_left [iff]: "Suc 0 dvd k" diff -r 70d8f7abde8f -r 831ddb69db9b src/HOL/Probability/Nonnegative_Lebesgue_Integration.thy --- a/src/HOL/Probability/Nonnegative_Lebesgue_Integration.thy Mon May 04 18:49:51 2015 +0200 +++ b/src/HOL/Probability/Nonnegative_Lebesgue_Integration.thy Tue May 05 14:52:17 2015 +0200 @@ -838,6 +838,9 @@ "(\x. x \ space M \ u x \ v x) \ integral\<^sup>N M u \ integral\<^sup>N M v" by (auto intro: nn_integral_mono_AE) +lemma mono_nn_integral: "mono F \ mono (\x. integral\<^sup>N M (F x))" + by (auto simp add: mono_def le_fun_def intro!: nn_integral_mono) + lemma nn_integral_cong_AE: "AE x in M. u x = v x \ integral\<^sup>N M u = integral\<^sup>N M v" by (auto simp: eq_iff intro!: nn_integral_mono_AE) @@ -1081,6 +1084,9 @@ "0 \ c \ (\\<^sup>+ x. c \M) = c * (emeasure M) (space M)" by (subst nn_integral_eq_simple_integral) auto +lemma nn_integral_const_nonpos: "c \ 0 \ nn_integral M (\x. c) = 0" + using nn_integral_max_0[of M "\x. c"] by (simp add: max_def split: split_if_asm) + lemma nn_integral_linear: assumes f: "f \ borel_measurable M" "\x. 0 \ f x" and "0 \ a" and g: "g \ borel_measurable M" "\x. 0 \ g x" @@ -1482,6 +1488,89 @@ by (intro Liminf_eq_Limsup) auto qed +lemma nn_integral_monotone_convergence_INF': + assumes f: "decseq f" and [measurable]: "\i. f i \ borel_measurable M" + assumes "(\\<^sup>+ x. f 0 x \M) < \" and nn: "\x i. 0 \ f i x" + shows "(\\<^sup>+ x. (INF i. f i x) \M) = (INF i. integral\<^sup>N M (f i))" +proof (rule LIMSEQ_unique) + show "(\i. integral\<^sup>N M (f i)) ----> (INF i. integral\<^sup>N M (f i))" + using f by (intro LIMSEQ_INF) (auto intro!: nn_integral_mono simp: decseq_def le_fun_def) + show "(\i. integral\<^sup>N M (f i)) ----> \\<^sup>+ x. (INF i. f i x) \M" + proof (rule nn_integral_dominated_convergence) + show "(\\<^sup>+ x. f 0 x \M) < \" "\i. f i \ borel_measurable M" "f 0 \ borel_measurable M" + by fact+ + show "\j. AE x in M. 0 \ f j x" + using nn by auto + show "\j. AE x in M. f j x \ f 0 x" + using f by (auto simp: decseq_def le_fun_def) + show "AE x in M. (\i. f i x) ----> (INF i. f i x)" + using f by (auto intro!: LIMSEQ_INF simp: decseq_def le_fun_def) + show "(\x. INF i. f i x) \ borel_measurable M" + by auto + qed +qed + +lemma nn_integral_monotone_convergence_INF: + assumes f: "decseq f" and [measurable]: "\i. f i \ borel_measurable M" + assumes fin: "(\\<^sup>+ x. f i x \M) < \" + shows "(\\<^sup>+ x. (INF i. f i x) \M) = (INF i. integral\<^sup>N M (f i))" +proof - + { fix f :: "nat \ ereal" and j assume "decseq f" + then have "(INF i. f i) = (INF i. f (i + j))" + apply (intro INF_eq) + apply (rule_tac x="i" in bexI) + apply (auto simp: decseq_def le_fun_def) + done } + note INF_shift = this + + have dec: "\f::nat \ 'a \ ereal. decseq f \ decseq (\j x. max 0 (f (j + i) x))" + by (intro antimonoI le_funI max.mono) (auto simp: decseq_def le_fun_def) + + have "(\\<^sup>+ x. max 0 (INF i. f i x) \M) = (\\<^sup>+ x. (INF i. max 0 (f i x)) \M)" + by (intro nn_integral_cong) + (simp add: sup_ereal_def[symmetric] sup_INF del: sup_ereal_def) + also have "\ = (\\<^sup>+ x. (INF j. max 0 (f (j + i) x)) \M)" + using f by (intro nn_integral_cong INF_shift antimonoI le_funI max.mono) + (auto simp: decseq_def le_fun_def) + also have "\ = (INF j. (\\<^sup>+ x. max 0 (f (j + i) x) \M))" + proof (rule nn_integral_monotone_convergence_INF') + show "\j. (\x. max 0 (f (j + i) x)) \ borel_measurable M" + by measurable + show "(\\<^sup>+ x. max 0 (f (0 + i) x) \M) < \" + using fin by (simp add: nn_integral_max_0) + qed (intro max.cobounded1 dec f)+ + also have "\ = (INF j. (\\<^sup>+ x. max 0 (f j x) \M))" + using f by (intro INF_shift[symmetric] nn_integral_mono antimonoI le_funI max.mono) + (auto simp: decseq_def le_fun_def) + finally show ?thesis unfolding nn_integral_max_0 . +qed + +lemma sup_continuous_nn_integral: + assumes f: "\y. sup_continuous (f y)" + assumes [measurable]: "\F x. (\y. f y F x) \ borel_measurable (M x)" + shows "sup_continuous (\F x. (\\<^sup>+y. f y F x \M x))" + unfolding sup_continuous_def +proof safe + fix C :: "nat \ 'b \ ereal" assume C: "incseq C" + then show "(\x. \\<^sup>+ y. f y (SUPREMUM UNIV C) x \M x) = (SUP i. (\x. \\<^sup>+ y. f y (C i) x \M x))" + using sup_continuous_mono[OF f] + by (simp add: sup_continuousD[OF f C] fun_eq_iff nn_integral_monotone_convergence_SUP mono_def le_fun_def) +qed + +lemma inf_continuous_nn_integral: + assumes f: "\y. inf_continuous (f y)" + assumes [measurable]: "\F x. (\y. f y F x) \ borel_measurable (M x)" + assumes bnd: "\x F. (\\<^sup>+ y. f y F x \M x) \ \" + shows "inf_continuous (\F x. (\\<^sup>+y. f y F x \M x))" + unfolding inf_continuous_def +proof safe + fix C :: "nat \ 'b \ ereal" assume C: "decseq C" + then show "(\x. \\<^sup>+ y. f y (INFIMUM UNIV C) x \M x) = (INF i. (\x. \\<^sup>+ y. f y (C i) x \M x))" + using inf_continuous_mono[OF f] + by (auto simp add: inf_continuousD[OF f C] fun_eq_iff antimono_def mono_def le_fun_def bnd + intro!: nn_integral_monotone_convergence_INF) +qed + lemma nn_integral_null_set: assumes "N \ null_sets M" shows "(\\<^sup>+ x. u x * indicator N x \M) = 0" proof - @@ -1649,6 +1738,124 @@ by (simp add: F_def) qed +lemma nn_integral_lfp: + assumes sets: "\s. sets (M s) = sets N" + assumes f: "sup_continuous f" + assumes meas: "\F. F \ borel_measurable N \ f F \ borel_measurable N" + assumes nonneg: "\F s. 0 \ g F s" + assumes g: "sup_continuous g" + assumes step: "\F s. F \ borel_measurable N \ integral\<^sup>N (M s) (f F) = g (\s. integral\<^sup>N (M s) F) s" + shows "(\\<^sup>+\. lfp f \ \M s) = lfp g s" +proof (rule antisym) + show "lfp g s \ (\\<^sup>+\. lfp f \ \M s)" + proof (induction arbitrary: s rule: lfp_ordinal_induct[OF sup_continuous_mono[OF g]]) + case (1 F) then show ?case + apply (subst lfp_unfold[OF sup_continuous_mono[OF f]]) + apply (subst step) + apply (rule borel_measurable_lfp[OF f]) + apply (rule meas) + apply assumption+ + apply (rule monoD[OF sup_continuous_mono[OF g], THEN le_funD]) + apply (simp add: le_fun_def) + done + qed (auto intro: SUP_least) + + have lfp_nonneg: "\s. 0 \ lfp g s" + by (subst lfp_unfold[OF sup_continuous_mono[OF g]]) (rule nonneg) + + { fix i have "((f ^^ i) bot) \ borel_measurable N" + by (induction i) (simp_all add: meas) } + + have "(\\<^sup>+\. lfp f \ \M s) = (\\<^sup>+\. (SUP i. (f ^^ i) bot \) \M s)" + by (simp add: sup_continuous_lfp f) + also have "\ = (SUP i. \\<^sup>+\. (f ^^ i) bot \ \M s)" + proof (rule nn_integral_monotone_convergence_SUP) + show "incseq (\i. (f ^^ i) bot)" + using f[THEN sup_continuous_mono] by (rule mono_funpow) + show "\i. ((f ^^ i) bot) \ borel_measurable (M s)" + unfolding measurable_cong_sets[OF sets refl] by fact + qed + also have "\ \ lfp g s" + proof (rule SUP_least) + fix i show "integral\<^sup>N (M s) ((f ^^ i) bot) \ lfp g s" + proof (induction i arbitrary: s) + case 0 then show ?case + by (simp add: nn_integral_const_nonpos lfp_nonneg) + next + case (Suc n) + show ?case + apply (simp del: bot_apply) + apply (subst step) + apply fact + apply (subst lfp_unfold[OF sup_continuous_mono[OF g]]) + apply (rule monoD[OF sup_continuous_mono[OF g], THEN le_funD]) + apply (rule le_funI) + apply (rule Suc) + done + qed + qed + finally show "(\\<^sup>+\. lfp f \ \M s) \ lfp g s" . +qed + +lemma nn_integral_gfp: + assumes sets: "\s. sets (M s) = sets N" + assumes f: "inf_continuous f" + assumes meas: "\F. F \ borel_measurable N \ f F \ borel_measurable N" + assumes bound: "\F s. (\\<^sup>+x. f F x \M s) < \" + assumes non_zero: "\s. emeasure (M s) (space (M s)) \ 0" + assumes g: "inf_continuous g" + assumes step: "\F s. F \ borel_measurable N \ integral\<^sup>N (M s) (f F) = g (\s. integral\<^sup>N (M s) F) s" + shows "(\\<^sup>+\. gfp f \ \M s) = gfp g s" +proof (rule antisym) + show "(\\<^sup>+\. gfp f \ \M s) \ gfp g s" + proof (induction arbitrary: s rule: gfp_ordinal_induct[OF inf_continuous_mono[OF g]]) + case (1 F) then show ?case + apply (subst gfp_unfold[OF inf_continuous_mono[OF f]]) + apply (subst step) + apply (rule borel_measurable_gfp[OF f]) + apply (rule meas) + apply assumption+ + apply (rule monoD[OF inf_continuous_mono[OF g], THEN le_funD]) + apply (simp add: le_fun_def) + done + qed (auto intro: INF_greatest) + + { fix i have "((f ^^ i) top) \ borel_measurable N" + by (induction i) (simp_all add: meas) } + + have "(\\<^sup>+\. gfp f \ \M s) = (\\<^sup>+\. (INF i. (f ^^ i) top \) \M s)" + by (simp add: inf_continuous_gfp f) + also have "\ = (INF i. \\<^sup>+\. (f ^^ i) top \ \M s)" + proof (rule nn_integral_monotone_convergence_INF) + show "decseq (\i. (f ^^ i) top)" + using f[THEN inf_continuous_mono] by (rule antimono_funpow) + show "\i. ((f ^^ i) top) \ borel_measurable (M s)" + unfolding measurable_cong_sets[OF sets refl] by fact + show "integral\<^sup>N (M s) ((f ^^ 1) top) < \" + using bound[of s top] by simp + qed + also have "\ \ gfp g s" + proof (rule INF_greatest) + fix i show "gfp g s \ integral\<^sup>N (M s) ((f ^^ i) top)" + proof (induction i arbitrary: s) + case 0 with non_zero[of s] show ?case + by (simp add: top_ereal_def less_le emeasure_nonneg) + next + case (Suc n) + show ?case + apply (simp del: top_apply) + apply (subst step) + apply fact + apply (subst gfp_unfold[OF inf_continuous_mono[OF g]]) + apply (rule monoD[OF inf_continuous_mono[OF g], THEN le_funD]) + apply (rule le_funI) + apply (rule Suc) + done + qed + qed + finally show "gfp g s \ (\\<^sup>+\. gfp f \ \M s)" . +qed + subsection {* Integral under concrete measures *} lemma nn_integral_empty: