src/HOL/Probability/Infinite_Product_Measure.thy
changeset 50252 4aa34bd43228
parent 50244 de72bbe42190
child 51351 dd1dd470690b
equal deleted inserted replaced
50251:227477f17c26 50252:4aa34bd43228
    17   let ?\<Omega> = "\<Pi>\<^isub>E i\<in>I. space (M i)"
    17   let ?\<Omega> = "\<Pi>\<^isub>E i\<in>I. space (M i)"
    18   let ?G = generator
    18   let ?G = generator
    19   assume "\<not> finite I"
    19   assume "\<not> finite I"
    20   then have I_not_empty: "I \<noteq> {}" by auto
    20   then have I_not_empty: "I \<noteq> {}" by auto
    21   interpret G!: algebra ?\<Omega> generator by (rule algebra_generator) fact
    21   interpret G!: algebra ?\<Omega> generator by (rule algebra_generator) fact
    22   note \<mu>G_mono =
    22   note mu_G_mono =
    23     G.additive_increasing[OF positive_\<mu>G[OF I_not_empty] additive_\<mu>G[OF I_not_empty], THEN increasingD]
    23     G.additive_increasing[OF positive_mu_G[OF I_not_empty] additive_mu_G[OF I_not_empty],
       
    24       THEN increasingD]
       
    25   write mu_G  ("\<mu>G")
    24 
    26 
    25   { fix Z J assume J: "J \<noteq> {}" "finite J" "J \<subseteq> I" and Z: "Z \<in> ?G"
    27   { fix Z J assume J: "J \<noteq> {}" "finite J" "J \<subseteq> I" and Z: "Z \<in> ?G"
    26 
    28 
    27     from `infinite I` `finite J` obtain k where k: "k \<in> I" "k \<notin> J"
    29     from `infinite I` `finite J` obtain k where k: "k \<in> I" "k \<notin> J"
    28       by (metis rev_finite_subset subsetI)
    30       by (metis rev_finite_subset subsetI)
    40         using J K y by (intro merge_sets) auto
    42         using J K y by (intro merge_sets) auto
    41       ultimately
    43       ultimately
    42       have ***: "((\<lambda>x. merge J (I - J) (y, x)) -` Z \<inter> space (Pi\<^isub>M I M)) \<in> ?G"
    44       have ***: "((\<lambda>x. merge J (I - J) (y, x)) -` Z \<inter> space (Pi\<^isub>M I M)) \<in> ?G"
    43         using J K by (intro generatorI) auto
    45         using J K by (intro generatorI) auto
    44       have "\<mu>G ((\<lambda>x. merge J (I - J) (y, x)) -` emb I K X \<inter> space (Pi\<^isub>M I M)) = emeasure (Pi\<^isub>M (K - J) M) (?M y)"
    46       have "\<mu>G ((\<lambda>x. merge J (I - J) (y, x)) -` emb I K X \<inter> space (Pi\<^isub>M I M)) = emeasure (Pi\<^isub>M (K - J) M) (?M y)"
    45         unfolding * using K J by (subst \<mu>G_eq[OF _ _ _ **]) auto
    47         unfolding * using K J by (subst mu_G_eq[OF _ _ _ **]) auto
    46       note * ** *** this }
    48       note * ** *** this }
    47     note merge_in_G = this
    49     note merge_in_G = this
    48 
    50 
    49     have "finite (K - J)" using K by auto
    51     have "finite (K - J)" using K by auto
    50 
    52 
    59       (is "_ = (\<integral>\<^isup>+x. \<mu>G (?MZ x) \<partial>Pi\<^isub>M J M)")
    61       (is "_ = (\<integral>\<^isup>+x. \<mu>G (?MZ x) \<partial>Pi\<^isub>M J M)")
    60     proof (intro positive_integral_cong)
    62     proof (intro positive_integral_cong)
    61       fix x assume x: "x \<in> space (Pi\<^isub>M J M)"
    63       fix x assume x: "x \<in> space (Pi\<^isub>M J M)"
    62       with K merge_in_G(2)[OF this]
    64       with K merge_in_G(2)[OF this]
    63       show "emeasure (Pi\<^isub>M (K - J) M) (?M x) = \<mu>G (?MZ x)"
    65       show "emeasure (Pi\<^isub>M (K - J) M) (?M x) = \<mu>G (?MZ x)"
    64         unfolding `Z = emb I K X` merge_in_G(1)[OF x] by (subst \<mu>G_eq) auto
    66         unfolding `Z = emb I K X` merge_in_G(1)[OF x] by (subst mu_G_eq) auto
    65     qed
    67     qed
    66     finally have fold: "\<mu>G Z = (\<integral>\<^isup>+x. \<mu>G (?MZ x) \<partial>Pi\<^isub>M J M)" .
    68     finally have fold: "\<mu>G Z = (\<integral>\<^isup>+x. \<mu>G (?MZ x) \<partial>Pi\<^isub>M J M)" .
    67 
    69 
    68     { fix x assume x: "x \<in> space (Pi\<^isub>M J M)"
    70     { fix x assume x: "x \<in> space (Pi\<^isub>M J M)"
    69       then have "\<mu>G (?MZ x) \<le> 1"
    71       then have "\<mu>G (?MZ x) \<le> 1"
    72     note le_1 = this
    74     note le_1 = this
    73 
    75 
    74     let ?q = "\<lambda>y. \<mu>G ((\<lambda>x. merge J (I - J) (y,x)) -` Z \<inter> space (Pi\<^isub>M I M))"
    76     let ?q = "\<lambda>y. \<mu>G ((\<lambda>x. merge J (I - J) (y,x)) -` Z \<inter> space (Pi\<^isub>M I M))"
    75     have "?q \<in> borel_measurable (Pi\<^isub>M J M)"
    77     have "?q \<in> borel_measurable (Pi\<^isub>M J M)"
    76       unfolding `Z = emb I K X` using J K merge_in_G(3)
    78       unfolding `Z = emb I K X` using J K merge_in_G(3)
    77       by (simp add: merge_in_G  \<mu>G_eq emeasure_fold_measurable cong: measurable_cong)
    79       by (simp add: merge_in_G  mu_G_eq emeasure_fold_measurable cong: measurable_cong)
    78     note this fold le_1 merge_in_G(3) }
    80     note this fold le_1 merge_in_G(3) }
    79   note fold = this
    81   note fold = this
    80 
    82 
    81   have "\<exists>\<mu>. (\<forall>s\<in>?G. \<mu> s = \<mu>G s) \<and> measure_space ?\<Omega> (sigma_sets ?\<Omega> ?G) \<mu>"
    83   have "\<exists>\<mu>. (\<forall>s\<in>?G. \<mu> s = \<mu>G s) \<and> measure_space ?\<Omega> (sigma_sets ?\<Omega> ?G) \<mu>"
    82   proof (rule G.caratheodory_empty_continuous[OF positive_\<mu>G additive_\<mu>G])
    84   proof (rule G.caratheodory_empty_continuous[OF positive_mu_G additive_mu_G])
    83     fix A assume "A \<in> ?G"
    85     fix A assume "A \<in> ?G"
    84     with generatorE guess J X . note JX = this
    86     with generatorE guess J X . note JX = this
    85     interpret JK: finite_product_prob_space M J by default fact+ 
    87     interpret JK: finite_product_prob_space M J by default fact+ 
    86     from JX show "\<mu>G A \<noteq> \<infinity>" by simp
    88     from JX show "\<mu>G A \<noteq> \<infinity>" by simp
    87   next
    89   next
    88     fix A assume A: "range A \<subseteq> ?G" "decseq A" "(\<Inter>i. A i) = {}"
    90     fix A assume A: "range A \<subseteq> ?G" "decseq A" "(\<Inter>i. A i) = {}"
    89     then have "decseq (\<lambda>i. \<mu>G (A i))"
    91     then have "decseq (\<lambda>i. \<mu>G (A i))"
    90       by (auto intro!: \<mu>G_mono simp: decseq_def)
    92       by (auto intro!: mu_G_mono simp: decseq_def)
    91     moreover
    93     moreover
    92     have "(INF i. \<mu>G (A i)) = 0"
    94     have "(INF i. \<mu>G (A i)) = 0"
    93     proof (rule ccontr)
    95     proof (rule ccontr)
    94       assume "(INF i. \<mu>G (A i)) \<noteq> 0" (is "?a \<noteq> 0")
    96       assume "(INF i. \<mu>G (A i)) \<noteq> 0" (is "?a \<noteq> 0")
    95       moreover have "0 \<le> ?a"
    97       moreover have "0 \<le> ?a"
    96         using A positive_\<mu>G[OF I_not_empty] by (auto intro!: INF_greatest simp: positive_def)
    98         using A positive_mu_G[OF I_not_empty] by (auto intro!: INF_greatest simp: positive_def)
    97       ultimately have "0 < ?a" by auto
    99       ultimately have "0 < ?a" by auto
    98 
   100 
    99       have "\<forall>n. \<exists>J X. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I \<and> X \<in> sets (Pi\<^isub>M J M) \<and> A n = emb I J X \<and> \<mu>G (A n) = emeasure (limP J M (\<lambda>J. (Pi\<^isub>M J M))) X"
   101       have "\<forall>n. \<exists>J X. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I \<and> X \<in> sets (Pi\<^isub>M J M) \<and> A n = emb I J X \<and> \<mu>G (A n) = emeasure (limP J M (\<lambda>J. (Pi\<^isub>M J M))) X"
   100         using A by (intro allI generator_Ex) auto
   102         using A by (intro allI generator_Ex) auto
   101       then obtain J' X' where J': "\<And>n. J' n \<noteq> {}" "\<And>n. finite (J' n)" "\<And>n. J' n \<subseteq> I" "\<And>n. X' n \<in> sets (Pi\<^isub>M (J' n) M)"
   103       then obtain J' X' where J': "\<And>n. J' n \<noteq> {}" "\<And>n. finite (J' n)" "\<And>n. J' n \<subseteq> I" "\<And>n. X' n \<in> sets (Pi\<^isub>M (J' n) M)"
   112         unfolding J_def by force
   114         unfolding J_def by force
   113 
   115 
   114       interpret J: finite_product_prob_space M "J i" for i by default fact+
   116       interpret J: finite_product_prob_space M "J i" for i by default fact+
   115 
   117 
   116       have a_le_1: "?a \<le> 1"
   118       have a_le_1: "?a \<le> 1"
   117         using \<mu>G_spec[of "J 0" "A 0" "X 0"] J A_eq
   119         using mu_G_spec[of "J 0" "A 0" "X 0"] J A_eq
   118         by (auto intro!: INF_lower2[of 0] J.measure_le_1)
   120         by (auto intro!: INF_lower2[of 0] J.measure_le_1)
   119 
   121 
   120       let ?M = "\<lambda>K Z y. (\<lambda>x. merge K (I - K) (y, x)) -` Z \<inter> space (Pi\<^isub>M I M)"
   122       let ?M = "\<lambda>K Z y. (\<lambda>x. merge K (I - K) (y, x)) -` Z \<inter> space (Pi\<^isub>M I M)"
   121 
   123 
   122       { fix Z k assume Z: "range Z \<subseteq> ?G" "decseq Z" "\<forall>n. ?a / 2^k \<le> \<mu>G (Z n)"
   124       { fix Z k assume Z: "range Z \<subseteq> ?G" "decseq Z" "\<forall>n. ?a / 2^k \<le> \<mu>G (Z n)"
   164           proof (safe intro!: vimageI[OF refl])
   166           proof (safe intro!: vimageI[OF refl])
   165             fix m n :: nat assume "m \<le> n"
   167             fix m n :: nat assume "m \<le> n"
   166             fix x assume x: "x \<in> space (Pi\<^isub>M J' M)"
   168             fix x assume x: "x \<in> space (Pi\<^isub>M J' M)"
   167             assume "?a / 2^(k+1) \<le> ?q n x"
   169             assume "?a / 2^(k+1) \<le> ?q n x"
   168             also have "?q n x \<le> ?q m x"
   170             also have "?q n x \<le> ?q m x"
   169             proof (rule \<mu>G_mono)
   171             proof (rule mu_G_mono)
   170               from fold(4)[OF J', OF Z_sets x]
   172               from fold(4)[OF J', OF Z_sets x]
   171               show "?M J' (Z n) x \<in> ?G" "?M J' (Z m) x \<in> ?G" by auto
   173               show "?M J' (Z n) x \<in> ?G" "?M J' (Z m) x \<in> ?G" by auto
   172               show "?M J' (Z n) x \<subseteq> ?M J' (Z m) x"
   174               show "?M J' (Z n) x \<subseteq> ?M J' (Z m) x"
   173                 using `decseq Z`[THEN decseqD, OF `m \<le> n`] by auto
   175                 using `decseq Z`[THEN decseqD, OF `m \<le> n`] by auto
   174             qed
   176             qed
   246         moreover
   248         moreover
   247         then have "w k \<in> space (Pi\<^isub>M (J k) M)" by auto
   249         then have "w k \<in> space (Pi\<^isub>M (J k) M)" by auto
   248         moreover
   250         moreover
   249         from w have "?a / 2 ^ (k + 1) \<le> ?q k k (w k)" by auto
   251         from w have "?a / 2 ^ (k + 1) \<le> ?q k k (w k)" by auto
   250         then have "?M (J k) (A k) (w k) \<noteq> {}"
   252         then have "?M (J k) (A k) (w k) \<noteq> {}"
   251           using positive_\<mu>G[OF I_not_empty, unfolded positive_def] `0 < ?a` `?a \<le> 1`
   253           using positive_mu_G[OF I_not_empty, unfolded positive_def] `0 < ?a` `?a \<le> 1`
   252           by (cases ?a) (auto simp: divide_le_0_iff power_le_zero_eq)
   254           by (cases ?a) (auto simp: divide_le_0_iff power_le_zero_eq)
   253         then obtain x where "x \<in> ?M (J k) (A k) (w k)" by auto
   255         then obtain x where "x \<in> ?M (J k) (A k) (w k)" by auto
   254         then have "merge (J k) (I - J k) (w k, x) \<in> A k" by auto
   256         then have "merge (J k) (I - J k) (w k, x) \<in> A k" by auto
   255         then have "\<exists>x\<in>A k. restrict x (J k) = w k"
   257         then have "\<exists>x\<in>A k. restrict x (J k) = w k"
   256           using `w k \<in> space (Pi\<^isub>M (J k) M)`
   258           using `w k \<in> space (Pi\<^isub>M (J k) M)`
   315     have "emb I J (Pi\<^isub>E J X) \<in> generator"
   317     have "emb I J (Pi\<^isub>E J X) \<in> generator"
   316       using J `I \<noteq> {}` by (intro generatorI') (auto simp: Pi_iff)
   318       using J `I \<noteq> {}` by (intro generatorI') (auto simp: Pi_iff)
   317     then have "\<mu> (emb I J (Pi\<^isub>E J X)) = \<mu>G (emb I J (Pi\<^isub>E J X))"
   319     then have "\<mu> (emb I J (Pi\<^isub>E J X)) = \<mu>G (emb I J (Pi\<^isub>E J X))"
   318       using \<mu> by simp
   320       using \<mu> by simp
   319     also have "\<dots> = (\<Prod> j\<in>J. if j \<in> J then emeasure (M j) (X j) else emeasure (M j) (space (M j)))"
   321     also have "\<dots> = (\<Prod> j\<in>J. if j \<in> J then emeasure (M j) (X j) else emeasure (M j) (space (M j)))"
   320       using J  `I \<noteq> {}` by (subst \<mu>G_spec[OF _ _ _ refl]) (auto simp: emeasure_PiM Pi_iff)
   322       using J  `I \<noteq> {}` by (subst mu_G_spec[OF _ _ _ refl]) (auto simp: emeasure_PiM Pi_iff)
   321     also have "\<dots> = (\<Prod>j\<in>J \<union> {i \<in> I. emeasure (M i) (space (M i)) \<noteq> 1}.
   323     also have "\<dots> = (\<Prod>j\<in>J \<union> {i \<in> I. emeasure (M i) (space (M i)) \<noteq> 1}.
   322       if j \<in> J then emeasure (M j) (X j) else emeasure (M j) (space (M j)))"
   324       if j \<in> J then emeasure (M j) (X j) else emeasure (M j) (space (M j)))"
   323       using J `I \<noteq> {}` by (intro setprod_mono_one_right) (auto simp: M.emeasure_space_1)
   325       using J `I \<noteq> {}` by (intro setprod_mono_one_right) (auto simp: M.emeasure_space_1)
   324     finally show "\<mu> (emb I J (Pi\<^isub>E J X)) = \<dots>" .
   326     finally show "\<mu> (emb I J (Pi\<^isub>E J X)) = \<dots>" .
   325   next
   327   next