Nominal/Ex/Foo2.thy
author Christian Urban <urbanc@in.tum.de>
Fri, 26 Nov 2010 22:43:26 +0000
changeset 2585 385add25dedf
parent 2584 1eac050a36f4
child 2586 3ebc7ecfb0dd
permissions -rw-r--r--
slightly simplified the Foo2 tests and hint at a general lemma
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
theory Foo2
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
imports "../Nominal2" 
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
begin
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
(* 
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
  Contrived example that has more than one
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
  binding clause
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
*)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
atom_decl name
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
nominal_datatype foo: trm =
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
  Var "name"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
| App "trm" "trm"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
| Lam x::"name" t::"trm"  bind x in t
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
| Let1 a1::"assg" t1::"trm" a2::"assg" t2::"trm" bind "bn a1" in t1, bind "bn a2" in t2
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
| Let2 x::"name" y::"name" t1::"trm" t2::"trm" bind x y in t1, bind y in t2
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
and assg =
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
  As_Nil
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
| As "name" x::"name" t::"trm" "assg" 
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
binder
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
  bn::"assg \<Rightarrow> atom list"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
where
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
 "bn (As x y t a) = [atom x] @ bn a"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
| "bn (As_Nil) = []"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
thm foo.perm_bn_simps
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
thm foo.distinct
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
thm foo.induct
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
thm foo.inducts
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
thm foo.exhaust
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
thm foo.fv_defs
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
thm foo.bn_defs
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
thm foo.perm_simps
2575
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    37
thm foo.eq_iff(5)
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
thm foo.fv_bn_eqvt
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
thm foo.size_eqvt
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
thm foo.supports
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
thm foo.fsupp
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
thm foo.supp
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
thm foo.fresh
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
lemma uu1:
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
  shows "alpha_bn as (permute_bn p as)"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
apply(induct as rule: foo.inducts(2))
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
apply(auto)[5]
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
apply(simp add: foo.perm_bn_simps)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
apply(simp add: foo.eq_iff)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
apply(simp add: foo.perm_bn_simps)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
apply(simp add: foo.eq_iff)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
done
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
lemma tt1:
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
  shows "(p \<bullet> bn as) = bn (permute_bn p as)"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
apply(induct as rule: foo.inducts(2))
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
apply(auto)[5]
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
apply(simp add: foo.perm_bn_simps foo.bn_defs)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
apply(simp add: foo.perm_bn_simps foo.bn_defs)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
apply(simp add: atom_eqvt)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
done
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
lemma Let1_rename:
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
  assumes "supp ([bn assn1]lst. trm1) \<sharp>* p" "supp ([bn assn2]lst. trm2) \<sharp>* p"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
  shows "Let1 assn1 trm1 assn2 trm2 = Let1 (permute_bn p assn1) (p \<bullet> trm1) (permute_bn p assn2) (p \<bullet> trm2)"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
using assms
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
apply -
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
apply(drule supp_perm_eq[symmetric])
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
apply(drule supp_perm_eq[symmetric])
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
apply(simp only: permute_Abs)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
apply(simp only: tt1)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
apply(simp only: foo.eq_iff)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
apply(simp add: uu1)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
done
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
2575
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    78
lemma Let2_rename:
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    79
  assumes "(supp ([[atom x, atom y]]lst. t1)) \<sharp>* p" and "(supp ([[atom y]]lst. t2)) \<sharp>* p"
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    80
  shows "Let2 x y t1 t2 = Let2 (p \<bullet> x) (p \<bullet> y) (p \<bullet> t1) (p \<bullet> t2)"
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    81
  using assms
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    82
  apply -
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    83
  apply(drule supp_perm_eq[symmetric])
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    84
  apply(drule supp_perm_eq[symmetric])
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    85
  apply(simp only: foo.eq_iff)
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    86
  apply(simp only: eqvts)
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    87
  apply simp
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    88
  done
b1d38940040a single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2573
diff changeset
    89
2576
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
    90
lemma Let2_rename2:
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
    91
  assumes "(supp ([[atom x, atom y]]lst. t1)) \<sharp>* p" and "(atom y) \<sharp> p"
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
    92
  shows "Let2 x y t1 t2 = Let2 (p \<bullet> x) y (p \<bullet> t1) t2"
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
    93
  using assms
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
    94
  apply -
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
    95
  apply(drule supp_perm_eq[symmetric])
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
    96
  apply(simp only: foo.eq_iff)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
    97
  apply(simp only: eqvts)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
    98
  apply simp
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
    99
  by (metis assms(2) atom_eqvt fresh_perm)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   100
2577
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   101
lemma Let2_rename3:
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   102
  assumes "(supp ([[atom x, atom y]]lst. t1)) \<sharp>* p"
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   103
  and "(supp ([[atom y]]lst. t2)) \<sharp>* p"
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   104
  and "(atom x) \<sharp> p"
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   105
  shows "Let2 x y t1 t2 = Let2 x (p \<bullet> y) (p \<bullet> t1) (p \<bullet> t2)"
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   106
  using assms
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   107
  apply -
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   108
  apply(drule supp_perm_eq[symmetric])
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   109
  apply(drule supp_perm_eq[symmetric])
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   110
  apply(simp only: foo.eq_iff)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   111
  apply(simp only: eqvts)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   112
  apply simp
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   113
  by (metis assms(2) atom_eqvt fresh_perm)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   114
2578
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   115
lemma strong_exhaust1_pre:
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
  fixes c::"'a::fs"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
  assumes "\<And>name. y = Var name \<Longrightarrow> P" 
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
  and     "\<And>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
  and     "\<And>name trm. \<lbrakk>{atom name} \<sharp>* c; y = Lam name trm\<rbrakk> \<Longrightarrow> P" 
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
  and     "\<And>assn1 trm1 assn2 trm2. 
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
    \<lbrakk>((set (bn assn1)) \<union> (set (bn assn2))) \<sharp>* c; y = Let1 assn1 trm1 assn2 trm2\<rbrakk> \<Longrightarrow> P"
