src/HOL/Probability/Borel.thy
changeset 39092 98de40859858
parent 39087 96984bf6fa5b
child 39198 f967a16dfcdd
equal deleted inserted replaced
39091:11314c196e11 39092:98de40859858
     3 header {*Borel spaces*}
     3 header {*Borel spaces*}
     4 
     4 
     5 theory Borel
     5 theory Borel
     6   imports Sigma_Algebra Positive_Infinite_Real Multivariate_Analysis
     6   imports Sigma_Algebra Positive_Infinite_Real Multivariate_Analysis
     7 begin
     7 begin
       
     8 
       
     9 lemma LIMSEQ_max:
       
    10   "u ----> (x::real) \<Longrightarrow> (\<lambda>i. max (u i) 0) ----> max x 0"
       
    11   by (fastsimp intro!: LIMSEQ_I dest!: LIMSEQ_D)
     8 
    12 
     9 section "Generic Borel spaces"
    13 section "Generic Borel spaces"
    10 
    14 
    11 definition "borel_space = sigma (UNIV::'a::topological_space set) open"
    15 definition "borel_space = sigma (UNIV::'a::topological_space set) open"
    12 abbreviation "borel_measurable M \<equiv> measurable M borel_space"
    16 abbreviation "borel_measurable M \<equiv> measurable M borel_space"
   102       by (metis borel_space.top borel_space_def_raw mem_def space_sigma)
   106       by (metis borel_space.top borel_space_def_raw mem_def space_sigma)
   103     ultimately show ?case
   107     ultimately show ?case
   104       by (auto simp: vimage_Diff borel_space.Diff)
   108       by (auto simp: vimage_Diff borel_space.Diff)
   105   qed (auto simp add: vimage_UN)
   109   qed (auto simp add: vimage_UN)
   106 qed
   110 qed
       
   111 
       
   112 lemma (in sigma_algebra) borel_measurable_restricted:
       
   113   fixes f :: "'a \<Rightarrow> 'x\<Colon>{topological_space, semiring_1}" assumes "A \<in> sets M"
       
   114   shows "f \<in> borel_measurable (restricted_space A) \<longleftrightarrow>
       
   115     (\<lambda>x. f x * indicator A x) \<in> borel_measurable M"
       
   116     (is "f \<in> borel_measurable ?R \<longleftrightarrow> ?f \<in> borel_measurable M")
       
   117 proof -
       
   118   interpret R: sigma_algebra ?R by (rule restricted_sigma_algebra[OF `A \<in> sets M`])
       
   119   have *: "f \<in> borel_measurable ?R \<longleftrightarrow> ?f \<in> borel_measurable ?R"
       
   120     by (auto intro!: measurable_cong)
       
   121   show ?thesis unfolding *
       
   122     unfolding in_borel_measurable_borel_space
       
   123   proof (simp, safe)
       
   124     fix S :: "'x set" assume "S \<in> sets borel_space"
       
   125       "\<forall>S\<in>sets borel_space. ?f -` S \<inter> A \<in> op \<inter> A ` sets M"
       
   126     then have "?f -` S \<inter> A \<in> op \<inter> A ` sets M" by auto
       
   127     then have f: "?f -` S \<inter> A \<in> sets M"
       
   128       using `A \<in> sets M` sets_into_space by fastsimp
       
   129     show "?f -` S \<inter> space M \<in> sets M"
       
   130     proof cases
       
   131       assume "0 \<in> S"
       
   132       then have "?f -` S \<inter> space M = ?f -` S \<inter> A \<union> (space M - A)"
       
   133         using `A \<in> sets M` sets_into_space by auto
       
   134       then show ?thesis using f `A \<in> sets M` by (auto intro!: Un Diff)
       
   135     next
       
   136       assume "0 \<notin> S"
       
   137       then have "?f -` S \<inter> space M = ?f -` S \<inter> A"
       
   138         using `A \<in> sets M` sets_into_space
       
   139         by (auto simp: indicator_def split: split_if_asm)
       
   140       then show ?thesis using f by auto
       
   141     qed
       
   142   next
       
   143     fix S :: "'x set" assume "S \<in> sets borel_space"
       
   144       "\<forall>S\<in>sets borel_space. ?f -` S \<inter> space M \<in> sets M"
       
   145     then have f: "?f -` S \<inter> space M \<in> sets M" by auto
       
   146     then show "?f -` S \<inter> A \<in> op \<inter> A ` sets M"
       
   147       using `A \<in> sets M` sets_into_space
       
   148       apply (simp add: image_iff)
       
   149       apply (rule bexI[OF _ f])
       
   150       by auto
       
   151   qed
       
   152 qed
       
   153 
       
   154 lemma (in sigma_algebra) borel_measurable_subalgebra:
       
   155   assumes "N \<subseteq> sets M" "f \<in> borel_measurable (M\<lparr>sets:=N\<rparr>)"
       
   156   shows "f \<in> borel_measurable M"
       
   157   using assms unfolding measurable_def by auto
   107 
   158 
   108 section "Borel spaces on euclidean spaces"
   159 section "Borel spaces on euclidean spaces"
   109 
   160 
   110 lemma lessThan_borel[simp, intro]:
   161 lemma lessThan_borel[simp, intro]:
   111   fixes a :: "'a\<Colon>ordered_euclidean_space"
   162   fixes a :: "'a\<Colon>ordered_euclidean_space"
  1292     by (simp add: pinfreal_less_minus_iff)
  1343     by (simp add: pinfreal_less_minus_iff)
  1293   then show "{x \<in> space M. a < f x - g x} \<in> sets M"
  1344   then show "{x \<in> space M. a < f x - g x} \<in> sets M"
  1294     using assms by auto
  1345     using assms by auto
  1295 qed
  1346 qed
  1296 
  1347 
       
  1348 lemma (in sigma_algebra) borel_measurable_psuminf:
       
  1349   assumes "\<And>i. f i \<in> borel_measurable M"
       
  1350   shows "(\<lambda>x. (\<Sum>\<^isub>\<infinity> i. f i x)) \<in> borel_measurable M"
       
  1351   using assms unfolding psuminf_def
       
  1352   by (auto intro!: borel_measurable_SUP[unfolded SUPR_fun_expand])
       
  1353 
       
  1354 section "LIMSEQ is borel measurable"
       
  1355 
       
  1356 lemma (in sigma_algebra) borel_measurable_LIMSEQ:
       
  1357   fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> real"
       
  1358   assumes u': "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. u i x) ----> u' x"
       
  1359   and u: "\<And>i. u i \<in> borel_measurable M"
       
  1360   shows "u' \<in> borel_measurable M"
       
  1361 proof -
       
  1362   let "?pu x i" = "max (u i x) 0"
       
  1363   let "?nu x i" = "max (- u i x) 0"
       
  1364 
       
  1365   { fix x assume x: "x \<in> space M"
       
  1366     have "(?pu x) ----> max (u' x) 0"
       
  1367       "(?nu x) ----> max (- u' x) 0"
       
  1368       using u'[OF x] by (auto intro!: LIMSEQ_max LIMSEQ_minus)
       
  1369     from LIMSEQ_imp_lim_INF[OF _ this(1)] LIMSEQ_imp_lim_INF[OF _ this(2)]
       
  1370     have "(SUP n. INF m. Real (u (n + m) x)) = Real (u' x)"
       
  1371       "(SUP n. INF m. Real (- u (n + m) x)) = Real (- u' x)"
       
  1372       by (simp_all add: Real_max'[symmetric]) }
       
  1373   note eq = this
       
  1374 
       
  1375   have *: "\<And>x. real (Real (u' x)) - real (Real (- u' x)) = u' x"
       
  1376     by auto
       
  1377 
       
  1378   have "(SUP n. INF m. (\<lambda>x. Real (u (n + m) x))) \<in> borel_measurable M"
       
  1379        "(SUP n. INF m. (\<lambda>x. Real (- u (n + m) x))) \<in> borel_measurable M"
       
  1380     using u by (auto intro: borel_measurable_SUP borel_measurable_INF borel_measurable_Real)
       
  1381   with eq[THEN measurable_cong, of M "\<lambda>x. x" borel_space]
       
  1382   have "(\<lambda>x. Real (u' x)) \<in> borel_measurable M"
       
  1383        "(\<lambda>x. Real (- u' x)) \<in> borel_measurable M"
       
  1384     unfolding SUPR_fun_expand INFI_fun_expand by auto
       
  1385   note this[THEN borel_measurable_real]
       
  1386   from borel_measurable_diff[OF this]
       
  1387   show ?thesis unfolding * .
       
  1388 qed
       
  1389 
  1297 end
  1390 end