src/HOL/Probability/Measure.thy
changeset 41661 baf1964bc468
parent 41660 7795aaab6038
child 41689 3e39b0e730d6
equal deleted inserted replaced
41660:7795aaab6038 41661:baf1964bc468
   521       using assms by (subst measure_additive) auto
   521       using assms by (subst measure_additive) auto
   522     also have "\<dots> \<le> \<mu> (space M)"
   522     also have "\<dots> \<le> \<mu> (space M)"
   523       using assms sets_into_space by (auto intro!: measure_mono)
   523       using assms sets_into_space by (auto intro!: measure_mono)
   524     finally show False ..
   524     finally show False ..
   525   qed
   525   qed
       
   526 qed
       
   527 
       
   528 lemma True
       
   529 proof
       
   530   fix x a b :: nat
       
   531   have "\<And>x a b :: int. x dvd a \<Longrightarrow> x dvd (a + b) \<Longrightarrow> x dvd b"
       
   532     by (metis dvd_mult_div_cancel zadd_commute zdvd_reduce)
       
   533   then have "x dvd a \<Longrightarrow> x dvd (a + b) \<Longrightarrow> x dvd b"
       
   534     unfolding zdvd_int[of x] zadd_int[symmetric] .
   526 qed
   535 qed
   527 
   536 
   528 lemma measure_unique_Int_stable:
   537 lemma measure_unique_Int_stable:
   529   fixes M E :: "'a algebra" and A :: "nat \<Rightarrow> 'a set"
   538   fixes M E :: "'a algebra" and A :: "nat \<Rightarrow> 'a set"
   530   assumes "Int_stable E" "M = sigma E"
   539   assumes "Int_stable E" "M = sigma E"
   606   then have "(\<lambda>i. \<mu> (A i \<inter> X)) \<up> \<mu> X" "(\<lambda>i. \<nu> (A i \<inter> X)) \<up> \<nu> X"
   615   then have "(\<lambda>i. \<mu> (A i \<inter> X)) \<up> \<mu> X" "(\<lambda>i. \<nu> (A i \<inter> X)) \<up> \<nu> X"
   607     using `X \<in> sets M` A' by (auto intro!: M.measure_up M'.measure_up M.Int)
   616     using `X \<in> sets M` A' by (auto intro!: M.measure_up M'.measure_up M.Int)
   608   ultimately show ?thesis by (simp add: isoton_def)
   617   ultimately show ?thesis by (simp add: isoton_def)
   609 qed
   618 qed
   610 
   619 
   611 section "Isomorphisms between measure spaces"
       
   612 
       
   613 lemma (in measure_space) measure_space_isomorphic:
       
   614   fixes f :: "'c \<Rightarrow> 'a"
       
   615   assumes "bij_betw f S (space M)"
       
   616   shows "measure_space (vimage_algebra S f) (\<lambda>A. \<mu> (f ` A))"
       
   617     (is "measure_space ?T ?\<mu>")
       
   618 proof -
       
   619   have "f \<in> S \<rightarrow> space M" using assms unfolding bij_betw_def by auto
       
   620   then interpret T: sigma_algebra ?T by (rule sigma_algebra_vimage)
       
   621   show ?thesis
       
   622   proof
       
   623     show "\<mu> (f`{}) = 0" by simp
       
   624     show "countably_additive ?T (\<lambda>A. \<mu> (f ` A))"
       
   625     proof (unfold countably_additive_def, intro allI impI)
       
   626       fix A :: "nat \<Rightarrow> 'c set" assume "range A \<subseteq> sets ?T" "disjoint_family A"
       
   627       then have "\<forall>i. \<exists>F'. F' \<in> sets M \<and> A i = f -` F' \<inter> S"
       
   628         by (auto simp: image_iff image_subset_iff Bex_def vimage_algebra_def)
       
   629       from choice[OF this] obtain F where F: "\<And>i. F i \<in> sets M" and A: "\<And>i. A i = f -` F i \<inter> S" by auto
       
   630       then have [simp]: "\<And>i. f ` (A i) = F i"
       
   631         using sets_into_space assms
       
   632         by (force intro!: image_vimage_inter_eq[where T="space M"] simp: bij_betw_def)
       
   633       have "disjoint_family F"
       
   634       proof (intro disjoint_family_on_bisimulation[OF `disjoint_family A`])
       
   635         fix n m assume "A n \<inter> A m = {}"
       
   636         then have "f -` (F n \<inter> F m) \<inter> S = {}" unfolding A by auto
       
   637         moreover
       
   638         have "F n \<in> sets M" "F m \<in> sets M" using F by auto
       
   639         then have "f`S = space M" "F n \<inter> F m \<subseteq> space M"
       
   640           using sets_into_space assms by (auto simp: bij_betw_def)
       
   641         note image_vimage_inter_eq[OF this, symmetric]
       
   642         ultimately show "F n \<inter> F m = {}" by simp
       
   643       qed
       
   644       with F show "(\<Sum>\<^isub>\<infinity> i. \<mu> (f ` A i)) = \<mu> (f ` (\<Union>i. A i))"
       
   645         by (auto simp add: image_UN intro!: measure_countably_additive)
       
   646     qed
       
   647   qed
       
   648 qed
       
   649 
       
   650 section "@{text \<mu>}-null sets"
   620 section "@{text \<mu>}-null sets"
   651 
   621 
   652 abbreviation (in measure_space) "null_sets \<equiv> {N\<in>sets M. \<mu> N = 0}"
   622 abbreviation (in measure_space) "null_sets \<equiv> {N\<in>sets M. \<mu> N = 0}"
   653 
   623 
   654 lemma (in measure_space) null_sets_Un[intro]:
   624 lemma (in measure_space) null_sets_Un[intro]:
   877   qed
   847   qed
   878 qed
   848 qed
   879 
   849 
   880 lemma (in measure_space) measure_space_vimage:
   850 lemma (in measure_space) measure_space_vimage:
   881   fixes M' :: "'b algebra"
   851   fixes M' :: "'b algebra"
   882   assumes "f \<in> measurable M M'"
   852   assumes T: "sigma_algebra M'" "T \<in> measurable M M'"
   883   and "sigma_algebra M'"
   853     and \<nu>: "\<And>A. A \<in> sets M' \<Longrightarrow> \<nu> A = \<mu> (T -` A \<inter> space M)"
   884   shows "measure_space M' (\<lambda>A. \<mu> (f -` A \<inter> space M))" (is "measure_space M' ?T")
   854   shows "measure_space M' \<nu>"
   885 proof -
   855 proof -
   886   interpret M': sigma_algebra M' by fact
   856   interpret M': sigma_algebra M' by fact
   887 
       
   888   show ?thesis
   857   show ?thesis
   889   proof
   858   proof
   890     show "?T {} = 0" by simp
   859     show "\<nu> {} = 0" using \<nu>[of "{}"] by simp
   891 
   860 
   892     show "countably_additive M' ?T"
   861     show "countably_additive M' \<nu>"
   893     proof (unfold countably_additive_def, safe)
   862     proof (intro countably_additive_def[THEN iffD2] allI impI)
   894       fix A :: "nat \<Rightarrow> 'b set" assume "range A \<subseteq> sets M'" "disjoint_family A"
   863       fix A :: "nat \<Rightarrow> 'b set" assume "range A \<subseteq> sets M'" "disjoint_family A"
   895       hence *: "\<And>i. f -` (A i) \<inter> space M \<in> sets M"
   864       then have A: "\<And>i. A i \<in> sets M'" "(\<Union>i. A i) \<in> sets M'" by auto
   896         using `f \<in> measurable M M'` by (auto simp: measurable_def)
   865       then have *: "range (\<lambda>i. T -` (A i) \<inter> space M) \<subseteq> sets M"
   897       moreover have "(\<Union>i. f -`  A i \<inter> space M) \<in> sets M"
   866         using `T \<in> measurable M M'` by (auto simp: measurable_def)
       
   867       moreover have "(\<Union>i. T -`  A i \<inter> space M) \<in> sets M"
   898         using * by blast
   868         using * by blast
   899       moreover have **: "disjoint_family (\<lambda>i. f -` A i \<inter> space M)"
   869       moreover have **: "disjoint_family (\<lambda>i. T -` A i \<inter> space M)"
   900         using `disjoint_family A` by (auto simp: disjoint_family_on_def)
   870         using `disjoint_family A` by (auto simp: disjoint_family_on_def)
   901       ultimately show "(\<Sum>\<^isub>\<infinity> i. ?T (A i)) = ?T (\<Union>i. A i)"
   871       ultimately show "(\<Sum>\<^isub>\<infinity> i. \<nu> (A i)) = \<nu> (\<Union>i. A i)"
   902         using measure_countably_additive[OF _ **] by (auto simp: comp_def vimage_UN)
   872         using measure_countably_additive[OF _ **] A
       
   873         by (auto simp: comp_def vimage_UN \<nu>)
   903     qed
   874     qed
   904   qed
   875   qed
   905 qed
   876 qed
   906 
   877 
   907 lemma (in measure_space) measure_space_subalgebra:
   878 lemma (in measure_space) measure_space_subalgebra:
  1002       by (auto intro!: measure_finitely_subadditive)
   973       by (auto intro!: measure_finitely_subadditive)
  1003     also have "\<dots> < \<omega>"
   974     also have "\<dots> < \<omega>"
  1004       using F by (auto simp: setsum_\<omega>)
   975       using F by (auto simp: setsum_\<omega>)
  1005     finally show "\<mu> (\<Union> i\<le>n. F i) \<noteq> \<omega>" by simp
   976     finally show "\<mu> (\<Union> i\<le>n. F i) \<noteq> \<omega>" by simp
  1006   qed force+
   977   qed force+
  1007 qed
       
  1008 
       
  1009 lemma (in sigma_finite_measure) sigma_finite_measure_isomorphic:
       
  1010   assumes f: "bij_betw f S (space M)"
       
  1011   shows "sigma_finite_measure (vimage_algebra S f) (\<lambda>A. \<mu> (f ` A))"
       
  1012 proof -
       
  1013   interpret M: measure_space "vimage_algebra S f" "\<lambda>A. \<mu> (f ` A)"
       
  1014     using f by (rule measure_space_isomorphic)
       
  1015   show ?thesis
       
  1016   proof default
       
  1017     from sigma_finite guess A::"nat \<Rightarrow> 'a set" .. note A = this
       
  1018     show "\<exists>A::nat\<Rightarrow>'b set. range A \<subseteq> sets (vimage_algebra S f) \<and> (\<Union>i. A i) = space (vimage_algebra S f) \<and> (\<forall>i. \<mu> (f ` A i) \<noteq> \<omega>)"
       
  1019     proof (intro exI conjI)
       
  1020       show "(\<Union>i::nat. f -` A i \<inter> S) = space (vimage_algebra S f)"
       
  1021         using A f[THEN bij_betw_imp_funcset] by (auto simp: vimage_UN[symmetric])
       
  1022       show "range (\<lambda>i. f -` A i \<inter> S) \<subseteq> sets (vimage_algebra S f)"
       
  1023         using A by (auto simp: vimage_algebra_def)
       
  1024       have "\<And>i. f ` (f -` A i \<inter> S) = A i"
       
  1025         using f A sets_into_space
       
  1026         by (intro image_vimage_inter_eq) (auto simp: bij_betw_def)
       
  1027       then show "\<forall>i. \<mu> (f ` (f -` A i \<inter> S)) \<noteq> \<omega>"  using A by simp
       
  1028     qed
       
  1029   qed
       
  1030 qed
   978 qed
  1031 
   979 
  1032 section "Real measure values"
   980 section "Real measure values"
  1033 
   981 
  1034 lemma (in measure_space) real_measure_Union:
   982 lemma (in measure_space) real_measure_Union: