src/HOL/Finite_Set.thy
changeset 36079 fa0e354e6a39
parent 36045 b846881928ea
child 36176 3fe7e97ccca8
equal deleted inserted replaced
36078:59f6773a7d1d 36079:fa0e354e6a39
  2043   "\<lbrakk> x \<notin> F; \<forall>c1 \<in> insert x F. \<forall>c2 \<in> insert x F. c1 \<noteq> c2 \<longrightarrow> c1 \<inter> c2 = {} \<rbrakk>
  2043   "\<lbrakk> x \<notin> F; \<forall>c1 \<in> insert x F. \<forall>c2 \<in> insert x F. c1 \<noteq> c2 \<longrightarrow> c1 \<inter> c2 = {} \<rbrakk>
  2044   \<Longrightarrow> x \<inter> \<Union> F = {}"
  2044   \<Longrightarrow> x \<inter> \<Union> F = {}"
  2045 by auto
  2045 by auto
  2046 
  2046 
  2047 lemma finite_psubset_induct[consumes 1, case_names psubset]:
  2047 lemma finite_psubset_induct[consumes 1, case_names psubset]:
  2048   assumes "finite A" and "!!A. finite A \<Longrightarrow> (!!B. finite B \<Longrightarrow> B \<subset> A \<Longrightarrow> P(B)) \<Longrightarrow> P(A)" shows "P A"
  2048   assumes fin: "finite A" 
  2049 using assms(1)
  2049   and     major: "\<And>A. finite A \<Longrightarrow> (\<And>B. B \<subset> A \<Longrightarrow> P B) \<Longrightarrow> P A" 
  2050 proof (induct A rule: measure_induct_rule[where f=card])
  2050   shows "P A"
       
  2051 using fin
       
  2052 proof (induct A taking: card rule: measure_induct_rule)
  2051   case (less A)
  2053   case (less A)
  2052   show ?case
  2054   have fin: "finite A" by fact
  2053   proof(rule assms(2)[OF less(2)])
  2055   have ih: "\<And>B. \<lbrakk>card B < card A; finite B\<rbrakk> \<Longrightarrow> P B" by fact
  2054     fix B assume "finite B" "B \<subset> A"
  2056   { fix B 
  2055     show "P B" by(rule less(1)[OF psubset_card_mono[OF less(2) `B \<subset> A`] `finite B`])
  2057     assume asm: "B \<subset> A"
  2056   qed
  2058     from asm have "card B < card A" using psubset_card_mono fin by blast
       
  2059     moreover
       
  2060     from asm have "B \<subseteq> A" by auto
       
  2061     then have "finite B" using fin finite_subset by blast
       
  2062     ultimately 
       
  2063     have "P B" using ih by simp
       
  2064   }
       
  2065   with fin show "P A" using major by blast
  2057 qed
  2066 qed
  2058 
  2067 
  2059 text{* main cardinality theorem *}
  2068 text{* main cardinality theorem *}
  2060 lemma card_partition [rule_format]:
  2069 lemma card_partition [rule_format]:
  2061   "finite C ==>
  2070   "finite C ==>