src/HOL/Probability/Euclidean_Lebesgue.thy
author hoelzl
Thu, 02 Sep 2010 19:57:16 +0200
changeset 39098 21e9bd6cf0a8
parent 38656 d5d342611edb
child 39198 f967a16dfcdd
permissions -rw-r--r--
Corrected definition and hence removed sorry.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     1
theory Euclidean_Lebesgue
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     2
  imports Lebesgue_Integration Lebesgue_Measure
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     3
begin
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     4
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     5
lemma simple_function_has_integral:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     6
  fixes f::"'a::ordered_euclidean_space \<Rightarrow> pinfreal"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     7
  assumes f:"lebesgue.simple_function f"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     8
  and f':"\<forall>x. f x \<noteq> \<omega>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     9
  and om:"\<forall>x\<in>range f. lmeasure (f -` {x} \<inter> UNIV) = \<omega> \<longrightarrow> x = 0"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    10
  shows "((\<lambda>x. real (f x)) has_integral (real (lebesgue.simple_integral f))) UNIV"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    11
  unfolding lebesgue.simple_integral_def
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    12
  apply(subst lebesgue_simple_function_indicator[OF f])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    13
proof- case goal1
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    14
  have *:"\<And>x. \<forall>y\<in>range f. y * indicator (f -` {y}) x \<noteq> \<omega>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    15
    "\<forall>x\<in>range f. x * lmeasure (f -` {x} \<inter> UNIV) \<noteq> \<omega>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    16
    using f' om unfolding indicator_def by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    17
  show ?case unfolding space_lebesgue_space real_of_pinfreal_setsum'[OF *(1),THEN sym]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    18
    unfolding real_of_pinfreal_setsum'[OF *(2),THEN sym]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    19
    unfolding real_of_pinfreal_setsum space_lebesgue_space
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    20
    apply(rule has_integral_setsum)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    21
  proof safe show "finite (range f)" using f by (auto dest: lebesgue.simple_functionD)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    22
    fix y::'a show "((\<lambda>x. real (f y * indicator (f -` {f y}) x)) has_integral
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    23
      real (f y * lmeasure (f -` {f y} \<inter> UNIV))) UNIV"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    24
    proof(cases "f y = 0") case False
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    25
      have mea:"gmeasurable (f -` {f y})" apply(rule glmeasurable_finite)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    26
        using assms unfolding lebesgue.simple_function_def using False by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    27
      have *:"\<And>x. real (indicator (f -` {f y}) x::pinfreal) = (if x \<in> f -` {f y} then 1 else 0)" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    28
      show ?thesis unfolding real_of_pinfreal_mult[THEN sym]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    29
        apply(rule has_integral_cmul[where 'b=real, unfolded real_scaleR_def])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    30
        unfolding Int_UNIV_right lmeasure_gmeasure[OF mea,THEN sym]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    31
        unfolding measure_integral_univ[OF mea] * apply(rule integrable_integral)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    32
        unfolding gmeasurable_integrable[THEN sym] using mea .
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    33
    qed auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    34
  qed qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    35
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    36
lemma (in measure_space) positive_integral_omega:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    37
  assumes "f \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    38
  and "positive_integral f \<noteq> \<omega>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    39
  shows "\<mu> (f -` {\<omega>} \<inter> space M) = 0"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    40
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    41
  have "\<omega> * \<mu> (f -` {\<omega>} \<inter> space M) = positive_integral (\<lambda>x. \<omega> * indicator (f -` {\<omega>} \<inter> space M) x)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    42
    using positive_integral_cmult_indicator[OF borel_measurable_vimage, OF assms(1), of \<omega> \<omega>] by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    43
  also have "\<dots> \<le> positive_integral f"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    44
    by (auto intro!: positive_integral_mono simp: indicator_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    45
  finally show ?thesis
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    46
    using assms(2) by (cases ?thesis) auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    47
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    48
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    49
lemma (in measure_space) simple_integral_omega:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    50
  assumes "simple_function f"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    51
  and "simple_integral f \<noteq> \<omega>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    52
  shows "\<mu> (f -` {\<omega>} \<inter> space M) = 0"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    53
proof (rule positive_integral_omega)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    54
  show "f \<in> borel_measurable M" using assms by (auto intro: borel_measurable_simple_function)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    55
  show "positive_integral f \<noteq> \<omega>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    56
    using assms by (simp add: positive_integral_eq_simple_integral)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    57
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    58
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    59
lemma bounded_realI: assumes "\<forall>x\<in>s. abs (x::real) \<le> B" shows "bounded s"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    60
  unfolding bounded_def dist_real_def apply(rule_tac x=0 in exI)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    61
  using assms by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    62
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    63
lemma simple_function_has_integral':
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    64
  fixes f::"'a::ordered_euclidean_space \<Rightarrow> pinfreal"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    65
  assumes f:"lebesgue.simple_function f"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    66
  and i: "lebesgue.simple_integral f \<noteq> \<omega>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    67
  shows "((\<lambda>x. real (f x)) has_integral (real (lebesgue.simple_integral f))) UNIV"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    68
proof- let ?f = "\<lambda>x. if f x = \<omega> then 0 else f x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    69
  { fix x have "real (f x) = real (?f x)" by (cases "f x") auto } note * = this
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    70
  have **:"{x. f x \<noteq> ?f x} = f -` {\<omega>}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    71
  have **:"lmeasure {x\<in>space lebesgue_space. f x \<noteq> ?f x} = 0"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    72
    using lebesgue.simple_integral_omega[OF assms] by(auto simp add:**)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    73
  show ?thesis apply(subst lebesgue.simple_integral_cong'[OF f _ **])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    74
    apply(rule lebesgue.simple_function_compose1[OF f])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    75
    unfolding * defer apply(rule simple_function_has_integral)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    76
  proof-
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    77
    show "lebesgue.simple_function ?f"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    78
      using lebesgue.simple_function_compose1[OF f] .
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    79
    show "\<forall>x. ?f x \<noteq> \<omega>" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    80
    show "\<forall>x\<in>range ?f. lmeasure (?f -` {x} \<inter> UNIV) = \<omega> \<longrightarrow> x = 0"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    81
    proof (safe, simp, safe, rule ccontr)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    82
      fix y assume "f y \<noteq> \<omega>" "f y \<noteq> 0"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    83
      hence "(\<lambda>x. if f x = \<omega> then 0 else f x) -` {if f y = \<omega> then 0 else f y} = f -` {f y}"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    84
        by (auto split: split_if_asm)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    85
      moreover assume "lmeasure ((\<lambda>x. if f x = \<omega> then 0 else f x) -` {if f y = \<omega> then 0 else f y}) = \<omega>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    86
      ultimately have "lmeasure (f -` {f y}) = \<omega>" by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    87
      moreover
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    88
      have "f y * lmeasure (f -` {f y}) \<noteq> \<omega>" using i f
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    89
        unfolding lebesgue.simple_integral_def setsum_\<omega> lebesgue.simple_function_def
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    90
        by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    91
      ultimately have "f y = 0" by (auto split: split_if_asm)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    92
      then show False using `f y \<noteq> 0` by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    93
    qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    94
  qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    95
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    96
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    97
lemma (in measure_space) positive_integral_monotone_convergence:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    98
  fixes f::"nat \<Rightarrow> 'a \<Rightarrow> pinfreal"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    99
  assumes i: "\<And>i. f i \<in> borel_measurable M" and mono: "\<And>x. mono (\<lambda>n. f n x)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   100
  and lim: "\<And>x. (\<lambda>i. f i x) ----> u x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   101
  shows "u \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   102
  and "(\<lambda>i. positive_integral (f i)) ----> positive_integral u" (is ?ilim)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   103
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   104
  from positive_integral_isoton[unfolded isoton_fun_expand isoton_iff_Lim_mono, of f u]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   105
  show ?ilim using mono lim i by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   106
  have "(SUP i. f i) = u" using mono lim SUP_Lim_pinfreal
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   107
    unfolding expand_fun_eq SUPR_fun_expand mono_def by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   108
  moreover have "(SUP i. f i) \<in> borel_measurable M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   109
    using i by (rule borel_measurable_SUP)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   110
  ultimately show "u \<in> borel_measurable M" by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   111
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   112
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   113
lemma positive_integral_has_integral:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   114
  fixes f::"'a::ordered_euclidean_space => pinfreal"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   115
  assumes f:"f \<in> borel_measurable lebesgue_space"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   116
  and int_om:"lebesgue.positive_integral f \<noteq> \<omega>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   117
  and f_om:"\<forall>x. f x \<noteq> \<omega>" (* TODO: remove this *)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   118
  shows "((\<lambda>x. real (f x)) has_integral (real (lebesgue.positive_integral f))) UNIV"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   119
proof- let ?i = "lebesgue.positive_integral f"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   120
  from lebesgue.borel_measurable_implies_simple_function_sequence[OF f]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   121
  guess u .. note conjunctD2[OF this,rule_format] note u = conjunctD2[OF this(1)] this(2)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   122
  let ?u = "\<lambda>i x. real (u i x)" and ?f = "\<lambda>x. real (f x)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   123
  have u_simple:"\<And>k. lebesgue.simple_integral (u k) = lebesgue.positive_integral (u k)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   124
    apply(subst lebesgue.positive_integral_eq_simple_integral[THEN sym,OF u(1)]) ..
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   125
    (*unfolding image_iff defer apply(rule) using u(2) by smt*)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   126
  have int_u_le:"\<And>k. lebesgue.simple_integral (u k) \<le> lebesgue.positive_integral f"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   127
    unfolding u_simple apply(rule lebesgue.positive_integral_mono)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   128
    using isoton_Sup[OF u(3)] unfolding le_fun_def by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   129
  have u_int_om:"\<And>i. lebesgue.simple_integral (u i) \<noteq> \<omega>"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   130
  proof- case goal1 thus ?case using int_u_le[of i] int_om by auto qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   131
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   132
  note u_int = simple_function_has_integral'[OF u(1) this]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   133
  have "(\<lambda>x. real (f x)) integrable_on UNIV \<and>
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   134
    (\<lambda>k. gintegral UNIV (\<lambda>x. real (u k x))) ----> gintegral UNIV (\<lambda>x. real (f x))"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   135
    apply(rule monotone_convergence_increasing) apply(rule,rule,rule u_int)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   136
  proof safe case goal1 show ?case apply(rule real_of_pinfreal_mono) using u(2,3) by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   137
  next case goal2 show ?case using u(3) apply(subst lim_Real[THEN sym])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   138
      prefer 3 apply(subst Real_real') defer apply(subst Real_real')
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   139
      using isotone_Lim[OF u(3)[unfolded isoton_fun_expand, THEN spec]] using f_om u by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   140
  next case goal3
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   141
    show ?case apply(rule bounded_realI[where B="real (lebesgue.positive_integral f)"])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   142
      apply safe apply(subst abs_of_nonneg) apply(rule integral_nonneg,rule) apply(rule u_int)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   143
      unfolding integral_unique[OF u_int] defer apply(rule real_of_pinfreal_mono[OF _ int_u_le])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   144
      using u int_om by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   145
  qed note int = conjunctD2[OF this]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   146
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   147
  have "(\<lambda>i. lebesgue.simple_integral (u i)) ----> ?i" unfolding u_simple
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   148
    apply(rule lebesgue.positive_integral_monotone_convergence(2))
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   149
    apply(rule lebesgue.borel_measurable_simple_function[OF u(1)])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   150
    using isotone_Lim[OF u(3)[unfolded isoton_fun_expand, THEN spec]] by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   151
  hence "(\<lambda>i. real (lebesgue.simple_integral (u i))) ----> real ?i" apply-
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   152
    apply(subst lim_Real[THEN sym]) prefer 3
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   153
    apply(subst Real_real') defer apply(subst Real_real')
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   154
    using u f_om int_om u_int_om by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   155
  note * = LIMSEQ_unique[OF this int(2)[unfolded integral_unique[OF u_int]]]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   156
  show ?thesis unfolding * by(rule integrable_integral[OF int(1)])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   157
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   158
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   159
lemma lebesgue_integral_has_integral:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   160
  fixes f::"'a::ordered_euclidean_space => real"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   161
  assumes f:"lebesgue.integrable f"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   162
  shows "(f has_integral (lebesgue.integral f)) UNIV"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   163
proof- let ?n = "\<lambda>x. - min (f x) 0" and ?p = "\<lambda>x. max (f x) 0"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   164
  have *:"f = (\<lambda>x. ?p x - ?n x)" apply rule by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   165
  note f = lebesgue.integrableD[OF f]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   166
  show ?thesis unfolding lebesgue.integral_def apply(subst *)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   167
  proof(rule has_integral_sub) case goal1
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   168
    have *:"\<forall>x. Real (f x) \<noteq> \<omega>" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   169
    note lebesgue.borel_measurable_Real[OF f(1)]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   170
    from positive_integral_has_integral[OF this f(2) *]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   171
    show ?case unfolding real_Real_max .
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   172
  next case goal2
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   173
    have *:"\<forall>x. Real (- f x) \<noteq> \<omega>" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   174
    note lebesgue.borel_measurable_uminus[OF f(1)]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   175
    note lebesgue.borel_measurable_Real[OF this]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   176
    from positive_integral_has_integral[OF this f(3) *]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   177
    show ?case unfolding real_Real_max minus_min_eq_max by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   178
  qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   179
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   180
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   181
lemma lmeasurable_imp_borel[dest]: fixes s::"'a::ordered_euclidean_space set"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   182
  assumes "s \<in> sets borel_space" shows "lmeasurable s"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   183
proof- let ?S = "range (\<lambda>(a, b). {a .. (b :: 'a\<Colon>ordered_euclidean_space)})"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   184
  have *:"?S \<subseteq> sets lebesgue_space" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   185
  have "s \<in> sigma_sets UNIV ?S" using assms
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   186
    unfolding borel_space_eq_atLeastAtMost by (simp add: sigma_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   187
  thus ?thesis using lebesgue.sigma_subset[of ?S,unfolded sets_sigma,OF *]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   188
    by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   189
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   190
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   191
lemma lmeasurable_open[dest]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   192
  assumes "open s" shows "lmeasurable s"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   193
proof- have "s \<in> sets borel_space" using assms by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   194
  thus ?thesis by auto qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   195
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   196
lemma continuous_on_imp_borel_measurable:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   197
  fixes f::"'a::ordered_euclidean_space \<Rightarrow> 'b::ordered_euclidean_space"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   198
  assumes "continuous_on UNIV f"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   199
  shows "f \<in> borel_measurable lebesgue_space"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   200
  apply(rule lebesgue.borel_measurableI)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   201
  unfolding lebesgue_measurable apply(rule lmeasurable_open)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   202
  using continuous_open_preimage[OF assms] unfolding vimage_def by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   203
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   204
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   205
lemma (in measure_space) integral_monotone_convergence_pos':
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   206
  assumes i: "\<And>i. integrable (f i)" and mono: "\<And>x. mono (\<lambda>n. f n x)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   207
  and pos: "\<And>x i. 0 \<le> f i x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   208
  and lim: "\<And>x. (\<lambda>i. f i x) ----> u x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   209
  and ilim: "(\<lambda>i. integral (f i)) ----> x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   210
  shows "integrable u \<and> integral u = x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   211
  using integral_monotone_convergence_pos[OF assms] by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   212
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   213
end