diff -r bf321f16d025 -r 24dbe785f2e5 Nominal/TySch.thy --- a/Nominal/TySch.thy Thu Mar 18 23:19:55 2010 +0100 +++ b/Nominal/TySch.thy Fri Mar 19 00:35:20 2010 +0100 @@ -55,6 +55,49 @@ lemma fset_to_set_eqvt[eqvt]: "pi \ (fset_to_set x) = fset_to_set (pi \ x)" by (lifting set_eqvt) +thm list_induct2'[no_vars] + +lemma fset_induct2: + "Pa {||} {||} \ + (\x xs. Pa (finsert x xs) {||}) \ + (\y ys. Pa {||} (finsert y ys)) \ + (\x xs y ys. Pa xs ys \ Pa (finsert x xs) (finsert y ys)) \ + Pa xsa ysa" +by (lifting list_induct2') + +lemma set_cong: "(set x = set y) = (x \ y)" + apply rule + apply simp_all + apply (induct x y rule: list_induct2') + apply simp_all + apply auto + done + +lemma fset_cong: + "(fset_to_set x = fset_to_set y) = (x = y)" + by (lifting set_cong) + +lemma supp_fset_to_set: + "supp (fset_to_set x) = supp x" + apply (simp add: supp_def) + apply (simp add: eqvts) + apply (simp add: fset_cong) + done + +lemma inj_map_eq_iff: + "inj f \ (map f l \ map f m) = (l \ m)" + by (simp add: Set.expand_set_eq[symmetric] inj_image_eq_iff) + +lemma inj_fmap_eq_iff: + "inj f \ (fmap f l = fmap f m) = (l = m)" + by (lifting inj_map_eq_iff) + +lemma atom_fmap_cong: + shows "(fmap atom x = fmap atom y) = (x = y)" + apply(rule inj_fmap_eq_iff) + apply(simp add: inj_on_def) + done + lemma map_eqvt[eqvt]: "pi \ (map f l) = map (pi \ f) (pi \ l)" apply (induct l) apply (simp_all) @@ -64,6 +107,12 @@ lemma fmap_eqvt[eqvt]: "pi \ (fmap f l) = fmap (pi \ f) (pi \ l)" by (lifting map_eqvt) +lemma supp_fmap_atom: + "supp (fmap atom x) = supp x" + apply (simp add: supp_def) + apply (simp add: eqvts eqvts_raw atom_fmap_cong) + done + nominal_datatype t = Var "name" | Fun "t" "t"