src/HOL/Probability/Projective_Limit.thy
author wenzelm
Wed, 28 Nov 2012 15:59:18 +0100
changeset 50252 4aa34bd43228
parent 50245 dea9363887a6
child 50884 2b21b4e2d7cb
permissions -rw-r--r--
eliminated slightly odd identifiers;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50091
b3b5dc2350b7 corrected headers
immler
parents: 50090
diff changeset
     1
(*  Title:      HOL/Probability/Projective_Limit.thy
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
     2
    Author:     Fabian Immler, TU M√ľnchen
32d1795cc77a added projective limit;
immler
parents:
diff changeset
     3
*)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
     4
32d1795cc77a added projective limit;
immler
parents:
diff changeset
     5
header {* Projective Limit *}
32d1795cc77a added projective limit;
immler
parents:
diff changeset
     6
32d1795cc77a added projective limit;
immler
parents:
diff changeset
     7
theory Projective_Limit
32d1795cc77a added projective limit;
immler
parents:
diff changeset
     8
  imports
32d1795cc77a added projective limit;
immler
parents:
diff changeset
     9
    Caratheodory
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    10
    Fin_Map
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    11
    Regularity
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    12
    Projective_Family
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    13
    Infinite_Product_Measure
50243
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
    14
    "~~/src/HOL/Library/Countable_Set"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    15
begin
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    16
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    17
subsection {* Sequences of Finite Maps in Compact Sets *}
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    18
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    19
locale finmap_seqs_into_compact =
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    20
  fixes K::"nat \<Rightarrow> (nat \<Rightarrow>\<^isub>F 'a::metric_space) set" and f::"nat \<Rightarrow> (nat \<Rightarrow>\<^isub>F 'a)" and M
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    21
  assumes compact: "\<And>n. compact (K n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    22
  assumes f_in_K: "\<And>n. K n \<noteq> {}"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    23
  assumes domain_K: "\<And>n. k \<in> K n \<Longrightarrow> domain k = domain (f n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    24
  assumes proj_in_K:
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    25
    "\<And>t n m. m \<ge> n \<Longrightarrow> t \<in> domain (f n) \<Longrightarrow> (f m)\<^isub>F t \<in> (\<lambda>k. (k)\<^isub>F t) ` K n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    26
begin
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    27
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    28
lemma proj_in_K': "(\<exists>n. \<forall>m \<ge> n. (f m)\<^isub>F t \<in> (\<lambda>k. (k)\<^isub>F t) ` K n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    29
  using proj_in_K f_in_K
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    30
proof cases
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    31
  obtain k where "k \<in> K (Suc 0)" using f_in_K by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    32
  assume "\<forall>n. t \<notin> domain (f n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    33
  thus ?thesis
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    34
    by (auto intro!: exI[where x=1] image_eqI[OF _ `k \<in> K (Suc 0)`]
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    35
      simp: domain_K[OF `k \<in> K (Suc 0)`])
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    36
qed blast
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    37
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    38
lemma proj_in_KE:
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    39
  obtains n where "\<And>m. m \<ge> n \<Longrightarrow> (f m)\<^isub>F t \<in> (\<lambda>k. (k)\<^isub>F t) ` K n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    40
  using proj_in_K' by blast
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    41
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    42
lemma compact_projset:
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    43
  shows "compact ((\<lambda>k. (k)\<^isub>F i) ` K n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    44
  using continuous_proj compact by (rule compact_continuous_image)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    45
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    46
end
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    47
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    48
lemma compactE':
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    49
  assumes "compact S" "\<forall>n\<ge>m. f n \<in> S"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    50
  obtains l r where "l \<in> S" "subseq r" "((f \<circ> r) ---> l) sequentially"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    51
