# HG changeset patch # User paulson # Date 1523956962 -3600 # Node ID 53ab458395a89d68066f6f13373428a55f437e0f # Parent c0ebecf6e3ebc006903a08fa45bf74c15b87d58b more about measure diff -r c0ebecf6e3eb -r 53ab458395a8 src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy --- a/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Mon Apr 16 21:23:38 2018 +0100 +++ b/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Tue Apr 17 10:22:42 2018 +0100 @@ -1383,6 +1383,36 @@ "\S \ lmeasurable; negligible((S - T) \ (T - S))\ \ T \ lmeasurable" using integrable_spike_set_eq lmeasurable_iff_integrable_on by blast + +lemma measure_Un3_negligible: + assumes meas: "S \ lmeasurable" "T \ lmeasurable" "U \ lmeasurable" + and neg: "negligible(S \ T)" "negligible(S \ U)" "negligible(T \ U)" and V: "S \ T \ U = V" +shows "measure lebesgue V = measure lebesgue S + measure lebesgue T + measure lebesgue U" +proof - + have [simp]: "measure lebesgue (S \ T) = 0" + using neg(1) negligible_imp_measure0 by blast + have [simp]: "measure lebesgue (S \ U \ T \ U) = 0" + using neg(2) neg(3) negligible_Un negligible_imp_measure0 by blast + have "measure lebesgue V = measure lebesgue (S \ T \ U)" + using V by simp + also have "\ = measure lebesgue S + measure lebesgue T + measure lebesgue U" + by (simp add: measure_Un3 meas fmeasurable.Un Int_Un_distrib2) + finally show ?thesis . +qed + +lemma measure_translate_add: + assumes meas: "S \ lmeasurable" "T \ lmeasurable" + and U: "S \ ((+)a ` T) = U" and neg: "negligible(S \ ((+)a ` T))" + shows "measure lebesgue S + measure lebesgue T = measure lebesgue U" +proof - + have [simp]: "measure lebesgue (S \ (+) a ` T) = 0" + using neg negligible_imp_measure0 by blast + have "measure lebesgue (S \ ((+)a ` T)) = measure lebesgue S + measure lebesgue T" + by (simp add: measure_Un3 meas measurable_translation measure_translation fmeasurable.Un) + then show ?thesis + using U by auto +qed + lemma measure_negligible_symdiff: assumes S: "S \ lmeasurable" and neg: "negligible (S - T \ (T - S))" @@ -2759,6 +2789,277 @@ qed (use \ cbox djointish close covers in auto) qed + +subsection\Transformation of measure by linear maps\ + +lemma measurable_linear_image_interval: + "linear f \ f ` (cbox a b) \ lmeasurable" + by (metis bounded_linear_image linear_linear bounded_cbox closure_bounded_linear_image closure_cbox compact_closure lmeasurable_compact) + +proposition measure_linear_sufficient: + fixes f :: "'n::euclidean_space \ 'n" + assumes "linear f" and S: "S \ lmeasurable" + and im: "\a b. measure lebesgue (f ` (cbox a b)) = m * measure lebesgue (cbox a b)" + shows "f ` S \ lmeasurable \ m * measure lebesgue S = measure lebesgue (f ` S)" + using le_less_linear [of 0 m] +proof + assume "m < 0" + then show ?thesis + using im [of 0 One] by auto +next + assume "m \ 0" + let ?\ = "measure lebesgue" + show ?thesis + proof (cases "inj f") + case False + then have "?\ (f ` S) = 0" + using \linear f\ negligible_imp_measure0 negligible_linear_singular_image by blast + then have "m * ?\ (cbox 0 (One)) = 0" + by (metis False \linear f\ cbox_borel content_unit im measure_completion negligible_imp_measure0 negligible_linear_singular_image sets_lborel) + then show ?thesis + using \linear f\ negligible_linear_singular_image negligible_imp_measure0 False + by (auto simp: lmeasurable_iff_has_integral negligible_UNIV) + next + case True + then obtain h where "linear h" and hf: "\x. h (f x) = x" and fh: "\x. f (h x) = x" + using \linear f\ linear_injective_isomorphism by blast + have fBS: "(f ` S) \ lmeasurable \ m * ?\ S = ?\ (f ` S)" + if "bounded S" "S \ lmeasurable" for S + proof - + obtain a b where "S \ cbox a b" + using \bounded S\ bounded_subset_cbox by blast + have fUD: "(f ` \\) \ lmeasurable \ ?\ (f ` \\) = (m * ?\ (\\))" + if "countable \" + and cbox: "\K. K \ \ \ K \ cbox a b \ K \ {} \ (\c d. K = cbox c d)" + and intint: "pairwise (\A B. interior A \ interior B = {}) \" + for \ + proof - + have conv: "\K. K \ \ \ convex K" + using cbox convex_box(1) by blast + have neg: "negligible (g ` K \ g ` L)" if "linear g" "K \ \" "L \ \" "K \ L" + for K L and g :: "'n\'n" + proof (cases "inj g") + case True + have "negligible (frontier(g ` K \ g ` L) \ interior(g ` K \ g ` L))" + proof (rule negligible_Un) + show "negligible (frontier (g ` K \ g ` L))" + by (simp add: negligible_convex_frontier convex_Int conv convex_linear_image that) + next + show "negligible (interior (g ` K \ g ` L))" + by (metis (mono_tags, lifting) True finite.emptyI image_Int image_empty interior_Int interior_injective_linear_image intint negligible_finite pairwiseD that) + qed + moreover have "g ` K \ g ` L \ frontier (g ` K \ g ` L) \ interior (g ` K \ g ` L)" + apply (auto simp: frontier_def) + using closure_subset contra_subsetD by fastforce+ + ultimately show ?thesis + by (rule negligible_subset) + next + case False + then show ?thesis + by (simp add: negligible_Int negligible_linear_singular_image \linear g\) + qed + have negf: "negligible ((f ` K) \ (f ` L))" + and negid: "negligible (K \ L)" if "K \ \" "L \ \" "K \ L" for K L + using neg [OF \linear f\] neg [OF linear_id] that by auto + show ?thesis + proof (cases "finite \") + case True + then have "?\ (\x\\. f ` x) = (\x\\. ?\ (f ` x))" + using \linear f\ cbox measurable_linear_image_interval negf + by (blast intro: measure_negligible_finite_Union_image [unfolded pairwise_def]) + also have "\ = (\k\\. m * ?\ k)" + by (metis (no_types, lifting) cbox im sum.cong) + also have "\ = m * ?\ (\\)" + unfolding sum_distrib_left [symmetric] + by (metis True cbox lmeasurable_cbox measure_negligible_finite_Union [unfolded pairwise_def] negid) + finally show ?thesis + by (metis True \linear f\ cbox image_Union fmeasurable.finite_UN measurable_linear_image_interval) + next + case False + with \countable \\ obtain X :: "nat \ 'n set" where S: "bij_betw X UNIV \" + using bij_betw_from_nat_into by blast + then have eq: "(\\) = (\n. X n)" "(f ` \\) = (\n. f ` X n)" + by (auto simp: bij_betw_def) + have meas: "\K. K \ \ \ K \ lmeasurable" + using cbox by blast + with S have 1: "\n. X n \ lmeasurable" + by (auto simp: bij_betw_def) + have 2: "pairwise (\m n. negligible (X m \ X n)) UNIV" + using S unfolding bij_betw_def pairwise_def by (metis injD negid range_eqI) + have "bounded (\\)" + by (meson Sup_least bounded_cbox bounded_subset cbox) + then have 3: "bounded (\n. X n)" + using S unfolding bij_betw_def by blast + have "(\n. X n) \ lmeasurable" + by (rule measurable_countable_negligible_Union_bounded [OF 1 2 3]) + with S have f1: "\n. f ` (X n) \ lmeasurable" + unfolding bij_betw_def by (metis assms(1) cbox measurable_linear_image_interval rangeI) + have f2: "pairwise (\m n. negligible (f ` (X m) \ f ` (X n))) UNIV" + using S unfolding bij_betw_def pairwise_def by (metis injD negf rangeI) + have "bounded (\\)" + by (meson Sup_least bounded_cbox bounded_subset cbox) + then have f3: "bounded (\n. f ` X n)" + using S unfolding bij_betw_def + by (metis bounded_linear_image linear_linear assms(1) image_Union range_composition) + have "(\n. ?\ (X n)) sums ?\ (\n. X n)" + by (rule measure_countable_negligible_Union_bounded [OF 1 2 3]) + have meq: "?\ (\n. f ` X n) = m * ?\ (UNION UNIV X)" + proof (rule sums_unique2 [OF measure_countable_negligible_Union_bounded [OF f1 f2 f3]]) + have m: "\n. ?\ (f ` X n) = (m * ?\ (X n))" + using S unfolding bij_betw_def by (metis cbox im rangeI) + show "(\n. ?\ (f ` X n)) sums (m * ?\ (UNION UNIV X))" + unfolding m + using measure_countable_negligible_Union_bounded [OF 1 2 3] sums_mult by blast + qed + show ?thesis + using measurable_countable_negligible_Union_bounded [OF f1 f2 f3] meq + by (auto simp: eq [symmetric]) + qed + qed + show ?thesis + unfolding completion.fmeasurable_measure_inner_outer_le + proof (intro conjI allI impI) + fix e :: real + assume "e > 0" + have 1: "cbox a b - S \ lmeasurable" + by (simp add: fmeasurable.Diff that) + have 2: "0 < e / (1 + \m\)" + using \e > 0\ by (simp add: divide_simps abs_add_one_gt_zero) + obtain \ + where "countable \" + and cbox: "\K. K \ \ \ K \ cbox a b \ K \ {} \ (\c d. K = cbox c d)" + and intdisj: "pairwise (\A B. interior A \ interior B = {}) \" + and DD: "cbox a b - S \ \\" "\\ \ lmeasurable" + and le: "?\ (\\) \ ?\ (cbox a b - S) + e/(1 + \m\)" + by (rule measurable_outer_intervals_bounded [of "cbox a b - S" a b "e/(1 + \m\)"]; use 1 2 pairwise_def in force) + have meq: "?\ (cbox a b - S) = ?\ (cbox a b) - ?\ S" + by (simp add: measurable_measure_Diff \S \ cbox a b\ fmeasurableD that(2)) + show "\T \ lmeasurable. T \ f ` S \ m * ?\ S - e \ ?\ T" + proof (intro bexI conjI) + show "f ` (cbox a b) - f ` (\\) \ f ` S" + using \cbox a b - S \ \\\ by force + have "m * ?\ S - e \ m * (?\ S - e / (1 + \m\))" + using \m \ 0\ \e > 0\ by (simp add: field_simps) + also have "\ \ ?\ (f ` cbox a b) - ?\ (f ` (\\))" + using le \m \ 0\ \e > 0\ + apply (simp add: im fUD [OF \countable \\ cbox intdisj] right_diff_distrib [symmetric]) + apply (rule mult_left_mono; simp add: algebra_simps meq) + done + also have "\ = ?\ (f ` cbox a b - f ` \\)" + apply (rule measurable_measure_Diff [symmetric]) + apply (simp add: assms(1) measurable_linear_image_interval) + apply (simp add: \countable \\ cbox fUD fmeasurableD intdisj) + apply (simp add: Sup_le_iff cbox image_mono) + done + finally show "m * ?\ S - e \ ?\ (f ` cbox a b - f ` \\)" . + show "f ` cbox a b - f ` \\ \ lmeasurable" + by (simp add: fUD \countable \\ \linear f\ cbox fmeasurable.Diff intdisj measurable_linear_image_interval) + qed + next + fix e :: real + assume "e > 0" + have em: "0 < e / (1 + \m\)" + using \e > 0\ by (simp add: divide_simps abs_add_one_gt_zero) + obtain \ + where "countable \" + and cbox: "\K. K \ \ \ K \ cbox a b \ K \ {} \ (\c d. K = cbox c d)" + and intdisj: "pairwise (\A B. interior A \ interior B = {}) \" + and DD: "S \ \\" "\\ \ lmeasurable" + and le: "?\ (\\) \ ?\ S + e/(1 + \m\)" + by (rule measurable_outer_intervals_bounded [of S a b "e/(1 + \m\)"]; use \S \ lmeasurable\ \S \ cbox a b\ em in force) + show "\U \ lmeasurable. f ` S \ U \ ?\ U \ m * ?\ S + e" + proof (intro bexI conjI) + show "f ` S \ f ` (\\)" + by (simp add: DD(1) image_mono) + have "?\ (f ` \\) \ m * (?\ S + e / (1 + \m\))" + using \m \ 0\ le mult_left_mono + by (auto simp: fUD \countable \\ \linear f\ cbox fmeasurable.Diff intdisj measurable_linear_image_interval) + also have "\ \ m * ?\ S + e" + using \m \ 0\ \e > 0\ by (simp add: fUD [OF \countable \\ cbox intdisj] field_simps) + finally show "?\ (f ` \\) \ m * ?\ S + e" . + show "f ` \\ \ lmeasurable" + by (simp add: \countable \\ cbox fUD intdisj) + qed + qed + qed + show ?thesis + unfolding has_measure_limit_iff + proof (intro allI impI) + fix e :: real + assume "e > 0" + obtain B where "B > 0" and B: + "\a b. ball 0 B \ cbox a b \ \?\ (S \ cbox a b) - ?\ S\ < e / (1 + \m\)" + using has_measure_limit [OF S] \e > 0\ by (metis abs_add_one_gt_zero zero_less_divide_iff) + obtain c d::'n where cd: "ball 0 B \ cbox c d" + using bounded_subset_cbox by blast + with B have less: "\?\ (S \ cbox c d) - ?\ S\ < e / (1 + \m\)" . + obtain D where "D > 0" and D: "cbox c d \ ball 0 D" + by (metis bounded_cbox bounded_subset_ballD) + obtain C where "C > 0" and C: "\x. norm (f x) \ C * norm x" + using linear_bounded_pos \linear f\ by blast + have "f ` S \ cbox a b \ lmeasurable \ + \?\ (f ` S \ cbox a b) - m * ?\ S\ < e" + if "ball 0 (D*C) \ cbox a b" for a b + proof - + have "bounded (S \ h ` cbox a b)" + by (simp add: bounded_linear_image linear_linear \linear h\ bounded_Int) + moreover have Shab: "S \ h ` cbox a b \ lmeasurable" + by (simp add: S \linear h\ fmeasurable.Int measurable_linear_image_interval) + moreover have fim: "f ` (S \ h ` (cbox a b)) = (f ` S) \ cbox a b" + by (auto simp: hf rev_image_eqI fh) + ultimately have 1: "(f ` S) \ cbox a b \ lmeasurable" + and 2: "m * ?\ (S \ h ` cbox a b) = ?\ ((f ` S) \ cbox a b)" + using fBS [of "S \ (h ` (cbox a b))"] by auto + have *: "\\z - m\ < e; z \ w; w \ m\ \ \w - m\ \ e" + for w z m and e::real by auto + have meas_adiff: "\?\ (S \ h ` cbox a b) - ?\ S\ \ e / (1 + \m\)" + proof (rule * [OF less]) + show "?\ (S \ cbox c d) \ ?\ (S \ h ` cbox a b)" + proof (rule measure_mono_fmeasurable [OF _ _ Shab]) + have "f ` ball 0 D \ ball 0 (C * D)" + using C \C > 0\ + apply (clarsimp simp: algebra_simps) + by (meson le_less_trans linordered_comm_semiring_strict_class.comm_mult_strict_left_mono) + then have "f ` ball 0 D \ cbox a b" + by (metis mult.commute order_trans that) + have "ball 0 D \ h ` cbox a b" + by (metis \f ` ball 0 D \ cbox a b\ hf image_subset_iff subsetI) + then show "S \ cbox c d \ S \ h ` cbox a b" + using D by blast + next + show "S \ cbox c d \ sets lebesgue" + using S fmeasurable_cbox by blast + qed + next + show "?\ (S \ h ` cbox a b) \ ?\ S" + by (simp add: S Shab fmeasurableD measure_mono_fmeasurable) + qed + have "\?\ (f ` S \ cbox a b) - m * ?\ S\ \ m * e / (1 + \m\)" + proof - + have mm: "\m\ = m" + by (simp add: \0 \ m\) + then have "\?\ S - ?\ (S \ h ` cbox a b)\ * m \ e / (1 + m) * m" + by (metis (no_types) \0 \ m\ meas_adiff abs_minus_commute mult_right_mono) + moreover have "\r. \r * m\ = m * \r\" + by (metis \0 \ m\ abs_mult_pos mult.commute) + ultimately show ?thesis + apply (simp add: 2 [symmetric]) + by (metis (no_types) abs_minus_commute mult.commute right_diff_distrib' mm) + qed + also have "\ < e" + using \e > 0\ by (auto simp: divide_simps) + finally have "\?\ (f ` S \ cbox a b) - m * ?\ S\ < e" . + with 1 show ?thesis by auto + qed + then show "\B>0. \a b. ball 0 B \ cbox a b \ + f ` S \ cbox a b \ lmeasurable \ + \?\ (f ` S \ cbox a b) - m * ?\ S\ < e" + using \C>0\ \D>0\ by (metis mult_zero_left real_mult_less_iff1) + qed + qed +qed + + subsection\Lemmas about absolute integrability\ text\FIXME Redundant!\ @@ -2812,6 +3113,7 @@ using absolutely_integrable_integrable_bound by (simp add: absolutely_integrable_on_def continuous_on_norm integrable_continuous) + subsection \Componentwise\ proposition absolutely_integrable_componentwise_iff: