src/HOL/Analysis/Change_Of_Vars.thy
changeset 69313 b021008c5397
parent 69272 15e9ed5b28fb
child 69325 4b6ddc5989fc
equal deleted inserted replaced
69312:e0f68a507683 69313:b021008c5397
   627 
   627 
   628 subsection%important\<open>\<open>F_sigma\<close> and \<open>G_delta\<close> sets.\<close>(*FIX ME mv *)
   628 subsection%important\<open>\<open>F_sigma\<close> and \<open>G_delta\<close> sets.\<close>(*FIX ME mv *)
   629 
   629 
   630 (*https://en.wikipedia.org/wiki/F\<sigma>_set*)
   630 (*https://en.wikipedia.org/wiki/F\<sigma>_set*)
   631 inductive%important fsigma :: "'a::topological_space set \<Rightarrow> bool" where
   631 inductive%important fsigma :: "'a::topological_space set \<Rightarrow> bool" where
   632   "(\<And>n::nat. closed (F n)) \<Longrightarrow> fsigma (UNION UNIV F)"
   632   "(\<And>n::nat. closed (F n)) \<Longrightarrow> fsigma (\<Union>(F ` UNIV))"
   633 
   633 
   634 inductive%important gdelta :: "'a::topological_space set \<Rightarrow> bool" where
   634 inductive%important gdelta :: "'a::topological_space set \<Rightarrow> bool" where
   635   "(\<And>n::nat. open (F n)) \<Longrightarrow> gdelta (INTER UNIV F)"
   635   "(\<And>n::nat. open (F n)) \<Longrightarrow> gdelta (\<Inter>(F ` UNIV))"
   636 
   636 
   637 lemma%important fsigma_Union_compact:
   637 lemma%important fsigma_Union_compact:
   638   fixes S :: "'a::{real_normed_vector,heine_borel} set"
   638   fixes S :: "'a::{real_normed_vector,heine_borel} set"
   639   shows "fsigma S \<longleftrightarrow> (\<exists>F::nat \<Rightarrow> 'a set. range F \<subseteq> Collect compact \<and> S = UNION UNIV F)"
   639   shows "fsigma S \<longleftrightarrow> (\<exists>F::nat \<Rightarrow> 'a set. range F \<subseteq> Collect compact \<and> S = \<Union>(F ` UNIV))"
   640 proof%unimportant safe
   640 proof%unimportant safe
   641   assume "fsigma S"
   641   assume "fsigma S"
   642   then obtain F :: "nat \<Rightarrow> 'a set" where F: "range F \<subseteq> Collect closed" "S = UNION UNIV F"
   642   then obtain F :: "nat \<Rightarrow> 'a set" where F: "range F \<subseteq> Collect closed" "S = \<Union>(F ` UNIV)"
   643     by (meson fsigma.cases image_subsetI mem_Collect_eq)
   643     by (meson fsigma.cases image_subsetI mem_Collect_eq)
   644   then have "\<exists>D::nat \<Rightarrow> 'a set. range D \<subseteq> Collect compact \<and> UNION UNIV D = F i" for i
   644   then have "\<exists>D::nat \<Rightarrow> 'a set. range D \<subseteq> Collect compact \<and> \<Union>(D ` UNIV) = F i" for i
   645     using closed_Union_compact_subsets [of "F i"]
   645     using closed_Union_compact_subsets [of "F i"]
   646     by (metis image_subsetI mem_Collect_eq range_subsetD)
   646     by (metis image_subsetI mem_Collect_eq range_subsetD)
   647   then obtain D :: "nat \<Rightarrow> nat \<Rightarrow> 'a set"
   647   then obtain D :: "nat \<Rightarrow> nat \<Rightarrow> 'a set"
   648     where D: "\<And>i. range (D i) \<subseteq> Collect compact \<and> UNION UNIV (D i) = F i"
   648     where D: "\<And>i. range (D i) \<subseteq> Collect compact \<and> \<Union>((D i) ` UNIV) = F i"
   649     by metis
   649     by metis
   650   let ?DD = "\<lambda>n. (\<lambda>(i,j). D i j) (prod_decode n)"
   650   let ?DD = "\<lambda>n. (\<lambda>(i,j). D i j) (prod_decode n)"
   651   show "\<exists>F::nat \<Rightarrow> 'a set. range F \<subseteq> Collect compact \<and> S = UNION UNIV F"
   651   show "\<exists>F::nat \<Rightarrow> 'a set. range F \<subseteq> Collect compact \<and> S = \<Union>(F ` UNIV)"
   652   proof (intro exI conjI)
   652   proof (intro exI conjI)
   653     show "range ?DD \<subseteq> Collect compact"
   653     show "range ?DD \<subseteq> Collect compact"
   654       using D by clarsimp (metis mem_Collect_eq rangeI split_conv subsetCE surj_pair)
   654       using D by clarsimp (metis mem_Collect_eq rangeI split_conv subsetCE surj_pair)
   655     show "S = UNION UNIV ?DD"
   655     show "S = UNION UNIV ?DD"
   656     proof
   656     proof
   661         using D F  by fastforce
   661         using D F  by fastforce
   662     qed
   662     qed
   663   qed
   663   qed
   664 next
   664 next
   665   fix F :: "nat \<Rightarrow> 'a set"
   665   fix F :: "nat \<Rightarrow> 'a set"
   666   assume "range F \<subseteq> Collect compact" and "S = UNION UNIV F"
   666   assume "range F \<subseteq> Collect compact" and "S = \<Union>(F ` UNIV)"
   667   then show "fsigma (UNION UNIV F)"
   667   then show "fsigma (\<Union>(F ` UNIV))"
   668     by (simp add: compact_imp_closed fsigma.intros image_subset_iff)
   668     by (simp add: compact_imp_closed fsigma.intros image_subset_iff)
   669 qed
   669 qed
   670 
   670 
   671 lemma%unimportant gdelta_imp_fsigma: "gdelta S \<Longrightarrow> fsigma (- S)"
   671 lemma%unimportant gdelta_imp_fsigma: "gdelta S \<Longrightarrow> fsigma (- S)"
   672 proof (induction rule: gdelta.induct)
   672 proof (induction rule: gdelta.induct)
   673   case (1 F)
   673   case (1 F)
   674   have "- INTER UNIV F = (\<Union>i. -(F i))"
   674   have "- \<Inter>(F ` UNIV) = (\<Union>i. -(F i))"
   675     by auto
   675     by auto
   676   then show ?case
   676   then show ?case
   677     by (simp add: fsigma.intros closed_Compl 1)
   677     by (simp add: fsigma.intros closed_Compl 1)
   678 qed
   678 qed
   679 
   679 
   680 lemma%unimportant fsigma_imp_gdelta: "fsigma S \<Longrightarrow> gdelta (- S)"
   680 lemma%unimportant fsigma_imp_gdelta: "fsigma S \<Longrightarrow> gdelta (- S)"
   681 proof (induction rule: fsigma.induct)
   681 proof (induction rule: fsigma.induct)
   682   case (1 F)
   682   case (1 F)
   683   have "- UNION UNIV F = (\<Inter>i. -(F i))"
   683   have "- \<Union>(F ` UNIV) = (\<Inter>i. -(F i))"
   684     by auto
   684     by auto
   685   then show ?case
   685   then show ?case
   686     by (simp add: 1 gdelta.intros open_closed)
   686     by (simp add: 1 gdelta.intros open_closed)
   687 qed
   687 qed
   688 
   688 
   699       using sets_lebesgue_inner_closed [OF assms]
   699       using sets_lebesgue_inner_closed [OF assms]
   700       by (metis divide_pos_pos less_numeral_extra(1) of_nat_0_less_iff zero_less_Suc)
   700       by (metis divide_pos_pos less_numeral_extra(1) of_nat_0_less_iff zero_less_Suc)
   701   }
   701   }
   702   then obtain F where F: "\<And>n::nat. closed (F n) \<and> F n \<subseteq> S \<and> S - F n \<in> lmeasurable \<and> measure lebesgue (S - F n) < 1 / Suc n"
   702   then obtain F where F: "\<And>n::nat. closed (F n) \<and> F n \<subseteq> S \<and> S - F n \<in> lmeasurable \<and> measure lebesgue (S - F n) < 1 / Suc n"
   703     by metis
   703     by metis
   704   let ?C = "UNION UNIV F"
   704   let ?C = "\<Union>(F ` UNIV)"
   705   show thesis
   705   show thesis
   706   proof
   706   proof
   707     show "fsigma ?C"
   707     show "fsigma ?C"
   708       using F by (simp add: fsigma.intros)
   708       using F by (simp add: fsigma.intros)
   709     show "negligible (S - ?C)"
   709     show "negligible (S - ?C)"
  3728   have "?D absolutely_integrable_on C \<and> integral C ?D = b
  3728   have "?D absolutely_integrable_on C \<and> integral C ?D = b
  3729     \<longleftrightarrow> f absolutely_integrable_on (g ` C) \<and> integral (g ` C) f = b"
  3729     \<longleftrightarrow> f absolutely_integrable_on (g ` C) \<and> integral (g ` C) f = b"
  3730     unfolding Ceq
  3730     unfolding Ceq
  3731   proof (rule has_absolute_integral_change_of_variables_compact_family)
  3731   proof (rule has_absolute_integral_change_of_variables_compact_family)
  3732     fix n x
  3732     fix n x
  3733     assume "x \<in> UNION UNIV F"
  3733     assume "x \<in> \<Union>(F ` UNIV)"
  3734     then show "(g has_derivative g' x) (at x within UNION UNIV F)"
  3734     then show "(g has_derivative g' x) (at x within \<Union>(F ` UNIV))"
  3735       using Ceq \<open>C \<union> N = S\<close> der_g has_derivative_within_subset by blast
  3735       using Ceq \<open>C \<union> N = S\<close> der_g has_derivative_within_subset by blast
  3736   next
  3736   next
  3737     have "UNION UNIV F \<subseteq> S"
  3737     have "\<Union>(F ` UNIV) \<subseteq> S"
  3738       using Ceq \<open>C \<union> N = S\<close> by blast
  3738       using Ceq \<open>C \<union> N = S\<close> by blast
  3739     then show "inj_on g (UNION UNIV F)"
  3739     then show "inj_on g (\<Union>(F ` UNIV))"
  3740       using inj by (meson inj_on_subset)
  3740       using inj by (meson inj_on_subset)
  3741   qed (use F in auto)
  3741   qed (use F in auto)
  3742   moreover
  3742   moreover
  3743   have "?D absolutely_integrable_on C \<and> integral C ?D = b
  3743   have "?D absolutely_integrable_on C \<and> integral C ?D = b
  3744     \<longleftrightarrow> ?D absolutely_integrable_on S \<and> integral S ?D = b"
  3744     \<longleftrightarrow> ?D absolutely_integrable_on S \<and> integral S ?D = b"