--- a/Quot/Examples/FSet3.thy Sat Dec 12 04:48:43 2009 +0100
+++ b/Quot/Examples/FSet3.thy Sat Dec 12 05:12:50 2009 +0100
@@ -79,7 +79,7 @@
| "delete_raw (a # A) x = (if (a = x) then delete_raw A x else a # (delete_raw A x))"
lemma mem_delete_raw:
- "x mem (delete_raw A a) = (x mem A \<and> \<not>(x = a))"
+ "x \<in> set (delete_raw A a) = (x \<in> set A \<and> \<not>(x = a))"
by (induct A arbitrary: x a) (auto)
lemma mem_delete_raw_ident:
@@ -97,7 +97,7 @@
sorry
lemma cons_delete_raw:
- "a # (delete_raw A a) \<approx> (if a mem A then A else (a # A))"
+ "a # (delete_raw A a) \<approx> (if a \<in> set A then A else (a # A))"
sorry
lemma mem_cons_delete_raw:
@@ -112,7 +112,7 @@
card_raw :: "'a list \<Rightarrow> nat"
where
card_raw_nil: "card_raw [] = 0"
-| card_raw_cons: "card_raw (x # xs) = (if x mem xs then card_raw xs else Suc (card_raw xs))"
+| card_raw_cons: "card_raw (x # xs) = (if x \<in> set xs then card_raw xs else Suc (card_raw xs))"
lemma not_mem_card_raw:
fixes x :: "'a"
@@ -121,28 +121,22 @@
sorry
lemma card_raw_suc:
- fixes xs :: "'a list"
- fixes n :: "nat"
assumes c: "card_raw xs = Suc n"
- shows "\<exists>a ys. \<not>(a mem ys) \<and> xs \<approx> (a # ys)"
- using c
-apply(induct xs)
-(*apply(metis mem_delete_raw)
-apply(metis mem_delete_raw)
-done*)
-sorry
+ shows "\<exists>a ys. (a \<notin> set ys) \<and> xs \<approx> (a # ys)"
+ using c apply(induct xs)
+ apply(simp)
+ sorry
-
-lemma mem_card_raw_not_0:
- "a mem A \<Longrightarrow> \<not>(card_raw A = 0)"
-sorry
+lemma mem_card_raw_gt_0:
+ "a \<in> set A \<Longrightarrow> 0 < card_raw A"
+ by (induct A) (auto)
lemma card_raw_cons_gt_0:
"0 < card_raw (a # A)"
-sorry
+ by (induct A) (auto)
lemma card_raw_delete_raw:
- "card_raw (delete_raw A a) = (if a mem A then card_raw A - 1 else card_raw A)"
+ "card_raw (delete_raw A a) = (if a \<in> set A then card_raw A - 1 else card_raw A)"
sorry
lemma card_raw_rsp_aux:
@@ -156,16 +150,16 @@
lemma card_raw_0:
"(card_raw A = 0) = (A = [])"
-sorry
+ by (induct A) (auto)
lemma list2set_thm:
shows "set [] = {}"
and "set (h # t) = insert h (set t)"
-sorry
+ by (auto)
lemma list2set_RSP:
"A \<approx> B \<Longrightarrow> set A = set B"
-sorry
+ by auto
definition
rsp_fold