# HG changeset patch # User hoelzl # Date 1349863952 -7200 # Node ID 182fa22e7ee8c1c8bb0a71e4d719971ca17fe0e1 # Parent 9f2fb9b25a770b70f884270e6acf76676fd108e2 introduce induction rules for simple functions and for Borel measurable functions diff -r 9f2fb9b25a77 -r 182fa22e7ee8 src/HOL/Probability/Lebesgue_Integration.thy --- a/src/HOL/Probability/Lebesgue_Integration.thy Wed Oct 10 12:12:31 2012 +0200 +++ b/src/HOL/Probability/Lebesgue_Integration.thy Wed Oct 10 12:12:32 2012 +0200 @@ -355,6 +355,113 @@ "\x. (SUP i. f i x) = max 0 (u x)" "\i x. 0 \ f i x" using borel_measurable_implies_simple_function_sequence[OF u] by auto +lemma simple_function_induct[consumes 1, case_names cong set mult add, induct set: simple_function]: + fixes u :: "'a \ ereal" + assumes u: "simple_function M u" + assumes cong: "\f g. simple_function M f \ simple_function M g \ (AE x in M. f x = g x) \ P f \ P g" + assumes set: "\A. A \ sets M \ P (indicator A)" + assumes mult: "\u c. P u \ P (\x. c * u x)" + assumes add: "\u v. P u \ P v \ P (\x. v x + u x)" + shows "P u" +proof (rule cong) + from AE_space show "AE x in M. (\y\u ` space M. y * indicator (u -` {y} \ space M) x) = u x" + proof eventually_elim + fix x assume x: "x \ space M" + from simple_function_indicator_representation[OF u x] + show "(\y\u ` space M. y * indicator (u -` {y} \ space M) x) = u x" .. + qed +next + from u have "finite (u ` space M)" + unfolding simple_function_def by auto + then show "P (\x. \y\u ` space M. y * indicator (u -` {y} \ space M) x)" + proof induct + case empty show ?case + using set[of "{}"] by (simp add: indicator_def[abs_def]) + qed (auto intro!: add mult set simple_functionD u) +next + show "simple_function M (\x. (\y\u ` space M. y * indicator (u -` {y} \ space M) x))" + apply (subst simple_function_cong) + apply (rule simple_function_indicator_representation[symmetric]) + apply (auto intro: u) + done +qed fact + +lemma simple_function_induct_nn[consumes 2, case_names cong set mult add]: + fixes u :: "'a \ ereal" + assumes u: "simple_function M u" and nn: "AE x in M. 0 \ u x" + assumes cong: "\f g. simple_function M f \ simple_function M g \ (AE x in M. f x = g x) \ P f \ P g" + assumes set: "\A. A \ sets M \ P (indicator A)" + assumes mult: "\u c. 0 \ c \ P u \ P (\x. c * u x)" + assumes add: "\u v. P u \ P v \ P (\x. v x + u x)" + shows "P u" +proof - + def v \ "max 0 \ u" + have v: "simple_function M v" + unfolding v_def using u by (rule simple_function_compose) + have v_nn: "\x. 0 \ v x" + unfolding v_def by (auto simp: max_def) + + show ?thesis + proof (rule cong) + have "AE x in M. u x = v x" + unfolding v_def using nn by eventually_elim (auto simp: max_def) + with AE_space + show "AE x in M. (\y\v ` space M. y * indicator (v -` {y} \ space M) x) = u x" + proof eventually_elim + fix x assume x: "x \ space M" and "u x = v x" + from simple_function_indicator_representation[OF v x] + show "(\y\v ` space M. y * indicator (v -` {y} \ space M) x) = u x" + unfolding `u x = v x` .. + qed + next + show "simple_function M (\x. (\y\v ` space M. y * indicator (v -` {y} \ space M) x))" + apply (subst simple_function_cong) + apply (rule simple_function_indicator_representation[symmetric]) + apply (auto intro: v) + done + next + from v v_nn have "finite (v ` space M)" "\x. x \ v ` space M \ 0 \ x" + unfolding simple_function_def by auto + then show "P (\x. \y\v ` space M. y * indicator (v -` {y} \ space M) x)" + proof induct + case empty show ?case + using set[of "{}"] by (simp add: indicator_def[abs_def]) + qed (auto intro!: add mult set simple_functionD v) + qed fact +qed + +lemma borel_measurable_induct[consumes 2, case_names cong set mult add seq, induct set: borel_measurable]: + fixes u :: "'a \ ereal" + assumes u: "u \ borel_measurable M" "AE x in M. 0 \ u x" + assumes cong: "\f g. f \ borel_measurable M \ g \ borel_measurable M \ (AE x in M. f x = g x) \ P f \ P g" + assumes set: "\A. A \ sets M \ P (indicator A)" + assumes mult: "\u c. 0 \ c \ P u \ P (\x. c * u x)" + assumes add: "\u v. P u \ P v \ P (\x. v x + u x)" + assumes seq: "\U. (\i. P (U i)) \ incseq U \ P (SUP i. U i)" + shows "P u" + using u +proof (induct rule: borel_measurable_implies_simple_function_sequence') + fix U assume "\i. simple_function M (U i)" "incseq U" "\i. \ \ range (U i)" and + sup: "\x. (SUP i. U i x) = max 0 (u x)" and nn: "\i x. 0 \ U i x" + have u_eq: "max 0 \ u = (SUP i. U i)" and "\i. AE x in M. 0 \ U i x" + using nn u sup by (auto simp: max_def) + + have "max 0 \ u \ borel_measurable M" "u \ borel_measurable M" + by (auto intro!: measurable_comp u borel_measurable_ereal_max simp: id_def[symmetric]) + moreover have "AE x in M. (max 0 \ u) x = u x" + using u(2) by eventually_elim (auto simp: max_def) + moreover have "P (max 0 \ u)" + unfolding u_eq + proof (rule seq) + fix i show "P (U i)" + using `simple_function M (U i)` `AE x in M. 0 \ U i x` + by (induct rule: simple_function_induct_nn) + (auto intro: set mult add cong dest!: borel_measurable_simple_function) + qed fact + ultimately show "P u" + by fact +qed + lemma simple_function_If_set: assumes sf: "simple_function M f" "simple_function M g" and A: "A \ space M \ sets M" shows "simple_function M (\x. if x \ A then f x else g x)" (is "simple_function M ?IF") @@ -595,7 +702,7 @@ lemma simple_integral_indicator: assumes "A \ sets M" - assumes "simple_function M f" + assumes f: "simple_function M f" shows "(\\<^isup>Sx. f x * indicator A x \M) = (\x \ f ` space M. x * (emeasure M) (f -` {x} \ space M \ A))" proof cases