src/HOL/Library/Infinite_Set.thy
changeset 59488 8a183caa424d
parent 59000 6eb0725503fc
child 59506 4af607652318
equal deleted inserted replaced
59487:adaa430fc0f7 59488:8a183caa424d
   141   element that is the image of infinitely many domain elements.  In
   141   element that is the image of infinitely many domain elements.  In
   142   particular, any infinite sequence of elements from a finite set
   142   particular, any infinite sequence of elements from a finite set
   143   contains some element that occurs infinitely often.
   143   contains some element that occurs infinitely often.
   144 *}
   144 *}
   145 
   145 
       
   146 lemma inf_img_fin_dom':
       
   147   assumes img: "finite (f ` A)" and dom: "infinite A"
       
   148   shows "\<exists>y \<in> f ` A. infinite (f -` {y} \<inter> A)"
       
   149 proof (rule ccontr)
       
   150   have "A \<subseteq> (\<Union>y\<in>f ` A. f -` {y} \<inter> A)" by auto
       
   151   moreover
       
   152   assume "\<not> ?thesis"
       
   153   with img have "finite (\<Union>y\<in>f ` A. f -` {y} \<inter> A)" by blast
       
   154   ultimately have "finite A" by(rule finite_subset)
       
   155   with dom show False by contradiction
       
   156 qed
       
   157 
       
   158 lemma inf_img_fin_domE':
       
   159   assumes "finite (f ` A)" and "infinite A"
       
   160   obtains y where "y \<in> f`A" and "infinite (f -` {y} \<inter> A)"
       
   161   using assms by (blast dest: inf_img_fin_dom')
       
   162 
   146 lemma inf_img_fin_dom:
   163 lemma inf_img_fin_dom:
   147   assumes img: "finite (f`A)" and dom: "infinite A"
   164   assumes img: "finite (f`A)" and dom: "infinite A"
   148   shows "\<exists>y \<in> f`A. infinite (f -` {y})"
   165   shows "\<exists>y \<in> f`A. infinite (f -` {y})"
   149 proof (rule ccontr)
   166 using inf_img_fin_dom'[OF assms] by auto
   150   assume "\<not> ?thesis"
       
   151   with img have "finite (UN y:f`A. f -` {y})" by blast
       
   152   moreover have "A \<subseteq> (UN y:f`A. f -` {y})" by auto
       
   153   moreover note dom
       
   154   ultimately show False by (simp add: infinite_super)
       
   155 qed
       
   156 
   167 
   157 lemma inf_img_fin_domE:
   168 lemma inf_img_fin_domE:
   158   assumes "finite (f`A)" and "infinite A"
   169   assumes "finite (f`A)" and "infinite A"
   159   obtains y where "y \<in> f`A" and "infinite (f -` {y})"
   170   obtains y where "y \<in> f`A" and "infinite (f -` {y})"
   160   using assms by (blast dest: inf_img_fin_dom)
   171   using assms by (blast dest: inf_img_fin_dom)
   161 
       
   162 
   172 
   163 subsection "Infinitely Many and Almost All"
   173 subsection "Infinitely Many and Almost All"
   164 
   174 
   165 text {*
   175 text {*
   166   We often need to reason about the existence of infinitely many
   176   We often need to reason about the existence of infinitely many