src/HOL/Probability/Finite_Product_Measure.thy
changeset 59425 c5e79df8cc21
parent 59353 f0707dc3d9aa
child 60580 7e741e22d7fc
equal deleted inserted replaced
59424:ca2336984f6a 59425:c5e79df8cc21
   177 syntax (HTML output)
   177 syntax (HTML output)
   178   "_PiM" :: "pttrn \<Rightarrow> 'i set \<Rightarrow> 'a measure \<Rightarrow> ('i => 'a) measure"  ("(3\<Pi>\<^sub>M _\<in>_./ _)"  10)
   178   "_PiM" :: "pttrn \<Rightarrow> 'i set \<Rightarrow> 'a measure \<Rightarrow> ('i => 'a) measure"  ("(3\<Pi>\<^sub>M _\<in>_./ _)"  10)
   179 
   179 
   180 translations
   180 translations
   181   "PIM x:I. M" == "CONST PiM I (%x. M)"
   181   "PIM x:I. M" == "CONST PiM I (%x. M)"
       
   182 
       
   183 lemma extend_measure_cong:
       
   184   assumes "\<Omega> = \<Omega>'" "I = I'" "G = G'" "\<And>i. i \<in> I' \<Longrightarrow> \<mu> i = \<mu>' i"
       
   185   shows "extend_measure \<Omega> I G \<mu> = extend_measure \<Omega>' I' G' \<mu>'"
       
   186   unfolding extend_measure_def by (auto simp add: assms)
       
   187 
       
   188 lemma Pi_cong_sets:
       
   189     "\<lbrakk>I = J; \<And>x. x \<in> I \<Longrightarrow> M x = N x\<rbrakk> \<Longrightarrow> Pi I M = Pi J N"
       
   190   unfolding Pi_def by auto 
       
   191 
       
   192 lemma PiM_cong:
       
   193   assumes "I = J" "\<And>x. x \<in> I \<Longrightarrow> M x = N x"
       
   194   shows "PiM I M = PiM J N"
       
   195 unfolding PiM_def
       
   196 proof (rule extend_measure_cong)
       
   197   case goal1 show ?case using assms
       
   198     by (subst assms(1), intro PiE_cong[of J "\<lambda>i. space (M i)" "\<lambda>i. space (N i)"]) simp_all
       
   199 next
       
   200   case goal2
       
   201   have "\<And>K. K \<subseteq> J \<Longrightarrow> (\<Pi> j\<in>K. sets (M j)) = (\<Pi> j\<in>K. sets (N j))"
       
   202     using assms by (intro Pi_cong_sets) auto
       
   203   thus ?case by (auto simp: assms)
       
   204 next
       
   205   case goal3 show ?case using assms 
       
   206     by (intro ext) (auto simp: prod_emb_def dest: PiE_mem)
       
   207 next
       
   208   case (goal4 x)
       
   209   thus ?case using assms 
       
   210     by (auto intro!: setprod.cong split: split_if_asm)
       
   211 qed
       
   212 
   182 
   213 
   183 lemma prod_algebra_sets_into_space:
   214 lemma prod_algebra_sets_into_space:
   184   "prod_algebra I M \<subseteq> Pow (\<Pi>\<^sub>E i\<in>I. space (M i))"
   215   "prod_algebra I M \<subseteq> Pow (\<Pi>\<^sub>E i\<in>I. space (M i))"
   185   by (auto simp: prod_emb_def prod_algebra_def)
   216   by (auto simp: prod_emb_def prod_algebra_def)
   186 
   217 
   622   by (intro measurable_PiM_single) (auto dest: measurable_space)
   653   by (intro measurable_PiM_single) (auto dest: measurable_space)
   623 
   654 
   624 lemma measurable_restrict_subset: "J \<subseteq> L \<Longrightarrow> (\<lambda>f. restrict f J) \<in> measurable (Pi\<^sub>M L M) (Pi\<^sub>M J M)"
   655 lemma measurable_restrict_subset: "J \<subseteq> L \<Longrightarrow> (\<lambda>f. restrict f J) \<in> measurable (Pi\<^sub>M L M) (Pi\<^sub>M J M)"
   625   by (intro measurable_restrict measurable_component_singleton) auto
   656   by (intro measurable_restrict measurable_component_singleton) auto
   626 
   657 
       
   658 lemma measurable_restrict_subset':
       
   659   assumes "J \<subseteq> L" "\<And>x. x \<in> J \<Longrightarrow> sets (M x) = sets (N x)"
       
   660   shows "(\<lambda>f. restrict f J) \<in> measurable (Pi\<^sub>M L M) (Pi\<^sub>M J N)"
       
   661 proof-
       
   662   from assms(1) have "(\<lambda>f. restrict f J) \<in> measurable (Pi\<^sub>M L M) (Pi\<^sub>M J M)"
       
   663     by (rule measurable_restrict_subset)
       
   664   also from assms(2) have "measurable (Pi\<^sub>M L M) (Pi\<^sub>M J M) = measurable (Pi\<^sub>M L M) (Pi\<^sub>M J N)"
       
   665     by (intro sets_PiM_cong measurable_cong_sets) simp_all
       
   666   finally show ?thesis .
       
   667 qed
       
   668 
   627 lemma measurable_prod_emb[intro, simp]:
   669 lemma measurable_prod_emb[intro, simp]:
   628   "J \<subseteq> L \<Longrightarrow> X \<in> sets (Pi\<^sub>M J M) \<Longrightarrow> prod_emb L M J X \<in> sets (Pi\<^sub>M L M)"
   670   "J \<subseteq> L \<Longrightarrow> X \<in> sets (Pi\<^sub>M J M) \<Longrightarrow> prod_emb L M J X \<in> sets (Pi\<^sub>M L M)"
   629   unfolding prod_emb_def space_PiM[symmetric]
   671   unfolding prod_emb_def space_PiM[symmetric]
   630   by (auto intro!: measurable_sets measurable_restrict measurable_component_singleton)
   672   by (auto intro!: measurable_sets measurable_restrict measurable_component_singleton)
   631 
   673 
   943       by (auto intro!: nn_integral_cong arg_cong[where f=f]
   985       by (auto intro!: nn_integral_cong arg_cong[where f=f]
   944                simp add: space_PiM extensional_def PiE_def)
   986                simp add: space_PiM extensional_def PiE_def)
   945   qed
   987   qed
   946 qed
   988 qed
   947 
   989 
       
   990 lemma (in product_sigma_finite) product_nn_integral_insert_rev:
       
   991   assumes I[simp]: "finite I" "i \<notin> I"
       
   992     and [measurable]: "f \<in> borel_measurable (Pi\<^sub>M (insert i I) M)"
       
   993   shows "integral\<^sup>N (Pi\<^sub>M (insert i I) M) f = (\<integral>\<^sup>+ y. (\<integral>\<^sup>+ x. f (x(i := y)) \<partial>(Pi\<^sub>M I M)) \<partial>(M i))"
       
   994   apply (subst product_nn_integral_insert[OF assms])
       
   995   apply (rule pair_sigma_finite.Fubini')
       
   996   apply intro_locales []
       
   997   apply (rule sigma_finite[OF I(1)])
       
   998   apply measurable
       
   999   done
       
  1000 
   948 lemma (in product_sigma_finite) product_nn_integral_setprod:
  1001 lemma (in product_sigma_finite) product_nn_integral_setprod:
   949   fixes f :: "'i \<Rightarrow> 'a \<Rightarrow> ereal"
  1002   fixes f :: "'i \<Rightarrow> 'a \<Rightarrow> ereal"
   950   assumes "finite I" and borel: "\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable (M i)"
  1003   assumes "finite I" and borel: "\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable (M i)"
   951   and pos: "\<And>i x. i \<in> I \<Longrightarrow> 0 \<le> f i x"
  1004   and pos: "\<And>i x. i \<in> I \<Longrightarrow> 0 \<le> f i x"
   952   shows "(\<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M) = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))"
  1005   shows "(\<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M) = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))"
   967     apply (subst nn_integral_cmult)
  1020     apply (subst nn_integral_cmult)
   968     apply (auto simp add: pos borel insert(2-) setprod_ereal_pos nn_integral_nonneg)
  1021     apply (auto simp add: pos borel insert(2-) setprod_ereal_pos nn_integral_nonneg)
   969     done
  1022     done
   970 qed (simp add: space_PiM)
  1023 qed (simp add: space_PiM)
   971 
  1024 
       
  1025 lemma (in product_sigma_finite) product_nn_integral_pair:
       
  1026   assumes [measurable]: "split f \<in> borel_measurable (M x \<Otimes>\<^sub>M M y)"
       
  1027   assumes xy: "x \<noteq> y"
       
  1028   shows "(\<integral>\<^sup>+\<sigma>. f (\<sigma> x) (\<sigma> y) \<partial>PiM {x, y} M) = (\<integral>\<^sup>+z. f (fst z) (snd z) \<partial>(M x \<Otimes>\<^sub>M M y))"
       
  1029 proof-
       
  1030   interpret psm: pair_sigma_finite "M x" "M y"
       
  1031     unfolding pair_sigma_finite_def using sigma_finite_measures by simp_all
       
  1032   have "{x, y} = {y, x}" by auto
       
  1033   also have "(\<integral>\<^sup>+\<sigma>. f (\<sigma> x) (\<sigma> y) \<partial>PiM {y, x} M) = (\<integral>\<^sup>+y. \<integral>\<^sup>+\<sigma>. f (\<sigma> x) y \<partial>PiM {x} M \<partial>M y)"
       
  1034     using xy by (subst product_nn_integral_insert_rev) simp_all
       
  1035   also have "... = (\<integral>\<^sup>+y. \<integral>\<^sup>+x. f x y \<partial>M x \<partial>M y)"
       
  1036     by (intro nn_integral_cong, subst product_nn_integral_singleton) simp_all
       
  1037   also have "... = (\<integral>\<^sup>+z. f (fst z) (snd z) \<partial>(M x \<Otimes>\<^sub>M M y))"
       
  1038     by (subst psm.nn_integral_snd[symmetric]) simp_all
       
  1039   finally show ?thesis .
       
  1040 qed
       
  1041 
   972 lemma (in product_sigma_finite) distr_component:
  1042 lemma (in product_sigma_finite) distr_component:
   973   "distr (M i) (Pi\<^sub>M {i} M) (\<lambda>x. \<lambda>i\<in>{i}. x) = Pi\<^sub>M {i} M" (is "?D = ?P")
  1043   "distr (M i) (Pi\<^sub>M {i} M) (\<lambda>x. \<lambda>i\<in>{i}. x) = Pi\<^sub>M {i} M" (is "?D = ?P")
   974 proof (intro measure_eqI[symmetric])
  1044 proof (intro measure_eqI[symmetric])
   975   interpret I: finite_product_sigma_finite M "{i}" by default simp
  1045   interpret I: finite_product_sigma_finite M "{i}" by default simp
   976 
  1046