src/HOL/Probability/Borel_Space.thy
author haftmann
Wed, 08 Dec 2010 16:47:45 +0100
changeset 41083 c987429a1298
parent 41080 294956ff285b
child 41096 843c40bbc379
permissions -rw-r--r--
work around problems with eta-expansion of equations
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
     1
(* Author: Armin Heller, Johannes Hoelzl, TU Muenchen *)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
     2
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
     3
header {*Borel spaces*}
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
     4
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
     5
theory Borel_Space
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
     6
  imports Sigma_Algebra Positive_Extended_Real Multivariate_Analysis
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
     7
begin
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
     8
39092
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
     9
lemma LIMSEQ_max:
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
    10
  "u ----> (x::real) \<Longrightarrow> (\<lambda>i. max (u i) 0) ----> max x 0"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
    11
  by (fastsimp intro!: LIMSEQ_I dest!: LIMSEQ_D)
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
    12
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    13
section "Generic Borel spaces"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    14
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    15
definition "borel = sigma \<lparr> space = UNIV::'a::topological_space set, sets = open\<rparr>"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    16
abbreviation "borel_measurable M \<equiv> measurable M borel"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    17
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    18
interpretation borel: sigma_algebra borel
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    19
  by (auto simp: borel_def intro!: sigma_algebra_sigma)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    20
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    21
lemma in_borel_measurable:
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    22
   "f \<in> borel_measurable M \<longleftrightarrow>
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    23
    (\<forall>S \<in> sets (sigma \<lparr> space = UNIV, sets = open\<rparr>).
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    24
      f -` S \<inter> space M \<in> sets M)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    25
  by (auto simp add: measurable_def borel_def)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    26
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    27
lemma in_borel_measurable_borel:
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    28
   "f \<in> borel_measurable M \<longleftrightarrow>
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    29
    (\<forall>S \<in> sets borel.
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    30
      f -` S \<inter> space M \<in> sets M)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    31
  by (auto simp add: measurable_def borel_def)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    32
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    33
lemma space_borel[simp]: "space borel = UNIV"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    34
  unfolding borel_def by auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    35
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    36
lemma borel_open[simp]:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    37
  assumes "open A" shows "A \<in> sets borel"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    38
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    39
  have "A \<in> open" unfolding mem_def using assms .
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    40
  thus ?thesis unfolding borel_def sigma_def by (auto intro!: sigma_sets.Basic)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    41
qed
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    42
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    43
lemma borel_closed[simp]:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    44
  assumes "closed A" shows "A \<in> sets borel"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    45
proof -
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    46
  have "space borel - (- A) \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    47
    using assms unfolding closed_def by (blast intro: borel_open)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    48
  thus ?thesis by simp
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    49
qed
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    50
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    51
lemma (in sigma_algebra) borel_measurable_vimage:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    52
  fixes f :: "'a \<Rightarrow> 'x::t2_space"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    53
  assumes borel: "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    54
  shows "f -` {x} \<inter> space M \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    55
proof (cases "x \<in> f ` space M")
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    56
  case True then obtain y where "x = f y" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    57
  from closed_sing[of "f y"]
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    58
  have "{f y} \<in> sets borel" by (rule borel_closed)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    59
  with assms show ?thesis
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    60
    unfolding in_borel_measurable_borel `x = f y` by auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    61
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    62
  case False hence "f -` {x} \<inter> space M = {}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    63
  thus ?thesis by auto
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    64
qed
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    65
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    66
lemma (in sigma_algebra) borel_measurableI:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    67
  fixes f :: "'a \<Rightarrow> 'x\<Colon>topological_space"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    68
  assumes "\<And>S. open S \<Longrightarrow> f -` S \<inter> space M \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    69
  shows "f \<in> borel_measurable M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    70
  unfolding borel_def
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    71
proof (rule measurable_sigma, simp_all)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    72
  fix S :: "'x set" assume "S \<in> open" thus "f -` S \<inter> space M \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    73
    using assms[of S] by (simp add: mem_def)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    74
