Nominal/Ex/LetRecB.thy
changeset 2917 6ad2f1c296a7
parent 2916 b55098314f83
child 2918 aaaed6367b8f
equal deleted inserted replaced
2916:b55098314f83 2917:6ad2f1c296a7
    27 thm let_rec.fv_bn_eqvt
    27 thm let_rec.fv_bn_eqvt
    28 thm let_rec.size_eqvt
    28 thm let_rec.size_eqvt
    29 
    29 
    30 
    30 
    31 lemma Abs_lst_fcb2:
    31 lemma Abs_lst_fcb2:
    32   fixes as bs :: "atom list"
    32   fixes as bs :: "'a :: fs"
    33     and x y :: "'b :: fs"
    33     and x y :: "'b :: fs"
    34     and c::"'c::fs"
    34     and c::"'c::fs"
    35   assumes eq: "[bf as]lst. x = [bf bs]lst. y"
    35   assumes eq: "[ba as]lst. x = [ba bs]lst. y"
    36   and fcb1: "(set (bf as)) \<sharp>* f as x c"
    36   and fcb1: "(set (ba as)) \<sharp>* f as x c"
    37   and fresh1: "set (bf as) \<sharp>* c"
    37   and fresh1: "set (ba as) \<sharp>* c"
    38   and fresh2: "set (bf bs) \<sharp>* c"
    38   and fresh2: "set (ba bs) \<sharp>* c"
    39   and perm1: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f as x c) = f (p \<bullet> as) (p \<bullet> x) c"
    39   and perm1: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f as x c) = f (p \<bullet> as) (p \<bullet> x) c"
    40   and perm2: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f bs y c) = f (p \<bullet> bs) (p \<bullet> y) c"
    40   and perm2: "\<And>p. supp p \<sharp>* c \<Longrightarrow> p \<bullet> (f bs y c) = f (p \<bullet> bs) (p \<bullet> y) c"
    41   and props: "eqvt bf" "inj bf"
    41   and props: "eqvt ba" "inj ba"
    42   shows "f as x c = f bs y c"
    42   shows "f as x c = f bs y c"
    43 proof -
    43 proof -
    44   have "supp (as, x, c) supports (f as x c)"
    44   have "supp (as, x, c) supports (f as x c)"
    45     unfolding  supports_def fresh_def[symmetric]
    45     unfolding  supports_def fresh_def[symmetric]
    46     by (simp add: fresh_Pair perm1 fresh_star_def supp_swap swap_fresh_fresh)
    46     by (simp add: fresh_Pair perm1 fresh_star_def supp_swap swap_fresh_fresh)
    50     unfolding  supports_def fresh_def[symmetric]
    50     unfolding  supports_def fresh_def[symmetric]
    51     by (simp add: fresh_Pair perm2 fresh_star_def supp_swap swap_fresh_fresh)
    51     by (simp add: fresh_Pair perm2 fresh_star_def supp_swap swap_fresh_fresh)
    52   then have fin2: "finite (supp (f bs y c))"
    52   then have fin2: "finite (supp (f bs y c))"
    53     by (auto intro: supports_finite simp add: finite_supp)
    53     by (auto intro: supports_finite simp add: finite_supp)
    54   obtain q::"perm" where 
    54   obtain q::"perm" where 
    55     fr1: "(q \<bullet> (set (bf as))) \<sharp>* (x, c, f as x c, f bs y c)" and 
    55     fr1: "(q \<bullet> (set (ba as))) \<sharp>* (x, c, f as x c, f bs y c)" and 
    56     fr2: "supp q \<sharp>* ([bf as]lst. x)" and 
    56     fr2: "supp q \<sharp>* ([ba as]lst. x)" and 
    57     inc: "supp q \<subseteq> (set (bf as)) \<union> q \<bullet> (set (bf as))"
    57     inc: "supp q \<subseteq> (set (ba as)) \<union> q \<bullet> (set (ba as))"
    58     using at_set_avoiding3[where xs="set (bf as)" and c="(x, c, f as x c, f bs y c)" and x="[bf as]lst. x"]  
    58     using at_set_avoiding3[where xs="set (ba as)" and c="(x, c, f as x c, f bs y c)" and x="[ba as]lst. x"]  
    59       fin1 fin2
    59       fin1 fin2
    60     by (auto simp add: supp_Pair finite_supp Abs_fresh_star dest: fresh_star_supp_conv)
    60     by (auto simp add: supp_Pair finite_supp Abs_fresh_star dest: fresh_star_supp_conv)
    61   have "[q \<bullet> (bf as)]lst. (q \<bullet> x) = q \<bullet> ([bf as]lst. x)" by simp
    61   have "[q \<bullet> (ba as)]lst. (q \<bullet> x) = q \<bullet> ([ba as]lst. x)" by simp
    62   also have "\<dots> = [bf as]lst. x"
    62   also have "\<dots> = [ba as]lst. x"
    63     by (simp only: fr2 perm_supp_eq)
    63     by (simp only: fr2 perm_supp_eq)
    64   finally have "[q \<bullet> (bf as)]lst. (q \<bullet> x) = [bf bs]lst. y" using eq by simp
    64   finally have "[q \<bullet> (ba as)]lst. (q \<bullet> x) = [ba bs]lst. y" using eq by simp
    65   then obtain r::perm where 
    65   then obtain r::perm where 
    66     qq1: "q \<bullet> x = r \<bullet> y" and 
    66     qq1: "q \<bullet> x = r \<bullet> y" and 
    67     qq2: "q \<bullet> (bf as) = r \<bullet> (bf bs)" and 
    67     qq2: "q \<bullet> (ba as) = r \<bullet> (ba bs)" and 
    68     qq3: "supp r \<subseteq> (q \<bullet> (set (bf as))) \<union> set (bf bs)"
    68     qq3: "supp r \<subseteq> (q \<bullet> (set (ba as))) \<union> set (ba bs)"
    69     apply(drule_tac sym)
    69     apply(drule_tac sym)
    70     apply(simp only: Abs_eq_iff2 alphas)
    70     apply(simp only: Abs_eq_iff2 alphas)
    71     apply(erule exE)
    71     apply(erule exE)
    72     apply(erule conjE)+
    72     apply(erule conjE)+
    73     apply(drule_tac x="p" in meta_spec)
    73     apply(drule_tac x="p" in meta_spec)
    76     done
    76     done
    77   have qq4: "q \<bullet> as = r \<bullet> bs" using qq2 props unfolding eqvt_def inj_on_def
    77   have qq4: "q \<bullet> as = r \<bullet> bs" using qq2 props unfolding eqvt_def inj_on_def
    78     apply(perm_simp)
    78     apply(perm_simp)
    79     apply(simp)
    79     apply(simp)
    80     done
    80     done
    81   have "(set (bf as)) \<sharp>* f as x c" by (rule fcb1)
    81   have "(set (ba as)) \<sharp>* f as x c" by (rule fcb1)
    82   then have "q \<bullet> ((set (bf as)) \<sharp>* f as x c)"
    82   then have "q \<bullet> ((set (ba as)) \<sharp>* f as x c)"
    83     by (simp add: permute_bool_def)
    83     by (simp add: permute_bool_def)
    84   then have "set (q \<bullet> (bf as)) \<sharp>* f (q \<bullet> as) (q \<bullet> x) c"
    84   then have "set (q \<bullet> (ba as)) \<sharp>* f (q \<bullet> as) (q \<bullet> x) c"
    85     apply(simp add: fresh_star_eqvt set_eqvt)
    85     apply(simp add: fresh_star_eqvt set_eqvt)
    86     apply(subst (asm) perm1)
    86     apply(subst (asm) perm1)
    87     using inc fresh1 fr1
    87     using inc fresh1 fr1
    88     apply(auto simp add: fresh_star_def fresh_Pair)
    88     apply(auto simp add: fresh_star_def fresh_Pair)
    89     done
    89     done
    90   then have "set (r \<bullet> (bf bs)) \<sharp>* f (r \<bullet> bs) (r \<bullet> y) c" using qq1 qq2 qq4
    90   then have "set (r \<bullet> (ba bs)) \<sharp>* f (r \<bullet> bs) (r \<bullet> y) c" using qq1 qq2 qq4
    91     by simp
    91     by simp
    92   then have "r \<bullet> ((set (bf bs)) \<sharp>* f bs y c)"
    92   then have "r \<bullet> ((set (ba bs)) \<sharp>* f bs y c)"
    93     apply(simp add: fresh_star_eqvt set_eqvt)
    93     apply(simp add: fresh_star_eqvt set_eqvt)
    94     apply(subst (asm) perm2[symmetric])
    94     apply(subst (asm) perm2[symmetric])
    95     using qq3 fresh2 fr1
    95     using qq3 fresh2 fr1
    96     apply(auto simp add: set_eqvt fresh_star_def fresh_Pair)
    96     apply(auto simp add: set_eqvt fresh_star_def fresh_Pair)
    97     done
    97     done
    98   then have fcb2: "(set (bf bs)) \<sharp>* f bs y c" by (simp add: permute_bool_def)
    98   then have fcb2: "(set (ba bs)) \<sharp>* f bs y c" by (simp add: permute_bool_def)
    99   have "f as x c = q \<bullet> (f as x c)"
    99   have "f as x c = q \<bullet> (f as x c)"
   100     apply(rule perm_supp_eq[symmetric])
   100     apply(rule perm_supp_eq[symmetric])
   101     using inc fcb1 fr1 by (auto simp add: fresh_star_def)
   101     using inc fcb1 fr1 by (auto simp add: fresh_star_def)
   102   also have "\<dots> = f (q \<bullet> as) (q \<bullet> x) c" 
   102   also have "\<dots> = f (q \<bullet> as) (q \<bullet> x) c" 
   103     apply(rule perm1)
   103     apply(rule perm1)
   142   apply(simp add: eqvt_def)
   142   apply(simp add: eqvt_def)
   143   apply(perm_simp)
   143   apply(perm_simp)
   144   apply(simp)
   144   apply(simp)
   145   apply(simp add: inj_on_def)
   145   apply(simp add: inj_on_def)
   146   --"HERE"
   146   --"HERE"
   147   apply (drule_tac c="()" in Abs_lst_fcb2)
   147   thm Abs_lst_fcb Abs_lst_fcb2
       
   148   apply (drule_tac c="()" and ba="bn" in Abs_lst_fcb2)
   148   prefer 8
   149   prefer 8
   149   apply(assumption)
   150   apply(assumption)
   150   apply (drule_tac c="()" in Abs_lst_fcb2)
   151   apply (drule_tac c="()" in Abs_lst_fcb2)
   151   apply (simp add: Abs_eq_iff2)
   152   apply (simp add: Abs_eq_iff2)
   152   apply (simp add: alphas)
   153   apply (simp add: alphas)