2639 by (metis A(2)[symmetric]) |
2639 by (metis A(2)[symmetric]) |
2640 then show "P (c {a \<in> A. k a = (\<Union>x\<in>A. k x)})" |
2640 then show "P (c {a \<in> A. k a = (\<Union>x\<in>A. k x)})" |
2641 by (simp add: A(3)) |
2641 by (simp add: A(3)) |
2642 qed |
2642 qed |
2643 |
2643 |
|
2644 instantiation measure :: (type) complete_lattice |
|
2645 begin |
|
2646 |
2644 interpretation sup_measure: comm_monoid_set sup "bot :: 'a measure" |
2647 interpretation sup_measure: comm_monoid_set sup "bot :: 'a measure" |
2645 proof qed (auto intro!: antisym) |
2648 by standard (auto intro!: antisym) |
2646 |
2649 |
2647 lemma sup_measure_F_mono': |
2650 lemma sup_measure_F_mono': |
2648 "finite J \<Longrightarrow> finite I \<Longrightarrow> sup_measure.F id I \<le> sup_measure.F id (I \<union> J)" |
2651 "finite J \<Longrightarrow> finite I \<Longrightarrow> sup_measure.F id I \<le> sup_measure.F id (I \<union> J)" |
2649 proof (induction J rule: finite_induct) |
2652 proof (induction J rule: finite_induct) |
2650 case empty then show ?case |
2653 case empty then show ?case |
2741 show "positive (sets (Sup_measure' M)) ?S" |
2744 show "positive (sets (Sup_measure' M)) ?S" |
2742 by (auto simp: positive_def bot_ennreal[symmetric]) |
2745 by (auto simp: positive_def bot_ennreal[symmetric]) |
2743 show "X \<in> sets (Sup_measure' M)" |
2746 show "X \<in> sets (Sup_measure' M)" |
2744 using assms * by auto |
2747 using assms * by auto |
2745 qed (rule UN_space_closed) |
2748 qed (rule UN_space_closed) |
2746 |
|
2747 instantiation measure :: (type) complete_lattice |
|
2748 begin |
|
2749 |
2749 |
2750 definition Sup_measure :: "'a measure set \<Rightarrow> 'a measure" |
2750 definition Sup_measure :: "'a measure set \<Rightarrow> 'a measure" |
2751 where |
2751 where |
2752 "Sup_measure = Sup_lexord space (Sup_lexord sets Sup_measure' |
2752 "Sup_measure = Sup_lexord space (Sup_lexord sets Sup_measure' |
2753 (\<lambda>U. sigma (\<Union>u\<in>U. space u) (\<Union>u\<in>U. sets u))) (\<lambda>U. sigma (\<Union>u\<in>U. space u) {})" |
2753 (\<lambda>U. sigma (\<Union>u\<in>U. space u) (\<Union>u\<in>U. sets u))) (\<lambda>U. sigma (\<Union>u\<in>U. space u) {})" |
2945 |
2945 |
2946 lemma emeasure_SUP: |
2946 lemma emeasure_SUP: |
2947 assumes sets: "\<And>i. i \<in> I \<Longrightarrow> sets (M i) = sets N" "X \<in> sets N" "I \<noteq> {}" |
2947 assumes sets: "\<And>i. i \<in> I \<Longrightarrow> sets (M i) = sets N" "X \<in> sets N" "I \<noteq> {}" |
2948 shows "emeasure (SUP i:I. M i) X = (SUP J:{J. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I}. emeasure (SUP i:J. M i) X)" |
2948 shows "emeasure (SUP i:I. M i) X = (SUP J:{J. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I}. emeasure (SUP i:J. M i) X)" |
2949 proof - |
2949 proof - |
|
2950 interpret sup_measure: comm_monoid_set sup "bot :: 'b measure" |
|
2951 by standard (auto intro!: antisym) |
2950 have eq: "finite J \<Longrightarrow> sup_measure.F id J = (SUP i:J. i)" for J :: "'b measure set" |
2952 have eq: "finite J \<Longrightarrow> sup_measure.F id J = (SUP i:J. i)" for J :: "'b measure set" |
2951 by (induction J rule: finite_induct) auto |
2953 by (induction J rule: finite_induct) auto |
2952 have 1: "J \<noteq> {} \<Longrightarrow> J \<subseteq> I \<Longrightarrow> sets (SUP x:J. M x) = sets N" for J |
2954 have 1: "J \<noteq> {} \<Longrightarrow> J \<subseteq> I \<Longrightarrow> sets (SUP x:J. M x) = sets N" for J |
2953 by (intro sets_SUP sets) (auto ) |
2955 by (intro sets_SUP sets) (auto ) |
2954 |
|
2955 from \<open>I \<noteq> {}\<close> obtain i where "i\<in>I" by auto |
2956 from \<open>I \<noteq> {}\<close> obtain i where "i\<in>I" by auto |
2956 have "Sup_measure' (M`I) X = (SUP P:{P. finite P \<and> P \<subseteq> M`I}. sup_measure.F id P X)" |
2957 have "Sup_measure' (M`I) X = (SUP P:{P. finite P \<and> P \<subseteq> M`I}. sup_measure.F id P X)" |
2957 using sets by (intro emeasure_Sup_measure') auto |
2958 using sets by (intro emeasure_Sup_measure') auto |
2958 also have "Sup_measure' (M`I) = (SUP i:I. M i)" |
2959 also have "Sup_measure' (M`I) = (SUP i:I. M i)" |
2959 unfolding Sup_measure_def using \<open>I \<noteq> {}\<close> sets sets(1)[THEN sets_eq_imp_space_eq] |
2960 unfolding Sup_measure_def using \<open>I \<noteq> {}\<close> sets sets(1)[THEN sets_eq_imp_space_eq] |
3306 from \<open>?M \<noteq> 0\<close> *[OF this] have "?m x \<noteq> 0" by (auto simp: field_simps measure_le_0_iff) |
3307 from \<open>?M \<noteq> 0\<close> *[OF this] have "?m x \<noteq> 0" by (auto simp: field_simps measure_le_0_iff) |
3307 then have "{x} \<in> sets M" by (auto dest: measure_notin_sets) } |
3308 then have "{x} \<in> sets M" by (auto dest: measure_notin_sets) } |
3308 note singleton_sets = this |
3309 note singleton_sets = this |
3309 have "?M < (\<Sum>x\<in>X. ?M / Suc n)" |
3310 have "?M < (\<Sum>x\<in>X. ?M / Suc n)" |
3310 using \<open>?M \<noteq> 0\<close> |
3311 using \<open>?M \<noteq> 0\<close> |
3311 by (simp add: \<open>card X = Suc (Suc n)\<close> of_nat_Suc field_simps less_le measure_nonneg) |
3312 by (simp add: \<open>card X = Suc (Suc n)\<close> field_simps less_le) |
3312 also have "\<dots> \<le> (\<Sum>x\<in>X. ?m x)" |
3313 also have "\<dots> \<le> (\<Sum>x\<in>X. ?m x)" |
3313 by (rule setsum_mono) fact |
3314 by (rule setsum_mono) fact |
3314 also have "\<dots> = measure M (\<Union>x\<in>X. {x})" |
3315 also have "\<dots> = measure M (\<Union>x\<in>X. {x})" |
3315 using singleton_sets \<open>finite X\<close> |
3316 using singleton_sets \<open>finite X\<close> |
3316 by (intro finite_measure_finite_Union[symmetric]) (auto simp: disjoint_family_on_def) |
3317 by (intro finite_measure_finite_Union[symmetric]) (auto simp: disjoint_family_on_def) |