src/HOL/Analysis/Equivalence_Measurable_On_Borel.thy
author desharna
Thu, 08 Jul 2021 08:44:18 +0200
changeset 73933 fa92bc604c59
parent 73932 fd21b4a93043
parent 73869 7181130f5872
child 74969 fa0020b47868
permissions -rw-r--r--
merged
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
(*Borrowed from Ergodic_Theory/SG_Library_Complement*)
ae37b8fbf023 New theory Equivalence_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
abbreviation sym_diff :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" 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
    13
  "sym_diff A B \<equiv> ((A - B) \<union> (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
    14
ae37b8fbf023 New theory Equivalence_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
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
    16
ae37b8fbf023 New theory Equivalence_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
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
    18
  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
    19
  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
    20
  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
    21
                  "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
    22
  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
    23
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
    24
  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
    25
  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
    26
  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
    27
    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
    28
    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
    29
      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
    30
  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
    31
    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
    32
    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
    33
      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
    34
    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
    35
      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
    36
    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
    37
      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
    38
    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
    39
    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
    40
      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
    41
    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
    42
      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
    43
        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
    44
      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
    45
        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
    46
      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
    47
        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
    48
    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
    49
    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
    50
      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
    51
    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
    52
    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
    53
      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
    54
        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
    55
      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
    56
        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
    57
      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
    58
        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
    59
      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
    60
        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: 70721
diff changeset
    61
          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
    62
        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
    63
          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
    64
        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
    65
        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
    66
          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
    67
          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
    68
          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
    69
            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
    70
          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
    71
            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
    72
          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
    73
          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
    74
            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: 70721
diff changeset
    75
              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
    76
            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
    77
              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
    78
            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
    79
            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
    80
              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
    81
                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
    82
              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
    83
                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
    84
                  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
    85
                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
    86
                  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
    87
                  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
    88
                  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
    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
            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
    91
          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
    92
        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
    93
      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
    94
      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
    95
        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
    96
      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
    97
      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
    98
        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
    99
          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
   100
        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
   101
          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
   102
      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
   103
      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
   104
        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
   105
      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
   106
      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
   107
        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
   108
          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
   109
        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
   110
        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
   111
          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
   112
            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
   113
          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
   114
            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
   115
        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
   116
        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: 70802
diff changeset
   117
          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
   118
        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
   119
          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
   120
      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
   121
      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
   122
      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
   123
        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
   124
        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
   125
          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
   126
            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
   127
          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
   128
            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
   129
        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
   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
      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: 70802
diff changeset
   132
        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
   133
    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
   134
  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
   135
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
   136
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
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
   139
ae37b8fbf023 New theory Equivalence_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
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
   141
  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
   142
  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
   143
  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
   144
       "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
   145
       "\<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
   146
               \<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
   147
                         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
   148
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
   149
  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
   150
  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
   151
  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
   152
  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
   153
  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
   154
  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
   155
  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
   156
    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
   157
    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
   158
      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
   159
    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
   160
      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
   161
      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
   162
        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
   163
    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
   164
      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
   165
      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
   166
        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
   167
      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
   168
        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
   169
      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
   170
        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
   171
      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
   172
        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
   173
        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
   174
        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
   175
        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
   176
          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
   177
        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
   178
          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
   179
        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
   180
          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
   181
                    \<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
   182
          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
   183
        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
   184
        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
   185
                    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
   186
          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
   187
        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
   188
          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
   189
            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
   190
          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
   191
                          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
   192
            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
   193
            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
   194
          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
   195
          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
   196
            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
   197
            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
   198
            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
   199
              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
   200
              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
   201
              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
   202
                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
   203
              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
   204
                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
   205
              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
   206
                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
   207
                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
   208
              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
   209
            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
   210
            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
   211
              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
   212
            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
   213
              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
   214
              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
   215
          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
   216
        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
   217
        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
   218
          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
   219
          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
   220
          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
   221
        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
   222
             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
   223
          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
   224
        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
   225
        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
   226
          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
   227
        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
   228
          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
   229
          "\<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
   230
          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
   231
          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
   232
          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
   233
        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
   234
          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
   235
        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
   236
        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
   237
          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
   238
            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
   239
            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
   240
          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
   241
            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
   242
          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
   243
            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
   244
              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
   245
            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
   246
              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
   247
          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
   248
          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
   249
            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
   250
          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
   251
            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
   252
          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
   253
            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
   254
          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
   255
            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
   256
            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
   257
              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
   258
          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
   259
            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
   260
            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
   261
              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
   262
            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
   263
              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
   264
                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
   265
              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
   266
                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
   267
              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
   268
                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
   269
              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
   270
                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
   271
              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
   272
                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
   273
                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
   274
                  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
   275
                    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
   276
                  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
   277
                    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
   278
                  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
   279
                    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
   280
                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
   281
                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
   282
                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
   283
                  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
   284
                    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
   285
                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
   286
                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
   287
                  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
   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
            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
   290
            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
   291
              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
   292
          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
   293
          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
   294
            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
   295
            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
   296
            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
   297
          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
   298
            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
   299
          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
   300
          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
   301
          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
   302
            "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
   303
          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
   304
            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
   305
              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
   306
            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
   307
              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
   308
              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
   309
              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
   310
              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
   311
              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
   312
              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
   313
            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
   314
              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
   315
          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
   316
          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
   317
            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
   318
            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
   319
            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
   320
          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
   321
          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
   322
          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
   323
            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
   324
              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
   325
            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
   326
              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
   327
            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
   328
              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
   329
            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
   330
              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
   331
            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
   332
              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
   333
            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
   334
              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
   335
                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
   336
              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
   337
                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
   338
              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
   339
                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
   340
              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
   341
                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
   342
                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
   343
              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
   344
                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
   345
            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
   346
            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
   347
              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
   348
            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
   349
            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
   350
              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
   351
                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: 73536
diff changeset
   352
                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
   353
            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
   354
ae37b8fbf023 New theory Equivalence_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
            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
   356
              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
   357
            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
   358
                = 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
   359
              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
   360
            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
   361
              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
   362
                  = 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
   363
                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
   364
              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
   365
                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
   366
            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
   367
            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
   368
              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
   369
              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
   370
                  \<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
   371
                  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
   372
            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
   373
            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
   374
              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
   375
                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
   376
              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
   377
                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
   378
              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
   379
              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
   380
                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
   381
                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
   382
                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
   383
                  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
   384
                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
   385
                  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
   386
                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
   387
                  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
   388
                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
   389
                  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
   390
                  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
   391
                  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
   392
                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: 70760
diff changeset
   393
                  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
   394
                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
   395
                        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
   396
                  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
   397
              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
   398
              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
   399
              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
   400
                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
   401
                  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
   402
                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
   403
                  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
   404
                    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
   405
                    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
   406
                    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
   407
                  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
   408
                    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
   409
                  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
   410
                    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
   411
                  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
   412
                    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
   413
                      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
   414
                    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
   415
                      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
   416
                    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
   417
                      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
   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
                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
   420
                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
   421
                  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
   422
              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
   423
              finally show ?thesis
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
   424
                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
   425
          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
   426
            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
   427
          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
   428
          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
   429
          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
   430
          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
   431
            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
   432
              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
   433
            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
   434
            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
   435
              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
   436
              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
   437
              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
   438
                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
   439
              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
   440
                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
   441
            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
   442
            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
   443
              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
   444
            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
   445
              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
   446
            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
   447
              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
   448
          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
   449
          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
   450
          have "measure lebesgue (\<Union>\<F>) \<le> e/2"
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
   451
            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
   452
          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
   453
            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
   454
        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
   455
      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
   456
    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
   457
    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
   458
      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
   459
      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
   460
    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
   461
      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
   462
    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
   463
    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
   464
      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
   465
      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
   466
        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
   467
      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
   468
        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
   469
      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
   470
        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
   471
        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
   472
        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
   473
    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
   474
    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
   475
      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
   476
    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
   477
      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
   478
  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
   479
  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
   480
    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
   481
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
   482
ae37b8fbf023 New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   483
ae37b8fbf023 New theory Equivalence_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
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
   485
ae37b8fbf023 New theory Equivalence_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
definition measurable_on :: "('a::euclidean_space \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> 'a set \<Rightarrow> bool"
ae37b8fbf023 New theory Equivalence_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
  (infixr "measurable'_on" 46)
ae37b8fbf023 New theory Equivalence_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
  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
   489
        \<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
   490
              (\<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
   491
              (\<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
   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_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
   494
  "(\<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
   495
  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
   496
ae37b8fbf023 New theory Equivalence_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
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
   498
  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
   499
  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
   500
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
   501
  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
   502
    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
   503
      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
   504
      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
   505
    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
   506
  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
   507
    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
   508
  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
   509
    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
   510
      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
   511
    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
   512
      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
   513
    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
   514
      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
   515
      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
   516
  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
   517
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
   518
ae37b8fbf023 New theory Equivalence_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
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
   520
ae37b8fbf023 New theory Equivalence_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
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
   522
  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
   523
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
   524
  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
   525
    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
   526
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
   527
ae37b8fbf023 New theory Equivalence_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
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
   529
  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
   530
  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
   531
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
   532
  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
   533
    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
   534
      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
   535
      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
   536
    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
   537
  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
   538
    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
   539
  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
   540
    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
   541
      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
   542
    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
   543
      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
   544
      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
   545
  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
   546
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
   547
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
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
   550
  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
   551
  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
   552
  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
   553
  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
   554
ae37b8fbf023 New theory Equivalence_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
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
   556
  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
   557
  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
   558
  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
   559
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
   560
  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
   561
  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
   562
    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
   563
    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
   564
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
   565
ae37b8fbf023 New theory Equivalence_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
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
   568
   "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
   569
  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
   570
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
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
   573
   "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
   574
  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
   575
  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
   576
  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
   577
  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
   578
ae37b8fbf023 New theory Equivalence_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
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
   580
  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
   581
  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
   582
  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
   583
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
   584
  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
   585
  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
   586
  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
   587
    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
   588
            \<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
   589
                  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
   590
    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
   591
  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
   592
    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
   593
  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
   594
    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
   595
    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
   596
      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
   597
        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
   598
        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
   599
      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
   600
        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
   601
        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
   602
          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
   603
        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
   604
          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
   605
        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
   606
          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
   607
        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
   608
          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
   609
                           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
   610
                           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
   611
                          \<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
   612
          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
   613
        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
   614
        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
   615
          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
   616
            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
   617
          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
   618
            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
   619
          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
   620
            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
   621
              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
   622
            have le1: "inverse (1 + real n) \<le> 1"
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
   623
              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
   624
            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
   625
                - 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
   626
                < 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
   627
            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
   628
              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
   629
                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
   630
              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
   631
              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
   632
                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
   633
                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
   634
                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
   635
                  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
   636
                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
   637
                  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
   638
                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
   639
                                "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
   640
                  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
   641
              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
   642
              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
   643
                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
   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
            then show ?thesis
70802
160eaf566bcb formally augmented corresponding rules for field_simps
haftmann
parents: 70760
diff changeset
   646
              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
   647
          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
   648
        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
   649
      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
   650
    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
   651
    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
   652
      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
   653
    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
   654
      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
   655
      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
   656
    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
   657
      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
   658
        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
   659
      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
   660
        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
   661
          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
   662
              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
   663
          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
   664
        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
   665
          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
   666
        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
   667
        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
   668
          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
   669
            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
   670
          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
   671
            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
   672
              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
   673
            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
   674
              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
   675
              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
   676
              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
   677
              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
   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
      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
   681
    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
   682
  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
   683
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
   684
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
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
   687
ae37b8fbf023 New theory Equivalence_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
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
   689
   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
   690
   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
   691
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
   692
  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
   693
    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
   694
      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
   695
      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
   696
    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
   697
  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
   698
    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
   699
  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
   700
    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
   701
      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
   702
    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
   703
      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
   704
    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
   705
      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
   706
      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
   707
  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
   708
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
   709
ae37b8fbf023 New theory Equivalence_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
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
   711
   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
   712
   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
   713
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
   714
  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
   715
    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
   716
  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
   717
    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
   718
    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
   719
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
   720
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
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
   723
  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
   724
    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
   725
  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
   726
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
   727
  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
   728
    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
   729
      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
   730
      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
   731
    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
   732
  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
   733
    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
   734
                                            (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
   735
                                                 (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
   736
    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
   737
      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
   738
    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
   739
      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
   740
    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
   741
    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
   742
      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
   743
        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
   744
        apply (intro continuous_on_compose2 [OF contg] continuous_intros conth)
71633
07bec530f02e cleaned proofs
nipkow
parents: 70817
diff changeset
   745
        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
   746
        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
   747
      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
   748
        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
   749
        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
   750
      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
   751
        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
   752
          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
   753
        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
   754
          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
   755
        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
   756
          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
   757
          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
   758
          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
   759
            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
   760
          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
   761
            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
   762
          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
   763
            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
   764
          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
   765
            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
   766
        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
   767
        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
7181130f5872 more default simp rules
haftmann
parents: 73536
diff changeset
   768
          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
   769
        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
   770
          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
   771
        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
   772
      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
   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
  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
   775
  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
   776
    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
   777
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
   778
ae37b8fbf023 New theory Equivalence_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
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
   780
  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
   781
  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
   782
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
   783
  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
   784
    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
   785
      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
   786
      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
   787
    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
   788
  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
   789
    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
   790
      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
   791
      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
   792
    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
   793
  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
   794
    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
   795
  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
   796
    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
   797
      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
   798
    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
   799
      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
   800
    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
   801
      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
   802
      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
   803
      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
   804
  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
   805
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
   806
ae37b8fbf023 New theory Equivalence_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
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
   808
  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
   809
    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
   810
  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
   811
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
   812
  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
   813
    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
   814
  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
   815
    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
   816
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
   817
ae37b8fbf023 New theory Equivalence_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
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
   819
  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
   820
  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
   821
  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
   822
ae37b8fbf023 New theory Equivalence_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
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
   824
  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
   825
  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
   826
  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
   827
ae37b8fbf023 New theory Equivalence_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
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
   829
  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
   830
  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
   831
  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
   832
ae37b8fbf023 New theory Equivalence_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
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
   834
  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
   835
  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
   836
  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
   837
ae37b8fbf023 New theory Equivalence_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
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
   839
  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
   840
  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
   841
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
   842
  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
   843
    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
   844
      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
   845
      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
   846
    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
   847
  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
   848
    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
   849
  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
   850
    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
   851
      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
   852
    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
   853
      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
   854
  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
   855
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
   856
ae37b8fbf023 New theory Equivalence_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
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
   858
  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
   859
  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
   860
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
   861
  { 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
   862
    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
   863
    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
   864
      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
   865
    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
   866
      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
   867
    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
   868
      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
   869
    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
   870
      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
   871
    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
   872
      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
   873
    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
   874
      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
   875
    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
   876
      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
   877
    have 1: "continuous_on (T \<union> -U) (indicat_real S)"
73536
5131c388a9b0 simplified definition
haftmann
parents: 71633
diff changeset
   878
      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
   879
    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
   880
      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
   881
        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
   882
      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
   883
        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
   884
      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
   885
        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
   886
    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
   887
    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
   888
      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
   889
    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
   890
      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
   891
    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
   892
                        (\<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
   893
      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
   894
      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
   895
      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
   896
  }
ae37b8fbf023 New theory Equivalence_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
  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
   898
    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
   899
    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
   900
    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
   901
    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
   902
    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
   903
  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
   904
  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
   905
    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
   906
      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
   907
    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
   908
    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
   909
      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
   910
        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
   911
    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
   912
  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
   913
  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
   914
  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
   915
    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
   916
      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
   917
    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
   918
      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
   919
      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
   920
  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
   921
  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
   922
    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
   923
  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
   924
    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
   925
      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
   926
    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
   927
      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
   928
  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
   929
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
   930
ae37b8fbf023 New theory Equivalence_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
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
   932
  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
   933
  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
   934
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
   935
  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
   936
    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
   937
  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
   938
    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
   939
    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
   940
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
   941
ae37b8fbf023 New theory Equivalence_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
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
   943
  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
   944
ae37b8fbf023 New theory Equivalence_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
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
   946
  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
   947
ae37b8fbf023 New theory Equivalence_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
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
   949
  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
   950
  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
   951
  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
   952
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
   953
  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
   954
    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
   955
  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
   956
     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
   957
      (\<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
   958
         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
   959
    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
   960
    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
   961
    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
   962
  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
   963
      = 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
   964
            (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
   965
    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
   966
  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
   967
                   (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
   968
    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
   969
  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
   970
    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
   971
    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
   972
  finally show ?thesis
73536
5131c388a9b0 simplified definition
haftmann
parents: 71633
diff changeset
   973
    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
   974
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
   975
ae37b8fbf023 New theory Equivalence_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
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
   977
    [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
   978
  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
   979
  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
   980
  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
   981
  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
   982
  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
   983
  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
   984
  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
   985
  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
   986
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
   987
  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
   988
  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
   989
    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
   990
    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
   991
    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
   992
      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
   993
  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
   994
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
   995
  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
   996
    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
   997
  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
   998
  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
   999
    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
  1000
    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
  1001
      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
  1002
  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
  1003
    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
  1004
    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
  1005
            = (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
  1006
    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
  1007
      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
  1008
      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
  1009
        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
  1010
      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
  1011
        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
  1012
    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
  1013
    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
  1014
    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
  1015
      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
  1016
        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
  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
    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
  1019
      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
  1020
      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
  1021
  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
  1022
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
  1023
  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
  1024
    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
  1025
    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
  1026
    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
  1027
    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
  1028
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
  1029
ae37b8fbf023 New theory Equivalence_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
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
  1031
  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
  1032
  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
  1033
  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
  1034
  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
  1035
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
  1036
  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
  1037
  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
  1038
    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
  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 (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
  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 (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
  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: 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
  1045
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
  1046
  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
  1047
  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
  1048
    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
  1049
  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
  1050
  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
  1051
    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
  1052
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
  1053
ae37b8fbf023 New theory Equivalence_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
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
  1055
  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
  1056
  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
  1057
  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
  1058
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
  1059
  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
  1060
    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
  1061
  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
  1062
    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
  1063
  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
  1064
    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
  1065
  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
  1066
  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
  1067
    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
  1068
           = (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
  1069
      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
  1070
    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
  1071
      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
  1072
  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
  1073
  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
  1074
  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
  1075
    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
  1076
    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
  1077
      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
  1078
  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
  1079
    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
  1080
    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
  1081
      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
  1082
    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
  1083
      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
  1084
  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
  1085
  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
  1086
    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
  1087
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
  1088
ae37b8fbf023 New theory Equivalence_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
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
  1090
  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
  1091
  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
  1092
  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
  1093
  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
  1094
ae37b8fbf023 New theory Equivalence_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
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
  1096
  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
  1097
  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
  1098
  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
  1099
  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
  1100
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
  1101
  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
  1102
    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
  1103
      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
  1104
      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
  1105
    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
  1106
  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
  1107
    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
  1108
      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
  1109
      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
  1110
    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
  1111
  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
  1112
    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
  1113
  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
  1114
    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
  1115
      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
  1116
    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
  1117
      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
  1118
      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
  1119
  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
  1120
  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
  1121
    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
  1122
  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
  1123
    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
  1124
      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
  1125
    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
  1126
      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
  1127
      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
  1128
  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
  1129
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
  1130
ae37b8fbf023 New theory Equivalence_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
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
  1132
  "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
  1133
  (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
  1134
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
  1135
  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
  1136
  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
  1137
  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
  1138
    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
  1139
    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
  1140
    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
  1141
      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
  1142
    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
  1143
      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
  1144
      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
  1145
  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
  1146
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
  1147
  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
  1148
  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
  1149
              (\<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
  1150
              (\<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
  1151
    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
  1152
    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
  1153
  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
  1154
        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
  1155
        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
  1156
    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
  1157
  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
  1158
    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
  1159
  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
  1160
    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
  1161
      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
  1162
    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
  1163
      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
  1164
  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
  1165
    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
  1166
    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
  1167
    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
  1168
      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
  1169
    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
  1170
      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
  1171
    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
  1172
      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
  1173
  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
  1174
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
  1175
ae37b8fbf023 New theory Equivalence_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
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
  1177
  "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
  1178
  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
  1179
  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
  1180
  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
  1181
  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
  1182
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
(*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
  1185
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
  1186
  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
  1187
  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
  1188
  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
  1189
             (\<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
  1190
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
  1191
  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
  1192
    "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
  1193
ae37b8fbf023 New theory Equivalence_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
  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
  1195
    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
  1196
ae37b8fbf023 New theory Equivalence_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
  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
  1198
    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
  1199
ae37b8fbf023 New theory Equivalence_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
  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
  1201
    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
  1202
  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
  1203
    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
  1204
ae37b8fbf023 New theory Equivalence_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
  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
  1206
    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
  1207
ae37b8fbf023 New theory Equivalence_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
  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
  1209
  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
  1210
    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
  1211
    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
  1212
    { 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
  1213
      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
  1214
        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
  1215
      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
  1216
        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
  1217
           (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
  1218
      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
  1219
        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
  1220
        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
  1221
    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
  1222
      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
  1223
  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
  1224
  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
  1225
    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
  1226
  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
  1227
  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
  1228
  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
  1229
    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
  1230
      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
  1231
    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
  1232
      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
  1233
    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
  1234
      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
  1235
    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
  1236
      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
  1237
  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
  1238
  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
  1239
  { 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
  1240
    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
  1241
    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
  1242
      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
  1243
      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
  1244
        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
  1245
      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
  1246
      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
  1247
        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
  1248
          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
  1249
        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
  1250
          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
  1251
        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
  1252
          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
  1253
          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
  1254
        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
  1255
          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
  1256
      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
  1257
      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
  1258
        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
  1259
      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
  1260
      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
  1261
        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
  1262
    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
  1263
  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
  1264
    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
  1265
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
  1266
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
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
  1269
  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
  1270
  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
  1271
  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
  1272
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
  1273
  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
  1274
    using assms
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
  1275
    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
  1276
  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
  1277
    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
  1278
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
  1279
ae37b8fbf023 New theory Equivalence_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
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
  1281
  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
  1282
  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
  1283
  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
  1284
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
  1285
  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
  1286
    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
  1287
  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
  1288
                   (\<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
  1289
                   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
  1290
                   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
  1291
    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
  1292
    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
  1293
  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
  1294
              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
  1295
              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
  1296
              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
  1297
    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
  1298
  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
  1299
  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
  1300
  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
  1301
    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
  1302
  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
  1303
    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
  1304
      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
  1305
    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
  1306
      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
  1307
    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
  1308
      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
  1309
    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
  1310
      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
  1311
    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
  1312
      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
  1313
        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
  1314
    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
  1315
    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
  1316
      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
  1317
      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
  1318
  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
  1319
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
  1320
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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 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
  1324
    \<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
  1325
  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
  1326
ae37b8fbf023 New theory Equivalence_Measurable_On_Borel, with the HOL Light notion of measurable_on and its equivalence to ours
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1327
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
  1328
  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
  1329
  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
  1330
  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: 70694
diff changeset
  1331
  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
  1332
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
  1333
  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
  1334
    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: 70694
diff changeset
  1335
  proof -
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1336
    have "N \<inter> S = N"
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1337
      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: 70694
diff changeset
  1338
    moreover have "N \<inter> S \<in> sets lebesgue"
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1339
      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: 70694
diff changeset
  1340
    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: 70694
diff changeset
  1341
      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: 70694
diff changeset
  1342
    ultimately show ?thesis
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1343
      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: 70694
diff changeset
  1344
  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
  1345
  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
  1346
    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: 70694
diff changeset
  1347
  proof -
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1348
    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: 70694
diff changeset
  1349
      by blast
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1350
    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: 70694
diff changeset
  1351
      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: 70694
diff changeset
  1352
    then show ?thesis
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1353
      by (simp add: inf.commute sets_restrict_space)
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1354
  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
  1355
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
  1356
ae37b8fbf023 New theory Equivalence_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
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
  1358
  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
  1359
  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
  1360
  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
  1361
  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
  1362
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
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
  1366
  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
  1367
  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
  1368
  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
  1369
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
  1370
  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
  1371
    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
  1372
      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
  1373
      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
  1374
    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
  1375
  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
  1376
  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
  1377
    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
  1378
    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
  1379
      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
  1380
        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
  1381
      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
  1382
        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
  1383
        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
  1384
    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
  1385
    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
  1386
      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
  1387
  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
  1388
  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
  1389
    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
  1390
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
  1391
ae37b8fbf023 New theory Equivalence_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
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
  1393
  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
  1394
  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
  1395
  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
  1396
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
  1397
  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
  1398
    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
  1399
  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
  1400
    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
  1401
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
  1402
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
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
  1405
  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
  1406
  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
  1407
    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
  1408
  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
  1409
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
  1410
  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
  1411
    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
  1412
  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
  1413
                  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
  1414
                  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
  1415
                  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
  1416
                  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
  1417
                  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
  1418
    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
  1419
  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
  1420
  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
  1421
    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
  1422
      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
  1423
    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
  1424
      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
  1425
    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
  1426
    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
  1427
      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
  1428
        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
  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
    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
  1431
      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
  1432
    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
  1433
  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
  1434
  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
  1435
    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
  1436
  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
  1437
  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
  1438
    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
  1439
    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
  1440
    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
  1441
    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
  1442
      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
  1443
      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
  1444
        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
  1445
        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
  1446
          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
  1447
            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
  1448
          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
  1449
            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
  1450
          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
  1451
            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
  1452
            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
  1453
          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
  1454
          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
  1455
            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
  1456
            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
  1457
              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
  1458
                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
  1459
              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
  1460
                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
  1461
                  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
  1462
                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
  1463
                  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
  1464
              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
  1465
              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
  1466
                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
  1467
              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
  1468
                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
  1469
            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
  1470
            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
  1471
              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
  1472
            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
  1473
              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
  1474
              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
  1475
          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
  1476
        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
  1477
        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
  1478
          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
  1479
        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
  1480
          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
  1481
        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
  1482
          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
  1483
      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
  1484
    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
  1485
    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
  1486
      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
  1487
    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
  1488
      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
  1489
  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
  1490
  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
  1491
    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
  1492
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
  1493
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
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
  1496
  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
  1497
  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
  1498
   \<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
  1499
  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
  1500
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
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
  1503
  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
  1504
  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
  1505
  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
  1506
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
  1507
  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
  1508
    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
  1509
    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
  1510
    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
  1511
  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
  1512
    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
  1513
  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
  1514
    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
  1515
      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
  1516
    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
  1517
      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
  1518
    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
  1519
    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
  1520
      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
  1521
        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
  1522
        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
  1523
      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
  1524
        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
  1525
    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
  1526
  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
  1527
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
  1528
ae37b8fbf023 New theory Equivalence_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
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
  1530
  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
  1531
  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
  1532
  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
  1533
  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
  1534
  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
  1535
  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
  1536
ae37b8fbf023 New theory Equivalence_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
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
  1538
  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
  1539
  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
  1540
  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
  1541
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
  1542
  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
  1543
  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
  1544
  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
  1545
    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
  1546
  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
  1547
    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
  1548
  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
  1549
    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
  1550
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
  1551
ae37b8fbf023 New theory Equivalence_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
ae37b8fbf023 New theory Equivalence_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
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
  1554
  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
  1555
  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
  1556
  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
  1557
  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
  1558
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
  1559
  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
  1560
  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
  1561
  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
  1562
    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
  1563
  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
  1564
    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
  1565
  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
  1566
    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
  1567
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
  1568
ae37b8fbf023 New theory Equivalence_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
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
  1570
  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
  1571
  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
  1572
  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
  1573
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
  1574
  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
  1575
    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
  1576
    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
  1577
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
  1578
  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
  1579
  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
  1580
    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
  1581
  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
  1582
    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
  1583
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
  1584
70707
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1585
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: 70707
diff changeset
  1586
70707
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1587
lemma measurable_on_bilinear:
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1588
  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: 70694
diff changeset
  1589
  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: 70694
diff changeset
  1590
  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: 70694
diff changeset
  1591
proof (rule measurable_on_combine [where h = h])
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1592
  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: 70694
diff changeset
  1593
    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: 70694
diff changeset
  1594
  show "h 0 0 = 0"
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1595
  by (simp add: bilinear_lzero h)
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1596
qed (auto intro: assms)
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1597
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1598
lemma borel_measurable_bilinear:
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1599
  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: 70694
diff changeset
  1600
  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: 70694
diff changeset
  1601
    and S: "S \<in> sets lebesgue"
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1602
  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: 70694
diff changeset
  1603
  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: 70694
diff changeset
  1604
  by (simp flip: measurable_on_iff_borel_measurable)
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1605
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1606
lemma absolutely_integrable_bounded_measurable_product:
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1607
  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: 70694
diff changeset
  1608
  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: 70694
diff changeset
  1609
    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: 70694
diff changeset
  1610
  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: 70694
diff changeset
  1611
proof -
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1612
  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: 70694
diff changeset
  1613
    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: 70694
diff changeset
  1614
  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: 70694
diff changeset
  1615
    using bounded_pos by (metis bou imageI)
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1616
  show ?thesis
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1617
  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: 70694
diff changeset
  1618
    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: 70694
diff changeset
  1619
      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: 70694
diff changeset
  1620
    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: 70694
diff changeset
  1621
      using \<open>bilinear h\<close> f g
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1622
      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: 70694
diff changeset
  1623
    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: 70694
diff changeset
  1624
      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: 70694
diff changeset
  1625
  qed
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1626
qed
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1627
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1628
lemma absolutely_integrable_bounded_measurable_product_real:
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1629
  fixes f :: "real \<Rightarrow> real"
125705f5965f A little-known material, and some tidying up
paulson <lp15@cam.ac.uk>
parents: 70694
diff changeset
  1630
  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: 70694
diff changeset
  1631
      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: 70694
diff changeset
  1632
  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: 70694
diff changeset
  1633
  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: 70694
diff changeset
  1634
70721
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1635
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1636
lemma borel_measurable_AE:
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1637
  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: 70707
diff changeset
  1638
  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: 70707
diff changeset
  1639
  shows "g \<in> borel_measurable lebesgue"
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1640
proof -
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1641
  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: 70707
diff changeset
  1642
    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: 70707
diff changeset
  1643
  have "f measurable_on UNIV"
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1644
    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: 70707
diff changeset
  1645
  then have "g measurable_on UNIV"
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1646
    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: 70707
diff changeset
  1647
  then show ?thesis
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1648
    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: 70707
diff changeset
  1649
qed
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1650
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1651
lemma has_bochner_integral_combine:
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1652
  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: 70707
diff changeset
  1653
  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: 70707
diff changeset
  1654
    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: 70707
diff changeset
  1655
    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: 70707
diff changeset
  1656
  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: 70707
diff changeset
  1657
proof -
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1658
  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: 70707
diff changeset
  1659
   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: 70707
diff changeset
  1660
    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: 70707
diff changeset
  1661
  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: 70707
diff changeset
  1662
  proof (rule AE_I')
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1663
    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: 70707
diff changeset
  1664
      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: 70707
diff changeset
  1665
    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: 70707
diff changeset
  1666
      by auto
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1667
  qed auto
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1668
  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: 70707
diff changeset
  1669
  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: 70707
diff changeset
  1670
    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: 70707
diff changeset
  1671
      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: 70707
diff changeset
  1672
    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: 70707
diff changeset
  1673
    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: 70707
diff changeset
  1674
      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: 70707
diff changeset
  1675
           "(\<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: 70707
diff changeset
  1676
        using i j by auto
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1677
    qed
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1678
  qed
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1679
  then show ?thesis
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1680
    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: 70707
diff changeset
  1681
qed
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1682
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1683
lemma integrable_combine:
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1684
  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: 70707
diff changeset
  1685
  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: 70707
diff changeset
  1686
    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: 70707
diff changeset
  1687
  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: 70707
diff changeset
  1688
  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: 70707
diff changeset
  1689
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1690
lemma integral_combine:
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1691
  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: 70707
diff changeset
  1692
  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: 70707
diff changeset
  1693
  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: 70707
diff changeset
  1694
proof -
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1695
  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: 70707
diff changeset
  1696
    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: 70707
diff changeset
  1697
  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: 70707
diff changeset
  1698
    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: 70707
diff changeset
  1699
  show ?thesis
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1700
    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: 70707
diff changeset
  1701
qed
47258727fa42 A few new theorems, tidying up and deletion of obsolete material
paulson <lp15@cam.ac.uk>
parents: 70707
diff changeset
  1702
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: 70721
diff changeset
  1703
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: 70721
diff changeset
  1704
  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: 70721
diff changeset
  1705
  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: 70721
diff changeset
  1706
  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: 70721
diff changeset
  1707
  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: 70721
diff changeset
  1708
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: 70721
diff changeset
  1709
  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: 70721
diff changeset
  1710
  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: 70721
diff changeset
  1711
    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: 70721
diff changeset
  1712
      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: 70721
diff changeset
  1713
    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: 70721
diff changeset
  1714
    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: 70721
diff changeset
  1715
      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: 70721
diff changeset
  1716
        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: 70721
diff changeset
  1717
      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: 70721
diff changeset
  1718
        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: 70721
diff changeset
  1719
        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: 70721
diff changeset
  1720
      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: 70721
diff changeset
  1721
        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: 70721
diff changeset
  1722
    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: 70721
diff changeset
  1723
  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: 70721
diff changeset
  1724
  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: 70721
diff changeset
  1725
  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: 70721
diff changeset
  1726
    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: 70721
diff changeset
  1727
      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: 70721
diff changeset
  1728
  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: 70721
diff changeset
  1729
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: 70721
diff changeset
  1730
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: 70721
diff changeset
  1731
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: 70721
diff changeset
  1732
  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: 70721
diff changeset
  1733
  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: 70721
diff changeset
  1734
  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: 70721
diff changeset
  1735
  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: 70721
diff changeset
  1736
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
  1737
end