proof atomize_elim
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    52
  have "subseq (op + m)" by (simp add: subseq_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    53
  have "\<forall>n. (f o (\<lambda>i. m + i)) n \<in> S" using assms by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    54
  from compactE[OF `compact S` this] guess l r .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    55
  hence "l \<in> S" "subseq ((\<lambda>i. m + i) o r) \<and> (f \<circ> ((\<lambda>i. m + i) o r)) ----> l"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    56
    using subseq_o[OF `subseq (op + m)` `subseq r`] by (auto simp: o_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    57
  thus "\<exists>l r. l \<in> S \<and> subseq r \<and> (f \<circ> r) ----> l" by blast
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    58
qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    59
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    60
sublocale finmap_seqs_into_compact \<subseteq> subseqs "\<lambda>n s. (\<exists>l. (\<lambda>i. ((f o s) i)\<^isub>F n) ----> l)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    61
proof
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    62
  fix n s
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    63
  assume "subseq s"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    64
  from proj_in_KE[of n] guess n0 . note n0 = this
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    65
  have "\<forall>i \<ge> n0. ((f \<circ> s) i)\<^isub>F n \<in> (\<lambda>k. (k)\<^isub>F n) ` K n0"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    66
  proof safe
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    67
    fix i assume "n0 \<le> i"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    68
    also have "\<dots> \<le> s i" by (rule seq_suble) fact
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    69
    finally have "n0 \<le> s i" .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    70
    with n0 show "((f \<circ> s) i)\<^isub>F n \<in> (\<lambda>k. (k)\<^isub>F n) ` K n0 "
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    71
      by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    72
  qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    73
  from compactE'[OF compact_projset this] guess ls rs .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    74
  thus "\<exists>r'. subseq r' \<and> (\<exists>l. (\<lambda>i. ((f \<circ> (s \<circ> r')) i)\<^isub>F n) ----> l)" by (auto simp: o_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    75
qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    76
50125
4319691be975 tuned: use induction rule sigma_sets_induct_disjoint
hoelzl
parents: 50124
diff changeset
    77
lemma (in finmap_seqs_into_compact) diagonal_tendsto: "\<exists>l. (\<lambda>i. (f (diagseq i))\<^isub>F n) ----> l"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    78
proof -
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    79
  have "\<And>i n0. (f o seqseq i) i = f (diagseq i)" unfolding diagseq_def by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    80
  from reducer_reduces obtain l where l: "(\<lambda>i. ((f \<circ> seqseq (Suc n)) i)\<^isub>F n) ----> l"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    81
    unfolding seqseq_reducer
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    82
  by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    83
  have "(\<lambda>i. (f (diagseq (i + Suc n)))\<^isub>F n) =
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    84
    (\<lambda>i. ((f o (diagseq o (op + (Suc n)))) i)\<^isub>F n)" by (simp add: add_commute)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    85
  also have "\<dots> =
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    86
    (\<lambda>i. ((f o ((seqseq (Suc n) o (\<lambda>x. fold_reduce (Suc n) x (Suc n + x))))) i)\<^isub>F n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    87
    unfolding diagseq_seqseq by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    88
  also have "\<dots> = (\<lambda>i. ((f o ((seqseq (Suc n)))) i)\<^isub>F n) o (\<lambda>x. fold_reduce (Suc n) x (Suc n + x))"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    89
    by (simp add: o_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    90
  also have "\<dots> ----> l"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    91
  proof (rule LIMSEQ_subseq_LIMSEQ[OF _ subseq_diagonal_rest], rule tendstoI)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    92
    fix e::real assume "0 < e"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    93
    from tendstoD[OF l `0 < e`]
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    94
    show "eventually (\<lambda>x. dist (((f \<circ> seqseq (Suc n)) x)\<^isub>F n) l < e)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    95
      sequentially" .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    96
  qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    97
  finally show ?thesis by (intro exI) (rule LIMSEQ_offset)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    98
qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
    99
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   100
subsection {* Daniell-Kolmogorov Theorem *}
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   101
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   102
text {* Existence of Projective Limit *}
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   103
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   104
locale polish_projective = projective_family I P "\<lambda>_. borel::'a::polish_space measure"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   105
  for I::"'i set" and P
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   106
begin
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   107
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   108
abbreviation "lim\<^isub>B \<equiv> (\<lambda>J P. limP J (\<lambda>_. borel) P)"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   109
50125
4319691be975 tuned: use induction rule sigma_sets_induct_disjoint
hoelzl
parents: 50124
diff changeset
   110
lemma emeasure_limB_emb_not_empty:
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   111
  assumes "I \<noteq> {}"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   112
  assumes X: "J \<noteq> {}" "J \<subseteq> I" "finite J" "\<forall>i\<in>J. B i \<in> sets borel"
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   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)"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   114
proof -
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   115
  let ?\<Omega> = "\<Pi>\<^isub>E i\<in>I. space borel"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   116
  let ?G = generator
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   117
  interpret G!: algebra ?\<Omega> generator by (intro  algebra_generator) fact
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   118
  note mu_G_mono =
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   119
    G.additive_increasing[OF positive_mu_G[OF `I \<noteq> {}`] additive_mu_G[OF `I \<noteq> {}`],
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   120
      THEN increasingD]
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   121
  write mu_G  ("\<mu>G")
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   122
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   123
  have "\<exists>\<mu>. (\<forall>s\<in>?G. \<mu> s = \<mu>G s) \<and> measure_space ?\<Omega> (sigma_sets ?\<Omega> ?G) \<mu>"
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   124
  proof (rule G.caratheodory_empty_continuous[OF positive_mu_G additive_mu_G,
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   125
      OF `I \<noteq> {}`, OF `I \<noteq> {}`])
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   126
    fix A assume "A \<in> ?G"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   127
    with generatorE guess J X . note JX = this
50101
a3bede207a04 renamed prob_space to proj_prob_space as it clashed with Probability_Measure.prob_space
hoelzl
parents: 50095
diff changeset
   128
    interpret prob_space "P J" using proj_prob_space[OF `finite J`] .
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   129
    show "\<mu>G A \<noteq> \<infinity>" using JX by (simp add: limP_finite)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   130
  next
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   131
    fix Z assume Z: "range Z \<subseteq> ?G" "decseq Z" "(\<Inter>i. Z i) = {}"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   132
    then have "decseq (\<lambda>i. \<mu>G (Z i))"
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   133
      by (auto intro!: mu_G_mono simp: decseq_def)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   134
    moreover
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   135
    have "(INF i. \<mu>G (Z i)) = 0"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   136
    proof (rule ccontr)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   137
      assume "(INF i. \<mu>G (Z i)) \<noteq> 0" (is "?a \<noteq> 0")
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   138
      moreover have "0 \<le> ?a"
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   139
        using Z positive_mu_G[OF `I \<noteq> {}`] by (auto intro!: INF_greatest simp: positive_def)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   140
      ultimately have "0 < ?a" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   141
      hence "?a \<noteq> -\<infinity>" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   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>
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   143
        Z n = emb I J B \<and> \<mu>G (Z n) = emeasure (lim\<^isub>B J P) B"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   144
        using Z by (intro allI generator_Ex) auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   145
      then obtain J' B' where J': "\<And>n. J' n \<noteq> {}" "\<And>n. finite (J' n)" "\<And>n. J' n \<subseteq> I"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   146
          "\<And>n. B' n \<in> sets (\<Pi>\<^isub>M i\<in>J' n. borel)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   147
        and Z_emb: "\<And>n. Z n = emb I (J' n) (B' n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   148
        unfolding choice_iff by blast
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   149
      moreover def J \<equiv> "\<lambda>n. (\<Union>i\<le>n. J' i)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   150
      moreover def B \<equiv> "\<lambda>n. emb (J n) (J' n) (B' n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   151
      ultimately have J: "\<And>n. J n \<noteq> {}" "\<And>n. finite (J n)" "\<And>n. J n \<subseteq> I"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   152
        "\<And>n. B n \<in> sets (\<Pi>\<^isub>M i\<in>J n. borel)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   153
        by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   154
      have J_mono: "\<And>n m. n \<le> m \<Longrightarrow> J n \<subseteq> J m"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   155
        unfolding J_def by force
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   156
      have "\<forall>n. \<exists>j. j \<in> J n" using J by blast
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   157
      then obtain j where j: "\<And>n. j n \<in> J n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   158
        unfolding choice_iff by blast
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   159
      note [simp] = `\<And>n. finite (J n)`
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   160
      from J  Z_emb have Z_eq: "\<And>n. Z n = emb I (J n) (B n)" "\<And>n. Z n \<in> ?G"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   161
        unfolding J_def B_def by (subst prod_emb_trans) (insert Z, auto)
50101
a3bede207a04 renamed prob_space to proj_prob_space as it clashed with Probability_Measure.prob_space
hoelzl
parents: 50095
diff changeset
   162
      interpret prob_space "P (J i)" for i using proj_prob_space by simp
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   163
      have "?a \<le> \<mu>G (Z 0)" by (auto intro: INF_lower)
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   164
      also have "\<dots> < \<infinity>" using J by (auto simp: Z_eq mu_G_eq limP_finite proj_sets)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   165
      finally have "?a \<noteq> \<infinity>" by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   166
      have "\<And>n. \<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>" unfolding Z_eq using J J_mono
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   167
        by (subst mu_G_eq) (auto simp: limP_finite proj_sets mu_G_eq)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   168
50243
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   169
      have countable_UN_J: "countable (\<Union>n. J n)" by (simp add: countable_finite)
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   170
      def Utn \<equiv> "to_nat_on (\<Union>n. J n)"
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   171
      interpret function_to_finmap "J n" Utn "from_nat_into (\<Union>n. J n)" for n
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   172
        by unfold_locales (auto simp: Utn_def intro: from_nat_into_to_nat_on[OF countable_UN_J])
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   173
      have inj_on_Utn: "inj_on Utn (\<Union>n. J n)"
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   174
        unfolding Utn_def using countable_UN_J by (rule inj_on_to_nat_on)
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   175
      hence inj_on_Utn_J: "\<And>n. inj_on Utn (J n)" by (rule subset_inj_on) auto
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   176
      def P' \<equiv> "\<lambda>n. mapmeasure n (P (J n)) (\<lambda>_. borel)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   177
      let ?SUP = "\<lambda>n. SUP K : {K. K \<subseteq> fm n ` (B n) \<and> compact K}. emeasure (P' n) K"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   178
      {
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   179
        fix n
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   180
        interpret finite_measure "P (J n)" by unfold_locales
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   181
        have "emeasure (P (J n)) (B n) = emeasure (P' n) (fm n ` (B n))"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   182
          using J by (auto simp: P'_def mapmeasure_PiM proj_space proj_sets)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   183
        also
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   184
        have "\<dots> = ?SUP n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   185
        proof (rule inner_regular)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   186
          show "emeasure (P' n) (space (P' n)) \<noteq> \<infinity>"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   187
            unfolding P'_def
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   188
            by (auto simp: P'_def mapmeasure_PiF fm_measurable proj_space proj_sets)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   189
          show "sets (P' n) = sets borel" by (simp add: borel_eq_PiF_borel P'_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   190
        next
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   191
          show "fm n ` B n \<in> sets borel"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   192
            unfolding borel_eq_PiF_borel
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   193
            by (auto simp del: J(2) simp: P'_def fm_image_measurable_finite proj_sets J)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   194
        qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   195
        finally
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   196
        have "emeasure (P (J n)) (B n) = ?SUP n" "?SUP n \<noteq> \<infinity>" "?SUP n \<noteq> - \<infinity>" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   197
      } note R = this
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   198
      have "\<forall>n. \<exists>K. emeasure (P (J n)) (B n) - emeasure (P' n) K \<le> 2 powr (-n) * ?a
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   199
        \<and> compact K \<and> K \<subseteq> fm n ` B n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   200
      proof
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   201
        fix n
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   202
        have "emeasure (P' n) (space (P' n)) \<noteq> \<infinity>"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   203
          by (simp add: mapmeasure_PiF P'_def proj_space proj_sets)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   204
        then interpret finite_measure "P' n" ..
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   205
        show "\<exists>K. emeasure (P (J n)) (B n) - emeasure (P' n) K \<le> ereal (2 powr - real n) * ?a \<and>
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   206
            compact K \<and> K \<subseteq> fm n ` B n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   207
          unfolding R
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   208
        proof (rule ccontr)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   209
          assume H: "\<not> (\<exists>K'. ?SUP n - emeasure (P' n) K' \<le> ereal (2 powr - real n)  * ?a \<and>
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   210
            compact K' \<and> K' \<subseteq> fm n ` B n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   211
          have "?SUP n \<le> ?SUP n - 2 powr (-n) * ?a"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   212
          proof (intro SUP_least)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   213
            fix K
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   214
            assume "K \<in> {K. K \<subseteq> fm n ` B n \<and> compact K}"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   215
            with H have "\<not> ?SUP n - emeasure (P' n) K \<le> 2 powr (-n) * ?a"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   216
              by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   217
            hence "?SUP n - emeasure (P' n) K > 2 powr (-n) * ?a"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   218
              unfolding not_less[symmetric] by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   219
            hence "?SUP n - 2 powr (-n) * ?a > emeasure (P' n) K"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   220
              using `0 < ?a` by (auto simp add: ereal_less_minus_iff ac_simps)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   221
            thus "?SUP n - 2 powr (-n) * ?a \<ge> emeasure (P' n) K" by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   222
          qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   223
          hence "?SUP n + 0 \<le> ?SUP n - (2 powr (-n) * ?a)" using `0 < ?a` by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   224
          hence "?SUP n + 0 \<le> ?SUP n + - (2 powr (-n) * ?a)" unfolding minus_ereal_def .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   225
          hence "0 \<le> - (2 powr (-n) * ?a)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   226
            using `?SUP _ \<noteq> \<infinity>` `?SUP _ \<noteq> - \<infinity>`
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   227
            by (subst (asm) ereal_add_le_add_iff) (auto simp:)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   228
          moreover have "ereal (2 powr - real n) * ?a > 0" using `0 < ?a`
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   229
            by (auto simp: ereal_zero_less_0_iff)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   230
          ultimately show False by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   231
        qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   232
      qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   233
      then obtain K' where K':
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   234
        "\<And>n. emeasure (P (J n)) (B n) - emeasure (P' n) (K' n) \<le> ereal (2 powr - real n) * ?a"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   235
        "\<And>n. compact (K' n)" "\<And>n. K' n \<subseteq> fm n ` B n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   236
        unfolding choice_iff by blast
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   237
      def K \<equiv> "\<lambda>n. fm n -` K' n \<inter> space (Pi\<^isub>M (J n) (\<lambda>_. borel))"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   238
      have K_sets: "\<And>n. K n \<in> sets (Pi\<^isub>M (J n) (\<lambda>_. borel))"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   239
        unfolding K_def
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   240
        using compact_imp_closed[OF `compact (K' _)`]
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   241
        by (intro measurable_sets[OF fm_measurable, of _ "Collect finite"])
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   242
           (auto simp: borel_eq_PiF_borel[symmetric])
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   243
      have K_B: "\<And>n. K n \<subseteq> B n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   244
      proof
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   245
        fix x n
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   246
        assume "x \<in> K n" hence fm_in: "fm n x \<in> fm n ` B n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   247
          using K' by (force simp: K_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   248
        show "x \<in> B n"
50244
de72bbe42190 qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents: 50243
diff changeset
   249
          using `x \<in> K n` K_sets sets.sets_into_space J[of n]
de72bbe42190 qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents: 50243
diff changeset
   250
          by (intro inj_on_image_mem_iff[OF inj_on_fm _ fm_in, of "\<lambda>_. borel"]) auto
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   251
      qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   252
      def Z' \<equiv> "\<lambda>n. emb I (J n) (K n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   253
      have Z': "\<And>n. Z' n \<subseteq> Z n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   254
        unfolding Z_eq unfolding Z'_def
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   255
      proof (rule prod_emb_mono, safe)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   256
        fix n x assume "x \<in> K n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   257
        hence "fm n x \<in> K' n" "x \<in> space (Pi\<^isub>M (J n) (\<lambda>_. borel))"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   258
          by (simp_all add: K_def proj_space)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   259
        note this(1)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   260
        also have "K' n \<subseteq> fm n ` B n" by (simp add: K')
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   261
        finally have "fm n x \<in> fm n ` B n" .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   262
        thus "x \<in> B n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   263
        proof safe
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   264
          fix y assume "y \<in> B n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   265
          moreover
50244
de72bbe42190 qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents: 50243
diff changeset
   266
          hence "y \<in> space (Pi\<^isub>M (J n) (\<lambda>_. borel))" using J sets.sets_into_space[of "B n" "P (J n)"]
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   267
            by (auto simp add: proj_space proj_sets)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   268
          assume "fm n x = fm n y"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   269
          note inj_onD[OF inj_on_fm[OF space_borel],
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   270
            OF `fm n x = fm n y` `x \<in> space _` `y \<in> space _`]
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   271
          ultimately show "x \<in> B n" by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   272
        qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   273
      qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   274
      { fix n
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   275
        have "Z' n \<in> ?G" using K' unfolding Z'_def
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   276
          apply (intro generatorI'[OF J(1-3)])
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   277
          unfolding K_def proj_space
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   278
          apply (rule measurable_sets[OF fm_measurable[of _ "Collect finite"]])
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   279
          apply (auto simp add: P'_def borel_eq_PiF_borel[symmetric] compact_imp_closed)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   280
          done
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   281
      }
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   282
      def Y \<equiv> "\<lambda>n. \<Inter>i\<in>{1..n}. Z' i"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   283
      hence "\<And>n k. Y (n + k) \<subseteq> Y n" by (induct_tac k) (auto simp: Y_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   284
      hence Y_mono: "\<And>n m. n \<le> m \<Longrightarrow> Y m \<subseteq> Y n" by (auto simp: le_iff_add)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   285
      have Y_Z': "\<And>n. n \<ge> 1 \<Longrightarrow> Y n \<subseteq> Z' n" by (auto simp: Y_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   286
      hence Y_Z: "\<And>n. n \<ge> 1 \<Longrightarrow> Y n \<subseteq> Z n" using Z' by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   287
      have Y_notempty: "\<And>n. n \<ge> 1 \<Longrightarrow> (Y n) \<noteq> {}"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   288
      proof -
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   289
        fix n::nat assume "n \<ge> 1" hence "Y n \<subseteq> Z n" by fact
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   290
        have "Y n = (\<Inter> i\<in>{1..n}. emb I (J n) (emb (J n) (J i) (K i)))" using J J_mono
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   291
          by (auto simp: Y_def Z'_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   292
        also have "\<dots> = prod_emb I (\<lambda>_. borel) (J n) (\<Inter> i\<in>{1..n}. emb (J n) (J i) (K i))"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   293
          using `n \<ge> 1`
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   294
          by (subst prod_emb_INT) auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   295
        finally
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   296
        have Y_emb:
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   297
          "Y n = prod_emb I (\<lambda>_. borel) (J n)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   298
            (\<Inter> i\<in>{1..n}. prod_emb (J n) (\<lambda>_. borel) (J i) (K i))" .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   299
        hence "Y n \<in> ?G" using J J_mono K_sets `n \<ge> 1` by (intro generatorI[OF _ _ _ _ Y_emb]) auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   300
        hence "\<bar>\<mu>G (Y n)\<bar> \<noteq> \<infinity>" unfolding Y_emb using J J_mono K_sets `n \<ge> 1`
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   301
          by (subst mu_G_eq) (auto simp: limP_finite proj_sets mu_G_eq)
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   302
        interpret finite_measure "(limP (J n) (\<lambda>_. borel) P)"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   303
        proof
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   304
          have "emeasure (limP (J n) (\<lambda>_. borel) P) (J n \<rightarrow>\<^isub>E space borel) \<noteq> \<infinity>"
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   305
            using J by (subst emeasure_limP) auto
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   306
          thus  "emeasure (limP (J n) (\<lambda>_. borel) P) (space (limP (J n) (\<lambda>_. borel) P)) \<noteq> \<infinity>"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   307
             by (simp add: space_PiM)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   308
        qed
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   309
        have "\<mu>G (Z n) = limP (J n) (\<lambda>_. borel) P (B n)"
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   310
          unfolding Z_eq using J by (auto simp: mu_G_eq)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   311
        moreover have "\<mu>G (Y n) =
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   312
          limP (J n) (\<lambda>_. borel) P (\<Inter>i\<in>{Suc 0..n}. prod_emb (J n) (\<lambda>_. borel) (J i) (K i))"
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   313
          unfolding Y_emb using J J_mono K_sets `n \<ge> 1` by (subst mu_G_eq) auto
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   314
        moreover have "\<mu>G (Z n - Y n) = limP (J n) (\<lambda>_. borel) P
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   315
          (B n - (\<Inter>i\<in>{Suc 0..n}. prod_emb (J n) (\<lambda>_. borel) (J i) (K i)))"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   316
          unfolding Z_eq Y_emb prod_emb_Diff[symmetric] using J J_mono K_sets `n \<ge> 1`
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   317
          by (subst mu_G_eq) (auto intro!: sets.Diff)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   318
        ultimately
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   319
        have "\<mu>G (Z n) - \<mu>G (Y n) = \<mu>G (Z n - Y n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   320
          using J J_mono K_sets `n \<ge> 1`
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   321
          by (simp only: emeasure_eq_measure)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   322
            (auto dest!: bspec[where x=n]
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   323
            simp: extensional_restrict emeasure_eq_measure prod_emb_iff
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   324
            intro!: measure_Diff[symmetric] set_mp[OF K_B])
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   325
        also have subs: "Z n - Y n \<subseteq> (\<Union> i\<in>{1..n}. (Z i - Z' i))" using Z' Z `n \<ge> 1`
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   326
          unfolding Y_def by (force simp: decseq_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   327
        have "Z n - Y n \<in> ?G" "(\<Union> i\<in>{1..n}. (Z i - Z' i)) \<in> ?G"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   328
          using `Z' _ \<in> ?G` `Z _ \<in> ?G` `Y _ \<in> ?G` by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   329
        hence "\<mu>G (Z n - Y n) \<le> \<mu>G (\<Union> i\<in>{1..n}. (Z i - Z' i))"
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   330
          using subs G.additive_increasing[OF positive_mu_G[OF `I \<noteq> {}`] additive_mu_G[OF `I \<noteq> {}`]]
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   331
          unfolding increasing_def by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   332
        also have "\<dots> \<le> (\<Sum> i\<in>{1..n}. \<mu>G (Z i - Z' i))" using `Z _ \<in> ?G` `Z' _ \<in> ?G`
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   333
          by (intro G.subadditive[OF positive_mu_G additive_mu_G, OF `I \<noteq> {}` `I \<noteq> {}`]) auto
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   334
        also have "\<dots> \<le> (\<Sum> i\<in>{1..n}. 2 powr -real i * ?a)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   335
        proof (rule setsum_mono)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   336
          fix i assume "i \<in> {1..n}" hence "i \<le> n" by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   337
          have "\<mu>G (Z i - Z' i) = \<mu>G (prod_emb I (\<lambda>_. borel) (J i) (B i - K i))"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   338
            unfolding Z'_def Z_eq by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   339
          also have "\<dots> = P (J i) (B i - K i)"
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   340
            apply (subst mu_G_eq) using J K_sets apply auto
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   341
            apply (subst limP_finite) apply auto
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   342
            done
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   343
          also have "\<dots> = P (J i) (B i) - P (J i) (K i)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   344
            apply (subst emeasure_Diff) using K_sets J `K _ \<subseteq> B _` apply (auto simp: proj_sets)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   345
            done
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   346
          also have "\<dots> = P (J i) (B i) - P' i (K' i)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   347
            unfolding K_def P'_def
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   348
            by (auto simp: mapmeasure_PiF proj_space proj_sets borel_eq_PiF_borel[symmetric]
50123
69b35a75caf3 merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents: 50101
diff changeset
   349
              compact_imp_closed[OF `compact (K' _)`] space_PiM PiE_def)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   350
          also have "\<dots> \<le> ereal (2 powr - real i) * ?a" using K'(1)[of i] .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   351
          finally show "\<mu>G (Z i - Z' i) \<le> (2 powr - real i) * ?a" .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   352
        qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   353
        also have "\<dots> = (\<Sum> i\<in>{1..n}. ereal (2 powr -real i) * ereal(real ?a))"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   354
          using `?a \<noteq> \<infinity>` `?a \<noteq> - \<infinity>` by (subst ereal_real') auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   355
        also have "\<dots> = ereal (\<Sum> i\<in>{1..n}. (2 powr -real i) * (real ?a))" by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   356
        also have "\<dots> = ereal ((\<Sum> i\<in>{1..n}. (2 powr -real i)) * real ?a)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   357
          by (simp add: setsum_left_distrib)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   358
        also have "\<dots> < ereal (1 * real ?a)" unfolding less_ereal.simps
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   359
        proof (rule mult_strict_right_mono)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   360
          have "(\<Sum>i\<in>{1..n}. 2 powr - real i) = (\<Sum>i\<in>{1..<Suc n}. (1/2) ^ i)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   361
            by (rule setsum_cong)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   362
               (auto simp: powr_realpow[symmetric] powr_minus powr_divide inverse_eq_divide)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   363
          also have "{1..<Suc n} = {0..<Suc n} - {0}" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   364
          also have "setsum (op ^ (1 / 2::real)) ({0..<Suc n} - {0}) =
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   365
            setsum (op ^ (1 / 2)) ({0..<Suc n}) - 1" by (auto simp: setsum_diff1)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   366
          also have "\<dots> < 1" by (subst sumr_geometric) auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   367
          finally show "(\<Sum>i = 1..n. 2 powr - real i) < 1" .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   368
        qed (auto simp:
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   369
          `0 < ?a` `?a \<noteq> \<infinity>` `?a \<noteq> - \<infinity>` ereal_less_real_iff zero_ereal_def[symmetric])
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   370
        also have "\<dots> = ?a" using `0 < ?a` `?a \<noteq> \<infinity>` by (auto simp: ereal_real')
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   371
        also have "\<dots> \<le> \<mu>G (Z n)" by (auto intro: INF_lower)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   372
        finally have "\<mu>G (Z n) - \<mu>G (Y n) < \<mu>G (Z n)" .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   373
        hence R: "\<mu>G (Z n) < \<mu>G (Z n) + \<mu>G (Y n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   374
          using `\<bar>\<mu>G (Y n)\<bar> \<noteq> \<infinity>` by (simp add: ereal_minus_less)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   375
        have "0 \<le> (- \<mu>G (Z n)) + \<mu>G (Z n)" using `\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>` by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   376
        also have "\<dots> < (- \<mu>G (Z n)) + (\<mu>G (Z n) + \<mu>G (Y n))"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   377
          apply (rule ereal_less_add[OF _ R]) using `\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>` by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   378
        finally have "\<mu>G (Y n) > 0"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   379
          using `\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>` by (auto simp: ac_simps zero_ereal_def[symmetric])
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   380
        thus "Y n \<noteq> {}" using positive_mu_G `I \<noteq> {}` by (auto simp add: positive_def)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   381
      qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   382
      hence "\<forall>n\<in>{1..}. \<exists>y. y \<in> Y n" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   383
      then obtain y where y: "\<And>n. n \<ge> 1 \<Longrightarrow> y n \<in> Y n" unfolding bchoice_iff by force
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   384
      {
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   385
        fix t and n m::nat
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   386
        assume "1 \<le> n" "n \<le> m" hence "1 \<le> m" by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   387
        from Y_mono[OF `m \<ge> n`] y[OF `1 \<le> m`] have "y m \<in> Y n" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   388
        also have "\<dots> \<subseteq> Z' n" using Y_Z'[OF `1 \<le> n`] .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   389
        finally
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   390
        have "fm n (restrict (y m) (J n)) \<in> K' n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   391
          unfolding Z'_def K_def prod_emb_iff by (simp add: Z'_def K_def prod_emb_iff)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   392
        moreover have "finmap_of (J n) (restrict (y m) (J n)) = finmap_of (J n) (y m)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   393
          using J by (simp add: fm_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   394
        ultimately have "fm n (y m) \<in> K' n" by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   395
      } note fm_in_K' = this
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   396
      interpret finmap_seqs_into_compact "\<lambda>n. K' (Suc n)" "\<lambda>k. fm (Suc k) (y (Suc k))" borel
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   397
      proof
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   398
        fix n show "compact (K' n)" by fact
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   399
      next
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   400
        fix n
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   401
        from Y_mono[of n "Suc n"] y[of "Suc n"] have "y (Suc n) \<in> Y (Suc n)" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   402
        also have "\<dots> \<subseteq> Z' (Suc n)" using Y_Z' by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   403
        finally
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   404
        have "fm (Suc n) (restrict (y (Suc n)) (J (Suc n))) \<in> K' (Suc n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   405
          unfolding Z'_def K_def prod_emb_iff by (simp add: Z'_def K_def prod_emb_iff)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   406
        thus "K' (Suc n) \<noteq> {}" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   407
        fix k
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   408
        assume "k \<in> K' (Suc n)"
50244
de72bbe42190 qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents: 50243
diff changeset
   409
        with K'[of "Suc n"] sets.sets_into_space have "k \<in> fm (Suc n) ` B (Suc n)" by auto
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   410
        then obtain b where "k = fm (Suc n) b" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   411
        thus "domain k = domain (fm (Suc n) (y (Suc n)))"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   412
          by (simp_all add: fm_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   413
      next
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   414
        fix t and n m::nat
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   415
        assume "n \<le> m" hence "Suc n \<le> Suc m" by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   416
        assume "t \<in> domain (fm (Suc n) (y (Suc n)))"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   417
        then obtain j where j: "t = Utn j" "j \<in> J (Suc n)" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   418
        hence "j \<in> J (Suc m)" using J_mono[OF `Suc n \<le> Suc m`] by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   419
        have img: "fm (Suc n) (y (Suc m)) \<in> K' (Suc n)" using `n \<le> m`
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   420
          by (intro fm_in_K') simp_all
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   421
        show "(fm (Suc m) (y (Suc m)))\<^isub>F t \<in> (\<lambda>k. (k)\<^isub>F t) ` K' (Suc n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   422
          apply (rule image_eqI[OF _ img])
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   423
          using `j \<in> J (Suc n)` `j \<in> J (Suc m)`
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   424
          unfolding j by (subst proj_fm, auto)+
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   425
      qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   426
      have "\<forall>t. \<exists>z. (\<lambda>i. (fm (Suc (diagseq i)) (y (Suc (diagseq i))))\<^isub>F t) ----> z"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   427
        using diagonal_tendsto ..
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   428
      then obtain z where z:
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   429
        "\<And>t. (\<lambda>i. (fm (Suc (diagseq i)) (y (Suc (diagseq i))))\<^isub>F t) ----> z t"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   430
        unfolding choice_iff by blast
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   431
      {
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   432
        fix n :: nat assume "n \<ge> 1"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   433
        have "\<And>i. domain (fm n (y (Suc (diagseq i)))) = domain (finmap_of (Utn ` J n) z)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   434
          by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   435
        moreover
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   436
        {
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   437
          fix t
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   438
          assume t: "t \<in> domain (finmap_of (Utn ` J n) z)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   439
          hence "t \<in> Utn ` J n" by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   440
          then obtain j where j: "t = Utn j" "j \<in> J n" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   441
          have "(\<lambda>i. (fm n (y (Suc (diagseq i))))\<^isub>F t) ----> z t"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   442
            apply (subst (2) tendsto_iff, subst eventually_sequentially)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   443
          proof safe
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   444
            fix e :: real assume "0 < e"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   445
            { fix i x assume "i \<ge> n" "t \<in> domain (fm n x)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   446
              moreover
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   447
              hence "t \<in> domain (fm i x)" using J_mono[OF `i \<ge> n`] by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   448
              ultimately have "(fm i x)\<^isub>F t = (fm n x)\<^isub>F t"
50243
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   449
                using j by (auto simp: proj_fm dest!: inj_onD[OF inj_on_Utn])
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   450
            } note index_shift = this
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   451
            have I: "\<And>i. i \<ge> n \<Longrightarrow> Suc (diagseq i) \<ge> n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   452
              apply (rule le_SucI)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   453
              apply (rule order_trans) apply simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   454
              apply (rule seq_suble[OF subseq_diagseq])
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   455
              done
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   456
            from z
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   457
            have "\<exists>N. \<forall>i\<ge>N. dist ((fm (Suc (diagseq i)) (y (Suc (diagseq i))))\<^isub>F t) (z t) < e"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   458
              unfolding tendsto_iff eventually_sequentially using `0 < e` by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   459
            then obtain N where N: "\<And>i. i \<ge> N \<Longrightarrow>
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   460
              dist ((fm (Suc (diagseq i)) (y (Suc (diagseq i))))\<^isub>F t) (z t) < e" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   461
            show "\<exists>N. \<forall>na\<ge>N. dist ((fm n (y (Suc (diagseq na))))\<^isub>F t) (z t) < e "
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   462
            proof (rule exI[where x="max N n"], safe)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   463
              fix na assume "max N n \<le> na"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   464
              hence  "dist ((fm n (y (Suc (diagseq na))))\<^isub>F t) (z t) =
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   465
                      dist ((fm (Suc (diagseq na)) (y (Suc (diagseq na))))\<^isub>F t) (z t)" using t
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   466
                by (subst index_shift[OF I]) auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   467
              also have "\<dots> < e" using `max N n \<le> na` by (intro N) simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   468
              finally show "dist ((fm n (y (Suc (diagseq na))))\<^isub>F t) (z t) < e" .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   469
            qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   470
          qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   471
          hence "(\<lambda>i. (fm n (y (Suc (diagseq i))))\<^isub>F t) ----> (finmap_of (Utn ` J n) z)\<^isub>F t"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   472
            by (simp add: tendsto_intros)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   473
        } ultimately
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   474
        have "(\<lambda>i. fm n (y (Suc (diagseq i)))) ----> finmap_of (Utn ` J n) z"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   475
          by (rule tendsto_finmap)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   476
        hence "((\<lambda>i. fm n (y (Suc (diagseq i)))) o (\<lambda>i. i + n)) ----> finmap_of (Utn ` J n) z"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   477
          by (intro lim_subseq) (simp add: subseq_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   478
        moreover
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   479
        have "(\<forall>i. ((\<lambda>i. fm n (y (Suc (diagseq i)))) o (\<lambda>i. i + n)) i \<in> K' n)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   480
          apply (auto simp add: o_def intro!: fm_in_K' `1 \<le> n` le_SucI)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   481
          apply (rule le_trans)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   482
          apply (rule le_add2)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   483
          using seq_suble[OF subseq_diagseq]
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   484
          apply auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   485
          done
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   486
        moreover
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   487
        from `compact (K' n)` have "closed (K' n)" by (rule compact_imp_closed)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   488
        ultimately
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   489
        have "finmap_of (Utn ` J n) z \<in> K' n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   490
          unfolding closed_sequential_limits by blast
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   491
        also have "finmap_of (Utn ` J n) z  = fm n (\<lambda>i. z (Utn i))"
50243
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   492
          unfolding finmap_eq_iff
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   493
        proof clarsimp
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   494
          fix i assume "i \<in> J n"
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   495
          moreover hence "from_nat_into (\<Union>n. J n) (Utn i) = i"
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   496
            unfolding Utn_def
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   497
            by (subst from_nat_into_to_nat_on[OF countable_UN_J]) auto
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   498
          ultimately show "z (Utn i) = (fm n (\<lambda>i. z (Utn i)))\<^isub>F (Utn i)"
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   499
            by (simp add: finmap_eq_iff fm_def compose_def)
0d97ef1d6de9 eliminated finite_set_sequence with countable set
immler
parents: 50125
diff changeset
   500
        qed
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   501
        finally have "fm n (\<lambda>i. z (Utn i)) \<in> K' n" .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   502
        moreover
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   503
        let ?J = "\<Union>n. J n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   504
        have "(?J \<inter> J n) = J n" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   505
        ultimately have "restrict (\<lambda>i. z (Utn i)) (?J \<inter> J n) \<in> K n"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   506
          unfolding K_def by (auto simp: proj_space space_PiM)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   507
        hence "restrict (\<lambda>i. z (Utn i)) ?J \<in> Z' n" unfolding Z'_def
50123
69b35a75caf3 merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents: 50101
diff changeset
   508
          using J by (auto simp: prod_emb_def PiE_def extensional_def)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   509
        also have "\<dots> \<subseteq> Z n" using Z' by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   510
        finally have "restrict (\<lambda>i. z (Utn i)) ?J \<in> Z n" .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   511
      } note in_Z = this
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   512
      hence "(\<Inter>i\<in>{1..}. Z i) \<noteq> {}" by auto
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   513
      hence "(\<Inter>i. Z i) \<noteq> {}" using Z INT_decseq_offset[OF `decseq Z`] by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   514
      thus False using Z by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   515
    qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   516
    ultimately show "(\<lambda>i. \<mu>G (Z i)) ----> 0"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   517
      using LIMSEQ_ereal_INFI[of "\<lambda>i. \<mu>G (Z i)"] by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   518
  qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   519
  then guess \<mu> .. note \<mu> = this
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   520
  def f \<equiv> "finmap_of J B"
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   521
  show "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)"
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   522
  proof (subst emeasure_extend_measure_Pair[OF limP_def, of I "\<lambda>_. borel" \<mu>])
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   523
    show "positive (sets (lim\<^isub>B I P)) \<mu>" "countably_additive (sets (lim\<^isub>B I P)) \<mu>"
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   524
      using \<mu> unfolding sets_limP sets_PiM_generator by (auto simp: measure_space_def)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   525
  next
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   526
    show "(J \<noteq> {} \<or> I = {}) \<and> finite J \<and> J \<subseteq> I \<and> B \<in> J \<rightarrow> sets borel"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   527
      using assms by (auto simp: f_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   528
  next
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   529
    fix J and X::"'i \<Rightarrow> 'a set"
50123
69b35a75caf3 merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents: 50101
diff changeset
   530
    show "prod_emb I (\<lambda>_. borel) J (Pi\<^isub>E J X) \<in> Pow (I \<rightarrow>\<^isub>E space borel)"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   531
      by (auto simp: prod_emb_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   532
    assume JX: "(J \<noteq> {} \<or> I = {}) \<and> finite J \<and> J \<subseteq> I \<and> X \<in> J \<rightarrow> sets borel"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   533
    hence "emb I J (Pi\<^isub>E J X) \<in> generator" using assms
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   534
      by (intro generatorI[where J=J and X="Pi\<^isub>E J X"]) (auto intro: sets_PiM_I_finite)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   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
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   536
    also have "\<dots> = emeasure (P J) (Pi\<^isub>E J X)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   537
      using JX assms proj_sets
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   538
      by (subst mu_G_eq) (auto simp: mu_G_eq limP_finite intro: sets_PiM_I_finite)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   539
    finally show "\<mu> (emb I J (Pi\<^isub>E J X)) = emeasure (P J) (Pi\<^isub>E J X)" .
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   540
  next
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   541
    show "emeasure (P J) (Pi\<^isub>E J B) = emeasure (limP J (\<lambda>_. borel) P) (Pi\<^isub>E J B)"
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   542
      using assms by (simp add: f_def limP_finite Pi_def)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   543
  qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   544
qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   545
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   546
end
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   547
50090
01203193dfa0 hide constants of auxiliary type finmap
immler
parents: 50088
diff changeset
   548
hide_const (open) PiF
01203193dfa0 hide constants of auxiliary type finmap
immler
parents: 50088
diff changeset
   549
hide_const (open) Pi\<^isub>F
01203193dfa0 hide constants of auxiliary type finmap
immler
parents: 50088
diff changeset
   550
hide_const (open) Pi'
01203193dfa0 hide constants of auxiliary type finmap
immler
parents: 50088
diff changeset
   551
hide_const (open) Abs_finmap
01203193dfa0 hide constants of auxiliary type finmap
immler
parents: 50088
diff changeset
   552
hide_const (open) Rep_finmap
01203193dfa0 hide constants of auxiliary type finmap
immler
parents: 50088
diff changeset
   553
hide_const (open) finmap_of
01203193dfa0 hide constants of auxiliary type finmap
immler
parents: 50088
diff changeset
   554
hide_const (open) proj
01203193dfa0 hide constants of auxiliary type finmap
immler
parents: 50088
diff changeset
   555
hide_const (open) domain
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50244
diff changeset
   556
hide_const (open) basis_finmap
50090
01203193dfa0 hide constants of auxiliary type finmap
immler
parents: 50088
diff changeset
   557
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   558
sublocale polish_projective \<subseteq> P!: prob_space "(lim\<^isub>B I P)"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   559
proof
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   560
  show "emeasure (lim\<^isub>B I P) (space (lim\<^isub>B I P)) = 1"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   561
  proof cases
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   562
    assume "I = {}"
50101
a3bede207a04 renamed prob_space to proj_prob_space as it clashed with Probability_Measure.prob_space
hoelzl
parents: 50095
diff changeset
   563
    interpret prob_space "P {}" using proj_prob_space by simp
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   564
    show ?thesis
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   565
      by (simp add: space_PiM_empty limP_finite emeasure_space_1 `I = {}`)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   566
  next
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   567
    assume "I \<noteq> {}"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   568
    then obtain i where "i \<in> I" by auto
50101
a3bede207a04 renamed prob_space to proj_prob_space as it clashed with Probability_Measure.prob_space
hoelzl
parents: 50095
diff changeset
   569
    interpret prob_space "P {i}" using proj_prob_space by simp
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   570
    have R: "(space (lim\<^isub>B I P)) = (emb I {i} (Pi\<^isub>E {i} (\<lambda>_. space borel)))"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   571
      by (auto simp: prod_emb_def space_PiM)
50123
69b35a75caf3 merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents: 50101
diff changeset
   572
    moreover have "extensional {i} = space (P {i})" by (simp add: proj_space space_PiM PiE_def)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   573
    ultimately show ?thesis using `i \<in> I`
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   574
      apply (subst R)
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   575
      apply (subst emeasure_limB_emb_not_empty)
50123
69b35a75caf3 merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents: 50101
diff changeset
   576
      apply (auto simp: limP_finite emeasure_space_1 PiE_def)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   577
      done
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   578
  qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   579
qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   580
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   581
context polish_projective begin
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   582
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   583
lemma emeasure_limB_emb:
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   584
  assumes X: "J \<subseteq> I" "finite J" "\<forall>i\<in>J. B i \<in> sets borel"
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   585
  shows "emeasure (lim\<^isub>B I P) (emb I J (Pi\<^isub>E J B)) = emeasure (P J) (Pi\<^isub>E J B)"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   586
proof cases
50101
a3bede207a04 renamed prob_space to proj_prob_space as it clashed with Probability_Measure.prob_space
hoelzl
parents: 50095
diff changeset
   587
  interpret prob_space "P {}" using proj_prob_space by simp
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   588
  assume "J = {}"
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   589
  moreover have "emb I {} {\<lambda>x. undefined} = space (lim\<^isub>B I P)"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   590
    by (auto simp: space_PiM prod_emb_def)
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   591
  moreover have "{\<lambda>x. undefined} = space (lim\<^isub>B {} P)"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   592
    by (auto simp: space_PiM prod_emb_def)
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   593
  ultimately show ?thesis
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   594
    by (simp add: P.emeasure_space_1 limP_finite emeasure_space_1 del: space_limP)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   595
next
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   596
  assume "J \<noteq> {}" with X show ?thesis
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   597
    by (subst emeasure_limB_emb_not_empty) (auto simp: limP_finite)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   598
qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   599
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   600
lemma measure_limB_emb:
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   601
  assumes "J \<subseteq> I" "finite J" "\<forall>i\<in>J. B i \<in> sets borel"
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   602
  shows "measure (lim\<^isub>B I P) (emb I J (Pi\<^isub>E J B)) = measure (P J) (Pi\<^isub>E J B)"
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   603
proof -
50101
a3bede207a04 renamed prob_space to proj_prob_space as it clashed with Probability_Measure.prob_space
hoelzl
parents: 50095
diff changeset
   604
  interpret prob_space "P J" using proj_prob_space assms by simp
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   605
  show ?thesis
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   606
    using emeasure_limB_emb[OF assms]
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   607
    unfolding emeasure_eq_measure limP_finite[OF `finite J` `J \<subseteq> I`] P.emeasure_eq_measure
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   608
    by simp
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   609
qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   610
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   611
end
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   612
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   613
locale polish_product_prob_space =
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   614
  product_prob_space "\<lambda>_. borel::('a::polish_space) measure" I for I::"'i set"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   615
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   616
sublocale polish_product_prob_space \<subseteq> P: polish_projective I "\<lambda>J. PiM J (\<lambda>_. borel::('a) measure)"
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   617
proof qed
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   618
50125
4319691be975 tuned: use induction rule sigma_sets_induct_disjoint
hoelzl
parents: 50124
diff changeset
   619
lemma (in polish_product_prob_space) limP_eq_PiM:
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   620
  "I \<noteq> {} \<Longrightarrow> lim\<^isub>P I (\<lambda>_. borel) (\<lambda>J. PiM J (\<lambda>_. borel::('a) measure)) =
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   621
    PiM I (\<lambda>_. borel)"
50095
94d7dfa9f404 renamed to more appropriate lim_P for projective limit
immler
parents: 50091
diff changeset
   622
  by (rule PiM_eq) (auto simp: emeasure_PiM emeasure_limB_emb)
50088
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   623
32d1795cc77a added projective limit;
immler
parents:
diff changeset
   624
end