src/HOL/ex/set.thy
changeset 34055 fdf294ee08b2
parent 33057 764547b68538
child 36319 8feb2c4bef1a
equal deleted inserted replaced
34054:8e07304ecd0c 34055:fdf294ee08b2
   203 text {* The paper has no Example 10! *}
   203 text {* The paper has no Example 10! *}
   204 
   204 
   205 lemma "(\<forall>A. 0 \<in> A \<and> (\<forall>x \<in> A. Suc x \<in> A) \<longrightarrow> n \<in> A) \<and>
   205 lemma "(\<forall>A. 0 \<in> A \<and> (\<forall>x \<in> A. Suc x \<in> A) \<longrightarrow> n \<in> A) \<and>
   206   P 0 \<and> (\<forall>x. P x \<longrightarrow> P (Suc x)) \<longrightarrow> P n"
   206   P 0 \<and> (\<forall>x. P x \<longrightarrow> P (Suc x)) \<longrightarrow> P n"
   207   -- {* Example 11: needs a hint. *}
   207   -- {* Example 11: needs a hint. *}
   208   apply clarify
   208 by(metis Nat.induct)
   209   apply (drule_tac x = "{x. P x}" in spec)
       
   210   apply force
       
   211   done
       
   212 
   209 
   213 lemma
   210 lemma
   214   "(\<forall>A. (0, 0) \<in> A \<and> (\<forall>x y. (x, y) \<in> A \<longrightarrow> (Suc x, Suc y) \<in> A) \<longrightarrow> (n, m) \<in> A)
   211   "(\<forall>A. (0, 0) \<in> A \<and> (\<forall>x y. (x, y) \<in> A \<longrightarrow> (Suc x, Suc y) \<in> A) \<longrightarrow> (n, m) \<in> A)
   215     \<and> P n \<longrightarrow> P m"
   212     \<and> P n \<longrightarrow> P m"
   216   -- {* Example 12. *}
   213   -- {* Example 12. *}
   221     (\<exists>A. \<forall>x. (x \<in> A) = (Suc x \<notin> A))"
   218     (\<exists>A. \<forall>x. (x \<in> A) = (Suc x \<notin> A))"
   222   -- {* Example EO1: typo in article, and with the obvious fix it seems
   219   -- {* Example EO1: typo in article, and with the obvious fix it seems
   223       to require arithmetic reasoning. *}
   220       to require arithmetic reasoning. *}
   224   apply clarify
   221   apply clarify
   225   apply (rule_tac x = "{x. \<exists>u. x = 2 * u}" in exI, auto)
   222   apply (rule_tac x = "{x. \<exists>u. x = 2 * u}" in exI, auto)
   226    apply (case_tac v, auto)
   223    apply metis+
   227   apply (drule_tac x = "Suc v" and P = "\<lambda>x. ?a x \<noteq> ?b x" in spec, force)
       
   228   done
   224   done
   229 
   225 
   230 end
   226 end