src/HOL/Probability/Infinite_Product_Measure.thy
changeset 58184 db1381d811ab
parent 57512 cc97b347b301
child 58876 1888e3cb8048
equal deleted inserted replaced
58183:285fbec02fb0 58184:db1381d811ab
   182         then have "\<exists>w\<in>space (Pi\<^sub>M J' M). \<forall>n. ?a / 2 ^ (k + 1) \<le> ?q n w" by auto }
   182         then have "\<exists>w\<in>space (Pi\<^sub>M J' M). \<forall>n. ?a / 2 ^ (k + 1) \<le> ?q n w" by auto }
   183       note Ex_w = this
   183       note Ex_w = this
   184 
   184 
   185       let ?q = "\<lambda>k n y. \<mu>G (?M (J k) (A n) y)"
   185       let ?q = "\<lambda>k n y. \<mu>G (?M (J k) (A n) y)"
   186 
   186 
   187       have "\<forall>n. ?a / 2 ^ 0 \<le> \<mu>G (A n)" by (auto intro: INF_lower)
   187       let ?P = "\<lambda>w k. w \<in> space (Pi\<^sub>M (J k) M) \<and> (\<forall>n. ?a / 2 ^ (Suc k) \<le> ?q k n w)"
   188       from Ex_w[OF A(1,2) this J(1-3), of 0] guess w0 .. note w0 = this
   188       have "\<exists>w. \<forall>k. ?P (w k) k \<and> restrict (w (Suc k)) (J k) = w k"
   189 
   189       proof (rule dependent_nat_choice)
   190       let ?P =
   190         have "\<forall>n. ?a / 2 ^ 0 \<le> \<mu>G (A n)" by (auto intro: INF_lower)
   191         "\<lambda>k wk w. w \<in> space (Pi\<^sub>M (J (Suc k)) M) \<and> restrict w (J k) = wk \<and>
   191         from Ex_w[OF A(1,2) this J(1-3), of 0] show "\<exists>w. ?P w 0" by auto
   192           (\<forall>n. ?a / 2 ^ (Suc k + 1) \<le> ?q (Suc k) n w)"
   192       next
   193       def w \<equiv> "rec_nat w0 (\<lambda>k wk. Eps (?P k wk))"
   193         fix w k assume Suc: "?P w k"
   194 
   194         show "\<exists>w'. ?P w' (Suc k) \<and> restrict w' (J k) = w"
   195       { fix k have w: "w k \<in> space (Pi\<^sub>M (J k) M) \<and>
   195         proof cases
   196           (\<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))"
   196           assume [simp]: "J k = J (Suc k)"
   197         proof (induct k)
   197           have "?a / 2 ^ (Suc (Suc k)) \<le> ?a / 2 ^ (k + 1)"
   198           case 0 with w0 show ?case
   198             using `0 < ?a` `?a \<le> 1` by (cases ?a) (auto simp: field_simps)
   199             unfolding w_def nat.rec(1) by auto
   199           with Suc show ?thesis
       
   200             by (auto intro!: exI[of _ w] simp: extensional_restrict space_PiM intro: order_trans)
   200         next
   201         next
   201           case (Suc k)
   202           assume "J k \<noteq> J (Suc k)"
   202           then have wk: "w k \<in> space (Pi\<^sub>M (J k) M)" by auto
   203           with J_mono[of k "Suc k"] have "J (Suc k) - J k \<noteq> {}" (is "?D \<noteq> {}") by auto
   203           have "\<exists>w'. ?P k (w k) w'"
   204           have "range (\<lambda>n. ?M (J k) (A n) w) \<subseteq> ?G" "decseq (\<lambda>n. ?M (J k) (A n) w)"
   204           proof cases
   205             "\<forall>n. ?a / 2 ^ (k + 1) \<le> \<mu>G (?M (J k) (A n) w)"
   205             assume [simp]: "J k = J (Suc k)"
   206             using `decseq A` fold(4)[OF J(1-3) A_eq(2), of w k] Suc
   206             show ?thesis
   207             by (auto simp: decseq_def)
   207             proof (intro exI[of _ "w k"] conjI allI)
   208           from Ex_w[OF this `?D \<noteq> {}`] J[of "Suc k"]
   208               fix n
   209           obtain w' where w': "w' \<in> space (Pi\<^sub>M ?D M)"
   209               have "?a / 2 ^ (Suc k + 1) \<le> ?a / 2 ^ (k + 1)"
   210             "\<forall>n. ?a / 2 ^ (Suc k + 1) \<le> \<mu>G (?M ?D (?M (J k) (A n) w) w')" by auto
   210                 using `0 < ?a` `?a \<le> 1` by (cases ?a) (auto simp: field_simps)
   211           let ?w = "merge (J k) ?D (w, w')"
   211               also have "\<dots> \<le> ?q k n (w k)" using Suc by auto
   212           have [simp]: "\<And>x. merge (J k) (I - J k) (w, merge ?D (I - ?D) (w', x)) =
   212               finally show "?a / 2 ^ (Suc k + 1) \<le> ?q (Suc k) n (w k)" by simp
   213             merge (J (Suc k)) (I - (J (Suc k))) (?w, x)"
   213             next
   214             using J(3)[of "Suc k"] J(3)[of k] J_mono[of k "Suc k"]
   214               show "w k \<in> space (Pi\<^sub>M (J (Suc k)) M)"
   215             by (auto intro!: ext split: split_merge)
   215                 using Suc by simp
   216           have *: "\<And>n. ?M ?D (?M (J k) (A n) w) w' = ?M (J (Suc k)) (A n) ?w"
   216               then show "restrict (w k) (J k) = w k"
   217             using w'(1) J(3)[of "Suc k"]
   217                 by (simp add: extensional_restrict space_PiM)
   218             by (auto simp: space_PiM split: split_merge intro!: extensional_merge_sub) force+
   218             qed
   219           show ?thesis
   219           next
   220             using Suc w' J_mono[of k "Suc k"] unfolding *
   220             assume "J k \<noteq> J (Suc k)"
   221             by (intro exI[of _ ?w])
   221             with J_mono[of k "Suc k"] have "J (Suc k) - J k \<noteq> {}" (is "?D \<noteq> {}") by auto
   222                (auto split: split_merge intro!: extensional_merge_sub ext simp: space_PiM PiE_iff)
   222             have "range (\<lambda>n. ?M (J k) (A n) (w k)) \<subseteq> ?G"
       
   223               "decseq (\<lambda>n. ?M (J k) (A n) (w k))"
       
   224               "\<forall>n. ?a / 2 ^ (k + 1) \<le> \<mu>G (?M (J k) (A n) (w k))"
       
   225               using `decseq A` fold(4)[OF J(1-3) A_eq(2), of "w k" k] Suc
       
   226               by (auto simp: decseq_def)
       
   227             from Ex_w[OF this `?D \<noteq> {}`] J[of "Suc k"]
       
   228             obtain w' where w': "w' \<in> space (Pi\<^sub>M ?D M)"
       
   229               "\<forall>n. ?a / 2 ^ (Suc k + 1) \<le> \<mu>G (?M ?D (?M (J k) (A n) (w k)) w')" by auto
       
   230             let ?w = "merge (J k) ?D (w k, w')"
       
   231             have [simp]: "\<And>x. merge (J k) (I - J k) (w k, merge ?D (I - ?D) (w', x)) =
       
   232               merge (J (Suc k)) (I - (J (Suc k))) (?w, x)"
       
   233               using J(3)[of "Suc k"] J(3)[of k] J_mono[of k "Suc k"]
       
   234               by (auto intro!: ext split: split_merge)
       
   235             have *: "\<And>n. ?M ?D (?M (J k) (A n) (w k)) w' = ?M (J (Suc k)) (A n) ?w"
       
   236               using w'(1) J(3)[of "Suc k"]
       
   237               by (auto simp: space_PiM split: split_merge intro!: extensional_merge_sub) force+
       
   238             show ?thesis
       
   239               using w' J_mono[of k "Suc k"] wk unfolding *
       
   240               by (intro exI[of _ ?w])
       
   241                  (auto split: split_merge intro!: extensional_merge_sub ext simp: space_PiM PiE_iff)
       
   242           qed
       
   243           then have "?P k (w k) (w (Suc k))"
       
   244             unfolding w_def nat.rec(2) unfolding w_def[symmetric]
       
   245             by (rule someI_ex)
       
   246           then show ?case by auto
       
   247         qed
   223         qed
   248         moreover
   224       qed
   249         from w have "w k \<in> space (Pi\<^sub>M (J k) M)" by auto
   225       then obtain w where w:
   250         moreover
   226         "\<And>k. w k \<in> space (Pi\<^sub>M (J k) M)"
       
   227         "\<And>k n. ?a / 2 ^ (Suc k) \<le> ?q k n (w k)"
       
   228         "\<And>k. restrict (w (Suc k)) (J k) = w k"
       
   229         by metis
       
   230 
       
   231       { fix k
   251         from w have "?a / 2 ^ (k + 1) \<le> ?q k k (w k)" by auto
   232         from w have "?a / 2 ^ (k + 1) \<le> ?q k k (w k)" by auto
   252         then have "?M (J k) (A k) (w k) \<noteq> {}"
   233         then have "?M (J k) (A k) (w k) \<noteq> {}"
   253           using positive_mu_G[OF I_not_empty, unfolded positive_def] `0 < ?a` `?a \<le> 1`
   234           using positive_mu_G[OF I_not_empty, unfolded positive_def] `0 < ?a` `?a \<le> 1`
   254           by (cases ?a) (auto simp: divide_le_0_iff power_le_zero_eq)
   235           by (cases ?a) (auto simp: divide_le_0_iff power_le_zero_eq)
   255         then obtain x where "x \<in> ?M (J k) (A k) (w k)" by auto
   236         then obtain x where "x \<in> ?M (J k) (A k) (w k)" by auto
   256         then have "merge (J k) (I - J k) (w k, x) \<in> A k" by auto
   237         then have "merge (J k) (I - J k) (w k, x) \<in> A k" by auto
   257         then have "\<exists>x\<in>A k. restrict x (J k) = w k"
   238         then have "\<exists>x\<in>A k. restrict x (J k) = w k"
   258           using `w k \<in> space (Pi\<^sub>M (J k) M)`
   239           using `w k \<in> space (Pi\<^sub>M (J k) M)`
   259           by (intro rev_bexI) (auto intro!: ext simp: extensional_def space_PiM)
   240           by (intro rev_bexI) (auto intro!: ext simp: extensional_def space_PiM) }
   260         ultimately have "w k \<in> space (Pi\<^sub>M (J k) M)"
   241       note w_ext = this
   261           "\<exists>x\<in>A k. restrict x (J k) = w k"
       
   262           "k \<noteq> 0 \<Longrightarrow> restrict (w k) (J (k - 1)) = w (k - 1)"
       
   263           by auto }
       
   264       note w = this
       
   265 
   242 
   266       { fix k l i assume "k \<le> l" "i \<in> J k"
   243       { fix k l i assume "k \<le> l" "i \<in> J k"
   267         { fix l have "w k i = w (k + l) i"
   244         { fix l have "w k i = w (k + l) i"
   268           proof (induct l)
   245           proof (induct l)
   269             case (Suc l)
   246             case (Suc l)
   270             from `i \<in> J k` J_mono[of k "k + l"] have "i \<in> J (k + l)" by auto
   247             from `i \<in> J k` J_mono[of k "k + l"] have "i \<in> J (k + l)" by auto
   271             with w(3)[of "k + Suc l"]
   248             with w(3)[of "k + l"]
   272             have "w (k + l) i = w (k + Suc l) i"
   249             have "w (k + l) i = w (k + Suc l) i"
   273               by (auto simp: restrict_def fun_eq_iff split: split_if_asm)
   250               by (auto simp: restrict_def fun_eq_iff split: split_if_asm)
   274             with Suc show ?case by simp
   251             with Suc show ?case by simp
   275           qed simp }
   252           qed simp }
   276         from this[of "l - k"] `k \<le> l` have "w l i = w k i" by simp }
   253         from this[of "l - k"] `k \<le> l` have "w l i = w k i" by simp }
   295         using w(1) by (auto simp add: Pi_iff extensional_def space_PiM)
   272         using w(1) by (auto simp add: Pi_iff extensional_def space_PiM)
   296 
   273 
   297       { fix n
   274       { fix n
   298         have "restrict w' (J n) = w n" using w(1)[of n]
   275         have "restrict w' (J n) = w n" using w(1)[of n]
   299           by (auto simp add: fun_eq_iff space_PiM)
   276           by (auto simp add: fun_eq_iff space_PiM)
   300         with w[of n] obtain x where "x \<in> A n" "restrict x (J n) = restrict w' (J n)" by auto
   277         with w_ext[of n] obtain x where "x \<in> A n" "restrict x (J n) = restrict w' (J n)"
       
   278           by auto
   301         then have "w' \<in> A n" unfolding A_eq using w' by (auto simp: prod_emb_def space_PiM) }
   279         then have "w' \<in> A n" unfolding A_eq using w' by (auto simp: prod_emb_def space_PiM) }
   302       then have "w' \<in> (\<Inter>i. A i)" by auto
   280       then have "w' \<in> (\<Inter>i. A i)" by auto
   303       with `(\<Inter>i. A i) = {}` show False by auto
   281       with `(\<Inter>i. A i) = {}` show False by auto
   304     qed
   282     qed
   305     ultimately show "(\<lambda>i. \<mu>G (A i)) ----> 0"
   283     ultimately show "(\<lambda>i. \<mu>G (A i)) ----> 0"