src/HOL/Finite_Set.thy
changeset 51546 2e26df807dc7
parent 51489 f738e6dbd844
child 51598 5dbe537087aa
equal deleted inserted replaced
51545:6f6012f430fc 51546:2e26df807dc7
  1105 definition card :: "'a set \<Rightarrow> nat" where
  1105 definition card :: "'a set \<Rightarrow> nat" where
  1106   "card = folding.F (\<lambda>_. Suc) 0"
  1106   "card = folding.F (\<lambda>_. Suc) 0"
  1107 
  1107 
  1108 interpretation card!: folding "\<lambda>_. Suc" 0
  1108 interpretation card!: folding "\<lambda>_. Suc" 0
  1109 where
  1109 where
  1110   "card.F = card"
  1110   "folding.F (\<lambda>_. Suc) 0 = card"
  1111 proof -
  1111 proof -
  1112   show "folding (\<lambda>_. Suc)" by default rule
  1112   show "folding (\<lambda>_. Suc)" by default rule
  1113   then interpret card!: folding "\<lambda>_. Suc" 0 .
  1113   then interpret card!: folding "\<lambda>_. Suc" 0 .
  1114   show "card.F = card" by (simp only: card_def)
  1114   from card_def show "folding.F (\<lambda>_. Suc) 0 = card" by rule
  1115 qed
  1115 qed
  1116 
  1116 
  1117 lemma card_infinite:
  1117 lemma card_infinite:
  1118   "\<not> finite A \<Longrightarrow> card A = 0"
  1118   "\<not> finite A \<Longrightarrow> card A = 0"
  1119   by (fact card.infinite)
  1119   by (fact card.infinite)