src/HOL/Probability/Finite_Product_Measure.thy
changeset 50099 a58bb401af80
parent 50087 635d73673b5e
child 50104 de19856feb54
equal deleted inserted replaced
50098:98abff4a775b 50099:a58bb401af80
   538   with space have "f -` A \<inter> space N = {\<omega> \<in> space N. f \<omega> i \<in> B}" by auto
   538   with space have "f -` A \<inter> space N = {\<omega> \<in> space N. f \<omega> i \<in> B}" by auto
   539   also have "\<dots> \<in> sets N" using B by (rule sets)
   539   also have "\<dots> \<in> sets N" using B by (rule sets)
   540   finally show "f -` A \<inter> space N \<in> sets N" .
   540   finally show "f -` A \<inter> space N \<in> sets N" .
   541 qed (auto simp: space)
   541 qed (auto simp: space)
   542 
   542 
       
   543 lemma measurable_PiM_single':
       
   544   assumes f: "\<And>i. i \<in> I \<Longrightarrow> f i \<in> measurable N (M i)"
       
   545     and "(\<lambda>\<omega> i. f i \<omega>) \<in> space N \<rightarrow> (\<Pi>\<^isub>E i\<in>I. space (M i))"
       
   546   shows "(\<lambda>\<omega> i. f i \<omega>) \<in> measurable N (Pi\<^isub>M I M)"
       
   547 proof (rule measurable_PiM_single)
       
   548   fix A i assume A: "i \<in> I" "A \<in> sets (M i)"
       
   549   then have "{\<omega> \<in> space N. f i \<omega> \<in> A} = f i -` A \<inter> space N"
       
   550     by auto
       
   551   then show "{\<omega> \<in> space N. f i \<omega> \<in> A} \<in> sets N"
       
   552     using A f by (auto intro!: measurable_sets)
       
   553 qed fact
       
   554 
   543 lemma sets_PiM_I_finite[measurable]:
   555 lemma sets_PiM_I_finite[measurable]:
   544   assumes "finite I" and sets: "(\<And>i. i \<in> I \<Longrightarrow> E i \<in> sets (M i))"
   556   assumes "finite I" and sets: "(\<And>i. i \<in> I \<Longrightarrow> E i \<in> sets (M i))"
   545   shows "(PIE j:I. E j) \<in> sets (PIM i:I. M i)"
   557   shows "(PIE j:I. E j) \<in> sets (PIM i:I. M i)"
   546   using sets_PiM_I[of I I E M] sets_into_space[OF sets] `finite I` sets by auto
   558   using sets_PiM_I[of I I E M] sets_into_space[OF sets] `finite I` sets by auto
   547 
   559 
   560   assumes f: "f \<in> measurable N (Pi\<^isub>M I M)"
   572   assumes f: "f \<in> measurable N (Pi\<^isub>M I M)"
   561   assumes i: "i \<in> I"
   573   assumes i: "i \<in> I"
   562   shows "(\<lambda>x. (f x) i) \<in> measurable N (M i)"
   574   shows "(\<lambda>x. (f x) i) \<in> measurable N (M i)"
   563   using measurable_compose[OF f measurable_component_singleton, OF i] .
   575   using measurable_compose[OF f measurable_component_singleton, OF i] .
   564 
   576 
       
   577 lemma measurable_PiM_component_rev[measurable (raw)]:
       
   578   "i \<in> I \<Longrightarrow> f \<in> measurable (M i) N \<Longrightarrow> (\<lambda>x. f (x i)) \<in> measurable (PiM I M) N"
       
   579   by simp
       
   580 
   565 lemma measurable_nat_case[measurable (raw)]:
   581 lemma measurable_nat_case[measurable (raw)]:
   566   assumes [measurable (raw)]: "i = 0 \<Longrightarrow> f \<in> measurable M N"
   582   assumes [measurable (raw)]: "i = 0 \<Longrightarrow> f \<in> measurable M N"
   567     "\<And>j. i = Suc j \<Longrightarrow> (\<lambda>x. g x j) \<in> measurable M N"
   583     "\<And>j. i = Suc j \<Longrightarrow> (\<lambda>x. g x j) \<in> measurable M N"
   568   shows "(\<lambda>x. nat_case (f x) (g x) i) \<in> measurable M N"
   584   shows "(\<lambda>x. nat_case (f x) (g x) i) \<in> measurable M N"
   569   by (cases i) simp_all
   585   by (cases i) simp_all
       
   586 
       
   587 lemma measurable_nat_case'[measurable (raw)]:
       
   588   assumes fg[measurable]: "f \<in> measurable N M" "g \<in> measurable N (\<Pi>\<^isub>M i\<in>UNIV. M)"
       
   589   shows "(\<lambda>x. nat_case (f x) (g x)) \<in> measurable N (\<Pi>\<^isub>M i\<in>UNIV. M)"
       
   590   using fg[THEN measurable_space]
       
   591   by (auto intro!: measurable_PiM_single' simp add: space_PiM Pi_iff split: nat.split)
   570 
   592 
   571 lemma measurable_add_dim[measurable]:
   593 lemma measurable_add_dim[measurable]:
   572   "(\<lambda>(f, y). f(i := y)) \<in> measurable (Pi\<^isub>M I M \<Otimes>\<^isub>M M i) (Pi\<^isub>M (insert i I) M)"
   594   "(\<lambda>(f, y). f(i := y)) \<in> measurable (Pi\<^isub>M I M \<Otimes>\<^isub>M M i) (Pi\<^isub>M (insert i I) M)"
   573     (is "?f \<in> measurable ?P ?I")
   595     (is "?f \<in> measurable ?P ?I")
   574 proof (rule measurable_PiM_single)
   596 proof (rule measurable_PiM_single)