author | Christian Urban <urbanc@in.tum.de> |
Mon, 15 Nov 2010 20:54:01 +0000 | |
changeset 2572 | 73196608ec04 |
parent 2571 | f0252365936c |
child 2573 | 6c131c089ce2 |
permissions | -rw-r--r-- |
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1 |
theory Foo1 |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
2 |
imports "../Nominal2" |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
4 |
|
2564 | 5 |
text {* |
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
6 |
Contrived example that has more than one |
2564 | 7 |
binding function |
8 |
*} |
|
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
9 |
|
2571
f0252365936c
proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents:
2564
diff
changeset
|
10 |
|
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
11 |
atom_decl name |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
12 |
|
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
13 |
nominal_datatype foo: trm = |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
14 |
Var "name" |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
15 |
| App "trm" "trm" |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
16 |
| Lam x::"name" t::"trm" bind x in t |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
17 |
| Let1 a::"assg" t::"trm" bind "bn1 a" in t |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
18 |
| Let2 a::"assg" t::"trm" bind "bn2 a" in t |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
19 |
| Let3 a::"assg" t::"trm" bind "bn3 a" in t |
2564 | 20 |
| Let4 a::"assg'" t::"trm" bind (set) "bn4 a" in t |
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
21 |
and assg = |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
22 |
As "name" "name" "trm" |
2564 | 23 |
and assg' = |
24 |
BNil |
|
25 |
| BAs "name" "assg'" |
|
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
26 |
binder |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
27 |
bn1::"assg \<Rightarrow> atom list" and |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
28 |
bn2::"assg \<Rightarrow> atom list" and |
2564 | 29 |
bn3::"assg \<Rightarrow> atom list" and |
30 |
bn4::"assg' \<Rightarrow> atom set" |
|
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
31 |
where |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
32 |
"bn1 (As x y t) = [atom x]" |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
33 |
| "bn2 (As x y t) = [atom y]" |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
34 |
| "bn3 (As x y t) = [atom x, atom y]" |
2564 | 35 |
| "bn4 (BNil) = {}" |
36 |
| "bn4 (BAs a as) = {atom a} \<union> bn4 as" |
|
37 |
||
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
38 |
|
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
39 |
thm foo.distinct |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
40 |
thm foo.induct |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
41 |
thm foo.inducts |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
42 |
thm foo.exhaust |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
43 |
thm foo.fv_defs |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
44 |
thm foo.bn_defs |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
45 |
thm foo.perm_simps |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
46 |
thm foo.eq_iff |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
47 |
thm foo.fv_bn_eqvt |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
48 |
thm foo.size_eqvt |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
49 |
thm foo.supports |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
50 |
thm foo.fsupp |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
51 |
thm foo.supp |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
52 |
thm foo.fresh |
2571
f0252365936c
proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents:
2564
diff
changeset
|
53 |
thm foo.bn_finite |
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
54 |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
55 |
lemma uu1: |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
56 |
shows "alpha_bn1 as (permute_bn1 p as)" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
57 |
apply(induct as rule: foo.inducts(2)) |
2564 | 58 |
apply(auto)[7] |
59 |
apply(simp add: foo.perm_bn_simps) |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
60 |
apply(simp add: foo.eq_iff) |
2564 | 61 |
apply(auto) |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
62 |
done |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
63 |
|
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
64 |
lemma uu2: |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
65 |
shows "alpha_bn2 as (permute_bn2 p as)" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
66 |
apply(induct as rule: foo.inducts(2)) |
2564 | 67 |
apply(auto)[7] |
68 |
apply(simp add: foo.perm_bn_simps) |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
69 |
apply(simp add: foo.eq_iff) |
2564 | 70 |
apply(auto) |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
71 |
done |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
72 |
|
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
73 |
lemma uu3: |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
74 |
shows "alpha_bn3 as (permute_bn3 p as)" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
75 |
apply(induct as rule: foo.inducts(2)) |
2564 | 76 |
apply(auto)[7] |
77 |
apply(simp add: foo.perm_bn_simps) |
|
78 |
apply(simp add: foo.eq_iff) |
|
79 |
apply(auto) |
|
80 |
done |
|
81 |
||
82 |
lemma uu4: |
|
83 |
shows "alpha_bn4 as (permute_bn4 p as)" |
|
84 |
apply(induct as rule: foo.inducts(3)) |
|
85 |
apply(auto)[8] |
|
86 |
apply(simp add: foo.perm_bn_simps) |
|
87 |
apply(simp add: foo.eq_iff) |
|
88 |
apply(simp add: foo.perm_bn_simps) |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
89 |
apply(simp add: foo.eq_iff) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
90 |
done |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
91 |
|
2564 | 92 |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
93 |
lemma tt1: |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
94 |
shows "(p \<bullet> bn1 as) = bn1 (permute_bn1 p as)" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
95 |
apply(induct as rule: foo.inducts(2)) |
2564 | 96 |
apply(auto)[7] |
97 |
apply(simp add: foo.perm_bn_simps foo.bn_defs) |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
98 |
apply(simp add: atom_eqvt) |
2564 | 99 |
apply(auto) |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
100 |
done |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
101 |
|
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
102 |
lemma tt2: |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
103 |
shows "(p \<bullet> bn2 as) = bn2 (permute_bn2 p as)" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
104 |
apply(induct as rule: foo.inducts(2)) |
2564 | 105 |
apply(auto)[7] |
106 |
apply(simp add: foo.perm_bn_simps foo.bn_defs) |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
107 |
apply(simp add: atom_eqvt) |
2564 | 108 |
apply(auto) |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
109 |
done |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
110 |
|
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
111 |
lemma tt3: |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
112 |
shows "(p \<bullet> bn3 as) = bn3 (permute_bn3 p as)" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
113 |
apply(induct as rule: foo.inducts(2)) |
2564 | 114 |
apply(auto)[7] |
115 |
apply(simp add: foo.perm_bn_simps foo.bn_defs) |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
116 |
apply(simp add: atom_eqvt) |
2564 | 117 |
apply(auto) |
118 |
done |
|
119 |
||
120 |
lemma tt4: |
|
121 |
shows "(p \<bullet> bn4 as) = bn4 (permute_bn4 p as)" |
|
122 |
apply(induct as rule: foo.inducts(3)) |
|
123 |
apply(auto)[8] |
|
124 |
apply(simp add: foo.perm_bn_simps foo.bn_defs permute_set_eq) |
|
125 |
apply(simp add: foo.perm_bn_simps foo.bn_defs) |
|
126 |
apply(simp add: atom_eqvt insert_eqvt) |
|
127 |
done |
|
128 |
||
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
129 |
|
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
130 |
|
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
131 |
lemma strong_exhaust1: |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
132 |
fixes c::"'a::fs" |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
133 |
assumes "\<And>name. y = Var name \<Longrightarrow> P" |
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
134 |
and "\<And>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P" |
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
135 |
and "\<And>name trm. \<lbrakk>{atom name} \<sharp>* c; y = Lam name trm\<rbrakk> \<Longrightarrow> P" |
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
136 |
and "\<And>assn trm. \<lbrakk>set (bn1 assn) \<sharp>* c; y = Let1 assn trm\<rbrakk> \<Longrightarrow> P" |
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
137 |
and "\<And>assn trm. \<lbrakk>set (bn2 assn) \<sharp>* c; y = Let2 assn trm\<rbrakk> \<Longrightarrow> P" |
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
138 |
and "\<And>assn trm. \<lbrakk>set (bn3 assn) \<sharp>* c; y = Let3 assn trm\<rbrakk> \<Longrightarrow> P" |
2564 | 139 |
and "\<And>assn' trm. \<lbrakk>(bn4 assn') \<sharp>* c; y = Let4 assn' trm\<rbrakk> \<Longrightarrow> P" |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
140 |
shows "P" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
141 |
apply(rule_tac y="y" in foo.exhaust(1)) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
142 |
apply(rule assms(1)) |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
143 |
apply(assumption) |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
144 |
apply(rule assms(2)) |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
145 |
apply(assumption) |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
146 |
apply(subgoal_tac "\<exists>q. (q \<bullet> {atom name}) \<sharp>* c \<and> supp (Lam name trm) \<sharp>* q") |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
147 |
apply(erule exE) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
148 |
apply(erule conjE) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
149 |
apply(rule assms(3)) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
150 |
apply(perm_simp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
151 |
apply(assumption) |
2571
f0252365936c
proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents:
2564
diff
changeset
|
152 |
apply(simp) |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
153 |
apply(drule supp_perm_eq[symmetric]) |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
154 |
apply(perm_simp) |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
155 |
apply(simp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
156 |
apply(rule at_set_avoiding2) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
157 |
apply(simp add: finite_supp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
158 |
apply(simp add: finite_supp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
159 |
apply(simp add: finite_supp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
160 |
apply(simp add: foo.fresh fresh_star_def) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
161 |
apply(subgoal_tac "\<exists>q. (q \<bullet> (set (bn1 assg))) \<sharp>* c \<and> supp ([bn1 assg]lst.trm) \<sharp>* q") |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
162 |
apply(erule exE) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
163 |
apply(erule conjE) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
164 |
apply(rule assms(4)) |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
165 |
apply(perm_simp add: tt1) |
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
166 |
apply(assumption) |
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
167 |
apply(drule supp_perm_eq[symmetric]) |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
168 |
apply(simp add: foo.eq_iff) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
169 |
apply(simp add: tt1 uu1) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
170 |
apply(rule at_set_avoiding2) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
171 |
apply(simp add: finite_supp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
172 |
apply(simp add: finite_supp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
173 |
apply(simp add: finite_supp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
174 |
apply(simp add: Abs_fresh_star) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
175 |
apply(subgoal_tac "\<exists>q. (q \<bullet> (set (bn2 assg))) \<sharp>* c \<and> supp ([bn2 assg]lst.trm) \<sharp>* q") |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
176 |
apply(erule exE) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
177 |
apply(erule conjE) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
178 |
apply(rule assms(5)) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
179 |
apply(simp add: set_eqvt) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
180 |
apply(simp add: tt2) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
181 |
apply(simp add: foo.eq_iff) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
182 |
apply(drule supp_perm_eq[symmetric]) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
183 |
apply(simp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
184 |
apply(simp add: tt2 uu2) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
185 |
apply(rule at_set_avoiding2) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
186 |
apply(simp add: finite_supp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
187 |
apply(simp add: finite_supp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
188 |
apply(simp add: finite_supp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
189 |
apply(simp add: Abs_fresh_star) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
190 |
apply(subgoal_tac "\<exists>q. (q \<bullet> (set (bn3 assg))) \<sharp>* c \<and> supp ([bn3 assg]lst.trm) \<sharp>* q") |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
191 |
apply(erule exE) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
192 |
apply(erule conjE) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
193 |
apply(rule assms(6)) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
194 |
apply(simp add: set_eqvt) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
195 |
apply(simp add: tt3) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
196 |
apply(simp add: foo.eq_iff) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
197 |
apply(drule supp_perm_eq[symmetric]) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
198 |
apply(simp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
199 |
apply(simp add: tt3 uu3) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
200 |
apply(rule at_set_avoiding2) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
201 |
apply(simp add: finite_supp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
202 |
apply(simp add: finite_supp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
203 |
apply(simp add: finite_supp) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
204 |
apply(simp add: Abs_fresh_star) |
2564 | 205 |
apply(subgoal_tac "\<exists>q. (q \<bullet> (bn4 assg')) \<sharp>* c \<and> supp ([bn4 assg']set.trm) \<sharp>* q") |
206 |
apply(erule exE) |
|
207 |
apply(erule conjE) |
|
208 |
apply(rule assms(7)) |
|
209 |
apply(simp add: tt4) |
|
210 |
apply(simp add: foo.eq_iff) |
|
211 |
apply(drule supp_perm_eq[symmetric]) |
|
212 |
apply(simp) |
|
213 |
apply(simp add: tt4 uu4) |
|
214 |
apply(rule at_set_avoiding2) |
|
2571
f0252365936c
proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents:
2564
diff
changeset
|
215 |
apply(simp add: foo.bn_finite) |
2564 | 216 |
apply(simp add: finite_supp) |
217 |
apply(simp add: finite_supp) |
|
218 |
apply(simp add: Abs_fresh_star) |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
219 |
done |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
220 |
|
2572 | 221 |
thm strong_exhaust1 foo.exhaust(1) |
222 |
||
223 |
||
2571
f0252365936c
proved that bn functions return a finite set
Christian Urban <urbanc@in.tum.de>
parents:
2564
diff
changeset
|
224 |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
225 |
lemma strong_exhaust2: |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
226 |
assumes "\<And>x y t. as = As x y t \<Longrightarrow> P" |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
227 |
shows "P" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
228 |
apply(rule_tac y="as" in foo.exhaust(2)) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
229 |
apply(rule assms(1)) |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
230 |
apply(assumption) |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
231 |
done |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
232 |
|
2564 | 233 |
lemma strong_exhaust3: |
234 |
assumes "as' = BNil \<Longrightarrow> P" |
|
235 |
and "\<And>a as. as' = BAs a as \<Longrightarrow> P" |
|
236 |
shows "P" |
|
237 |
apply(rule_tac y="as'" in foo.exhaust(3)) |
|
238 |
apply(rule assms(1)) |
|
239 |
apply(assumption) |
|
240 |
apply(rule assms(2)) |
|
241 |
apply(assumption) |
|
242 |
done |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
243 |
|
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
244 |
lemma |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
245 |
fixes t::trm |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
246 |
and as::assg |
2564 | 247 |
and as'::assg' |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
248 |
and c::"'a::fs" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
249 |
assumes a1: "\<And>x c. P1 c (Var x)" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
250 |
and a2: "\<And>t1 t2 c. \<lbrakk>\<And>d. P1 d t1; \<And>d. P1 d t2\<rbrakk> \<Longrightarrow> P1 c (App t1 t2)" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
251 |
and a3: "\<And>x t c. \<lbrakk>{atom x} \<sharp>* c; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Lam x t)" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
252 |
and a4: "\<And>as t c. \<lbrakk>set (bn1 as) \<sharp>* c; \<And>d. P2 d as; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let1 as t)" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
253 |
and a5: "\<And>as t c. \<lbrakk>set (bn2 as) \<sharp>* c; \<And>d. P2 d as; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let2 as t)" |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
254 |
and a6: "\<And>as t c. \<lbrakk>set (bn3 as) \<sharp>* c; \<And>d. P2 d as; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let3 as t)" |
2564 | 255 |
and a7: "\<And>as' t c. \<lbrakk>(bn4 as') \<sharp>* c; \<And>d. P3 d as'; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let4 as' t)" |
256 |
and a8: "\<And>x y t c. \<And>d. P1 d t \<Longrightarrow> P2 c (As x y t)" |
|
257 |
and a9: "\<And>c. P3 c (BNil)" |
|
258 |
and a10: "\<And>c a as. \<And>d. P3 d as \<Longrightarrow> P3 c (BAs a as)" |
|
259 |
shows "P1 c t" "P2 c as" "P3 c as'" |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
260 |
using assms |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
261 |
apply(induction_schema) |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
262 |
apply(rule_tac y="t" and c="c" in strong_exhaust1) |
2564 | 263 |
apply(simp_all)[7] |
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
264 |
apply(rule_tac as="as" in strong_exhaust2) |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
265 |
apply(simp) |
2564 | 266 |
apply(rule_tac as'="as'" in strong_exhaust3) |
267 |
apply(simp_all)[2] |
|
268 |
apply(relation "measure (sum_case (size o snd) (sum_case (\<lambda>y. size (snd y)) (\<lambda>z. size (snd z))))") |
|
2500
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
269 |
apply(simp_all add: foo.size) |
3b6a70e73006
worked example Foo1 with induct_schema
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
270 |
done |
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
271 |
|
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
272 |
end |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
273 |
|
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
274 |
|
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
275 |