diff -r 3d90a96fd6a9 -r 1fee63e0377d src/HOL/Finite_Set.thy --- a/src/HOL/Finite_Set.thy Fri Sep 05 16:09:03 2014 +0100 +++ b/src/HOL/Finite_Set.thy Sat Sep 06 20:12:32 2014 +0200 @@ -456,6 +456,15 @@ show ?thesis by(rule finite_imageD[OF 1 2]) qed +lemma not_finite_existsD: + assumes "\ finite {a. P a}" + shows "\a. P a" +proof (rule classical) + assume "\ (\a. P a)" + with assms show ?thesis by auto +qed + + subsubsection {* Further induction rules on finite sets *} lemma finite_ne_induct [case_names singleton insert, consumes 2]: @@ -523,6 +532,29 @@ then show ?thesis by simp qed +lemma finite_update_induct [consumes 1, case_names const update]: + assumes finite: "finite {a. f a \ c}" + assumes const: "P (\a. c)" + assumes update: "\a b f. finite {a. f a \ c} \ f a = c \ b \ c \ P f \ P (f(a := b))" + shows "P f" +using finite proof (induct "{a. f a \ c}" arbitrary: f) + case empty with const show ?case by simp +next + case (insert a A) + then have "A = {a'. (f(a := c)) a' \ c}" and "f a \ c" + by auto + with `finite A` have "finite {a'. (f(a := c)) a' \ c}" + by simp + have "(f(a := c)) a = c" + by simp + from insert `A = {a'. (f(a := c)) a' \ c}` have "P (f(a := c))" + by simp + with `finite {a'. (f(a := c)) a' \ c}` `(f(a := c)) a = c` `f a \ c` have "P ((f(a := c))(a := f a))" + by (rule update) + then show ?case by simp +qed + + subsection {* Class @{text finite} *} class finite =