2576
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   122
  and     "\<And>x1 x2 trm1 trm2. \<lbrakk>{atom x1} \<sharp>* c; y = Let2 x1 x2 trm1 trm2\<rbrakk> \<Longrightarrow> P"
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
  shows "P"
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
apply(rule_tac y="y" in foo.exhaust(1))
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
apply(rule assms(1))
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
apply(assumption)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
apply(rule assms(2))
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
apply(assumption)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
apply(subgoal_tac "\<exists>q. (q \<bullet> {atom name}) \<sharp>* c \<and> supp (Lam name trm) \<sharp>* q")
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
apply(erule exE)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
apply(erule conjE)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
apply(rule assms(3))
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
apply(perm_simp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
apply(assumption)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
apply(simp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
apply(drule supp_perm_eq[symmetric])
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
apply(perm_simp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
apply(simp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
apply(rule at_set_avoiding2)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
apply(simp add: finite_supp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
apply(simp add: finite_supp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
apply(simp add: finite_supp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
apply(simp add: foo.fresh fresh_star_def)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
apply(subgoal_tac "\<exists>q. (q \<bullet> (set (bn assg1))) \<sharp>* c \<and> supp ([bn assg1]lst. trm1) \<sharp>* q")
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   145
apply(subgoal_tac "\<exists>q. (q \<bullet> (set (bn assg2))) \<sharp>* c \<and> supp ([bn assg2]lst. trm2) \<sharp>* q")
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
apply(erule exE)+
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
apply(erule conjE)+
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
apply(rule assms(4))
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
apply(simp add: set_eqvt union_eqvt)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
apply(simp add: tt1)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
apply(simp add: fresh_star_union)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
apply(rule conjI)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   153
apply(assumption)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
apply(rotate_tac 3)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
apply(assumption)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
apply(simp add: foo.eq_iff)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
apply(drule supp_perm_eq[symmetric])+
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
apply(simp add: tt1 uu1)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
apply(auto)[1]
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   160
apply(rule at_set_avoiding2)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
apply(simp add: finite_supp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   162
apply(simp add: finite_supp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
apply(simp add: finite_supp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
apply(simp add: Abs_fresh_star)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
apply(rule at_set_avoiding2)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
apply(simp add: finite_supp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
apply(simp add: finite_supp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
apply(simp add: finite_supp)
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
apply(simp add: Abs_fresh_star)
2576
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   170
apply(case_tac "name1 = name2")
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
apply(subgoal_tac 
2576
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   172
  "\<exists>q. (q \<bullet> {atom name1, atom name2}) \<sharp>* c \<and> (supp (([[atom name1, atom name2]]lst. trm1), ([[atom name2]]lst. trm2))) \<sharp>* q")
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
apply(erule exE)+
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
apply(erule conjE)+
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
apply(perm_simp)
2576
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   176
apply(rule assms(5))
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   177
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   178
apply (simp add: fresh_star_def eqvts)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   179
apply (simp only: supp_Pair)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   180
apply (simp only: fresh_star_Un_elim)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   181
apply (subst Let2_rename)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   182
apply assumption
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   183
apply assumption
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   184
apply (rule refl)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   185
apply(rule at_set_avoiding2)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   186
apply(simp add: finite_supp)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   187
apply(simp add: finite_supp)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   188
apply(simp add: finite_supp)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   189
apply clarify
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   190
apply (simp add: fresh_star_def)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   191
apply (simp add: fresh_def supp_Pair supp_Abs)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   192
apply(subgoal_tac
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   193
  "\<exists>q. (q \<bullet> {atom name1}) \<sharp>* c \<and> (supp ((([[atom name1, atom name2]]lst. trm1)), (atom name2))) \<sharp>* q")
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   194
prefer 2
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   195
apply(rule at_set_avoiding2)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   196
apply(simp add: finite_supp)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   197
apply(simp add: finite_supp)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   198
apply(simp add: finite_supp)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   199
apply (simp add: fresh_star_def)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   200
apply (simp add: fresh_def supp_Pair supp_Abs supp_atom)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   201
apply(erule exE)+
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   202
apply(erule conjE)+
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   203
apply(perm_simp)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   204
apply(rule assms(5))
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   205
apply assumption
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   206
apply clarify
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   207
apply (rule_tac x="name1" and y="name2" and ?t1.0="trm1" and ?t2.0="trm2" in Let2_rename2)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   208
apply (simp_all add: fresh_star_Un_elim supp_Pair supp_Abs)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   209
apply (simp add: fresh_star_def supp_atom)
67828f23c4e9 Foo2 strong_exhaust for first variable.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2575
diff changeset
   210
done
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   211
2578
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   212
lemma strong_exhaust1:
2577
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   213
  fixes c::"'a::fs"
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   214
  assumes "\<And>name. y = Var name \<Longrightarrow> P" 
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   215
  and     "\<And>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P"
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   216
  and     "\<And>name trm. \<lbrakk>{atom name} \<sharp>* c; y = Lam name trm\<rbrakk> \<Longrightarrow> P" 
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   217
  and     "\<And>assn1 trm1 assn2 trm2. 
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   218
    \<lbrakk>((set (bn assn1)) \<union> (set (bn assn2))) \<sharp>* c; y = Let1 assn1 trm1 assn2 trm2\<rbrakk> \<Longrightarrow> P"
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   219
  and     "\<And>x1 x2 trm1 trm2. \<lbrakk>{atom x1, atom x2} \<sharp>* c; y = Let2 x1 x2 trm1 trm2\<rbrakk> \<Longrightarrow> P"
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   220
  shows "P"
2578
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   221
  apply (rule strong_exhaust1_pre)
2577
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   222
  apply (erule assms)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   223
  apply (erule assms)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   224
  apply (erule assms) apply assumption
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   225
  apply (erule assms) apply assumption
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   226
apply(case_tac "x1 = x2")
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   227
apply(subgoal_tac 
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   228
  "\<exists>q. (q \<bullet> {atom x1, atom x2}) \<sharp>* c \<and> (supp (([[atom x1, atom x2]]lst. trm1), ([[atom x2]]lst. trm2))) \<sharp>* q")
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   229
apply(erule exE)+
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   230
apply(erule conjE)+
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   231
apply(perm_simp)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   232
apply(rule assms(5))
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   233
apply assumption
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   234
apply simp
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   235
apply (rule Let2_rename)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   236
apply (simp only: supp_Pair)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   237
apply (simp only: fresh_star_Un_elim)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   238
apply (simp only: supp_Pair)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   239
apply (simp only: fresh_star_Un_elim)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   240
apply(rule at_set_avoiding2)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   241
apply(simp add: finite_supp)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   242
apply(simp add: finite_supp)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   243
apply(simp add: finite_supp)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   244
apply clarify
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   245
apply (simp add: fresh_star_def)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   246
apply (simp add: fresh_def supp_Pair supp_Abs)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   247
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   248
  apply(subgoal_tac 
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   249
    "\<exists>q. (q \<bullet> {atom x2}) \<sharp>* c \<and> supp (([[atom x2]]lst. trm2), ([[atom x1, atom x2]]lst. trm1), (atom x1)) \<sharp>* q")
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   250
  apply(erule exE)+
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   251
  apply(erule conjE)+
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   252
  apply(rule assms(5))
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   253
apply(perm_simp)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   254
apply(simp (no_asm) add: fresh_star_insert)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   255
apply(rule conjI)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   256
apply (simp add: fresh_star_def)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   257
apply(rotate_tac 2)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   258
apply(simp add: fresh_star_def)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   259
apply(simp)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   260
apply (rule Let2_rename3)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   261
apply (simp add: supp_Pair fresh_star_union)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   262
apply (simp add: supp_Pair fresh_star_union)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   263
apply (simp add: supp_Pair fresh_star_union)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   264
apply clarify
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   265
apply (simp add: fresh_star_def supp_atom)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   266
apply(rule at_set_avoiding2)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   267
apply(simp add: finite_supp)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   268
apply(simp add: finite_supp)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   269
apply(simp add: finite_supp)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   270
apply(simp add: fresh_star_def)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   271
apply (simp add: fresh_def supp_Pair supp_Abs supp_atom)
d8a676a69047 foo2 full exhausts
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2576
diff changeset
   272
done
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   273
2578
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   274
lemma strong_induct:
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   275
  fixes c :: "'a :: fs"
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   276
  and assg :: assg and trm :: trm
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   277
  assumes a0: "\<And>name c. P1 c (Var name)"
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   278
  and a1: "\<And>trm1 trm2 c. \<lbrakk>\<And>d. P1 d trm1; \<And>d. P1 d trm2\<rbrakk> \<Longrightarrow> P1 c (App trm1 trm2)"
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   279
  and a2: "\<And>name trm c. (\<And>d. P1 d trm) \<Longrightarrow> P1 c (Lam name trm)"
2579
dc988b07755e missing freshness assumptions
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2578
diff changeset
   280
  and a3: "\<And>assg1 trm1 assg2 trm2 c. \<lbrakk>((set (bn assg1)) \<union> (set (bn assg2))) \<sharp>* c; \<And>d. P2 c assg1; \<And>d. P1 d trm1; \<And>d. P2 d assg2; \<And>d. P1 d trm2\<rbrakk> \<Longrightarrow> P1 c (Let1 assg1 trm1 assg2 trm2)"
dc988b07755e missing freshness assumptions
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2578
diff changeset
   281
  and a4: "\<And>name1 name2 trm1 trm2 c. \<lbrakk>{atom name1, atom name2} \<sharp>* c; \<And>d. P1 d trm1; \<And>d. P1 d trm2\<rbrakk> \<Longrightarrow> P1 c (Let2 name1 name2 trm1 trm2)"
2578
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   282
  and a5: "\<And>c. P2 c As_Nil"
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   283
  and a6: "\<And>name1 name2 trm assg c. \<lbrakk>\<And>d. P1 d trm; \<And>d. P2 d assg\<rbrakk> \<Longrightarrow> P2 c (As name1 name2 trm assg)"
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   284
  shows "P1 c trm" "P2 c assg"
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   285
  using assms
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   286
  apply(induction_schema)
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   287
  apply(rule_tac y="trm" and c="c" in strong_exhaust1)
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   288
apply(simp_all)[5]
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   289
apply(rule_tac y="assg" in foo.exhaust(2))
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   290
apply(simp_all)[2]
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   291
apply(relation "measure (sum_case (size o snd) (\<lambda>y. size (snd y)))")
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   292
apply(simp_all add: foo.size)
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   293
done
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   294
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   295
2584
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   296
text {*
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   297
  tests by cu
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   298
*}
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   299
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   300
2585
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   301
thm at_set_avoiding2 supp_perm_eq at_set_avoiding
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   302
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   303
lemma abs_rename_set:
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   304
  fixes x::"'a::fs"
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   305
  assumes "b' \<sharp> x" "sort_of b = sort_of b'"
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   306
  shows "\<exists>y. [{b}]set. x = [{b'}]set. y"
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   307
apply(rule_tac x="(b \<rightleftharpoons> b') \<bullet> x" in exI)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   308
apply(subst Abs_swap1[where a="b" and b="b'"])
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   309
apply(simp)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   310
using assms
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   311
apply(simp add: fresh_def)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   312
apply(perm_simp)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   313
using assms
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   314
apply(simp)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   315
done
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   316
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   317
lemma abs_rename_list:
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   318
  fixes x::"'a::fs"
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   319
  assumes "b' \<sharp> x" "sort_of b = sort_of b'"
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   320
  shows "\<exists>y. [[b]]lst. x = [[b']]lst. y"
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   321
apply(rule_tac x="(b \<rightleftharpoons> b') \<bullet> x" in exI)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   322
apply(subst Abs_swap2[where a="b" and b="b'"])
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   323
apply(simp)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   324
using assms
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   325
apply(simp add: fresh_def)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   326
apply(perm_simp)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   327
using assms
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   328
apply(simp)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   329
done
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   330
2584
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   331
lemma test3:
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   332
  fixes c::"'a::fs"
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   333
  assumes a: "y = Let2 x1 x2 trm1 trm2"
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   334
  and b: "\<forall>x1 x2 trm1 trm2. {atom x1, atom x2} \<sharp>* c \<and> y = Let2 x1 x2 trm1 trm2 \<longrightarrow> P"
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   335
  shows "P"
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   336
using b[simplified a]
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   337
apply -
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   338
apply(subgoal_tac "\<exists>q::perm. (q \<bullet> {atom x1, atom x2}) \<sharp>* (c, x1, x2, trm1, trm2)")
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   339
apply(erule exE)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   340
apply(perm_simp)
2585
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   341
apply(drule_tac x="q \<bullet> x1" in spec)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   342
apply(drule_tac x="q \<bullet> x2" in spec)
2584
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   343
apply(simp only: foo.eq_iff)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   344
apply(simp)
2585
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   345
apply(erule mp)
2584
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   346
apply(rule conjI)
2585
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   347
apply(simp add: fresh_star_prod)
2584
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   348
apply(rule conjI)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   349
prefer 2
2585
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   350
apply(rule abs_rename_list)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   351
apply(simp add: fresh_star_prod)
2584
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   352
apply(simp add: fresh_star_def)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   353
apply(simp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   354
apply(case_tac "x1=x2")
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   355
apply(simp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   356
apply(subst Abs_swap2[where a="atom x2" and b="atom (q \<bullet> x2)"])
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   357
apply(simp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   358
apply(simp add: fresh_star_def)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   359
apply(simp add: fresh_def supp_Pair)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   360
apply(simp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   361
apply(rule exI)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   362
apply(rule refl)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   363
apply(subst Abs_swap2[where a="atom x2" and b="atom (q \<bullet> x2)"])
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   364
apply(simp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   365
apply(simp add: fresh_star_def)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   366
apply(simp add: fresh_def supp_Pair)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   367
apply(simp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   368
apply(simp add: flip_def[symmetric] atom_eqvt)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   369
apply(subgoal_tac "q \<bullet> x2 \<noteq> x1")
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   370
apply(simp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   371
apply(subst Abs_swap2[where a="atom x1" and b="atom (q \<bullet> x1)"])
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   372
apply(simp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   373
apply(subgoal_tac " atom (q \<bullet> x1) \<notin> supp ((x2 \<leftrightarrow> q \<bullet> x2) \<bullet> trm1)")
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   374
apply(simp add: fresh_star_def)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   375
apply(simp add: fresh_star_def)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   376
apply(simp add: fresh_def supp_Pair)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   377
apply(erule conjE)+
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   378
apply(rule_tac p="(x2 \<leftrightarrow> q \<bullet> x2)" in permute_boolE)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   379
apply(simp add: mem_eqvt Not_eqvt atom_eqvt supp_eqvt)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   380
apply(subgoal_tac "q \<bullet> x2 \<noteq> q \<bullet> x1")
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   381
apply(subgoal_tac "x2 \<noteq> q \<bullet> x1")
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   382
apply(simp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   383
apply(simp add: supp_at_base)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   384
apply(simp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   385
apply(simp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   386
apply(rule exI)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   387
apply(rule refl)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   388
apply(simp add: fresh_star_def)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   389
apply(simp add: fresh_def supp_Pair)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   390
apply(simp add: supp_at_base)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   391
apply(rule at_set_avoiding3[where x="()", simplified])
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   392
apply(simp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   393
apply(simp add: finite_supp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   394
apply(simp add: finite_supp)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   395
apply(simp add: fresh_star_def fresh_Unit)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   396
done
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   397
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   398
lemma test4:
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   399
  fixes c::"'a::fs"
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   400
  assumes a: "y = Let2 x1 x2 trm1 trm2"
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   401
  and b: "\<And>x1 x2 trm1 trm2. \<lbrakk>{atom x1, atom x2} \<sharp>* c; y = Let2 x1 x2 trm1 trm2\<rbrakk> \<Longrightarrow> P"
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   402
  shows "P"
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   403
apply(rule test3)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   404
apply(rule a)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   405
using b
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   406
apply(auto)
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   407
done
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   408
2585
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   409
lemma test5:
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   410
  fixes c::"'a::fs"
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   411
  assumes "\<And>name. y = Var name \<Longrightarrow> P" 
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   412
  and     "\<And>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P"
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   413
  and     "\<And>name trm. \<lbrakk>{atom name} \<sharp>* c; y = Lam name trm\<rbrakk> \<Longrightarrow> P" 
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   414
  and     "\<And>assn1 trm1 assn2 trm2. 
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   415
    \<lbrakk>((set (bn assn1)) \<union> (set (bn assn2))) \<sharp>* c; y = Let1 assn1 trm1 assn2 trm2\<rbrakk> \<Longrightarrow> P"
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   416
  and     "\<And>x1 x2 trm1 trm2. \<lbrakk>{atom x1, atom x2} \<sharp>* c; y = Let2 x1 x2 trm1 trm2\<rbrakk> \<Longrightarrow> P"
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   417
  shows "P"
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   418
apply(rule_tac y="y" in foo.exhaust(1))
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   419
apply (erule assms)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   420
apply (erule assms)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   421
prefer 3
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   422
apply(erule test4[where c="c"])
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   423
apply (rule assms(5)) 
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   424
apply assumption
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   425
apply(simp)
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   426
oops
385add25dedf slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents: 2584
diff changeset
   427
2584
1eac050a36f4 completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents: 2579
diff changeset
   428
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   429
end
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   430
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   431
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   432