Nominal/Nominal2_FCB.thy
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Fri, 19 Apr 2013 00:10:52 +0100
changeset 3218 89158f401b07
parent 3191 0440bc1a2438
child 3230 b33b42211bbf
permissions -rw-r--r--
updated to simplifier changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
theory Nominal2_FCB
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
imports "Nominal2_Abs" 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
begin
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
2946
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
     6
text {*
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
     7
  A tactic which solves all trivial cases in function 
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
     8
  definitions, and leaves the others unchanged.
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
     9
*}
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    10
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    11
ML {*
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    12
val all_trivials : (Proof.context -> Method.method) context_parser =
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    13
Scan.succeed (fn ctxt =>
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    14
 let
3218
89158f401b07 updated to simplifier changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 3191
diff changeset
    15
   val tac = TRYALL (SOLVED' (full_simp_tac ctxt))
2946
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    16
 in 
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    17
   Method.SIMPLE_METHOD' (K tac)
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    18
 end)
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    19
*}
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    20
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    21
method_setup all_trivials = {* all_trivials *} {* solves trivial goals *}
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    22
d9c3cc271e62 added a tactic "all_trivials" which simplifies all trivial constructor cases and leaves the others untouched.
Christian Urban <urbanc@in.tum.de>
parents: 2944
diff changeset
    23
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
lemma Abs_lst1_fcb:
3191
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
    25
  fixes x y :: "'a :: at"
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
    and S T :: "'b :: fs"
3191
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
    27
  assumes e: "[[atom x]]lst. T = [[atom y]]lst. S"
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
    28
  and f1: "\<lbrakk>x \<noteq> y; atom y \<sharp> T; atom x \<sharp> (y \<leftrightarrow> x) \<bullet> T\<rbrakk> \<Longrightarrow> atom x \<sharp> f x T"
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
    29
  and f2: "\<lbrakk>x \<noteq> y; atom y \<sharp> T; atom x \<sharp> (y \<leftrightarrow> x) \<bullet> T\<rbrakk> \<Longrightarrow> atom y \<sharp> f x T"
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
    30
  and p: "\<lbrakk>S = (x \<leftrightarrow> y) \<bullet> T; x \<noteq> y; atom y \<sharp> T; atom x \<sharp> S\<rbrakk> 
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
    31
    \<Longrightarrow> (x \<leftrightarrow> y) \<bullet> (f x T) = f y S"
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
  shows "f x T = f y S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
  using e
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
  apply(case_tac "atom x \<sharp> S")
3191
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
    35
  apply(simp add: Abs1_eq_iff')
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
  apply(elim conjE disjE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
  apply(simp)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
  apply(rule trans)
3191
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
    39
  apply(rule_tac p="(x \<leftrightarrow> y)" in supp_perm_eq[symmetric])
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
  apply(rule fresh_star_supp_conv)
3191
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
    41
  apply(simp add: flip_def supp_swap fresh_star_def f1 f2)
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
    42
  apply(simp add: flip_commute p)
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
    43
  apply(simp add: Abs1_eq_iff)
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
  done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
lemma Abs_lst_fcb:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
  fixes xs ys :: "'a :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
    and S T :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
  assumes e: "(Abs_lst (ba xs) T) = (Abs_lst (ba ys) S)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
    and f1: "\<And>x. x \<in> set (ba xs) \<Longrightarrow> x \<sharp> f xs T"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
    and f2: "\<And>x. \<lbrakk>supp T - set (ba xs) = supp S - set (ba ys); x \<in> set (ba ys)\<rbrakk> \<Longrightarrow> x \<sharp> f xs T"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
    and eqv: "\<And>p. \<lbrakk>p \<bullet> T = S; p \<bullet> ba xs = ba ys; supp p \<subseteq> set (ba xs) \<union> set (ba ys)\<rbrakk> 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
      \<Longrightarrow> p \<bullet> (f xs T) = f ys S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
  shows "f xs T = f ys S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
  using e apply -
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
  apply(subst (asm) Abs_eq_iff2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
  apply(simp add: alphas)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
  apply(elim exE conjE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
  apply(rule trans)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
  apply(rule_tac p="p" in supp_perm_eq[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
  apply(rule fresh_star_supp_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
  apply(drule fresh_star_perm_set_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
  apply(rule finite_Diff)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
  apply(rule finite_supp)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
  apply(subgoal_tac "(set (ba xs) \<union> set (ba ys)) \<sharp>* f xs T")
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
  apply(metis Un_absorb2 fresh_star_Un)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
  apply(subst fresh_star_Un)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
  apply(rule conjI)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
  apply(simp add: fresh_star_def f1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
  apply(simp add: fresh_star_def f2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
  apply(simp add: eqv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
  done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
lemma Abs_set_fcb:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
  fixes xs ys :: "'a :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
    and S T :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
  assumes e: "(Abs_set (ba xs) T) = (Abs_set (ba ys) S)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
    and f1: "\<And>x. x \<in> ba xs \<Longrightarrow> x \<sharp> f xs T"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
    and f2: "\<And>x. \<lbrakk>supp T - ba xs = supp S - ba ys; x \<in> ba ys\<rbrakk> \<Longrightarrow> x \<sharp> f xs T"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
    and eqv: "\<And>p. \<lbrakk>p \<bullet> T = S; p \<bullet> ba xs = ba ys; supp p \<subseteq> ba xs \<union> ba ys\<rbrakk> \<Longrightarrow> p \<bullet> (f xs T) = f ys S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
  shows "f xs T = f ys S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
  using e apply -
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
  apply(subst (asm) Abs_eq_iff2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
  apply(simp add: alphas)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
  apply(elim exE conjE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
  apply(rule trans)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
  apply(rule_tac p="p" in supp_perm_eq[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
  apply(rule fresh_star_supp_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
  apply(drule fresh_star_perm_set_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
  apply(rule finite_Diff)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
  apply(rule finite_supp)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
  apply(subgoal_tac "(ba xs \<union> ba ys) \<sharp>* f xs T")
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
  apply(metis Un_absorb2 fresh_star_Un)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
  apply(subst fresh_star_Un)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
  apply(rule conjI)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
  apply(simp add: fresh_star_def f1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
  apply(simp add: fresh_star_def f2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
  apply(simp add: eqv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
  done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
lemma Abs_res_fcb:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
  fixes xs ys :: "('a :: at_base) set"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
    and S T :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
  assumes e: "(Abs_res (atom ` xs) T) = (Abs_res (atom ` ys) S)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
    and f1: "\<And>x. x \<in> atom ` xs \<Longrightarrow> x \<in> supp T \<Longrightarrow> x \<sharp> f xs T"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
    and f2: "\<And>x. \<lbrakk>supp T - atom ` xs = supp S - atom ` ys; x \<in> atom ` ys; x \<in> supp S\<rbrakk> \<Longrightarrow> x \<sharp> f xs T"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
    and eqv: "\<And>p. \<lbrakk>p \<bullet> T = S; supp p \<subseteq> atom ` xs \<inter> supp T \<union> atom ` ys \<inter> supp S;
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
      p \<bullet> (atom ` xs \<inter> supp T) = atom ` ys \<inter> supp S\<rbrakk> \<Longrightarrow> p \<bullet> (f xs T) = f ys S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
  shows "f xs T = f ys S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
  using e apply -
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
  apply(subst (asm) Abs_eq_res_set)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
  apply(subst (asm) Abs_eq_iff2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
  apply(simp add: alphas)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
  apply(elim exE conjE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
  apply(rule trans)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
  apply(rule_tac p="p" in supp_perm_eq[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
  apply(rule fresh_star_supp_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
  apply(drule fresh_star_perm_set_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
  apply(rule finite_Diff)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
  apply(rule finite_supp)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
  apply(subgoal_tac "(atom ` xs \<inter> supp T \<union> atom ` ys \<inter> supp S) \<sharp>* f xs T")
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
  apply(metis Un_absorb2 fresh_star_Un)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
  apply(subst fresh_star_Un)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
  apply(rule conjI)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
  apply(simp add: fresh_star_def f1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
  apply(subgoal_tac "supp T - atom ` xs = supp S - atom ` ys")
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
  apply(simp add: fresh_star_def f2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
  apply(blast)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
  apply(simp add: eqv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
  done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
lemma Abs_set_fcb2:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
  fixes as bs :: "atom set"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
    and x y :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
    and c::"'c::fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
  assumes eq: "[as]set. x = [bs]set. y"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
  and fin: "finite as" "finite bs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
  and fcb1: "as \<sharp>* f as x c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
  and fresh1: "as \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
  and fresh2: "bs \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
  and perm1: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f as x c) = f (p \<bullet> as) (p \<bullet> x) c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
  and perm2: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f bs y c) = f (p \<bullet> bs) (p \<bullet> y) c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   145
  shows "f as x c = f bs y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
proof -
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
  have "supp (as, x, c) supports (f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
    unfolding  supports_def fresh_def[symmetric]
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
    by (simp add: fresh_Pair perm1 fresh_star_def supp_swap swap_fresh_fresh)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
  then have fin1: "finite (supp (f as x c))"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
    using fin by (auto intro: supports_finite simp add: finite_supp supp_of_finite_sets supp_Pair)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
  have "supp (bs, y, c) supports (f bs y c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   153
    unfolding  supports_def fresh_def[symmetric]
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
    by (simp add: fresh_Pair perm2 fresh_star_def supp_swap swap_fresh_fresh)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
  then have fin2: "finite (supp (f bs y c))"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
    using fin by (auto intro: supports_finite simp add: finite_supp supp_of_finite_sets supp_Pair)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
  obtain q::"perm" where 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
    fr1: "(q \<bullet> as) \<sharp>* (x, c, f as x c, f bs y c)" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
    fr2: "supp q \<sharp>* ([as]set. x)" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   160
    inc: "supp q \<subseteq> as \<union> (q \<bullet> as)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
    using at_set_avoiding3[where xs="as" and c="(x, c, f as x c, f bs y c)" and x="[as]set. x"]  
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   162
      fin1 fin2 fin
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
    by (auto simp add: supp_Pair finite_supp Abs_fresh_star dest: fresh_star_supp_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
  have "[q \<bullet> as]set. (q \<bullet> x) = q \<bullet> ([as]set. x)" by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
  also have "\<dots> = [as]set. x"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
    by (simp only: fr2 perm_supp_eq)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
  finally have "[q \<bullet> as]set. (q \<bullet> x) = [bs]set. y" using eq by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
  then obtain r::perm where 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
    qq1: "q \<bullet> x = r \<bullet> y" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
    qq2: "q \<bullet> as = r \<bullet> bs" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
    qq3: "supp r \<subseteq> (q \<bullet> as) \<union> bs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
    apply(drule_tac sym)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
    apply(simp only: Abs_eq_iff2 alphas)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
    apply(erule exE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
    apply(erule conjE)+
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
    apply(drule_tac x="p" in meta_spec)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
    apply(simp add: set_eqvt)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   178
    apply(blast)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   179
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   180
  have "as \<sharp>* f as x c" by (rule fcb1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   181
  then have "q \<bullet> (as \<sharp>* f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   182
    by (simp add: permute_bool_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
  then have "(q \<bullet> as) \<sharp>* f (q \<bullet> as) (q \<bullet> x) c"
3183
313e6f2cdd89 added permutation simplification to the simplifier; this makes the simplifier more powerful, but it potentially loops more often
Christian Urban <urbanc@in.tum.de>
parents: 3109
diff changeset
   184
    apply(simp only: fresh_star_eqvt set_eqvt)
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185
    apply(subst (asm) perm1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   186
    using inc fresh1 fr1
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   187
    apply(auto simp add: fresh_star_def fresh_Pair)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
  then have "(r \<bullet> bs) \<sharp>* f (r \<bullet> bs) (r \<bullet> y) c" using qq1 qq2 by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
  then have "r \<bullet> (bs \<sharp>* f bs y c)"
3183
313e6f2cdd89 added permutation simplification to the simplifier; this makes the simplifier more powerful, but it potentially loops more often
Christian Urban <urbanc@in.tum.de>
parents: 3109
diff changeset
   191
    apply(simp only: fresh_star_eqvt set_eqvt)
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   192
    apply(subst (asm) perm2[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   193
    using qq3 fresh2 fr1
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   194
    apply(auto simp add: set_eqvt fresh_star_def fresh_Pair)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   196
  then have fcb2: "bs \<sharp>* f bs y c" by (simp add: permute_bool_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   197
  have "f as x c = q \<bullet> (f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   198
    apply(rule perm_supp_eq[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   199
    using inc fcb1 fr1 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   200
  also have "\<dots> = f (q \<bullet> as) (q \<bullet> x) c" 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   201
    apply(rule perm1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   202
    using inc fresh1 fr1 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   203
  also have "\<dots> = f (r \<bullet> bs) (r \<bullet> y) c" using qq1 qq2 by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   204
  also have "\<dots> = r \<bullet> (f bs y c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   205
    apply(rule perm2[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   206
    using qq3 fresh2 fr1 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   207
  also have "... = f bs y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   208
    apply(rule perm_supp_eq)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   209
    using qq3 fr1 fcb2 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   210
  finally show ?thesis by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   211
qed
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   212
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   213
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   214
lemma Abs_res_fcb2:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   215
  fixes as bs :: "atom set"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   216
    and x y :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   217
    and c::"'c::fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   218
  assumes eq: "[as]res. x = [bs]res. y"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   219
  and fin: "finite as" "finite bs"
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   220
  and fcb1: "(as \<inter> supp x) \<sharp>* f (as \<inter> supp x) x c"
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   221
  and fresh1: "as \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   222
  and fresh2: "bs \<sharp>* c"
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   223
  and perm1: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f (as \<inter> supp x) x c) = f (p \<bullet> (as \<inter> supp x)) (p \<bullet> x) c"
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   224
  and perm2: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f (bs \<inter> supp y) y c) = f (p \<bullet> (bs \<inter> supp y)) (p \<bullet> y) c"
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   225
  shows "f (as \<inter> supp x) x c = f (bs \<inter> supp y) y c"
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   226
proof -
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   227
  have "supp (as, x, c) supports (f (as \<inter> supp x) x c)"
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   228
    unfolding  supports_def fresh_def[symmetric]
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   229
    by (simp add: fresh_Pair perm1 fresh_star_def supp_swap swap_fresh_fresh inter_eqvt supp_eqvt)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   230
  then have fin1: "finite (supp (f (as \<inter> supp x) x c))"
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   231
    using fin by (auto intro: supports_finite simp add: finite_supp supp_of_finite_sets supp_Pair)
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   232
  have "supp (bs, y, c) supports (f (bs \<inter> supp y) y c)"
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   233
    unfolding  supports_def fresh_def[symmetric]
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   234
    by (simp add: fresh_Pair perm2 fresh_star_def supp_swap swap_fresh_fresh inter_eqvt supp_eqvt)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   235
  then have fin2: "finite (supp (f (bs \<inter> supp y) y c))"
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   236
    using fin by (auto intro: supports_finite simp add: finite_supp supp_of_finite_sets supp_Pair)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   237
  obtain q::"perm" where 
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   238
    fr1: "(q \<bullet> (as \<inter> supp x)) \<sharp>* (x, c, f (as \<inter> supp x) x c, f (bs \<inter> supp y) y c)" and 
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   239
    fr2: "supp q \<sharp>* ([as \<inter> supp x]set. x)" and 
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   240
    inc: "supp q \<subseteq> (as \<inter> supp x) \<union> (q \<bullet> (as \<inter> supp x))"
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   241
    using at_set_avoiding3[where xs="as \<inter> supp x" and c="(x, c, f (as \<inter> supp x) x c, f (bs \<inter> supp y) y c)" 
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   242
      and x="[as \<inter> supp x]set. x"]  
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   243
      fin1 fin2 fin
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   244
    apply (auto simp add: supp_Pair finite_supp Abs_fresh_star dest: fresh_star_supp_conv)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   245
    done
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   246
  have "[q \<bullet> (as \<inter> supp x)]set. (q \<bullet> x) = q \<bullet> ([as \<inter> supp x]set. x)" by simp
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   247
  also have "\<dots> = [as \<inter> supp x]set. x"
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   248
    by (simp only: fr2 perm_supp_eq)
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   249
  finally have "[q \<bullet> (as \<inter> supp x)]set. (q \<bullet> x) = [bs \<inter> supp y]set. y" using eq 
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   250
    by(simp add: Abs_eq_res_set)
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   251
  then obtain r::perm where 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   252
    qq1: "q \<bullet> x = r \<bullet> y" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   253
    qq2: "(q \<bullet> as \<inter> supp (q \<bullet> x)) = r \<bullet> (bs \<inter> supp y)" and 
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   254
    qq3: "supp r \<subseteq> (bs \<inter> supp y) \<union> q \<bullet> (as \<inter> supp x)"
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   255
    apply(drule_tac sym)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   256
    apply(simp only: Abs_eq_iff2 alphas)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   257
    apply(erule exE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   258
    apply(erule conjE)+
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   259
    apply(drule_tac x="p" in meta_spec)
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   260
    apply(simp add: set_eqvt inter_eqvt supp_eqvt)
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   261
    done
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   262
  have "(as \<inter> supp x) \<sharp>* f (as \<inter> supp x) x c" by (rule fcb1)
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   263
  then have "q \<bullet> ((as \<inter> supp x) \<sharp>* f (as \<inter> supp x) x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   264
    by (simp add: permute_bool_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   265
  then have "(q \<bullet> (as \<inter> supp x)) \<sharp>* f (q \<bullet> (as \<inter> supp x)) (q \<bullet> x) c"
3183
313e6f2cdd89 added permutation simplification to the simplifier; this makes the simplifier more powerful, but it potentially loops more often
Christian Urban <urbanc@in.tum.de>
parents: 3109
diff changeset
   266
    apply(simp only: fresh_star_eqvt set_eqvt)
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   267
    apply(subst (asm) perm1)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   268
    using inc fresh1 fr1
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   269
    apply(auto simp add: fresh_star_def fresh_Pair)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   270
    done
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   271
  then have "(r \<bullet> (bs \<inter> supp y)) \<sharp>* f (r \<bullet> (bs \<inter> supp y)) (r \<bullet> y) c" using qq1 qq2 
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   272
    apply(perm_simp)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   273
    apply simp
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   274
    done
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   275
  then have "r \<bullet> ((bs \<inter> supp y) \<sharp>* f (bs \<inter> supp y) y c)"
3183
313e6f2cdd89 added permutation simplification to the simplifier; this makes the simplifier more powerful, but it potentially loops more often
Christian Urban <urbanc@in.tum.de>
parents: 3109
diff changeset
   276
    apply(simp only: fresh_star_eqvt set_eqvt)
3105
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   277
    apply(subst (asm) perm2[symmetric])
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   278
    using qq3 fresh2 fr1
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   279
    apply(auto simp add: set_eqvt fresh_star_def fresh_Pair)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   280
    done
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   281
  then have fcb2: "(bs \<inter> supp y) \<sharp>* f (bs \<inter> supp y) y c" by (simp add: permute_bool_def)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   282
  have "f (as \<inter> supp x) x c = q \<bullet> (f (as \<inter> supp x) x c)"
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   283
    apply(rule perm_supp_eq[symmetric])
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   284
    using inc fcb1 fr1 
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   285
    apply (auto simp add: fresh_star_def)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   286
    done
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   287
  also have "\<dots> = f (q \<bullet> (as \<inter> supp x)) (q \<bullet> x) c" 
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   288
    apply(rule perm1)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   289
    using inc fresh1 fr1 by (auto simp add: fresh_star_def)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   290
  also have "\<dots> = f (r \<bullet> (bs \<inter> supp y)) (r \<bullet> y) c" using qq1 qq2 
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   291
    apply(perm_simp)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   292
    apply simp
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   293
    done
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   294
  also have "\<dots> = r \<bullet> (f (bs \<inter> supp y) y c)"
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   295
    apply(rule perm2[symmetric])
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   296
    using qq3 fresh2 fr1 by (auto simp add: fresh_star_def)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   297
  also have "... = f (bs \<inter> supp y) y c"
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   298
    apply(rule perm_supp_eq)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   299
    using qq3 fr1 fcb2 by (auto simp add: fresh_star_def)
1b0d230445ce added an FCB for res (will not define evry function, but is a good datapoint)
Christian Urban <urbanc@in.tum.de>
parents: 2946
diff changeset
   300
  finally show ?thesis by simp
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   301
qed
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   302
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   303
lemma Abs_lst_fcb2:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   304
  fixes as bs :: "atom list"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   305
    and x y :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   306
    and c::"'c::fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   307
  assumes eq: "[as]lst. x = [bs]lst. y"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   308
  and fcb1: "(set as) \<sharp>* f as x c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   309
  and fresh1: "set as \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   310
  and fresh2: "set bs \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   311
  and perm1: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f as x c) = f (p \<bullet> as) (p \<bullet> x) c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   312
  and perm2: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f bs y c) = f (p \<bullet> bs) (p \<bullet> y) c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   313
  shows "f as x c = f bs y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   314
proof -
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   315
  have "supp (as, x, c) supports (f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   316
    unfolding  supports_def fresh_def[symmetric]
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   317
    by (simp add: fresh_Pair perm1 fresh_star_def supp_swap swap_fresh_fresh)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   318
  then have fin1: "finite (supp (f as x c))"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   319
    by (auto intro: supports_finite simp add: finite_supp)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   320
  have "supp (bs, y, c) supports (f bs y c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   321
    unfolding  supports_def fresh_def[symmetric]
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   322
    by (simp add: fresh_Pair perm2 fresh_star_def supp_swap swap_fresh_fresh)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   323
  then have fin2: "finite (supp (f bs y c))"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   324
    by (auto intro: supports_finite simp add: finite_supp)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   325
  obtain q::"perm" where 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   326
    fr1: "(q \<bullet> (set as)) \<sharp>* (x, c, f as x c, f bs y c)" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   327
    fr2: "supp q \<sharp>* Abs_lst as x" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   328
    inc: "supp q \<subseteq> (set as) \<union> q \<bullet> (set as)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   329
    using at_set_avoiding3[where xs="set as" and c="(x, c, f as x c, f bs y c)" and x="[as]lst. x"]  
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   330
      fin1 fin2
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   331
    by (auto simp add: supp_Pair finite_supp Abs_fresh_star dest: fresh_star_supp_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   332
  have "Abs_lst (q \<bullet> as) (q \<bullet> x) = q \<bullet> Abs_lst as x" by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   333
  also have "\<dots> = Abs_lst as x"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   334
    by (simp only: fr2 perm_supp_eq)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   335
  finally have "Abs_lst (q \<bullet> as) (q \<bullet> x) = Abs_lst bs y" using eq by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   336
  then obtain r::perm where 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   337
    qq1: "q \<bullet> x = r \<bullet> y" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   338
    qq2: "q \<bullet> as = r \<bullet> bs" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   339
    qq3: "supp r \<subseteq> (q \<bullet> (set as)) \<union> set bs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   340
    apply(drule_tac sym)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   341
    apply(simp only: Abs_eq_iff2 alphas)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   342
    apply(erule exE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   343
    apply(erule conjE)+
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
    apply(drule_tac x="p" in meta_spec)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   345
    apply(simp add: set_eqvt)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   346
    apply(blast)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   347
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   348
  have "(set as) \<sharp>* f as x c" by (rule fcb1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   349
  then have "q \<bullet> ((set as) \<sharp>* f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   350
    by (simp add: permute_bool_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   351
  then have "set (q \<bullet> as) \<sharp>* f (q \<bullet> as) (q \<bullet> x) c"
3183
313e6f2cdd89 added permutation simplification to the simplifier; this makes the simplifier more powerful, but it potentially loops more often
Christian Urban <urbanc@in.tum.de>
parents: 3109
diff changeset
   352
    apply(simp only: fresh_star_eqvt set_eqvt)
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
    apply(subst (asm) perm1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   354
    using inc fresh1 fr1
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   355
    apply(auto simp add: fresh_star_def fresh_Pair)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   356
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   357
  then have "set (r \<bullet> bs) \<sharp>* f (r \<bullet> bs) (r \<bullet> y) c" using qq1 qq2 by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   358
  then have "r \<bullet> ((set bs) \<sharp>* f bs y c)"
3183
313e6f2cdd89 added permutation simplification to the simplifier; this makes the simplifier more powerful, but it potentially loops more often
Christian Urban <urbanc@in.tum.de>
parents: 3109
diff changeset
   359
    apply(simp only: fresh_star_eqvt set_eqvt)
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   360
    apply(subst (asm) perm2[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   361
    using qq3 fresh2 fr1
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   362
    apply(auto simp add: set_eqvt fresh_star_def fresh_Pair)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   363
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   364
  then have fcb2: "(set bs) \<sharp>* f bs y c" by (simp add: permute_bool_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   365
  have "f as x c = q \<bullet> (f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   366
    apply(rule perm_supp_eq[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   367
    using inc fcb1 fr1 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   368
  also have "\<dots> = f (q \<bullet> as) (q \<bullet> x) c" 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   369
    apply(rule perm1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   370
    using inc fresh1 fr1 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   371
  also have "\<dots> = f (r \<bullet> bs) (r \<bullet> y) c" using qq1 qq2 by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   372
  also have "\<dots> = r \<bullet> (f bs y c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   373
    apply(rule perm2[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   374
    using qq3 fresh2 fr1 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   375
  also have "... = f bs y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   376
    apply(rule perm_supp_eq)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   377
    using qq3 fr1 fcb2 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   378
  finally show ?thesis by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   379
qed
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   380
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   381
lemma Abs_lst1_fcb2:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   382
  fixes a b :: "atom"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   383
    and x y :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   384
    and c::"'c :: fs"
3191
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
   385
  assumes e: "[[a]]lst. x = [[b]]lst. y"
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   386
  and fcb1: "a \<sharp> f a x c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   387
  and fresh: "{a, b} \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   388
  and perm1: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f a x c) = f (p \<bullet> a) (p \<bullet> x) c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   389
  and perm2: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f b y c) = f (p \<bullet> b) (p \<bullet> y) c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   390
  shows "f a x c = f b y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   391
using e
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   392
apply(drule_tac Abs_lst_fcb2[where c="c" and f="\<lambda>(as::atom list) . f (hd as)"])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   393
apply(simp_all)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   394
using fcb1 fresh perm1 perm2
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   395
apply(simp_all add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   396
done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   397
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   398
lemma Abs_lst1_fcb2':
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   399
  fixes a b :: "'a::at"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   400
    and x y :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   401
    and c::"'c :: fs"
3191
0440bc1a2438 streamlined definition of alpha-equivalence for single binders (used flip instead of swap)
Christian Urban <urbanc@in.tum.de>
parents: 3183
diff changeset
   402
  assumes e: "[[atom a]]lst. x = [[atom b]]lst. y"
2944
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   403
  and fcb1: "atom a \<sharp> f a x c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   404
  and fresh: "{atom a, atom b} \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   405
  and perm1: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f a x c) = f (p \<bullet> a) (p \<bullet> x) c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   406
  and perm2: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f b y c) = f (p \<bullet> b) (p \<bullet> y) c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   407
  shows "f a x c = f b y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   408
using e
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   409
apply(drule_tac Abs_lst1_fcb2[where c="c" and f="\<lambda>a . f ((inv atom) a)"])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   410
using  fcb1 fresh perm1 perm2
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   411
apply(simp_all add: fresh_star_def inv_f_f inj_on_def atom_eqvt)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   412
done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   413
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   414
end