Nominal/Ex/Foo2.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Thu, 25 Nov 2010 15:06:45 +0900
changeset 2578 64abcfddb0c1
parent 2577 d8a676a69047
child 2579 dc988b07755e
permissions -rw-r--r--
foo2 strong induction
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)"
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   280
  and a3: "\<And>assg1 trm1 assg2 trm2 c. \<lbrakk>\<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)"
64abcfddb0c1 foo2 strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2577
diff changeset
   281
  and a4: "\<And>name1 name2 trm1 trm2 c. \<lbrakk>\<And>d. P1 d trm1; \<And>d. P1 d trm2\<rbrakk> \<Longrightarrow> P1 c (Let2 name1 name2 trm1 trm2)"
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
2573
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   296
end
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   297
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   298
6c131c089ce2 added example Foo2.thy
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   299