src/HOL/Hilbert_Choice.thy
changeset 63540 f8652d0534fa
parent 63374 1a474286f315
child 63612 7195acc2fe93
equal deleted inserted replaced
63539:70d4d9e5707b 63540:f8652d0534fa
   315   shows "\<exists>f. inj (f::nat \<Rightarrow> 'a) \<and> range f \<subseteq> S"
   315   shows "\<exists>f. inj (f::nat \<Rightarrow> 'a) \<and> range f \<subseteq> S"
   316   \<comment> \<open>Courtesy of Stephan Merz\<close>
   316   \<comment> \<open>Courtesy of Stephan Merz\<close>
   317 proof -
   317 proof -
   318   define Sseq where "Sseq = rec_nat S (\<lambda>n T. T - {SOME e. e \<in> T})"
   318   define Sseq where "Sseq = rec_nat S (\<lambda>n T. T - {SOME e. e \<in> T})"
   319   define pick where "pick n = (SOME e. e \<in> Sseq n)" for n
   319   define pick where "pick n = (SOME e. e \<in> Sseq n)" for n
   320   { fix n have "Sseq n \<subseteq> S" "\<not> finite (Sseq n)" by (induct n) (auto simp add: Sseq_def inf) }
   320   have *: "Sseq n \<subseteq> S" "\<not> finite (Sseq n)" for n
   321   moreover then have *: "\<And>n. pick n \<in> Sseq n"
   321     by (induct n) (auto simp add: Sseq_def inf)
       
   322   then have **: "\<And>n. pick n \<in> Sseq n"
   322     unfolding pick_def by (subst (asm) finite.simps) (auto simp add: ex_in_conv intro: someI_ex)
   323     unfolding pick_def by (subst (asm) finite.simps) (auto simp add: ex_in_conv intro: someI_ex)
   323   ultimately have "range pick \<subseteq> S" by auto
   324   with * have "range pick \<subseteq> S" by auto
   324   moreover
   325   moreover
   325   { fix n m
   326   {
   326     have "pick n \<notin> Sseq (n + Suc m)" by (induct m) (auto simp add: Sseq_def pick_def)
   327     fix n m
   327     with * have "pick n \<noteq> pick (n + Suc m)" by auto
   328     have "pick n \<notin> Sseq (n + Suc m)"
       
   329       by (induct m) (auto simp add: Sseq_def pick_def)
       
   330     with ** have "pick n \<noteq> pick (n + Suc m)" by auto
   328   }
   331   }
   329   then have "inj pick" by (intro linorder_injI) (auto simp add: less_iff_Suc_add)
   332   then have "inj pick" by (intro linorder_injI) (auto simp add: less_iff_Suc_add)
   330   ultimately show ?thesis by blast
   333   ultimately show ?thesis by blast
   331 qed
   334 qed
   332 
   335