qed
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    75
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    76
lemma borel_singleton[simp, intro]:
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    77
  fixes x :: "'a::t1_space"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    78
  shows "A \<in> sets borel \<Longrightarrow> insert x A \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    79
  proof (rule borel.insert_in_sets)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    80
    show "{x} \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    81
      using closed_sing[of x] by (rule borel_closed)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    82
  qed simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    83
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    84
lemma (in sigma_algebra) borel_measurable_const[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    85
  "(\<lambda>x. c) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    86
  by (auto intro!: measurable_const)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    87
39083
e46acc0ea1fe introduced integration on subalgebras
hoelzl
parents: 38705
diff changeset
    88
lemma (in sigma_algebra) borel_measurable_indicator[simp, intro!]:
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    89
  assumes A: "A \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    90
  shows "indicator A \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    91
  unfolding indicator_def_raw using A
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
    92
  by (auto intro!: measurable_If_set borel_measurable_const)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
    93
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    94
lemma (in sigma_algebra) borel_measurable_indicator_iff:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    95
  "(indicator A :: 'a \<Rightarrow> 'x::{t1_space, zero_neq_one}) \<in> borel_measurable M \<longleftrightarrow> A \<inter> space M \<in> sets M"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    96
    (is "?I \<in> borel_measurable M \<longleftrightarrow> _")
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    97
proof
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    98
  assume "?I \<in> borel_measurable M"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
    99
  then have "?I -` {1} \<inter> space M \<in> sets M"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   100
    unfolding measurable_def by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   101
  also have "?I -` {1} \<inter> space M = A \<inter> space M"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   102
    unfolding indicator_def_raw by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   103
  finally show "A \<inter> space M \<in> sets M" .
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   104
next
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   105
  assume "A \<inter> space M \<in> sets M"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   106
  moreover have "?I \<in> borel_measurable M \<longleftrightarrow>
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   107
    (indicator (A \<inter> space M) :: 'a \<Rightarrow> 'x) \<in> borel_measurable M"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   108
    by (intro measurable_cong) (auto simp: indicator_def)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   109
  ultimately show "?I \<in> borel_measurable M" by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   110
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   111
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   112
lemma borel_measurable_translate:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   113
  assumes "A \<in> sets borel" and trans: "\<And>B. open B \<Longrightarrow> f -` B \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   114
  shows "f -` A \<in> sets borel"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   115
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   116
  have "A \<in> sigma_sets UNIV open" using assms
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   117
    by (simp add: borel_def sigma_def)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   118
  thus ?thesis
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   119
  proof (induct rule: sigma_sets.induct)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   120
    case (Basic a) thus ?case using trans[of a] by (simp add: mem_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   121
  next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   122
    case (Compl a)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   123
    moreover have "UNIV \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   124
      using borel.top by simp
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   125
    ultimately show ?case
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   126
      by (auto simp: vimage_Diff borel.Diff)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   127
  qed (auto simp add: vimage_UN)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   128
qed
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   129
39092
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   130
lemma (in sigma_algebra) borel_measurable_restricted:
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   131
  fixes f :: "'a \<Rightarrow> 'x\<Colon>{topological_space, semiring_1}" assumes "A \<in> sets M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   132
  shows "f \<in> borel_measurable (restricted_space A) \<longleftrightarrow>
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   133
    (\<lambda>x. f x * indicator A x) \<in> borel_measurable M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   134
    (is "f \<in> borel_measurable ?R \<longleftrightarrow> ?f \<in> borel_measurable M")
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   135
proof -
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   136
  interpret R: sigma_algebra ?R by (rule restricted_sigma_algebra[OF `A \<in> sets M`])
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   137
  have *: "f \<in> borel_measurable ?R \<longleftrightarrow> ?f \<in> borel_measurable ?R"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   138
    by (auto intro!: measurable_cong)
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   139
  show ?thesis unfolding *
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   140
    unfolding in_borel_measurable_borel
39092
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   141
  proof (simp, safe)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   142
    fix S :: "'x set" assume "S \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   143
      "\<forall>S\<in>sets borel. ?f -` S \<inter> A \<in> op \<inter> A ` sets M"
39092
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   144
    then have "?f -` S \<inter> A \<in> op \<inter> A ` sets M" by auto
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   145
    then have f: "?f -` S \<inter> A \<in> sets M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   146
      using `A \<in> sets M` sets_into_space by fastsimp
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   147
    show "?f -` S \<inter> space M \<in> sets M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   148
    proof cases
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   149
      assume "0 \<in> S"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   150
      then have "?f -` S \<inter> space M = ?f -` S \<inter> A \<union> (space M - A)"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   151
        using `A \<in> sets M` sets_into_space by auto
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   152
      then show ?thesis using f `A \<in> sets M` by (auto intro!: Un Diff)
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   153
    next
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   154
      assume "0 \<notin> S"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   155
      then have "?f -` S \<inter> space M = ?f -` S \<inter> A"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   156
        using `A \<in> sets M` sets_into_space
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   157
        by (auto simp: indicator_def split: split_if_asm)
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   158
      then show ?thesis using f by auto
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   159
    qed
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   160
  next
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   161
    fix S :: "'x set" assume "S \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   162
      "\<forall>S\<in>sets borel. ?f -` S \<inter> space M \<in> sets M"
39092
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   163
    then have f: "?f -` S \<inter> space M \<in> sets M" by auto
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   164
    then show "?f -` S \<inter> A \<in> op \<inter> A ` sets M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   165
      using `A \<in> sets M` sets_into_space
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   166
      apply (simp add: image_iff)
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   167
      apply (rule bexI[OF _ f])
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   168
      by auto
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   169
  qed
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   170
qed
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   171
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   172
lemma (in sigma_algebra) borel_measurable_subalgebra:
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   173
  assumes "N \<subseteq> sets M" "f \<in> borel_measurable (M\<lparr>sets:=N\<rparr>)"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   174
  shows "f \<in> borel_measurable M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   175
  using assms unfolding measurable_def by auto
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
   176
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   177
section "Borel spaces on euclidean spaces"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   178
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   179
lemma lessThan_borel[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   180
  fixes a :: "'a\<Colon>ordered_euclidean_space"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   181
  shows "{..< a} \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   182
  by (blast intro: borel_open)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   183
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   184
lemma greaterThan_borel[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   185
  fixes a :: "'a\<Colon>ordered_euclidean_space"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   186
  shows "{a <..} \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   187
  by (blast intro: borel_open)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   188
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   189
lemma greaterThanLessThan_borel[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   190
  fixes a b :: "'a\<Colon>ordered_euclidean_space"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   191
  shows "{a<..<b} \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   192
  by (blast intro: borel_open)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   193
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   194
lemma atMost_borel[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   195
  fixes a :: "'a\<Colon>ordered_euclidean_space"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   196
  shows "{..a} \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   197
  by (blast intro: borel_closed)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   198
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   199
lemma atLeast_borel[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   200
  fixes a :: "'a\<Colon>ordered_euclidean_space"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   201
  shows "{a..} \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   202
  by (blast intro: borel_closed)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   203
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   204
lemma atLeastAtMost_borel[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   205
  fixes a b :: "'a\<Colon>ordered_euclidean_space"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   206
  shows "{a..b} \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   207
  by (blast intro: borel_closed)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   208
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   209
lemma greaterThanAtMost_borel[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   210
  fixes a b :: "'a\<Colon>ordered_euclidean_space"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   211
  shows "{a<..b} \<in> sets borel"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   212
  unfolding greaterThanAtMost_def by blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   213
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   214
lemma atLeastLessThan_borel[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   215
  fixes a b :: "'a\<Colon>ordered_euclidean_space"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   216
  shows "{a..<b} \<in> sets borel"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   217
  unfolding atLeastLessThan_def by blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   218
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   219
lemma hafspace_less_borel[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   220
  fixes a :: real
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   221
  shows "{x::'a::euclidean_space. a < x $$ i} \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   222
  by (auto intro!: borel_open open_halfspace_component_gt)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   223
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   224
lemma hafspace_greater_borel[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   225
  fixes a :: real
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   226
  shows "{x::'a::euclidean_space. x $$ i < a} \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   227
  by (auto intro!: borel_open open_halfspace_component_lt)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   228
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   229
lemma hafspace_less_eq_borel[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   230
  fixes a :: real
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   231
  shows "{x::'a::euclidean_space. a \<le> x $$ i} \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   232
  by (auto intro!: borel_closed closed_halfspace_component_ge)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   233
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   234
lemma hafspace_greater_eq_borel[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   235
  fixes a :: real
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   236
  shows "{x::'a::euclidean_space. x $$ i \<le> a} \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   237
  by (auto intro!: borel_closed closed_halfspace_component_le)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   238
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   239
lemma (in sigma_algebra) borel_measurable_less[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   240
  fixes f :: "'a \<Rightarrow> real"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   241
  assumes f: "f \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   242
  assumes g: "g \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   243
  shows "{w \<in> space M. f w < g w} \<in> sets M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   244
proof -
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   245
  have "{w \<in> space M. f w < g w} =
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   246
        (\<Union>r. (f -` {..< of_rat r} \<inter> space M) \<inter> (g -` {of_rat r <..} \<inter> space M))"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   247
    using Rats_dense_in_real by (auto simp add: Rats_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   248
  then show ?thesis using f g
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   249
    by simp (blast intro: measurable_sets)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   250
qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   251
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   252
lemma (in sigma_algebra) borel_measurable_le[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   253
  fixes f :: "'a \<Rightarrow> real"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   254
  assumes f: "f \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   255
  assumes g: "g \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   256
  shows "{w \<in> space M. f w \<le> g w} \<in> sets M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   257
proof -
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   258
  have "{w \<in> space M. f w \<le> g w} = space M - {w \<in> space M. g w < f w}"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   259
    by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   260
  thus ?thesis using f g
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   261
    by simp blast
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   262
qed
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   263
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   264
lemma (in sigma_algebra) borel_measurable_eq[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   265
  fixes f :: "'a \<Rightarrow> real"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   266
  assumes f: "f \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   267
  assumes g: "g \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   268
  shows "{w \<in> space M. f w = g w} \<in> sets M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   269
proof -
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   270
  have "{w \<in> space M. f w = g w} =
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33535
diff changeset
   271
        {w \<in> space M. f w \<le> g w} \<inter> {w \<in> space M. g w \<le> f w}"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   272
    by auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   273
  thus ?thesis using f g by auto
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   274
qed
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   275
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   276
lemma (in sigma_algebra) borel_measurable_neq[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   277
  fixes f :: "'a \<Rightarrow> real"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   278
  assumes f: "f \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   279
  assumes g: "g \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   280
  shows "{w \<in> space M. f w \<noteq> g w} \<in> sets M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   281
proof -
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   282
  have "{w \<in> space M. f w \<noteq> g w} = space M - {w \<in> space M. f w = g w}"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   283
    by auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   284
  thus ?thesis using f g by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   285
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   286
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   287
subsection "Borel space equals sigma algebras over intervals"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   288
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   289
lemma rational_boxes:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   290
  fixes x :: "'a\<Colon>ordered_euclidean_space"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   291
  assumes "0 < e"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   292
  shows "\<exists>a b. (\<forall>i. a $$ i \<in> \<rat>) \<and> (\<forall>i. b $$ i \<in> \<rat>) \<and> x \<in> {a <..< b} \<and> {a <..< b} \<subseteq> ball x e"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   293
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   294
  def e' \<equiv> "e / (2 * sqrt (real (DIM ('a))))"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   295
  then have e: "0 < e'" using assms by (auto intro!: divide_pos_pos)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   296
  have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> y < x $$ i \<and> x $$ i - y < e'" (is "\<forall>i. ?th i")
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   297
  proof
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   298
    fix i from Rats_dense_in_real[of "x $$ i - e'" "x $$ i"] e
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   299
    show "?th i" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   300
  qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   301
  from choice[OF this] guess a .. note a = this
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   302
  have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> x $$ i < y \<and> y - x $$ i < e'" (is "\<forall>i. ?th i")
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   303
  proof
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   304
    fix i from Rats_dense_in_real[of "x $$ i" "x $$ i + e'"] e
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   305
    show "?th i" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   306
  qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   307
  from choice[OF this] guess b .. note b = this
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   308
  { fix y :: 'a assume *: "Chi a < y" "y < Chi b"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   309
    have "dist x y = sqrt (\<Sum>i<DIM('a). (dist (x $$ i) (y $$ i))\<twosuperior>)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   310
      unfolding setL2_def[symmetric] by (rule euclidean_dist_l2)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   311
    also have "\<dots> < sqrt (\<Sum>i<DIM('a). e^2 / real (DIM('a)))"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   312
    proof (rule real_sqrt_less_mono, rule setsum_strict_mono)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   313
      fix i assume i: "i \<in> {..<DIM('a)}"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   314
      have "a i < y$$i \<and> y$$i < b i" using * i eucl_less[where 'a='a] by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   315
      moreover have "a i < x$$i" "x$$i - a i < e'" using a by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   316
      moreover have "x$$i < b i" "b i - x$$i < e'" using b by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   317
      ultimately have "\<bar>x$$i - y$$i\<bar> < 2 * e'" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   318
      then have "dist (x $$ i) (y $$ i) < e/sqrt (real (DIM('a)))"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   319
        unfolding e'_def by (auto simp: dist_real_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   320
      then have "(dist (x $$ i) (y $$ i))\<twosuperior> < (e/sqrt (real (DIM('a))))\<twosuperior>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   321
        by (rule power_strict_mono) auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   322
      then show "(dist (x $$ i) (y $$ i))\<twosuperior> < e\<twosuperior> / real DIM('a)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   323
        by (simp add: power_divide)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   324
    qed auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   325
    also have "\<dots> = e" using `0 < e` by (simp add: real_eq_of_nat DIM_positive)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   326
    finally have "dist x y < e" . }
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   327
  with a b show ?thesis
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   328
    apply (rule_tac exI[of _ "Chi a"])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   329
    apply (rule_tac exI[of _ "Chi b"])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   330
    using eucl_less[where 'a='a] by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   331
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   332
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   333
lemma ex_rat_list:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   334
  fixes x :: "'a\<Colon>ordered_euclidean_space"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   335
  assumes "\<And> i. x $$ i \<in> \<rat>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   336
  shows "\<exists> r. length r = DIM('a) \<and> (\<forall> i < DIM('a). of_rat (r ! i) = x $$ i)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   337
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   338
  have "\<forall>i. \<exists>r. x $$ i = of_rat r" using assms unfolding Rats_def by blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   339
  from choice[OF this] guess r ..
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   340
  then show ?thesis by (auto intro!: exI[of _ "map r [0 ..< DIM('a)]"])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   341
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   342
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   343
lemma open_UNION:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   344
  fixes M :: "'a\<Colon>ordered_euclidean_space set"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   345
  assumes "open M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   346
  shows "M = UNION {(a, b) | a b. {Chi (of_rat \<circ> op ! a) <..< Chi (of_rat \<circ> op ! b)} \<subseteq> M}
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   347
                   (\<lambda> (a, b). {Chi (of_rat \<circ> op ! a) <..< Chi (of_rat \<circ> op ! b)})"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   348
    (is "M = UNION ?idx ?box")
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   349
proof safe
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   350
  fix x assume "x \<in> M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   351
  obtain e where e: "e > 0" "ball x e \<subseteq> M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   352
    using openE[OF assms `x \<in> M`] by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   353
  then obtain a b where ab: "x \<in> {a <..< b}" "\<And>i. a $$ i \<in> \<rat>" "\<And>i. b $$ i \<in> \<rat>" "{a <..< b} \<subseteq> ball x e"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   354
    using rational_boxes[OF e(1)] by blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   355
  then obtain p q where pq: "length p = DIM ('a)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   356
                            "length q = DIM ('a)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   357
                            "\<forall> i < DIM ('a). of_rat (p ! i) = a $$ i \<and> of_rat (q ! i) = b $$ i"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   358
    using ex_rat_list[OF ab(2)] ex_rat_list[OF ab(3)] by blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   359
  hence p: "Chi (of_rat \<circ> op ! p) = a"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   360
    using euclidean_eq[of "Chi (of_rat \<circ> op ! p)" a]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   361
    unfolding o_def by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   362
  from pq have q: "Chi (of_rat \<circ> op ! q) = b"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   363
    using euclidean_eq[of "Chi (of_rat \<circ> op ! q)" b]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   364
    unfolding o_def by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   365
  have "x \<in> ?box (p, q)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   366
    using p q ab by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   367
  thus "x \<in> UNION ?idx ?box" using ab e p q exI[of _ p] exI[of _ q] by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   368
qed auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   369
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   370
lemma halfspace_span_open:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   371
  "sigma_sets UNIV (range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. x $$ i < a}))
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   372
    \<subseteq> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   373
  by (auto intro!: borel.sigma_sets_subset[simplified] borel_open
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   374
                   open_halfspace_component_lt)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   375
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   376
lemma halfspace_lt_in_halfspace:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   377
  "{x\<Colon>'a. x $$ i < a} \<in> sets (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. x $$ i < a})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   378
  by (auto intro!: sigma_sets.Basic simp: sets_sigma)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   379
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   380
lemma halfspace_gt_in_halfspace:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   381
  "{x\<Colon>'a. a < x $$ i} \<in> sets (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. x $$ i < a})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   382
  (is "?set \<in> sets ?SIGMA")
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   383
proof -
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   384
  interpret sigma_algebra "?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   385
    by (intro sigma_algebra_sigma_sets) (simp_all add: sets_sigma)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   386
  have *: "?set = (\<Union>n. space ?SIGMA - {x\<Colon>'a. x $$ i < a + 1 / real (Suc n)})"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   387
  proof (safe, simp_all add: not_less)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   388
    fix x assume "a < x $$ i"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   389
    with reals_Archimedean[of "x $$ i - a"]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   390
    obtain n where "a + 1 / real (Suc n) < x $$ i"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   391
      by (auto simp: inverse_eq_divide field_simps)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   392
    then show "\<exists>n. a + 1 / real (Suc n) \<le> x $$ i"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   393
      by (blast intro: less_imp_le)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   394
  next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   395
    fix x n
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   396
    have "a < a + 1 / real (Suc n)" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   397
    also assume "\<dots> \<le> x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   398
    finally show "a < x" .
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   399
  qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   400
  show "?set \<in> sets ?SIGMA" unfolding *
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   401
    by (safe intro!: countable_UN Diff halfspace_lt_in_halfspace)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   402
qed
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   403
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   404
lemma open_span_halfspace:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   405
  "sets borel \<subseteq> sets (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x::'a::ordered_euclidean_space. x $$ i < a})\<rparr>)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   406
    (is "_ \<subseteq> sets ?SIGMA")
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   407
proof -
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   408
  have "sigma_algebra ?SIGMA" by (rule sigma_algebra_sigma) simp
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   409
  then interpret sigma_algebra ?SIGMA .
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   410
  { fix S :: "'a set" assume "S \<in> open" then have "open S" unfolding mem_def .
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   411
    from open_UNION[OF this]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   412
    obtain I where *: "S =
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   413
      (\<Union>(a, b)\<in>I.
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   414
          (\<Inter> i<DIM('a). {x. (Chi (real_of_rat \<circ> op ! a)::'a) $$ i < x $$ i}) \<inter>
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   415
          (\<Inter> i<DIM('a). {x. x $$ i < (Chi (real_of_rat \<circ> op ! b)::'a) $$ i}))"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   416
      unfolding greaterThanLessThan_def
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   417
      unfolding eucl_greaterThan_eq_halfspaces[where 'a='a]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   418
      unfolding eucl_lessThan_eq_halfspaces[where 'a='a]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   419
      by blast
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   420
    have "S \<in> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   421
      unfolding *
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   422
      by (auto intro!: countable_UN Int countable_INT halfspace_lt_in_halfspace halfspace_gt_in_halfspace) }
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   423
  then show ?thesis unfolding borel_def
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   424
    by (intro sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   425
qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   426
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   427
lemma halfspace_span_halfspace_le:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   428
  "sets (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. x $$ i < a})\<rparr>) \<subseteq>
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   429
   sets (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x. x $$ i \<le> a})\<rparr>)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   430
  (is "_ \<subseteq> sets ?SIGMA")
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   431
proof -
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   432
  have "sigma_algebra ?SIGMA" by (rule sigma_algebra_sigma) auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   433
  then interpret sigma_algebra ?SIGMA .
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   434
  { fix a i
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   435
    have *: "{x::'a. x$$i < a} = (\<Union>n. {x. x$$i \<le> a - 1/real (Suc n)})"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   436
    proof (safe, simp_all)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   437
      fix x::'a assume *: "x$$i < a"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   438
      with reals_Archimedean[of "a - x$$i"]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   439
      obtain n where "x $$ i < a - 1 / (real (Suc n))"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   440
        by (auto simp: field_simps inverse_eq_divide)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   441
      then show "\<exists>n. x $$ i \<le> a - 1 / (real (Suc n))"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   442
        by (blast intro: less_imp_le)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   443
    next
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   444
      fix x::'a and n
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   445
      assume "x$$i \<le> a - 1 / real (Suc n)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   446
      also have "\<dots> < a" by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   447
      finally show "x$$i < a" .
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   448
    qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   449
    have "{x. x$$i < a} \<in> sets ?SIGMA" unfolding *
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   450
      by (safe intro!: countable_UN)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   451
         (auto simp: sets_sigma intro!: sigma_sets.Basic) }
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   452
  then show ?thesis by (intro sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   453
qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   454
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   455
lemma halfspace_span_halfspace_ge:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   456
  "sets (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. x $$ i < a})\<rparr>) \<subseteq>
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   457
   sets (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x. a \<le> x $$ i})\<rparr>)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   458
  (is "_ \<subseteq> sets ?SIGMA")
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   459
proof -
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   460
  have "sigma_algebra ?SIGMA" by (rule sigma_algebra_sigma) auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   461
  then interpret sigma_algebra ?SIGMA .
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   462
  { fix a i have *: "{x::'a. x$$i < a} = space ?SIGMA - {x::'a. a \<le> x$$i}" by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   463
    have "{x. x$$i < a} \<in> sets ?SIGMA" unfolding *
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   464
      by (safe intro!: Diff)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   465
         (auto simp: sets_sigma intro!: sigma_sets.Basic) }
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   466
  then show ?thesis by (intro sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   467
qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   468
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   469
lemma halfspace_le_span_halfspace_gt:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   470
  "sets (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. x $$ i \<le> a})\<rparr>) \<subseteq>
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   471
   sets (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x. a < x $$ i})\<rparr>)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   472
  (is "_ \<subseteq> sets ?SIGMA")
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   473
proof -
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   474
  have "sigma_algebra ?SIGMA" by (rule sigma_algebra_sigma) auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   475
  then interpret sigma_algebra ?SIGMA .
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   476
  { fix a i have *: "{x::'a. x$$i \<le> a} = space ?SIGMA - {x::'a. a < x$$i}" by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   477
    have "{x. x$$i \<le> a} \<in> sets ?SIGMA" unfolding *
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   478
      by (safe intro!: Diff)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   479
         (auto simp: sets_sigma intro!: sigma_sets.Basic) }
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   480
  then show ?thesis by (intro sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   481
qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   482
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   483
lemma halfspace_le_span_atMost:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   484
  "sets (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. x $$ i \<le> a})\<rparr>) \<subseteq>
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   485
   sets (sigma \<lparr>space=UNIV, sets=range (\<lambda>a. {..a\<Colon>'a\<Colon>ordered_euclidean_space})\<rparr>)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   486
  (is "_ \<subseteq> sets ?SIGMA")
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   487
proof -
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   488
  have "sigma_algebra ?SIGMA" by (rule sigma_algebra_sigma) auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   489
  then interpret sigma_algebra ?SIGMA .
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   490
  have "\<And>a i. {x. x$$i \<le> a} \<in> sets ?SIGMA"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   491
  proof cases
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   492
    fix a i assume "i < DIM('a)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   493
    then have *: "{x::'a. x$$i \<le> a} = (\<Union>k::nat. {.. (\<chi>\<chi> n. if n = i then a else real k)})"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   494
    proof (safe, simp_all add: eucl_le[where 'a='a] split: split_if_asm)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   495
      fix x
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   496
      from real_arch_simple[of "Max ((\<lambda>i. x$$i)`{..<DIM('a)})"] guess k::nat ..
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   497
      then have "\<And>i. i < DIM('a) \<Longrightarrow> x$$i \<le> real k"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   498
        by (subst (asm) Max_le_iff) auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   499
      then show "\<exists>k::nat. \<forall>ia. ia \<noteq> i \<longrightarrow> ia < DIM('a) \<longrightarrow> x $$ ia \<le> real k"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   500
        by (auto intro!: exI[of _ k])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   501
    qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   502
    show "{x. x$$i \<le> a} \<in> sets ?SIGMA" unfolding *
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   503
      by (safe intro!: countable_UN)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   504
         (auto simp: sets_sigma intro!: sigma_sets.Basic)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   505
  next
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   506
    fix a i assume "\<not> i < DIM('a)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   507
    then show "{x. x$$i \<le> a} \<in> sets ?SIGMA"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   508
      using top by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   509
  qed
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   510
  then show ?thesis by (intro sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   511
qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   512
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   513
lemma halfspace_le_span_greaterThan:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   514
  "sets (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. x $$ i \<le> a})\<rparr>) \<subseteq>
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   515
   sets (sigma \<lparr>space=UNIV, sets=range (\<lambda>a. {a<..})\<rparr>)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   516
  (is "_ \<subseteq> sets ?SIGMA")
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   517
proof -
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   518
  have "sigma_algebra ?SIGMA" by (rule sigma_algebra_sigma) auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   519
  then interpret sigma_algebra ?SIGMA .
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   520
  have "\<And>a i. {x. x$$i \<le> a} \<in> sets ?SIGMA"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   521
  proof cases
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   522
    fix a i assume "i < DIM('a)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   523
    have "{x::'a. x$$i \<le> a} = space ?SIGMA - {x::'a. a < x$$i}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   524
    also have *: "{x::'a. a < x$$i} = (\<Union>k::nat. {(\<chi>\<chi> n. if n = i then a else -real k) <..})" using `i <DIM('a)`
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   525
    proof (safe, simp_all add: eucl_less[where 'a='a] split: split_if_asm)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   526
      fix x
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   527
      from real_arch_lt[of "Max ((\<lambda>i. -x$$i)`{..<DIM('a)})"]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   528
      guess k::nat .. note k = this
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   529
      { fix i assume "i < DIM('a)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   530
        then have "-x$$i < real k"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   531
          using k by (subst (asm) Max_less_iff) auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   532
        then have "- real k < x$$i" by simp }
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   533
      then show "\<exists>k::nat. \<forall>ia. ia \<noteq> i \<longrightarrow> ia < DIM('a) \<longrightarrow> -real k < x $$ ia"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   534
        by (auto intro!: exI[of _ k])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   535
    qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   536
    finally show "{x. x$$i \<le> a} \<in> sets ?SIGMA"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   537
      apply (simp only:)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   538
      apply (safe intro!: countable_UN Diff)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   539
      by (auto simp: sets_sigma intro!: sigma_sets.Basic)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   540
  next
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   541
    fix a i assume "\<not> i < DIM('a)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   542
    then show "{x. x$$i \<le> a} \<in> sets ?SIGMA"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   543
      using top by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   544
  qed
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   545
  then show ?thesis by (intro sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   546
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   547
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   548
lemma halfspace_le_span_lessThan:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   549
  "sets (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x\<Colon>'a\<Colon>ordered_euclidean_space. a \<le> x $$ i})\<rparr>) \<subseteq>
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   550
   sets (sigma \<lparr>space=UNIV, sets=range (\<lambda>a. {..<a})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   551
  (is "_ \<subseteq> sets ?SIGMA")
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   552
proof -
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   553
  have "sigma_algebra ?SIGMA" by (rule sigma_algebra_sigma) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   554
  then interpret sigma_algebra ?SIGMA .
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   555
  have "\<And>a i. {x. a \<le> x$$i} \<in> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   556
  proof cases
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   557
    fix a i assume "i < DIM('a)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   558
    have "{x::'a. a \<le> x$$i} = space ?SIGMA - {x::'a. x$$i < a}" by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   559
    also have *: "{x::'a. x$$i < a} = (\<Union>k::nat. {..< (\<chi>\<chi> n. if n = i then a else real k)})" using `i <DIM('a)`
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   560
    proof (safe, simp_all add: eucl_less[where 'a='a] split: split_if_asm)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   561
      fix x
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   562
      from real_arch_lt[of "Max ((\<lambda>i. x$$i)`{..<DIM('a)})"]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   563
      guess k::nat .. note k = this
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   564
      { fix i assume "i < DIM('a)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   565
        then have "x$$i < real k"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   566
          using k by (subst (asm) Max_less_iff) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   567
        then have "x$$i < real k" by simp }
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   568
      then show "\<exists>k::nat. \<forall>ia. ia \<noteq> i \<longrightarrow> ia < DIM('a) \<longrightarrow> x $$ ia < real k"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   569
        by (auto intro!: exI[of _ k])
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   570
    qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   571
    finally show "{x. a \<le> x$$i} \<in> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   572
      apply (simp only:)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   573
      apply (safe intro!: countable_UN Diff)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   574
      by (auto simp: sets_sigma intro!: sigma_sets.Basic)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   575
  next
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   576
    fix a i assume "\<not> i < DIM('a)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   577
    then show "{x. a \<le> x$$i} \<in> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   578
      using top by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   579
  qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   580
  then show ?thesis by (intro sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   581
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   582
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   583
lemma atMost_span_atLeastAtMost:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   584
  "sets (sigma \<lparr>space=UNIV, sets=range (\<lambda>a. {..a\<Colon>'a\<Colon>ordered_euclidean_space})\<rparr>) \<subseteq>
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   585
   sets (sigma \<lparr>space=UNIV, sets=range (\<lambda>(a,b). {a..b})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   586
  (is "_ \<subseteq> sets ?SIGMA")
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   587
proof -
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   588
  have "sigma_algebra ?SIGMA" by (rule sigma_algebra_sigma) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   589
  then interpret sigma_algebra ?SIGMA .
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   590
  { fix a::'a
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   591
    have *: "{..a} = (\<Union>n::nat. {- real n *\<^sub>R One .. a})"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   592
    proof (safe, simp_all add: eucl_le[where 'a='a])
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   593
      fix x
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   594
      from real_arch_simple[of "Max ((\<lambda>i. - x$$i)`{..<DIM('a)})"]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   595
      guess k::nat .. note k = this
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   596
      { fix i assume "i < DIM('a)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   597
        with k have "- x$$i \<le> real k"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   598
          by (subst (asm) Max_le_iff) (auto simp: field_simps)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   599
        then have "- real k \<le> x$$i" by simp }
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   600
      then show "\<exists>n::nat. \<forall>i<DIM('a). - real n \<le> x $$ i"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   601
        by (auto intro!: exI[of _ k])
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   602
    qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   603
    have "{..a} \<in> sets ?SIGMA" unfolding *
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   604
      by (safe intro!: countable_UN)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   605
         (auto simp: sets_sigma intro!: sigma_sets.Basic) }
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   606
  then show ?thesis by (intro sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   607
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   608
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   609
lemma borel_eq_atMost:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   610
  "borel = (sigma \<lparr>space=UNIV, sets=range (\<lambda> a. {.. a::'a\<Colon>ordered_euclidean_space})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   611
    (is "_ = ?SIGMA")
40869
251df82c0088 Replace algebra_eqI by algebra.equality;
hoelzl
parents: 40859
diff changeset
   612
proof (intro algebra.equality antisym)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   613
  show "sets borel \<subseteq> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   614
    using halfspace_le_span_atMost halfspace_span_halfspace_le open_span_halfspace
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   615
    by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   616
  show "sets ?SIGMA \<subseteq> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   617
    by (rule borel.sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   618
qed auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   619
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   620
lemma borel_eq_atLeastAtMost:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   621
  "borel = (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a :: 'a\<Colon>ordered_euclidean_space, b). {a .. b})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   622
   (is "_ = ?SIGMA")
40869
251df82c0088 Replace algebra_eqI by algebra.equality;
hoelzl
parents: 40859
diff changeset
   623
proof (intro algebra.equality antisym)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   624
  show "sets borel \<subseteq> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   625
    using atMost_span_atLeastAtMost halfspace_le_span_atMost
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   626
      halfspace_span_halfspace_le open_span_halfspace
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   627
    by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   628
  show "sets ?SIGMA \<subseteq> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   629
    by (rule borel.sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   630
qed auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   631
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   632
lemma borel_eq_greaterThan:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   633
  "borel = (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a :: 'a\<Colon>ordered_euclidean_space). {a <..})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   634
   (is "_ = ?SIGMA")
40869
251df82c0088 Replace algebra_eqI by algebra.equality;
hoelzl
parents: 40859
diff changeset
   635
proof (intro algebra.equality antisym)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   636
  show "sets borel \<subseteq> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   637
    using halfspace_le_span_greaterThan
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   638
      halfspace_span_halfspace_le open_span_halfspace
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   639
    by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   640
  show "sets ?SIGMA \<subseteq> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   641
    by (rule borel.sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   642
qed auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   643
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   644
lemma borel_eq_lessThan:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   645
  "borel = (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a :: 'a\<Colon>ordered_euclidean_space). {..< a})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   646
   (is "_ = ?SIGMA")
40869
251df82c0088 Replace algebra_eqI by algebra.equality;
hoelzl
parents: 40859
diff changeset
   647
proof (intro algebra.equality antisym)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   648
  show "sets borel \<subseteq> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   649
    using halfspace_le_span_lessThan
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   650
      halfspace_span_halfspace_ge open_span_halfspace
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   651
    by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   652
  show "sets ?SIGMA \<subseteq> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   653
    by (rule borel.sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   654
qed auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   655
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   656
lemma borel_eq_greaterThanLessThan:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   657
  "borel = (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, b). {a <..< (b :: 'a \<Colon> ordered_euclidean_space)})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   658
    (is "_ = ?SIGMA")
40869
251df82c0088 Replace algebra_eqI by algebra.equality;
hoelzl
parents: 40859
diff changeset
   659
proof (intro algebra.equality antisym)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   660
  show "sets ?SIGMA \<subseteq> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   661
    by (rule borel.sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   662
  show "sets borel \<subseteq> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   663
  proof -
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   664
    have "sigma_algebra ?SIGMA" by (rule sigma_algebra_sigma) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   665
    then interpret sigma_algebra ?SIGMA .
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   666
    { fix M :: "'a set" assume "M \<in> open"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   667
      then have "open M" by (simp add: mem_def)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   668
      have "M \<in> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   669
        apply (subst open_UNION[OF `open M`])
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   670
        apply (safe intro!: countable_UN)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   671
        by (auto simp add: sigma_def intro!: sigma_sets.Basic) }
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   672
    then show ?thesis
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   673
      unfolding borel_def by (intro sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   674
  qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   675
qed auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   676
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   677
lemma borel_eq_halfspace_le:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   678
  "borel = (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x::'a::ordered_euclidean_space. x$$i \<le> a})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   679
   (is "_ = ?SIGMA")
40869
251df82c0088 Replace algebra_eqI by algebra.equality;
hoelzl
parents: 40859
diff changeset
   680
proof (intro algebra.equality antisym)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   681
  show "sets borel \<subseteq> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   682
    using open_span_halfspace halfspace_span_halfspace_le by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   683
  show "sets ?SIGMA \<subseteq> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   684
    by (rule borel.sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   685
qed auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   686
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   687
lemma borel_eq_halfspace_less:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   688
  "borel = (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x::'a::ordered_euclidean_space. x$$i < a})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   689
   (is "_ = ?SIGMA")
40869
251df82c0088 Replace algebra_eqI by algebra.equality;
hoelzl
parents: 40859
diff changeset
   690
proof (intro algebra.equality antisym)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   691
  show "sets borel \<subseteq> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   692
    using open_span_halfspace .
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   693
  show "sets ?SIGMA \<subseteq> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   694
    by (rule borel.sets_sigma_subset) auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   695
qed auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   696
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   697
lemma borel_eq_halfspace_gt:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   698
  "borel = (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x::'a::ordered_euclidean_space. a < x$$i})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   699
   (is "_ = ?SIGMA")
40869
251df82c0088 Replace algebra_eqI by algebra.equality;
hoelzl
parents: 40859
diff changeset
   700
proof (intro algebra.equality antisym)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   701
  show "sets borel \<subseteq> sets ?SIGMA"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   702
    using halfspace_le_span_halfspace_gt open_span_halfspace halfspace_span_halfspace_le by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   703
  show "sets ?SIGMA \<subseteq> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   704
    by (rule borel.sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   705
qed auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   706
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   707
lemma borel_eq_halfspace_ge:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   708
  "borel = (sigma \<lparr>space=UNIV, sets=range (\<lambda> (a, i). {x::'a::ordered_euclidean_space. a \<le> x$$i})\<rparr>)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   709
   (is "_ = ?SIGMA")
40869
251df82c0088 Replace algebra_eqI by algebra.equality;
hoelzl
parents: 40859
diff changeset
   710
proof (intro algebra.equality antisym)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   711
  show "sets borel \<subseteq> sets ?SIGMA"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   712
    using halfspace_span_halfspace_ge open_span_halfspace by auto
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   713
  show "sets ?SIGMA \<subseteq> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   714
    by (rule borel.sets_sigma_subset) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   715
qed auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   716
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   717
lemma (in sigma_algebra) borel_measurable_halfspacesI:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   718
  fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   719
  assumes "borel = (sigma \<lparr>space=UNIV, sets=range F\<rparr>)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   720
  and "\<And>a i. S a i = f -` F (a,i) \<inter> space M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   721
  and "\<And>a i. \<not> i < DIM('c) \<Longrightarrow> S a i \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   722
  shows "f \<in> borel_measurable M = (\<forall>i<DIM('c). \<forall>a::real. S a i \<in> sets M)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   723
proof safe
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   724
  fix a :: real and i assume i: "i < DIM('c)" and f: "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   725
  then show "S a i \<in> sets M" unfolding assms
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   726
    by (auto intro!: measurable_sets sigma_sets.Basic simp: assms(1) sigma_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   727
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   728
  assume a: "\<forall>i<DIM('c). \<forall>a. S a i \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   729
  { fix a i have "S a i \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   730
    proof cases
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   731
      assume "i < DIM('c)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   732
      with a show ?thesis unfolding assms(2) by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   733
    next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   734
      assume "\<not> i < DIM('c)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   735
      from assms(3)[OF this] show ?thesis .
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   736
    qed }
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   737
  then have "f \<in> measurable M (sigma \<lparr>space=UNIV, sets=range F\<rparr>)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   738
    by (auto intro!: measurable_sigma simp: assms(2))
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   739
  then show "f \<in> borel_measurable M" unfolding measurable_def
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   740
    unfolding assms(1) by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   741
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   742
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   743
lemma (in sigma_algebra) borel_measurable_iff_halfspace_le:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   744
  fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   745
  shows "f \<in> borel_measurable M = (\<forall>i<DIM('c). \<forall>a. {w \<in> space M. f w $$ i \<le> a} \<in> sets M)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   746
  by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_le]) auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   747
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   748
lemma (in sigma_algebra) borel_measurable_iff_halfspace_less:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   749
  fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   750
  shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>i<DIM('c). \<forall>a. {w \<in> space M. f w $$ i < a} \<in> sets M)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   751
  by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_less]) auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   752
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   753
lemma (in sigma_algebra) borel_measurable_iff_halfspace_ge:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   754
  fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   755
  shows "f \<in> borel_measurable M = (\<forall>i<DIM('c). \<forall>a. {w \<in> space M. a \<le> f w $$ i} \<in> sets M)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   756
  by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_ge]) auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   757
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   758
lemma (in sigma_algebra) borel_measurable_iff_halfspace_greater:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   759
  fixes f :: "'a \<Rightarrow> 'c\<Colon>ordered_euclidean_space"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   760
  shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>i<DIM('c). \<forall>a. {w \<in> space M. a < f w $$ i} \<in> sets M)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   761
  by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_gt]) auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   762
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   763
lemma (in sigma_algebra) borel_measurable_iff_le:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   764
  "(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. f w \<le> a} \<in> sets M)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   765
  using borel_measurable_iff_halfspace_le[where 'c=real] by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   766
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   767
lemma (in sigma_algebra) borel_measurable_iff_less:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   768
  "(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. f w < a} \<in> sets M)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   769
  using borel_measurable_iff_halfspace_less[where 'c=real] by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   770
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   771
lemma (in sigma_algebra) borel_measurable_iff_ge:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   772
  "(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. a \<le> f w} \<in> sets M)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   773
  using borel_measurable_iff_halfspace_ge[where 'c=real] by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   774
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   775
lemma (in sigma_algebra) borel_measurable_iff_greater:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   776
  "(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. a < f w} \<in> sets M)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   777
  using borel_measurable_iff_halfspace_greater[where 'c=real] by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   778
41025
8b2cd85ecf11 fixed spelling errors
hoelzl
parents: 41023
diff changeset
   779
lemma borel_measurable_euclidean_component:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   780
  "(\<lambda>x::'a::euclidean_space. x $$ i) \<in> borel_measurable borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   781
  unfolding borel_def[where 'a=real]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   782
proof (rule borel.measurable_sigma, simp_all)
39087
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   783
  fix S::"real set" assume "S \<in> open" then have "open S" unfolding mem_def .
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   784
  from open_vimage_euclidean_component[OF this]
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   785
  show "(\<lambda>x. x $$ i) -` S \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   786
    by (auto intro: borel_open)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   787
qed
39087
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   788
41025
8b2cd85ecf11 fixed spelling errors
hoelzl
parents: 41023
diff changeset
   789
lemma (in sigma_algebra) borel_measurable_euclidean_space:
39087
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   790
  fixes f :: "'a \<Rightarrow> 'c::ordered_euclidean_space"
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   791
  shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>i<DIM('c). (\<lambda>x. f x $$ i) \<in> borel_measurable M)"
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   792
proof safe
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   793
  fix i assume "f \<in> borel_measurable M"
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   794
  then show "(\<lambda>x. f x $$ i) \<in> borel_measurable M"
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   795
    using measurable_comp[of f _ _ "\<lambda>x. x $$ i", unfolded comp_def]
41025
8b2cd85ecf11 fixed spelling errors
hoelzl
parents: 41023
diff changeset
   796
    by (auto intro: borel_measurable_euclidean_component)
39087
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   797
next
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   798
  assume f: "\<forall>i<DIM('c). (\<lambda>x. f x $$ i) \<in> borel_measurable M"
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   799
  then show "f \<in> borel_measurable M"
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   800
    unfolding borel_measurable_iff_halfspace_le by auto
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   801
qed
96984bf6fa5b Measurable on euclidean space is equiv. to measurable components
hoelzl
parents: 39083
diff changeset
   802
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   803
subsection "Borel measurable operators"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   804
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   805
lemma (in sigma_algebra) affine_borel_measurable_vector:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   806
  fixes f :: "'a \<Rightarrow> 'x::real_normed_vector"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   807
  assumes "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   808
  shows "(\<lambda>x. a + b *\<^sub>R f x) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   809
proof (rule borel_measurableI)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   810
  fix S :: "'x set" assume "open S"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   811
  show "(\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   812
  proof cases
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   813
    assume "b \<noteq> 0"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   814
    with `open S` have "((\<lambda>x. (- a + x) /\<^sub>R b) ` S) \<in> open" (is "?S \<in> open")
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   815
      by (auto intro!: open_affinity simp: scaleR.add_right mem_def)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   816
    hence "?S \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   817
      unfolding borel_def by (auto simp: sigma_def intro!: sigma_sets.Basic)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   818
    moreover
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   819
    from `b \<noteq> 0` have "(\<lambda>x. a + b *\<^sub>R f x) -` S = f -` ?S"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   820
      apply auto by (rule_tac x="a + b *\<^sub>R f x" in image_eqI, simp_all)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
   821
    ultimately show ?thesis using assms unfolding in_borel_measurable_borel
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   822
      by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   823
  qed simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   824
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   825
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   826
lemma (in sigma_algebra) affine_borel_measurable:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   827
  fixes g :: "'a \<Rightarrow> real"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   828
  assumes g: "g \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   829
  shows "(\<lambda>x. a + (g x) * b) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   830
  using affine_borel_measurable_vector[OF assms] by (simp add: mult_commute)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   831
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   832
lemma (in sigma_algebra) borel_measurable_add[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   833
  fixes f :: "'a \<Rightarrow> real"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   834
  assumes f: "f \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   835
  assumes g: "g \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   836
  shows "(\<lambda>x. f x + g x) \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   837
proof -
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   838
  have 1: "\<And>a. {w\<in>space M. a \<le> f w + g w} = {w \<in> space M. a + g w * -1 \<le> f w}"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   839
    by auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   840
  have "\<And>a. (\<lambda>w. a + (g w) * -1) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   841
    by (rule affine_borel_measurable [OF g])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   842
  then have "\<And>a. {w \<in> space M. (\<lambda>w. a + (g w) * -1)(w) \<le> f w} \<in> sets M" using f
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   843
    by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   844
  then have "\<And>a. {w \<in> space M. a \<le> f w + g w} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   845
    by (simp add: 1)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   846
  then show ?thesis
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   847
    by (simp add: borel_measurable_iff_ge)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   848
qed
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   849
41026
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   850
lemma (in sigma_algebra) borel_measurable_setsum[simp, intro]:
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   851
  fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> real"
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   852
  assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M"
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   853
  shows "(\<lambda>x. \<Sum>i\<in>S. f i x) \<in> borel_measurable M"
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   854
proof cases
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   855
  assume "finite S"
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   856
  thus ?thesis using assms by induct auto
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   857
qed simp
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   858
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   859
lemma (in sigma_algebra) borel_measurable_square:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   860
  fixes f :: "'a \<Rightarrow> real"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   861
  assumes f: "f \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   862
  shows "(\<lambda>x. (f x)^2) \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   863
proof -
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   864
  {
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   865
    fix a
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   866
    have "{w \<in> space M. (f w)\<twosuperior> \<le> a} \<in> sets M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   867
    proof (cases rule: linorder_cases [of a 0])
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   868
      case less
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   869
      hence "{w \<in> space M. (f w)\<twosuperior> \<le> a} = {}"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   870
        by auto (metis less order_le_less_trans power2_less_0)
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   871
      also have "... \<in> sets M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   872
        by (rule empty_sets)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   873
      finally show ?thesis .
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   874
    next
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   875
      case equal
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   876
      hence "{w \<in> space M. (f w)\<twosuperior> \<le> a} =
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   877
             {w \<in> space M. f w \<le> 0} \<inter> {w \<in> space M. 0 \<le> f w}"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   878
        by auto
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   879
      also have "... \<in> sets M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   880
        apply (insert f)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   881
        apply (rule Int)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   882
        apply (simp add: borel_measurable_iff_le)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   883
        apply (simp add: borel_measurable_iff_ge)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   884
        done
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   885
      finally show ?thesis .
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   886
    next
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   887
      case greater
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   888
      have "\<forall>x. (f x ^ 2 \<le> sqrt a ^ 2) = (- sqrt a  \<le> f x & f x \<le> sqrt a)"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   889
        by (metis abs_le_interval_iff abs_of_pos greater real_sqrt_abs
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   890
                  real_sqrt_le_iff real_sqrt_power)
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   891
      hence "{w \<in> space M. (f w)\<twosuperior> \<le> a} =
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   892
             {w \<in> space M. -(sqrt a) \<le> f w} \<inter> {w \<in> space M. f w \<le> sqrt a}"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   893
        using greater by auto
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   894
      also have "... \<in> sets M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   895
        apply (insert f)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   896
        apply (rule Int)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   897
        apply (simp add: borel_measurable_iff_ge)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   898
        apply (simp add: borel_measurable_iff_le)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   899
        done
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   900
      finally show ?thesis .
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   901
    qed
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   902
  }
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   903
  thus ?thesis by (auto simp add: borel_measurable_iff_le)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   904
qed
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   905
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   906
lemma times_eq_sum_squares:
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   907
   fixes x::real
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   908
   shows"x*y = ((x+y)^2)/4 - ((x-y)^ 2)/4"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   909
by (simp add: power2_eq_square ring_distribs diff_divide_distrib [symmetric])
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   910
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   911
lemma (in sigma_algebra) borel_measurable_uminus[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   912
  fixes g :: "'a \<Rightarrow> real"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   913
  assumes g: "g \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   914
  shows "(\<lambda>x. - g x) \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   915
proof -
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   916
  have "(\<lambda>x. - g x) = (\<lambda>x. 0 + (g x) * -1)"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   917
    by simp
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   918
  also have "... \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   919
    by (fast intro: affine_borel_measurable g)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   920
  finally show ?thesis .
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   921
qed
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   922
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   923
lemma (in sigma_algebra) borel_measurable_times[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   924
  fixes f :: "'a \<Rightarrow> real"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   925
  assumes f: "f \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   926
  assumes g: "g \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   927
  shows "(\<lambda>x. f x * g x) \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   928
proof -
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   929
  have 1: "(\<lambda>x. 0 + (f x + g x)\<twosuperior> * inverse 4) \<in> borel_measurable M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   930
    using assms by (fast intro: affine_borel_measurable borel_measurable_square)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   931
  have "(\<lambda>x. -((f x + -g x) ^ 2 * inverse 4)) =
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   932
        (\<lambda>x. 0 + ((f x + -g x) ^ 2 * inverse -4))"
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 35347
diff changeset
   933
    by (simp add: minus_divide_right)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   934
  also have "... \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   935
    using f g by (fast intro: affine_borel_measurable borel_measurable_square f g)
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   936
  finally have 2: "(\<lambda>x. -((f x + -g x) ^ 2 * inverse 4)) \<in> borel_measurable M" .
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   937
  show ?thesis
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   938
    apply (simp add: times_eq_sum_squares diff_minus)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   939
    using 1 2 by simp
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   940
qed
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   941
41026
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   942
lemma (in sigma_algebra) borel_measurable_setprod[simp, intro]:
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   943
  fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> real"
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   944
  assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M"
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   945
  shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M"
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   946
proof cases
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   947
  assume "finite S"
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   948
  thus ?thesis using assms by induct auto
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   949
qed simp
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
   950
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   951
lemma (in sigma_algebra) borel_measurable_diff[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   952
  fixes f :: "'a \<Rightarrow> real"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   953
  assumes f: "f \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   954
  assumes g: "g \<in> borel_measurable M"
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   955
  shows "(\<lambda>x. f x - g x) \<in> borel_measurable M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   956
  unfolding diff_minus using assms by fast
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
   957
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   958
lemma (in sigma_algebra) borel_measurable_inverse[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   959
  fixes f :: "'a \<Rightarrow> real"
35692
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
   960
  assumes "f \<in> borel_measurable M"
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
   961
  shows "(\<lambda>x. inverse (f x)) \<in> borel_measurable M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   962
  unfolding borel_measurable_iff_ge unfolding inverse_eq_divide
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   963
proof safe
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   964
  fix a :: real
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   965
  have *: "{w \<in> space M. a \<le> 1 / f w} =
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   966
      ({w \<in> space M. 0 < f w} \<inter> {w \<in> space M. a * f w \<le> 1}) \<union>
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   967
      ({w \<in> space M. f w < 0} \<inter> {w \<in> space M. 1 \<le> a * f w}) \<union>
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   968
      ({w \<in> space M. f w = 0} \<inter> {w \<in> space M. a \<le> 0})" by (auto simp: le_divide_eq)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   969
  show "{w \<in> space M. a \<le> 1 / f w} \<in> sets M" using assms unfolding *
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   970
    by (auto intro!: Int Un)
35692
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
   971
qed
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
   972
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   973
lemma (in sigma_algebra) borel_measurable_divide[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   974
  fixes f :: "'a \<Rightarrow> real"
35692
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
   975
  assumes "f \<in> borel_measurable M"
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
   976
  and "g \<in> borel_measurable M"
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
   977
  shows "(\<lambda>x. f x / g x) \<in> borel_measurable M"
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
   978
  unfolding field_divide_inverse
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   979
  by (rule borel_measurable_inverse borel_measurable_times assms)+
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   980
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   981
lemma (in sigma_algebra) borel_measurable_max[intro, simp]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   982
  fixes f g :: "'a \<Rightarrow> real"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   983
  assumes "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   984
  assumes "g \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   985
  shows "(\<lambda>x. max (g x) (f x)) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   986
  unfolding borel_measurable_iff_le
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   987
proof safe
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   988
  fix a
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   989
  have "{x \<in> space M. max (g x) (f x) \<le> a} =
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   990
    {x \<in> space M. g x \<le> a} \<inter> {x \<in> space M. f x \<le> a}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   991
  thus "{x \<in> space M. max (g x) (f x) \<le> a} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   992
    using assms unfolding borel_measurable_iff_le
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   993
    by (auto intro!: Int)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   994
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   995
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   996
lemma (in sigma_algebra) borel_measurable_min[intro, simp]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   997
  fixes f g :: "'a \<Rightarrow> real"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   998
  assumes "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
   999
  assumes "g \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1000
  shows "(\<lambda>x. min (g x) (f x)) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1001
  unfolding borel_measurable_iff_ge
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1002
proof safe
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1003
  fix a
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1004
  have "{x \<in> space M. a \<le> min (g x) (f x)} =
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1005
    {x \<in> space M. a \<le> g x} \<inter> {x \<in> space M. a \<le> f x}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1006
  thus "{x \<in> space M. a \<le> min (g x) (f x)} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1007
    using assms unfolding borel_measurable_iff_ge
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1008
    by (auto intro!: Int)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1009
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1010
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1011
lemma (in sigma_algebra) borel_measurable_abs[simp, intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1012
  assumes "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1013
  shows "(\<lambda>x. \<bar>f x :: real\<bar>) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1014
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1015
  have *: "\<And>x. \<bar>f x\<bar> = max 0 (f x) + max 0 (- f x)" by (simp add: max_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1016
  show ?thesis unfolding * using assms by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1017
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1018
41026
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
  1019
lemma borel_measurable_nth[simp, intro]:
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
  1020
  "(\<lambda>x::real^'n. x $ i) \<in> borel_measurable borel"
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
  1021
  using borel_measurable_euclidean_component
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
  1022
  unfolding nth_conv_component by auto
bea75746dc9d folding on arbitrary Lebesgue integrable functions
hoelzl
parents: 41025
diff changeset
  1023
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1024
section "Borel space over the real line with infinity"
35692
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
  1025
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
  1026
lemma borel_Real_measurable:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
  1027
  "A \<in> sets borel \<Longrightarrow> Real -` A \<in> sets borel"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1028
proof (rule borel_measurable_translate)
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1029
  fix B :: "pextreal set" assume "open B"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1030
  then obtain T x where T: "open T" "Real ` (T \<inter> {0..}) = B - {\<omega>}" and
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1031
    x: "\<omega> \<in> B \<Longrightarrow> 0 \<le> x" "\<omega> \<in> B \<Longrightarrow> {Real x <..} \<subseteq> B"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1032
    unfolding open_pextreal_def by blast
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1033
  have "Real -` B = Real -` (B - {\<omega>})" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1034
  also have "\<dots> = Real -` (Real ` (T \<inter> {0..}))" using T by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1035
  also have "\<dots> = (if 0 \<in> T then T \<union> {.. 0} else T \<inter> {0..})"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1036
    apply (auto simp add: Real_eq_Real image_iff)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1037
    apply (rule_tac x="max 0 x" in bexI)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1038
    by (auto simp: max_def)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
  1039
  finally show "Real -` B \<in> sets borel"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1040
    using `open T` by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1041
qed simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1042
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
  1043
lemma borel_real_measurable:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1044
  "A \<in> sets borel \<Longrightarrow> (real -` A :: pextreal set) \<in> sets borel"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1045
proof (rule borel_measurable_translate)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1046
  fix B :: "real set" assume "open B"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1047
  { fix x have "0 < real x \<longleftrightarrow> (\<exists>r>0. x = Real r)" by (cases x) auto }
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1048
  note Ex_less_real = this
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1049
  have *: "real -` B = (if 0 \<in> B then real -` (B \<inter> {0 <..}) \<union> {0, \<omega>} else real -` (B \<inter> {0 <..}))"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1050
    by (force simp: Ex_less_real)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1051
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1052
  have "open (real -` (B \<inter> {0 <..}) :: pextreal set)"
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1053
    unfolding open_pextreal_def using `open B`
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1054
    by (auto intro!: open_Int exI[of _ "B \<inter> {0 <..}"] simp: image_iff Ex_less_real)
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1055
  then show "(real -` B :: pextreal set) \<in> sets borel" unfolding * by auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1056
qed simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1057
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1058
lemma (in sigma_algebra) borel_measurable_Real[intro, simp]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1059
  assumes "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1060
  shows "(\<lambda>x. Real (f x)) \<in> borel_measurable M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
  1061
  unfolding in_borel_measurable_borel
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1062
proof safe
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1063
  fix S :: "pextreal set" assume "S \<in> sets borel"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
  1064
  from borel_Real_measurable[OF this]
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1065
  have "(Real \<circ> f) -` S \<inter> space M \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1066
    using assms
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
  1067
    unfolding vimage_compose in_borel_measurable_borel
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1068
    by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1069
  thus "(\<lambda>x. Real (f x)) -` S \<inter> space M \<in> sets M" by (simp add: comp_def)
35748
5f35613d9a65 Equality of integral and infinite sum.
hoelzl
parents: 35704
diff changeset
  1070
qed
35692
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
  1071
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1072
lemma (in sigma_algebra) borel_measurable_real[intro, simp]:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1073
  fixes f :: "'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1074
  assumes "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1075
  shows "(\<lambda>x. real (f x)) \<in> borel_measurable M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
  1076
  unfolding in_borel_measurable_borel
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1077
proof safe
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
  1078
  fix S :: "real set" assume "S \<in> sets borel"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
  1079
  from borel_real_measurable[OF this]
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1080
  have "(real \<circ> f) -` S \<inter> space M \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1081
    using assms
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
  1082
    unfolding vimage_compose in_borel_measurable_borel
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1083
    by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1084
  thus "(\<lambda>x. real (f x)) -` S \<inter> space M \<in> sets M" by (simp add: comp_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1085
qed
35692
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
  1086
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1087
lemma (in sigma_algebra) borel_measurable_Real_eq:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1088
  assumes "\<And>x. x \<in> space M \<Longrightarrow> 0 \<le> f x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1089
  shows "(\<lambda>x. Real (f x)) \<in> borel_measurable M \<longleftrightarrow> f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1090
proof
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1091
  have [simp]: "(\<lambda>x. Real (f x)) -` {\<omega>} \<inter> space M = {}"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1092
    by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1093
  assume "(\<lambda>x. Real (f x)) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1094
  hence "(\<lambda>x. real (Real (f x))) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1095
    by (rule borel_measurable_real)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1096
  moreover have "\<And>x. x \<in> space M \<Longrightarrow> real (Real (f x)) = f x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1097
    using assms by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1098
  ultimately show "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1099
    by (simp cong: measurable_cong)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1100
qed auto
35692
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
  1101
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1102
lemma (in sigma_algebra) borel_measurable_pextreal_eq_real:
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1103
  "f \<in> borel_measurable M \<longleftrightarrow>
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1104
    ((\<lambda>x. real (f x)) \<in> borel_measurable M \<and> f -` {\<omega>} \<inter> space M \<in> sets M)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1105
proof safe
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1106
  assume "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1107
  then show "(\<lambda>x. real (f x)) \<in> borel_measurable M" "f -` {\<omega>} \<inter> space M \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1108
    by (auto intro: borel_measurable_vimage borel_measurable_real)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1109
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1110
  assume *: "(\<lambda>x. real (f x)) \<in> borel_measurable M" "f -` {\<omega>} \<inter> space M \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1111
  have "f -` {\<omega>} \<inter> space M = {x\<in>space M. f x = \<omega>}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1112
  with * have **: "{x\<in>space M. f x = \<omega>} \<in> sets M" by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1113
  have f: "f = (\<lambda>x. if f x = \<omega> then \<omega> else Real (real (f x)))"
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 39198
diff changeset
  1114
    by (simp add: fun_eq_iff Real_real)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1115
  show "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1116
    apply (subst f)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1117
    apply (rule measurable_If)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1118
    using * ** by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1119
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1120
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1121
lemma (in sigma_algebra) less_eq_ge_measurable:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1122
  fixes f :: "'a \<Rightarrow> 'c::linorder"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1123
  shows "{x\<in>space M. a < f x} \<in> sets M \<longleftrightarrow> {x\<in>space M. f x \<le> a} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1124
proof
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1125
  assume "{x\<in>space M. f x \<le> a} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1126
  moreover have "{x\<in>space M. a < f x} = space M - {x\<in>space M. f x \<le> a}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1127
  ultimately show "{x\<in>space M. a < f x} \<in> sets M" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1128
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1129
  assume "{x\<in>space M. a < f x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1130
  moreover have "{x\<in>space M. f x \<le> a} = space M - {x\<in>space M. a < f x}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1131
  ultimately show "{x\<in>space M. f x \<le> a} \<in> sets M" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1132
qed
35692
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
  1133
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1134
lemma (in sigma_algebra) greater_eq_le_measurable:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1135
  fixes f :: "'a \<Rightarrow> 'c::linorder"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1136
  shows "{x\<in>space M. f x < a} \<in> sets M \<longleftrightarrow> {x\<in>space M. a \<le> f x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1137
proof
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1138
  assume "{x\<in>space M. a \<le> f x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1139
  moreover have "{x\<in>space M. f x < a} = space M - {x\<in>space M. a \<le> f x}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1140
  ultimately show "{x\<in>space M. f x < a} \<in> sets M" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1141
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1142
  assume "{x\<in>space M. f x < a} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1143
  moreover have "{x\<in>space M. a \<le> f x} = space M - {x\<in>space M. f x < a}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1144
  ultimately show "{x\<in>space M. a \<le> f x} \<in> sets M" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1145
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1146
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1147
lemma (in sigma_algebra) less_eq_le_pextreal_measurable:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1148
  fixes f :: "'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1149
  shows "(\<forall>a. {x\<in>space M. a < f x} \<in> sets M) \<longleftrightarrow> (\<forall>a. {x\<in>space M. a \<le> f x} \<in> sets M)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1150
proof
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1151
  assume a: "\<forall>a. {x\<in>space M. a \<le> f x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1152
  show "\<forall>a. {x \<in> space M. a < f x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1153
  proof
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1154
    fix a show "{x \<in> space M. a < f x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1155
    proof (cases a)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1156
      case (preal r)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1157
      have "{x\<in>space M. a < f x} = (\<Union>i. {x\<in>space M. a + inverse (of_nat (Suc i)) \<le> f x})"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
  1158
      proof safe
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1159
        fix x assume "a < f x" and [simp]: "x \<in> space M"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1160
        with ex_pextreal_inverse_of_nat_Suc_less[of "f x - a"]
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1161
        obtain n where "a + inverse (of_nat (Suc n)) < f x"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1162
          by (cases "f x", auto simp: pextreal_minus_order)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1163
        then have "a + inverse (of_nat (Suc n)) \<le> f x" by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1164
        then show "x \<in> (\<Union>i. {x \<in> space M. a + inverse (of_nat (Suc i)) \<le> f x})"
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
  1165
          by auto
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
  1166
      next
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1167
        fix i x assume [simp]: "x \<in> space M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1168
        have "a < a + inverse (of_nat (Suc i))" using preal by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1169
        also assume "a + inverse (of_nat (Suc i)) \<le> f x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1170
        finally show "a < f x" .
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
  1171
      qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1172
      with a show ?thesis by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1173
    qed simp
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 35347
diff changeset
  1174
  qed
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 35347
diff changeset
  1175
next
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1176
  assume a': "\<forall>a. {x \<in> space M. a < f x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1177
  then have a: "\<forall>a. {x \<in> space M. f x \<le> a} \<in> sets M" unfolding less_eq_ge_measurable .
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1178
  show "\<forall>a. {x \<in> space M. a \<le> f x} \<in> sets M" unfolding greater_eq_le_measurable[symmetric]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1179
  proof
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1180
    fix a show "{x \<in> space M. f x < a} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1181
    proof (cases a)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1182
      case (preal r)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1183
      show ?thesis
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1184
      proof cases
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1185
        assume "a = 0" then show ?thesis by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1186
      next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1187
        assume "a \<noteq> 0"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1188
        have "{x\<in>space M. f x < a} = (\<Union>i. {x\<in>space M. f x \<le> a - inverse (of_nat (Suc i))})"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1189
        proof safe
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1190
          fix x assume "f x < a" and [simp]: "x \<in> space M"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1191
          with ex_pextreal_inverse_of_nat_Suc_less[of "a - f x"]
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1192
          obtain n where "inverse (of_nat (Suc n)) < a - f x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1193
            using preal by (cases "f x") auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1194
          then have "f x \<le> a - inverse (of_nat (Suc n)) "
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1195
            using preal by (cases "f x") (auto split: split_if_asm)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1196
          then show "x \<in> (\<Union>i. {x \<in> space M. f x \<le> a - inverse (of_nat (Suc i))})"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1197
            by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1198
        next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1199
          fix i x assume [simp]: "x \<in> space M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1200
          assume "f x \<le> a - inverse (of_nat (Suc i))"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1201
          also have "\<dots> < a" using `a \<noteq> 0` preal by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1202
          finally show "f x < a" .
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1203
        qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1204
        with a show ?thesis by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1205
      qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1206
    next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1207
      case infinite
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1208
      have "f -` {\<omega>} \<inter> space M = (\<Inter>n. {x\<in>space M. of_nat n < f x})"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1209
      proof (safe, simp_all, safe)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1210
        fix x assume *: "\<forall>n::nat. Real (real n) < f x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1211
        show "f x = \<omega>"    proof (rule ccontr)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1212
          assume "f x \<noteq> \<omega>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1213
          with real_arch_lt[of "real (f x)"] obtain n where "f x < of_nat n"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1214
            by (auto simp: pextreal_noteq_omega_Ex)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1215
          with *[THEN spec, of n] show False by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1216
        qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1217
      qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1218
      with a' have \<omega>: "f -` {\<omega>} \<inter> space M \<in> sets M" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1219
      moreover have "{x \<in> space M. f x < a} = space M - f -` {\<omega>} \<inter> space M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1220
        using infinite by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1221
      ultimately show ?thesis by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1222
    qed
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 35347
diff changeset
  1223
  qed
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 35347
diff changeset
  1224
qed
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 35347
diff changeset
  1225
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1226
lemma (in sigma_algebra) borel_measurable_pextreal_iff_greater:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1227
  "(f::'a \<Rightarrow> pextreal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. {x\<in>space M. a < f x} \<in> sets M)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1228
proof safe
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1229
  fix a assume f: "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1230
  have "{x\<in>space M. a < f x} = f -` {a <..} \<inter> space M" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1231
  with f show "{x\<in>space M. a < f x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1232
    by (auto intro!: measurable_sets)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1233
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1234
  assume *: "\<forall>a. {x\<in>space M. a < f x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1235
  hence **: "\<forall>a. {x\<in>space M. f x < a} \<in> sets M"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1236
    unfolding less_eq_le_pextreal_measurable
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1237
    unfolding greater_eq_le_measurable .
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1238
  show "f \<in> borel_measurable M" unfolding borel_measurable_pextreal_eq_real borel_measurable_iff_greater
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1239
  proof safe
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1240
    have "f -` {\<omega>} \<inter> space M = space M - {x\<in>space M. f x < \<omega>}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1241
    then show \<omega>: "f -` {\<omega>} \<inter> space M \<in> sets M" using ** by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1242
    fix a
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1243
    have "{w \<in> space M. a < real (f w)} =
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1244
      (if 0 \<le> a then {w\<in>space M. Real a < f w} - (f -` {\<omega>} \<inter> space M) else space M)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1245
    proof (split split_if, safe del: notI)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1246
      fix x assume "0 \<le> a"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1247
      { assume "a < real (f x)" then show "Real a < f x" "x \<notin> f -` {\<omega>} \<inter> space M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1248
          using `0 \<le> a` by (cases "f x", auto) }
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1249
      { assume "Real a < f x" "x \<notin> f -` {\<omega>}" then show "a < real (f x)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1250
          using `0 \<le> a` by (cases "f x", auto) }
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1251
    next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1252
      fix x assume "\<not> 0 \<le> a" then show "a < real (f x)" by (cases "f x") auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1253
    qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1254
    then show "{w \<in> space M. a < real (f w)} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1255
      using \<omega> * by (auto intro!: Diff)
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 35347
diff changeset
  1256
  qed
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 35347
diff changeset
  1257
qed
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 35347
diff changeset
  1258
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1259
lemma (in sigma_algebra) borel_measurable_pextreal_iff_less:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1260
  "(f::'a \<Rightarrow> pextreal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. {x\<in>space M. f x < a} \<in> sets M)"
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1261
  using borel_measurable_pextreal_iff_greater unfolding less_eq_le_pextreal_measurable greater_eq_le_measurable .
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1262
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1263
lemma (in sigma_algebra) borel_measurable_pextreal_iff_le:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1264
  "(f::'a \<Rightarrow> pextreal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. {x\<in>space M. f x \<le> a} \<in> sets M)"
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1265
  using borel_measurable_pextreal_iff_greater unfolding less_eq_ge_measurable .
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1266
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1267
lemma (in sigma_algebra) borel_measurable_pextreal_iff_ge:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1268
  "(f::'a \<Rightarrow> pextreal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. {x\<in>space M. a \<le> f x} \<in> sets M)"
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1269
  using borel_measurable_pextreal_iff_greater unfolding less_eq_le_pextreal_measurable .
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1270
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1271
lemma (in sigma_algebra) borel_measurable_pextreal_eq_const:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1272
  fixes f :: "'a \<Rightarrow> pextreal" assumes "f \<in> borel_measurable M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1273
  shows "{x\<in>space M. f x = c} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1274
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1275
  have "{x\<in>space M. f x = c} = (f -` {c} \<inter> space M)" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1276
  then show ?thesis using assms by (auto intro!: measurable_sets)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1277
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1278
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1279
lemma (in sigma_algebra) borel_measurable_pextreal_neq_const:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1280
  fixes f :: "'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1281
  assumes "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1282
  shows "{x\<in>space M. f x \<noteq> c} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1283
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1284
  have "{x\<in>space M. f x \<noteq> c} = space M - (f -` {c} \<inter> space M)" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1285
  then show ?thesis using assms by (auto intro!: measurable_sets)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1286
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1287
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1288
lemma (in sigma_algebra) borel_measurable_pextreal_less[intro,simp]:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1289
  fixes f g :: "'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1290
  assumes f: "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1291
  assumes g: "g \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1292
  shows "{x \<in> space M. f x < g x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1293
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1294
  have "(\<lambda>x. real (f x)) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1295
    "(\<lambda>x. real (g x)) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1296
    using assms by (auto intro!: borel_measurable_real)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1297
  from borel_measurable_less[OF this]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1298
  have "{x \<in> space M. real (f x) < real (g x)} \<in> sets M" .
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1299
  moreover have "{x \<in> space M. f x \<noteq> \<omega>} \<in> sets M" using f by (rule borel_measurable_pextreal_neq_const)
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1300
  moreover have "{x \<in> space M. g x = \<omega>} \<in> sets M" using g by (rule borel_measurable_pextreal_eq_const)
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1301
  moreover have "{x \<in> space M. g x \<noteq> \<omega>} \<in> sets M" using g by (rule borel_measurable_pextreal_neq_const)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1302
  moreover have "{x \<in> space M. f x < g x} = ({x \<in> space M. g x = \<omega>} \<inter> {x \<in> space M. f x \<noteq> \<omega>}) \<union>
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1303
    ({x \<in> space M. g x \<noteq> \<omega>} \<inter> {x \<in> space M. f x \<noteq> \<omega>} \<inter> {x \<in> space M. real (f x) < real (g x)})"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1304
    by (auto simp: real_of_pextreal_strict_mono_iff)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1305
  ultimately show ?thesis by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1306
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1307
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1308
lemma (in sigma_algebra) borel_measurable_pextreal_le[intro,simp]:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1309
  fixes f :: "'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1310
  assumes f: "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1311
  assumes g: "g \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1312
  shows "{x \<in> space M. f x \<le> g x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1313
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1314
  have "{x \<in> space M. f x \<le> g x} = space M - {x \<in> space M. g x < f x}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1315
  then show ?thesis using g f by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1316
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1317
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1318
lemma (in sigma_algebra) borel_measurable_pextreal_eq[intro,simp]:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1319
  fixes f :: "'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1320
  assumes f: "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1321
  assumes g: "g \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1322
  shows "{w \<in> space M. f w = g w} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1323
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1324
  have "{x \<in> space M. f x = g x} = {x \<in> space M. g x \<le> f x} \<inter> {x \<in> space M. f x \<le> g x}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1325
  then show ?thesis using g f by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1326
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1327
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1328
lemma (in sigma_algebra) borel_measurable_pextreal_neq[intro,simp]:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1329
  fixes f :: "'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1330
  assumes f: "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1331
  assumes g: "g \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1332
  shows "{w \<in> space M. f w \<noteq> g w} \<in> sets M"
35692
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
  1333
proof -
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1334
  have "{w \<in> space M. f w \<noteq> g w} = space M - {w \<in> space M. f w = g w}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1335
  thus ?thesis using f g by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1336
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1337
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1338
lemma (in sigma_algebra) borel_measurable_pextreal_add[intro, simp]:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1339
  fixes f :: "'a \<Rightarrow> pextreal"
41025
8b2cd85ecf11 fixed spelling errors
hoelzl
parents: 41023
diff changeset
  1340
  assumes "f \<in> borel_measurable M" "g \<in> borel_measurable M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1341
  shows "(\<lambda>x. f x + g x) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1342
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1343
  have *: "(\<lambda>x. f x + g x) =
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1344
     (\<lambda>x. if f x = \<omega> then \<omega> else if g x = \<omega> then \<omega> else Real (real (f x) + real (g x)))"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1345
     by (auto simp: fun_eq_iff pextreal_noteq_omega_Ex)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1346
  show ?thesis using assms unfolding *
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1347
    by (auto intro!: measurable_If)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1348
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1349
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1350
lemma (in sigma_algebra) borel_measurable_pextreal_times[intro, simp]:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1351
  fixes f :: "'a \<Rightarrow> pextreal" assumes "f \<in> borel_measurable M" "g \<in> borel_measurable M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1352
  shows "(\<lambda>x. f x * g x) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1353
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1354
  have *: "(\<lambda>x. f x * g x) =
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1355
     (\<lambda>x. if f x = 0 then 0 else if g x = 0 then 0 else if f x = \<omega> then \<omega> else if g x = \<omega> then \<omega> else
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1356
      Real (real (f x) * real (g x)))"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1357
     by (auto simp: fun_eq_iff pextreal_noteq_omega_Ex)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1358
  show ?thesis using assms unfolding *
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1359
    by (auto intro!: measurable_If)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1360
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1361
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1362
lemma (in sigma_algebra) borel_measurable_pextreal_setsum[simp, intro]:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1363
  fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1364
  assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1365
  shows "(\<lambda>x. \<Sum>i\<in>S. f i x) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1366
proof cases
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1367
  assume "finite S"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1368
  thus ?thesis using assms
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1369
    by induct auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1370
qed (simp add: borel_measurable_const)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1371
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1372
lemma (in sigma_algebra) borel_measurable_pextreal_min[simp, intro]:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1373
  fixes f g :: "'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1374
  assumes "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1375
  assumes "g \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1376
  shows "(\<lambda>x. min (g x) (f x)) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1377
  using assms unfolding min_def by (auto intro!: measurable_If)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1378
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1379
lemma (in sigma_algebra) borel_measurable_pextreal_max[simp, intro]:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1380
  fixes f g :: "'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1381
  assumes "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1382
  and "g \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1383
  shows "(\<lambda>x. max (g x) (f x)) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1384
  using assms unfolding max_def by (auto intro!: measurable_If)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1385
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1386
lemma (in sigma_algebra) borel_measurable_SUP[simp, intro]:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1387
  fixes f :: "'d\<Colon>countable \<Rightarrow> 'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1388
  assumes "\<And>i. i \<in> A \<Longrightarrow> f i \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1389
  shows "(SUP i : A. f i) \<in> borel_measurable M" (is "?sup \<in> borel_measurable M")
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1390
  unfolding borel_measurable_pextreal_iff_greater
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1391
proof safe
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1392
  fix a
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1393
  have "{x\<in>space M. a < ?sup x} = (\<Union>i\<in>A. {x\<in>space M. a < f i x})"
41083
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1394
    by (auto simp: less_SUP_iff SUPR_apply)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1395
  then show "{x\<in>space M. a < ?sup x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1396
    using assms by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1397
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1398
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1399
lemma (in sigma_algebra) borel_measurable_INF[simp, intro]:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1400
  fixes f :: "'d :: countable \<Rightarrow> 'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1401
  assumes "\<And>i. i \<in> A \<Longrightarrow> f i \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1402
  shows "(INF i : A. f i) \<in> borel_measurable M" (is "?inf \<in> borel_measurable M")
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1403
  unfolding borel_measurable_pextreal_iff_less
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1404
proof safe
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1405
  fix a
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1406
  have "{x\<in>space M. ?inf x < a} = (\<Union>i\<in>A. {x\<in>space M. f i x < a})"
41083
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1407
    by (auto simp: INF_less_iff INFI_apply)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1408
  then show "{x\<in>space M. ?inf x < a} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1409
    using assms by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1410
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1411
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1412
lemma (in sigma_algebra) borel_measurable_pextreal_diff[simp, intro]:
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1413
  fixes f g :: "'a \<Rightarrow> pextreal"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1414
  assumes "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1415
  assumes "g \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1416
  shows "(\<lambda>x. f x - g x) \<in> borel_measurable M"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1417
  unfolding borel_measurable_pextreal_iff_greater
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1418
proof safe
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1419
  fix a
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1420
  have "{x \<in> space M. a < f x - g x} = {x \<in> space M. g x + a < f x}"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40870
diff changeset
  1421
    by (simp add: pextreal_less_minus_iff)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1422
  then show "{x \<in> space M. a < f x - g x} \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37887
diff changeset
  1423
    using assms by auto
35692
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
  1424
qed
f1315bbf1bc9 Moved theorems in Lebesgue to the right places
hoelzl
parents: 35582
diff changeset
  1425
41083
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1426
lemma INFI_fun_expand:
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1427
  "(INF y:A. f y) = (\<lambda>x. (INF y:A. f y x))"
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1428
  by (simp add: fun_eq_iff INFI_apply)
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1429
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1430
lemma SUPR_fun_expand:
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1431
  "(SUP y:A. f y) = (\<lambda>x. (SUP y:A. f y x))"
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1432
  by (simp add: fun_eq_iff SUPR_apply)
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1433
40870
94427db32392 Tuned setup for borel_measurable with min, max and psuminf.
hoelzl
parents: 40869
diff changeset
  1434
lemma (in sigma_algebra) borel_measurable_psuminf[simp, intro]:
39092
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1435
  assumes "\<And>i. f i \<in> borel_measurable M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1436
  shows "(\<lambda>x. (\<Sum>\<^isub>\<infinity> i. f i x)) \<in> borel_measurable M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1437
  using assms unfolding psuminf_def
41083
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1438
  by (auto intro!: borel_measurable_SUP [unfolded SUPR_fun_expand])
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1439
39092
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1440
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1441
section "LIMSEQ is borel measurable"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1442
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1443
lemma (in sigma_algebra) borel_measurable_LIMSEQ:
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1444
  fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> real"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1445
  assumes u': "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. u i x) ----> u' x"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1446
  and u: "\<And>i. u i \<in> borel_measurable M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1447
  shows "u' \<in> borel_measurable M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1448
proof -
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1449
  let "?pu x i" = "max (u i x) 0"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1450
  let "?nu x i" = "max (- u i x) 0"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1451
  { fix x assume x: "x \<in> space M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1452
    have "(?pu x) ----> max (u' x) 0"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1453
      "(?nu x) ----> max (- u' x) 0"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1454
      using u'[OF x] by (auto intro!: LIMSEQ_max LIMSEQ_minus)
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1455
    from LIMSEQ_imp_lim_INF[OF _ this(1)] LIMSEQ_imp_lim_INF[OF _ this(2)]
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1456
    have "(SUP n. INF m. Real (u (n + m) x)) = Real (u' x)"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1457
      "(SUP n. INF m. Real (- u (n + m) x)) = Real (- u' x)"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1458
      by (simp_all add: Real_max'[symmetric]) }
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1459
  note eq = this
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1460
  have *: "\<And>x. real (Real (u' x)) - real (Real (- u' x)) = u' x"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1461
    by auto
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1462
  have "(SUP n. INF m. (\<lambda>x. Real (u (n + m) x))) \<in> borel_measurable M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1463
       "(SUP n. INF m. (\<lambda>x. Real (- u (n + m) x))) \<in> borel_measurable M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1464
    using u by (auto intro: borel_measurable_SUP borel_measurable_INF borel_measurable_Real)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 39302
diff changeset
  1465
  with eq[THEN measurable_cong, of M "\<lambda>x. x" borel]
39092
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1466
  have "(\<lambda>x. Real (u' x)) \<in> borel_measurable M"
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1467
       "(\<lambda>x. Real (- u' x)) \<in> borel_measurable M"
41083
c987429a1298 work around problems with eta-expansion of equations
haftmann
parents: 41080
diff changeset
  1468
    unfolding SUPR_fun_expand INFI_fun_expand by auto
39092
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1469
  note this[THEN borel_measurable_real]
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1470
  from borel_measurable_diff[OF this]
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1471
  show ?thesis unfolding * .
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1472
qed
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39087
diff changeset
  1473
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
diff changeset
  1474
end