Nominal/Nominal2_FCB.thy
author Christian Urban <urbanc@in.tum.de>
Tue, 19 Jul 2011 09:40:46 +0100
changeset 2978 967c55907ce1
parent 2946 d9c3cc271e62
child 3105 1b0d230445ce
permissions -rw-r--r--
merged
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
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
    15
   val tac = TRYALL (SOLVED' (full_simp_tac (simpset_of 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
    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:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
  fixes x y :: "'a :: at_base"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
    and S T :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
  assumes e: "(Abs_lst [atom x] T) = (Abs_lst [atom y] S)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
  and f1: "\<lbrakk>x \<noteq> y; atom y \<sharp> T; atom x \<sharp> (atom y \<rightleftharpoons> atom x) \<bullet> T\<rbrakk> \<Longrightarrow> atom x \<sharp> f x T"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
  and f2: "\<lbrakk>x \<noteq> y; atom y \<sharp> T; atom x \<sharp> (atom y \<rightleftharpoons> atom x) \<bullet> T\<rbrakk> \<Longrightarrow> atom y \<sharp> f x T"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
  and p: "\<lbrakk>S = (atom x \<rightleftharpoons> atom y) \<bullet> T; x \<noteq> y; atom y \<sharp> T; atom x \<sharp> S\<rbrakk> 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
    \<Longrightarrow> (atom x \<rightleftharpoons> atom y) \<bullet> (f x T) = f y S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
  and s: "sort_of (atom x) = sort_of (atom y)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
  shows "f x T = f y S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
  using e
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
  apply(case_tac "atom x \<sharp> S")
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
  apply(simp add: Abs1_eq_iff'[OF s s])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
  apply(elim conjE disjE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
  apply(simp)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
  apply(rule trans)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
  apply(rule_tac p="(atom x \<rightleftharpoons> atom y)" in supp_perm_eq[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
  apply(rule fresh_star_supp_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
  apply(simp add: supp_swap fresh_star_def s f1 f2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
  apply(simp add: swap_commute p)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
  apply(simp add: Abs1_eq_iff[OF s s])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
  done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
lemma Abs_lst_fcb:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
  fixes xs ys :: "'a :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
    and S T :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
  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
    51
    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
    52
    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
    53
    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
    54
      \<Longrightarrow> p \<bullet> (f xs T) = f ys S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
  shows "f xs T = f ys S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
  using e apply -
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
  apply(subst (asm) Abs_eq_iff2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
  apply(simp add: alphas)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
  apply(elim exE conjE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
  apply(rule trans)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
  apply(rule_tac p="p" in supp_perm_eq[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
  apply(rule fresh_star_supp_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
  apply(drule fresh_star_perm_set_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
  apply(rule finite_Diff)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
  apply(rule finite_supp)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
  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
    67
  apply(metis Un_absorb2 fresh_star_Un)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
  apply(subst fresh_star_Un)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
  apply(rule conjI)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
  apply(simp add: fresh_star_def f1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
  apply(simp add: fresh_star_def f2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
  apply(simp add: eqv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
  done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
lemma Abs_set_fcb:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
  fixes xs ys :: "'a :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
    and S T :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
  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
    79
    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
    80
    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
    81
    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
    82
  shows "f xs T = f ys S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
  using e apply -
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
  apply(subst (asm) Abs_eq_iff2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
  apply(simp add: alphas)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
  apply(elim exE conjE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
  apply(rule trans)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
  apply(rule_tac p="p" in supp_perm_eq[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
  apply(rule fresh_star_supp_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
  apply(drule fresh_star_perm_set_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
  apply(rule finite_Diff)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
  apply(rule finite_supp)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
  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
    94
  apply(metis Un_absorb2 fresh_star_Un)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
  apply(subst fresh_star_Un)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
  apply(rule conjI)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
  apply(simp add: fresh_star_def f1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
  apply(simp add: fresh_star_def f2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
  apply(simp add: eqv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
  done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
lemma Abs_res_fcb:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
  fixes xs ys :: "('a :: at_base) set"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
    and S T :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
  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
   106
    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
   107
    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
   108
    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
   109
      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
   110
  shows "f xs T = f ys S"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
  using e apply -
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
  apply(subst (asm) Abs_eq_res_set)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
  apply(subst (asm) Abs_eq_iff2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
  apply(simp add: alphas)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
  apply(elim exE conjE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
  apply(rule trans)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
  apply(rule_tac p="p" in supp_perm_eq[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
  apply(rule fresh_star_supp_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
  apply(drule fresh_star_perm_set_conv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
  apply(rule finite_Diff)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
  apply(rule finite_supp)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
  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
   123
  apply(metis Un_absorb2 fresh_star_Un)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
  apply(subst fresh_star_Un)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
  apply(rule conjI)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
  apply(simp add: fresh_star_def f1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
  apply(subgoal_tac "supp T - atom ` xs = supp S - atom ` ys")
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
  apply(simp add: fresh_star_def f2)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
  apply(blast)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
  apply(simp add: eqv)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
  done
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
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
lemma Abs_set_fcb2:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
  fixes as bs :: "atom set"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
    and x y :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
    and c::"'c::fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
  assumes eq: "[as]set. x = [bs]set. y"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
  and fin: "finite as" "finite bs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
  and fcb1: "as \<sharp>* f as x c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
  and fresh1: "as \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
  and fresh2: "bs \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
  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
   145
  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
   146
  shows "f as x c = f bs y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
proof -
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
  have "supp (as, x, c) supports (f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
    unfolding  supports_def fresh_def[symmetric]
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
    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
   151
  then have fin1: "finite (supp (f as x c))"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
    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
   153
  have "supp (bs, y, c) supports (f bs y c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
    unfolding  supports_def fresh_def[symmetric]
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
    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
   156
  then have fin2: "finite (supp (f bs y c))"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
    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
   158
  obtain q::"perm" where 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
    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
   160
    fr2: "supp q \<sharp>* ([as]set. x)" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
    inc: "supp q \<subseteq> as \<union> (q \<bullet> as)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   162
    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
   163
      fin1 fin2 fin
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
    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
   165
  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
   166
  also have "\<dots> = [as]set. x"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
    by (simp only: fr2 perm_supp_eq)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
  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
   169
  then obtain r::perm where 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
    qq1: "q \<bullet> x = r \<bullet> y" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
    qq2: "q \<bullet> as = r \<bullet> bs" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
    qq3: "supp r \<subseteq> (q \<bullet> as) \<union> bs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
    apply(drule_tac sym)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
    apply(simp only: Abs_eq_iff2 alphas)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
    apply(erule exE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
    apply(erule conjE)+
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
    apply(drule_tac x="p" in meta_spec)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   178
    apply(simp add: set_eqvt)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   179
    apply(blast)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   180
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   181
  have "as \<sharp>* f as x c" by (rule fcb1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   182
  then have "q \<bullet> (as \<sharp>* f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
    by (simp add: permute_bool_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   184
  then have "(q \<bullet> as) \<sharp>* f (q \<bullet> as) (q \<bullet> x) c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185
    apply(simp add: fresh_star_eqvt set_eqvt)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   186
    apply(subst (asm) perm1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   187
    using inc fresh1 fr1
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188
    apply(auto simp add: fresh_star_def fresh_Pair)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
  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
   191
  then have "r \<bullet> (bs \<sharp>* f bs y c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   192
    apply(simp add: fresh_star_eqvt set_eqvt)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   193
    apply(subst (asm) perm2[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   194
    using qq3 fresh2 fr1
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195
    apply(auto simp add: set_eqvt fresh_star_def fresh_Pair)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   196
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   197
  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
   198
  have "f as x c = q \<bullet> (f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   199
    apply(rule perm_supp_eq[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   200
    using inc fcb1 fr1 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   201
  also have "\<dots> = f (q \<bullet> as) (q \<bullet> x) c" 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   202
    apply(rule perm1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   203
    using inc fresh1 fr1 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   204
  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
   205
  also have "\<dots> = r \<bullet> (f bs y c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   206
    apply(rule perm2[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   207
    using qq3 fresh2 fr1 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   208
  also have "... = f bs y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   209
    apply(rule perm_supp_eq)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   210
    using qq3 fr1 fcb2 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   211
  finally show ?thesis by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   212
qed
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
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   215
text {* NOT DONE 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   216
lemma Abs_res_fcb2:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   217
  fixes as bs :: "atom set"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   218
    and x y :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   219
    and c::"'c::fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   220
  assumes eq: "[as]res. x = [bs]res. y"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   221
  and fin: "finite as" "finite bs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   222
  and fcb1: "as \<sharp>* f as x c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   223
  and fresh1: "as \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   224
  and fresh2: "bs \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   225
  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
   226
  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
   227
  shows "f as x c = f bs y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   228
proof -
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   229
  have "supp (as, x, c) supports (f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   230
    unfolding  supports_def fresh_def[symmetric]
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   231
    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
   232
  then have fin1: "finite (supp (f as x c))"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   233
    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
   234
  have "supp (bs, y, c) supports (f bs y c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   235
    unfolding  supports_def fresh_def[symmetric]
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   236
    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
   237
  then have fin2: "finite (supp (f bs y c))"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   238
    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
   239
  obtain q::"perm" where 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   240
    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
   241
    fr2: "supp q \<sharp>* ([as]res. x)" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   242
    inc: "supp q \<subseteq> as \<union> (q \<bullet> as)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   243
    using at_set_avoiding3[where xs="as" and c="(x, c, f as x c, f bs y c)" and x="[as]res. x"]  
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   244
      fin1 fin2 fin
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   245
    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
   246
  have "[q \<bullet> as]res. (q \<bullet> x) = q \<bullet> ([as]res. x)" by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   247
  also have "\<dots> = [as]res. x"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   248
    by (simp only: fr2 perm_supp_eq)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   249
  finally have "[q \<bullet> as]res. (q \<bullet> x) = [bs]res. y" using eq by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   250
  then obtain r::perm where 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   251
    qq1: "q \<bullet> x = r \<bullet> y" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   252
    qq2: "(q \<bullet> as \<inter> supp (q \<bullet> x)) = r \<bullet> (bs \<inter> supp y)" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   253
    qq3: "supp r \<subseteq> bs \<inter> supp y \<union> q \<bullet> as \<inter> supp (q \<bullet> x)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   254
    apply(drule_tac sym)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   255
    apply(subst(asm) Abs_eq_res_set)
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)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   260
    apply(simp add: set_eqvt)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   261
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   262
  have "(as \<inter> supp x) \<sharp>* f (as \<inter> supp x) x c" sorry (* FCB? *)
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"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   266
    apply(simp add: fresh_star_eqvt set_eqvt)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   267
    sorry (* perm? *)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   268
  then have "r \<bullet> (bs \<inter> supp y) \<sharp>* f (r \<bullet> (bs \<inter> supp y)) (r \<bullet> y) c" using qq2 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   269
    apply (simp add: inter_eqvt)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   270
    sorry
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   271
  (* rest similar reversing it other way around... *)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   272
  show ?thesis sorry
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   273
qed
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   274
*}
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   275
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   276
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   277
lemma Abs_lst_fcb2:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   278
  fixes as bs :: "atom list"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   279
    and x y :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   280
    and c::"'c::fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   281
  assumes eq: "[as]lst. x = [bs]lst. y"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   282
  and fcb1: "(set as) \<sharp>* f as x c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   283
  and fresh1: "set as \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   284
  and fresh2: "set bs \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   285
  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
   286
  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
   287
  shows "f as x c = f bs y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   288
proof -
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   289
  have "supp (as, x, c) supports (f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   290
    unfolding  supports_def fresh_def[symmetric]
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   291
    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
   292
  then have fin1: "finite (supp (f as x c))"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   293
    by (auto intro: supports_finite simp add: finite_supp)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   294
  have "supp (bs, y, c) supports (f bs y c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   295
    unfolding  supports_def fresh_def[symmetric]
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   296
    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
   297
  then have fin2: "finite (supp (f bs y c))"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   298
    by (auto intro: supports_finite simp add: finite_supp)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   299
  obtain q::"perm" where 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   300
    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
   301
    fr2: "supp q \<sharp>* Abs_lst as x" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   302
    inc: "supp q \<subseteq> (set as) \<union> q \<bullet> (set as)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   303
    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
   304
      fin1 fin2
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   305
    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
   306
  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
   307
  also have "\<dots> = Abs_lst as x"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   308
    by (simp only: fr2 perm_supp_eq)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   309
  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
   310
  then obtain r::perm where 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   311
    qq1: "q \<bullet> x = r \<bullet> y" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   312
    qq2: "q \<bullet> as = r \<bullet> bs" and 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   313
    qq3: "supp r \<subseteq> (q \<bullet> (set as)) \<union> set bs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   314
    apply(drule_tac sym)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   315
    apply(simp only: Abs_eq_iff2 alphas)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   316
    apply(erule exE)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   317
    apply(erule conjE)+
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   318
    apply(drule_tac x="p" in meta_spec)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   319
    apply(simp add: set_eqvt)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   320
    apply(blast)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   321
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   322
  have "(set as) \<sharp>* f as x c" by (rule fcb1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   323
  then have "q \<bullet> ((set as) \<sharp>* f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   324
    by (simp add: permute_bool_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   325
  then have "set (q \<bullet> as) \<sharp>* f (q \<bullet> as) (q \<bullet> x) c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   326
    apply(simp add: fresh_star_eqvt set_eqvt)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   327
    apply(subst (asm) perm1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   328
    using inc fresh1 fr1
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   329
    apply(auto simp add: fresh_star_def fresh_Pair)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   330
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   331
  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
   332
  then have "r \<bullet> ((set bs) \<sharp>* f bs y c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   333
    apply(simp add: fresh_star_eqvt set_eqvt)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   334
    apply(subst (asm) perm2[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   335
    using qq3 fresh2 fr1
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   336
    apply(auto simp add: set_eqvt fresh_star_def fresh_Pair)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   337
    done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   338
  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
   339
  have "f as x c = q \<bullet> (f as x c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   340
    apply(rule perm_supp_eq[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   341
    using inc fcb1 fr1 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   342
  also have "\<dots> = f (q \<bullet> as) (q \<bullet> x) c" 
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   343
    apply(rule perm1)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
    using inc fresh1 fr1 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   345
  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
   346
  also have "\<dots> = r \<bullet> (f bs y c)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   347
    apply(rule perm2[symmetric])
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   348
    using qq3 fresh2 fr1 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   349
  also have "... = f bs y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   350
    apply(rule perm_supp_eq)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   351
    using qq3 fr1 fcb2 by (auto simp add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   352
  finally show ?thesis by simp
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
qed
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   354
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   355
lemma Abs_lst1_fcb2:
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   356
  fixes a b :: "atom"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   357
    and x y :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   358
    and c::"'c :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   359
  assumes e: "(Abs_lst [a] x) = (Abs_lst [b] y)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   360
  and fcb1: "a \<sharp> f a x c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   361
  and fresh: "{a, b} \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   362
  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
   363
  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
   364
  shows "f a x c = f b y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   365
using e
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   366
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
   367
apply(simp_all)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   368
using fcb1 fresh perm1 perm2
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   369
apply(simp_all add: fresh_star_def)
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   370
done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   371
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   372
lemma Abs_lst1_fcb2':
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   373
  fixes a b :: "'a::at"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   374
    and x y :: "'b :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   375
    and c::"'c :: fs"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   376
  assumes e: "(Abs_lst [atom a] x) = (Abs_lst [atom b] y)"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   377
  and fcb1: "atom a \<sharp> f a x c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   378
  and fresh: "{atom a, atom b} \<sharp>* c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   379
  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
   380
  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
   381
  shows "f a x c = f b y c"
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   382
using e
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   383
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
   384
using  fcb1 fresh perm1 perm2
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   385
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
   386
done
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   387
8648ae682442 all FCB lemmas
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   388
end