Nominal/Abs.thy
changeset 1258 7d8949da7d99
parent 1210 10a0e3578507
child 1259 db158e995bfc
equal deleted inserted replaced
1252:4b0563bc4b03 1258:7d8949da7d99
       
     1 theory Abs
       
     2 imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "../Quotient" "../Quotient_Product"
       
     3 begin
       
     4 
       
     5 (* the next three lemmas that should be in Nominal \<dots>\<dots>must be cleaned *)
       
     6 lemma ball_image: 
       
     7   shows "(\<forall>x \<in> p \<bullet> S. P x) = (\<forall>x \<in> S. P (p \<bullet> x))"
       
     8 apply(auto)
       
     9 apply(drule_tac x="p \<bullet> x" in bspec)
       
    10 apply(simp add: mem_permute_iff)
       
    11 apply(simp)
       
    12 apply(drule_tac x="(- p) \<bullet> x" in bspec)
       
    13 apply(rule_tac p1="p" in mem_permute_iff[THEN iffD1])
       
    14 apply(simp)
       
    15 apply(simp)
       
    16 done
       
    17 
       
    18 lemma fresh_star_plus:
       
    19   fixes p q::perm
       
    20   shows "\<lbrakk>a \<sharp>* p;  a \<sharp>* q\<rbrakk> \<Longrightarrow> a \<sharp>* (p + q)"
       
    21   unfolding fresh_star_def
       
    22   by (simp add: fresh_plus_perm)
       
    23 
       
    24 lemma fresh_star_permute_iff:
       
    25   shows "(p \<bullet> a) \<sharp>* (p \<bullet> x) \<longleftrightarrow> a \<sharp>* x"
       
    26 apply(simp add: fresh_star_def)
       
    27 apply(simp add: ball_image)
       
    28 apply(simp add: fresh_permute_iff)
       
    29 done
       
    30 
       
    31 fun
       
    32   alpha_gen 
       
    33 where
       
    34   alpha_gen[simp del]:
       
    35   "alpha_gen (bs, x) R f pi (cs, y) \<longleftrightarrow> f x - bs = f y - cs \<and> (f x - bs) \<sharp>* pi \<and> R (pi \<bullet> x) y"
       
    36 
       
    37 notation
       
    38   alpha_gen ("_ \<approx>gen _ _ _ _" [100, 100, 100, 100, 100] 100)
       
    39 
       
    40 lemma [mono]: "R1 \<le> R2 \<Longrightarrow> alpha_gen x R1 \<le> alpha_gen x R2"
       
    41   by (cases x) (auto simp add: le_fun_def le_bool_def alpha_gen.simps)
       
    42 
       
    43 lemma alpha_gen_refl:
       
    44   assumes a: "R x x"
       
    45   shows "(bs, x) \<approx>gen R f 0 (bs, x)"
       
    46   using a by (simp add: alpha_gen fresh_star_def fresh_zero_perm)
       
    47 
       
    48 lemma alpha_gen_sym:
       
    49   assumes a: "(bs, x) \<approx>gen R f p (cs, y)"
       
    50   and     b: "R (p \<bullet> x) y \<Longrightarrow> R (- p \<bullet> y) x"
       
    51   shows "(cs, y) \<approx>gen R f (- p) (bs, x)"
       
    52   using a b by (simp add: alpha_gen fresh_star_def fresh_def supp_minus_perm)
       
    53 
       
    54 lemma alpha_gen_trans:
       
    55   assumes a: "(bs, x) \<approx>gen R f p1 (cs, y)"
       
    56   and     b: "(cs, y) \<approx>gen R f p2 (ds, z)"
       
    57   and     c: "\<lbrakk>R (p1 \<bullet> x) y; R (p2 \<bullet> y) z\<rbrakk> \<Longrightarrow> R ((p2 + p1) \<bullet> x) z"
       
    58   shows "(bs, x) \<approx>gen R f (p2 + p1) (ds, z)"
       
    59   using a b c using supp_plus_perm
       
    60   apply(simp add: alpha_gen fresh_star_def fresh_def)
       
    61   apply(blast)
       
    62   done
       
    63 
       
    64 lemma alpha_gen_eqvt:
       
    65   assumes a: "(bs, x) \<approx>gen R f q (cs, y)"
       
    66   and     b: "R (q \<bullet> x) y \<Longrightarrow> R (p \<bullet> (q \<bullet> x)) (p \<bullet> y)"
       
    67   and     c: "p \<bullet> (f x) = f (p \<bullet> x)"
       
    68   and     d: "p \<bullet> (f y) = f (p \<bullet> y)"
       
    69   shows "(p \<bullet> bs, p \<bullet> x) \<approx>gen R f (p \<bullet> q) (p \<bullet> cs, p \<bullet> y)"
       
    70   using a b
       
    71   apply(simp add: alpha_gen c[symmetric] d[symmetric] Diff_eqvt[symmetric])
       
    72   apply(simp add: permute_eqvt[symmetric])
       
    73   apply(simp add: fresh_star_permute_iff)
       
    74   apply(clarsimp)
       
    75   done
       
    76 
       
    77 lemma alpha_gen_compose_sym:
       
    78   assumes b: "\<exists>pi. (aa, t) \<approx>gen (\<lambda>x1 x2. R x1 x2 \<and> R x2 x1) f pi (ab, s)"
       
    79   and a: "\<And>pi t s. (R t s \<Longrightarrow> R (pi \<bullet> t) (pi \<bullet> s))"
       
    80   shows "\<exists>pi. (ab, s) \<approx>gen R f pi (aa, t)"
       
    81   using b apply -
       
    82   apply(erule exE)
       
    83   apply(rule_tac x="- pi" in exI)
       
    84   apply(simp add: alpha_gen.simps)
       
    85   apply(erule conjE)+
       
    86   apply(rule conjI)
       
    87   apply(simp add: fresh_star_def fresh_minus_perm)
       
    88   apply(subgoal_tac "R (- pi \<bullet> s) ((- pi) \<bullet> (pi \<bullet> t))")
       
    89   apply simp
       
    90   apply(rule a)
       
    91   apply assumption
       
    92   done
       
    93 
       
    94 lemma alpha_gen_compose_trans:
       
    95   assumes b: "\<exists>pi\<Colon>perm. (aa, t) \<approx>gen (\<lambda>x1 x2. R x1 x2 \<and> (\<forall>x. R x2 x \<longrightarrow> R x1 x)) f pi (ab, ta)"
       
    96   and c: "\<exists>pi\<Colon>perm. (ab, ta) \<approx>gen R f pi (ac, sa)"
       
    97   and a: "\<And>pi t s. (R t s \<Longrightarrow> R (pi \<bullet> t) (pi \<bullet> s))"
       
    98   shows "\<exists>pi\<Colon>perm. (aa, t) \<approx>gen R f pi (ac, sa)"
       
    99   using b c apply -
       
   100   apply(simp add: alpha_gen.simps)
       
   101   apply(erule conjE)+
       
   102   apply(erule exE)+
       
   103   apply(erule conjE)+
       
   104   apply(rule_tac x="pia + pi" in exI)
       
   105   apply(simp add: fresh_star_plus)
       
   106   apply(drule_tac x="- pia \<bullet> sa" in spec)
       
   107   apply(drule mp)
       
   108   apply(rotate_tac 4)
       
   109   apply(drule_tac pi="- pia" in a)
       
   110   apply(simp)
       
   111   apply(rotate_tac 6)
       
   112   apply(drule_tac pi="pia" in a)
       
   113   apply(simp)
       
   114   done
       
   115 
       
   116 lemma alpha_gen_atom_eqvt:
       
   117   assumes a: "\<And>x. pi \<bullet> (f x) = f (pi \<bullet> x)"
       
   118   and     b: "\<exists>pia. ({atom a}, t) \<approx>gen (\<lambda>x1 x2. R x1 x2 \<and> R (pi \<bullet> x1) (pi \<bullet> x2)) f pia ({atom b}, s)"
       
   119   shows  "\<exists>pia. ({atom (pi \<bullet> a)}, pi \<bullet> t) \<approx>gen R f pia ({atom (pi \<bullet> b)}, pi \<bullet> s)"
       
   120   using b 
       
   121   apply -
       
   122   apply(erule exE)
       
   123   apply(rule_tac x="pi \<bullet> pia" in exI)
       
   124   apply(simp add: alpha_gen.simps)
       
   125   apply(erule conjE)+
       
   126   apply(rule conjI)
       
   127   apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1])
       
   128   apply(simp add: a[symmetric] atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt)
       
   129   apply(rule conjI)
       
   130   apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1])
       
   131   apply(simp add: a[symmetric] atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt)
       
   132   apply(subst permute_eqvt[symmetric])
       
   133   apply(simp)
       
   134   done
       
   135 
       
   136 fun
       
   137   alpha_abs 
       
   138 where
       
   139   "alpha_abs (bs, x) (cs, y) = (\<exists>p. (bs, x) \<approx>gen (op=) supp p (cs, y))"
       
   140 
       
   141 notation
       
   142   alpha_abs ("_ \<approx>abs _")
       
   143 
       
   144 lemma alpha_abs_swap:
       
   145   assumes a1: "a \<notin> (supp x) - bs"
       
   146   and     a2: "b \<notin> (supp x) - bs"
       
   147   shows "(bs, x) \<approx>abs ((a \<rightleftharpoons> b) \<bullet> bs, (a \<rightleftharpoons> b) \<bullet> x)"
       
   148   apply(simp)
       
   149   apply(rule_tac x="(a \<rightleftharpoons> b)" in exI)
       
   150   apply(simp add: alpha_gen)
       
   151   apply(simp add: supp_eqvt[symmetric] Diff_eqvt[symmetric])
       
   152   apply(simp add: swap_set_not_in[OF a1 a2])
       
   153   apply(subgoal_tac "supp (a \<rightleftharpoons> b) \<subseteq> {a, b}")
       
   154   using a1 a2
       
   155   apply(simp add: fresh_star_def fresh_def)
       
   156   apply(blast)
       
   157   apply(simp add: supp_swap)
       
   158   done
       
   159 
       
   160 fun
       
   161   supp_abs_fun
       
   162 where
       
   163   "supp_abs_fun (bs, x) = (supp x) - bs"
       
   164 
       
   165 lemma supp_abs_fun_lemma:
       
   166   assumes a: "x \<approx>abs y" 
       
   167   shows "supp_abs_fun x = supp_abs_fun y"
       
   168   using a
       
   169   apply(induct rule: alpha_abs.induct)
       
   170   apply(simp add: alpha_gen)
       
   171   done
       
   172   
       
   173 quotient_type 'a abs = "(atom set \<times> 'a::pt)" / "alpha_abs"
       
   174   apply(rule equivpI)
       
   175   unfolding reflp_def symp_def transp_def
       
   176   apply(simp_all)
       
   177   (* refl *)
       
   178   apply(clarify)
       
   179   apply(rule exI)
       
   180   apply(rule alpha_gen_refl)
       
   181   apply(simp)
       
   182   (* symm *)
       
   183   apply(clarify)
       
   184   apply(rule exI)
       
   185   apply(rule alpha_gen_sym)
       
   186   apply(assumption)
       
   187   apply(clarsimp)
       
   188   (* trans *)
       
   189   apply(clarify)
       
   190   apply(rule exI)
       
   191   apply(rule alpha_gen_trans)
       
   192   apply(assumption)
       
   193   apply(assumption)
       
   194   apply(simp)
       
   195   done
       
   196 
       
   197 quotient_definition
       
   198   "Abs::atom set \<Rightarrow> ('a::pt) \<Rightarrow> 'a abs"
       
   199 is
       
   200   "Pair::atom set \<Rightarrow> ('a::pt) \<Rightarrow> (atom set \<times> 'a)"
       
   201 
       
   202 lemma [quot_respect]:
       
   203   shows "((op =) ===> (op =) ===> alpha_abs) Pair Pair"
       
   204   apply(clarsimp)
       
   205   apply(rule exI)
       
   206   apply(rule alpha_gen_refl)
       
   207   apply(simp)
       
   208   done
       
   209 
       
   210 lemma [quot_respect]:
       
   211   shows "((op =) ===> alpha_abs ===> alpha_abs) permute permute"
       
   212   apply(clarsimp)
       
   213   apply(rule exI)
       
   214   apply(rule alpha_gen_eqvt)
       
   215   apply(assumption)
       
   216   apply(simp_all add: supp_eqvt)
       
   217   done
       
   218 
       
   219 lemma [quot_respect]:
       
   220   shows "(alpha_abs ===> (op =)) supp_abs_fun supp_abs_fun"
       
   221   apply(simp add: supp_abs_fun_lemma)
       
   222   done
       
   223 
       
   224 lemma abs_induct:
       
   225   "\<lbrakk>\<And>as (x::'a::pt). P (Abs as x)\<rbrakk> \<Longrightarrow> P t"
       
   226   apply(lifting prod.induct[where 'a="atom set" and 'b="'a"])
       
   227   done
       
   228 
       
   229 (* TEST case *)
       
   230 lemmas abs_induct2 = prod.induct[where 'a="atom set" and 'b="'a::pt", quot_lifted]
       
   231 thm abs_induct abs_induct2
       
   232 
       
   233 instantiation abs :: (pt) pt
       
   234 begin
       
   235 
       
   236 quotient_definition
       
   237   "permute_abs::perm \<Rightarrow> ('a::pt abs) \<Rightarrow> 'a abs"
       
   238 is
       
   239   "permute:: perm \<Rightarrow> (atom set \<times> 'a::pt) \<Rightarrow> (atom set \<times> 'a::pt)"
       
   240 
       
   241 lemma permute_ABS [simp]:
       
   242   fixes x::"'a::pt"  (* ??? has to be 'a \<dots> 'b does not work *)
       
   243   shows "(p \<bullet> (Abs as x)) = Abs (p \<bullet> as) (p \<bullet> x)"
       
   244   by (lifting permute_prod.simps(1)[where 'a="atom set" and 'b="'a"])
       
   245 
       
   246 instance
       
   247   apply(default)
       
   248   apply(induct_tac [!] x rule: abs_induct)
       
   249   apply(simp_all)
       
   250   done
       
   251 
       
   252 end
       
   253 
       
   254 quotient_definition
       
   255   "supp_Abs_fun :: ('a::pt) abs \<Rightarrow> atom \<Rightarrow> bool"
       
   256 is
       
   257   "supp_abs_fun"
       
   258 
       
   259 lemma supp_Abs_fun_simp:
       
   260   shows "supp_Abs_fun (Abs bs x) = (supp x) - bs"
       
   261   by (lifting supp_abs_fun.simps(1))
       
   262 
       
   263 lemma supp_Abs_fun_eqvt [eqvt]:
       
   264   shows "(p \<bullet> supp_Abs_fun x) = supp_Abs_fun (p \<bullet> x)"
       
   265   apply(induct_tac x rule: abs_induct)
       
   266   apply(simp add: supp_Abs_fun_simp supp_eqvt Diff_eqvt)
       
   267   done
       
   268 
       
   269 lemma supp_Abs_fun_fresh:
       
   270   shows "a \<sharp> Abs bs x \<Longrightarrow> a \<sharp> supp_Abs_fun (Abs bs x)"
       
   271   apply(rule fresh_fun_eqvt_app)
       
   272   apply(simp add: eqvts_raw)
       
   273   apply(simp)
       
   274   done
       
   275 
       
   276 lemma Abs_swap:
       
   277   assumes a1: "a \<notin> (supp x) - bs"
       
   278   and     a2: "b \<notin> (supp x) - bs"
       
   279   shows "(Abs bs x) = (Abs ((a \<rightleftharpoons> b) \<bullet> bs) ((a \<rightleftharpoons> b) \<bullet> x))"
       
   280   using a1 a2 by (lifting alpha_abs_swap)
       
   281 
       
   282 lemma Abs_supports:
       
   283   shows "((supp x) - as) supports (Abs as x)"
       
   284   unfolding supports_def
       
   285   apply(clarify)
       
   286   apply(simp (no_asm))
       
   287   apply(subst Abs_swap[symmetric])
       
   288   apply(simp_all)
       
   289   done
       
   290 
       
   291 lemma supp_Abs_subset1:
       
   292   fixes x::"'a::fs"
       
   293   shows "(supp x) - as \<subseteq> supp (Abs as x)"
       
   294   apply(simp add: supp_conv_fresh)
       
   295   apply(auto)
       
   296   apply(drule_tac supp_Abs_fun_fresh)
       
   297   apply(simp only: supp_Abs_fun_simp)
       
   298   apply(simp add: fresh_def)
       
   299   apply(simp add: supp_finite_atom_set finite_supp)
       
   300   done
       
   301 
       
   302 lemma supp_Abs_subset2:
       
   303   fixes x::"'a::fs"
       
   304   shows "supp (Abs as x) \<subseteq> (supp x) - as"
       
   305   apply(rule supp_is_subset)
       
   306   apply(rule Abs_supports)
       
   307   apply(simp add: finite_supp)
       
   308   done
       
   309 
       
   310 lemma supp_Abs:
       
   311   fixes x::"'a::fs"
       
   312   shows "supp (Abs as x) = (supp x) - as"
       
   313   apply(rule_tac subset_antisym)
       
   314   apply(rule supp_Abs_subset2)
       
   315   apply(rule supp_Abs_subset1)
       
   316   done
       
   317 
       
   318 instance abs :: (fs) fs
       
   319   apply(default)
       
   320   apply(induct_tac x rule: abs_induct)
       
   321   apply(simp add: supp_Abs)
       
   322   apply(simp add: finite_supp)
       
   323   done
       
   324 
       
   325 lemma Abs_fresh_iff:
       
   326   fixes x::"'a::fs"
       
   327   shows "a \<sharp> Abs bs x \<longleftrightarrow> a \<in> bs \<or> (a \<notin> bs \<and> a \<sharp> x)"
       
   328   apply(simp add: fresh_def)
       
   329   apply(simp add: supp_Abs)
       
   330   apply(auto)
       
   331   done
       
   332 
       
   333 lemma Abs_eq_iff:
       
   334   shows "Abs bs x = Abs cs y \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>gen (op =) supp p (cs, y))"
       
   335   by (lifting alpha_abs.simps(1))
       
   336 
       
   337 
       
   338 
       
   339 (* 
       
   340   below is a construction site for showing that in the
       
   341   single-binder case, the old and new alpha equivalence 
       
   342   coincide
       
   343 *)
       
   344 
       
   345 fun
       
   346   alpha1
       
   347 where
       
   348   "alpha1 (a, x) (b, y) \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> x = (a \<rightleftharpoons> b) \<bullet> y \<and> a \<sharp> y)"
       
   349 
       
   350 notation 
       
   351   alpha1 ("_ \<approx>abs1 _")
       
   352 
       
   353 thm swap_set_not_in
       
   354 
       
   355 lemma qq:
       
   356   fixes S::"atom set"
       
   357   assumes a: "supp p \<inter> S = {}"
       
   358   shows "p \<bullet> S = S"
       
   359 using a
       
   360 apply(simp add: supp_perm permute_set_eq)
       
   361 apply(auto)
       
   362 apply(simp only: disjoint_iff_not_equal)
       
   363 apply(simp)
       
   364 apply (metis permute_atom_def_raw)
       
   365 apply(rule_tac x="(- p) \<bullet> x" in exI)
       
   366 apply(simp)
       
   367 apply(simp only: disjoint_iff_not_equal)
       
   368 apply(simp)
       
   369 apply(metis permute_minus_cancel)
       
   370 done
       
   371 
       
   372 lemma alpha_abs_swap:
       
   373   assumes a1: "(supp x - bs) \<sharp>* p"
       
   374   and     a2: "(supp x - bs) \<sharp>* p"
       
   375   shows "(bs, x) \<approx>abs (p \<bullet> bs, p \<bullet> x)"
       
   376   apply(simp)
       
   377   apply(rule_tac x="p" in exI)
       
   378   apply(simp add: alpha_gen)
       
   379   apply(simp add: supp_eqvt[symmetric] Diff_eqvt[symmetric])
       
   380   apply(rule conjI)
       
   381   apply(rule sym)
       
   382   apply(rule qq)
       
   383   using a1 a2
       
   384   apply(auto)[1]
       
   385   oops
       
   386 
       
   387 
       
   388 
       
   389 lemma
       
   390   assumes a: "(a, x) \<approx>abs1 (b, y)" "sort_of a = sort_of b"
       
   391   shows "({a}, x) \<approx>abs ({b}, y)"
       
   392 using a
       
   393 apply(simp)
       
   394 apply(erule disjE)
       
   395 apply(simp)
       
   396 apply(rule exI)
       
   397 apply(rule alpha_gen_refl)
       
   398 apply(simp)
       
   399 apply(rule_tac x="(a \<rightleftharpoons> b)" in  exI)
       
   400 apply(simp add: alpha_gen)
       
   401 apply(simp add: fresh_def)
       
   402 apply(rule conjI)
       
   403 apply(rule_tac ?p1="(a \<rightleftharpoons> b)" in  permute_eq_iff[THEN iffD1])
       
   404 apply(rule trans)
       
   405 apply(simp add: Diff_eqvt supp_eqvt)
       
   406 apply(subst swap_set_not_in)
       
   407 back
       
   408 apply(simp)
       
   409 apply(simp)
       
   410 apply(simp add: permute_set_eq)
       
   411 apply(rule_tac ?p1="(a \<rightleftharpoons> b)" in fresh_star_permute_iff[THEN iffD1])
       
   412 apply(simp add: permute_self)
       
   413 apply(simp add: Diff_eqvt supp_eqvt)
       
   414 apply(simp add: permute_set_eq)
       
   415 apply(subgoal_tac "supp (a \<rightleftharpoons> b) \<subseteq> {a, b}")
       
   416 apply(simp add: fresh_star_def fresh_def)
       
   417 apply(blast)
       
   418 apply(simp add: supp_swap)
       
   419 done
       
   420 
       
   421 thm supp_perm
       
   422 
       
   423 lemma perm_induct_test:
       
   424   fixes P :: "perm => bool"
       
   425   assumes zero: "P 0"
       
   426   assumes swap: "\<And>a b. \<lbrakk>sort_of a = sort_of b; a \<noteq> b\<rbrakk> \<Longrightarrow> P (a \<rightleftharpoons> b)"
       
   427   assumes plus: "\<And>p1 p2. \<lbrakk>supp (p1 + p2) = (supp p1 \<union> supp p2); P p1; P p2\<rbrakk> \<Longrightarrow> P (p1 + p2)"
       
   428   shows "P p"
       
   429 sorry
       
   430 
       
   431 lemma tt1:
       
   432   assumes a: "finite (supp p)"
       
   433   shows "(supp x) \<sharp>* p \<Longrightarrow> p \<bullet> x = x"
       
   434 using a
       
   435 unfolding fresh_star_def fresh_def
       
   436 apply(induct F\<equiv>"supp p" arbitrary: p rule: finite.induct)
       
   437 apply(simp add: supp_perm)
       
   438 defer
       
   439 apply(case_tac "a \<in> A")
       
   440 apply(simp add: insert_absorb)
       
   441 apply(subgoal_tac "A = supp p - {a}")
       
   442 prefer 2
       
   443 apply(blast)
       
   444 apply(case_tac "p \<bullet> a = a")
       
   445 apply(simp add: supp_perm)
       
   446 apply(drule_tac x="p + (((- p) \<bullet> a) \<rightleftharpoons> a)" in meta_spec)
       
   447 apply(simp)
       
   448 apply(drule meta_mp)
       
   449 apply(rule subset_antisym)
       
   450 apply(rule subsetI)
       
   451 apply(simp)
       
   452 apply(simp add: supp_perm)
       
   453 apply(case_tac "xa = p \<bullet> a")
       
   454 apply(simp)
       
   455 apply(case_tac "p \<bullet> a = (- p) \<bullet> a")
       
   456 apply(simp)
       
   457 defer
       
   458 apply(simp)
       
   459 oops
       
   460 
       
   461 lemma tt:
       
   462   "(supp x) \<sharp>* p \<Longrightarrow> p \<bullet> x = x"
       
   463 apply(induct p rule: perm_induct_test)
       
   464 apply(simp)
       
   465 apply(rule swap_fresh_fresh)
       
   466 apply(case_tac "a \<in> supp x")
       
   467 apply(simp add: fresh_star_def)
       
   468 apply(drule_tac x="a" in bspec)
       
   469 apply(simp)
       
   470 apply(simp add: fresh_def)
       
   471 apply(simp add: supp_swap)
       
   472 apply(simp add: fresh_def)
       
   473 apply(case_tac "b \<in> supp x")
       
   474 apply(simp add: fresh_star_def)
       
   475 apply(drule_tac x="b" in bspec)
       
   476 apply(simp)
       
   477 apply(simp add: fresh_def)
       
   478 apply(simp add: supp_swap)
       
   479 apply(simp add: fresh_def)
       
   480 apply(simp)
       
   481 apply(drule meta_mp)
       
   482 apply(simp add: fresh_star_def fresh_def)
       
   483 apply(drule meta_mp)
       
   484 apply(simp add: fresh_star_def fresh_def)
       
   485 apply(simp)
       
   486 done
       
   487 
       
   488 lemma yy:
       
   489   assumes "S1 - {x} = S2 - {x}" "x \<in> S1" "x \<in> S2"
       
   490   shows "S1 = S2"
       
   491 using assms
       
   492 apply (metis insert_Diff_single insert_absorb)
       
   493 done
       
   494 
       
   495 
       
   496 lemma
       
   497   assumes a: "({a}, x) \<approx>abs ({b}, y)" "sort_of a = sort_of b"
       
   498   shows "(a, x) \<approx>abs1 (b, y)"
       
   499 using a
       
   500 apply(case_tac "a = b")
       
   501 apply(simp)
       
   502 oops
       
   503 
       
   504 
       
   505 end
       
   506