Nominal/Nominal2_Base.thy
changeset 3244 a44479bde681
parent 3239 67370521c09c
child 3245 017e33849f4d
equal deleted inserted replaced
3242:4af8a92396ce 3244:a44479bde681
    10         "~~/src/HOL/Quotient_Examples/FSet"
    10         "~~/src/HOL/Quotient_Examples/FSet"
    11         "~~/src/HOL/Library/FinFun"
    11         "~~/src/HOL/Library/FinFun"
    12 keywords
    12 keywords
    13   "atom_decl" "equivariance" :: thy_decl 
    13   "atom_decl" "equivariance" :: thy_decl 
    14 begin
    14 begin
       
    15 
       
    16 declare [[typedef_overloaded]]
       
    17 
    15 
    18 
    16 section {* Atoms and Sorts *}
    19 section {* Atoms and Sorts *}
    17 
    20 
    18 text {* A simple implementation for atom_sorts is strings. *}
    21 text {* A simple implementation for atom_sorts is strings. *}
    19 (* types atom_sort = string *)
    22 (* types atom_sort = string *)
   181   "Rep_perm (- p) = inv (Rep_perm p)"
   184   "Rep_perm (- p) = inv (Rep_perm p)"
   182   unfolding uminus_perm_def
   185   unfolding uminus_perm_def
   183   by (simp add: Abs_perm_inverse perm_inv Rep_perm)
   186   by (simp add: Abs_perm_inverse perm_inv Rep_perm)
   184 
   187 
   185 instance
   188 instance
   186 apply default
   189 apply standard
   187 unfolding Rep_perm_inject [symmetric]
   190 unfolding Rep_perm_inject [symmetric]
   188 unfolding minus_perm_def
   191 unfolding minus_perm_def
   189 unfolding Rep_perm_add
   192 unfolding Rep_perm_add
   190 unfolding Rep_perm_uminus
   193 unfolding Rep_perm_uminus
   191 unfolding Rep_perm_0
   194 unfolding Rep_perm_0
   323 
   326 
   324 definition
   327 definition
   325   "p \<bullet> a = (Rep_perm p) a"
   328   "p \<bullet> a = (Rep_perm p) a"
   326 
   329 
   327 instance 
   330 instance 
   328 apply(default)
   331 apply standard
   329 apply(simp_all add: permute_atom_def Rep_perm_simps)
   332 apply(simp_all add: permute_atom_def Rep_perm_simps)
   330 done
   333 done
   331 
   334 
   332 end
   335 end
   333 
   336 
   361 
   364 
   362 definition
   365 definition
   363   "p \<bullet> q = p + q - p"
   366   "p \<bullet> q = p + q - p"
   364 
   367 
   365 instance
   368 instance
   366 apply default
   369 apply standard
   367 apply (simp add: permute_perm_def)
   370 apply (simp add: permute_perm_def)
   368 apply (simp add: permute_perm_def algebra_simps)
   371 apply (simp add: permute_perm_def algebra_simps)
   369 done
   372 done
   370 
   373 
   371 end
   374 end
   388 
   391 
   389 definition
   392 definition
   390   "p \<bullet> f = (\<lambda>x. p \<bullet> (f (- p \<bullet> x)))"
   393   "p \<bullet> f = (\<lambda>x. p \<bullet> (f (- p \<bullet> x)))"
   391 
   394 
   392 instance
   395 instance
   393 apply default
   396 apply standard
   394 apply (simp add: permute_fun_def)
   397 apply (simp add: permute_fun_def)
   395 apply (simp add: permute_fun_def minus_add)
   398 apply (simp add: permute_fun_def minus_add)
   396 done
   399 done
   397 
   400 
   398 end
   401 end
   411 begin
   414 begin
   412 
   415 
   413 definition "p \<bullet> (b::bool) = b"
   416 definition "p \<bullet> (b::bool) = b"
   414 
   417 
   415 instance
   418 instance
   416 apply(default) 
   419 apply standard
   417 apply(simp_all add: permute_bool_def)
   420 apply(simp_all add: permute_bool_def)
   418 done
   421 done
   419 
   422 
   420 end
   423 end
   421 
   424 
   436 
   439 
   437 definition
   440 definition
   438   "p \<bullet> X = {p \<bullet> x | x. x \<in> X}" 
   441   "p \<bullet> X = {p \<bullet> x | x. x \<in> X}" 
   439 
   442 
   440 instance
   443 instance
   441 apply default
   444 apply standard
   442 apply (auto simp: permute_set_def)
   445 apply (auto simp: permute_set_def)
   443 done
   446 done
   444 
   447 
   445 end
   448 end
   446 
   449 
   508 begin
   511 begin
   509 
   512 
   510 definition "p \<bullet> (u::unit) = u"
   513 definition "p \<bullet> (u::unit) = u"
   511 
   514 
   512 instance 
   515 instance 
   513 by (default) (simp_all add: permute_unit_def)
   516   by standard (simp_all add: permute_unit_def)
   514 
   517 
   515 end
   518 end
   516 
   519 
   517 
   520 
   518 subsection {* Permutations for products *}
   521 subsection {* Permutations for products *}
   524   permute_prod 
   527   permute_prod 
   525 where
   528 where
   526   Pair_eqvt: "p \<bullet> (x, y) = (p \<bullet> x, p \<bullet> y)"
   529   Pair_eqvt: "p \<bullet> (x, y) = (p \<bullet> x, p \<bullet> y)"
   527 
   530 
   528 instance
   531 instance
   529 by default auto
   532   by standard auto
   530 
   533 
   531 end
   534 end
   532 
   535 
   533 subsection {* Permutations for sums *}
   536 subsection {* Permutations for sums *}
   534 
   537 
   540 where
   543 where
   541   Inl_eqvt: "p \<bullet> (Inl x) = Inl (p \<bullet> x)"
   544   Inl_eqvt: "p \<bullet> (Inl x) = Inl (p \<bullet> x)"
   542 | Inr_eqvt: "p \<bullet> (Inr y) = Inr (p \<bullet> y)"
   545 | Inr_eqvt: "p \<bullet> (Inr y) = Inr (p \<bullet> y)"
   543 
   546 
   544 instance 
   547 instance 
   545 by (default) (case_tac [!] x, simp_all)
   548   by standard (case_tac [!] x, simp_all)
   546 
   549 
   547 end
   550 end
   548 
   551 
   549 subsection {* Permutations for @{typ "'a list"} *}
   552 subsection {* Permutations for @{typ "'a list"} *}
   550 
   553 
   556 where
   559 where
   557   Nil_eqvt:  "p \<bullet> [] = []"
   560   Nil_eqvt:  "p \<bullet> [] = []"
   558 | Cons_eqvt: "p \<bullet> (x # xs) = p \<bullet> x # p \<bullet> xs"
   561 | Cons_eqvt: "p \<bullet> (x # xs) = p \<bullet> x # p \<bullet> xs"
   559 
   562 
   560 instance 
   563 instance 
   561 by (default) (induct_tac [!] x, simp_all)
   564   by standard (induct_tac [!] x, simp_all)
   562 
   565 
   563 end
   566 end
   564 
   567 
   565 lemma set_eqvt:
   568 lemma set_eqvt:
   566   shows "p \<bullet> (set xs) = set (p \<bullet> xs)"
   569   shows "p \<bullet> (set xs) = set (p \<bullet> xs)"
   578 where
   581 where
   579   None_eqvt: "p \<bullet> None = None"
   582   None_eqvt: "p \<bullet> None = None"
   580 | Some_eqvt: "p \<bullet> (Some x) = Some (p \<bullet> x)"
   583 | Some_eqvt: "p \<bullet> (Some x) = Some (p \<bullet> x)"
   581 
   584 
   582 instance 
   585 instance 
   583 by (default) (induct_tac [!] x, simp_all)
   586   by standard (induct_tac [!] x, simp_all)
   584 
   587 
   585 end
   588 end
   586 
   589 
   587 subsection {* Permutations for @{typ "'a multiset"} *}
   590 subsection {* Permutations for @{typ "'a multiset"} *}
   588 
   591 
   665   apply(assumption)
   668   apply(assumption)
   666   apply(simp)
   669   apply(simp)
   667   done
   670   done
   668 
   671 
   669 instance
   672 instance
   670 apply(default)
   673 apply standard
   671 apply(transfer)
   674 apply(transfer)
   672 apply(simp)
   675 apply(simp)
   673 apply(transfer)
   676 apply(transfer)
   674 apply(simp)
   677 apply(simp)
   675 done
   678 done
   683 begin
   686 begin
   684 
   687 
   685 definition "p \<bullet> (c::char) = c"
   688 definition "p \<bullet> (c::char) = c"
   686 
   689 
   687 instance 
   690 instance 
   688 by (default) (simp_all add: permute_char_def)
   691   by standard (simp_all add: permute_char_def)
   689 
   692 
   690 end
   693 end
   691 
   694 
   692 instantiation nat :: pt
   695 instantiation nat :: pt
   693 begin
   696 begin
   694 
   697 
   695 definition "p \<bullet> (n::nat) = n"
   698 definition "p \<bullet> (n::nat) = n"
   696 
   699 
   697 instance 
   700 instance 
   698 by (default) (simp_all add: permute_nat_def)
   701   by standard (simp_all add: permute_nat_def)
   699 
   702 
   700 end
   703 end
   701 
   704 
   702 instantiation int :: pt
   705 instantiation int :: pt
   703 begin
   706 begin
   704 
   707 
   705 definition "p \<bullet> (i::int) = i"
   708 definition "p \<bullet> (i::int) = i"
   706 
   709 
   707 instance 
   710 instance 
   708 by (default) (simp_all add: permute_int_def)
   711   by standard (simp_all add: permute_int_def)
   709 
   712 
   710 end
   713 end
   711 
   714 
   712 
   715 
   713 section {* Pure types *}
   716 section {* Pure types *}
   727 
   730 
   728 
   731 
   729 text {* Other type constructors preserve purity. *}
   732 text {* Other type constructors preserve purity. *}
   730 
   733 
   731 instance "fun" :: (pure, pure) pure
   734 instance "fun" :: (pure, pure) pure
   732 by default (simp add: permute_fun_def permute_pure)
   735   by standard (simp add: permute_fun_def permute_pure)
   733 
   736 
   734 instance set :: (pure) pure
   737 instance set :: (pure) pure
   735 by default (simp add: permute_set_def permute_pure)
   738   by standard (simp add: permute_set_def permute_pure)
   736 
   739 
   737 instance prod :: (pure, pure) pure
   740 instance prod :: (pure, pure) pure
   738 by default (induct_tac x, simp add: permute_pure)
   741   by standard (induct_tac x, simp add: permute_pure)
   739 
   742 
   740 instance sum :: (pure, pure) pure
   743 instance sum :: (pure, pure) pure
   741 by default (induct_tac x, simp_all add: permute_pure)
   744   by standard (induct_tac x, simp_all add: permute_pure)
   742 
   745 
   743 instance list :: (pure) pure
   746 instance list :: (pure) pure
   744 by default (induct_tac x, simp_all add: permute_pure)
   747   by standard (induct_tac x, simp_all add: permute_pure)
   745 
   748 
   746 instance option :: (pure) pure
   749 instance option :: (pure) pure
   747 by default (induct_tac x, simp_all add: permute_pure)
   750   by standard (induct_tac x, simp_all add: permute_pure)
   748 
   751 
   749 
   752 
   750 subsection {* Types @{typ char}, @{typ nat}, and @{typ int} *}
   753 subsection {* Types @{typ char}, @{typ nat}, and @{typ int} *}
   751 
   754 
   752 instance char :: pure
   755 instance char :: pure
  1067 
  1070 
  1068 instantiation bool :: le_eqvt
  1071 instantiation bool :: le_eqvt
  1069 begin
  1072 begin
  1070 
  1073 
  1071 instance 
  1074 instance 
  1072 apply(default)
  1075 apply standard
  1073 unfolding le_bool_def
  1076 unfolding le_bool_def
  1074 apply(perm_simp)
  1077 apply(perm_simp)
  1075 apply(rule refl)
  1078 apply(rule refl)
  1076 done
  1079 done
  1077 
  1080 
  1079 
  1082 
  1080 instantiation "fun" :: (pt, le_eqvt) le_eqvt
  1083 instantiation "fun" :: (pt, le_eqvt) le_eqvt
  1081 begin
  1084 begin
  1082 
  1085 
  1083 instance 
  1086 instance 
  1084 apply(default)
  1087 apply standard
  1085 unfolding le_fun_def
  1088 unfolding le_fun_def
  1086 apply(perm_simp)
  1089 apply(perm_simp)
  1087 apply(rule refl)
  1090 apply(rule refl)
  1088 done 
  1091 done 
  1089 
  1092 
  1091 
  1094 
  1092 instantiation bool :: inf_eqvt
  1095 instantiation bool :: inf_eqvt
  1093 begin
  1096 begin
  1094 
  1097 
  1095 instance 
  1098 instance 
  1096 apply(default)
  1099 apply standard
  1097 unfolding Inf_bool_def
  1100 unfolding Inf_bool_def
  1098 apply(perm_simp)
  1101 apply(perm_simp)
  1099 apply(rule refl)
  1102 apply(rule refl)
  1100 done
  1103 done
  1101 
  1104 
  1103 
  1106 
  1104 instantiation "fun" :: (pt, inf_eqvt) inf_eqvt
  1107 instantiation "fun" :: (pt, inf_eqvt) inf_eqvt
  1105 begin
  1108 begin
  1106 
  1109 
  1107 instance 
  1110 instance 
  1108 apply(default)
  1111 apply standard
  1109 unfolding Inf_fun_def INF_def
  1112 unfolding Inf_fun_def INF_def
  1110 apply(perm_simp)
  1113 apply(perm_simp)
  1111 apply(rule refl)
  1114 apply(rule refl)
  1112 done 
  1115 done 
  1113 
  1116 
  1143 lemma snd_eqvt [eqvt]:
  1146 lemma snd_eqvt [eqvt]:
  1144   shows "p \<bullet> (snd x) = snd (p \<bullet> x)"
  1147   shows "p \<bullet> (snd x) = snd (p \<bullet> x)"
  1145   by (cases x) simp
  1148   by (cases x) simp
  1146 
  1149 
  1147 lemma split_eqvt [eqvt]: 
  1150 lemma split_eqvt [eqvt]: 
  1148   shows "p \<bullet> (split P x) = split (p \<bullet> P) (p \<bullet> x)"
  1151   shows "p \<bullet> (case_prod P x) = case_prod (p \<bullet> P) (p \<bullet> x)"
  1149   unfolding split_def
  1152   unfolding split_def
  1150   by simp
  1153   by simp
  1151 
  1154 
  1152 
  1155 
  1153 subsubsection {* Equivariance for list operations *}
  1156 subsubsection {* Equivariance for list operations *}
  1454   fixes x::"'a::pure"
  1457   fixes x::"'a::pure"
  1455   shows "a \<sharp> x"
  1458   shows "a \<sharp> x"
  1456   unfolding fresh_def by (simp add: pure_supp)
  1459   unfolding fresh_def by (simp add: pure_supp)
  1457 
  1460 
  1458 instance pure < fs
  1461 instance pure < fs
  1459 by default (simp add: pure_supp)
  1462   by standard (simp add: pure_supp)
  1460 
  1463 
  1461 
  1464 
  1462 subsection  {* Type @{typ atom} is finitely-supported. *}
  1465 subsection  {* Type @{typ atom} is finitely-supported. *}
  1463 
  1466 
  1464 lemma supp_atom:
  1467 lemma supp_atom:
  1472 lemma fresh_atom: 
  1475 lemma fresh_atom: 
  1473   shows "a \<sharp> b \<longleftrightarrow> a \<noteq> b"
  1476   shows "a \<sharp> b \<longleftrightarrow> a \<noteq> b"
  1474   unfolding fresh_def supp_atom by simp
  1477   unfolding fresh_def supp_atom by simp
  1475 
  1478 
  1476 instance atom :: fs
  1479 instance atom :: fs
  1477 by default (simp add: supp_atom)
  1480   by standard (simp add: supp_atom)
  1478 
  1481 
  1479 
  1482 
  1480 section {* Type @{typ perm} is finitely-supported. *}
  1483 section {* Type @{typ perm} is finitely-supported. *}
  1481 
  1484 
  1482 lemma perm_swap_eq:
  1485 lemma perm_swap_eq:
  1621   apply(simp add: fresh_def)
  1624   apply(simp add: fresh_def)
  1622   done
  1625   done
  1623 
  1626 
  1624 
  1627 
  1625 instance perm :: fs
  1628 instance perm :: fs
  1626 by default (simp add: supp_perm finite_perm_lemma)
  1629   by standard (simp add: supp_perm finite_perm_lemma)
  1627 
  1630 
  1628 
  1631 
  1629 
  1632 
  1630 section {* Finite Support instances for other types *}
  1633 section {* Finite Support instances for other types *}
  1631 
  1634 
  1647 lemma fresh_Unit:
  1650 lemma fresh_Unit:
  1648   shows "a \<sharp> ()"
  1651   shows "a \<sharp> ()"
  1649   by (simp add: fresh_def supp_Unit)
  1652   by (simp add: fresh_def supp_Unit)
  1650 
  1653 
  1651 instance prod :: (fs, fs) fs
  1654 instance prod :: (fs, fs) fs
  1652 apply default
  1655 apply standard
  1653 apply (case_tac x)
  1656 apply (case_tac x)
  1654 apply (simp add: supp_Pair finite_supp)
  1657 apply (simp add: supp_Pair finite_supp)
  1655 done
  1658 done
  1656 
  1659 
  1657 
  1660 
  1672 lemma fresh_Inr: 
  1675 lemma fresh_Inr: 
  1673   shows "a \<sharp> Inr y \<longleftrightarrow> a \<sharp> y"
  1676   shows "a \<sharp> Inr y \<longleftrightarrow> a \<sharp> y"
  1674   by (simp add: fresh_def supp_Inr)
  1677   by (simp add: fresh_def supp_Inr)
  1675 
  1678 
  1676 instance sum :: (fs, fs) fs
  1679 instance sum :: (fs, fs) fs
  1677 apply default
  1680 apply standard
  1678 apply (case_tac x)
  1681 apply (case_tac x)
  1679 apply (simp_all add: supp_Inl supp_Inr finite_supp)
  1682 apply (simp_all add: supp_Inl supp_Inr finite_supp)
  1680 done
  1683 done
  1681 
  1684 
  1682 
  1685 
  1697 lemma fresh_Some: 
  1700 lemma fresh_Some: 
  1698   shows "a \<sharp> Some x \<longleftrightarrow> a \<sharp> x"
  1701   shows "a \<sharp> Some x \<longleftrightarrow> a \<sharp> x"
  1699   by (simp add: fresh_def supp_Some)
  1702   by (simp add: fresh_def supp_Some)
  1700 
  1703 
  1701 instance option :: (fs) fs
  1704 instance option :: (fs) fs
  1702 apply default
  1705 apply standard
  1703 apply (induct_tac x)
  1706 apply (induct_tac x)
  1704 apply (simp_all add: supp_None supp_Some finite_supp)
  1707 apply (simp_all add: supp_None supp_Some finite_supp)
  1705 done
  1708 done
  1706 
  1709 
  1707 
  1710 
  1750   shows "supp as = set as"
  1753   shows "supp as = set as"
  1751 by (induct as)
  1754 by (induct as)
  1752    (simp_all add: supp_Nil supp_Cons supp_atom)
  1755    (simp_all add: supp_Nil supp_Cons supp_atom)
  1753 
  1756 
  1754 instance list :: (fs) fs
  1757 instance list :: (fs) fs
  1755 apply default
  1758 apply standard
  1756 apply (induct_tac x)
  1759 apply (induct_tac x)
  1757 apply (simp_all add: supp_Nil supp_Cons finite_supp)
  1760 apply (simp_all add: supp_Nil supp_Cons finite_supp)
  1758 done
  1761 done
  1759 
  1762 
  1760 
  1763 
  1893         val argx = Free x
  1896         val argx = Free x
  1894         val absf = absfree x f
  1897         val absf = absfree x f
  1895         val cty_inst =
  1898         val cty_inst =
  1896           [SOME (Thm.ctyp_of ctxt (fastype_of argx)), SOME (Thm.ctyp_of ctxt (fastype_of f))]
  1899           [SOME (Thm.ctyp_of ctxt (fastype_of argx)), SOME (Thm.ctyp_of ctxt (fastype_of f))]
  1897         val ctrm_inst = [NONE, SOME (Thm.cterm_of ctxt absf), SOME (Thm.cterm_of ctxt argx)] 
  1900         val ctrm_inst = [NONE, SOME (Thm.cterm_of ctxt absf), SOME (Thm.cterm_of ctxt argx)] 
  1898         val thm = Drule.instantiate' cty_inst ctrm_inst @{thm fresh_fun_app}
  1901         val thm = Thm.instantiate' cty_inst ctrm_inst @{thm fresh_fun_app}
  1899       in
  1902       in
  1900         SOME(thm RS @{thm Eq_TrueI}) 
  1903         SOME(thm RS @{thm Eq_TrueI}) 
  1901       end  
  1904       end  
  1902     | (_, _) => NONE
  1905     | (_, _) => NONE
  1903   end
  1906   end
  2118 by (simp add: supp_set)
  2121 by (simp add: supp_set)
  2119 
  2122 
  2120 
  2123 
  2121 subsection {* Type @{typ "'a multiset"} is finitely supported *}
  2124 subsection {* Type @{typ "'a multiset"} is finitely supported *}
  2122 
  2125 
  2123 lemma set_of_eqvt [eqvt]:
  2126 lemma set_mset_eqvt [eqvt]:
  2124   shows "p \<bullet> (set_of M) = set_of (p \<bullet> M)"
  2127   shows "p \<bullet> (set_mset M) = set_mset (p \<bullet> M)"
  2125 by (induct M) (simp_all add: insert_eqvt empty_eqvt)
  2128 by (induct M) (simp_all add: insert_eqvt empty_eqvt)
  2126 
  2129 
  2127 lemma supp_set_of:
  2130 lemma supp_set_mset:
  2128   shows "supp (set_of M) \<subseteq> supp M"
  2131   shows "supp (set_mset M) \<subseteq> supp M"
  2129   apply (rule supp_fun_app_eqvt)
  2132   apply (rule supp_fun_app_eqvt)
  2130   unfolding eqvt_def
  2133   unfolding eqvt_def
  2131   apply(perm_simp)
  2134   apply(perm_simp)
  2132   apply(simp)
  2135   apply(simp)
  2133   done
  2136   done
  2163 
  2166 
  2164 lemma Union_included_multiset:
  2167 lemma Union_included_multiset:
  2165   fixes M::"('a::fs multiset)" 
  2168   fixes M::"('a::fs multiset)" 
  2166   shows "(\<Union>{supp x | x. x \<in># M}) \<subseteq> supp M"
  2169   shows "(\<Union>{supp x | x. x \<in># M}) \<subseteq> supp M"
  2167 proof -
  2170 proof -
  2168   have "(\<Union>{supp x | x. x \<in># M}) = (\<Union>{supp x | x. x \<in> set_of M})" by simp
  2171   have "(\<Union>{supp x | x. x \<in># M}) = (\<Union>{supp x | x. x \<in> set_mset M})" by simp
  2169   also have "... \<subseteq> (\<Union>x \<in> set_of M. supp x)" by auto
  2172   also have "... \<subseteq> (\<Union>x \<in> set_mset M. supp x)" by auto
  2170   also have "... = supp (set_of M)"
  2173   also have "... = supp (set_mset M)"
  2171     by (simp add: supp_of_finite_sets)
  2174     by (simp add: supp_of_finite_sets)
  2172   also have " ... \<subseteq> supp M" by (rule supp_set_of)
  2175   also have " ... \<subseteq> supp M" by (rule supp_set_mset)
  2173   finally show "(\<Union>{supp x | x. x \<in># M}) \<subseteq> supp M" .
  2176   finally show "(\<Union>{supp x | x. x \<in># M}) \<subseteq> supp M" .
  2174 qed
  2177 qed
  2175 
  2178 
  2176 lemma supp_of_multisets:
  2179 lemma supp_of_multisets:
  2177   fixes M::"('a::fs multiset)"
  2180   fixes M::"('a::fs multiset)"
  2197   shows "supp {#} = {}"
  2200   shows "supp {#} = {}"
  2198   unfolding supp_def
  2201   unfolding supp_def
  2199   by simp
  2202   by simp
  2200 
  2203 
  2201 instance multiset :: (fs) fs
  2204 instance multiset :: (fs) fs
  2202   apply (default)
  2205   by standard (rule multisets_supp_finite)
  2203   apply (rule multisets_supp_finite)
       
  2204   done
       
  2205 
  2206 
  2206 subsection {* Type @{typ "'a fset"} is finitely supported *}
  2207 subsection {* Type @{typ "'a fset"} is finitely supported *}
  2207 
  2208 
  2208 lemma supp_fset [simp]:
  2209 lemma supp_fset [simp]:
  2209   shows "supp (fset S) = supp S"
  2210   shows "supp (fset S) = supp S"
  2250   shows "a \<sharp> S |\<union>| T \<longleftrightarrow> a \<sharp> S \<and> a \<sharp> T"
  2251   shows "a \<sharp> S |\<union>| T \<longleftrightarrow> a \<sharp> S \<and> a \<sharp> T"
  2251 unfolding fresh_def
  2252 unfolding fresh_def
  2252 by (simp add: supp_union_fset)
  2253 by (simp add: supp_union_fset)
  2253 
  2254 
  2254 instance fset :: (fs) fs
  2255 instance fset :: (fs) fs
  2255   apply (default)
  2256   by standard (rule fset_finite_supp)
  2256   apply (rule fset_finite_supp)
       
  2257   done
       
  2258 
  2257 
  2259 
  2258 
  2260 subsection {* Type @{typ "('a, 'b) finfun"} is finitely supported *}
  2259 subsection {* Type @{typ "('a, 'b) finfun"} is finitely supported *}
  2261 
  2260 
  2262 lemma fresh_finfun_const:
  2261 lemma fresh_finfun_const:
  2277   shows "supp (finfun_update f x y) \<subseteq> supp(f, x, y)"
  2276   shows "supp (finfun_update f x y) \<subseteq> supp(f, x, y)"
  2278 using fresh_finfun_update
  2277 using fresh_finfun_update
  2279 by (auto simp: fresh_def supp_Pair)
  2278 by (auto simp: fresh_def supp_Pair)
  2280     
  2279     
  2281 instance finfun :: (fs, fs) fs
  2280 instance finfun :: (fs, fs) fs
  2282   apply(default)
  2281   apply standard
  2283   apply(induct_tac x rule: finfun_weak_induct)
  2282   apply(induct_tac x rule: finfun_weak_induct)
  2284   apply(simp add: supp_finfun_const finite_supp)
  2283   apply(simp add: supp_finfun_const finite_supp)
  2285   apply(rule finite_subset)
  2284   apply(rule finite_subset)
  2286   apply(rule supp_finfun_update)
  2285   apply(rule supp_finfun_update)
  2287   apply(simp add: supp_Pair finite_supp)
  2286   apply(simp add: supp_Pair finite_supp)