author  hoelzl 
Tue, 22 Mar 2011 20:06:10 +0100  
changeset 42067  66c8281349ec 
parent 41981  cdf7693bbe08 
child 42146  5b52c6a9c627 
permissions  rwrr 
42067  1 
(* Title: HOL/Probability/Lebesgue_Measure.thy 
2 
Author: Johannes Hölzl, TU München 

3 
Author: Robert Himmelmann, TU München 

4 
*) 

5 

38656  6 
header {* Lebsegue measure *} 
42067  7 

38656  8 
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

9 
imports Product_Measure 
38656  10 
begin 
11 

12 
subsection {* Standard Cubes *} 

13 

40859  14 
definition cube :: "nat \<Rightarrow> 'a::ordered_euclidean_space set" where 
15 
"cube n \<equiv> {\<chi>\<chi> i.  real n .. \<chi>\<chi> i. real n}" 

16 

17 
lemma cube_closed[intro]: "closed (cube n)" 

18 
unfolding cube_def by auto 

19 

20 
lemma cube_subset[intro]: "n \<le> N \<Longrightarrow> cube n \<subseteq> cube N" 

21 
by (fastsimp simp: eucl_le[where 'a='a] cube_def) 

38656  22 

40859  23 
lemma cube_subset_iff: 
24 
"cube n \<subseteq> cube N \<longleftrightarrow> n \<le> N" 

25 
proof 

26 
assume subset: "cube n \<subseteq> (cube N::'a set)" 

27 
then have "((\<chi>\<chi> i. real n)::'a) \<in> cube N" 

28 
using DIM_positive[where 'a='a] 

29 
by (fastsimp simp: cube_def eucl_le[where 'a='a]) 

30 
then show "n \<le> N" 

31 
by (fastsimp simp: cube_def eucl_le[where 'a='a]) 

32 
next 

33 
assume "n \<le> N" then show "cube n \<subseteq> (cube N::'a set)" by (rule cube_subset) 

34 
qed 

38656  35 

36 
lemma ball_subset_cube:"ball (0::'a::ordered_euclidean_space) (real n) \<subseteq> cube n" 

37 
unfolding cube_def subset_eq mem_interval apply safe unfolding euclidean_lambda_beta' 

38 
proof fix x::'a and i assume as:"x\<in>ball 0 (real n)" "i<DIM('a)" 

39 
thus " real n \<le> x $$ i" "real n \<ge> x $$ i" 

40 
using component_le_norm[of x i] by(auto simp: dist_norm) 

41 
qed 

42 

43 
lemma mem_big_cube: obtains n where "x \<in> cube n" 

44 
proof from real_arch_lt[of "norm x"] guess n .. 

45 
thus ?thesis applyapply(rule that[where n=n]) 

46 
apply(rule ball_subset_cube[unfolded subset_eq,rule_format]) 

47 
by (auto simp add:dist_norm) 

48 
qed 

49 

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

50 
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

51 
unfolding cube_def_raw subset_eq apply safe unfolding mem_interval by auto 
41654  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 
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

54 
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

55 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

56 
subsection {* Lebesgue measure *} 
41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

57 

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

58 
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

59 
"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

