Nominal/TySch.thy
changeset 1531 48d08d99b948
parent 1530 24dbe785f2e5
child 1534 984ea1299cd7
equal deleted inserted replaced
1526:770a66131bd3 1531:48d08d99b948
    53 end
    53 end
    54 
    54 
    55 lemma fset_to_set_eqvt[eqvt]: "pi \<bullet> (fset_to_set x) = fset_to_set (pi \<bullet> x)"
    55 lemma fset_to_set_eqvt[eqvt]: "pi \<bullet> (fset_to_set x) = fset_to_set (pi \<bullet> x)"
    56 by (lifting set_eqvt)
    56 by (lifting set_eqvt)
    57 
    57 
       
    58 thm list_induct2'[no_vars]
       
    59 
       
    60 lemma fset_induct2:
       
    61     "Pa {||} {||} \<Longrightarrow>
       
    62     (\<forall>x xs. Pa (finsert x xs) {||}) \<Longrightarrow>
       
    63     (\<forall>y ys. Pa {||} (finsert y ys)) \<Longrightarrow>
       
    64     (\<forall>x xs y ys. Pa xs ys \<longrightarrow> Pa (finsert x xs) (finsert y ys)) \<Longrightarrow>
       
    65     Pa xsa ysa"
       
    66 by (lifting list_induct2')
       
    67 
       
    68 lemma set_cong: "(set x = set y) = (x \<approx> y)"
       
    69   apply rule
       
    70   apply simp_all
       
    71   apply (induct x y rule: list_induct2')
       
    72   apply simp_all
       
    73   apply auto
       
    74   done
       
    75 
       
    76 lemma fset_cong:
       
    77   "(fset_to_set x = fset_to_set y) = (x = y)"
       
    78   by (lifting set_cong)
       
    79 
       
    80 lemma supp_fset_to_set:
       
    81   "supp (fset_to_set x) = supp x"
       
    82   apply (simp add: supp_def)
       
    83   apply (simp add: eqvts)
       
    84   apply (simp add: fset_cong)
       
    85   done
       
    86 
       
    87 lemma inj_map_eq_iff:
       
    88   "inj f \<Longrightarrow> (map f l \<approx> map f m) = (l \<approx> m)"
       
    89   by (simp add: Set.expand_set_eq[symmetric] inj_image_eq_iff)
       
    90 
       
    91 lemma inj_fmap_eq_iff:
       
    92   "inj f \<Longrightarrow> (fmap f l = fmap f m) = (l = m)"
       
    93   by (lifting inj_map_eq_iff)
       
    94 
       
    95 lemma atom_fmap_cong:
       
    96   shows "(fmap atom x = fmap atom y) = (x = y)"
       
    97   apply(rule inj_fmap_eq_iff)
       
    98   apply(simp add: inj_on_def)
       
    99   done
       
   100 
    58 lemma map_eqvt[eqvt]: "pi \<bullet> (map f l) = map (pi \<bullet> f) (pi \<bullet> l)"
   101 lemma map_eqvt[eqvt]: "pi \<bullet> (map f l) = map (pi \<bullet> f) (pi \<bullet> l)"
    59 apply (induct l)
   102 apply (induct l)
    60 apply (simp_all)
   103 apply (simp_all)
    61 apply (simp only: eqvt_apply)
   104 apply (simp only: eqvt_apply)
    62 done
   105 done
    63 
   106 
    64 lemma fmap_eqvt[eqvt]: "pi \<bullet> (fmap f l) = fmap (pi \<bullet> f) (pi \<bullet> l)"
   107 lemma fmap_eqvt[eqvt]: "pi \<bullet> (fmap f l) = fmap (pi \<bullet> f) (pi \<bullet> l)"
    65 by (lifting map_eqvt)
   108 by (lifting map_eqvt)
       
   109 
       
   110 lemma supp_fmap_atom:
       
   111   "supp (fmap atom x) = supp x"
       
   112   apply (simp add: supp_def)
       
   113   apply (simp add: eqvts eqvts_raw atom_fmap_cong)
       
   114   done
    66 
   115 
    67 nominal_datatype t =
   116 nominal_datatype t =
    68   Var "name"
   117   Var "name"
    69 | Fun "t" "t"
   118 | Fun "t" "t"
    70 and tyS =
   119 and tyS =