src/HOL/Probability/Lebesgue_Measure.thy
author hoelzl
Fri, 04 Feb 2011 14:16:55 +0100
changeset 41706 a207a858d1f6
parent 41704 8c539202f854
child 41831 91a2b435dd7a
permissions -rw-r--r--
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
     1
(*  Author: Robert Himmelmann, TU Muenchen *)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     2
header {* Lebsegue measure *}
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     3
theory Lebesgue_Measure
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
     4
  imports Product_Measure
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     5
begin
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     6
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     7
subsection {* Standard Cubes *}
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
     8
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
     9
definition cube :: "nat \<Rightarrow> 'a::ordered_euclidean_space set" where
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    10
  "cube n \<equiv> {\<chi>\<chi> i. - real n .. \<chi>\<chi> i. real n}"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    11
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    12
lemma cube_closed[intro]: "closed (cube n)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    13
  unfolding cube_def by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    14
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    15
lemma cube_subset[intro]: "n \<le> N \<Longrightarrow> cube n \<subseteq> cube N"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    16
  by (fastsimp simp: eucl_le[where 'a='a] cube_def)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    17
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    18
lemma cube_subset_iff:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    19
  "cube n \<subseteq> cube N \<longleftrightarrow> n \<le> N"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    20
proof
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    21
  assume subset: "cube n \<subseteq> (cube N::'a set)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    22
  then have "((\<chi>\<chi> i. real n)::'a) \<in> cube N"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    23
    using DIM_positive[where 'a='a]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    24
    by (fastsimp simp: cube_def eucl_le[where 'a='a])
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    25
  then show "n \<le> N"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    26
    by (fastsimp simp: cube_def eucl_le[where 'a='a])
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    27
next
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    28
  assume "n \<le> N" then show "cube n \<subseteq> (cube N::'a set)" by (rule cube_subset)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
    29
qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    30
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    31
lemma ball_subset_cube:"ball (0::'a::ordered_euclidean_space) (real n) \<subseteq> cube n"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    32
  unfolding cube_def subset_eq mem_interval apply safe unfolding euclidean_lambda_beta'
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    33
proof- fix x::'a and i assume as:"x\<in>ball 0 (real n)" "i<DIM('a)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    34
  thus "- real n \<le> x $$ i" "real n \<ge> x $$ i"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    35
    using component_le_norm[of x i] by(auto simp: dist_norm)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    36
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    37
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    38
lemma mem_big_cube: obtains n where "x \<in> cube n"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    39
proof- from real_arch_lt[of "norm x"] guess n ..
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    40
  thus ?thesis apply-apply(rule that[where n=n])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    41
    apply(rule ball_subset_cube[unfolded subset_eq,rule_format])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    42
    by (auto simp add:dist_norm)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    43
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    44
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
    45
lemma cube_subset_Suc[intro]: "cube n \<subseteq> cube (Suc n)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
    46
  unfolding cube_def_raw subset_eq apply safe unfolding mem_interval by auto
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    47
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
    48
lemma Pi_iff: "f \<in> Pi I X \<longleftrightarrow> (\<forall>i\<in>I. f i \<in> X i)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
    49
  unfolding Pi_def by auto
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
    50
41706
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
    51
subsection {* Lebesgue measure *}
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
    52
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
    53
