diff -r 9bde8a508594 -r 775d0bfd99fd Nominal/FSet.thy --- a/Nominal/FSet.thy Fri Oct 15 15:24:19 2010 +0900 +++ b/Nominal/FSet.thy Fri Oct 15 15:52:40 2010 +0900 @@ -256,8 +256,7 @@ lemma ffold_raw_rsp[quot_respect]: shows "(op = ===> op = ===> op \ ===> op =) ffold_raw ffold_raw" unfolding fun_rel_def - apply(auto intro: ffold_raw_rsp_pre) - done + by(auto intro: ffold_raw_rsp_pre) lemma concat_rsp_pre: assumes a: "list_all2 op \ x x'" @@ -300,28 +299,7 @@ qed -lemma concat_rsp_unfolded: - "\list_all2 op \ a ba; ba \ bb; list_all2 op \ bb b\ \ concat a \ concat b" -proof - - fix a b ba bb - assume a: "list_all2 op \ a ba" - assume b: "ba \ bb" - assume c: "list_all2 op \ bb b" - have "\x. (\xa\set a. x \ set xa) = (\xa\set b. x \ set xa)" proof - fix x - show "(\xa\set a. x \ set xa) = (\xa\set b. x \ set xa)" proof - assume d: "\xa\set a. x \ set xa" - show "\xa\set b. x \ set xa" by (rule concat_rsp_pre[OF a b c d]) - next - assume e: "\xa\set b. x \ set xa" - have a': "list_all2 op \ ba a" by (rule list_all2_symp[OF list_eq_equivp, OF a]) - have b': "bb \ ba" by (rule equivp_symp[OF list_eq_equivp, OF b]) - have c': "list_all2 op \ b bb" by (rule list_all2_symp[OF list_eq_equivp, OF c]) - show "\xa\set a. x \ set xa" by (rule concat_rsp_pre[OF c' b' a' e]) - qed - qed - then show "concat a \ concat b" by auto -qed + lemma [quot_respect]: shows "((op =) ===> op \ ===> op \) filter filter" @@ -505,11 +483,13 @@ quotient_definition "fcard :: 'a fset \ nat" - is fcard_raw +is + fcard_raw quotient_definition "fmap :: ('a \ 'b) \ 'a fset \ 'b fset" - is map +is + map quotient_definition "fdelete :: 'a \ 'a fset \ 'a fset" @@ -679,14 +659,6 @@ "memb x (xs @ ys) \ memb x xs \ memb x ys" by (induct xs) (simp_all add: not_memb_nil memb_cons_iff) -lemma cons_left_comm: - "x # y # xs \ y # x # xs" - by auto - -lemma cons_left_idem: - "x # x # xs \ x # xs" - by auto - lemma fset_raw_strong_cases: obtains "xs = []" | x ys where "\ memb x ys" and "xs \ x # ys" @@ -720,7 +692,6 @@ then show thesis using a c by blast qed - section {* deletion *} @@ -827,7 +798,7 @@ text {* Lifted theorems *} lemma not_fin_fnil: "x |\| {||}" - by (lifting not_memb_nil) + by (descending) (simp add: memb_def) lemma fin_finsert_iff[simp]: "x |\| finsert y S \ x = y \ x |\| S" @@ -1025,7 +996,7 @@ by (induct S) simp_all lemma inj_fmap_eq_iff: - "inj f \ (fmap f S = fmap f T) = (S = T)" + "inj f \ fmap f S = fmap f T \ S = T" by (lifting inj_map_eq_iff) lemma fmap_funion: @@ -1215,10 +1186,10 @@ lemma eq_ffilter: shows "(ffilter P xs = ffilter Q xs) = (\x. x |\| xs \ P x = Q x)" by (descending) (auto simp add: memb_def) - -lemma subset_ffilter: - "(\x. x |\| xs \ P x \ Q x) \ (x |\| xs & \ P x & Q x) \ ffilter P xs < ffilter Q xs" -unfolding less_fset_def by (auto simp add: subseteq_filter eq_ffilter) + +lemma subset_ffilter: + shows "(\x. x |\| xs \ P x \ Q x) \ (x |\| xs & \ P x & Q x) \ ffilter P xs < ffilter Q xs" + unfolding less_fset_def by (auto simp add: subseteq_filter eq_ffilter) section {* lemmas transferred from Finite_Set theory *} @@ -1410,5 +1381,4 @@ no_notation list_eq (infix "\" 50) - end