src/HOL/Probability/Infinite_Product_Measure.thy
changeset 46731 5302e932d1e5
parent 45777 c36637603821
child 46898 1570b30ee040
equal deleted inserted replaced
46730:e3b99d0231bc 46731:5302e932d1e5
    50   interpret J: finite_product_prob_space M J
    50   interpret J: finite_product_prob_space M J
    51     by default (insert J, auto)
    51     by default (insert J, auto)
    52   from J.sigma_finite_pairs guess F .. note F = this
    52   from J.sigma_finite_pairs guess F .. note F = this
    53   then have [simp,intro]: "\<And>k i. k \<in> J \<Longrightarrow> F k i \<in> sets (M k)"
    53   then have [simp,intro]: "\<And>k i. k \<in> J \<Longrightarrow> F k i \<in> sets (M k)"
    54     by auto
    54     by auto
    55   let "?F i" = "\<Pi>\<^isub>E k\<in>J. F k i"
    55   let ?F = "\<lambda>i. \<Pi>\<^isub>E k\<in>J. F k i"
    56   let ?J = "product_algebra_generator J M \<lparr> measure := measure (Pi\<^isub>M J M) \<rparr>"
    56   let ?J = "product_algebra_generator J M \<lparr> measure := measure (Pi\<^isub>M J M) \<rparr>"
    57   have "?R \<in> measure_preserving (\<Pi>\<^isub>M i\<in>K. M i) (sigma ?J)"
    57   have "?R \<in> measure_preserving (\<Pi>\<^isub>M i\<in>K. M i) (sigma ?J)"
    58   proof (rule K.measure_preserving_Int_stable)
    58   proof (rule K.measure_preserving_Int_stable)
    59     show "Int_stable ?J"
    59     show "Int_stable ?J"
    60       by (auto simp: Int_stable_def product_algebra_generator_def PiE_Int)
    60       by (auto simp: Int_stable_def product_algebra_generator_def PiE_Int)
   446     moreover def X \<equiv> "emb K K' X'"
   446     moreover def X \<equiv> "emb K K' X'"
   447     ultimately have K: "K \<noteq> {}" "finite K" "K \<subseteq> I" "X \<in> sets (Pi\<^isub>M K M)" "Z = emb I K X"
   447     ultimately have K: "K \<noteq> {}" "finite K" "K \<subseteq> I" "X \<in> sets (Pi\<^isub>M K M)" "Z = emb I K X"
   448       "K - J \<noteq> {}" "K - J \<subseteq> I" "\<mu>G Z = measure (Pi\<^isub>M K M) X"
   448       "K - J \<noteq> {}" "K - J \<subseteq> I" "\<mu>G Z = measure (Pi\<^isub>M K M) X"
   449       by (auto simp: subset_insertI)
   449       by (auto simp: subset_insertI)
   450 
   450 
   451     let "?M y" = "merge J y (K - J) -` emb (J \<union> K) K X \<inter> space (Pi\<^isub>M (K - J) M)"
   451     let ?M = "\<lambda>y. merge J y (K - J) -` emb (J \<union> K) K X \<inter> space (Pi\<^isub>M (K - J) M)"
   452     { fix y assume y: "y \<in> space (Pi\<^isub>M J M)"
   452     { fix y assume y: "y \<in> space (Pi\<^isub>M J M)"
   453       note * = merge_emb[OF `K \<subseteq> I` `J \<subseteq> I` y, of X]
   453       note * = merge_emb[OF `K \<subseteq> I` `J \<subseteq> I` y, of X]
   454       moreover
   454       moreover
   455       have **: "?M y \<in> sets (Pi\<^isub>M (K - J) M)"
   455       have **: "?M y \<in> sets (Pi\<^isub>M (K - J) M)"
   456         using J K y by (intro merge_sets) auto
   456         using J K y by (intro merge_sets) auto
   485       then have "\<mu>G (?MZ x) \<le> 1"
   485       then have "\<mu>G (?MZ x) \<le> 1"
   486         unfolding merge_in_G(4)[OF x] `Z = emb I K X`
   486         unfolding merge_in_G(4)[OF x] `Z = emb I K X`
   487         by (intro KmJ.measure_le_1 merge_in_G(2)[OF x]) }
   487         by (intro KmJ.measure_le_1 merge_in_G(2)[OF x]) }
   488     note le_1 = this
   488     note le_1 = this
   489 
   489 
   490     let "?q y" = "\<mu>G (merge J y (I - J) -` Z \<inter> space (Pi\<^isub>M I M))"
   490     let ?q = "\<lambda>y. \<mu>G (merge J y (I - J) -` Z \<inter> space (Pi\<^isub>M I M))"
   491     have "?q \<in> borel_measurable (Pi\<^isub>M J M)"
   491     have "?q \<in> borel_measurable (Pi\<^isub>M J M)"
   492       unfolding `Z = emb I K X` using J K merge_in_G(3)
   492       unfolding `Z = emb I K X` using J K merge_in_G(3)
   493       by (simp add: merge_in_G  \<mu>G_eq measure_fold_measurable
   493       by (simp add: merge_in_G  \<mu>G_eq measure_fold_measurable
   494                del: space_product_algebra cong: measurable_cong)
   494                del: space_product_algebra cong: measurable_cong)
   495     note this fold le_1 merge_in_G(3) }
   495     note this fold le_1 merge_in_G(3) }
   534 
   534 
   535       have a_le_1: "?a \<le> 1"
   535       have a_le_1: "?a \<le> 1"
   536         using \<mu>G_spec[of "J 0" "A 0" "X 0"] J A_eq
   536         using \<mu>G_spec[of "J 0" "A 0" "X 0"] J A_eq
   537         by (auto intro!: INF_lower2[of 0] J.measure_le_1)
   537         by (auto intro!: INF_lower2[of 0] J.measure_le_1)
   538 
   538 
   539       let "?M K Z y" = "merge K y (I - K) -` Z \<inter> space (Pi\<^isub>M I M)"
   539       let ?M = "\<lambda>K Z y. merge K y (I - K) -` Z \<inter> space (Pi\<^isub>M I M)"
   540 
   540 
   541       { fix Z k assume Z: "range Z \<subseteq> sets ?G" "decseq Z" "\<forall>n. ?a / 2^k \<le> \<mu>G (Z n)"
   541       { fix Z k assume Z: "range Z \<subseteq> sets ?G" "decseq Z" "\<forall>n. ?a / 2^k \<le> \<mu>G (Z n)"
   542         then have Z_sets: "\<And>n. Z n \<in> sets ?G" by auto
   542         then have Z_sets: "\<And>n. Z n \<in> sets ?G" by auto
   543         fix J' assume J': "J' \<noteq> {}" "finite J'" "J' \<subseteq> I"
   543         fix J' assume J': "J' \<noteq> {}" "finite J'" "J' \<subseteq> I"
   544         interpret J': finite_product_prob_space M J' by default fact+
   544         interpret J': finite_product_prob_space M J' by default fact+
   545 
   545 
   546         let "?q n y" = "\<mu>G (?M J' (Z n) y)"
   546         let ?q = "\<lambda>n y. \<mu>G (?M J' (Z n) y)"
   547         let "?Q n" = "?q n -` {?a / 2^(k+1) ..} \<inter> space (Pi\<^isub>M J' M)"
   547         let ?Q = "\<lambda>n. ?q n -` {?a / 2^(k+1) ..} \<inter> space (Pi\<^isub>M J' M)"
   548         { fix n
   548         { fix n
   549           have "?q n \<in> borel_measurable (Pi\<^isub>M J' M)"
   549           have "?q n \<in> borel_measurable (Pi\<^isub>M J' M)"
   550             using Z J' by (intro fold(1)) auto
   550             using Z J' by (intro fold(1)) auto
   551           then have "?Q n \<in> sets (Pi\<^isub>M J' M)"
   551           then have "?Q n \<in> sets (Pi\<^isub>M J' M)"
   552             by (rule measurable_sets) auto }
   552             by (rule measurable_sets) auto }
   597         finally have "(\<Inter>n. ?Q n) \<noteq> {}"
   597         finally have "(\<Inter>n. ?Q n) \<noteq> {}"
   598           using `0 < ?a` `?a \<le> 1` by (cases ?a) (auto simp: divide_le_0_iff power_le_zero_eq)
   598           using `0 < ?a` `?a \<le> 1` by (cases ?a) (auto simp: divide_le_0_iff power_le_zero_eq)
   599         then have "\<exists>w\<in>space (Pi\<^isub>M J' M). \<forall>n. ?a / 2 ^ (k + 1) \<le> ?q n w" by auto }
   599         then have "\<exists>w\<in>space (Pi\<^isub>M J' M). \<forall>n. ?a / 2 ^ (k + 1) \<le> ?q n w" by auto }
   600       note Ex_w = this
   600       note Ex_w = this
   601 
   601 
   602       let "?q k n y" = "\<mu>G (?M (J k) (A n) y)"
   602       let ?q = "\<lambda>k n y. \<mu>G (?M (J k) (A n) y)"
   603 
   603 
   604       have "\<forall>n. ?a / 2 ^ 0 \<le> \<mu>G (A n)" by (auto intro: INF_lower)
   604       have "\<forall>n. ?a / 2 ^ 0 \<le> \<mu>G (A n)" by (auto intro: INF_lower)
   605       from Ex_w[OF A(1,2) this J(1-3), of 0] guess w0 .. note w0 = this
   605       from Ex_w[OF A(1,2) this J(1-3), of 0] guess w0 .. note w0 = this
   606 
   606 
   607       let "?P k wk w" =
   607       let ?P =
   608         "w \<in> space (Pi\<^isub>M (J (Suc k)) M) \<and> restrict w (J k) = wk \<and> (\<forall>n. ?a / 2 ^ (Suc k + 1) \<le> ?q (Suc k) n w)"
   608         "\<lambda>k wk w. w \<in> space (Pi\<^isub>M (J (Suc k)) M) \<and> restrict w (J k) = wk \<and>
       
   609           (\<forall>n. ?a / 2 ^ (Suc k + 1) \<le> ?q (Suc k) n w)"
   609       def w \<equiv> "nat_rec w0 (\<lambda>k wk. Eps (?P k wk))"
   610       def w \<equiv> "nat_rec w0 (\<lambda>k wk. Eps (?P k wk))"
   610 
   611 
   611       { fix k have w: "w k \<in> space (Pi\<^isub>M (J k) M) \<and>
   612       { fix k have w: "w k \<in> space (Pi\<^isub>M (J k) M) \<and>
   612           (\<forall>n. ?a / 2 ^ (k + 1) \<le> ?q k n (w k)) \<and> (k \<noteq> 0 \<longrightarrow> restrict (w k) (J (k - 1)) = w (k - 1))"
   613           (\<forall>n. ?a / 2 ^ (k + 1) \<le> ?q k n (w k)) \<and> (k \<noteq> 0 \<longrightarrow> restrict (w k) (J (k - 1)) = w (k - 1))"
   613         proof (induct k)
   614         proof (induct k)
  1013 
  1014 
  1014 lemma (in sequence_space) measure_infprod:
  1015 lemma (in sequence_space) measure_infprod:
  1015   fixes E :: "nat \<Rightarrow> 'a set" assumes E: "\<And>i. E i \<in> sets (M i)"
  1016   fixes E :: "nat \<Rightarrow> 'a set" assumes E: "\<And>i. E i \<in> sets (M i)"
  1016   shows "(\<lambda>n. \<Prod>i\<le>n. M.\<mu>' i (E i)) ----> \<mu>' (Pi UNIV E)"
  1017   shows "(\<lambda>n. \<Prod>i\<le>n. M.\<mu>' i (E i)) ----> \<mu>' (Pi UNIV E)"
  1017 proof -
  1018 proof -
  1018   let "?E n" = "emb UNIV {..n} (Pi\<^isub>E {.. n} E)"
  1019   let ?E = "\<lambda>n. emb UNIV {..n} (Pi\<^isub>E {.. n} E)"
  1019   { fix n :: nat
  1020   { fix n :: nat
  1020     interpret n: finite_product_prob_space M "{..n}" by default auto
  1021     interpret n: finite_product_prob_space M "{..n}" by default auto
  1021     have "(\<Prod>i\<le>n. M.\<mu>' i (E i)) = n.\<mu>' (Pi\<^isub>E {.. n} E)"
  1022     have "(\<Prod>i\<le>n. M.\<mu>' i (E i)) = n.\<mu>' (Pi\<^isub>E {.. n} E)"
  1022       using E by (subst n.finite_measure_times) auto
  1023       using E by (subst n.finite_measure_times) auto
  1023     also have "\<dots> = \<mu>' (?E n)"
  1024     also have "\<dots> = \<mu>' (?E n)"