definition lebesgue :: "'a::ordered_euclidean_space measure_space" where
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
    54
  "lebesgue = \<lparr> space = UNIV,
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
    55
    sets = {A. \<forall>n. (indicator A :: 'a \<Rightarrow> real) integrable_on cube n},
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
    56
    measure = \<lambda>A. SUP n. Real (integral (cube n) (indicator A)) \<rparr>"
41661
baf1964bc468 use pre-image measure, instead of image
hoelzl
parents: 41654
diff changeset
    57
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    58
lemma space_lebesgue[simp]: "space lebesgue = UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    59
  unfolding lebesgue_def by simp
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    60
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    61
lemma lebesgueD: "A \<in> sets lebesgue \<Longrightarrow> (indicator A :: _ \<Rightarrow> real) integrable_on cube n"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    62
  unfolding lebesgue_def by simp
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    63
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    64
lemma lebesgueI: "(\<And>n. (indicator A :: _ \<Rightarrow> real) integrable_on cube n) \<Longrightarrow> A \<in> sets lebesgue"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    65
  unfolding lebesgue_def by simp
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    66
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    67
lemma absolutely_integrable_on_indicator[simp]:
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    68
  fixes A :: "'a::ordered_euclidean_space set"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    69
  shows "((indicator A :: _ \<Rightarrow> real) absolutely_integrable_on X) \<longleftrightarrow>
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    70
    (indicator A :: _ \<Rightarrow> real) integrable_on X"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    71
  unfolding absolutely_integrable_on_def by simp
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    72
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    73
lemma LIMSEQ_indicator_UN:
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    74
  "(\<lambda>k. indicator (\<Union> i<k. A i) x) ----> (indicator (\<Union>i. A i) x :: real)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    75
proof cases
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    76
  assume "\<exists>i. x \<in> A i" then guess i .. note i = this
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    77
  then have *: "\<And>n. (indicator (\<Union> i<n + Suc i. A i) x :: real) = 1"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    78
    "(indicator (\<Union> i. A i) x :: real) = 1" by (auto simp: indicator_def)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    79
  show ?thesis
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    80
    apply (rule LIMSEQ_offset[of _ "Suc i"]) unfolding * by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    81
qed (auto simp: indicator_def)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    82
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    83
lemma indicator_add:
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    84
  "A \<inter> B = {} \<Longrightarrow> (indicator A x::_::monoid_add) + indicator B x = indicator (A \<union> B) x"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    85
  unfolding indicator_def by auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
    86
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    87
interpretation lebesgue: sigma_algebra lebesgue
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    88
proof (intro sigma_algebra_iff2[THEN iffD2] conjI allI ballI impI lebesgueI)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    89
  fix A n assume A: "A \<in> sets lebesgue"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    90
  have "indicator (space lebesgue - A) = (\<lambda>x. 1 - indicator A x :: real)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    91
    by (auto simp: fun_eq_iff indicator_def)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    92
  then show "(indicator (space lebesgue - A) :: _ \<Rightarrow> real) integrable_on cube n"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    93
    using A by (auto intro!: integrable_sub dest: lebesgueD simp: cube_def)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    94
next
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    95
  fix n show "(indicator {} :: _\<Rightarrow>real) integrable_on cube n"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    96
    by (auto simp: cube_def indicator_def_raw)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    97
next
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    98
  fix A :: "nat \<Rightarrow> 'a set" and n ::nat assume "range A \<subseteq> sets lebesgue"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
    99
  then have A: "\<And>i. (indicator (A i) :: _ \<Rightarrow> real) integrable_on cube n"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   100
    by (auto dest: lebesgueD)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   101
  show "(indicator (\<Union>i. A i) :: _ \<Rightarrow> real) integrable_on cube n" (is "?g integrable_on _")
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   102
  proof (intro dominated_convergence[where g="?g"] ballI)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   103
    fix k show "(indicator (\<Union>i<k. A i) :: _ \<Rightarrow> real) integrable_on cube n"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   104
    proof (induct k)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   105
      case (Suc k)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   106
      have *: "(\<Union> i<Suc k. A i) = (\<Union> i<k. A i) \<union> A k"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   107
        unfolding lessThan_Suc UN_insert by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   108
      have *: "(\<lambda>x. max (indicator (\<Union> i<k. A i) x) (indicator (A k) x) :: real) =
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   109
          indicator (\<Union> i<Suc k. A i)" (is "(\<lambda>x. max (?f x) (?g x)) = _")
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   110
        by (auto simp: fun_eq_iff * indicator_def)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   111
      show ?case
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   112
        using absolutely_integrable_max[of ?f "cube n" ?g] A Suc by (simp add: *)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   113
    qed auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   114
  qed (auto intro: LIMSEQ_indicator_UN simp: cube_def)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   115
qed simp
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   116
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   117
interpretation lebesgue: measure_space lebesgue
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   118
proof
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   119
  have *: "indicator {} = (\<lambda>x. 0 :: real)" by (simp add: fun_eq_iff)
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   120
  show "measure lebesgue {} = 0" by (simp add: integral_0 * lebesgue_def)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   121
next
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   122
  show "countably_additive lebesgue (measure lebesgue)"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   123
  proof (intro countably_additive_def[THEN iffD2] allI impI)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   124
    fix A :: "nat \<Rightarrow> 'b set" assume rA: "range A \<subseteq> sets lebesgue" "disjoint_family A"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   125
    then have A[simp, intro]: "\<And>i n. (indicator (A i) :: _ \<Rightarrow> real) integrable_on cube n"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   126
      by (auto dest: lebesgueD)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   127
    let "?m n i" = "integral (cube n) (indicator (A i) :: _\<Rightarrow>real)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   128
    let "?M n I" = "integral (cube n) (indicator (\<Union>i\<in>I. A i) :: _\<Rightarrow>real)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   129
    have nn[simp, intro]: "\<And>i n. 0 \<le> ?m n i" by (auto intro!: integral_nonneg)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   130
    assume "(\<Union>i. A i) \<in> sets lebesgue"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   131
    then have UN_A[simp, intro]: "\<And>i n. (indicator (\<Union>i. A i) :: _ \<Rightarrow> real) integrable_on cube n"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   132
      by (auto dest: lebesgueD)
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   133
    show "(\<Sum>\<^isub>\<infinity>n. measure lebesgue (A n)) = measure lebesgue (\<Union>i. A i)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   134
    proof (simp add: lebesgue_def, subst psuminf_SUP_eq)
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   135
      fix n i show "Real (?m n i) \<le> Real (?m (Suc n) i)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   136
        using cube_subset[of n "Suc n"] by (auto intro!: integral_subset_le)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   137
    next
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   138
      show "(SUP n. \<Sum>\<^isub>\<infinity>i. Real (?m n i)) = (SUP n. Real (?M n UNIV))"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   139
        unfolding psuminf_def
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   140
      proof (subst setsum_Real, (intro arg_cong[where f="SUPR UNIV"] ext ballI nn SUP_eq_LIMSEQ[THEN iffD2])+)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   141
        fix n :: nat show "mono (\<lambda>m. \<Sum>x<m. ?m n x)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   142
        proof (intro mono_iff_le_Suc[THEN iffD2] allI)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   143
          fix m show "(\<Sum>x<m. ?m n x) \<le> (\<Sum>x<Suc m. ?m n x)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   144
            using nn[of n m] by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   145
        qed
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   146
        show "0 \<le> ?M n UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   147
          using UN_A by (auto intro!: integral_nonneg)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   148
        fix m show "0 \<le> (\<Sum>x<m. ?m n x)" by (auto intro!: setsum_nonneg)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   149
      next
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   150
        fix n
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   151
        have "\<And>m. (UNION {..<m} A) \<in> sets lebesgue" using rA by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   152
        from lebesgueD[OF this]
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   153
        have "(\<lambda>m. ?M n {..< m}) ----> ?M n UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   154
          (is "(\<lambda>m. integral _ (?A m)) ----> ?I")
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   155
          by (intro dominated_convergence(2)[where f="?A" and h="\<lambda>x. 1::real"])
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   156
             (auto intro: LIMSEQ_indicator_UN simp: cube_def)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   157
        moreover
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   158
        { fix m have *: "(\<Sum>x<m. ?m n x) = ?M n {..< m}"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   159
          proof (induct m)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   160
            case (Suc m)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   161
            have "(\<Union>i<m. A i) \<in> sets lebesgue" using rA by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   162
            then have "(indicator (\<Union>i<m. A i) :: _\<Rightarrow>real) integrable_on (cube n)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   163
              by (auto dest!: lebesgueD)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   164
            moreover
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   165
            have "(\<Union>i<m. A i) \<inter> A m = {}"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   166
              using rA(2)[unfolded disjoint_family_on_def, THEN bspec, of m]
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   167
              by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   168
            then have "\<And>x. indicator (\<Union>i<Suc m. A i) x =
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   169
              indicator (\<Union>i<m. A i) x + (indicator (A m) x :: real)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   170
              by (auto simp: indicator_add lessThan_Suc ac_simps)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   171
            ultimately show ?case
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   172
              using Suc A by (simp add: integral_add[symmetric])
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   173
          qed auto }
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   174
        ultimately show "(\<lambda>m. \<Sum>x<m. ?m n x) ----> ?M n UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   175
          by simp
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   176
      qed
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   177
    qed
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   178
  qed
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   179
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   180
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   181
lemma has_integral_interval_cube:
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   182
  fixes a b :: "'a::ordered_euclidean_space"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   183
  shows "(indicator {a .. b} has_integral
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   184
    content ({\<chi>\<chi> i. max (- real n) (a $$ i) .. \<chi>\<chi> i. min (real n) (b $$ i)} :: 'a set)) (cube n)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   185
    (is "(?I has_integral content ?R) (cube n)")
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   186
proof -
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   187
  let "{?N .. ?P}" = ?R
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   188
  have [simp]: "(\<lambda>x. if x \<in> cube n then ?I x else 0) = indicator ?R"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   189
    by (auto simp: indicator_def cube_def fun_eq_iff eucl_le[where 'a='a])
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   190
  have "(?I has_integral content ?R) (cube n) \<longleftrightarrow> (indicator ?R has_integral content ?R) UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   191
    unfolding has_integral_restrict_univ[where s="cube n", symmetric] by simp
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   192
  also have "\<dots> \<longleftrightarrow> ((\<lambda>x. 1) has_integral content ?R) ?R"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   193
    unfolding indicator_def_raw has_integral_restrict_univ ..
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   194
  finally show ?thesis
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   195
    using has_integral_const[of "1::real" "?N" "?P"] by simp
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   196
qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   197
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   198
lemma lebesgueI_borel[intro, simp]:
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   199
  fixes s::"'a::ordered_euclidean_space set"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   200
  assumes "s \<in> sets borel" shows "s \<in> sets lebesgue"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   201
proof -
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   202
  let ?S = "range (\<lambda>(a, b). {a .. (b :: 'a\<Colon>ordered_euclidean_space)})"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   203
  have *:"?S \<subseteq> sets lebesgue"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   204
  proof (safe intro!: lebesgueI)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   205
    fix n :: nat and a b :: 'a
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   206
    let ?N = "\<chi>\<chi> i. max (- real n) (a $$ i)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   207
    let ?P = "\<chi>\<chi> i. min (real n) (b $$ i)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   208
    show "(indicator {a..b} :: 'a\<Rightarrow>real) integrable_on cube n"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   209
      unfolding integrable_on_def
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   210
      using has_integral_interval_cube[of a b] by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   211
  qed
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   212
  have "s \<in> sigma_sets UNIV ?S" using assms
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   213
    unfolding borel_eq_atLeastAtMost by (simp add: sigma_def)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   214
  thus ?thesis
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   215
    using lebesgue.sigma_subset[of "\<lparr> space = UNIV, sets = ?S\<rparr>", simplified, OF *]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   216
    by (auto simp: sigma_def)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   217
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   218
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   219
lemma lebesgueI_negligible[dest]: fixes s::"'a::ordered_euclidean_space set"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   220
  assumes "negligible s" shows "s \<in> sets lebesgue"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   221
  using assms by (force simp: cube_def integrable_on_def negligible_def intro!: lebesgueI)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   222
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   223
lemma lmeasure_eq_0:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   224
  fixes S :: "'a::ordered_euclidean_space set" assumes "negligible S" shows "lebesgue.\<mu> S = 0"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   225
proof -
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   226
  have "\<And>n. integral (cube n) (indicator S :: 'a\<Rightarrow>real) = 0"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   227
    unfolding lebesgue_integral_def using assms
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   228
    by (intro integral_unique some1_equality ex_ex1I)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   229
       (auto simp: cube_def negligible_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   230
  then show ?thesis by (auto simp: lebesgue_def)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   231
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   232
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   233
lemma lmeasure_iff_LIMSEQ:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   234
  assumes "A \<in> sets lebesgue" "0 \<le> m"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   235
  shows "lebesgue.\<mu> A = Real m \<longleftrightarrow> (\<lambda>n. integral (cube n) (indicator A :: _ \<Rightarrow> real)) ----> m"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   236
proof (simp add: lebesgue_def, intro SUP_eq_LIMSEQ)
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   237
  show "mono (\<lambda>n. integral (cube n) (indicator A::_=>real))"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   238
    using cube_subset assms by (intro monoI integral_subset_le) (auto dest!: lebesgueD)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   239
  fix n show "0 \<le> integral (cube n) (indicator A::_=>real)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   240
    using assms by (auto dest!: lebesgueD intro!: integral_nonneg)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   241
qed fact
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   242
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   243
lemma has_integral_indicator_UNIV:
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   244
  fixes s A :: "'a::ordered_euclidean_space set" and x :: real
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   245
  shows "((indicator (s \<inter> A) :: 'a\<Rightarrow>real) has_integral x) UNIV = ((indicator s :: _\<Rightarrow>real) has_integral x) A"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   246
proof -
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   247
  have "(\<lambda>x. if x \<in> A then indicator s x else 0) = (indicator (s \<inter> A) :: _\<Rightarrow>real)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   248
    by (auto simp: fun_eq_iff indicator_def)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   249
  then show ?thesis
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   250
    unfolding has_integral_restrict_univ[where s=A, symmetric] by simp
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   251
qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   252
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   253
lemma
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   254
  fixes s a :: "'a::ordered_euclidean_space set"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   255
  shows integral_indicator_UNIV:
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   256
    "integral UNIV (indicator (s \<inter> A) :: 'a\<Rightarrow>real) = integral A (indicator s :: _\<Rightarrow>real)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   257
  and integrable_indicator_UNIV:
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   258
    "(indicator (s \<inter> A) :: 'a\<Rightarrow>real) integrable_on UNIV \<longleftrightarrow> (indicator s :: 'a\<Rightarrow>real) integrable_on A"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   259
  unfolding integral_def integrable_on_def has_integral_indicator_UNIV by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   260
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   261
lemma lmeasure_finite_has_integral:
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   262
  fixes s :: "'a::ordered_euclidean_space set"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   263
  assumes "s \<in> sets lebesgue" "lebesgue.\<mu> s = Real m" "0 \<le> m"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   264
  shows "(indicator s has_integral m) UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   265
proof -
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   266
  let ?I = "indicator :: 'a set \<Rightarrow> 'a \<Rightarrow> real"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   267
  have **: "(?I s) integrable_on UNIV \<and> (\<lambda>k. integral UNIV (?I (s \<inter> cube k))) ----> integral UNIV (?I s)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   268
  proof (intro monotone_convergence_increasing allI ballI)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   269
    have LIMSEQ: "(\<lambda>n. integral (cube n) (?I s)) ----> m"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   270
      using assms(2) unfolding lmeasure_iff_LIMSEQ[OF assms(1, 3)] .
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   271
    { fix n have "integral (cube n) (?I s) \<le> m"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   272
        using cube_subset assms
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   273
        by (intro incseq_le[where L=m] LIMSEQ incseq_def[THEN iffD2] integral_subset_le allI impI)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   274
           (auto dest!: lebesgueD) }
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   275
    moreover
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   276
    { fix n have "0 \<le> integral (cube n) (?I s)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   277
      using assms by (auto dest!: lebesgueD intro!: integral_nonneg) }
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   278
    ultimately
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   279
    show "bounded {integral UNIV (?I (s \<inter> cube k)) |k. True}"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   280
      unfolding bounded_def
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   281
      apply (rule_tac exI[of _ 0])
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   282
      apply (rule_tac exI[of _ m])
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   283
      by (auto simp: dist_real_def integral_indicator_UNIV)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   284
    fix k show "?I (s \<inter> cube k) integrable_on UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   285
      unfolding integrable_indicator_UNIV using assms by (auto dest!: lebesgueD)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   286
    fix x show "?I (s \<inter> cube k) x \<le> ?I (s \<inter> cube (Suc k)) x"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   287
      using cube_subset[of k "Suc k"] by (auto simp: indicator_def)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   288
  next
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   289
    fix x :: 'a
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   290
    from mem_big_cube obtain k where k: "x \<in> cube k" .
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   291
    { fix n have "?I (s \<inter> cube (n + k)) x = ?I s x"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   292
      using k cube_subset[of k "n + k"] by (auto simp: indicator_def) }
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   293
    note * = this
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   294
    show "(\<lambda>k. ?I (s \<inter> cube k) x) ----> ?I s x"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   295
      by (rule LIMSEQ_offset[where k=k]) (auto simp: *)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   296
  qed
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   297
  note ** = conjunctD2[OF this]
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   298
  have m: "m = integral UNIV (?I s)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   299
    apply (intro LIMSEQ_unique[OF _ **(2)])
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   300
    using assms(2) unfolding lmeasure_iff_LIMSEQ[OF assms(1,3)] integral_indicator_UNIV .
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   301
  show ?thesis
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   302
    unfolding m by (intro integrable_integral **)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   303
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   304
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   305
lemma lmeasure_finite_integrable: assumes "s \<in> sets lebesgue" "lebesgue.\<mu> s \<noteq> \<omega>"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   306
  shows "(indicator s :: _ \<Rightarrow> real) integrable_on UNIV"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   307
proof (cases "lebesgue.\<mu> s")
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   308
  case (preal m) from lmeasure_finite_has_integral[OF `s \<in> sets lebesgue` this]
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   309
  show ?thesis unfolding integrable_on_def by auto
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   310
qed (insert assms, auto)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   311
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   312
lemma has_integral_lebesgue: assumes "((indicator s :: _\<Rightarrow>real) has_integral m) UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   313
  shows "s \<in> sets lebesgue"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   314
proof (intro lebesgueI)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   315
  let ?I = "indicator :: 'a set \<Rightarrow> 'a \<Rightarrow> real"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   316
  fix n show "(?I s) integrable_on cube n" unfolding cube_def
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   317
  proof (intro integrable_on_subinterval)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   318
    show "(?I s) integrable_on UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   319
      unfolding integrable_on_def using assms by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   320
  qed auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   321
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   322
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   323
lemma has_integral_lmeasure: assumes "((indicator s :: _\<Rightarrow>real) has_integral m) UNIV"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   324
  shows "lebesgue.\<mu> s = Real m"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   325
proof (intro lmeasure_iff_LIMSEQ[THEN iffD2])
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   326
  let ?I = "indicator :: 'a set \<Rightarrow> 'a \<Rightarrow> real"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   327
  show "s \<in> sets lebesgue" using has_integral_lebesgue[OF assms] .
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   328
  show "0 \<le> m" using assms by (rule has_integral_nonneg) auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   329
  have "(\<lambda>n. integral UNIV (?I (s \<inter> cube n))) ----> integral UNIV (?I s)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   330
  proof (intro dominated_convergence(2) ballI)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   331
    show "(?I s) integrable_on UNIV" unfolding integrable_on_def using assms by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   332
    fix n show "?I (s \<inter> cube n) integrable_on UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   333
      unfolding integrable_indicator_UNIV using `s \<in> sets lebesgue` by (auto dest: lebesgueD)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   334
    fix x show "norm (?I (s \<inter> cube n) x) \<le> ?I s x" by (auto simp: indicator_def)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   335
  next
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   336
    fix x :: 'a
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   337
    from mem_big_cube obtain k where k: "x \<in> cube k" .
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   338
    { fix n have "?I (s \<inter> cube (n + k)) x = ?I s x"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   339
      using k cube_subset[of k "n + k"] by (auto simp: indicator_def) }
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   340
    note * = this
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   341
    show "(\<lambda>k. ?I (s \<inter> cube k) x) ----> ?I s x"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   342
      by (rule LIMSEQ_offset[where k=k]) (auto simp: *)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   343
  qed
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   344
  then show "(\<lambda>n. integral (cube n) (?I s)) ----> m"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   345
    unfolding integral_unique[OF assms] integral_indicator_UNIV by simp
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   346
qed
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   347
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   348
lemma has_integral_iff_lmeasure:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   349
  "(indicator A has_integral m) UNIV \<longleftrightarrow> (A \<in> sets lebesgue \<and> 0 \<le> m \<and> lebesgue.\<mu> A = Real m)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   350
proof
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   351
  assume "(indicator A has_integral m) UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   352
  with has_integral_lmeasure[OF this] has_integral_lebesgue[OF this]
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   353
  show "A \<in> sets lebesgue \<and> 0 \<le> m \<and> lebesgue.\<mu> A = Real m"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   354
    by (auto intro: has_integral_nonneg)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   355
next
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   356
  assume "A \<in> sets lebesgue \<and> 0 \<le> m \<and> lebesgue.\<mu> A = Real m"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   357
  then show "(indicator A has_integral m) UNIV" by (intro lmeasure_finite_has_integral) auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   358
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   359
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   360
lemma lmeasure_eq_integral: assumes "(indicator s::_\<Rightarrow>real) integrable_on UNIV"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   361
  shows "lebesgue.\<mu> s = Real (integral UNIV (indicator s))"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   362
  using assms unfolding integrable_on_def
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   363
proof safe
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   364
  fix y :: real assume "(indicator s has_integral y) UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   365
  from this[unfolded has_integral_iff_lmeasure] integral_unique[OF this]
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   366
  show "lebesgue.\<mu> s = Real (integral UNIV (indicator s))" by simp
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   367
qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   368
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   369
lemma lebesgue_simple_function_indicator:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40874
diff changeset
   370
  fixes f::"'a::ordered_euclidean_space \<Rightarrow> pextreal"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   371
  assumes f:"simple_function lebesgue f"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   372
  shows "f = (\<lambda>x. (\<Sum>y \<in> f ` UNIV. y * indicator (f -` {y}) x))"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   373
  by (rule, subst lebesgue.simple_function_indicator_representation[OF f]) auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   374
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   375
lemma integral_eq_lmeasure:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   376
  "(indicator s::_\<Rightarrow>real) integrable_on UNIV \<Longrightarrow> integral UNIV (indicator s) = real (lebesgue.\<mu> s)"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   377
  by (subst lmeasure_eq_integral) (auto intro!: integral_nonneg)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   378
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   379
lemma lmeasure_finite: assumes "(indicator s::_\<Rightarrow>real) integrable_on UNIV" shows "lebesgue.\<mu> s \<noteq> \<omega>"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   380
  using lmeasure_eq_integral[OF assms] by auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   381
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   382
lemma negligible_iff_lebesgue_null_sets:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   383
  "negligible A \<longleftrightarrow> A \<in> lebesgue.null_sets"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   384
proof
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   385
  assume "negligible A"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   386
  from this[THEN lebesgueI_negligible] this[THEN lmeasure_eq_0]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   387
  show "A \<in> lebesgue.null_sets" by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   388
next
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   389
  assume A: "A \<in> lebesgue.null_sets"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   390
  then have *:"((indicator A) has_integral (0::real)) UNIV" using lmeasure_finite_has_integral[of A] by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   391
  show "negligible A" unfolding negligible_def
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   392
  proof (intro allI)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   393
    fix a b :: 'a
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   394
    have integrable: "(indicator A :: _\<Rightarrow>real) integrable_on {a..b}"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   395
      by (intro integrable_on_subinterval has_integral_integrable) (auto intro: *)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   396
    then have "integral {a..b} (indicator A) \<le> (integral UNIV (indicator A) :: real)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   397
      using * by (auto intro!: integral_subset_le has_integral_integrable)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   398
    moreover have "(0::real) \<le> integral {a..b} (indicator A)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   399
      using integrable by (auto intro!: integral_nonneg)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   400
    ultimately have "integral {a..b} (indicator A) = (0::real)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   401
      using integral_unique[OF *] by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   402
    then show "(indicator A has_integral (0::real)) {a..b}"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   403
      using integrable_integral[OF integrable] by simp
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   404
  qed
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   405
qed
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   406
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   407
lemma integral_const[simp]:
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   408
  fixes a b :: "'a::ordered_euclidean_space"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   409
  shows "integral {a .. b} (\<lambda>x. c) = content {a .. b} *\<^sub>R c"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   410
  by (rule integral_unique) (rule has_integral_const)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   411
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   412
lemma lmeasure_UNIV[intro]: "lebesgue.\<mu> (UNIV::'a::ordered_euclidean_space set) = \<omega>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   413
proof (simp add: lebesgue_def SUP_\<omega>, intro allI impI)
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   414
  fix x assume "x < \<omega>"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   415
  then obtain r where r: "x = Real r" "0 \<le> r" by (cases x) auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   416
  then obtain n where n: "r < of_nat n" using ex_less_of_nat by auto
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   417
  show "\<exists>i. x < Real (integral (cube i) (indicator UNIV::'a\<Rightarrow>real))"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   418
  proof (intro exI[of _ n])
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   419
    have [simp]: "indicator UNIV = (\<lambda>x. 1)" by (auto simp: fun_eq_iff)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   420
    { fix m :: nat assume "0 < m" then have "real n \<le> (\<Prod>x<m. 2 * real n)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   421
      proof (induct m)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   422
        case (Suc m)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   423
        show ?case
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   424
        proof cases
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   425
          assume "m = 0" then show ?thesis by (simp add: lessThan_Suc)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   426
        next
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   427
          assume "m \<noteq> 0" then have "real n \<le> (\<Prod>x<m. 2 * real n)" using Suc by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   428
          then show ?thesis
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   429
            by (auto simp: lessThan_Suc field_simps mult_le_cancel_left1)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   430
        qed
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   431
      qed auto } note this[OF DIM_positive[where 'a='a], simp]
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   432
    then have [simp]: "0 \<le> (\<Prod>x<DIM('a). 2 * real n)" using real_of_nat_ge_zero by arith
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   433
    have "x < Real (of_nat n)" using n r by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   434
    also have "Real (of_nat n) \<le> Real (integral (cube n) (indicator UNIV::'a\<Rightarrow>real))"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   435
      by (auto simp: real_eq_of_nat[symmetric] cube_def content_closed_interval_cases)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   436
    finally show "x < Real (integral (cube n) (indicator UNIV::'a\<Rightarrow>real))" .
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   437
  qed
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   438
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   439
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   440
lemma
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   441
  fixes a b ::"'a::ordered_euclidean_space"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   442
  shows lmeasure_atLeastAtMost[simp]: "lebesgue.\<mu> {a..b} = Real (content {a..b})"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   443
proof -
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   444
  have "(indicator (UNIV \<inter> {a..b})::_\<Rightarrow>real) integrable_on UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   445
    unfolding integrable_indicator_UNIV by (simp add: integrable_const indicator_def_raw)
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   446
  from lmeasure_eq_integral[OF this] show ?thesis unfolding integral_indicator_UNIV
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   447
    by (simp add: indicator_def_raw)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   448
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   449
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   450
lemma atLeastAtMost_singleton_euclidean[simp]:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   451
  fixes a :: "'a::ordered_euclidean_space" shows "{a .. a} = {a}"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   452
  by (force simp: eucl_le[where 'a='a] euclidean_eq[where 'a='a])
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   453
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   454
lemma content_singleton[simp]: "content {a} = 0"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   455
proof -
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   456
  have "content {a .. a} = 0"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   457
    by (subst content_closed_interval) auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   458
  then show ?thesis by simp
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   459
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   460
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   461
lemma lmeasure_singleton[simp]:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   462
  fixes a :: "'a::ordered_euclidean_space" shows "lebesgue.\<mu> {a} = 0"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   463
  using lmeasure_atLeastAtMost[of a a] by simp
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   464
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   465
declare content_real[simp]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   466
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   467
lemma
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   468
  fixes a b :: real
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   469
  shows lmeasure_real_greaterThanAtMost[simp]:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   470
    "lebesgue.\<mu> {a <.. b} = Real (if a \<le> b then b - a else 0)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   471
proof cases
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   472
  assume "a < b"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   473
  then have "lebesgue.\<mu> {a <.. b} = lebesgue.\<mu> {a .. b} - lebesgue.\<mu> {a}"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   474
    by (subst lebesgue.measure_Diff[symmetric])
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   475
       (auto intro!: arg_cong[where f=lebesgue.\<mu>])
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   476
  then show ?thesis by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   477
qed auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   478
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   479
lemma
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   480
  fixes a b :: real
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   481
  shows lmeasure_real_atLeastLessThan[simp]:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   482
    "lebesgue.\<mu> {a ..< b} = Real (if a \<le> b then b - a else 0)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   483
proof cases
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   484
  assume "a < b"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   485
  then have "lebesgue.\<mu> {a ..< b} = lebesgue.\<mu> {a .. b} - lebesgue.\<mu> {b}"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   486
    by (subst lebesgue.measure_Diff[symmetric])
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   487
       (auto intro!: arg_cong[where f=lebesgue.\<mu>])
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   488
  then show ?thesis by auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   489
qed auto
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   490
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   491
lemma
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   492
  fixes a b :: real
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   493
  shows lmeasure_real_greaterThanLessThan[simp]:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   494
    "lebesgue.\<mu> {a <..< b} = Real (if a \<le> b then b - a else 0)"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   495
proof cases
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   496
  assume "a < b"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   497
  then have "lebesgue.\<mu> {a <..< b} = lebesgue.\<mu> {a <.. b} - lebesgue.\<mu> {b}"
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   498
    by (subst lebesgue.measure_Diff[symmetric])
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   499
       (auto intro!: arg_cong[where f=lebesgue.\<mu>])
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   500
  then show ?thesis by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   501
qed auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   502
41706
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   503
subsection {* Lebesgue-Borel measure *}
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   504
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   505
definition "lborel = lebesgue \<lparr> sets := sets borel \<rparr>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   506
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   507
lemma
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   508
  shows space_lborel[simp]: "space lborel = UNIV"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   509
  and sets_lborel[simp]: "sets lborel = sets borel"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   510
  and measure_lborel[simp]: "measure lborel = lebesgue.\<mu>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   511
  and measurable_lborel[simp]: "measurable lborel = measurable borel"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   512
  by (simp_all add: measurable_def_raw lborel_def)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   513
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   514
interpretation lborel: measure_space lborel
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   515
  where "space lborel = UNIV"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   516
  and "sets lborel = sets borel"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   517
  and "measure lborel = lebesgue.\<mu>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   518
  and "measurable lborel = measurable borel"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   519
proof -
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   520
  show "measure_space lborel"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   521
  proof
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   522
    show "countably_additive lborel (measure lborel)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   523
      using lebesgue.ca unfolding countably_additive_def lborel_def
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   524
      apply safe apply (erule_tac x=A in allE) by auto
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   525
  qed (auto simp: lborel_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   526
qed simp_all
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   527
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   528
interpretation lborel: sigma_finite_measure lborel
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   529
  where "space lborel = UNIV"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   530
  and "sets lborel = sets borel"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   531
  and "measure lborel = lebesgue.\<mu>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   532
  and "measurable lborel = measurable borel"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   533
proof -
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   534
  show "sigma_finite_measure lborel"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   535
  proof (default, intro conjI exI[of _ "\<lambda>n. cube n"])
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   536
    show "range cube \<subseteq> sets lborel" by (auto intro: borel_closed)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   537
    { fix x have "\<exists>n. x\<in>cube n" using mem_big_cube by auto }
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   538
    thus "(\<Union>i. cube i) = space lborel" by auto
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   539
    show "\<forall>i. measure lborel (cube i) \<noteq> \<omega>" by (simp add: cube_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   540
  qed
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   541
qed simp_all
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   542
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   543
interpretation lebesgue: sigma_finite_measure lebesgue
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   544
proof
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   545
  from lborel.sigma_finite guess A ..
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   546
  moreover then have "range A \<subseteq> sets lebesgue" using lebesgueI_borel by blast
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   547
  ultimately show "\<exists>A::nat \<Rightarrow> 'b set. range A \<subseteq> sets lebesgue \<and> (\<Union>i. A i) = space lebesgue \<and> (\<forall>i. lebesgue.\<mu> (A i) \<noteq> \<omega>)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   548
    by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   549
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   550
41706
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   551
subsection {* Lebesgue integrable implies Gauge integrable *}
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   552
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   553
lemma simple_function_has_integral:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40874
diff changeset
   554
  fixes f::"'a::ordered_euclidean_space \<Rightarrow> pextreal"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   555
  assumes f:"simple_function lebesgue f"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   556
  and f':"\<forall>x. f x \<noteq> \<omega>"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   557
  and om:"\<forall>x\<in>range f. lebesgue.\<mu> (f -` {x} \<inter> UNIV) = \<omega> \<longrightarrow> x = 0"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   558
  shows "((\<lambda>x. real (f x)) has_integral (real (integral\<^isup>S lebesgue f))) UNIV"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   559
  unfolding simple_integral_def
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   560
  apply(subst lebesgue_simple_function_indicator[OF f])
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   561
proof -
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   562
  case goal1
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   563
  have *:"\<And>x. \<forall>y\<in>range f. y * indicator (f -` {y}) x \<noteq> \<omega>"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   564
    "\<forall>x\<in>range f. x * lebesgue.\<mu> (f -` {x} \<inter> UNIV) \<noteq> \<omega>"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   565
    using f' om unfolding indicator_def by auto
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40874
diff changeset
   566
  show ?case unfolding space_lebesgue real_of_pextreal_setsum'[OF *(1),THEN sym]
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40874
diff changeset
   567
    unfolding real_of_pextreal_setsum'[OF *(2),THEN sym]
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40874
diff changeset
   568
    unfolding real_of_pextreal_setsum space_lebesgue
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   569
    apply(rule has_integral_setsum)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   570
  proof safe show "finite (range f)" using f by (auto dest: lebesgue.simple_functionD)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   571
    fix y::'a show "((\<lambda>x. real (f y * indicator (f -` {f y}) x)) has_integral
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   572
      real (f y * lebesgue.\<mu> (f -` {f y} \<inter> UNIV))) UNIV"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   573
    proof(cases "f y = 0") case False
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   574
      have mea:"(indicator (f -` {f y}) ::_\<Rightarrow>real) integrable_on UNIV"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   575
        apply(rule lmeasure_finite_integrable)
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   576
        using assms unfolding simple_function_def using False by auto
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   577
      have *:"\<And>x. real (indicator (f -` {f y}) x::pextreal) = (indicator (f -` {f y}) x)"
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   578
        by (auto simp: indicator_def)
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40874
diff changeset
   579
      show ?thesis unfolding real_of_pextreal_mult[THEN sym]
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   580
        apply(rule has_integral_cmul[where 'b=real, unfolded real_scaleR_def])
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   581
        unfolding Int_UNIV_right lmeasure_eq_integral[OF mea,THEN sym]
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   582
        unfolding integral_eq_lmeasure[OF mea, symmetric] *
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   583
        apply(rule integrable_integral) using mea .
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   584
    qed auto
41654
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   585
  qed
32fe42892983 Gauge measure removed
hoelzl
parents: 41546
diff changeset
   586
qed
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   587
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   588
lemma bounded_realI: assumes "\<forall>x\<in>s. abs (x::real) \<le> B" shows "bounded s"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   589
  unfolding bounded_def dist_real_def apply(rule_tac x=0 in exI)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   590
  using assms by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   591
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   592
lemma simple_function_has_integral':
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40874
diff changeset
   593
  fixes f::"'a::ordered_euclidean_space \<Rightarrow> pextreal"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   594
  assumes f:"simple_function lebesgue f"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   595
  and i: "integral\<^isup>S lebesgue f \<noteq> \<omega>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   596
  shows "((\<lambda>x. real (f x)) has_integral (real (integral\<^isup>S lebesgue f))) UNIV"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   597
proof- let ?f = "\<lambda>x. if f x = \<omega> then 0 else f x"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   598
  { fix x have "real (f x) = real (?f x)" by (cases "f x") auto } note * = this
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   599
  have **:"{x. f x \<noteq> ?f x} = f -` {\<omega>}" by auto
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   600
  have **:"lebesgue.\<mu> {x\<in>space lebesgue. f x \<noteq> ?f x} = 0"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   601
    using lebesgue.simple_integral_omega[OF assms] by(auto simp add:**)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   602
  show ?thesis apply(subst lebesgue.simple_integral_cong'[OF f _ **])
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   603
    apply(rule lebesgue.simple_function_compose1[OF f])
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   604
    unfolding * defer apply(rule simple_function_has_integral)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   605
  proof-
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   606
    show "simple_function lebesgue ?f"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   607
      using lebesgue.simple_function_compose1[OF f] .
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   608
    show "\<forall>x. ?f x \<noteq> \<omega>" by auto
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   609
    show "\<forall>x\<in>range ?f. lebesgue.\<mu> (?f -` {x} \<inter> UNIV) = \<omega> \<longrightarrow> x = 0"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   610
    proof (safe, simp, safe, rule ccontr)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   611
      fix y assume "f y \<noteq> \<omega>" "f y \<noteq> 0"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   612
      hence "(\<lambda>x. if f x = \<omega> then 0 else f x) -` {if f y = \<omega> then 0 else f y} = f -` {f y}"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   613
        by (auto split: split_if_asm)
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   614
      moreover assume "lebesgue.\<mu> ((\<lambda>x. if f x = \<omega> then 0 else f x) -` {if f y = \<omega> then 0 else f y}) = \<omega>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   615
      ultimately have "lebesgue.\<mu> (f -` {f y}) = \<omega>" by simp
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   616
      moreover
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   617
      have "f y * lebesgue.\<mu> (f -` {f y}) \<noteq> \<omega>" using i f
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   618
        unfolding simple_integral_def setsum_\<omega> simple_function_def
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   619
        by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   620
      ultimately have "f y = 0" by (auto split: split_if_asm)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   621
      then show False using `f y \<noteq> 0` by simp
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   622
    qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   623
  qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   624
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   625
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   626
lemma (in measure_space) positive_integral_monotone_convergence:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40874
diff changeset
   627
  fixes f::"nat \<Rightarrow> 'a \<Rightarrow> pextreal"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   628
  assumes i: "\<And>i. f i \<in> borel_measurable M" and mono: "\<And>x. mono (\<lambda>n. f n x)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   629
  and lim: "\<And>x. (\<lambda>i. f i x) ----> u x"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   630
  shows "u \<in> borel_measurable M"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   631
  and "(\<lambda>i. integral\<^isup>P M (f i)) ----> integral\<^isup>P M u" (is ?ilim)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   632
proof -
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   633
  from positive_integral_isoton[unfolded isoton_fun_expand isoton_iff_Lim_mono, of f u]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   634
  show ?ilim using mono lim i by auto
41097
a1abfa4e2b44 use SUPR_ and INFI_apply instead of SUPR_, INFI_fun_expand
hoelzl
parents: 41095
diff changeset
   635
  have "\<And>x. (SUP i. f i x) = u x" using mono lim SUP_Lim_pextreal
a1abfa4e2b44 use SUPR_ and INFI_apply instead of SUPR_, INFI_fun_expand
hoelzl
parents: 41095
diff changeset
   636
    unfolding fun_eq_iff mono_def by auto
a1abfa4e2b44 use SUPR_ and INFI_apply instead of SUPR_, INFI_fun_expand
hoelzl
parents: 41095
diff changeset
   637
  moreover have "(\<lambda>x. SUP i. f i x) \<in> borel_measurable M"
a1abfa4e2b44 use SUPR_ and INFI_apply instead of SUPR_, INFI_fun_expand
hoelzl
parents: 41095
diff changeset
   638
    using i by auto
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   639
  ultimately show "u \<in> borel_measurable M" by simp
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   640
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   641
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   642
lemma positive_integral_has_integral:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40874
diff changeset
   643
  fixes f::"'a::ordered_euclidean_space => pextreal"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   644
  assumes f:"f \<in> borel_measurable lebesgue"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   645
  and int_om:"integral\<^isup>P lebesgue f \<noteq> \<omega>"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   646
  and f_om:"\<forall>x. f x \<noteq> \<omega>" (* TODO: remove this *)
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   647
  shows "((\<lambda>x. real (f x)) has_integral (real (integral\<^isup>P lebesgue f))) UNIV"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   648
proof- let ?i = "integral\<^isup>P lebesgue f"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   649
  from lebesgue.borel_measurable_implies_simple_function_sequence[OF f]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   650
  guess u .. note conjunctD2[OF this,rule_format] note u = conjunctD2[OF this(1)] this(2)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   651
  let ?u = "\<lambda>i x. real (u i x)" and ?f = "\<lambda>x. real (f x)"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   652
  have u_simple:"\<And>k. integral\<^isup>S lebesgue (u k) = integral\<^isup>P lebesgue (u k)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   653
    apply(subst lebesgue.positive_integral_eq_simple_integral[THEN sym,OF u(1)]) ..
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   654
  have int_u_le:"\<And>k. integral\<^isup>S lebesgue (u k) \<le> integral\<^isup>P lebesgue f"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   655
    unfolding u_simple apply(rule lebesgue.positive_integral_mono)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   656
    using isoton_Sup[OF u(3)] unfolding le_fun_def by auto
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   657
  have u_int_om:"\<And>i. integral\<^isup>S lebesgue (u i) \<noteq> \<omega>"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   658
  proof- case goal1 thus ?case using int_u_le[of i] int_om by auto qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   659
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   660
  note u_int = simple_function_has_integral'[OF u(1) this]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   661
  have "(\<lambda>x. real (f x)) integrable_on UNIV \<and>
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   662
    (\<lambda>k. Integration.integral UNIV (\<lambda>x. real (u k x))) ----> Integration.integral UNIV (\<lambda>x. real (f x))"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   663
    apply(rule monotone_convergence_increasing) apply(rule,rule,rule u_int)
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40874
diff changeset
   664
  proof safe case goal1 show ?case apply(rule real_of_pextreal_mono) using u(2,3) by auto
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   665
  next case goal2 show ?case using u(3) apply(subst lim_Real[THEN sym])
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   666
      prefer 3 apply(subst Real_real') defer apply(subst Real_real')
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   667
      using isotone_Lim[OF u(3)[unfolded isoton_fun_expand, THEN spec]] using f_om u by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   668
  next case goal3
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   669
    show ?case apply(rule bounded_realI[where B="real (integral\<^isup>P lebesgue f)"])
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   670
      apply safe apply(subst abs_of_nonneg) apply(rule integral_nonneg,rule) apply(rule u_int)
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40874
diff changeset
   671
      unfolding integral_unique[OF u_int] defer apply(rule real_of_pextreal_mono[OF _ int_u_le])
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   672
      using u int_om by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   673
  qed note int = conjunctD2[OF this]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   674
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   675
  have "(\<lambda>i. integral\<^isup>S lebesgue (u i)) ----> ?i" unfolding u_simple
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   676
    apply(rule lebesgue.positive_integral_monotone_convergence(2))
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   677
    apply(rule lebesgue.borel_measurable_simple_function[OF u(1)])
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   678
    using isotone_Lim[OF u(3)[unfolded isoton_fun_expand, THEN spec]] by auto
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   679
  hence "(\<lambda>i. real (integral\<^isup>S lebesgue (u i))) ----> real ?i" apply-
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   680
    apply(subst lim_Real[THEN sym]) prefer 3
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   681
    apply(subst Real_real') defer apply(subst Real_real')
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   682
    using u f_om int_om u_int_om by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   683
  note * = LIMSEQ_unique[OF this int(2)[unfolded integral_unique[OF u_int]]]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   684
  show ?thesis unfolding * by(rule integrable_integral[OF int(1)])
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   685
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   686
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   687
lemma lebesgue_integral_has_integral:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   688
  fixes f::"'a::ordered_euclidean_space => real"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   689
  assumes f:"integrable lebesgue f"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   690
  shows "(f has_integral (integral\<^isup>L lebesgue f)) UNIV"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   691
proof- let ?n = "\<lambda>x. - min (f x) 0" and ?p = "\<lambda>x. max (f x) 0"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   692
  have *:"f = (\<lambda>x. ?p x - ?n x)" apply rule by auto
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   693
  note f = integrableD[OF f]
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   694
  show ?thesis unfolding lebesgue_integral_def apply(subst *)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   695
  proof(rule has_integral_sub) case goal1
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   696
    have *:"\<forall>x. Real (f x) \<noteq> \<omega>" by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   697
    note lebesgue.borel_measurable_Real[OF f(1)]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   698
    from positive_integral_has_integral[OF this f(2) *]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   699
    show ?case unfolding real_Real_max .
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   700
  next case goal2
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   701
    have *:"\<forall>x. Real (- f x) \<noteq> \<omega>" by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   702
    note lebesgue.borel_measurable_uminus[OF f(1)]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   703
    note lebesgue.borel_measurable_Real[OF this]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   704
    from positive_integral_has_integral[OF this f(3) *]
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   705
    show ?case unfolding real_Real_max minus_min_eq_max by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   706
  qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   707
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   708
41546
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   709
lemma lebesgue_positive_integral_eq_borel:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   710
  "f \<in> borel_measurable borel \<Longrightarrow> integral\<^isup>P lebesgue f = integral\<^isup>P lborel f"
41546
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   711
  by (auto intro!: lebesgue.positive_integral_subalgebra[symmetric]) default
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   712
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   713
lemma lebesgue_integral_eq_borel:
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   714
  assumes "f \<in> borel_measurable borel"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   715
  shows "integrable lebesgue f \<longleftrightarrow> integrable lborel f" (is ?P)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   716
    and "integral\<^isup>L lebesgue f = integral\<^isup>L lborel f" (is ?I)
41546
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   717
proof -
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   718
  have *: "sigma_algebra lborel" by default
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   719
  have "sets lborel \<subseteq> sets lebesgue" by auto
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   720
  from lebesgue.integral_subalgebra[of f lborel, OF _ this _ _ *] assms
41546
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   721
  show ?P ?I by auto
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   722
qed
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   723
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   724
lemma borel_integral_has_integral:
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   725
  fixes f::"'a::ordered_euclidean_space => real"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   726
  assumes f:"integrable lborel f"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   727
  shows "(f has_integral (integral\<^isup>L lborel f)) UNIV"
41546
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   728
proof -
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   729
  have borel: "f \<in> borel_measurable borel"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   730
    using f unfolding integrable_def by auto
41546
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   731
  from f show ?thesis
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   732
    using lebesgue_integral_has_integral[of f]
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   733
    unfolding lebesgue_integral_eq_borel[OF borel] by simp
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   734
qed
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   735
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   736
lemma continuous_on_imp_borel_measurable:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   737
  fixes f::"'a::ordered_euclidean_space \<Rightarrow> 'b::ordered_euclidean_space"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   738
  assumes "continuous_on UNIV f"
41546
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   739
  shows "f \<in> borel_measurable borel"
2a12c23b7a34 integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents: 41097
diff changeset
   740
  apply(rule borel.borel_measurableI)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   741
  using continuous_open_preimage[OF assms] unfolding vimage_def by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   742
41706
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   743
subsection {* Equivalence between product spaces and euclidean spaces *}
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   744
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   745
definition e2p :: "'a::ordered_euclidean_space \<Rightarrow> (nat \<Rightarrow> real)" where
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   746
  "e2p x = (\<lambda>i\<in>{..<DIM('a)}. x$$i)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   747
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   748
definition p2e :: "(nat \<Rightarrow> real) \<Rightarrow> 'a::ordered_euclidean_space" where
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   749
  "p2e x = (\<chi>\<chi> i. x i)"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   750
41095
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   751
lemma e2p_p2e[simp]:
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   752
  "x \<in> extensional {..<DIM('a)} \<Longrightarrow> e2p (p2e x::'a::ordered_euclidean_space) = x"
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   753
  by (auto simp: fun_eq_iff extensional_def p2e_def e2p_def)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   754
41095
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   755
lemma p2e_e2p[simp]:
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   756
  "p2e (e2p x) = (x::'a::ordered_euclidean_space)"
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   757
  by (auto simp: euclidean_eq[where 'a='a] p2e_def e2p_def)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   758
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   759
interpretation lborel_product: product_sigma_finite "\<lambda>x. lborel::real measure_space"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   760
  by default
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   761
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   762
interpretation lborel_space: finite_product_sigma_finite "\<lambda>x. lborel::real measure_space" "{..<DIM('a::ordered_euclidean_space)}"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   763
  where "space lborel = UNIV"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   764
  and "sets lborel = sets borel"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   765
  and "measure lborel = lebesgue.\<mu>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   766
  and "measurable lborel = measurable borel"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   767
proof -
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   768
  show "finite_product_sigma_finite (\<lambda>x. lborel::real measure_space) {..<DIM('a::ordered_euclidean_space)}"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   769
    by default simp
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   770
qed simp_all
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   771
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   772
lemma sets_product_borel:
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   773
  assumes [intro]: "finite I"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   774
  shows "sets (\<Pi>\<^isub>M i\<in>I.
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   775
     \<lparr> space = UNIV::real set, sets = range lessThan, measure = lebesgue.\<mu> \<rparr>) =
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   776
   sets (\<Pi>\<^isub>M i\<in>I. lborel)" (is "sets ?G = _")
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   777
proof -
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   778
  have "sets ?G = sets (\<Pi>\<^isub>M i\<in>I.
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   779
       sigma \<lparr> space = UNIV::real set, sets = range lessThan, measure = lebesgue.\<mu> \<rparr>)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   780
    by (subst sigma_product_algebra_sigma_eq[of I "\<lambda>_ i. {..<real i}" ])
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   781
       (auto intro!: measurable_sigma_sigma isotoneI real_arch_lt
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   782
             simp: product_algebra_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   783
  then show ?thesis
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   784
    unfolding lborel_def borel_eq_lessThan lebesgue_def sigma_def by simp
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   785
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   786
41661
baf1964bc468 use pre-image measure, instead of image
hoelzl
parents: 41654
diff changeset
   787
lemma measurable_e2p:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   788
  "e2p \<in> measurable (borel::'a::ordered_euclidean_space algebra)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   789
                    (\<Pi>\<^isub>M i\<in>{..<DIM('a)}. (lborel :: real measure_space))"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   790
    (is "_ \<in> measurable ?E ?P")
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   791
proof -
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   792
  let ?B = "\<lparr> space = UNIV::real set, sets = range lessThan, measure = lebesgue.\<mu> \<rparr>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   793
  let ?G = "product_algebra_generator {..<DIM('a)} (\<lambda>_. ?B)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   794
  have "e2p \<in> measurable ?E (sigma ?G)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   795
  proof (rule borel.measurable_sigma)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   796
    show "e2p \<in> space ?E \<rightarrow> space ?G" by (auto simp: e2p_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   797
    fix A assume "A \<in> sets ?G"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   798
    then obtain E where A: "A = (\<Pi>\<^isub>E i\<in>{..<DIM('a)}. E i)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   799
      and "E \<in> {..<DIM('a)} \<rightarrow> (range lessThan)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   800
      by (auto elim!: product_algebraE simp: )
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   801
    then have "\<forall>i\<in>{..<DIM('a)}. \<exists>xs. E i = {..< xs}" by auto
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   802
    from this[THEN bchoice] guess xs ..
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   803
    then have A_eq: "A = (\<Pi>\<^isub>E i\<in>{..<DIM('a)}. {..< xs i})"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   804
      using A by auto
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   805
    have "e2p -` A = {..< (\<chi>\<chi> i. xs i) :: 'a}"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   806
      using DIM_positive by (auto simp add: Pi_iff set_eq_iff e2p_def A_eq
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   807
        euclidean_eq[where 'a='a] eucl_less[where 'a='a])
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   808
    then show "e2p -` A \<inter> space ?E \<in> sets ?E" by simp
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   809
  qed (auto simp: product_algebra_generator_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   810
  with sets_product_borel[of "{..<DIM('a)}"] show ?thesis
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   811
    unfolding measurable_def product_algebra_def by simp
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   812
qed
41661
baf1964bc468 use pre-image measure, instead of image
hoelzl
parents: 41654
diff changeset
   813
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   814
lemma measurable_p2e:
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   815
  "p2e \<in> measurable (\<Pi>\<^isub>M i\<in>{..<DIM('a)}. (lborel :: real measure_space))
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   816
    (borel :: 'a::ordered_euclidean_space algebra)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   817
  (is "p2e \<in> measurable ?P _")
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   818
  unfolding borel_eq_lessThan
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   819
proof (intro lborel_space.measurable_sigma)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   820
  let ?E = "\<lparr> space = UNIV :: 'a set, sets = range lessThan \<rparr>"
41095
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   821
  show "p2e \<in> space ?P \<rightarrow> space ?E" by simp
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   822
  fix A assume "A \<in> sets ?E"
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   823
  then obtain x where "A = {..<x}" by auto
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   824
  then have "p2e -` A \<inter> space ?P = (\<Pi>\<^isub>E i\<in>{..<DIM('a)}. {..< x $$ i})"
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   825
    using DIM_positive
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   826
    by (auto simp: Pi_iff set_eq_iff p2e_def
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   827
                   euclidean_eq[where 'a='a] eucl_less[where 'a='a])
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   828
  then show "p2e -` A \<inter> space ?P \<in> sets ?P" by auto
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   829
qed simp
41095
c335d880ff82 cleanup bijectivity btw. product spaces and pairs
hoelzl
parents: 41023
diff changeset
   830
41706
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   831
lemma Int_stable_cuboids:
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   832
  fixes x::"'a::ordered_euclidean_space"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   833
  shows "Int_stable \<lparr>space = UNIV, sets = range (\<lambda>(a, b::'a). {a..b})\<rparr>"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   834
  by (auto simp: inter_interval Int_stable_def)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   835
41706
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   836
lemma lborel_eq_lborel_space:
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   837
  fixes A :: "('a::ordered_euclidean_space) set"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   838
  assumes "A \<in> sets borel"
41706
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   839
  shows "lborel.\<mu> A = lborel_space.\<mu> TYPE('a) (p2e -` A \<inter> (space (lborel_space.P TYPE('a))))"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   840
    (is "_ = measure ?P (?T A)")
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   841
proof (rule measure_unique_Int_stable_vimage)
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   842
  show "measure_space ?P" by default
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   843
  show "measure_space lborel" by default
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   844
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   845
  let ?E = "\<lparr> space = UNIV :: 'a set, sets = range (\<lambda>(a,b). {a..b}) \<rparr>"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   846
  show "Int_stable ?E" using Int_stable_cuboids .
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   847
  show "range cube \<subseteq> sets ?E" unfolding cube_def_raw by auto
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   848
  { fix x have "\<exists>n. x \<in> cube n" using mem_big_cube[of x] by fastsimp }
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   849
  then show "cube \<up> space ?E" by (intro isotoneI cube_subset_Suc) auto
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   850
  { fix i show "lborel.\<mu> (cube i) \<noteq> \<omega>" unfolding cube_def by auto }
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   851
  show "A \<in> sets (sigma ?E)" "sets (sigma ?E) = sets lborel" "space ?E = space lborel"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   852
    using assms by (simp_all add: borel_eq_atLeastAtMost)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   853
41706
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   854
  show "p2e \<in> measurable ?P (lborel :: 'a measure_space)"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   855
    using measurable_p2e unfolding measurable_def by simp
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   856
  { fix X assume "X \<in> sets ?E"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   857
    then obtain a b where X[simp]: "X = {a .. b}" by auto
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   858
    have *: "?T X = (\<Pi>\<^isub>E i\<in>{..<DIM('a)}. {a $$ i .. b $$ i})"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   859
      by (auto simp: Pi_iff eucl_le[where 'a='a] p2e_def)
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   860
    show "lborel.\<mu> X = measure ?P (?T X)"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   861
    proof cases
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   862
      assume "X \<noteq> {}"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   863
      then have "a \<le> b"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   864
        by (simp add: interval_ne_empty eucl_le[where 'a='a])
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   865
      then have "lborel.\<mu> X = (\<Prod>x<DIM('a). lborel.\<mu> {a $$ x .. b $$ x})"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   866
        by (auto simp: content_closed_interval eucl_le[where 'a='a]
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   867
                 intro!: Real_setprod )
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   868
      also have "\<dots> = measure ?P (?T X)"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   869
        unfolding * by (subst lborel_space.measure_times) auto
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   870
      finally show ?thesis .
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   871
    qed simp }
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   872
qed
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   873
41706
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   874
lemma lebesgue_eq_lborel_space_in_borel:
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   875
  fixes A :: "('a::ordered_euclidean_space) set"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   876
  assumes A: "A \<in> sets borel"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   877
  shows "lebesgue.\<mu> A = lborel_space.\<mu> TYPE('a) (p2e -` A \<inter> (space (lborel_space.P TYPE('a))))"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   878
  using lborel_eq_lborel_space[OF A] by simp
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   879
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   880
lemma borel_fubini_positiv_integral:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40874
diff changeset
   881
  fixes f :: "'a::ordered_euclidean_space \<Rightarrow> pextreal"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   882
  assumes f: "f \<in> borel_measurable borel"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   883
  shows "integral\<^isup>P lborel f = \<integral>\<^isup>+x. f (p2e x) \<partial>(lborel_space.P TYPE('a))"
41706
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   884
proof (rule lborel_space.positive_integral_vimage[OF _ _ _ lborel_eq_lborel_space])
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   885
  show "sigma_algebra lborel" by default
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   886
  show "p2e \<in> measurable (lborel_space.P TYPE('a)) (lborel :: 'a measure_space)"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   887
       "f \<in> borel_measurable lborel"
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   888
    using measurable_p2e f by (simp_all add: measurable_def)
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   889
qed simp
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   890
41704
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   891
lemma borel_fubini_integrable:
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   892
  fixes f :: "'a::ordered_euclidean_space \<Rightarrow> real"
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   893
  shows "integrable lborel f \<longleftrightarrow>
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   894
    integrable (lborel_space.P TYPE('a)) (\<lambda>x. f (p2e x))"
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   895
    (is "_ \<longleftrightarrow> integrable ?B ?f")
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   896
proof
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   897
  assume "integrable lborel f"
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   898
  moreover then have f: "f \<in> borel_measurable borel"
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   899
    by auto
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   900
  moreover with measurable_p2e
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   901
  have "f \<circ> p2e \<in> borel_measurable ?B"
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   902
    by (rule measurable_comp)
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   903
  ultimately show "integrable ?B ?f"
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   904
    by (simp add: comp_def borel_fubini_positiv_integral integrable_def)
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   905
next
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   906
  assume "integrable ?B ?f"
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   907
  moreover then
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   908
  have "?f \<circ> e2p \<in> borel_measurable (borel::'a algebra)"
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   909
    by (auto intro!: measurable_e2p measurable_comp)
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   910
  then have "f \<in> borel_measurable borel"
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   911
    by (simp cong: measurable_cong)
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   912
  ultimately show "integrable lborel f"
41706
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   913
    by (simp add: borel_fubini_positiv_integral integrable_def)
41704
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   914
qed
8c539202f854 add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents: 41689
diff changeset
   915
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   916
lemma borel_fubini:
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   917
  fixes f :: "'a::ordered_euclidean_space \<Rightarrow> real"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 38656
diff changeset
   918
  assumes f: "f \<in> borel_measurable borel"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41661
diff changeset
   919
  shows "integral\<^isup>L lborel f = \<integral>x. f (p2e x) \<partial>(lborel_space.P TYPE('a))"
41706
a207a858d1f6 prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents: 41704
diff changeset
   920
  using f by (simp add: borel_fubini_positiv_integral lebesgue_integral_def)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   921
d5d342611edb Rewrite the Probability theory.
hoelzl
parents:
diff changeset
   922
end