| author | paulson <lp15@cam.ac.uk> | 
| Wed, 26 Mar 2025 21:11:04 +0000 | |
| changeset 82351 | 882b80bd10c8 | 
| parent 80914 | d97fdabd9e2b | 
| permissions | -rw-r--r-- | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1 | (* Title: HOL/Analysis/Equivalence_Measurable_On_Borel | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2 | Author: LC Paulson (some material ported from HOL Light) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3 | *) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5 | section\<open>Equivalence Between Classical Borel Measurability and HOL Light's\<close> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 7 | theory Equivalence_Measurable_On_Borel | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 8 | imports Equivalence_Lebesgue_Henstock_Integration Improper_Integral Continuous_Extension | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 9 | begin | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 10 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 11 | subsection\<open>Austin's Lemma\<close> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 12 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 13 | lemma Austin_Lemma: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 14 | fixes \<D> :: "'a::euclidean_space set set" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 15 | assumes "finite \<D>" and \<D>: "\<And>D. D \<in> \<D> \<Longrightarrow> \<exists>k a b. D = cbox a b \<and> (\<forall>i \<in> Basis. b\<bullet>i - a\<bullet>i = k)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 16 | obtains \<C> where "\<C> \<subseteq> \<D>" "pairwise disjnt \<C>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 17 |                   "measure lebesgue (\<Union>\<C>) \<ge> measure lebesgue (\<Union>\<D>) / 3 ^ (DIM('a))"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 18 | using assms | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 19 | proof (induction "card \<D>" arbitrary: \<D> thesis rule: less_induct) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 20 | case less | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 21 | show ?case | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 22 |   proof (cases "\<D> = {}")
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 23 | case True | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 24 | then show thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 25 | using less by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 26 | next | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 27 | case False | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 28 | then have "Max (Sigma_Algebra.measure lebesgue ` \<D>) \<in> Sigma_Algebra.measure lebesgue ` \<D>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 29 | using Max_in finite_imageI \<open>finite \<D>\<close> by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 30 | then obtain D where "D \<in> \<D>" and "measure lebesgue D = Max (measure lebesgue ` \<D>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 31 | by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 32 | then have D: "\<And>C. C \<in> \<D> \<Longrightarrow> measure lebesgue C \<le> measure lebesgue D" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 33 | by (simp add: \<open>finite \<D>\<close>) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 34 |     let ?\<E> = "{C. C \<in> \<D> - {D} \<and> disjnt C D}"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 35 | obtain \<D>' where \<D>'sub: "\<D>' \<subseteq> ?\<E>" and \<D>'dis: "pairwise disjnt \<D>'" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 36 |       and \<D>'m: "measure lebesgue (\<Union>\<D>') \<ge> measure lebesgue (\<Union>?\<E>) / 3 ^ (DIM('a))"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 37 | proof (rule less.hyps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 38 | have *: "?\<E> \<subset> \<D>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 39 | using \<open>D \<in> \<D>\<close> by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 40 | then show "card ?\<E> < card \<D>" "finite ?\<E>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 41 | by (auto simp: \<open>finite \<D>\<close> psubset_card_mono) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 42 | show "\<exists>k a b. D = cbox a b \<and> (\<forall>i\<in>Basis. b \<bullet> i - a \<bullet> i = k)" if "D \<in> ?\<E>" for D | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 43 | using less.prems(3) that by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 44 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 45 | then have [simp]: "\<Union>\<D>' - D = \<Union>\<D>'" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 46 | by (auto simp: disjnt_iff) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 47 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 48 | proof (rule less.prems) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 49 | show "insert D \<D>' \<subseteq> \<D>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 50 | using \<D>'sub \<open>D \<in> \<D>\<close> by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 51 | show "disjoint (insert D \<D>')" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 52 | using \<D>'dis \<D>'sub by (fastforce simp add: pairwise_def disjnt_sym) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 53 |       obtain a3 b3 where  m3: "content (cbox a3 b3) = 3 ^ DIM('a) * measure lebesgue D"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 54 | and sub3: "\<And>C. \<lbrakk>C \<in> \<D>; \<not> disjnt C D\<rbrakk> \<Longrightarrow> C \<subseteq> cbox a3 b3" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 55 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 56 | obtain k a b where ab: "D = cbox a b" and k: "\<And>i. i \<in> Basis \<Longrightarrow> b\<bullet>i - a\<bullet>i = k" | 
| 70760 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 57 | using less.prems \<open>D \<in> \<D>\<close> by meson | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 58 | then have eqk: "\<And>i. i \<in> Basis \<Longrightarrow> a \<bullet> i \<le> b \<bullet> i \<longleftrightarrow> k \<ge> 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 59 | by force | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 60 | show thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 61 | proof | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 62 | let ?a = "(a + b) /\<^sub>R 2 - (3/2) *\<^sub>R (b - a)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 63 | let ?b = "(a + b) /\<^sub>R 2 + (3/2) *\<^sub>R (b - a)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 64 |           have eq: "(\<Prod>i\<in>Basis. b \<bullet> i * 3 - a \<bullet> i * 3) = (\<Prod>i\<in>Basis. b \<bullet> i - a \<bullet> i) * 3 ^ DIM('a)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 65 | by (simp add: comm_monoid_mult_class.prod.distrib flip: left_diff_distrib inner_diff_left) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 66 |           show "content (cbox ?a ?b) = 3 ^ DIM('a) * measure lebesgue D"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 67 | by (simp add: content_cbox_if box_eq_empty algebra_simps eq ab k) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 68 | show "C \<subseteq> cbox ?a ?b" if "C \<in> \<D>" and CD: "\<not> disjnt C D" for C | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 69 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 70 | obtain k' a' b' where ab': "C = cbox a' b'" and k': "\<And>i. i \<in> Basis \<Longrightarrow> b'\<bullet>i - a'\<bullet>i = k'" | 
| 70760 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 71 | using less.prems \<open>C \<in> \<D>\<close> by meson | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 72 | then have eqk': "\<And>i. i \<in> Basis \<Longrightarrow> a' \<bullet> i \<le> b' \<bullet> i \<longleftrightarrow> k' \<ge> 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 73 | by force | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 74 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 75 | proof (clarsimp simp add: disjoint_interval disjnt_def ab ab' not_less subset_box algebra_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 76 | show "a \<bullet> i * 2 \<le> a' \<bullet> i + b \<bullet> i \<and> a \<bullet> i + b' \<bullet> i \<le> b \<bullet> i * 2" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 77 | if * [rule_format]: "\<forall>j\<in>Basis. a' \<bullet> j \<le> b' \<bullet> j" and "i \<in> Basis" for i | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 78 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 79 | have "a' \<bullet> i \<le> b' \<bullet> i \<and> a \<bullet> i \<le> b \<bullet> i \<and> a \<bullet> i \<le> b' \<bullet> i \<and> a' \<bullet> i \<le> b \<bullet> i" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 80 | using \<open>i \<in> Basis\<close> CD by (simp_all add: disjoint_interval disjnt_def ab ab' not_less) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 81 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 82 | using D [OF \<open>C \<in> \<D>\<close>] \<open>i \<in> Basis\<close> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 83 | apply (simp add: ab ab' k k' eqk eqk' content_cbox_cases) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 84 | using k k' by fastforce | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 85 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 86 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 87 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 88 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 89 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 90 | have \<D>lm: "\<And>D. D \<in> \<D> \<Longrightarrow> D \<in> lmeasurable" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 91 | using less.prems(3) by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 92 | have "measure lebesgue (\<Union>\<D>) \<le> measure lebesgue (cbox a3 b3 \<union> (\<Union>\<D> - cbox a3 b3))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 93 | proof (rule measure_mono_fmeasurable) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 94 | show "\<Union>\<D> \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 95 | using \<D>lm \<open>finite \<D>\<close> by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 96 | show "cbox a3 b3 \<union> (\<Union>\<D> - cbox a3 b3) \<in> lmeasurable" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 97 | by (simp add: \<D>lm fmeasurable.Un fmeasurable.finite_Union less.prems(2) subset_eq) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 98 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 99 | also have "\<dots> = content (cbox a3 b3) + measure lebesgue (\<Union>\<D> - cbox a3 b3)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 100 | by (simp add: \<D>lm fmeasurable.finite_Union less.prems(2) measure_Un2 subsetI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 101 |       also have "\<dots> \<le> (measure lebesgue D + measure lebesgue (\<Union>\<D>')) * 3 ^ DIM('a)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 102 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 103 | have "(\<Union>\<D> - cbox a3 b3) \<subseteq> \<Union>?\<E>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 104 | using sub3 by fastforce | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 105 | then have "measure lebesgue (\<Union>\<D> - cbox a3 b3) \<le> measure lebesgue (\<Union>?\<E>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 106 | proof (rule measure_mono_fmeasurable) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 107 | show "\<Union> \<D> - cbox a3 b3 \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 108 | by (simp add: \<D>lm fmeasurableD less.prems(2) sets.Diff sets.finite_Union subsetI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 109 |           show "\<Union> {C \<in> \<D> - {D}. disjnt C D} \<in> lmeasurable"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 110 | using \<D>lm less.prems(2) by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 111 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 112 |         then have "measure lebesgue (\<Union>\<D> - cbox a3 b3) / 3 ^ DIM('a) \<le> measure lebesgue (\<Union> \<D>')"
 | 
| 70817 
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
 haftmann parents: 
70802diff
changeset | 113 | using \<D>'m by (simp add: field_split_simps) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 114 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 115 | by (simp add: m3 field_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 116 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 117 |       also have "\<dots> \<le> measure lebesgue (\<Union>(insert D \<D>')) * 3 ^ DIM('a)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 118 | proof (simp add: \<D>lm \<open>D \<in> \<D>\<close>) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 119 | show "measure lebesgue D + measure lebesgue (\<Union>\<D>') \<le> measure lebesgue (D \<union> \<Union> \<D>')" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 120 | proof (subst measure_Un2) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 121 | show "\<Union> \<D>' \<in> lmeasurable" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 122 | by (meson \<D>lm \<open>insert D \<D>' \<subseteq> \<D>\<close> fmeasurable.finite_Union less.prems(2) finite_subset subset_eq subset_insertI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 123 | show "measure lebesgue D + measure lebesgue (\<Union> \<D>') \<le> measure lebesgue D + measure lebesgue (\<Union> \<D>' - D)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 124 | using \<open>insert D \<D>' \<subseteq> \<D>\<close> infinite_super less.prems(2) by force | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 125 | qed (simp add: \<D>lm \<open>D \<in> \<D>\<close>) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 126 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 127 |       finally show "measure lebesgue (\<Union>\<D>) / 3 ^ DIM('a) \<le> measure lebesgue (\<Union>(insert D \<D>'))"
 | 
| 70817 
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
 haftmann parents: 
70802diff
changeset | 128 | by (simp add: field_split_simps) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 129 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 130 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 131 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 132 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 133 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 134 | subsection\<open>A differentiability-like property of the indefinite integral. \<close> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 135 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 136 | proposition integrable_ccontinuous_explicit: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 137 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 138 | assumes "\<And>a b::'a. f integrable_on cbox a b" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 139 | obtains N where | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 140 | "negligible N" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 141 | "\<And>x e. \<lbrakk>x \<notin> N; 0 < e\<rbrakk> \<Longrightarrow> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 142 | \<exists>d>0. \<forall>h. 0 < h \<and> h < d \<longrightarrow> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 143 |                          norm(integral (cbox x (x + h *\<^sub>R One)) f /\<^sub>R h ^ DIM('a) - f x) < e"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 144 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 145 | define BOX where "BOX \<equiv> \<lambda>h. \<lambda>x::'a. cbox x (x + h *\<^sub>R One)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 146 | define BOX2 where "BOX2 \<equiv> \<lambda>h. \<lambda>x::'a. cbox (x - h *\<^sub>R One) (x + h *\<^sub>R One)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 147 |   define i where "i \<equiv> \<lambda>h x. integral (BOX h x) f /\<^sub>R h ^ DIM('a)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 148 | define \<Psi> where "\<Psi> \<equiv> \<lambda>x r. \<forall>d>0. \<exists>h. 0 < h \<and> h < d \<and> r \<le> norm(i h x - f x)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 149 |   let ?N = "{x. \<exists>e>0. \<Psi> x e}"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 150 | have "\<exists>N. negligible N \<and> (\<forall>x e. x \<notin> N \<and> 0 < e \<longrightarrow> \<not> \<Psi> x e)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 151 | proof (rule exI ; intro conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 152 |     let ?M =  "\<Union>n. {x. \<Psi> x (inverse(real n + 1))}"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 153 |     have "negligible ({x. \<Psi> x \<mu>} \<inter> cbox a b)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 154 | if "\<mu> > 0" for a b \<mu> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 155 | proof (cases "negligible(cbox a b)") | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 156 | case True | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 157 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 158 | by (simp add: negligible_Int) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 159 | next | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 160 | case False | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 161 |       then have "box a b \<noteq> {}"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 162 | by (simp add: negligible_interval) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 163 | then have ab: "\<And>i. i \<in> Basis \<Longrightarrow> a\<bullet>i < b\<bullet>i" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 164 | by (simp add: box_ne_empty) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 165 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 166 | unfolding negligible_outer_le | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 167 | proof (intro allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 168 | fix e::real | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 169 |         let ?ee = "(e * \<mu>) / 2 / 6 ^ (DIM('a))"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 170 | assume "e > 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 171 | then have gt0: "?ee > 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 172 | using \<open>\<mu> > 0\<close> by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 173 | have f': "f integrable_on cbox (a - One) (b + One)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 174 | using assms by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 175 | obtain \<gamma> where "gauge \<gamma>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 176 | and \<gamma>: "\<And>p. \<lbrakk>p tagged_partial_division_of (cbox (a - One) (b + One)); \<gamma> fine p\<rbrakk> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 177 | \<Longrightarrow> (\<Sum>(x, k)\<in>p. norm (content k *\<^sub>R f x - integral k f)) < ?ee" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 178 | using Henstock_lemma [OF f' gt0] that by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 179 |         let ?E = "{x. x \<in> cbox a b \<and> \<Psi> x \<mu>}"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 180 | have "\<exists>h>0. BOX h x \<subseteq> \<gamma> x \<and> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 181 | BOX h x \<subseteq> cbox (a - One) (b + One) \<and> \<mu> \<le> norm (i h x - f x)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 182 | if "x \<in> cbox a b" "\<Psi> x \<mu>" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 183 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 184 | obtain d where "d > 0" and d: "ball x d \<subseteq> \<gamma> x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 185 | using gaugeD [OF \<open>gauge \<gamma>\<close>, of x] openE by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 186 |           then obtain h where "0 < h" "h < 1" and hless: "h < d / real DIM('a)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 187 | and mule: "\<mu> \<le> norm (i h x - f x)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 188 |             using \<open>\<Psi> x \<mu>\<close> [unfolded \<Psi>_def, rule_format, of "min 1 (d / DIM('a))"]
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 189 | by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 190 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 191 | proof (intro exI conjI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 192 | show "0 < h" "\<mu> \<le> norm (i h x - f x)" by fact+ | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 193 | have "BOX h x \<subseteq> ball x d" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 194 | proof (clarsimp simp: BOX_def mem_box dist_norm algebra_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 195 | fix y | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 196 | assume "\<forall>i\<in>Basis. x \<bullet> i \<le> y \<bullet> i \<and> y \<bullet> i \<le> h + x \<bullet> i" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 197 |               then have lt: "\<bar>(x - y) \<bullet> i\<bar> < d / real DIM('a)" if "i \<in> Basis" for i
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 198 | using hless that by (force simp: inner_diff_left) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 199 | have "norm (x - y) \<le> (\<Sum>i\<in>Basis. \<bar>(x - y) \<bullet> i\<bar>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 200 | using norm_le_l1 by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 201 | also have "\<dots> < d" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 202 |                 using sum_bounded_above_strict [of Basis "\<lambda>i. \<bar>(x - y) \<bullet> i\<bar>" "d / DIM('a)", OF lt]
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 203 | by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 204 | finally show "norm (x - y) < d" . | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 205 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 206 | with d show "BOX h x \<subseteq> \<gamma> x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 207 | by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 208 | show "BOX h x \<subseteq> cbox (a - One) (b + One)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 209 | using that \<open>h < 1\<close> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 210 | by (force simp: BOX_def mem_box algebra_simps intro: subset_box_imp) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 211 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 212 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 213 | then obtain \<eta> where h0: "\<And>x. x \<in> ?E \<Longrightarrow> \<eta> x > 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 214 | and BOX_\<gamma>: "\<And>x. x \<in> ?E \<Longrightarrow> BOX (\<eta> x) x \<subseteq> \<gamma> x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 215 | and "\<And>x. x \<in> ?E \<Longrightarrow> BOX (\<eta> x) x \<subseteq> cbox (a - One) (b + One) \<and> \<mu> \<le> norm (i (\<eta> x) x - f x)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 216 | by simp metis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 217 | then have BOX_cbox: "\<And>x. x \<in> ?E \<Longrightarrow> BOX (\<eta> x) x \<subseteq> cbox (a - One) (b + One)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 218 | and \<mu>_le: "\<And>x. x \<in> ?E \<Longrightarrow> \<mu> \<le> norm (i (\<eta> x) x - f x)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 219 | by blast+ | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 220 | define \<gamma>' where "\<gamma>' \<equiv> \<lambda>x. if x \<in> cbox a b \<and> \<Psi> x \<mu> then ball x (\<eta> x) else \<gamma> x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 221 | have "gauge \<gamma>'" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 222 | using \<open>gauge \<gamma>\<close> by (auto simp: h0 gauge_def \<gamma>'_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 223 | obtain \<D> where "countable \<D>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 224 | and \<D>: "\<Union>\<D> \<subseteq> cbox a b" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 225 |           "\<And>K. K \<in> \<D> \<Longrightarrow> interior K \<noteq> {} \<and> (\<exists>c d. K = cbox c d)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 226 | and Dcovered: "\<And>K. K \<in> \<D> \<Longrightarrow> \<exists>x. x \<in> cbox a b \<and> \<Psi> x \<mu> \<and> x \<in> K \<and> K \<subseteq> \<gamma>' x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 227 | and subUD: "?E \<subseteq> \<Union>\<D>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 228 |           by (rule covering_lemma [of ?E a b \<gamma>']) (simp_all add: Bex_def \<open>box a b \<noteq> {}\<close> \<open>gauge \<gamma>'\<close>)
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 229 | then have "\<D> \<subseteq> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 230 | by fastforce | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 231 |         show "\<exists>T. {x. \<Psi> x \<mu>} \<inter> cbox a b \<subseteq> T \<and> T \<in> lmeasurable \<and> measure lebesgue T \<le> e"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 232 | proof (intro exI conjI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 233 |           show "{x. \<Psi> x \<mu>} \<inter> cbox a b \<subseteq> \<Union>\<D>"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 234 | apply auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 235 | using subUD by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 236 | have mUE: "measure lebesgue (\<Union> \<E>) \<le> measure lebesgue (cbox a b)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 237 | if "\<E> \<subseteq> \<D>" "finite \<E>" for \<E> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 238 | proof (rule measure_mono_fmeasurable) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 239 | show "\<Union> \<E> \<subseteq> cbox a b" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 240 | using \<D>(1) that(1) by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 241 | show "\<Union> \<E> \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 242 | by (metis \<D>(2) fmeasurable.finite_Union fmeasurableD lmeasurable_cbox subset_eq that) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 243 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 244 | then show "\<Union>\<D> \<in> lmeasurable" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 245 | by (metis \<D>(2) \<open>countable \<D>\<close> fmeasurable_Union_bound lmeasurable_cbox) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 246 | then have leab: "measure lebesgue (\<Union>\<D>) \<le> measure lebesgue (cbox a b)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 247 | by (meson \<D>(1) fmeasurableD lmeasurable_cbox measure_mono_fmeasurable) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 248 | obtain \<F> where "\<F> \<subseteq> \<D>" "finite \<F>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 249 | and \<F>: "measure lebesgue (\<Union>\<D>) \<le> 2 * measure lebesgue (\<Union>\<F>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 250 | proof (cases "measure lebesgue (\<Union>\<D>) = 0") | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 251 | case True | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 252 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 253 |               by (force intro: that [where \<F> = "{}"])
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 254 | next | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 255 | case False | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 256 | obtain \<F> where "\<F> \<subseteq> \<D>" "finite \<F>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 257 | and \<F>: "measure lebesgue (\<Union>\<D>)/2 < measure lebesgue (\<Union>\<F>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 258 | proof (rule measure_countable_Union_approachable [of \<D> "measure lebesgue (\<Union>\<D>) / 2" "content (cbox a b)"]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 259 | show "countable \<D>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 260 | by fact | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 261 | show "0 < measure lebesgue (\<Union> \<D>) / 2" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 262 | using False by (simp add: zero_less_measure_iff) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 263 | show Dlm: "D \<in> lmeasurable" if "D \<in> \<D>" for D | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 264 | using \<D>(2) that by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 265 | show "measure lebesgue (\<Union> \<F>) \<le> content (cbox a b)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 266 | if "\<F> \<subseteq> \<D>" "finite \<F>" for \<F> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 267 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 268 | have "measure lebesgue (\<Union> \<F>) \<le> measure lebesgue (\<Union>\<D>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 269 | proof (rule measure_mono_fmeasurable) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 270 | show "\<Union> \<F> \<subseteq> \<Union> \<D>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 271 | by (simp add: Sup_subset_mono \<open>\<F> \<subseteq> \<D>\<close>) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 272 | show "\<Union> \<F> \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 273 | by (meson Dlm fmeasurableD sets.finite_Union subset_eq that) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 274 | show "\<Union> \<D> \<in> lmeasurable" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 275 | by fact | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 276 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 277 | also have "\<dots> \<le> measure lebesgue (cbox a b)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 278 | proof (rule measure_mono_fmeasurable) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 279 | show "\<Union> \<D> \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 280 | by (simp add: \<open>\<Union> \<D> \<in> lmeasurable\<close> fmeasurableD) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 281 | qed (auto simp:\<D>(1)) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 282 | finally show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 283 | by simp | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 284 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 285 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 286 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 287 | using that by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 288 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 289 | obtain tag where tag_in_E: "\<And>D. D \<in> \<D> \<Longrightarrow> tag D \<in> ?E" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 290 | and tag_in_self: "\<And>D. D \<in> \<D> \<Longrightarrow> tag D \<in> D" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 291 | and tag_sub: "\<And>D. D \<in> \<D> \<Longrightarrow> D \<subseteq> \<gamma>' (tag D)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 292 | using Dcovered by simp metis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 293 | then have sub_ball_tag: "\<And>D. D \<in> \<D> \<Longrightarrow> D \<subseteq> ball (tag D) (\<eta> (tag D))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 294 | by (simp add: \<gamma>'_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 295 | define \<Phi> where "\<Phi> \<equiv> \<lambda>D. BOX (\<eta>(tag D)) (tag D)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 296 | define \<Phi>2 where "\<Phi>2 \<equiv> \<lambda>D. BOX2 (\<eta>(tag D)) (tag D)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 297 | obtain \<C> where "\<C> \<subseteq> \<Phi>2 ` \<F>" "pairwise disjnt \<C>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 298 |             "measure lebesgue (\<Union>\<C>) \<ge> measure lebesgue (\<Union>(\<Phi>2`\<F>)) / 3 ^ (DIM('a))"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 299 | proof (rule Austin_Lemma) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 300 | show "finite (\<Phi>2`\<F>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 301 | using \<open>finite \<F>\<close> by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 302 | have "\<exists>k a b. \<Phi>2 D = cbox a b \<and> (\<forall>i\<in>Basis. b \<bullet> i - a \<bullet> i = k)" if "D \<in> \<F>" for D | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 303 | apply (rule_tac x="2 * \<eta>(tag D)" in exI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 304 | apply (rule_tac x="tag D - \<eta>(tag D) *\<^sub>R One" in exI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 305 | apply (rule_tac x="tag D + \<eta>(tag D) *\<^sub>R One" in exI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 306 | using that | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 307 | apply (auto simp: \<Phi>2_def BOX2_def algebra_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 308 | done | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 309 | then show "\<And>D. D \<in> \<Phi>2 ` \<F> \<Longrightarrow> \<exists>k a b. D = cbox a b \<and> (\<forall>i\<in>Basis. b \<bullet> i - a \<bullet> i = k)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 310 | by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 311 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 312 | then obtain \<G> where "\<G> \<subseteq> \<F>" and disj: "pairwise disjnt (\<Phi>2 ` \<G>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 313 |             and "measure lebesgue (\<Union>(\<Phi>2 ` \<G>)) \<ge> measure lebesgue (\<Union>(\<Phi>2`\<F>)) / 3 ^ (DIM('a))"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 314 | unfolding \<Phi>2_def subset_image_iff | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 315 | by (meson empty_subsetI equals0D pairwise_imageI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 316 | moreover | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 317 |           have "measure lebesgue (\<Union>(\<Phi>2 ` \<G>)) * 3 ^ DIM('a) \<le> e/2"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 318 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 319 | have "finite \<G>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 320 | using \<open>finite \<F>\<close> \<open>\<G> \<subseteq> \<F>\<close> infinite_super by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 321 | have BOX2_m: "\<And>x. x \<in> tag ` \<G> \<Longrightarrow> BOX2 (\<eta> x) x \<in> lmeasurable" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 322 | by (auto simp: BOX2_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 323 | have BOX_m: "\<And>x. x \<in> tag ` \<G> \<Longrightarrow> BOX (\<eta> x) x \<in> lmeasurable" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 324 | by (auto simp: BOX_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 325 | have BOX_sub: "BOX (\<eta> x) x \<subseteq> BOX2 (\<eta> x) x" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 326 | by (auto simp: BOX_def BOX2_def subset_box algebra_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 327 |             have DISJ2: "BOX2 (\<eta> (tag X)) (tag X) \<inter> BOX2 (\<eta> (tag Y)) (tag Y) = {}"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 328 | if "X \<in> \<G>" "Y \<in> \<G>" "tag X \<noteq> tag Y" for X Y | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 329 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 330 | obtain i where i: "i \<in> Basis" "tag X \<bullet> i \<noteq> tag Y \<bullet> i" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 331 | using \<open>tag X \<noteq> tag Y\<close> by (auto simp: euclidean_eq_iff [of "tag X"]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 332 | have XY: "X \<in> \<D>" "Y \<in> \<D>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 333 | using \<open>\<F> \<subseteq> \<D>\<close> \<open>\<G> \<subseteq> \<F>\<close> that by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 334 | then have "0 \<le> \<eta> (tag X)" "0 \<le> \<eta> (tag Y)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 335 | by (meson h0 le_cases not_le tag_in_E)+ | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 336 | with XY i have "BOX2 (\<eta> (tag X)) (tag X) \<noteq> BOX2 (\<eta> (tag Y)) (tag Y)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 337 | unfolding eq_iff | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 338 | by (fastforce simp add: BOX2_def subset_box algebra_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 339 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 340 | using disj that by (auto simp: pairwise_def disjnt_def \<Phi>2_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 341 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 342 | then have BOX2_disj: "pairwise (\<lambda>x y. negligible (BOX2 (\<eta> x) x \<inter> BOX2 (\<eta> y) y)) (tag ` \<G>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 343 | by (simp add: pairwise_imageI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 344 | then have BOX_disj: "pairwise (\<lambda>x y. negligible (BOX (\<eta> x) x \<inter> BOX (\<eta> y) y)) (tag ` \<G>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 345 | proof (rule pairwise_mono) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 346 | show "negligible (BOX (\<eta> x) x \<inter> BOX (\<eta> y) y)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 347 | if "negligible (BOX2 (\<eta> x) x \<inter> BOX2 (\<eta> y) y)" for x y | 
| 73932 
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
 desharna parents: 
73536diff
changeset | 348 | by (metis (no_types, opaque_lifting) that Int_mono negligible_subset BOX_sub) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 349 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 350 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 351 | have eq: "\<And>box. (\<lambda>D. box (\<eta> (tag D)) (tag D)) ` \<G> = (\<lambda>t. box (\<eta> t) t) ` tag ` \<G>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 352 | by (simp add: image_comp) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 353 |             have "measure lebesgue (BOX2 (\<eta> t) t) * 3 ^ DIM('a)
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 354 |                 = measure lebesgue (BOX (\<eta> t) t) * (2*3) ^ DIM('a)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 355 | if "t \<in> tag ` \<G>" for t | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 356 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 357 | have "content (cbox (t - \<eta> t *\<^sub>R One) (t + \<eta> t *\<^sub>R One)) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 358 |                   = content (cbox t (t + \<eta> t *\<^sub>R One)) * 2 ^ DIM('a)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 359 | using that by (simp add: algebra_simps content_cbox_if box_eq_empty) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 360 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 361 | by (simp add: BOX2_def BOX_def flip: power_mult_distrib) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 362 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 363 |             then have "measure lebesgue (\<Union>(\<Phi>2 ` \<G>)) * 3 ^ DIM('a) = measure lebesgue (\<Union>(\<Phi> ` \<G>)) * 6 ^ DIM('a)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 364 | unfolding \<Phi>_def \<Phi>2_def eq | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 365 | by (simp add: measure_negligible_finite_Union_image | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 366 | \<open>finite \<G>\<close> BOX2_m BOX_m BOX2_disj BOX_disj sum_distrib_right | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 367 | del: UN_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 368 | also have "\<dots> \<le> e/2" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 369 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 370 | have "\<mu> * measure lebesgue (\<Union>D\<in>\<G>. \<Phi> D) \<le> \<mu> * (\<Sum>D \<in> \<Phi>`\<G>. measure lebesgue D)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 371 | using \<open>\<mu> > 0\<close> \<open>finite \<G>\<close> by (force simp: BOX_m \<Phi>_def fmeasurableD intro: measure_Union_le) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 372 | also have "\<dots> = (\<Sum>D \<in> \<Phi>`\<G>. measure lebesgue D * \<mu>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 373 | by (metis mult.commute sum_distrib_right) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 374 | also have "\<dots> \<le> (\<Sum>(x, K) \<in> (\<lambda>D. (tag D, \<Phi> D)) ` \<G>. norm (content K *\<^sub>R f x - integral K f))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 375 | proof (rule sum_le_included; clarify?) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 376 | fix D | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 377 | assume "D \<in> \<G>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 378 | then have "\<eta> (tag D) > 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 379 | using \<open>\<F> \<subseteq> \<D>\<close> \<open>\<G> \<subseteq> \<F>\<close> h0 tag_in_E by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 380 | then have m_\<Phi>: "measure lebesgue (\<Phi> D) > 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 381 | by (simp add: \<Phi>_def BOX_def algebra_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 382 | have "\<mu> \<le> norm (i (\<eta>(tag D)) (tag D) - f(tag D))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 383 | using \<mu>_le \<open>D \<in> \<G>\<close> \<open>\<F> \<subseteq> \<D>\<close> \<open>\<G> \<subseteq> \<F>\<close> tag_in_E by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 384 | also have "\<dots> = norm ((content (\<Phi> D) *\<^sub>R f(tag D) - integral (\<Phi> D) f) /\<^sub>R measure lebesgue (\<Phi> D))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 385 | using m_\<Phi> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 386 | unfolding i_def \<Phi>_def BOX_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 387 | by (simp add: algebra_simps content_cbox_plus norm_minus_commute) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 388 | finally have "measure lebesgue (\<Phi> D) * \<mu> \<le> norm (content (\<Phi> D) *\<^sub>R f(tag D) - integral (\<Phi> D) f)" | 
| 70802 
160eaf566bcb
formally augmented corresponding rules for field_simps
 haftmann parents: 
70760diff
changeset | 389 | using m_\<Phi> by simp (simp add: field_simps) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 390 | then show "\<exists>y\<in>(\<lambda>D. (tag D, \<Phi> D)) ` \<G>. | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 391 | snd y = \<Phi> D \<and> measure lebesgue (\<Phi> D) * \<mu> \<le> (case y of (x, k) \<Rightarrow> norm (content k *\<^sub>R f x - integral k f))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 392 | using \<open>D \<in> \<G>\<close> by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 393 | qed (use \<open>finite \<G>\<close> in auto) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 394 | also have "\<dots> < ?ee" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 395 | proof (rule \<gamma>) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 396 | show "(\<lambda>D. (tag D, \<Phi> D)) ` \<G> tagged_partial_division_of cbox (a - One) (b + One)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 397 | unfolding tagged_partial_division_of_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 398 | proof (intro conjI allI impI ; clarify ?) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 399 | show "tag D \<in> \<Phi> D" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 400 | if "D \<in> \<G>" for D | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 401 | using that \<open>\<F> \<subseteq> \<D>\<close> \<open>\<G> \<subseteq> \<F>\<close> h0 tag_in_E | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 402 | by (auto simp: \<Phi>_def BOX_def mem_box algebra_simps eucl_less_le_not_le in_mono) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 403 | show "y \<in> cbox (a - One) (b + One)" if "D \<in> \<G>" "y \<in> \<Phi> D" for D y | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 404 | using that BOX_cbox \<Phi>_def \<open>\<F> \<subseteq> \<D>\<close> \<open>\<G> \<subseteq> \<F>\<close> tag_in_E by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 405 | show "tag D = tag E \<and> \<Phi> D = \<Phi> E" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 406 |                     if "D \<in> \<G>" "E \<in> \<G>" and ne: "interior (\<Phi> D) \<inter> interior (\<Phi> E) \<noteq> {}" for D E
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 407 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 408 |                     have "BOX2 (\<eta> (tag D)) (tag D) \<inter> BOX2 (\<eta> (tag E)) (tag E) = {} \<or> tag E = tag D"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 409 | using DISJ2 \<open>D \<in> \<G>\<close> \<open>E \<in> \<G>\<close> by force | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 410 |                     then have "BOX (\<eta> (tag D)) (tag D) \<inter> BOX (\<eta> (tag E)) (tag E) = {} \<or> tag E = tag D"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 411 | using BOX_sub by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 412 | then show "tag D = tag E \<and> \<Phi> D = \<Phi> E" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 413 | by (metis \<Phi>_def interior_Int interior_empty ne) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 414 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 415 | qed (use \<open>finite \<G>\<close> \<Phi>_def BOX_def in auto) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 416 | show "\<gamma> fine (\<lambda>D. (tag D, \<Phi> D)) ` \<G>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 417 | unfolding fine_def \<Phi>_def using BOX_\<gamma> \<open>\<F> \<subseteq> \<D>\<close> \<open>\<G> \<subseteq> \<F>\<close> tag_in_E by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 418 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 419 | finally show ?thesis | 
| 70817 
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
 haftmann parents: 
70802diff
changeset | 420 | using \<open>\<mu> > 0\<close> by (auto simp: field_split_simps) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 421 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 422 | finally show ?thesis . | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 423 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 424 | moreover | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 425 | have "measure lebesgue (\<Union>\<F>) \<le> measure lebesgue (\<Union>(\<Phi>2`\<F>))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 426 | proof (rule measure_mono_fmeasurable) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 427 | have "D \<subseteq> ball (tag D) (\<eta>(tag D))" if "D \<in> \<F>" for D | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 428 | using \<open>\<F> \<subseteq> \<D>\<close> sub_ball_tag that by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 429 | moreover have "ball (tag D) (\<eta>(tag D)) \<subseteq> BOX2 (\<eta> (tag D)) (tag D)" if "D \<in> \<F>" for D | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 430 | proof (clarsimp simp: \<Phi>2_def BOX2_def mem_box algebra_simps dist_norm) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 431 | fix x and i::'a | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 432 | assume "norm (tag D - x) < \<eta> (tag D)" and "i \<in> Basis" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 433 | then have "\<bar>tag D \<bullet> i - x \<bullet> i\<bar> \<le> \<eta> (tag D)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 434 | by (metis eucl_less_le_not_le inner_commute inner_diff_right norm_bound_Basis_le) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 435 | then show "tag D \<bullet> i \<le> x \<bullet> i + \<eta> (tag D) \<and> x \<bullet> i \<le> \<eta> (tag D) + tag D \<bullet> i" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 436 | by (simp add: abs_diff_le_iff) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 437 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 438 | ultimately show "\<Union>\<F> \<subseteq> \<Union>(\<Phi>2`\<F>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 439 | by (force simp: \<Phi>2_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 440 | show "\<Union>\<F> \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 441 | using \<open>finite \<F>\<close> \<open>\<D> \<subseteq> sets lebesgue\<close> \<open>\<F> \<subseteq> \<D>\<close> by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 442 | show "\<Union>(\<Phi>2`\<F>) \<in> lmeasurable" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 443 | unfolding \<Phi>2_def BOX2_def using \<open>finite \<F>\<close> by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 444 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 445 | ultimately | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 446 | have "measure lebesgue (\<Union>\<F>) \<le> e/2" | 
| 70817 
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
 haftmann parents: 
70802diff
changeset | 447 | by (auto simp: field_split_simps) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 448 | then show "measure lebesgue (\<Union>\<D>) \<le> e" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 449 | using \<F> by linarith | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 450 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 451 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 452 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 453 |     then have "\<And>j. negligible {x. \<Psi> x (inverse(real j + 1))}"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 454 | using negligible_on_intervals | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 455 | by (metis (full_types) inverse_positive_iff_positive le_add_same_cancel1 linorder_not_le nat_le_real_less not_add_less1 of_nat_0) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 456 | then have "negligible ?M" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 457 | by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 458 | moreover have "?N \<subseteq> ?M" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 459 | proof (clarsimp simp: dist_norm) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 460 | fix y e | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 461 | assume "0 < e" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 462 | and ye [rule_format]: "\<Psi> y e" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 463 | then obtain k where k: "0 < k" "inverse (real k + 1) < e" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 464 | by (metis One_nat_def add.commute less_add_same_cancel2 less_imp_inverse_less less_trans neq0_conv of_nat_1 of_nat_Suc reals_Archimedean zero_less_one) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 465 | with ye show "\<exists>n. \<Psi> y (inverse (real n + 1))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 466 | apply (rule_tac x=k in exI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 467 | unfolding \<Psi>_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 468 | by (force intro: less_le_trans) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 469 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 470 | ultimately show "negligible ?N" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 471 | by (blast intro: negligible_subset) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 472 | show "\<not> \<Psi> x e" if "x \<notin> ?N \<and> 0 < e" for x e | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 473 | using that by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 474 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 475 | with that show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 476 | unfolding i_def BOX_def \<Psi>_def by (fastforce simp add: not_le) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 477 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 478 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 479 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 480 | subsection\<open>HOL Light measurability\<close> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 481 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 482 | definition measurable_on :: "('a::euclidean_space \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> 'a set \<Rightarrow> bool"
 | 
| 80914 
d97fdabd9e2b
standardize mixfix annotations via "isabelle update -a -u mixfix_cartouches" --- to simplify systematic editing;
 wenzelm parents: 
78258diff
changeset | 483 | (infixr \<open>measurable'_on\<close> 46) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 484 | where "f measurable_on S \<equiv> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 485 | \<exists>N g. negligible N \<and> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 486 | (\<forall>n. continuous_on UNIV (g n)) \<and> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 487 | (\<forall>x. x \<notin> N \<longrightarrow> (\<lambda>n. g n x) \<longlonglongrightarrow> (if x \<in> S then f x else 0))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 488 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 489 | lemma measurable_on_UNIV: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 490 | "(\<lambda>x. if x \<in> S then f x else 0) measurable_on UNIV \<longleftrightarrow> f measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 491 | by (auto simp: measurable_on_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 492 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 493 | lemma measurable_on_spike_set: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 494 | assumes f: "f measurable_on S" and neg: "negligible ((S - T) \<union> (T - S))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 495 | shows "f measurable_on T" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 496 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 497 | obtain N and F | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 498 | where N: "negligible N" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 499 | and conF: "\<And>n. continuous_on UNIV (F n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 500 | and tendsF: "\<And>x. x \<notin> N \<Longrightarrow> (\<lambda>n. F n x) \<longlonglongrightarrow> (if x \<in> S then f x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 501 | using f by (auto simp: measurable_on_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 502 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 503 | unfolding measurable_on_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 504 | proof (intro exI conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 505 | show "continuous_on UNIV (\<lambda>x. F n x)" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 506 | by (intro conF continuous_intros) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 507 | show "negligible (N \<union> (S - T) \<union> (T - S))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 508 | by (metis (full_types) N neg negligible_Un_eq) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 509 | show "(\<lambda>n. F n x) \<longlonglongrightarrow> (if x \<in> T then f x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 510 | if "x \<notin> (N \<union> (S - T) \<union> (T - S))" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 511 | using that tendsF [of x] by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 512 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 513 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 514 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 515 | text\<open> Various common equivalent forms of function measurability. \<close> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 516 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 517 | lemma measurable_on_0 [simp]: "(\<lambda>x. 0) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 518 | unfolding measurable_on_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 519 | proof (intro exI conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 520 | show "(\<lambda>n. 0) \<longlonglongrightarrow> (if x \<in> S then 0::'b else 0)" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 521 | by force | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 522 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 523 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 524 | lemma measurable_on_scaleR_const: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 525 | assumes f: "f measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 526 | shows "(\<lambda>x. c *\<^sub>R f x) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 527 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 528 | obtain NF and F | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 529 | where NF: "negligible NF" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 530 | and conF: "\<And>n. continuous_on UNIV (F n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 531 | and tendsF: "\<And>x. x \<notin> NF \<Longrightarrow> (\<lambda>n. F n x) \<longlonglongrightarrow> (if x \<in> S then f x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 532 | using f by (auto simp: measurable_on_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 533 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 534 | unfolding measurable_on_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 535 | proof (intro exI conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 536 | show "continuous_on UNIV (\<lambda>x. c *\<^sub>R F n x)" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 537 | by (intro conF continuous_intros) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 538 | show "(\<lambda>n. c *\<^sub>R F n x) \<longlonglongrightarrow> (if x \<in> S then c *\<^sub>R f x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 539 | if "x \<notin> NF" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 540 | using tendsto_scaleR [OF tendsto_const tendsF, of x] that by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 541 | qed (auto simp: NF) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 542 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 543 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 544 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 545 | lemma measurable_on_cmul: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 546 | fixes c :: real | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 547 | assumes "f measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 548 | shows "(\<lambda>x. c * f x) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 549 | using measurable_on_scaleR_const [OF assms] by simp | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 550 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 551 | lemma measurable_on_cdivide: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 552 | fixes c :: real | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 553 | assumes "f measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 554 | shows "(\<lambda>x. f x / c) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 555 | proof (cases "c=0") | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 556 | case False | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 557 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 558 | using measurable_on_cmul [of f S "1/c"] | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 559 | by (simp add: assms) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 560 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 561 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 562 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 563 | lemma measurable_on_minus: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 564 | "f measurable_on S \<Longrightarrow> (\<lambda>x. -(f x)) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 565 | using measurable_on_scaleR_const [of f S "-1"] by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 566 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 567 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 568 | lemma continuous_imp_measurable_on: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 569 | "continuous_on UNIV f \<Longrightarrow> f measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 570 | unfolding measurable_on_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 571 |   apply (rule_tac x="{}" in exI)
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 572 | apply (rule_tac x="\<lambda>n. f" in exI, auto) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 573 | done | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 574 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 575 | proposition integrable_subintervals_imp_measurable: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 576 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 577 | assumes "\<And>a b. f integrable_on cbox a b" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 578 | shows "f measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 579 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 580 | define BOX where "BOX \<equiv> \<lambda>h. \<lambda>x::'a. cbox x (x + h *\<^sub>R One)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 581 |   define i where "i \<equiv> \<lambda>h x. integral (BOX h x) f /\<^sub>R h ^ DIM('a)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 582 | obtain N where "negligible N" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 583 | and k: "\<And>x e. \<lbrakk>x \<notin> N; 0 < e\<rbrakk> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 584 | \<Longrightarrow> \<exists>d>0. \<forall>h. 0 < h \<and> h < d \<longrightarrow> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 585 |                   norm (integral (cbox x (x + h *\<^sub>R One)) f /\<^sub>R h ^ DIM('a) - f x) < e"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 586 | using integrable_ccontinuous_explicit assms by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 587 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 588 | unfolding measurable_on_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 589 | proof (intro exI conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 590 | show "continuous_on UNIV ((\<lambda>n x. i (inverse(Suc n)) x) n)" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 591 | proof (clarsimp simp: continuous_on_iff) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 592 | show "\<exists>d>0. \<forall>x'. dist x' x < d \<longrightarrow> dist (i (inverse (1 + real n)) x') (i (inverse (1 + real n)) x) < e" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 593 | if "0 < e" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 594 | for x e | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 595 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 596 |         let ?e = "e / (1 + real n) ^ DIM('a)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 597 | have "?e > 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 598 | using \<open>e > 0\<close> by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 599 | moreover have "x \<in> cbox (x - 2 *\<^sub>R One) (x + 2 *\<^sub>R One)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 600 | by (simp add: mem_box inner_diff_left inner_left_distrib) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 601 | moreover have "x + One /\<^sub>R real (Suc n) \<in> cbox (x - 2 *\<^sub>R One) (x + 2 *\<^sub>R One)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 602 | by (auto simp: mem_box inner_diff_left inner_left_distrib field_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 603 | ultimately obtain \<delta> where "\<delta> > 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 604 | and \<delta>: "\<And>c' d'. \<lbrakk>c' \<in> cbox (x - 2 *\<^sub>R One) (x + 2 *\<^sub>R One); | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 605 | d' \<in> cbox (x - 2 *\<^sub>R One) (x + 2 *\<^sub>R One); | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 606 | norm(c' - x) \<le> \<delta>; norm(d' - (x + One /\<^sub>R Suc n)) \<le> \<delta>\<rbrakk> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 607 | \<Longrightarrow> norm(integral(cbox c' d') f - integral(cbox x (x + One /\<^sub>R Suc n)) f) < ?e" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 608 | by (blast intro: indefinite_integral_continuous [of f _ _ x] assms) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 609 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 610 | proof (intro exI impI conjI allI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 611 | show "min \<delta> 1 > 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 612 | using \<open>\<delta> > 0\<close> by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 613 | show "dist (i (inverse (1 + real n)) y) (i (inverse (1 + real n)) x) < e" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 614 | if "dist y x < min \<delta> 1" for y | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 615 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 616 | have no: "norm (y - x) < 1" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 617 | using that by (auto simp: dist_norm) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 618 | have le1: "inverse (1 + real n) \<le> 1" | 
| 70817 
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
 haftmann parents: 
70802diff
changeset | 619 | by (auto simp: field_split_simps) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 620 | have "norm (integral (cbox y (y + One /\<^sub>R real (Suc n))) f | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 621 | - integral (cbox x (x + One /\<^sub>R real (Suc n))) f) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 622 |                 < e / (1 + real n) ^ DIM('a)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 623 | proof (rule \<delta>) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 624 | show "y \<in> cbox (x - 2 *\<^sub>R One) (x + 2 *\<^sub>R One)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 625 | using no by (auto simp: mem_box algebra_simps dest: Basis_le_norm [of _ "y-x"]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 626 | show "y + One /\<^sub>R real (Suc n) \<in> cbox (x - 2 *\<^sub>R One) (x + 2 *\<^sub>R One)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 627 | proof (simp add: dist_norm mem_box algebra_simps, intro ballI conjI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 628 | fix i::'a | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 629 | assume "i \<in> Basis" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 630 | then have 1: "\<bar>y \<bullet> i - x \<bullet> i\<bar> < 1" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 631 | by (metis inner_commute inner_diff_right no norm_bound_Basis_lt) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 632 | moreover have "\<dots> < (2 + inverse (1 + real n))" "1 \<le> 2 - inverse (1 + real n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 633 | by (auto simp: field_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 634 | ultimately show "x \<bullet> i \<le> y \<bullet> i + (2 + inverse (1 + real n))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 635 | "y \<bullet> i + inverse (1 + real n) \<le> x \<bullet> i + 2" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 636 | by linarith+ | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 637 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 638 | show "norm (y - x) \<le> \<delta>" "norm (y + One /\<^sub>R real (Suc n) - (x + One /\<^sub>R real (Suc n))) \<le> \<delta>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 639 | using that by (auto simp: dist_norm) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 640 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 641 | then show ?thesis | 
| 70802 
160eaf566bcb
formally augmented corresponding rules for field_simps
 haftmann parents: 
70760diff
changeset | 642 | using that by (simp add: dist_norm i_def BOX_def flip: scaleR_diff_right) (simp add: field_simps) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 643 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 644 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 645 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 646 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 647 | show "negligible N" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 648 | by (simp add: \<open>negligible N\<close>) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 649 | show "(\<lambda>n. i (inverse (Suc n)) x) \<longlonglongrightarrow> (if x \<in> UNIV then f x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 650 | if "x \<notin> N" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 651 | unfolding lim_sequentially | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 652 | proof clarsimp | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 653 | show "\<exists>no. \<forall>n\<ge>no. dist (i (inverse (1 + real n)) x) (f x) < e" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 654 | if "0 < e" for e | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 655 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 656 | obtain d where "d > 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 657 | and d: "\<And>h. \<lbrakk>0 < h; h < d\<rbrakk> \<Longrightarrow> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 658 |               norm (integral (cbox x (x + h *\<^sub>R One)) f /\<^sub>R h ^ DIM('a) - f x) < e"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 659 | using k [of x e] \<open>x \<notin> N\<close> \<open>0 < e\<close> by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 660 | then obtain M where M: "M \<noteq> 0" "0 < inverse (real M)" "inverse (real M) < d" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 661 | using real_arch_invD by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 662 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 663 | proof (intro exI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 664 | show "dist (i (inverse (1 + real n)) x) (f x) < e" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 665 | if "M \<le> n" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 666 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 667 | have *: "0 < inverse (1 + real n)" "inverse (1 + real n) \<le> inverse M" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 668 | using that \<open>M \<noteq> 0\<close> by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 669 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 670 | using that M | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 671 | apply (simp add: i_def BOX_def dist_norm) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 672 | apply (blast intro: le_less_trans * d) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 673 | done | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 674 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 675 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 676 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 677 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 678 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 679 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 680 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 681 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 682 | subsection\<open>Composing continuous and measurable functions; a few variants\<close> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 683 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 684 | lemma measurable_on_compose_continuous: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 685 | assumes f: "f measurable_on UNIV" and g: "continuous_on UNIV g" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 686 | shows "(g \<circ> f) measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 687 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 688 | obtain N and F | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 689 | where "negligible N" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 690 | and conF: "\<And>n. continuous_on UNIV (F n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 691 | and tendsF: "\<And>x. x \<notin> N \<Longrightarrow> (\<lambda>n. F n x) \<longlonglongrightarrow> f x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 692 | using f by (auto simp: measurable_on_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 693 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 694 | unfolding measurable_on_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 695 | proof (intro exI conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 696 | show "negligible N" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 697 | by fact | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 698 | show "continuous_on UNIV (g \<circ> (F n))" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 699 | using conF continuous_on_compose continuous_on_subset g by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 700 | show "(\<lambda>n. (g \<circ> F n) x) \<longlonglongrightarrow> (if x \<in> UNIV then (g \<circ> f) x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 701 | if "x \<notin> N" for x :: 'a | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 702 | using that g tendsF by (auto simp: continuous_on_def intro: tendsto_compose) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 703 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 704 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 705 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 706 | lemma measurable_on_compose_continuous_0: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 707 | assumes f: "f measurable_on S" and g: "continuous_on UNIV g" and "g 0 = 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 708 | shows "(g \<circ> f) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 709 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 710 | have f': "(\<lambda>x. if x \<in> S then f x else 0) measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 711 | using f measurable_on_UNIV by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 712 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 713 | using measurable_on_compose_continuous [OF f' g] | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 714 | by (simp add: measurable_on_UNIV o_def if_distrib \<open>g 0 = 0\<close> cong: if_cong) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 715 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 716 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 717 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 718 | lemma measurable_on_compose_continuous_box: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 719 | assumes fm: "f measurable_on UNIV" and fab: "\<And>x. f x \<in> box a b" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 720 | and contg: "continuous_on (box a b) g" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 721 | shows "(g \<circ> f) measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 722 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 723 | have "\<exists>\<gamma>. (\<forall>n. continuous_on UNIV (\<gamma> n)) \<and> (\<forall>x. x \<notin> N \<longrightarrow> (\<lambda>n. \<gamma> n x) \<longlonglongrightarrow> g (f x))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 724 | if "negligible N" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 725 | and conth [rule_format]: "\<forall>n. continuous_on UNIV (\<lambda>x. h n x)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 726 | and tends [rule_format]: "\<forall>x. x \<notin> N \<longrightarrow> (\<lambda>n. h n x) \<longlonglongrightarrow> f x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 727 | for N and h :: "nat \<Rightarrow> 'a \<Rightarrow> 'b" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 728 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 729 | define \<theta> where "\<theta> \<equiv> \<lambda>n x. (\<Sum>i\<in>Basis. (max (a\<bullet>i + (b\<bullet>i - a\<bullet>i) / real (n+2)) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 730 | (min ((h n x)\<bullet>i) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 731 | (b\<bullet>i - (b\<bullet>i - a\<bullet>i) / real (n+2)))) *\<^sub>R i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 732 | have aibi: "\<And>i. i \<in> Basis \<Longrightarrow> a \<bullet> i < b \<bullet> i" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 733 | using box_ne_empty(2) fab by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 734 | then have *: "\<And>i n. i \<in> Basis \<Longrightarrow> a \<bullet> i + real n * (a \<bullet> i) < b \<bullet> i + real n * (b \<bullet> i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 735 | by (meson add_mono_thms_linordered_field(3) less_eq_real_def mult_left_mono of_nat_0_le_iff) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 736 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 737 | proof (intro exI conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 738 | show "continuous_on UNIV (g \<circ> (\<theta> n))" for n :: nat | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 739 | unfolding \<theta>_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 740 | apply (intro continuous_on_compose2 [OF contg] continuous_intros conth) | 
| 71633 | 741 | apply (auto simp: aibi * mem_box less_max_iff_disj min_less_iff_disj field_split_simps) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 742 | done | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 743 | show "(\<lambda>n. (g \<circ> \<theta> n) x) \<longlonglongrightarrow> g (f x)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 744 | if "x \<notin> N" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 745 | unfolding o_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 746 | proof (rule isCont_tendsto_compose [where g=g]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 747 | show "isCont g (f x)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 748 | using contg fab continuous_on_eq_continuous_at by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 749 | have "(\<lambda>n. \<theta> n x) \<longlonglongrightarrow> (\<Sum>i\<in>Basis. max (a \<bullet> i) (min (f x \<bullet> i) (b \<bullet> i)) *\<^sub>R i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 750 | unfolding \<theta>_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 751 | proof (intro tendsto_intros \<open>x \<notin> N\<close> tends) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 752 | fix i::'b | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 753 | assume "i \<in> Basis" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 754 | have a: "(\<lambda>n. a \<bullet> i + (b \<bullet> i - a \<bullet> i) / real n) \<longlonglongrightarrow> a\<bullet>i + 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 755 | by (intro tendsto_add lim_const_over_n tendsto_const) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 756 | show "(\<lambda>n. a \<bullet> i + (b \<bullet> i - a \<bullet> i) / real (n + 2)) \<longlonglongrightarrow> a \<bullet> i" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 757 | using LIMSEQ_ignore_initial_segment [where k=2, OF a] by simp | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 758 | have b: "(\<lambda>n. b\<bullet>i - (b \<bullet> i - a \<bullet> i) / (real n)) \<longlonglongrightarrow> b\<bullet>i - 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 759 | by (intro tendsto_diff lim_const_over_n tendsto_const) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 760 | show "(\<lambda>n. b \<bullet> i - (b \<bullet> i - a \<bullet> i) / real (n + 2)) \<longlonglongrightarrow> b \<bullet> i" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 761 | using LIMSEQ_ignore_initial_segment [where k=2, OF b] by simp | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 762 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 763 | also have "(\<Sum>i\<in>Basis. max (a \<bullet> i) (min (f x \<bullet> i) (b \<bullet> i)) *\<^sub>R i) = (\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i)" | 
| 73869 | 764 | using fab by (auto simp add: mem_box intro: sum.cong) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 765 | also have "\<dots> = f x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 766 | using euclidean_representation by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 767 | finally show "(\<lambda>n. \<theta> n x) \<longlonglongrightarrow> f x" . | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 768 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 769 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 770 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 771 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 772 | using fm by (auto simp: measurable_on_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 773 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 774 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 775 | lemma measurable_on_Pair: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 776 | assumes f: "f measurable_on S" and g: "g measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 777 | shows "(\<lambda>x. (f x, g x)) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 778 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 779 | obtain NF and F | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 780 | where NF: "negligible NF" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 781 | and conF: "\<And>n. continuous_on UNIV (F n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 782 | and tendsF: "\<And>x. x \<notin> NF \<Longrightarrow> (\<lambda>n. F n x) \<longlonglongrightarrow> (if x \<in> S then f x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 783 | using f by (auto simp: measurable_on_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 784 | obtain NG and G | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 785 | where NG: "negligible NG" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 786 | and conG: "\<And>n. continuous_on UNIV (G n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 787 | and tendsG: "\<And>x. x \<notin> NG \<Longrightarrow> (\<lambda>n. G n x) \<longlonglongrightarrow> (if x \<in> S then g x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 788 | using g by (auto simp: measurable_on_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 789 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 790 | unfolding measurable_on_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 791 | proof (intro exI conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 792 | show "negligible (NF \<union> NG)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 793 | by (simp add: NF NG) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 794 | show "continuous_on UNIV (\<lambda>x. (F n x, G n x))" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 795 | using conF conG continuous_on_Pair by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 796 | show "(\<lambda>n. (F n x, G n x)) \<longlonglongrightarrow> (if x \<in> S then (f x, g x) else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 797 | if "x \<notin> NF \<union> NG" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 798 | using tendsto_Pair [OF tendsF tendsG, of x x] that unfolding zero_prod_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 799 | by (simp add: split: if_split_asm) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 800 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 801 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 802 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 803 | lemma measurable_on_combine: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 804 | assumes f: "f measurable_on S" and g: "g measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 805 | and h: "continuous_on UNIV (\<lambda>x. h (fst x) (snd x))" and "h 0 0 = 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 806 | shows "(\<lambda>x. h (f x) (g x)) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 807 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 808 | have *: "(\<lambda>x. h (f x) (g x)) = (\<lambda>x. h (fst x) (snd x)) \<circ> (\<lambda>x. (f x, g x))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 809 | by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 810 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 811 | unfolding * by (auto simp: measurable_on_compose_continuous_0 measurable_on_Pair assms) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 812 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 813 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 814 | lemma measurable_on_add: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 815 | assumes f: "f measurable_on S" and g: "g measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 816 | shows "(\<lambda>x. f x + g x) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 817 | by (intro continuous_intros measurable_on_combine [OF assms]) auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 818 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 819 | lemma measurable_on_diff: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 820 | assumes f: "f measurable_on S" and g: "g measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 821 | shows "(\<lambda>x. f x - g x) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 822 | by (intro continuous_intros measurable_on_combine [OF assms]) auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 823 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 824 | lemma measurable_on_scaleR: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 825 | assumes f: "f measurable_on S" and g: "g measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 826 | shows "(\<lambda>x. f x *\<^sub>R g x) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 827 | by (intro continuous_intros measurable_on_combine [OF assms]) auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 828 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 829 | lemma measurable_on_sum: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 830 | assumes "finite I" "\<And>i. i \<in> I \<Longrightarrow> f i measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 831 | shows "(\<lambda>x. sum (\<lambda>i. f i x) I) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 832 | using assms by (induction I) (auto simp: measurable_on_add) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 833 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 834 | lemma measurable_on_spike: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 835 | assumes f: "f measurable_on T" and "negligible S" and gf: "\<And>x. x \<in> T - S \<Longrightarrow> g x = f x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 836 | shows "g measurable_on T" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 837 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 838 | obtain NF and F | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 839 | where NF: "negligible NF" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 840 | and conF: "\<And>n. continuous_on UNIV (F n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 841 | and tendsF: "\<And>x. x \<notin> NF \<Longrightarrow> (\<lambda>n. F n x) \<longlonglongrightarrow> (if x \<in> T then f x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 842 | using f by (auto simp: measurable_on_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 843 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 844 | unfolding measurable_on_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 845 | proof (intro exI conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 846 | show "negligible (NF \<union> S)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 847 | by (simp add: NF \<open>negligible S\<close>) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 848 | show "\<And>x. x \<notin> NF \<union> S \<Longrightarrow> (\<lambda>n. F n x) \<longlonglongrightarrow> (if x \<in> T then g x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 849 | by (metis (full_types) Diff_iff Un_iff gf tendsF) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 850 | qed (auto simp: conF) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 851 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 852 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 853 | proposition indicator_measurable_on: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 854 | assumes "S \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 855 | shows "indicat_real S measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 856 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 857 |   { fix n::nat
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 858 | let ?\<epsilon> = "(1::real) / (2 * 2^n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 859 | have \<epsilon>: "?\<epsilon> > 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 860 | by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 861 | obtain T where "closed T" "T \<subseteq> S" "S-T \<in> lmeasurable" and ST: "emeasure lebesgue (S - T) < ?\<epsilon>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 862 | by (meson \<epsilon> assms sets_lebesgue_inner_closed) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 863 | obtain U where "open U" "S \<subseteq> U" "(U - S) \<in> lmeasurable" and US: "emeasure lebesgue (U - S) < ?\<epsilon>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 864 | by (meson \<epsilon> assms sets_lebesgue_outer_open) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 865 | have eq: "-T \<inter> U = (S-T) \<union> (U - S)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 866 | using \<open>T \<subseteq> S\<close> \<open>S \<subseteq> U\<close> by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 867 | have "emeasure lebesgue ((S-T) \<union> (U - S)) \<le> emeasure lebesgue (S - T) + emeasure lebesgue (U - S)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 868 | using \<open>S - T \<in> lmeasurable\<close> \<open>U - S \<in> lmeasurable\<close> emeasure_subadditive by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 869 | also have "\<dots> < ?\<epsilon> + ?\<epsilon>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 870 | using ST US add_mono_ennreal by metis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 871 | finally have le: "emeasure lebesgue (-T \<inter> U) < ennreal (1 / 2^n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 872 | by (simp add: eq) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 873 | have 1: "continuous_on (T \<union> -U) (indicat_real S)" | 
| 73536 | 874 | unfolding indicator_def of_bool_def | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 875 | proof (rule continuous_on_cases [OF \<open>closed T\<close>]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 876 | show "closed (- U)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 877 | using \<open>open U\<close> by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 878 | show "continuous_on T (\<lambda>x. 1::real)" "continuous_on (- U) (\<lambda>x. 0::real)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 879 | by (auto simp: continuous_on) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 880 | show "\<forall>x. x \<in> T \<and> x \<notin> S \<or> x \<in> - U \<and> x \<in> S \<longrightarrow> (1::real) = 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 881 | using \<open>T \<subseteq> S\<close> \<open>S \<subseteq> U\<close> by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 882 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 883 | have 2: "closedin (top_of_set UNIV) (T \<union> -U)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 884 | using \<open>closed T\<close> \<open>open U\<close> by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 885 | obtain g where "continuous_on UNIV g" "\<And>x. x \<in> T \<union> -U \<Longrightarrow> g x = indicat_real S x" "\<And>x. norm(g x) \<le> 1" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 886 | by (rule Tietze [OF 1 2, of 1]) auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 887 | with le have "\<exists>g E. continuous_on UNIV g \<and> (\<forall>x \<in> -E. g x = indicat_real S x) \<and> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 888 | (\<forall>x. norm(g x) \<le> 1) \<and> E \<in> sets lebesgue \<and> emeasure lebesgue E < ennreal (1 / 2^n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 889 | apply (rule_tac x=g in exI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 890 | apply (rule_tac x="-T \<inter> U" in exI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 891 | using \<open>S - T \<in> lmeasurable\<close> \<open>U - S \<in> lmeasurable\<close> eq by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 892 | } | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 893 | then obtain g E where cont: "\<And>n. continuous_on UNIV (g n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 894 | and geq: "\<And>n x. x \<in> - E n \<Longrightarrow> g n x = indicat_real S x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 895 | and ng1: "\<And>n x. norm(g n x) \<le> 1" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 896 | and Eset: "\<And>n. E n \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 897 | and Em: "\<And>n. emeasure lebesgue (E n) < ennreal (1 / 2^n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 898 | by metis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 899 | have null: "limsup E \<in> null_sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 900 | proof (rule borel_cantelli_limsup1 [OF Eset]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 901 | show "emeasure lebesgue (E n) < \<infinity>" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 902 | by (metis Em infinity_ennreal_def order.asym top.not_eq_extremum) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 903 | show "summable (\<lambda>n. measure lebesgue (E n))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 904 | proof (rule summable_comparison_test' [OF summable_geometric, of "1/2" 0]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 905 | show "norm (measure lebesgue (E n)) \<le> (1/2) ^ n" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 906 | using Em [of n] by (simp add: measure_def enn2real_leI power_one_over) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 907 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 908 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 909 | have tends: "(\<lambda>n. g n x) \<longlonglongrightarrow> indicat_real S x" if "x \<notin> limsup E" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 910 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 911 | have "\<forall>\<^sub>F n in sequentially. x \<in> - E n" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 912 | using that by (simp add: mem_limsup_iff not_frequently) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 913 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 914 | unfolding tendsto_iff dist_real_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 915 | by (simp add: eventually_mono geq) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 916 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 917 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 918 | unfolding measurable_on_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 919 | proof (intro exI conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 920 | show "negligible (limsup E)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 921 | using negligible_iff_null_sets null by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 922 | show "continuous_on UNIV (g n)" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 923 | using cont by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 924 | qed (use tends in auto) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 925 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 926 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 927 | lemma measurable_on_restrict: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 928 | assumes f: "f measurable_on UNIV" and S: "S \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 929 | shows "(\<lambda>x. if x \<in> S then f x else 0) measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 930 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 931 | have "indicat_real S measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 932 | by (simp add: S indicator_measurable_on) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 933 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 934 | using measurable_on_scaleR [OF _ f, of "indicat_real S"] | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 935 | by (simp add: indicator_scaleR_eq_if) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 936 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 937 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 938 | lemma measurable_on_const_UNIV: "(\<lambda>x. k) measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 939 | by (simp add: continuous_imp_measurable_on) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 940 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 941 | lemma measurable_on_const [simp]: "S \<in> sets lebesgue \<Longrightarrow> (\<lambda>x. k) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 942 | using measurable_on_UNIV measurable_on_const_UNIV measurable_on_restrict by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 943 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 944 | lemma simple_function_indicator_representation_real: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 945 | fixes f ::"'a \<Rightarrow> real" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 946 | assumes f: "simple_function M f" and x: "x \<in> space M" and nn: "\<And>x. f x \<ge> 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 947 |   shows "f x = (\<Sum>y \<in> f ` space M. y * indicator (f -` {y} \<inter> space M) x)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 948 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 949 | have f': "simple_function M (ennreal \<circ> f)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 950 | by (simp add: f) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 951 | have *: "f x = | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 952 | enn2real | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 953 | (\<Sum>y\<in> ennreal ` f ` space M. | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 954 |          y * indicator ((ennreal \<circ> f) -` {y} \<inter> space M) x)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 955 | using arg_cong [OF simple_function_indicator_representation [OF f' x], of enn2real, simplified nn o_def] nn | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 956 | unfolding o_def image_comp | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 957 | by (metis enn2real_ennreal) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 958 | have "enn2real (\<Sum>y\<in>ennreal ` f ` space M. if ennreal (f x) = y \<and> x \<in> space M then y else 0) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 959 | = sum (enn2real \<circ> (\<lambda>y. if ennreal (f x) = y \<and> x \<in> space M then y else 0)) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 960 | (ennreal ` f ` space M)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 961 | by (rule enn2real_sum) auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 962 | also have "\<dots> = sum (enn2real \<circ> (\<lambda>y. if ennreal (f x) = y \<and> x \<in> space M then y else 0) \<circ> ennreal) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 963 | (f ` space M)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 964 | by (rule sum.reindex) (use nn in \<open>auto simp: inj_on_def intro: sum.cong\<close>) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 965 | also have "\<dots> = (\<Sum>y\<in>f ` space M. if f x = y \<and> x \<in> space M then y else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 966 | using nn | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 967 | by (auto simp: inj_on_def intro: sum.cong) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 968 | finally show ?thesis | 
| 73536 | 969 | by (subst *) (simp add: enn2real_sum indicator_def of_bool_def if_distrib cong: if_cong) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 970 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 971 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 972 | lemma\<^marker>\<open>tag important\<close> simple_function_induct_real | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 973 | [consumes 1, case_names cong set mult add, induct set: simple_function]: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 974 | fixes u :: "'a \<Rightarrow> real" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 975 | assumes u: "simple_function M u" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 976 | assumes cong: "\<And>f g. simple_function M f \<Longrightarrow> simple_function M g \<Longrightarrow> (AE x in M. f x = g x) \<Longrightarrow> P f \<Longrightarrow> P g" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 977 | assumes set: "\<And>A. A \<in> sets M \<Longrightarrow> P (indicator A)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 978 | assumes mult: "\<And>u c. P u \<Longrightarrow> P (\<lambda>x. c * u x)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 979 | assumes add: "\<And>u v. P u \<Longrightarrow> P v \<Longrightarrow> P (\<lambda>x. u x + v x)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 980 | and nn: "\<And>x. u x \<ge> 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 981 | shows "P u" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 982 | proof (rule cong) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 983 |   from AE_space show "AE x in M. (\<Sum>y\<in>u ` space M. y * indicator (u -` {y} \<inter> space M) x) = u x"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 984 | proof eventually_elim | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 985 | fix x assume x: "x \<in> space M" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 986 | from simple_function_indicator_representation_real[OF u x] nn | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 987 |     show "(\<Sum>y\<in>u ` space M. y * indicator (u -` {y} \<inter> space M) x) = u x"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 988 | by metis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 989 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 990 | next | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 991 | from u have "finite (u ` space M)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 992 | unfolding simple_function_def by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 993 |   then show "P (\<lambda>x. \<Sum>y\<in>u ` space M. y * indicator (u -` {y} \<inter> space M) x)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 994 | proof induct | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 995 | case empty | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 996 | then show ?case | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 997 |       using set[of "{}"] by (simp add: indicator_def[abs_def])
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 998 | next | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 999 | case (insert a F) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1000 |     have eq: "\<Sum> {y. u x = y \<and> (y = a \<or> y \<in> F) \<and> x \<in> space M}
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1001 |             = (if u x = a \<and> x \<in> space M then a else 0) + \<Sum> {y. u x = y \<and> y \<in> F \<and> x \<in> space M}" for x
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1002 | proof (cases "x \<in> space M") | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1003 | case True | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1004 |       have *: "{y. u x = y \<and> (y = a \<or> y \<in> F)} = {y. u x = a \<and> y = a} \<union> {y. u x = y \<and> y \<in> F}"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1005 | by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1006 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1007 | using insert by (simp add: * True) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1008 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1009 |     have a: "P (\<lambda>x. a * indicator (u -` {a} \<inter> space M) x)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1010 | proof (intro mult set) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1011 |       show "u -` {a} \<inter> space M \<in> sets M"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1012 | using u by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1013 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1014 | show ?case | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1015 | using nn insert a | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1016 | by (simp add: eq indicator_times_eq_if [where f = "\<lambda>x. a"] add) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1017 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1018 | next | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1019 |   show "simple_function M (\<lambda>x. (\<Sum>y\<in>u ` space M. y * indicator (u -` {y} \<inter> space M) x))"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1020 | apply (subst simple_function_cong) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1021 | apply (rule simple_function_indicator_representation_real[symmetric]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1022 | apply (auto intro: u nn) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1023 | done | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1024 | qed fact | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1025 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1026 | proposition simple_function_measurable_on_UNIV: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1027 | fixes f :: "'a::euclidean_space \<Rightarrow> real" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1028 | assumes f: "simple_function lebesgue f" and nn: "\<And>x. f x \<ge> 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1029 | shows "f measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1030 | using f | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1031 | proof (induction f) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1032 | case (cong f g) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1033 |   then obtain N where "negligible N" "{x. g x \<noteq> f x} \<subseteq> N"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1034 | by (auto simp: eventually_ae_filter_negligible eq_commute) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1035 | then show ?case | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1036 | by (blast intro: measurable_on_spike cong) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1037 | next | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1038 | case (set S) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1039 | then show ?case | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1040 | by (simp add: indicator_measurable_on) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1041 | next | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1042 | case (mult u c) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1043 | then show ?case | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1044 | by (simp add: measurable_on_cmul) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1045 | case (add u v) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1046 | then show ?case | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1047 | by (simp add: measurable_on_add) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1048 | qed (auto simp: nn) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1049 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1050 | lemma simple_function_lebesgue_if: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1051 | fixes f :: "'a::euclidean_space \<Rightarrow> real" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1052 | assumes f: "simple_function lebesgue f" and S: "S \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1053 | shows "simple_function lebesgue (\<lambda>x. if x \<in> S then f x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1054 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1055 |   have ffin: "finite (range f)" and fsets: "\<forall>x. f -` {f x} \<in> sets lebesgue"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1056 | using f by (auto simp: simple_function_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1057 | have "finite (f ` S)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1058 | by (meson finite_subset subset_image_iff ffin top_greatest) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1059 | moreover have "finite ((\<lambda>x. 0::real) ` T)" for T :: "'a set" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1060 | by (auto simp: image_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1061 |   moreover have if_sets: "(\<lambda>x. if x \<in> S then f x else 0) -` {f a} \<in> sets lebesgue" for a
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1062 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1063 |     have *: "(\<lambda>x. if x \<in> S then f x else 0) -` {f a}
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1064 |            = (if f a = 0 then -S \<union> f -` {f a} else (f -` {f a}) \<inter> S)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1065 | by (auto simp: split: if_split_asm) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1066 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1067 | unfolding * by (metis Compl_in_sets_lebesgue S sets.Int sets.Un fsets) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1068 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1069 |   moreover have "(\<lambda>x. if x \<in> S then f x else 0) -` {0} \<in> sets lebesgue"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1070 | proof (cases "0 \<in> range f") | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1071 | case True | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1072 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1073 | by (metis (no_types, lifting) if_sets rangeE) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1074 | next | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1075 | case False | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1076 |     then have "(\<lambda>x. if x \<in> S then f x else 0) -` {0} = -S"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1077 | by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1078 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1079 | by (simp add: Compl_in_sets_lebesgue S) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1080 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1081 | ultimately show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1082 | by (auto simp: simple_function_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1083 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1084 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1085 | corollary simple_function_measurable_on: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1086 | fixes f :: "'a::euclidean_space \<Rightarrow> real" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1087 | assumes f: "simple_function lebesgue f" and nn: "\<And>x. f x \<ge> 0" and S: "S \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1088 | shows "f measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1089 | by (simp add: measurable_on_UNIV [symmetric, of f] S f simple_function_lebesgue_if nn simple_function_measurable_on_UNIV) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1090 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1091 | lemma | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1092 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::ordered_euclidean_space" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1093 | assumes f: "f measurable_on S" and g: "g measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1094 | shows measurable_on_sup: "(\<lambda>x. sup (f x) (g x)) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1095 | and measurable_on_inf: "(\<lambda>x. inf (f x) (g x)) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1096 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1097 | obtain NF and F | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1098 | where NF: "negligible NF" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1099 | and conF: "\<And>n. continuous_on UNIV (F n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1100 | and tendsF: "\<And>x. x \<notin> NF \<Longrightarrow> (\<lambda>n. F n x) \<longlonglongrightarrow> (if x \<in> S then f x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1101 | using f by (auto simp: measurable_on_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1102 | obtain NG and G | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1103 | where NG: "negligible NG" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1104 | and conG: "\<And>n. continuous_on UNIV (G n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1105 | and tendsG: "\<And>x. x \<notin> NG \<Longrightarrow> (\<lambda>n. G n x) \<longlonglongrightarrow> (if x \<in> S then g x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1106 | using g by (auto simp: measurable_on_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1107 | show "(\<lambda>x. sup (f x) (g x)) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1108 | unfolding measurable_on_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1109 | proof (intro exI conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1110 | show "continuous_on UNIV (\<lambda>x. sup (F n x) (G n x))" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1111 | unfolding sup_max eucl_sup by (intro conF conG continuous_intros) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1112 | show "(\<lambda>n. sup (F n x) (G n x)) \<longlonglongrightarrow> (if x \<in> S then sup (f x) (g x) else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1113 | if "x \<notin> NF \<union> NG" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1114 | using tendsto_sup [OF tendsF tendsG, of x x] that by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1115 | qed (simp add: NF NG) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1116 | show "(\<lambda>x. inf (f x) (g x)) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1117 | unfolding measurable_on_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1118 | proof (intro exI conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1119 | show "continuous_on UNIV (\<lambda>x. inf (F n x) (G n x))" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1120 | unfolding inf_min eucl_inf by (intro conF conG continuous_intros) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1121 | show "(\<lambda>n. inf (F n x) (G n x)) \<longlonglongrightarrow> (if x \<in> S then inf (f x) (g x) else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1122 | if "x \<notin> NF \<union> NG" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1123 | using tendsto_inf [OF tendsF tendsG, of x x] that by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1124 | qed (simp add: NF NG) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1125 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1126 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1127 | proposition measurable_on_componentwise_UNIV: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1128 | "f measurable_on UNIV \<longleftrightarrow> (\<forall>i\<in>Basis. (\<lambda>x. (f x \<bullet> i) *\<^sub>R i) measurable_on UNIV)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1129 | (is "?lhs = ?rhs") | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1130 | proof | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1131 | assume L: ?lhs | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1132 | show ?rhs | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1133 | proof | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1134 | fix i::'b | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1135 | assume "i \<in> Basis" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1136 | have cont: "continuous_on UNIV (\<lambda>x. (x \<bullet> i) *\<^sub>R i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1137 | by (intro continuous_intros) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1138 | show "(\<lambda>x. (f x \<bullet> i) *\<^sub>R i) measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1139 | using measurable_on_compose_continuous [OF L cont] | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1140 | by (simp add: o_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1141 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1142 | next | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1143 | assume ?rhs | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1144 | then have "\<exists>N g. negligible N \<and> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1145 | (\<forall>n. continuous_on UNIV (g n)) \<and> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1146 | (\<forall>x. x \<notin> N \<longrightarrow> (\<lambda>n. g n x) \<longlonglongrightarrow> (f x \<bullet> i) *\<^sub>R i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1147 | if "i \<in> Basis" for i | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1148 | by (simp add: measurable_on_def that) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1149 | then obtain N g where N: "\<And>i. i \<in> Basis \<Longrightarrow> negligible (N i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1150 | and cont: "\<And>i n. i \<in> Basis \<Longrightarrow> continuous_on UNIV (g i n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1151 | and tends: "\<And>i x. \<lbrakk>i \<in> Basis; x \<notin> N i\<rbrakk> \<Longrightarrow> (\<lambda>n. g i n x) \<longlonglongrightarrow> (f x \<bullet> i) *\<^sub>R i" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1152 | by metis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1153 | show ?lhs | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1154 | unfolding measurable_on_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1155 | proof (intro exI conjI allI impI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1156 | show "negligible (\<Union>i \<in> Basis. N i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1157 | using N eucl.finite_Basis by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1158 | show "continuous_on UNIV (\<lambda>x. (\<Sum>i\<in>Basis. g i n x))" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1159 | by (intro continuous_intros cont) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1160 | next | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1161 | fix x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1162 | assume "x \<notin> (\<Union>i \<in> Basis. N i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1163 | then have "\<And>i. i \<in> Basis \<Longrightarrow> x \<notin> N i" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1164 | by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1165 | then have "(\<lambda>n. (\<Sum>i\<in>Basis. g i n x)) \<longlonglongrightarrow> (\<Sum>i\<in>Basis. (f x \<bullet> i) *\<^sub>R i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1166 | by (intro tends tendsto_intros) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1167 | then show "(\<lambda>n. (\<Sum>i\<in>Basis. g i n x)) \<longlonglongrightarrow> (if x \<in> UNIV then f x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1168 | by (simp add: euclidean_representation) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1169 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1170 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1171 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1172 | corollary measurable_on_componentwise: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1173 | "f measurable_on S \<longleftrightarrow> (\<forall>i\<in>Basis. (\<lambda>x. (f x \<bullet> i) *\<^sub>R i) measurable_on S)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1174 | apply (subst measurable_on_UNIV [symmetric]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1175 | apply (subst measurable_on_componentwise_UNIV) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1176 | apply (simp add: measurable_on_UNIV if_distrib [of "\<lambda>x. inner x _"] if_distrib [of "\<lambda>x. scaleR x _"] cong: if_cong) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1177 | done | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1178 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1179 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1180 | (*FIXME: avoid duplication of proofs WRT borel_measurable_implies_simple_function_sequence*) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1181 | lemma\<^marker>\<open>tag important\<close> borel_measurable_implies_simple_function_sequence_real: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1182 | fixes u :: "'a \<Rightarrow> real" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1183 | assumes u[measurable]: "u \<in> borel_measurable M" and nn: "\<And>x. u x \<ge> 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1184 | shows "\<exists>f. incseq f \<and> (\<forall>i. simple_function M (f i)) \<and> (\<forall>x. bdd_above (range (\<lambda>i. f i x))) \<and> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1185 | (\<forall>i x. 0 \<le> f i x) \<and> u = (SUP i. f i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1186 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1187 | define f where [abs_def]: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1188 | "f i x = real_of_int (floor ((min i (u x)) * 2^i)) / 2^i" for i x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1189 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1190 | have [simp]: "0 \<le> f i x" for i x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1191 | by (auto simp: f_def intro!: divide_nonneg_nonneg mult_nonneg_nonneg nn) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1192 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1193 | have *: "2^n * real_of_int x = real_of_int (2^n * x)" for n x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1194 | by simp | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1195 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1196 | have "real_of_int \<lfloor>real i * 2 ^ i\<rfloor> = real_of_int \<lfloor>i * 2 ^ i\<rfloor>" for i | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1197 | by (intro arg_cong[where f=real_of_int]) simp | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1198 | then have [simp]: "real_of_int \<lfloor>real i * 2 ^ i\<rfloor> = i * 2 ^ i" for i | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1199 | unfolding floor_of_nat by simp | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1200 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1201 | have bdd: "bdd_above (range (\<lambda>i. f i x))" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1202 | by (rule bdd_aboveI [where M = "u x"]) (auto simp: f_def field_simps min_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1203 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1204 | have "incseq f" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1205 | proof (intro monoI le_funI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1206 | fix m n :: nat and x assume "m \<le> n" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1207 | moreover | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1208 |     { fix d :: nat
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1209 | have "\<lfloor>2^d::real\<rfloor> * \<lfloor>2^m * (min (of_nat m) (u x))\<rfloor> \<le> \<lfloor>2^d * (2^m * (min (of_nat m) (u x)))\<rfloor>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1210 | by (rule le_mult_floor) (auto simp: nn) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1211 | also have "\<dots> \<le> \<lfloor>2^d * (2^m * (min (of_nat d + of_nat m) (u x)))\<rfloor>" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1212 | by (intro floor_mono mult_mono min.mono) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1213 | (auto simp: nn min_less_iff_disj of_nat_less_top) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1214 | finally have "f m x \<le> f(m + d) x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1215 | unfolding f_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1216 | by (auto simp: field_simps power_add * simp del: of_int_mult) } | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1217 | ultimately show "f m x \<le> f n x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1218 | by (auto simp: le_iff_add) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1219 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1220 | then have inc_f: "incseq (\<lambda>i. f i x)" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1221 | by (auto simp: incseq_def le_fun_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1222 | moreover | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1223 | have "simple_function M (f i)" for i | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1224 | proof (rule simple_function_borel_measurable) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1225 | have "\<lfloor>(min (of_nat i) (u x)) * 2 ^ i\<rfloor> \<le> \<lfloor>int i * 2 ^ i\<rfloor>" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1226 | by (auto split: split_min intro!: floor_mono) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1227 |     then have "f i ` space M \<subseteq> (\<lambda>n. real_of_int n / 2^i) ` {0 .. of_nat i * 2^i}"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1228 | unfolding floor_of_int by (auto simp: f_def nn intro!: imageI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1229 | then show "finite (f i ` space M)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1230 | by (rule finite_subset) auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1231 | show "f i \<in> borel_measurable M" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1232 | unfolding f_def enn2real_def by measurable | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1233 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1234 | moreover | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1235 |   { fix x
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1236 | have "(SUP i. (f i x)) = u x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1237 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1238 | obtain n where "u x \<le> of_nat n" using real_arch_simple by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1239 | then have min_eq_r: "\<forall>\<^sub>F i in sequentially. min (real i) (u x) = u x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1240 | by (auto simp: eventually_sequentially intro!: exI[of _ n] split: split_min) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1241 | have "(\<lambda>i. real_of_int \<lfloor>min (real i) (u x) * 2^i\<rfloor> / 2^i) \<longlonglongrightarrow> u x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1242 | proof (rule tendsto_sandwich) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1243 | show "(\<lambda>n. u x - (1/2)^n) \<longlonglongrightarrow> u x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1244 | by (auto intro!: tendsto_eq_intros LIMSEQ_power_zero) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1245 | show "\<forall>\<^sub>F n in sequentially. real_of_int \<lfloor>min (real n) (u x) * 2 ^ n\<rfloor> / 2 ^ n \<le> u x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1246 | using min_eq_r by eventually_elim (auto simp: field_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1247 | have *: "u x * (2 ^ n * 2 ^ n) \<le> 2^n + 2^n * real_of_int \<lfloor>u x * 2 ^ n\<rfloor>" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1248 | using real_of_int_floor_ge_diff_one[of "u x * 2^n", THEN mult_left_mono, of "2^n"] | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1249 | by (auto simp: field_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1250 | show "\<forall>\<^sub>F n in sequentially. u x - (1/2)^n \<le> real_of_int \<lfloor>min (real n) (u x) * 2 ^ n\<rfloor> / 2 ^ n" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1251 | using min_eq_r by eventually_elim (insert *, auto simp: field_simps) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1252 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1253 | then have "(\<lambda>i. (f i x)) \<longlonglongrightarrow> u x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1254 | by (simp add: f_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1255 | from LIMSEQ_unique LIMSEQ_incseq_SUP [OF bdd inc_f] this | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1256 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1257 | by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1258 | qed } | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1259 | ultimately show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1260 | by (intro exI [of _ "\<lambda>i x. f i x"]) (auto simp: \<open>incseq f\<close> bdd image_comp) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1261 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1262 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1263 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1264 | lemma homeomorphic_open_interval_UNIV: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1265 | fixes a b:: real | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1266 | assumes "a < b" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1267 |   shows "{a<..<b} homeomorphic (UNIV::real set)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1268 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1269 |   have "{a<..<b} = ball ((b+a) / 2) ((b-a) / 2)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1270 | using assms | 
| 70817 
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
 haftmann parents: 
70802diff
changeset | 1271 | by (auto simp: dist_real_def abs_if field_split_simps split: if_split_asm) | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1272 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1273 | by (simp add: homeomorphic_ball_UNIV assms) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1274 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1275 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1276 | proposition homeomorphic_box_UNIV: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1277 | fixes a b:: "'a::euclidean_space" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1278 |   assumes "box a b \<noteq> {}"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1279 | shows "box a b homeomorphic (UNIV::'a set)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1280 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1281 |   have "{a \<bullet> i <..<b \<bullet> i} homeomorphic (UNIV::real set)" if "i \<in> Basis" for i
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1282 | using assms box_ne_empty that by (blast intro: homeomorphic_open_interval_UNIV) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1283 | then have "\<exists>f g. (\<forall>x. a \<bullet> i < x \<and> x < b \<bullet> i \<longrightarrow> g (f x) = x) \<and> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1284 | (\<forall>y. a \<bullet> i < g y \<and> g y < b \<bullet> i \<and> f(g y) = y) \<and> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1285 |                    continuous_on {a \<bullet> i<..<b \<bullet> i} f \<and>
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1286 | continuous_on (UNIV::real set) g" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1287 | if "i \<in> Basis" for i | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1288 | using that by (auto simp: homeomorphic_minimal mem_box Ball_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1289 | then obtain f g where gf: "\<And>i x. \<lbrakk>i \<in> Basis; a \<bullet> i < x; x < b \<bullet> i\<rbrakk> \<Longrightarrow> g i (f i x) = x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1290 | and fg: "\<And>i y. i \<in> Basis \<Longrightarrow> a \<bullet> i < g i y \<and> g i y < b \<bullet> i \<and> f i (g i y) = y" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1291 |               and contf: "\<And>i. i \<in> Basis \<Longrightarrow> continuous_on {a \<bullet> i<..<b \<bullet> i} (f i)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1292 | and contg: "\<And>i. i \<in> Basis \<Longrightarrow> continuous_on (UNIV::real set) (g i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1293 | by metis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1294 | define F where "F \<equiv> \<lambda>x. \<Sum>i\<in>Basis. (f i (x \<bullet> i)) *\<^sub>R i" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1295 | define G where "G \<equiv> \<lambda>x. \<Sum>i\<in>Basis. (g i (x \<bullet> i)) *\<^sub>R i" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1296 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1297 | unfolding homeomorphic_minimal | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1298 | proof (intro exI conjI ballI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1299 | show "G y \<in> box a b" for y | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1300 | using fg by (simp add: G_def mem_box) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1301 | show "G (F x) = x" if "x \<in> box a b" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1302 | using that by (simp add: F_def G_def gf mem_box euclidean_representation) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1303 | show "F (G y) = y" for y | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1304 | by (simp add: F_def G_def fg mem_box euclidean_representation) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1305 | show "continuous_on (box a b) F" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1306 | unfolding F_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1307 | proof (intro continuous_intros continuous_on_compose2 [OF contf continuous_on_inner]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1308 |       show "(\<lambda>x. x \<bullet> i) ` box a b \<subseteq> {a \<bullet> i<..<b \<bullet> i}" if "i \<in> Basis" for i
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1309 | using that by (auto simp: mem_box) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1310 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1311 | show "continuous_on UNIV G" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1312 | unfolding G_def | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1313 | by (intro continuous_intros continuous_on_compose2 [OF contg continuous_on_inner]) auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1314 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1315 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1316 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1317 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1318 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1319 | lemma diff_null_sets_lebesgue: "\<lbrakk>N \<in> null_sets (lebesgue_on S); X-N \<in> sets (lebesgue_on S); N \<subseteq> X\<rbrakk> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1320 | \<Longrightarrow> X \<in> sets (lebesgue_on S)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1321 | by (metis Int_Diff_Un inf.commute inf.orderE null_setsD2 sets.Un) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1322 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1323 | lemma borel_measurable_diff_null: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1324 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1325 | assumes N: "N \<in> null_sets (lebesgue_on S)" and S: "S \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1326 | shows "f \<in> borel_measurable (lebesgue_on (S-N)) \<longleftrightarrow> f \<in> borel_measurable (lebesgue_on S)" | 
| 70707 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1327 | unfolding in_borel_measurable space_lebesgue_on sets_restrict_UNIV | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1328 | proof (intro ball_cong iffI) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1329 | show "f -` T \<inter> S \<in> sets (lebesgue_on S)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1330 | if "f -` T \<inter> (S-N) \<in> sets (lebesgue_on (S-N))" for T | 
| 70707 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1331 | proof - | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1332 | have "N \<inter> S = N" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1333 | by (metis N S inf.orderE null_sets_restrict_space) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1334 | moreover have "N \<inter> S \<in> sets lebesgue" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1335 | by (metis N S inf.orderE null_setsD2 null_sets_restrict_space) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1336 | moreover have "f -` T \<inter> S \<inter> (f -` T \<inter> N) \<in> sets lebesgue" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1337 | by (metis N S completion.complete inf.absorb2 inf_le2 inf_mono null_sets_restrict_space) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1338 | ultimately show ?thesis | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1339 | by (metis Diff_Int_distrib Int_Diff_Un S inf_le2 sets.Diff sets.Un sets_restrict_space_iff space_lebesgue_on space_restrict_space that) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1340 | qed | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1341 | show "f -` T \<inter> (S-N) \<in> sets (lebesgue_on (S-N))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1342 | if "f -` T \<inter> S \<in> sets (lebesgue_on S)" for T | 
| 70707 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1343 | proof - | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1344 | have "(S - N) \<inter> f -` T = (S - N) \<inter> (f -` T \<inter> S)" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1345 | by blast | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1346 | then have "(S - N) \<inter> f -` T \<in> sets.restricted_space lebesgue (S - N)" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1347 | by (metis S image_iff sets.Int_space_eq2 sets_restrict_space_iff that) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1348 | then show ?thesis | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1349 | by (simp add: inf.commute sets_restrict_space) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1350 | qed | 
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1351 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1352 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1353 | lemma lebesgue_measurable_diff_null: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1354 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1355 | assumes "N \<in> null_sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1356 | shows "f \<in> borel_measurable (lebesgue_on (-N)) \<longleftrightarrow> f \<in> borel_measurable lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1357 | by (simp add: Compl_eq_Diff_UNIV assms borel_measurable_diff_null lebesgue_on_UNIV_eq) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1358 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1359 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1360 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1361 | proposition measurable_on_imp_borel_measurable_lebesgue_UNIV: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1362 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1363 | assumes "f measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1364 | shows "f \<in> borel_measurable lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1365 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1366 | obtain N and F | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1367 | where NF: "negligible N" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1368 | and conF: "\<And>n. continuous_on UNIV (F n)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1369 | and tendsF: "\<And>x. x \<notin> N \<Longrightarrow> (\<lambda>n. F n x) \<longlonglongrightarrow> f x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1370 | using assms by (auto simp: measurable_on_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1371 | obtain N where "N \<in> null_sets lebesgue" "f \<in> borel_measurable (lebesgue_on (-N))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1372 | proof | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1373 | show "f \<in> borel_measurable (lebesgue_on (- N))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1374 | proof (rule borel_measurable_LIMSEQ_metric) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1375 | show "F i \<in> borel_measurable (lebesgue_on (- N))" for i | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1376 | by (meson Compl_in_sets_lebesgue NF conF continuous_imp_measurable_on_sets_lebesgue continuous_on_subset negligible_imp_sets subset_UNIV) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1377 | show "(\<lambda>i. F i x) \<longlonglongrightarrow> f x" if "x \<in> space (lebesgue_on (- N))" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1378 | using that | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1379 | by (simp add: tendsF) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1380 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1381 | show "N \<in> null_sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1382 | using NF negligible_iff_null_sets by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1383 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1384 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1385 | using lebesgue_measurable_diff_null by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1386 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1387 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1388 | corollary measurable_on_imp_borel_measurable_lebesgue: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1389 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1390 | assumes "f measurable_on S" and S: "S \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1391 | shows "f \<in> borel_measurable (lebesgue_on S)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1392 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1393 | have "(\<lambda>x. if x \<in> S then f x else 0) measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1394 | using assms(1) measurable_on_UNIV by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1395 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1396 | by (simp add: borel_measurable_if_D measurable_on_imp_borel_measurable_lebesgue_UNIV) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1397 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1398 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1399 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1400 | proposition measurable_on_limit: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1401 | fixes f :: "nat \<Rightarrow> 'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1402 | assumes f: "\<And>n. f n measurable_on S" and N: "negligible N" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1403 | and lim: "\<And>x. x \<in> S - N \<Longrightarrow> (\<lambda>n. f n x) \<longlonglongrightarrow> g x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1404 | shows "g measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1405 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1406 | have "box (0::'b) One homeomorphic (UNIV::'b set)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1407 | by (simp add: homeomorphic_box_UNIV) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1408 | then obtain h h':: "'b\<Rightarrow>'b" where hh': "\<And>x. x \<in> box 0 One \<Longrightarrow> h (h' x) = x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1409 | and h'im: "h' ` box 0 One = UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1410 | and conth: "continuous_on UNIV h" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1411 | and conth': "continuous_on (box 0 One) h'" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1412 | and h'h: "\<And>y. h' (h y) = y" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1413 | and rangeh: "range h = box 0 One" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1414 | by (auto simp: homeomorphic_def homeomorphism_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1415 |   have "norm y \<le> DIM('b)" if y: "y \<in> box 0 One" for y::'b
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1416 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1417 | have y01: "0 < y \<bullet> i" "y \<bullet> i < 1" if "i \<in> Basis" for i | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1418 | using that y by (auto simp: mem_box) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1419 | have "norm y \<le> (\<Sum>i\<in>Basis. \<bar>y \<bullet> i\<bar>)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1420 | using norm_le_l1 by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1421 | also have "\<dots> \<le> (\<Sum>i::'b\<in>Basis. 1)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1422 | proof (rule sum_mono) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1423 | show "\<bar>y \<bullet> i\<bar> \<le> 1" if "i \<in> Basis" for i | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1424 | using y01 that by fastforce | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1425 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1426 |     also have "\<dots> \<le> DIM('b)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1427 | by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1428 | finally show ?thesis . | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1429 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1430 |   then have norm_le: "norm(h y) \<le> DIM('b)" for y
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1431 | by (metis UNIV_I image_eqI rangeh) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1432 | have "(h' \<circ> (h \<circ> (\<lambda>x. if x \<in> S then g x else 0))) measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1433 | proof (rule measurable_on_compose_continuous_box) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1434 | let ?\<chi> = "h \<circ> (\<lambda>x. if x \<in> S then g x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1435 | let ?f = "\<lambda>n. h \<circ> (\<lambda>x. if x \<in> S then f n x else 0)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1436 | show "?\<chi> measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1437 | proof (rule integrable_subintervals_imp_measurable) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1438 | show "?\<chi> integrable_on cbox a b" for a b | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1439 | proof (rule integrable_spike_set) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1440 | show "?\<chi> integrable_on (cbox a b - N)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1441 | proof (rule dominated_convergence_integrable) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1442 |           show const: "(\<lambda>x. DIM('b)) integrable_on cbox a b - N"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1443 | by (simp add: N has_integral_iff integrable_const integrable_negligible integrable_setdiff negligible_diff) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1444 |           show "norm ((h \<circ> (\<lambda>x. if x \<in> S then g x else 0)) x) \<le> DIM('b)" if "x \<in> cbox a b - N" for x
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1445 | using that norm_le by (simp add: o_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1446 | show "(\<lambda>k. ?f k x) \<longlonglongrightarrow> ?\<chi> x" if "x \<in> cbox a b - N" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1447 | using that lim [of x] conth | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1448 | by (auto simp: continuous_on_def intro: tendsto_compose) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1449 | show "(?f n) absolutely_integrable_on cbox a b - N" for n | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1450 | proof (rule measurable_bounded_by_integrable_imp_absolutely_integrable) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1451 | show "?f n \<in> borel_measurable (lebesgue_on (cbox a b - N))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1452 | proof (rule measurable_on_imp_borel_measurable_lebesgue [OF measurable_on_spike_set]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1453 | show "?f n measurable_on cbox a b" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1454 | unfolding measurable_on_UNIV [symmetric, of _ "cbox a b"] | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1455 | proof (rule measurable_on_restrict) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1456 | have f': "(\<lambda>x. if x \<in> S then f n x else 0) measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1457 | by (simp add: f measurable_on_UNIV) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1458 | show "?f n measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1459 | using measurable_on_compose_continuous [OF f' conth] by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1460 | qed auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1461 | show "negligible (sym_diff (cbox a b) (cbox a b - N))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1462 | by (auto intro: negligible_subset [OF N]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1463 | show "cbox a b - N \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1464 | by (simp add: N negligible_imp_sets sets.Diff) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1465 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1466 | show "cbox a b - N \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1467 | by (simp add: N negligible_imp_sets sets.Diff) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1468 |             show "norm (?f n x) \<le> DIM('b)"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1469 | if "x \<in> cbox a b - N" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1470 | using that local.norm_le by simp | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1471 | qed (auto simp: const) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1472 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1473 |         show "negligible {x \<in> cbox a b - N - cbox a b. ?\<chi> x \<noteq> 0}"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1474 | by (auto simp: empty_imp_negligible) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1475 |         have "{x \<in> cbox a b - (cbox a b - N). ?\<chi> x \<noteq> 0} \<subseteq> N"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1476 | by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1477 |         then show "negligible {x \<in> cbox a b - (cbox a b - N). ?\<chi> x \<noteq> 0}"
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1478 | using N negligible_subset by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1479 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1480 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1481 | show "?\<chi> x \<in> box 0 One" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1482 | using rangeh by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1483 | show "continuous_on (box 0 One) h'" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1484 | by (rule conth') | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1485 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1486 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1487 | by (simp add: o_def h'h measurable_on_UNIV) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1488 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1489 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1490 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1491 | lemma measurable_on_if_simple_function_limit: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1492 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1493 | shows "\<lbrakk>\<And>n. g n measurable_on UNIV; \<And>n. finite (range (g n)); \<And>x. (\<lambda>n. g n x) \<longlonglongrightarrow> f x\<rbrakk> | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1494 | \<Longrightarrow> f measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1495 |   by (force intro: measurable_on_limit [where N="{}"])
 | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1496 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1497 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1498 | lemma lebesgue_measurable_imp_measurable_on_nnreal_UNIV: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1499 | fixes u :: "'a::euclidean_space \<Rightarrow> real" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1500 | assumes u: "u \<in> borel_measurable lebesgue" and nn: "\<And>x. u x \<ge> 0" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1501 | shows "u measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1502 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1503 | obtain f where "incseq f" and f: "\<forall>i. simple_function lebesgue (f i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1504 | and bdd: "\<And>x. bdd_above (range (\<lambda>i. f i x))" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1505 | and nnf: "\<And>i x. 0 \<le> f i x" and *: "u = (SUP i. f i)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1506 | using borel_measurable_implies_simple_function_sequence_real nn u by metis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1507 | show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1508 | unfolding * | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1509 | proof (rule measurable_on_if_simple_function_limit [of concl: "Sup (range f)"]) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1510 | show "(f i) measurable_on UNIV" for i | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1511 | by (simp add: f nnf simple_function_measurable_on_UNIV) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1512 | show "finite (range (f i))" for i | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1513 | by (metis f simple_function_def space_borel space_completion space_lborel) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1514 | show "(\<lambda>i. f i x) \<longlonglongrightarrow> Sup (range f) x" for x | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1515 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1516 | have "incseq (\<lambda>i. f i x)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1517 | using \<open>incseq f\<close> apply (auto simp: incseq_def) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1518 | by (simp add: le_funD) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1519 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1520 | by (metis SUP_apply bdd LIMSEQ_incseq_SUP) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1521 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1522 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1523 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1524 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1525 | lemma lebesgue_measurable_imp_measurable_on_nnreal: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1526 | fixes u :: "'a::euclidean_space \<Rightarrow> real" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1527 | assumes "u \<in> borel_measurable lebesgue" "\<And>x. u x \<ge> 0""S \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1528 | shows "u measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1529 | unfolding measurable_on_UNIV [symmetric, of u] | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1530 | using assms | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1531 | by (auto intro: lebesgue_measurable_imp_measurable_on_nnreal_UNIV) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1532 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1533 | lemma lebesgue_measurable_imp_measurable_on_real: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1534 | fixes u :: "'a::euclidean_space \<Rightarrow> real" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1535 | assumes u: "u \<in> borel_measurable lebesgue" and S: "S \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1536 | shows "u measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1537 | proof - | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1538 | let ?f = "\<lambda>x. \<bar>u x\<bar> + u x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1539 | let ?g = "\<lambda>x. \<bar>u x\<bar> - u x" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1540 | have "?f measurable_on S" "?g measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1541 | using S u by (auto intro: lebesgue_measurable_imp_measurable_on_nnreal) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1542 | then have "(\<lambda>x. (?f x - ?g x) / 2) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1543 | using measurable_on_cdivide measurable_on_diff by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1544 | then show ?thesis | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1545 | by auto | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1546 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1547 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1548 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1549 | proposition lebesgue_measurable_imp_measurable_on: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1550 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1551 | assumes f: "f \<in> borel_measurable lebesgue" and S: "S \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1552 | shows "f measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1553 | unfolding measurable_on_componentwise [of f] | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1554 | proof | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1555 | fix i::'b | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1556 | assume "i \<in> Basis" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1557 | have "(\<lambda>x. (f x \<bullet> i)) \<in> borel_measurable lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1558 | using \<open>i \<in> Basis\<close> borel_measurable_euclidean_space f by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1559 | then have "(\<lambda>x. (f x \<bullet> i)) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1560 | using S lebesgue_measurable_imp_measurable_on_real by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1561 | then show "(\<lambda>x. (f x \<bullet> i) *\<^sub>R i) measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1562 | by (intro measurable_on_scaleR measurable_on_const S) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1563 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1564 | |
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1565 | proposition measurable_on_iff_borel_measurable: | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1566 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1567 | assumes "S \<in> sets lebesgue" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1568 | shows "f measurable_on S \<longleftrightarrow> f \<in> borel_measurable (lebesgue_on S)" (is "?lhs = ?rhs") | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1569 | proof | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1570 | show "f \<in> borel_measurable (lebesgue_on S)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1571 | if "f measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1572 | using that by (simp add: assms measurable_on_imp_borel_measurable_lebesgue) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1573 | next | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1574 | assume "f \<in> borel_measurable (lebesgue_on S)" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1575 | then have "(\<lambda>a. if a \<in> S then f a else 0) measurable_on UNIV" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1576 | by (simp add: assms borel_measurable_if lebesgue_measurable_imp_measurable_on) | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1577 | then show "f measurable_on S" | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1578 | using measurable_on_UNIV by blast | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1579 | qed | 
| 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1580 | |
| 74969 | 1581 | subsection \<open>Monotonic functions are Lebesgue integrable\<close> | 
| 1582 | ||
| 1583 | (*Can these be generalised from type real?*) | |
| 1584 | lemma integrable_mono_on_nonneg: | |
| 1585 | fixes f :: "real \<Rightarrow> real" | |
| 75607 
3c544d64c218
changed argument order of mono_on and strict_mono_on to uniformize with monotone_on and other predicates
 desharna parents: 
74969diff
changeset | 1586 |   assumes mon: "mono_on {a..b} f" and 0: "\<And>x. 0 \<le> f x"
 | 
| 74969 | 1587 |   shows "integrable (lebesgue_on {a..b}) f" 
 | 
| 1588 | proof - | |
| 1589 | have "space lborel = space lebesgue" "sets borel \<subseteq> sets lebesgue" | |
| 1590 | by force+ | |
| 1591 |   then have fborel: "f \<in> borel_measurable (lebesgue_on {a..b})"
 | |
| 1592 | by (metis mon borel_measurable_mono_on_fnc borel_measurable_subalgebra mono_restrict_space space_lborel space_restrict_space) | |
| 1593 |   then obtain g where g: "incseq g" and simple: "\<And>i. simple_function (lebesgue_on {a..b}) (g i)" 
 | |
| 1594 | and bdd: " (\<forall>x. bdd_above (range (\<lambda>i. g i x)))" and nonneg: "\<forall>i x. 0 \<le> g i x" | |
| 1595 | and fsup: "f = (SUP i. g i)" | |
| 1596 | by (metis borel_measurable_implies_simple_function_sequence_real 0) | |
| 1597 |   have "f ` {a..b} \<subseteq> {f a..f b}" 
 | |
| 1598 | using assms by (auto simp: mono_on_def) | |
| 1599 | have g_le_f: "g i x \<le> f x" for i x | |
| 1600 | proof - | |
| 1601 | have "bdd_above ((\<lambda>h. h x) ` range g)" | |
| 1602 | using bdd cSUP_lessD linorder_not_less by fastforce | |
| 1603 | then show ?thesis | |
| 1604 | by (metis SUP_apply UNIV_I bdd cSUP_upper fsup) | |
| 1605 | qed | |
| 1606 |   then have gfb: "g i x \<le> f b" if "x \<in> {a..b}" for i x
 | |
| 1607 | by (smt (verit, best) mon atLeastAtMost_iff mono_on_def that) | |
| 1608 | have g_le: "g i x \<le> g j x" if "i\<le>j" for i j x | |
| 1609 | using g by (simp add: incseq_def le_funD that) | |
| 1610 |   show "integrable (lebesgue_on {a..b}) ( f)"
 | |
| 1611 | proof (rule integrable_dominated_convergence) | |
| 1612 |     show "f \<in> borel_measurable (lebesgue_on {a..b})"
 | |
| 1613 | using fborel by blast | |
| 1614 | have "\<And>x. (\<lambda>i. g i x) \<longlonglongrightarrow> (SUP h \<in> range g. h x)" | |
| 1615 | proof (rule order_tendstoI) | |
| 1616 | show "\<forall>\<^sub>F i in sequentially. y < g i x" | |
| 1617 | if "y < (SUP h\<in>range g. h x)" for x y | |
| 1618 | proof - | |
| 1619 | from that obtain h where h: "h \<in> range g" "y < h x" | |
| 1620 | using g_le_f by (subst (asm)less_cSUP_iff) fastforce+ | |
| 1621 | then show ?thesis | |
| 1622 | by (smt (verit, ccfv_SIG) eventually_sequentially g_le imageE) | |
| 1623 | qed | |
| 1624 | show "\<forall>\<^sub>F i in sequentially. g i x < y" | |
| 1625 | if "(SUP h\<in>range g. h x) < y" for x y | |
| 1626 | by (smt (verit, best) that Sup_apply g_le_f always_eventually fsup image_cong) | |
| 1627 | qed | |
| 1628 |     then show "AE x in lebesgue_on {a..b}. (\<lambda>i. g i x) \<longlonglongrightarrow> f x"
 | |
| 1629 | by (simp add: fsup) | |
| 1630 | fix i | |
| 1631 |     show "g i \<in> borel_measurable (lebesgue_on {a..b})"
 | |
| 1632 | using borel_measurable_simple_function simple by blast | |
| 1633 |     show "AE x in lebesgue_on {a..b}. norm (g i x) \<le> f b"
 | |
| 1634 |       by (simp add: gfb nonneg Measure_Space.AE_I' [of "{}"])
 | |
| 1635 | qed auto | |
| 1636 | qed | |
| 1637 | ||
| 1638 | lemma integrable_mono_on: | |
| 1639 | fixes f :: "real \<Rightarrow> real" | |
| 75607 
3c544d64c218
changed argument order of mono_on and strict_mono_on to uniformize with monotone_on and other predicates
 desharna parents: 
74969diff
changeset | 1640 |   assumes "mono_on {a..b} f"
 | 
| 74969 | 1641 |   shows "integrable (lebesgue_on {a..b}) f" 
 | 
| 1642 | proof - | |
| 1643 |   define f' where "f' \<equiv> \<lambda>x. if x \<in> {a..b} then f x - f a else 0"
 | |
| 75607 
3c544d64c218
changed argument order of mono_on and strict_mono_on to uniformize with monotone_on and other predicates
 desharna parents: 
74969diff
changeset | 1644 |   have "mono_on {a..b} f'"
 | 
| 74969 | 1645 | by (smt (verit, best) assms f'_def mono_on_def) | 
| 1646 | moreover have 0: "\<And>x. 0 \<le> f' x" | |
| 1647 | by (smt (verit, best) assms atLeastAtMost_iff f'_def mono_on_def) | |
| 1648 |   ultimately have "integrable (lebesgue_on {a..b}) f'"
 | |
| 1649 | using integrable_mono_on_nonneg by presburger | |
| 1650 |   then have "integrable (lebesgue_on {a..b}) (\<lambda>x. f' x + f a)"
 | |
| 1651 | by force | |
| 1652 | moreover have "space lborel = space lebesgue" "sets borel \<subseteq> sets lebesgue" | |
| 1653 | by force+ | |
| 1654 |   then have fborel: "f \<in> borel_measurable (lebesgue_on {a..b})"
 | |
| 1655 | by (metis assms borel_measurable_mono_on_fnc borel_measurable_subalgebra mono_restrict_space space_lborel space_restrict_space) | |
| 1656 | ultimately show ?thesis | |
| 1657 | by (rule integrable_cong_AE_imp) (auto simp add: f'_def) | |
| 1658 | qed | |
| 1659 | ||
| 1660 | lemma integrable_on_mono_on: | |
| 1661 | fixes f :: "real \<Rightarrow> real" | |
| 75607 
3c544d64c218
changed argument order of mono_on and strict_mono_on to uniformize with monotone_on and other predicates
 desharna parents: 
74969diff
changeset | 1662 |   assumes "mono_on {a..b} f"
 | 
| 74969 | 1663 |   shows "f integrable_on {a..b}"
 | 
| 1664 | by (simp add: assms integrable_mono_on integrable_on_lebesgue_on) | |
| 1665 | ||
| 70707 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1666 | subsection \<open>Measurability on generalisations of the binary product\<close> | 
| 70721 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1667 | |
| 70707 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1668 | lemma measurable_on_bilinear: | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1669 | fixes h :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space \<Rightarrow> 'c::euclidean_space" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1670 | assumes h: "bilinear h" and f: "f measurable_on S" and g: "g measurable_on S" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1671 | shows "(\<lambda>x. h (f x) (g x)) measurable_on S" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1672 | proof (rule measurable_on_combine [where h = h]) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1673 | show "continuous_on UNIV (\<lambda>x. h (fst x) (snd x))" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1674 | by (simp add: bilinear_continuous_on_compose [OF continuous_on_fst continuous_on_snd h]) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1675 | show "h 0 0 = 0" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1676 | by (simp add: bilinear_lzero h) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1677 | qed (auto intro: assms) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1678 | |
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1679 | lemma borel_measurable_bilinear: | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1680 | fixes h :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space \<Rightarrow> 'c::euclidean_space" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1681 | assumes "bilinear h" "f \<in> borel_measurable (lebesgue_on S)" "g \<in> borel_measurable (lebesgue_on S)" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1682 | and S: "S \<in> sets lebesgue" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1683 | shows "(\<lambda>x. h (f x) (g x)) \<in> borel_measurable (lebesgue_on S)" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1684 | using assms measurable_on_bilinear [of h f S g] | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1685 | by (simp flip: measurable_on_iff_borel_measurable) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1686 | |
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1687 | lemma absolutely_integrable_bounded_measurable_product: | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1688 | fixes h :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space \<Rightarrow> 'c::euclidean_space" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1689 | assumes "bilinear h" and f: "f \<in> borel_measurable (lebesgue_on S)" "S \<in> sets lebesgue" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1690 | and bou: "bounded (f ` S)" and g: "g absolutely_integrable_on S" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1691 | shows "(\<lambda>x. h (f x) (g x)) absolutely_integrable_on S" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1692 | proof - | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1693 | obtain B where "B > 0" and B: "\<And>x y. norm (h x y) \<le> B * norm x * norm y" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1694 | using bilinear_bounded_pos \<open>bilinear h\<close> by blast | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1695 | obtain C where "C > 0" and C: "\<And>x. x \<in> S \<Longrightarrow> norm (f x) \<le> C" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1696 | using bounded_pos by (metis bou imageI) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1697 | show ?thesis | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1698 | proof (rule measurable_bounded_by_integrable_imp_absolutely_integrable [OF _ \<open>S \<in> sets lebesgue\<close>]) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1699 | show "norm (h (f x) (g x)) \<le> B * C * norm(g x)" if "x \<in> S" for x | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1700 | by (meson less_le mult_left_mono mult_right_mono norm_ge_zero order_trans that \<open>B > 0\<close> B C) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1701 | show "(\<lambda>x. h (f x) (g x)) \<in> borel_measurable (lebesgue_on S)" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1702 | using \<open>bilinear h\<close> f g | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1703 | by (blast intro: borel_measurable_bilinear dest: absolutely_integrable_measurable) | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1704 | show "(\<lambda>x. B * C * norm(g x)) integrable_on S" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1705 | using \<open>0 < B\<close> \<open>0 < C\<close> absolutely_integrable_on_def g by auto | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1706 | qed | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1707 | qed | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1708 | |
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1709 | lemma absolutely_integrable_bounded_measurable_product_real: | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1710 | fixes f :: "real \<Rightarrow> real" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1711 | assumes "f \<in> borel_measurable (lebesgue_on S)" "S \<in> sets lebesgue" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1712 | and "bounded (f ` S)" and "g absolutely_integrable_on S" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1713 | shows "(\<lambda>x. f x * g x) absolutely_integrable_on S" | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1714 | using absolutely_integrable_bounded_measurable_product bilinear_times assms by blast | 
| 
125705f5965f
A little-known material, and some tidying up
 paulson <lp15@cam.ac.uk> parents: 
70694diff
changeset | 1715 | |
| 70721 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1716 | |
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1717 | lemma borel_measurable_AE: | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1718 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1719 | assumes "f \<in> borel_measurable lebesgue" and ae: "AE x in lebesgue. f x = g x" | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1720 | shows "g \<in> borel_measurable lebesgue" | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1721 | proof - | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1722 | obtain N where N: "N \<in> null_sets lebesgue" "\<And>x. x \<notin> N \<Longrightarrow> f x = g x" | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1723 | using ae unfolding completion.AE_iff_null_sets by auto | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1724 | have "f measurable_on UNIV" | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1725 | by (simp add: assms lebesgue_measurable_imp_measurable_on) | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1726 | then have "g measurable_on UNIV" | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1727 | by (metis Diff_iff N measurable_on_spike negligible_iff_null_sets) | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1728 | then show ?thesis | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1729 | using measurable_on_imp_borel_measurable_lebesgue_UNIV by blast | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1730 | qed | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1731 | |
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1732 | lemma has_bochner_integral_combine: | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1733 | fixes f :: "real \<Rightarrow> 'a::euclidean_space" | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1734 | assumes "a \<le> c" "c \<le> b" | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1735 |     and ac: "has_bochner_integral (lebesgue_on {a..c}) f i"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1736 |     and cb: "has_bochner_integral (lebesgue_on {c..b}) f j"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1737 |   shows "has_bochner_integral (lebesgue_on {a..b}) f(i + j)"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1738 | proof - | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1739 |   have i: "has_bochner_integral lebesgue (\<lambda>x. indicator {a..c} x *\<^sub>R f x) i"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1740 |    and j: "has_bochner_integral lebesgue (\<lambda>x. indicator {c..b} x *\<^sub>R f x) j"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1741 | using assms by (auto simp: has_bochner_integral_restrict_space) | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1742 |   have AE: "AE x in lebesgue. indicat_real {a..c} x *\<^sub>R f x + indicat_real {c..b} x *\<^sub>R f x = indicat_real {a..b} x *\<^sub>R f x"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1743 | proof (rule AE_I') | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1744 |     have eq: "indicat_real {a..c} x *\<^sub>R f x + indicat_real {c..b} x *\<^sub>R f x = indicat_real {a..b} x *\<^sub>R f x" if "x \<noteq> c" for x
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1745 | using assms that by (auto simp: indicator_def) | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1746 |     then show "{x \<in> space lebesgue. indicat_real {a..c} x *\<^sub>R f x + indicat_real {c..b} x *\<^sub>R f x \<noteq> indicat_real {a..b} x *\<^sub>R f x} \<subseteq> {c}"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1747 | by auto | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1748 | qed auto | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1749 |   have "has_bochner_integral lebesgue (\<lambda>x. indicator {a..b} x *\<^sub>R f x) (i + j)"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1750 | proof (rule has_bochner_integralI_AE [OF has_bochner_integral_add [OF i j] _ AE]) | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1751 |     have eq: "indicat_real {a..c} x *\<^sub>R f x + indicat_real {c..b} x *\<^sub>R f x = indicat_real {a..b} x *\<^sub>R f x" if "x \<noteq> c" for x
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1752 | using assms that by (auto simp: indicator_def) | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1753 |     show "(\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) \<in> borel_measurable lebesgue"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1754 | proof (rule borel_measurable_AE [OF borel_measurable_add AE]) | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1755 |       show "(\<lambda>x. indicator {a..c} x *\<^sub>R f x) \<in> borel_measurable lebesgue"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1756 |            "(\<lambda>x. indicator {c..b} x *\<^sub>R f x) \<in> borel_measurable lebesgue"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1757 | using i j by auto | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1758 | qed | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1759 | qed | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1760 | then show ?thesis | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1761 | by (simp add: has_bochner_integral_restrict_space) | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1762 | qed | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1763 | |
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1764 | lemma integrable_combine: | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1765 | fixes f :: "real \<Rightarrow> 'a::euclidean_space" | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1766 |   assumes "integrable (lebesgue_on {a..c}) f" "integrable (lebesgue_on {c..b}) f"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1767 | and "a \<le> c" "c \<le> b" | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1768 |   shows "integrable (lebesgue_on {a..b}) f"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1769 | using assms has_bochner_integral_combine has_bochner_integral_iff by blast | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1770 | |
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1771 | lemma integral_combine: | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1772 | fixes f :: "real \<Rightarrow> 'a::euclidean_space" | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1773 |   assumes f: "integrable (lebesgue_on {a..b}) f" and "a \<le> c" "c \<le> b"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1774 |   shows "integral\<^sup>L (lebesgue_on {a..b}) f = integral\<^sup>L (lebesgue_on {a..c}) f + integral\<^sup>L (lebesgue_on {c..b}) f"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1775 | proof - | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1776 |   have i: "has_bochner_integral (lebesgue_on {a..c}) f(integral\<^sup>L (lebesgue_on {a..c}) f)"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1777 | using integrable_subinterval \<open>c \<le> b\<close> f has_bochner_integral_iff by fastforce | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1778 |   have j: "has_bochner_integral (lebesgue_on {c..b}) f(integral\<^sup>L (lebesgue_on {c..b}) f)"
 | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1779 | using integrable_subinterval \<open>a \<le> c\<close> f has_bochner_integral_iff by fastforce | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1780 | show ?thesis | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1781 | by (meson \<open>a \<le> c\<close> \<open>c \<le> b\<close> has_bochner_integral_combine has_bochner_integral_iff i j) | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1782 | qed | 
| 
47258727fa42
A few new theorems, tidying up and deletion of obsolete material
 paulson <lp15@cam.ac.uk> parents: 
70707diff
changeset | 1783 | |
| 70760 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1784 | lemma has_bochner_integral_null [intro]: | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1785 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1786 | assumes "N \<in> null_sets lebesgue" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1787 | shows "has_bochner_integral (lebesgue_on N) f 0" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1788 | unfolding has_bochner_integral_iff \<comment>\<open>strange that the proof's so long\<close> | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1789 | proof | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1790 | show "integrable (lebesgue_on N) f" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1791 | proof (subst integrable_restrict_space) | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1792 | show "N \<inter> space lebesgue \<in> sets lebesgue" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1793 | using assms by force | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1794 | show "integrable lebesgue (\<lambda>x. indicat_real N x *\<^sub>R f x)" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1795 | proof (rule integrable_cong_AE_imp) | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1796 | show "integrable lebesgue (\<lambda>x. 0)" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1797 | by simp | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1798 | show *: "AE x in lebesgue. 0 = indicat_real N x *\<^sub>R f x" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1799 | using assms | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1800 | by (simp add: indicator_def completion.null_sets_iff_AE eventually_mono) | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1801 | show "(\<lambda>x. indicat_real N x *\<^sub>R f x) \<in> borel_measurable lebesgue" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1802 | by (auto intro: borel_measurable_AE [OF _ *]) | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1803 | qed | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1804 | qed | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1805 | show "integral\<^sup>L (lebesgue_on N) f = 0" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1806 | proof (rule integral_eq_zero_AE) | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1807 | show "AE x in lebesgue_on N. f x = 0" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1808 | by (rule AE_I' [where N=N]) (auto simp: assms null_setsD2 null_sets_restrict_space) | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1809 | qed | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1810 | qed | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1811 | |
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1812 | lemma has_bochner_integral_null_eq[simp]: | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1813 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1814 | assumes "N \<in> null_sets lebesgue" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1815 | shows "has_bochner_integral (lebesgue_on N) f i \<longleftrightarrow> i = 0" | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1816 | using assms has_bochner_integral_eq by blast | 
| 
ffbe7784cc85
A little more material from the Fourier AFP entry, and the correction of two very slow proof lines
 paulson <lp15@cam.ac.uk> parents: 
70721diff
changeset | 1817 | |
| 70694 
ae37b8fbf023
New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1818 | end |