60 
sets = {A. \<forall>n. (indicator A :: 'a \<Rightarrow> real) integrable_on cube n}, 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

61 
measure = \<lambda>A. SUP n. extreal (integral (cube n) (indicator A)) \<rparr>" 
41661  62 

41654  63 
lemma space_lebesgue[simp]: "space lebesgue = UNIV" 
64 
unfolding lebesgue_def by simp 

65 

66 
lemma lebesgueD: "A \<in> sets lebesgue \<Longrightarrow> (indicator A :: _ \<Rightarrow> real) integrable_on cube n" 

67 
unfolding lebesgue_def by simp 

68 

69 
lemma lebesgueI: "(\<And>n. (indicator A :: _ \<Rightarrow> real) integrable_on cube n) \<Longrightarrow> A \<in> sets lebesgue" 

70 
unfolding lebesgue_def by simp 

71 

72 
lemma absolutely_integrable_on_indicator[simp]: 

73 
fixes A :: "'a::ordered_euclidean_space set" 

74 
shows "((indicator A :: _ \<Rightarrow> real) absolutely_integrable_on X) \<longleftrightarrow> 

75 
(indicator A :: _ \<Rightarrow> real) integrable_on X" 

76 
unfolding absolutely_integrable_on_def by simp 

77 

78 
lemma LIMSEQ_indicator_UN: 

79 
"(\<lambda>k. indicator (\<Union> i<k. A i) x) > (indicator (\<Union>i. A i) x :: real)" 

80 
proof cases 

81 
assume "\<exists>i. x \<in> A i" then guess i .. note i = this 

82 
then have *: "\<And>n. (indicator (\<Union> i<n + Suc i. A i) x :: real) = 1" 

83 
"(indicator (\<Union> i. A i) x :: real) = 1" by (auto simp: indicator_def) 

84 
show ?thesis 

85 
apply (rule LIMSEQ_offset[of _ "Suc i"]) unfolding * by auto 

86 
qed (auto simp: indicator_def) 

38656  87 

41654  88 
lemma indicator_add: 
89 
"A \<inter> B = {} \<Longrightarrow> (indicator A x::_::monoid_add) + indicator B x = indicator (A \<union> B) x" 

90 
unfolding indicator_def by auto 

38656  91 

41654  92 
interpretation lebesgue: sigma_algebra lebesgue 
93 
proof (intro sigma_algebra_iff2[THEN iffD2] conjI allI ballI impI lebesgueI) 

94 
fix A n assume A: "A \<in> sets lebesgue" 

95 
have "indicator (space lebesgue  A) = (\<lambda>x. 1  indicator A x :: real)" 

96 
by (auto simp: fun_eq_iff indicator_def) 

97 
then show "(indicator (space lebesgue  A) :: _ \<Rightarrow> real) integrable_on cube n" 

98 
using A by (auto intro!: integrable_sub dest: lebesgueD simp: cube_def) 

99 
next 

100 
fix n show "(indicator {} :: _\<Rightarrow>real) integrable_on cube n" 

101 
by (auto simp: cube_def indicator_def_raw) 

102 
next 

103 
fix A :: "nat \<Rightarrow> 'a set" and n ::nat assume "range A \<subseteq> sets lebesgue" 

104 
then have A: "\<And>i. (indicator (A i) :: _ \<Rightarrow> real) integrable_on cube n" 

105 
by (auto dest: lebesgueD) 

106 
show "(indicator (\<Union>i. A i) :: _ \<Rightarrow> real) integrable_on cube n" (is "?g integrable_on _") 

107 
proof (intro dominated_convergence[where g="?g"] ballI) 

108 
fix k show "(indicator (\<Union>i<k. A i) :: _ \<Rightarrow> real) integrable_on cube n" 

109 
proof (induct k) 

110 
case (Suc k) 

111 
have *: "(\<Union> i<Suc k. A i) = (\<Union> i<k. A i) \<union> A k" 

112 
unfolding lessThan_Suc UN_insert by auto 

113 
have *: "(\<lambda>x. max (indicator (\<Union> i<k. A i) x) (indicator (A k) x) :: real) = 

114 
indicator (\<Union> i<Suc k. A i)" (is "(\<lambda>x. max (?f x) (?g x)) = _") 

115 
by (auto simp: fun_eq_iff * indicator_def) 

116 
show ?case 

117 
using absolutely_integrable_max[of ?f "cube n" ?g] A Suc by (simp add: *) 

118 
qed auto 

119 
qed (auto intro: LIMSEQ_indicator_UN simp: cube_def) 

120 
qed simp 

38656  121 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

122 
lemma suminf_SUP_eq: 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

123 
fixes f :: "nat \<Rightarrow> nat \<Rightarrow> extreal" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

124 
assumes "\<And>i. incseq (\<lambda>n. f n i)" "\<And>n i. 0 \<le> f n i" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

125 
shows "(\<Sum>i. SUP n. f n i) = (SUP n. \<Sum>i. f n i)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

126 
proof  
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

127 
{ fix n :: nat 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

128 
have "(\<Sum>i<n. SUP k. f k i) = (SUP k. \<Sum>i<n. f k i)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

129 
using assms by (auto intro!: SUPR_extreal_setsum[symmetric]) } 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

130 
note * = this 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

131 
show ?thesis using assms 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

132 
apply (subst (1 2) suminf_extreal_eq_SUPR) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

133 
unfolding * 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

134 
apply (auto intro!: le_SUPI2) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

135 
apply (subst SUP_commute) .. 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

136 
qed 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

137 

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

138 
interpretation lebesgue: measure_space lebesgue 
41654  139 
proof 
140 
have *: "indicator {} = (\<lambda>x. 0 :: real)" by (simp add: fun_eq_iff) 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

141 
show "positive lebesgue (measure lebesgue)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

142 
proof (unfold positive_def, safe) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

143 
show "measure lebesgue {} = 0" by (simp add: integral_0 * lebesgue_def) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

144 
fix A assume "A \<in> sets lebesgue" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

145 
then show "0 \<le> measure lebesgue A" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

146 
unfolding lebesgue_def 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

147 
by (auto intro!: le_SUPI2 integral_nonneg) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

148 
qed 
40859  149 
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

150 
show "countably_additive lebesgue (measure lebesgue)" 
41654  151 
proof (intro countably_additive_def[THEN iffD2] allI impI) 
152 
fix A :: "nat \<Rightarrow> 'b set" assume rA: "range A \<subseteq> sets lebesgue" "disjoint_family A" 

153 
then have A[simp, intro]: "\<And>i n. (indicator (A i) :: _ \<Rightarrow> real) integrable_on cube n" 

154 
by (auto dest: lebesgueD) 

155 
let "?m n i" = "integral (cube n) (indicator (A i) :: _\<Rightarrow>real)" 

156 
let "?M n I" = "integral (cube n) (indicator (\<Union>i\<in>I. A i) :: _\<Rightarrow>real)" 

157 
have nn[simp, intro]: "\<And>i n. 0 \<le> ?m n i" by (auto intro!: integral_nonneg) 

158 
assume "(\<Union>i. A i) \<in> sets lebesgue" 

159 
then have UN_A[simp, intro]: "\<And>i n. (indicator (\<Union>i. A i) :: _ \<Rightarrow> real) integrable_on cube n" 

160 
by (auto dest: lebesgueD) 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

161 
show "(\<Sum>n. measure lebesgue (A n)) = measure lebesgue (\<Union>i. A i)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

162 
proof (simp add: lebesgue_def, subst suminf_SUP_eq, safe intro!: incseq_SucI) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

163 
fix i n show "extreal (?m n i) \<le> extreal (?m (Suc n) i)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

164 
using cube_subset[of n "Suc n"] by (auto intro!: integral_subset_le incseq_SucI) 
41654  165 
next 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

166 
fix i n show "0 \<le> extreal (?m n i)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

167 
using rA unfolding lebesgue_def 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

168 
by (auto intro!: le_SUPI2 integral_nonneg) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

169 
next 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

170 
show "(SUP n. \<Sum>i. extreal (?m n i)) = (SUP n. extreal (?M n UNIV))" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

171 
proof (intro arg_cong[where f="SUPR UNIV"] ext sums_unique[symmetric] sums_extreal[THEN iffD2] sums_def[THEN iffD2]) 
41654  172 
fix n 
173 
have "\<And>m. (UNION {..<m} A) \<in> sets lebesgue" using rA by auto 

174 
from lebesgueD[OF this] 

175 
have "(\<lambda>m. ?M n {..< m}) > ?M n UNIV" 

176 
(is "(\<lambda>m. integral _ (?A m)) > ?I") 

177 
by (intro dominated_convergence(2)[where f="?A" and h="\<lambda>x. 1::real"]) 

178 
(auto intro: LIMSEQ_indicator_UN simp: cube_def) 

179 
moreover 

180 
{ fix m have *: "(\<Sum>x<m. ?m n x) = ?M n {..< m}" 

181 
proof (induct m) 

182 
case (Suc m) 

183 
have "(\<Union>i<m. A i) \<in> sets lebesgue" using rA by auto 

184 
then have "(indicator (\<Union>i<m. A i) :: _\<Rightarrow>real) integrable_on (cube n)" 

185 
by (auto dest!: lebesgueD) 

186 
moreover 

187 
have "(\<Union>i<m. A i) \<inter> A m = {}" 

188 
using rA(2)[unfolded disjoint_family_on_def, THEN bspec, of m] 

189 
by auto 

190 
then have "\<And>x. indicator (\<Union>i<Suc m. A i) x = 

191 
indicator (\<Union>i<m. A i) x + (indicator (A m) x :: real)" 

192 
by (auto simp: indicator_add lessThan_Suc ac_simps) 

193 
ultimately show ?case 

194 
using Suc A by (simp add: integral_add[symmetric]) 

195 
qed auto } 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

196 
ultimately show "(\<lambda>m. \<Sum>x = 0..<m. ?m n x) > ?M n UNIV" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

197 
by (simp add: atLeast0LessThan) 
41654  198 
qed 
199 
qed 

200 
qed 

40859  201 
qed 
202 

41654  203 
lemma has_integral_interval_cube: 
204 
fixes a b :: "'a::ordered_euclidean_space" 

205 
shows "(indicator {a .. b} has_integral 

206 
content ({\<chi>\<chi> i. max ( real n) (a $$ i) .. \<chi>\<chi> i. min (real n) (b $$ i)} :: 'a set)) (cube n)" 

207 
(is "(?I has_integral content ?R) (cube n)") 

40859  208 
proof  
41654  209 
let "{?N .. ?P}" = ?R 
210 
have [simp]: "(\<lambda>x. if x \<in> cube n then ?I x else 0) = indicator ?R" 

211 
by (auto simp: indicator_def cube_def fun_eq_iff eucl_le[where 'a='a]) 

212 
have "(?I has_integral content ?R) (cube n) \<longleftrightarrow> (indicator ?R has_integral content ?R) UNIV" 

213 
unfolding has_integral_restrict_univ[where s="cube n", symmetric] by simp 

214 
also have "\<dots> \<longleftrightarrow> ((\<lambda>x. 1) has_integral content ?R) ?R" 

215 
unfolding indicator_def_raw has_integral_restrict_univ .. 

216 
finally show ?thesis 

217 
using has_integral_const[of "1::real" "?N" "?P"] by simp 

40859  218 
qed 
38656  219 

41654  220 
lemma lebesgueI_borel[intro, simp]: 
221 
fixes s::"'a::ordered_euclidean_space set" 

40859  222 
assumes "s \<in> sets borel" shows "s \<in> sets lebesgue" 
41654  223 
proof  
224 
let ?S = "range (\<lambda>(a, b). {a .. (b :: 'a\<Colon>ordered_euclidean_space)})" 

225 
have *:"?S \<subseteq> sets lebesgue" 

226 
proof (safe intro!: lebesgueI) 

227 
fix n :: nat and a b :: 'a 

228 
let ?N = "\<chi>\<chi> i. max ( real n) (a $$ i)" 

229 
let ?P = "\<chi>\<chi> i. min (real n) (b $$ i)" 

230 
show "(indicator {a..b} :: 'a\<Rightarrow>real) integrable_on cube n" 

231 
unfolding integrable_on_def 

232 
using has_integral_interval_cube[of a b] by auto 

233 
qed 

40859  234 
have "s \<in> sigma_sets UNIV ?S" using assms 
235 
unfolding borel_eq_atLeastAtMost by (simp add: sigma_def) 

236 
thus ?thesis 

237 
using lebesgue.sigma_subset[of "\<lparr> space = UNIV, sets = ?S\<rparr>", simplified, OF *] 

238 
by (auto simp: sigma_def) 

38656  239 
qed 
240 

40859  241 
lemma lebesgueI_negligible[dest]: fixes s::"'a::ordered_euclidean_space set" 
242 
assumes "negligible s" shows "s \<in> sets lebesgue" 

41654  243 
using assms by (force simp: cube_def integrable_on_def negligible_def intro!: lebesgueI) 
38656  244 

41654  245 
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

246 
fixes S :: "'a::ordered_euclidean_space set" assumes "negligible S" shows "lebesgue.\<mu> S = 0" 
40859  247 
proof  
41654  248 
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

249 
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

250 
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

251 
(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

252 
then show ?thesis by (auto simp: lebesgue_def) 
40859  253 
qed 
254 

255 
lemma lmeasure_iff_LIMSEQ: 

256 
assumes "A \<in> sets lebesgue" "0 \<le> m" 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

257 
shows "lebesgue.\<mu> A = extreal m \<longleftrightarrow> (\<lambda>n. integral (cube n) (indicator A :: _ \<Rightarrow> real)) > 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

258 
proof (simp add: lebesgue_def, intro SUP_eq_LIMSEQ) 
41654  259 
show "mono (\<lambda>n. integral (cube n) (indicator A::_=>real))" 
260 
using cube_subset assms by (intro monoI integral_subset_le) (auto dest!: lebesgueD) 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

261 
qed 
38656  262 

41654  263 
lemma has_integral_indicator_UNIV: 
264 
fixes s A :: "'a::ordered_euclidean_space set" and x :: real 

265 
shows "((indicator (s \<inter> A) :: 'a\<Rightarrow>real) has_integral x) UNIV = ((indicator s :: _\<Rightarrow>real) has_integral x) A" 

266 
proof  

267 
have "(\<lambda>x. if x \<in> A then indicator s x else 0) = (indicator (s \<inter> A) :: _\<Rightarrow>real)" 

268 
by (auto simp: fun_eq_iff indicator_def) 

269 
then show ?thesis 

270 
unfolding has_integral_restrict_univ[where s=A, symmetric] by simp 

40859  271 
qed 
38656  272 

41654  273 
lemma 
274 
fixes s a :: "'a::ordered_euclidean_space set" 

275 
shows integral_indicator_UNIV: 

276 
"integral UNIV (indicator (s \<inter> A) :: 'a\<Rightarrow>real) = integral A (indicator s :: _\<Rightarrow>real)" 

277 
and integrable_indicator_UNIV: 

278 
"(indicator (s \<inter> A) :: 'a\<Rightarrow>real) integrable_on UNIV \<longleftrightarrow> (indicator s :: 'a\<Rightarrow>real) integrable_on A" 

279 
unfolding integral_def integrable_on_def has_integral_indicator_UNIV by auto 

280 

281 
lemma lmeasure_finite_has_integral: 

282 
fixes s :: "'a::ordered_euclidean_space set" 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

283 
assumes "s \<in> sets lebesgue" "lebesgue.\<mu> s = extreal m" "0 \<le> m" 
41654  284 
shows "(indicator s has_integral m) UNIV" 
285 
proof  

286 
let ?I = "indicator :: 'a set \<Rightarrow> 'a \<Rightarrow> real" 

287 
have **: "(?I s) integrable_on UNIV \<and> (\<lambda>k. integral UNIV (?I (s \<inter> cube k))) > integral UNIV (?I s)" 

288 
proof (intro monotone_convergence_increasing allI ballI) 

289 
have LIMSEQ: "(\<lambda>n. integral (cube n) (?I s)) > m" 

290 
using assms(2) unfolding lmeasure_iff_LIMSEQ[OF assms(1, 3)] . 

291 
{ fix n have "integral (cube n) (?I s) \<le> m" 

292 
using cube_subset assms 

293 
by (intro incseq_le[where L=m] LIMSEQ incseq_def[THEN iffD2] integral_subset_le allI impI) 

294 
(auto dest!: lebesgueD) } 

295 
moreover 

296 
{ fix n have "0 \<le> integral (cube n) (?I s)" 

297 
using assms by (auto dest!: lebesgueD intro!: integral_nonneg) } 

298 
ultimately 

299 
show "bounded {integral UNIV (?I (s \<inter> cube k)) k. True}" 

300 
unfolding bounded_def 

301 
apply (rule_tac exI[of _ 0]) 

302 
apply (rule_tac exI[of _ m]) 

303 
by (auto simp: dist_real_def integral_indicator_UNIV) 

304 
fix k show "?I (s \<inter> cube k) integrable_on UNIV" 

305 
unfolding integrable_indicator_UNIV using assms by (auto dest!: lebesgueD) 

306 
fix x show "?I (s \<inter> cube k) x \<le> ?I (s \<inter> cube (Suc k)) x" 

307 
using cube_subset[of k "Suc k"] by (auto simp: indicator_def) 

308 
next 

309 
fix x :: 'a 

310 
from mem_big_cube obtain k where k: "x \<in> cube k" . 

311 
{ fix n have "?I (s \<inter> cube (n + k)) x = ?I s x" 

312 
using k cube_subset[of k "n + k"] by (auto simp: indicator_def) } 

313 
note * = this 

314 
show "(\<lambda>k. ?I (s \<inter> cube k) x) > ?I s x" 

315 
by (rule LIMSEQ_offset[where k=k]) (auto simp: *) 

316 
qed 

317 
note ** = conjunctD2[OF this] 

318 
have m: "m = integral UNIV (?I s)" 

319 
apply (intro LIMSEQ_unique[OF _ **(2)]) 

320 
using assms(2) unfolding lmeasure_iff_LIMSEQ[OF assms(1,3)] integral_indicator_UNIV . 

321 
show ?thesis 

322 
unfolding m by (intro integrable_integral **) 

38656  323 
qed 
324 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

325 
lemma lmeasure_finite_integrable: assumes s: "s \<in> sets lebesgue" and "lebesgue.\<mu> s \<noteq> \<infinity>" 
41654  326 
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

327 
proof (cases "lebesgue.\<mu> s") 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

328 
case (real m) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

329 
with lmeasure_finite_has_integral[OF `s \<in> sets lebesgue` this] 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

330 
lebesgue.positive_measure[OF s] 
41654  331 
show ?thesis unfolding integrable_on_def by auto 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

332 
qed (insert assms lebesgue.positive_measure[OF s], auto) 
38656  333 

41654  334 
lemma has_integral_lebesgue: assumes "((indicator s :: _\<Rightarrow>real) has_integral m) UNIV" 
335 
shows "s \<in> sets lebesgue" 

336 
proof (intro lebesgueI) 

337 
let ?I = "indicator :: 'a set \<Rightarrow> 'a \<Rightarrow> real" 

338 
fix n show "(?I s) integrable_on cube n" unfolding cube_def 

339 
proof (intro integrable_on_subinterval) 

340 
show "(?I s) integrable_on UNIV" 

341 
unfolding integrable_on_def using assms by auto 

342 
qed auto 

38656  343 
qed 
344 

41654  345 
lemma has_integral_lmeasure: assumes "((indicator s :: _\<Rightarrow>real) has_integral m) UNIV" 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

346 
shows "lebesgue.\<mu> s = extreal m" 
41654  347 
proof (intro lmeasure_iff_LIMSEQ[THEN iffD2]) 
348 
let ?I = "indicator :: 'a set \<Rightarrow> 'a \<Rightarrow> real" 

349 
show "s \<in> sets lebesgue" using has_integral_lebesgue[OF assms] . 

350 
show "0 \<le> m" using assms by (rule has_integral_nonneg) auto 

351 
have "(\<lambda>n. integral UNIV (?I (s \<inter> cube n))) > integral UNIV (?I s)" 

352 
proof (intro dominated_convergence(2) ballI) 

353 
show "(?I s) integrable_on UNIV" unfolding integrable_on_def using assms by auto 

354 
fix n show "?I (s \<inter> cube n) integrable_on UNIV" 

355 
unfolding integrable_indicator_UNIV using `s \<in> sets lebesgue` by (auto dest: lebesgueD) 

356 
fix x show "norm (?I (s \<inter> cube n) x) \<le> ?I s x" by (auto simp: indicator_def) 

357 
next 

358 
fix x :: 'a 

359 
from mem_big_cube obtain k where k: "x \<in> cube k" . 

360 
{ fix n have "?I (s \<inter> cube (n + k)) x = ?I s x" 

361 
using k cube_subset[of k "n + k"] by (auto simp: indicator_def) } 

362 
note * = this 

363 
show "(\<lambda>k. ?I (s \<inter> cube k) x) > ?I s x" 

364 
by (rule LIMSEQ_offset[where k=k]) (auto simp: *) 

365 
qed 

366 
then show "(\<lambda>n. integral (cube n) (?I s)) > m" 

367 
unfolding integral_unique[OF assms] integral_indicator_UNIV by simp 

368 
qed 

369 

370 
lemma has_integral_iff_lmeasure: 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

371 
"(indicator A has_integral m) UNIV \<longleftrightarrow> (A \<in> sets lebesgue \<and> 0 \<le> m \<and> lebesgue.\<mu> A = extreal m)" 
40859  372 
proof 
41654  373 
assume "(indicator A has_integral m) UNIV" 
374 
with has_integral_lmeasure[OF this] has_integral_lebesgue[OF this] 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

375 
show "A \<in> sets lebesgue \<and> 0 \<le> m \<and> lebesgue.\<mu> A = extreal m" 
41654  376 
by (auto intro: has_integral_nonneg) 
40859  377 
next 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

378 
assume "A \<in> sets lebesgue \<and> 0 \<le> m \<and> lebesgue.\<mu> A = extreal m" 
41654  379 
then show "(indicator A has_integral m) UNIV" by (intro lmeasure_finite_has_integral) auto 
38656  380 
qed 
381 

41654  382 
lemma lmeasure_eq_integral: assumes "(indicator s::_\<Rightarrow>real) integrable_on UNIV" 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

383 
shows "lebesgue.\<mu> s = extreal (integral UNIV (indicator s))" 
41654  384 
using assms unfolding integrable_on_def 
385 
proof safe 

386 
fix y :: real assume "(indicator s has_integral y) UNIV" 

387 
from this[unfolded has_integral_iff_lmeasure] integral_unique[OF this] 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

388 
show "lebesgue.\<mu> s = extreal (integral UNIV (indicator s))" by simp 
40859  389 
qed 
38656  390 

391 
lemma lebesgue_simple_function_indicator: 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

392 
fixes f::"'a::ordered_euclidean_space \<Rightarrow> extreal" 
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

393 
assumes f:"simple_function lebesgue f" 
38656  394 
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

395 
by (rule, subst lebesgue.simple_function_indicator_representation[OF f]) auto 
38656  396 

41654  397 
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

398 
"(indicator s::_\<Rightarrow>real) integrable_on UNIV \<Longrightarrow> integral UNIV (indicator s) = real (lebesgue.\<mu> s)" 
41654  399 
by (subst lmeasure_eq_integral) (auto intro!: integral_nonneg) 
38656  400 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

401 
lemma lmeasure_finite: assumes "(indicator s::_\<Rightarrow>real) integrable_on UNIV" shows "lebesgue.\<mu> s \<noteq> \<infinity>" 
41654  402 
using lmeasure_eq_integral[OF assms] by auto 
38656  403 

40859  404 
lemma negligible_iff_lebesgue_null_sets: 
405 
"negligible A \<longleftrightarrow> A \<in> lebesgue.null_sets" 

406 
proof 

407 
assume "negligible A" 

408 
from this[THEN lebesgueI_negligible] this[THEN lmeasure_eq_0] 

409 
show "A \<in> lebesgue.null_sets" by auto 

410 
next 

411 
assume A: "A \<in> lebesgue.null_sets" 

41654  412 
then have *:"((indicator A) has_integral (0::real)) UNIV" using lmeasure_finite_has_integral[of A] by auto 
413 
show "negligible A" unfolding negligible_def 

414 
proof (intro allI) 

415 
fix a b :: 'a 

416 
have integrable: "(indicator A :: _\<Rightarrow>real) integrable_on {a..b}" 

417 
by (intro integrable_on_subinterval has_integral_integrable) (auto intro: *) 

418 
then have "integral {a..b} (indicator A) \<le> (integral UNIV (indicator A) :: real)" 

419 
using * by (auto intro!: integral_subset_le has_integral_integrable) 

420 
moreover have "(0::real) \<le> integral {a..b} (indicator A)" 

421 
using integrable by (auto intro!: integral_nonneg) 

422 
ultimately have "integral {a..b} (indicator A) = (0::real)" 

423 
using integral_unique[OF *] by auto 

424 
then show "(indicator A has_integral (0::real)) {a..b}" 

425 
using integrable_integral[OF integrable] by simp 

426 
qed 

427 
qed 

428 

429 
lemma integral_const[simp]: 

430 
fixes a b :: "'a::ordered_euclidean_space" 

431 
shows "integral {a .. b} (\<lambda>x. c) = content {a .. b} *\<^sub>R c" 

432 
by (rule integral_unique) (rule has_integral_const) 

433 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

434 
lemma lmeasure_UNIV[intro]: "lebesgue.\<mu> (UNIV::'a::ordered_euclidean_space set) = \<infinity>" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

435 
proof (simp add: lebesgue_def, intro SUP_PInfty bexI) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

436 
fix n :: nat 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

437 
have "indicator UNIV = (\<lambda>x::'a. 1 :: real)" by auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

438 
moreover 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

439 
{ have "real n \<le> (2 * real n) ^ DIM('a)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

440 
proof (cases n) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

441 
case 0 then show ?thesis by auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

442 
next 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

443 
case (Suc n') 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

444 
have "real n \<le> (2 * real n)^1" by auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

445 
also have "(2 * real n)^1 \<le> (2 * real n) ^ DIM('a)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

446 
using Suc DIM_positive[where 'a='a] by (intro power_increasing) (auto simp: real_of_nat_Suc) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

447 
finally show ?thesis . 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

448 
qed } 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

449 
ultimately show "extreal (real n) \<le> extreal (integral (cube n) (indicator UNIV::'a\<Rightarrow>real))" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

450 
using integral_const DIM_positive[where 'a='a] 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

451 
by (auto simp: cube_def content_closed_interval_cases setprod_constant) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

452 
qed simp 
40859  453 

454 
lemma 

455 
fixes a b ::"'a::ordered_euclidean_space" 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

456 
shows lmeasure_atLeastAtMost[simp]: "lebesgue.\<mu> {a..b} = extreal (content {a..b})" 
41654  457 
proof  
458 
have "(indicator (UNIV \<inter> {a..b})::_\<Rightarrow>real) integrable_on UNIV" 

459 
unfolding integrable_indicator_UNIV by (simp add: integrable_const indicator_def_raw) 

460 
from lmeasure_eq_integral[OF this] show ?thesis unfolding integral_indicator_UNIV 

461 
by (simp add: indicator_def_raw) 

40859  462 
qed 
463 

464 
lemma atLeastAtMost_singleton_euclidean[simp]: 

465 
fixes a :: "'a::ordered_euclidean_space" shows "{a .. a} = {a}" 

466 
by (force simp: eucl_le[where 'a='a] euclidean_eq[where 'a='a]) 

467 

468 
lemma content_singleton[simp]: "content {a} = 0" 

469 
proof  

470 
have "content {a .. a} = 0" 

471 
by (subst content_closed_interval) auto 

472 
then show ?thesis by simp 

473 
qed 

474 

475 
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

476 
fixes a :: "'a::ordered_euclidean_space" shows "lebesgue.\<mu> {a} = 0" 
41654  477 
using lmeasure_atLeastAtMost[of a a] by simp 
40859  478 

479 
declare content_real[simp] 

480 

481 
lemma 

482 
fixes a b :: real 

483 
shows lmeasure_real_greaterThanAtMost[simp]: 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

484 
"lebesgue.\<mu> {a <.. b} = extreal (if a \<le> b then b  a else 0)" 
40859  485 
proof cases 
486 
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

487 
then have "lebesgue.\<mu> {a <.. b} = lebesgue.\<mu> {a .. b}  lebesgue.\<mu> {a}" 
41654  488 
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

489 
(auto intro!: arg_cong[where f=lebesgue.\<mu>]) 
40859  490 
then show ?thesis by auto 
491 
qed auto 

492 

493 
lemma 

494 
fixes a b :: real 

495 
shows lmeasure_real_atLeastLessThan[simp]: 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

496 
"lebesgue.\<mu> {a ..< b} = extreal (if a \<le> b then b  a else 0)" 
40859  497 
proof cases 
498 
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

499 
then have "lebesgue.\<mu> {a ..< b} = lebesgue.\<mu> {a .. b}  lebesgue.\<mu> {b}" 
41654  500 
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

501 
(auto intro!: arg_cong[where f=lebesgue.\<mu>]) 
41654  502 
then show ?thesis by auto 
503 
qed auto 

504 

505 
lemma 

506 
fixes a b :: real 

507 
shows lmeasure_real_greaterThanLessThan[simp]: 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

508 
"lebesgue.\<mu> {a <..< b} = extreal (if a \<le> b then b  a else 0)" 
41654  509 
proof cases 
510 
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

511 
then have "lebesgue.\<mu> {a <..< b} = lebesgue.\<mu> {a <.. b}  lebesgue.\<mu> {b}" 
41654  512 
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

513 
(auto intro!: arg_cong[where f=lebesgue.\<mu>]) 
40859  514 
then show ?thesis by auto 
515 
qed auto 

516 

41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

517 
subsection {* LebesgueBorel measure *} 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

518 

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

519 
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

520 

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 
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

522 
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

523 
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

524 
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

525 
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

526 
by (simp_all add: measurable_def_raw lborel_def) 
40859  527 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

528 
interpretation lborel: measure_space "lborel :: ('a::ordered_euclidean_space) measure_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

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" 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

533 
proof (rule lebesgue.measure_space_subalgebra) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

534 
have "sigma_algebra (lborel::'a measure_space) \<longleftrightarrow> sigma_algebra (borel::'a algebra)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

535 
unfolding sigma_algebra_iff2 lborel_def by simp 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

536 
then show "sigma_algebra (lborel::'a measure_space)" by simp default 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

537 
qed auto 
40859  538 

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

539 
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

540 
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

541 
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

542 
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

543 
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

544 
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

545 
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

546 
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

547 
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

548 
{ 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

549 
thus "(\<Union>i. cube i) = space lborel" by auto 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

550 
show "\<forall>i. measure lborel (cube i) \<noteq> \<infinity>" by (simp add: cube_def) 
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

551 
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

552 
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

553 

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

554 
interpretation lebesgue: sigma_finite_measure lebesgue 
40859  555 
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

556 
from lborel.sigma_finite guess A .. 
40859  557 
moreover then have "range A \<subseteq> sets lebesgue" using lebesgueI_borel by blast 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

558 
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> \<infinity>)" 
40859  559 
by auto 
560 
qed 

561 

41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

562 
subsection {* Lebesgue integrable implies Gauge integrable *} 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

563 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

564 
lemma positive_not_Inf: 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

565 
"0 \<le> x \<Longrightarrow> x \<noteq> \<infinity> \<Longrightarrow> \<bar>x\<bar> \<noteq> \<infinity>" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

566 
by (cases x) auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

567 

cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

568 
lemma has_integral_cmult_real: 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

569 
fixes c :: real 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

570 
assumes "c \<noteq> 0 \<Longrightarrow> (f has_integral x) A" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

571 
shows "((\<lambda>x. c * f x) has_integral c * x) A" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

572 
proof cases 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

573 
assume "c \<noteq> 0" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

574 
from has_integral_cmul[OF assms[OF this], of c] show ?thesis 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

575 
unfolding real_scaleR_def . 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

576 
qed simp 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

577 

40859  578 
lemma simple_function_has_integral: 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

579 
fixes f::"'a::ordered_euclidean_space \<Rightarrow> extreal" 
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

580 
assumes f:"simple_function lebesgue f" 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

581 
and f':"range f \<subseteq> {0..<\<infinity>}" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

582 
and om:"\<And>x. x \<in> range f \<Longrightarrow> lebesgue.\<mu> (f ` {x} \<inter> UNIV) = \<infinity> \<Longrightarrow> x = 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

583 
shows "((\<lambda>x. real (f x)) has_integral (real (integral\<^isup>S lebesgue f))) UNIV" 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

584 
unfolding simple_integral_def space_lebesgue 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

585 
proof (subst lebesgue_simple_function_indicator) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

586 
let "?M x" = "lebesgue.\<mu> (f ` {x} \<inter> UNIV)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

587 
let "?F x" = "indicator (f ` {x})" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

588 
{ fix x y assume "y \<in> range f" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

589 
from subsetD[OF f' this] have "y * ?F y x = extreal (real y * ?F y x)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

590 
by (cases rule: extreal2_cases[of y "?F y x"]) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

591 
(auto simp: indicator_def one_extreal_def split: split_if_asm) } 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

592 
moreover 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

593 
{ fix x assume x: "x\<in>range f" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

594 
have "x * ?M x = real x * real (?M x)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

595 
proof cases 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

596 
assume "x \<noteq> 0" with om[OF x] have "?M x \<noteq> \<infinity>" by auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

597 
with subsetD[OF f' x] f[THEN lebesgue.simple_functionD(2)] show ?thesis 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

598 
by (cases rule: extreal2_cases[of x "?M x"]) auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

599 
qed simp } 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

600 
ultimately 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

601 
have "((\<lambda>x. real (\<Sum>y\<in>range f. y * ?F y x)) has_integral real (\<Sum>x\<in>range f. x * ?M x)) UNIV \<longleftrightarrow> 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

602 
((\<lambda>x. \<Sum>y\<in>range f. real y * ?F y x) has_integral (\<Sum>x\<in>range f. real x * real (?M x))) UNIV" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

603 
by simp 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

604 
also have \<dots> 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

605 
proof (intro has_integral_setsum has_integral_cmult_real lmeasure_finite_has_integral 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

606 
real_of_extreal_pos lebesgue.positive_measure ballI) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

607 
show *: "finite (range f)" "\<And>y. f ` {y} \<in> sets lebesgue" "\<And>y. f ` {y} \<inter> UNIV \<in> sets lebesgue" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

608 
using lebesgue.simple_functionD[OF f] by auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

609 
fix y assume "real y \<noteq> 0" "y \<in> range f" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

610 
with * om[OF this(2)] show "lebesgue.\<mu> (f ` {y}) = extreal (real (?M y))" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

611 
by (auto simp: extreal_real) 
41654  612 
qed 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

613 
finally show "((\<lambda>x. real (\<Sum>y\<in>range f. y * ?F y x)) has_integral real (\<Sum>x\<in>range f. x * ?M x)) UNIV" . 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

614 
qed fact 
40859  615 

616 
lemma bounded_realI: assumes "\<forall>x\<in>s. abs (x::real) \<le> B" shows "bounded s" 

617 
unfolding bounded_def dist_real_def apply(rule_tac x=0 in exI) 

618 
using assms by auto 

619 

620 
lemma simple_function_has_integral': 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

621 
fixes f::"'a::ordered_euclidean_space \<Rightarrow> extreal" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

622 
assumes f: "simple_function lebesgue f" "\<And>x. 0 \<le> f x" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

623 
and i: "integral\<^isup>S lebesgue f \<noteq> \<infinity>" 
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

624 
shows "((\<lambda>x. real (f x)) has_integral (real (integral\<^isup>S lebesgue f))) UNIV" 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

625 
proof  
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

626 
let ?f = "\<lambda>x. if x \<in> f ` {\<infinity>} then 0 else f x" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

627 
note f(1)[THEN lebesgue.simple_functionD(2)] 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

628 
then have [simp, intro]: "\<And>X. f ` X \<in> sets lebesgue" by auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

629 
have f': "simple_function lebesgue ?f" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

630 
using f by (intro lebesgue.simple_function_If_set) auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

631 
have rng: "range ?f \<subseteq> {0..<\<infinity>}" using f by auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

632 
have "AE x in lebesgue. f x = ?f x" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

633 
using lebesgue.simple_integral_PInf[OF f i] 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

634 
by (intro lebesgue.AE_I[where N="f ` {\<infinity>} \<inter> space lebesgue"]) auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

635 
from f(1) f' this have eq: "integral\<^isup>S lebesgue f = integral\<^isup>S lebesgue ?f" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

636 
by (rule lebesgue.simple_integral_cong_AE) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

637 
have real_eq: "\<And>x. real (f x) = real (?f x)" by auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

638 

cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

639 
show ?thesis 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

640 
unfolding eq real_eq 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

641 
proof (rule simple_function_has_integral[OF f' rng]) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

642 
fix x assume x: "x \<in> range ?f" and inf: "lebesgue.\<mu> (?f ` {x} \<inter> UNIV) = \<infinity>" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

643 
have "x * lebesgue.\<mu> (?f ` {x} \<inter> UNIV) = (\<integral>\<^isup>S y. x * indicator (?f ` {x}) y \<partial>lebesgue)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

644 
using f'[THEN lebesgue.simple_functionD(2)] 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

645 
by (simp add: lebesgue.simple_integral_cmult_indicator) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

646 
also have "\<dots> \<le> integral\<^isup>S lebesgue f" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

647 
using f'[THEN lebesgue.simple_functionD(2)] f 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

648 
by (intro lebesgue.simple_integral_mono lebesgue.simple_function_mult lebesgue.simple_function_indicator) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

649 
(auto split: split_indicator) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

650 
finally show "x = 0" unfolding inf using i subsetD[OF rng x] by (auto split: split_if_asm) 
40859  651 
qed 
652 
qed 

653 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

654 
lemma real_of_extreal_positive_mono: 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

655 
"\<lbrakk>0 \<le> x; x \<le> y; y \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> real x \<le> real y" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

656 
by (cases rule: extreal2_cases[of x y]) auto 
40859  657 

658 
lemma positive_integral_has_integral: 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

659 
fixes f :: "'a::ordered_euclidean_space \<Rightarrow> extreal" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

660 
assumes f: "f \<in> borel_measurable lebesgue" "range f \<subseteq> {0..<\<infinity>}" "integral\<^isup>P lebesgue f \<noteq> \<infinity>" 
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

661 
shows "((\<lambda>x. real (f x)) has_integral (real (integral\<^isup>P lebesgue f))) UNIV" 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

662 
proof  
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

663 
from lebesgue.borel_measurable_implies_simple_function_sequence'[OF f(1)] 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

664 
guess u . note u = this 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

665 
have SUP_eq: "\<And>x. (SUP i. u i x) = f x" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

666 
using u(4) f(2)[THEN subsetD] by (auto split: split_max) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

667 
let "?u i x" = "real (u i x)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

668 
note u_eq = lebesgue.positive_integral_eq_simple_integral[OF u(1,5), symmetric] 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

669 
{ fix i 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

670 
note u_eq 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

671 
also have "integral\<^isup>P lebesgue (u i) \<le> (\<integral>\<^isup>+x. max 0 (f x) \<partial>lebesgue)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

672 
by (intro lebesgue.positive_integral_mono) (auto intro: le_SUPI simp: u(4)[symmetric]) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

673 
finally have "integral\<^isup>S lebesgue (u i) \<noteq> \<infinity>" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

674 
unfolding positive_integral_max_0 using f by auto } 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

675 
note u_fin = this 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

676 
then have u_int: "\<And>i. (?u i has_integral real (integral\<^isup>S lebesgue (u i))) UNIV" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

677 
by (rule simple_function_has_integral'[OF u(1,5)]) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

678 
have "\<forall>x. \<exists>r\<ge>0. f x = extreal r" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

679 
proof 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

680 
fix x from f(2) have "0 \<le> f x" "f x \<noteq> \<infinity>" by (auto simp: subset_eq) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

681 
then show "\<exists>r\<ge>0. f x = extreal r" by (cases "f x") auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

682 
qed 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

683 
from choice[OF this] obtain f' where f': "f = (\<lambda>x. extreal (f' x))" "\<And>x. 0 \<le> f' x" by auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

684 

cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

685 
have "\<forall>i. \<exists>r. \<forall>x. 0 \<le> r x \<and> u i x = extreal (r x)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

686 
proof 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

687 
fix i show "\<exists>r. \<forall>x. 0 \<le> r x \<and> u i x = extreal (r x)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

688 
proof (intro choice allI) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

689 
fix i x have "u i x \<noteq> \<infinity>" using u(3)[of i] by (auto simp: image_iff) metis 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

690 
then show "\<exists>r\<ge>0. u i x = extreal r" using u(5)[of i x] by (cases "u i x") auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

691 
qed 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

692 
qed 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

693 
from choice[OF this] obtain u' where 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

694 
u': "u = (\<lambda>i x. extreal (u' i x))" "\<And>i x. 0 \<le> u' i x" by (auto simp: fun_eq_iff) 
40859  695 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

696 
have convergent: "f' integrable_on UNIV \<and> 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

697 
(\<lambda>k. integral UNIV (u' k)) > integral UNIV f'" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

698 
proof (intro monotone_convergence_increasing allI ballI) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

699 
show int: "\<And>k. (u' k) integrable_on UNIV" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

700 
using u_int unfolding integrable_on_def u' by auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

701 
show "\<And>k x. u' k x \<le> u' (Suc k) x" using u(2,3,5) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

702 
by (auto simp: incseq_Suc_iff le_fun_def image_iff u' intro!: real_of_extreal_positive_mono) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

703 
show "\<And>x. (\<lambda>k. u' k x) > f' x" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

704 
using SUP_eq u(2) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

705 
by (intro SUP_eq_LIMSEQ[THEN iffD1]) (auto simp: u' f' incseq_mono incseq_Suc_iff le_fun_def) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

706 
show "bounded {integral UNIV (u' k)k. True}" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

707 
proof (safe intro!: bounded_realI) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

708 
fix k 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

709 
have "\<bar>integral UNIV (u' k)\<bar> = integral UNIV (u' k)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

710 
by (intro abs_of_nonneg integral_nonneg int ballI u') 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

711 
also have "\<dots> = real (integral\<^isup>S lebesgue (u k))" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

712 
using u_int[THEN integral_unique] by (simp add: u') 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

713 
also have "\<dots> = real (integral\<^isup>P lebesgue (u k))" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

714 
using lebesgue.positive_integral_eq_simple_integral[OF u(1,5)] by simp 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

715 
also have "\<dots> \<le> real (integral\<^isup>P lebesgue f)" using f 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

716 
by (auto intro!: real_of_extreal_positive_mono lebesgue.positive_integral_positive 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

717 
lebesgue.positive_integral_mono le_SUPI simp: SUP_eq[symmetric]) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

718 
finally show "\<bar>integral UNIV (u' k)\<bar> \<le> real (integral\<^isup>P lebesgue f)" . 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

719 
qed 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

720 
qed 
40859  721 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

722 
have "integral\<^isup>P lebesgue f = extreal (integral UNIV f')" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

723 
proof (rule tendsto_unique[OF trivial_limit_sequentially]) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

724 
have "(\<lambda>i. integral\<^isup>S lebesgue (u i)) > (SUP i. integral\<^isup>P lebesgue (u i))" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

725 
unfolding u_eq by (intro LIMSEQ_extreal_SUPR lebesgue.incseq_positive_integral u) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

726 
also note lebesgue.positive_integral_monotone_convergence_SUP 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

727 
[OF u(2) lebesgue.borel_measurable_simple_function[OF u(1)] u(5), symmetric] 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

728 
finally show "(\<lambda>k. integral\<^isup>S lebesgue (u k)) > integral\<^isup>P lebesgue f" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

729 
unfolding SUP_eq . 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

730 

cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

731 
{ fix k 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

732 
have "0 \<le> integral\<^isup>S lebesgue (u k)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

733 
using u by (auto intro!: lebesgue.simple_integral_positive) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

734 
then have "integral\<^isup>S lebesgue (u k) = extreal (real (integral\<^isup>S lebesgue (u k)))" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

735 
using u_fin by (auto simp: extreal_real) } 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

736 
note * = this 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

737 
show "(\<lambda>k. integral\<^isup>S lebesgue (u k)) > extreal (integral UNIV f')" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

738 
using convergent using u_int[THEN integral_unique, symmetric] 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

739 
by (subst *) (simp add: lim_extreal u') 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

740 
qed 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

741 
then show ?thesis using convergent by (simp add: f' integrable_integral) 
40859  742 
qed 
743 

744 
lemma lebesgue_integral_has_integral: 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

745 
fixes f :: "'a::ordered_euclidean_space \<Rightarrow> real" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

746 
assumes f: "integrable lebesgue f" 
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

747 
shows "(f has_integral (integral\<^isup>L lebesgue f)) UNIV" 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

748 
proof  
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

749 
let ?n = "\<lambda>x. real (extreal (max 0 ( f x)))" and ?p = "\<lambda>x. real (extreal (max 0 (f x)))" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

750 
have *: "f = (\<lambda>x. ?p x  ?n x)" by (auto simp del: extreal_max) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

751 
{ fix f have "(\<integral>\<^isup>+ x. extreal (f x) \<partial>lebesgue) = (\<integral>\<^isup>+ x. extreal (max 0 (f x)) \<partial>lebesgue)" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

752 
by (intro lebesgue.positive_integral_cong_pos) (auto split: split_max) } 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

753 
note eq = this 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

754 
show ?thesis 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

755 
unfolding lebesgue_integral_def 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

756 
apply (subst *) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

757 
apply (rule has_integral_sub) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

758 
unfolding eq[of f] eq[of "\<lambda>x.  f x"] 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

759 
apply (safe intro!: positive_integral_has_integral) 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

760 
using integrableD[OF f] 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

761 
by (auto simp: zero_extreal_def[symmetric] positive_integral_max_0 split: split_max 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

762 
intro!: lebesgue.measurable_If lebesgue.borel_measurable_extreal) 
40859  763 
qed 
764 

41546
2a12c23b7a34
integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents:
41097
diff
changeset

765 
lemma lebesgue_positive_integral_eq_borel: 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

766 
assumes f: "f \<in> borel_measurable borel" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

767 
shows "integral\<^isup>P lebesgue f = integral\<^isup>P lborel f" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

768 
proof  
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

769 
from f have "integral\<^isup>P lebesgue (\<lambda>x. max 0 (f x)) = integral\<^isup>P lborel (\<lambda>x. max 0 (f x))" 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

770 
by (auto intro!: lebesgue.positive_integral_subalgebra[symmetric]) default 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

771 
then show ?thesis unfolding positive_integral_max_0 . 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

772 
qed 
41546
2a12c23b7a34
integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents:
41097
diff
changeset

773 

2a12c23b7a34
integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents:
41097
diff
changeset

774 
lemma lebesgue_integral_eq_borel: 
2a12c23b7a34
integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents:
41097
diff
changeset

775 
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

776 
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

777 
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

778 
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

779 
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

780 
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

781 
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

782 
show ?P ?I by auto 
2a12c23b7a34
integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents:
41097
diff
changeset

783 
qed 
2a12c23b7a34
integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents:
41097
diff
changeset

784 

2a12c23b7a34
integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents:
41097
diff
changeset

785 
lemma borel_integral_has_integral: 
2a12c23b7a34
integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents:
41097
diff
changeset

786 
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

787 
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

788 
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

789 
proof  
2a12c23b7a34
integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents:
41097
diff
changeset

790 
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

791 
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

792 
from f show ?thesis 
2a12c23b7a34
integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents:
41097
diff
changeset

793 
using lebesgue_integral_has_integral[of f] 
2a12c23b7a34
integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents:
41097
diff
changeset

794 
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

795 
qed 
2a12c23b7a34
integral on lebesgue measure is extension of integral on borel measure
hoelzl
parents:
41097
diff
changeset

796 

41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

797 
subsection {* Equivalence between product spaces and euclidean spaces *} 
40859  798 

799 
definition e2p :: "'a::ordered_euclidean_space \<Rightarrow> (nat \<Rightarrow> real)" where 

800 
"e2p x = (\<lambda>i\<in>{..<DIM('a)}. x$$i)" 

801 

802 
definition p2e :: "(nat \<Rightarrow> real) \<Rightarrow> 'a::ordered_euclidean_space" where 

803 
"p2e x = (\<chi>\<chi> i. x i)" 

804 

41095  805 
lemma e2p_p2e[simp]: 
806 
"x \<in> extensional {..<DIM('a)} \<Longrightarrow> e2p (p2e x::'a::ordered_euclidean_space) = x" 

807 
by (auto simp: fun_eq_iff extensional_def p2e_def e2p_def) 

40859  808 

41095  809 
lemma p2e_e2p[simp]: 
810 
"p2e (e2p x) = (x::'a::ordered_euclidean_space)" 

811 
by (auto simp: euclidean_eq[where 'a='a] p2e_def e2p_def) 

40859  812 

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

813 
interpretation lborel_product: product_sigma_finite "\<lambda>x. lborel::real measure_space" 
40859  814 
by default 
815 

41831  816 
interpretation lborel_space: finite_product_sigma_finite "\<lambda>x. lborel::real measure_space" "{..<n}" for n :: nat 
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

817 
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

818 
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

819 
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

820 
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

821 
proof  
41831  822 
show "finite_product_sigma_finite (\<lambda>x. lborel::real measure_space) {..<n}" 
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

823 
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

824 
qed simp_all 
40859  825 

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

826 
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

827 
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

828 
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

829 
\<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

830 
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

831 
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

832 
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

833 
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

834 
by (subst sigma_product_algebra_sigma_eq[of I "\<lambda>_ i. {..<real i}" ]) 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

835 
(auto intro!: measurable_sigma_sigma incseq_SucI real_arch_lt 
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

836 
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

837 
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

838 
unfolding lborel_def borel_eq_lessThan lebesgue_def sigma_def by simp 
40859  839 
qed 
840 

41661  841 
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

842 
"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

843 
(\<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

844 
(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

845 
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

846 
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

847 
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

848 
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

849 
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

850 
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

851 
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

852 
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

853 
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

854 
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

855 
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

856 
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

857 
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

858 
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

859 
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

860 
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

861 
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

862 
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

863 
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

864 
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

865 
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

866 
qed 
41661  867 

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

868 
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

869 
"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

870 
(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

871 
(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

872 
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

873 
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

874 
let ?E = "\<lparr> space = UNIV :: 'a set, sets = range lessThan \<rparr>" 
41095  875 
show "p2e \<in> space ?P \<rightarrow> space ?E" by simp 
876 
fix A assume "A \<in> sets ?E" 

877 
then obtain x where "A = {..<x}" by auto 

878 
then have "p2e ` A \<inter> space ?P = (\<Pi>\<^isub>E i\<in>{..<DIM('a)}. {..< x $$ i})" 

879 
using DIM_positive 

880 
by (auto simp: Pi_iff set_eq_iff p2e_def 

881 
euclidean_eq[where 'a='a] eucl_less[where 'a='a]) 

882 
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

883 
qed simp 
41095  884 

41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

885 
lemma Int_stable_cuboids: 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

886 
fixes x::"'a::ordered_euclidean_space" 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

887 
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

888 
by (auto simp: inter_interval Int_stable_def) 
40859  889 

41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

890 
lemma lborel_eq_lborel_space: 
40859  891 
fixes A :: "('a::ordered_euclidean_space) set" 
892 
assumes "A \<in> sets borel" 

41831  893 
shows "lborel.\<mu> A = lborel_space.\<mu> DIM('a) (p2e ` A \<inter> (space (lborel_space.P DIM('a))))" 
41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

894 
(is "_ = measure ?P (?T A)") 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

895 
proof (rule measure_unique_Int_stable_vimage) 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

896 
show "measure_space ?P" by default 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

897 
show "measure_space lborel" by default 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

898 

a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

899 
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

900 
show "Int_stable ?E" using Int_stable_cuboids . 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

901 
show "range cube \<subseteq> sets ?E" unfolding cube_def_raw by auto 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

902 
show "incseq cube" using cube_subset_Suc by (auto intro!: incseq_SucI) 
41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

903 
{ fix x have "\<exists>n. x \<in> cube n" using mem_big_cube[of x] by fastsimp } 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

904 
then show "(\<Union>i. cube i) = space ?E" by auto 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

905 
{ fix i show "lborel.\<mu> (cube i) \<noteq> \<infinity>" unfolding cube_def by auto } 
41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

906 
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

907 
using assms by (simp_all add: borel_eq_atLeastAtMost) 
40859  908 

41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

909 
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

910 
using measurable_p2e unfolding measurable_def by simp 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

911 
{ fix X assume "X \<in> sets ?E" 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

912 
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

913 
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

914 
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

915 
show "lborel.\<mu> X = measure ?P (?T X)" 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

916 
proof cases 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

917 
assume "X \<noteq> {}" 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

918 
then have "a \<le> b" 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

919 
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

920 
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

921 
by (auto simp: content_closed_interval eucl_le[where 'a='a] 
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

922 
intro!: setprod_extreal[symmetric]) 
41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

923 
also have "\<dots> = measure ?P (?T X)" 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

924 
unfolding * by (subst lborel_space.measure_times) auto 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

925 
finally show ?thesis . 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

926 
qed simp } 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

927 
qed 
40859  928 

41831  929 
lemma measure_preserving_p2e: 
930 
"p2e \<in> measure_preserving (\<Pi>\<^isub>M i\<in>{..<DIM('a)}. (lborel :: real measure_space)) 

931 
(lborel::'a::ordered_euclidean_space measure_space)" (is "_ \<in> measure_preserving ?P ?E") 

932 
proof 

933 
show "p2e \<in> measurable ?P ?E" 

934 
using measurable_p2e by (simp add: measurable_def) 

935 
fix A :: "'a set" assume "A \<in> sets lborel" 

936 
then show "lborel_space.\<mu> DIM('a) (p2e ` A \<inter> (space (lborel_space.P DIM('a)))) = lborel.\<mu> A" 

937 
by (intro lborel_eq_lborel_space[symmetric]) simp 

938 
qed 

939 

41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

940 
lemma lebesgue_eq_lborel_space_in_borel: 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

941 
fixes A :: "('a::ordered_euclidean_space) set" 
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

942 
assumes A: "A \<in> sets borel" 
41831  943 
shows "lebesgue.\<mu> A = lborel_space.\<mu> DIM('a) (p2e ` A \<inter> (space (lborel_space.P DIM('a))))" 
41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

944 
using lborel_eq_lborel_space[OF A] by simp 
40859  945 

946 
lemma borel_fubini_positiv_integral: 

41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset

947 
fixes f :: "'a::ordered_euclidean_space \<Rightarrow> extreal" 
40859  948 
assumes f: "f \<in> borel_measurable borel" 
41831  949 
shows "integral\<^isup>P lborel f = \<integral>\<^isup>+x. f (p2e x) \<partial>(lborel_space.P DIM('a))" 
950 
proof (rule lborel_space.positive_integral_vimage[OF _ measure_preserving_p2e _]) 

951 
show "f \<in> borel_measurable lborel" 

952 
using f by (simp_all add: measurable_def) 

953 
qed default 

40859  954 

41704
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

955 
lemma borel_fubini_integrable: 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

956 
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

957 
shows "integrable lborel f \<longleftrightarrow> 
41831  958 
integrable (lborel_space.P DIM('a)) (\<lambda>x. f (p2e x))" 
41704
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

959 
(is "_ \<longleftrightarrow> integrable ?B ?f") 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

960 
proof 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

961 
assume "integrable lborel f" 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

962 
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

963 
by auto 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

964 
moreover with measurable_p2e 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

965 
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

966 
by (rule measurable_comp) 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

967 
ultimately show "integrable ?B ?f" 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

968 
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

969 
next 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

970 
assume "integrable ?B ?f" 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

971 
moreover then 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

972 
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

973 
by (auto intro!: measurable_e2p measurable_comp) 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

974 
then have "f \<in> borel_measurable borel" 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

975 
by (simp cong: measurable_cong) 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

976 
ultimately show "integrable lborel f" 
41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

977 
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

978 
qed 
8c539202f854
add borel_fubini_integrable; remove unused bijectivity rules for measureable functions
hoelzl
parents:
41689
diff
changeset

979 

40859  980 
lemma borel_fubini: 
981 
fixes f :: "'a::ordered_euclidean_space \<Rightarrow> real" 

982 
assumes f: "f \<in> borel_measurable borel" 

41831  983 
shows "integral\<^isup>L lborel f = \<integral>x. f (p2e x) \<partial>(lborel_space.P DIM('a))" 
41706
a207a858d1f6
prefer p2e before e2p; use measure_unique_Int_stable_vimage;
hoelzl
parents:
41704
diff
changeset

984 
using f by (simp add: borel_fubini_positiv_integral lebesgue_integral_def) 
38656  985 

986 
end 