src/HOL/Probability/Projective_Limit.thy
changeset 50252 4aa34bd43228
parent 50245 dea9363887a6
child 50884 2b21b4e2d7cb
equal deleted inserted replaced
50251:227477f17c26 50252:4aa34bd43228
   113   shows "emeasure (lim\<^isub>B I P) (emb I J (Pi\<^isub>E J B)) = emeasure (lim\<^isub>B J P) (Pi\<^isub>E J B)"
   113   shows "emeasure (lim\<^isub>B I P) (emb I J (Pi\<^isub>E J B)) = emeasure (lim\<^isub>B J P) (Pi\<^isub>E J B)"
   114 proof -
   114 proof -
   115   let ?\<Omega> = "\<Pi>\<^isub>E i\<in>I. space borel"
   115   let ?\<Omega> = "\<Pi>\<^isub>E i\<in>I. space borel"
   116   let ?G = generator
   116   let ?G = generator
   117   interpret G!: algebra ?\<Omega> generator by (intro  algebra_generator) fact
   117   interpret G!: algebra ?\<Omega> generator by (intro  algebra_generator) fact
   118   note \<mu>G_mono =
   118   note mu_G_mono =
   119     G.additive_increasing[OF positive_\<mu>G[OF `I \<noteq> {}`] additive_\<mu>G[OF `I \<noteq> {}`], THEN increasingD]
   119     G.additive_increasing[OF positive_mu_G[OF `I \<noteq> {}`] additive_mu_G[OF `I \<noteq> {}`],
       
   120       THEN increasingD]
       
   121   write mu_G  ("\<mu>G")
       
   122 
   120   have "\<exists>\<mu>. (\<forall>s\<in>?G. \<mu> s = \<mu>G s) \<and> measure_space ?\<Omega> (sigma_sets ?\<Omega> ?G) \<mu>"
   123   have "\<exists>\<mu>. (\<forall>s\<in>?G. \<mu> s = \<mu>G s) \<and> measure_space ?\<Omega> (sigma_sets ?\<Omega> ?G) \<mu>"
   121   proof (rule G.caratheodory_empty_continuous[OF positive_\<mu>G additive_\<mu>G,
   124   proof (rule G.caratheodory_empty_continuous[OF positive_mu_G additive_mu_G,
   122       OF `I \<noteq> {}`, OF `I \<noteq> {}`])
   125       OF `I \<noteq> {}`, OF `I \<noteq> {}`])
   123     fix A assume "A \<in> ?G"
   126     fix A assume "A \<in> ?G"
   124     with generatorE guess J X . note JX = this
   127     with generatorE guess J X . note JX = this
   125     interpret prob_space "P J" using proj_prob_space[OF `finite J`] .
   128     interpret prob_space "P J" using proj_prob_space[OF `finite J`] .
   126     show "\<mu>G A \<noteq> \<infinity>" using JX by (simp add: limP_finite)
   129     show "\<mu>G A \<noteq> \<infinity>" using JX by (simp add: limP_finite)
   127   next
   130   next
   128     fix Z assume Z: "range Z \<subseteq> ?G" "decseq Z" "(\<Inter>i. Z i) = {}"
   131     fix Z assume Z: "range Z \<subseteq> ?G" "decseq Z" "(\<Inter>i. Z i) = {}"
   129     then have "decseq (\<lambda>i. \<mu>G (Z i))"
   132     then have "decseq (\<lambda>i. \<mu>G (Z i))"
   130       by (auto intro!: \<mu>G_mono simp: decseq_def)
   133       by (auto intro!: mu_G_mono simp: decseq_def)
   131     moreover
   134     moreover
   132     have "(INF i. \<mu>G (Z i)) = 0"
   135     have "(INF i. \<mu>G (Z i)) = 0"
   133     proof (rule ccontr)
   136     proof (rule ccontr)
   134       assume "(INF i. \<mu>G (Z i)) \<noteq> 0" (is "?a \<noteq> 0")
   137       assume "(INF i. \<mu>G (Z i)) \<noteq> 0" (is "?a \<noteq> 0")
   135       moreover have "0 \<le> ?a"
   138       moreover have "0 \<le> ?a"
   136         using Z positive_\<mu>G[OF `I \<noteq> {}`] by (auto intro!: INF_greatest simp: positive_def)
   139         using Z positive_mu_G[OF `I \<noteq> {}`] by (auto intro!: INF_greatest simp: positive_def)
   137       ultimately have "0 < ?a" by auto
   140       ultimately have "0 < ?a" by auto
   138       hence "?a \<noteq> -\<infinity>" by auto
   141       hence "?a \<noteq> -\<infinity>" by auto
   139       have "\<forall>n. \<exists>J B. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I \<and> B \<in> sets (Pi\<^isub>M J (\<lambda>_. borel)) \<and>
   142       have "\<forall>n. \<exists>J B. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I \<and> B \<in> sets (Pi\<^isub>M J (\<lambda>_. borel)) \<and>
   140         Z n = emb I J B \<and> \<mu>G (Z n) = emeasure (lim\<^isub>B J P) B"
   143         Z n = emb I J B \<and> \<mu>G (Z n) = emeasure (lim\<^isub>B J P) B"
   141         using Z by (intro allI generator_Ex) auto
   144         using Z by (intro allI generator_Ex) auto
   156       note [simp] = `\<And>n. finite (J n)`
   159       note [simp] = `\<And>n. finite (J n)`
   157       from J  Z_emb have Z_eq: "\<And>n. Z n = emb I (J n) (B n)" "\<And>n. Z n \<in> ?G"
   160       from J  Z_emb have Z_eq: "\<And>n. Z n = emb I (J n) (B n)" "\<And>n. Z n \<in> ?G"
   158         unfolding J_def B_def by (subst prod_emb_trans) (insert Z, auto)
   161         unfolding J_def B_def by (subst prod_emb_trans) (insert Z, auto)
   159       interpret prob_space "P (J i)" for i using proj_prob_space by simp
   162       interpret prob_space "P (J i)" for i using proj_prob_space by simp
   160       have "?a \<le> \<mu>G (Z 0)" by (auto intro: INF_lower)
   163       have "?a \<le> \<mu>G (Z 0)" by (auto intro: INF_lower)
   161       also have "\<dots> < \<infinity>" using J by (auto simp: Z_eq \<mu>G_eq limP_finite proj_sets)
   164       also have "\<dots> < \<infinity>" using J by (auto simp: Z_eq mu_G_eq limP_finite proj_sets)
   162       finally have "?a \<noteq> \<infinity>" by simp
   165       finally have "?a \<noteq> \<infinity>" by simp
   163       have "\<And>n. \<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>" unfolding Z_eq using J J_mono
   166       have "\<And>n. \<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>" unfolding Z_eq using J J_mono
   164         by (subst \<mu>G_eq) (auto simp: limP_finite proj_sets \<mu>G_eq)
   167         by (subst mu_G_eq) (auto simp: limP_finite proj_sets mu_G_eq)
   165 
   168 
   166       have countable_UN_J: "countable (\<Union>n. J n)" by (simp add: countable_finite)
   169       have countable_UN_J: "countable (\<Union>n. J n)" by (simp add: countable_finite)
   167       def Utn \<equiv> "to_nat_on (\<Union>n. J n)"
   170       def Utn \<equiv> "to_nat_on (\<Union>n. J n)"
   168       interpret function_to_finmap "J n" Utn "from_nat_into (\<Union>n. J n)" for n
   171       interpret function_to_finmap "J n" Utn "from_nat_into (\<Union>n. J n)" for n
   169         by unfold_locales (auto simp: Utn_def intro: from_nat_into_to_nat_on[OF countable_UN_J])
   172         by unfold_locales (auto simp: Utn_def intro: from_nat_into_to_nat_on[OF countable_UN_J])
   293         have Y_emb:
   296         have Y_emb:
   294           "Y n = prod_emb I (\<lambda>_. borel) (J n)
   297           "Y n = prod_emb I (\<lambda>_. borel) (J n)
   295             (\<Inter> i\<in>{1..n}. prod_emb (J n) (\<lambda>_. borel) (J i) (K i))" .
   298             (\<Inter> i\<in>{1..n}. prod_emb (J n) (\<lambda>_. borel) (J i) (K i))" .
   296         hence "Y n \<in> ?G" using J J_mono K_sets `n \<ge> 1` by (intro generatorI[OF _ _ _ _ Y_emb]) auto
   299         hence "Y n \<in> ?G" using J J_mono K_sets `n \<ge> 1` by (intro generatorI[OF _ _ _ _ Y_emb]) auto
   297         hence "\<bar>\<mu>G (Y n)\<bar> \<noteq> \<infinity>" unfolding Y_emb using J J_mono K_sets `n \<ge> 1`
   300         hence "\<bar>\<mu>G (Y n)\<bar> \<noteq> \<infinity>" unfolding Y_emb using J J_mono K_sets `n \<ge> 1`
   298           by (subst \<mu>G_eq) (auto simp: limP_finite proj_sets \<mu>G_eq)
   301           by (subst mu_G_eq) (auto simp: limP_finite proj_sets mu_G_eq)
   299         interpret finite_measure "(limP (J n) (\<lambda>_. borel) P)"
   302         interpret finite_measure "(limP (J n) (\<lambda>_. borel) P)"
   300         proof
   303         proof
   301           have "emeasure (limP (J n) (\<lambda>_. borel) P) (J n \<rightarrow>\<^isub>E space borel) \<noteq> \<infinity>"
   304           have "emeasure (limP (J n) (\<lambda>_. borel) P) (J n \<rightarrow>\<^isub>E space borel) \<noteq> \<infinity>"
   302             using J by (subst emeasure_limP) auto
   305             using J by (subst emeasure_limP) auto
   303           thus  "emeasure (limP (J n) (\<lambda>_. borel) P) (space (limP (J n) (\<lambda>_. borel) P)) \<noteq> \<infinity>"
   306           thus  "emeasure (limP (J n) (\<lambda>_. borel) P) (space (limP (J n) (\<lambda>_. borel) P)) \<noteq> \<infinity>"
   304              by (simp add: space_PiM)
   307              by (simp add: space_PiM)
   305         qed
   308         qed
   306         have "\<mu>G (Z n) = limP (J n) (\<lambda>_. borel) P (B n)"
   309         have "\<mu>G (Z n) = limP (J n) (\<lambda>_. borel) P (B n)"
   307           unfolding Z_eq using J by (auto simp: \<mu>G_eq)
   310           unfolding Z_eq using J by (auto simp: mu_G_eq)
   308         moreover have "\<mu>G (Y n) =
   311         moreover have "\<mu>G (Y n) =
   309           limP (J n) (\<lambda>_. borel) P (\<Inter>i\<in>{Suc 0..n}. prod_emb (J n) (\<lambda>_. borel) (J i) (K i))"
   312           limP (J n) (\<lambda>_. borel) P (\<Inter>i\<in>{Suc 0..n}. prod_emb (J n) (\<lambda>_. borel) (J i) (K i))"
   310           unfolding Y_emb using J J_mono K_sets `n \<ge> 1` by (subst \<mu>G_eq) auto
   313           unfolding Y_emb using J J_mono K_sets `n \<ge> 1` by (subst mu_G_eq) auto
   311         moreover have "\<mu>G (Z n - Y n) = limP (J n) (\<lambda>_. borel) P
   314         moreover have "\<mu>G (Z n - Y n) = limP (J n) (\<lambda>_. borel) P
   312           (B n - (\<Inter>i\<in>{Suc 0..n}. prod_emb (J n) (\<lambda>_. borel) (J i) (K i)))"
   315           (B n - (\<Inter>i\<in>{Suc 0..n}. prod_emb (J n) (\<lambda>_. borel) (J i) (K i)))"
   313           unfolding Z_eq Y_emb prod_emb_Diff[symmetric] using J J_mono K_sets `n \<ge> 1`
   316           unfolding Z_eq Y_emb prod_emb_Diff[symmetric] using J J_mono K_sets `n \<ge> 1`
   314           by (subst \<mu>G_eq) (auto intro!: sets.Diff)
   317           by (subst mu_G_eq) (auto intro!: sets.Diff)
   315         ultimately
   318         ultimately
   316         have "\<mu>G (Z n) - \<mu>G (Y n) = \<mu>G (Z n - Y n)"
   319         have "\<mu>G (Z n) - \<mu>G (Y n) = \<mu>G (Z n - Y n)"
   317           using J J_mono K_sets `n \<ge> 1`
   320           using J J_mono K_sets `n \<ge> 1`
   318           by (simp only: emeasure_eq_measure)
   321           by (simp only: emeasure_eq_measure)
   319             (auto dest!: bspec[where x=n]
   322             (auto dest!: bspec[where x=n]
   322         also have subs: "Z n - Y n \<subseteq> (\<Union> i\<in>{1..n}. (Z i - Z' i))" using Z' Z `n \<ge> 1`
   325         also have subs: "Z n - Y n \<subseteq> (\<Union> i\<in>{1..n}. (Z i - Z' i))" using Z' Z `n \<ge> 1`
   323           unfolding Y_def by (force simp: decseq_def)
   326           unfolding Y_def by (force simp: decseq_def)
   324         have "Z n - Y n \<in> ?G" "(\<Union> i\<in>{1..n}. (Z i - Z' i)) \<in> ?G"
   327         have "Z n - Y n \<in> ?G" "(\<Union> i\<in>{1..n}. (Z i - Z' i)) \<in> ?G"
   325           using `Z' _ \<in> ?G` `Z _ \<in> ?G` `Y _ \<in> ?G` by auto
   328           using `Z' _ \<in> ?G` `Z _ \<in> ?G` `Y _ \<in> ?G` by auto
   326         hence "\<mu>G (Z n - Y n) \<le> \<mu>G (\<Union> i\<in>{1..n}. (Z i - Z' i))"
   329         hence "\<mu>G (Z n - Y n) \<le> \<mu>G (\<Union> i\<in>{1..n}. (Z i - Z' i))"
   327           using subs G.additive_increasing[OF positive_\<mu>G[OF `I \<noteq> {}`] additive_\<mu>G[OF `I \<noteq> {}`]]
   330           using subs G.additive_increasing[OF positive_mu_G[OF `I \<noteq> {}`] additive_mu_G[OF `I \<noteq> {}`]]
   328           unfolding increasing_def by auto
   331           unfolding increasing_def by auto
   329         also have "\<dots> \<le> (\<Sum> i\<in>{1..n}. \<mu>G (Z i - Z' i))" using `Z _ \<in> ?G` `Z' _ \<in> ?G`
   332         also have "\<dots> \<le> (\<Sum> i\<in>{1..n}. \<mu>G (Z i - Z' i))" using `Z _ \<in> ?G` `Z' _ \<in> ?G`
   330           by (intro G.subadditive[OF positive_\<mu>G additive_\<mu>G, OF `I \<noteq> {}` `I \<noteq> {}`]) auto
   333           by (intro G.subadditive[OF positive_mu_G additive_mu_G, OF `I \<noteq> {}` `I \<noteq> {}`]) auto
   331         also have "\<dots> \<le> (\<Sum> i\<in>{1..n}. 2 powr -real i * ?a)"
   334         also have "\<dots> \<le> (\<Sum> i\<in>{1..n}. 2 powr -real i * ?a)"
   332         proof (rule setsum_mono)
   335         proof (rule setsum_mono)
   333           fix i assume "i \<in> {1..n}" hence "i \<le> n" by simp
   336           fix i assume "i \<in> {1..n}" hence "i \<le> n" by simp
   334           have "\<mu>G (Z i - Z' i) = \<mu>G (prod_emb I (\<lambda>_. borel) (J i) (B i - K i))"
   337           have "\<mu>G (Z i - Z' i) = \<mu>G (prod_emb I (\<lambda>_. borel) (J i) (B i - K i))"
   335             unfolding Z'_def Z_eq by simp
   338             unfolding Z'_def Z_eq by simp
   336           also have "\<dots> = P (J i) (B i - K i)"
   339           also have "\<dots> = P (J i) (B i - K i)"
   337             apply (subst \<mu>G_eq) using J K_sets apply auto
   340             apply (subst mu_G_eq) using J K_sets apply auto
   338             apply (subst limP_finite) apply auto
   341             apply (subst limP_finite) apply auto
   339             done
   342             done
   340           also have "\<dots> = P (J i) (B i) - P (J i) (K i)"
   343           also have "\<dots> = P (J i) (B i) - P (J i) (K i)"
   341             apply (subst emeasure_Diff) using K_sets J `K _ \<subseteq> B _` apply (auto simp: proj_sets)
   344             apply (subst emeasure_Diff) using K_sets J `K _ \<subseteq> B _` apply (auto simp: proj_sets)
   342             done
   345             done
   372         have "0 \<le> (- \<mu>G (Z n)) + \<mu>G (Z n)" using `\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>` by auto
   375         have "0 \<le> (- \<mu>G (Z n)) + \<mu>G (Z n)" using `\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>` by auto
   373         also have "\<dots> < (- \<mu>G (Z n)) + (\<mu>G (Z n) + \<mu>G (Y n))"
   376         also have "\<dots> < (- \<mu>G (Z n)) + (\<mu>G (Z n) + \<mu>G (Y n))"
   374           apply (rule ereal_less_add[OF _ R]) using `\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>` by auto
   377           apply (rule ereal_less_add[OF _ R]) using `\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>` by auto
   375         finally have "\<mu>G (Y n) > 0"
   378         finally have "\<mu>G (Y n) > 0"
   376           using `\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>` by (auto simp: ac_simps zero_ereal_def[symmetric])
   379           using `\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>` by (auto simp: ac_simps zero_ereal_def[symmetric])
   377         thus "Y n \<noteq> {}" using positive_\<mu>G `I \<noteq> {}` by (auto simp add: positive_def)
   380         thus "Y n \<noteq> {}" using positive_mu_G `I \<noteq> {}` by (auto simp add: positive_def)
   378       qed
   381       qed
   379       hence "\<forall>n\<in>{1..}. \<exists>y. y \<in> Y n" by auto
   382       hence "\<forall>n\<in>{1..}. \<exists>y. y \<in> Y n" by auto
   380       then obtain y where y: "\<And>n. n \<ge> 1 \<Longrightarrow> y n \<in> Y n" unfolding bchoice_iff by force
   383       then obtain y where y: "\<And>n. n \<ge> 1 \<Longrightarrow> y n \<in> Y n" unfolding bchoice_iff by force
   381       {
   384       {
   382         fix t and n m::nat
   385         fix t and n m::nat
   530     hence "emb I J (Pi\<^isub>E J X) \<in> generator" using assms
   533     hence "emb I J (Pi\<^isub>E J X) \<in> generator" using assms
   531       by (intro generatorI[where J=J and X="Pi\<^isub>E J X"]) (auto intro: sets_PiM_I_finite)
   534       by (intro generatorI[where J=J and X="Pi\<^isub>E J X"]) (auto intro: sets_PiM_I_finite)
   532     hence "\<mu> (emb I J (Pi\<^isub>E J X)) = \<mu>G (emb I J (Pi\<^isub>E J X))" using \<mu> by simp
   535     hence "\<mu> (emb I J (Pi\<^isub>E J X)) = \<mu>G (emb I J (Pi\<^isub>E J X))" using \<mu> by simp
   533     also have "\<dots> = emeasure (P J) (Pi\<^isub>E J X)"
   536     also have "\<dots> = emeasure (P J) (Pi\<^isub>E J X)"
   534       using JX assms proj_sets
   537       using JX assms proj_sets
   535       by (subst \<mu>G_eq) (auto simp: \<mu>G_eq limP_finite intro: sets_PiM_I_finite)
   538       by (subst mu_G_eq) (auto simp: mu_G_eq limP_finite intro: sets_PiM_I_finite)
   536     finally show "\<mu> (emb I J (Pi\<^isub>E J X)) = emeasure (P J) (Pi\<^isub>E J X)" .
   539     finally show "\<mu> (emb I J (Pi\<^isub>E J X)) = emeasure (P J) (Pi\<^isub>E J X)" .
   537   next
   540   next
   538     show "emeasure (P J) (Pi\<^isub>E J B) = emeasure (limP J (\<lambda>_. borel) P) (Pi\<^isub>E J B)"
   541     show "emeasure (P J) (Pi\<^isub>E J B) = emeasure (limP J (\<lambda>_. borel) P) (Pi\<^isub>E J B)"
   539       using assms by (simp add: f_def limP_finite Pi_def)
   542       using assms by (simp add: f_def limP_finite Pi_def)
   540   qed
   543   qed