author | Christian Urban <urbanc@in.tum.de> |
Fri, 12 Nov 2010 01:20:53 +0000 | |
changeset 2560 | 82e37a4595c7 |
parent 2559 | add799cf0817 |
child 2561 | 7926f1cb45eb |
permissions | -rw-r--r-- |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2120
diff
changeset
|
1 |
theory Let |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2449
diff
changeset
|
2 |
imports "../Nominal2" |
1600 | 3 |
begin |
4 |
||
5 |
atom_decl name |
|
6 |
||
7 |
nominal_datatype trm = |
|
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2120
diff
changeset
|
8 |
Var "name" |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2120
diff
changeset
|
9 |
| App "trm" "trm" |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2120
diff
changeset
|
10 |
| Lam x::"name" t::"trm" bind x in t |
2490 | 11 |
| Let as::"assn" t::"trm" bind "bn as" in t |
12 |
and assn = |
|
13 |
ANil |
|
14 |
| ACons "name" "trm" "assn" |
|
1600 | 15 |
binder |
16 |
bn |
|
17 |
where |
|
2490 | 18 |
"bn ANil = []" |
19 |
| "bn (ACons x t as) = (atom x) # (bn as)" |
|
20 |
||
2560
82e37a4595c7
automated permute_bn functions (raw ones first)
Christian Urban <urbanc@in.tum.de>
parents:
2559
diff
changeset
|
21 |
thm permute_bn_raw.simps |
82e37a4595c7
automated permute_bn functions (raw ones first)
Christian Urban <urbanc@in.tum.de>
parents:
2559
diff
changeset
|
22 |
|
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
23 |
thm at_set_avoiding2 |
2490 | 24 |
thm trm_assn.fv_defs |
2492
5ac9a74d22fd
post-processed eq_iff and supp threormes according to the fv-supp equality
Christian Urban <urbanc@in.tum.de>
parents:
2490
diff
changeset
|
25 |
thm trm_assn.eq_iff |
2490 | 26 |
thm trm_assn.bn_defs |
27 |
thm trm_assn.perm_simps |
|
2492
5ac9a74d22fd
post-processed eq_iff and supp threormes according to the fv-supp equality
Christian Urban <urbanc@in.tum.de>
parents:
2490
diff
changeset
|
28 |
thm trm_assn.induct |
5ac9a74d22fd
post-processed eq_iff and supp threormes according to the fv-supp equality
Christian Urban <urbanc@in.tum.de>
parents:
2490
diff
changeset
|
29 |
thm trm_assn.inducts |
2490 | 30 |
thm trm_assn.distinct |
31 |
thm trm_assn.supp |
|
2493
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
32 |
thm trm_assn.fresh |
2514
69780ae147f5
down to 21 pages and changed strong induction section
Christian Urban <urbanc@in.tum.de>
parents:
2509
diff
changeset
|
33 |
thm trm_assn.exhaust[where y="t", no_vars] |
2490 | 34 |
|
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
35 |
quotient_definition |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
36 |
"permute_bn :: perm \<Rightarrow> assn \<Rightarrow> assn" |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
37 |
is |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
38 |
"permute_bn_raw" |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
39 |
|
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
40 |
lemma [quot_respect]: "((op =) ===> alpha_assn_raw ===> alpha_assn_raw) permute_bn_raw permute_bn_raw" |
2559
add799cf0817
adapted to changes by Florian on the quotient package and removed local fix for function package
Christian Urban <urbanc@in.tum.de>
parents:
2514
diff
changeset
|
41 |
apply (simp add: fun_rel_def) |
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
42 |
apply clarify |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
43 |
apply (erule alpha_trm_raw_alpha_assn_raw_alpha_bn_raw.inducts) |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
44 |
apply (rule TrueI)+ |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
45 |
apply simp_all |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
46 |
apply (rule_tac [!] alpha_trm_raw_alpha_assn_raw_alpha_bn_raw.intros) |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
47 |
apply simp_all |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
48 |
done |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
49 |
|
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
50 |
lemmas permute_bn = permute_bn_raw.simps[quot_lifted] |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
51 |
|
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
52 |
lemma uu: |
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
53 |
shows "alpha_bn as (permute_bn p as)" |
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
54 |
apply(induct as rule: trm_assn.inducts(2)) |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
55 |
apply(auto)[4] |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
56 |
apply(simp add: permute_bn) |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
57 |
apply(simp add: trm_assn.eq_iff) |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
58 |
apply(simp add: permute_bn) |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
59 |
apply(simp add: trm_assn.eq_iff) |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
60 |
done |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
61 |
|
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
62 |
lemma tt: |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
63 |
shows "(p \<bullet> bn as) = bn (permute_bn p as)" |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
64 |
apply(induct as rule: trm_assn.inducts(2)) |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
65 |
apply(auto)[4] |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
66 |
apply(simp add: permute_bn trm_assn.bn_defs) |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
67 |
apply(simp add: permute_bn trm_assn.bn_defs) |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
68 |
apply(simp add: atom_eqvt) |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
69 |
done |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
70 |
|
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
71 |
lemma strong_exhaust1: |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
72 |
fixes c::"'a::fs" |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
73 |
assumes "\<And>name. y = Var name \<Longrightarrow> P" |
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
74 |
and "\<And>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P" |
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
75 |
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
|
76 |
and "\<And>assn trm. \<lbrakk>set (bn assn) \<sharp>* c; y = Let assn trm\<rbrakk> \<Longrightarrow> P" |
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
77 |
shows "P" |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
78 |
apply(rule_tac y="y" in trm_assn.exhaust(1)) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
79 |
apply(rule assms(1)) |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
80 |
apply(assumption) |
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
81 |
apply(rule assms(2)) |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
82 |
apply(assumption) |
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
83 |
apply(subgoal_tac "\<exists>q. (q \<bullet> {atom name}) \<sharp>* c \<and> supp (Lam name trm) \<sharp>* q") |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
84 |
apply(erule exE) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
85 |
apply(erule conjE) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
86 |
apply(rule assms(3)) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
87 |
apply(perm_simp) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
88 |
apply(assumption) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
89 |
apply(drule supp_perm_eq[symmetric]) |
2490 | 90 |
apply(simp) |
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
91 |
apply(rule at_set_avoiding2) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
92 |
apply(simp add: finite_supp) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
93 |
apply(simp add: finite_supp) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
94 |
apply(simp add: finite_supp) |
2493
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2492
diff
changeset
|
95 |
apply(simp add: trm_assn.fresh fresh_star_def) |
2507 | 96 |
apply(subgoal_tac "\<exists>q. (q \<bullet> (set (bn assn))) \<sharp>* (c::'a::fs) \<and> supp ([bn assn]lst.trm) \<sharp>* q") |
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
97 |
apply(erule exE) |
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
98 |
apply(erule conjE) |
2505 | 99 |
apply(simp add: set_eqvt) |
100 |
apply(subst (asm) tt) |
|
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
101 |
apply(rule_tac assms(4)) |
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
102 |
apply(simp) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
103 |
apply(simp add: trm_assn.eq_iff) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
104 |
apply(drule supp_perm_eq[symmetric]) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
105 |
apply(simp) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
106 |
apply(simp add: tt uu) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
107 |
apply(rule at_set_avoiding2) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
108 |
apply(simp add: finite_supp) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
109 |
apply(simp add: finite_supp) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
110 |
apply(simp add: finite_supp) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
111 |
apply(simp add: Abs_fresh_star) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
112 |
done |
2490 | 113 |
|
114 |
||
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
115 |
lemma strong_exhaust2: |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
116 |
assumes "as = ANil \<Longrightarrow> P" |
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
117 |
and "\<And>x t assn. \<lbrakk>as = ACons x t assn\<rbrakk> \<Longrightarrow> P" |
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
118 |
shows "P" |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
119 |
apply(rule_tac y="as" in trm_assn.exhaust(2)) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
120 |
apply(rule assms(1)) |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
121 |
apply(assumption) |
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
122 |
apply(rule assms(2)) |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
123 |
apply(assumption)+ |
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
124 |
done |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
125 |
|
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
126 |
|
2490 | 127 |
lemma |
128 |
fixes t::trm |
|
129 |
and as::assn |
|
130 |
and c::"'a::fs" |
|
131 |
assumes a1: "\<And>x c. P1 c (Var x)" |
|
132 |
and a2: "\<And>t1 t2 c. \<lbrakk>\<And>d. P1 d t1; \<And>d. P1 d t2\<rbrakk> \<Longrightarrow> P1 c (App t1 t2)" |
|
133 |
and a3: "\<And>x t c. \<lbrakk>{atom x} \<sharp>* c; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Lam x t)" |
|
134 |
and a4: "\<And>as t c. \<lbrakk>set (bn as) \<sharp>* c; \<And>d. P2 d as; \<And>d. P1 d t\<rbrakk> \<Longrightarrow> P1 c (Let as t)" |
|
135 |
and a5: "\<And>c. P2 c ANil" |
|
136 |
and a6: "\<And>x t as c. \<lbrakk>\<And>d. P1 d t; \<And>d. P2 d as\<rbrakk> \<Longrightarrow> P2 c (ACons x t as)" |
|
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
137 |
shows "P1 c t" "P2 c as" |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
138 |
using assms |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
139 |
apply(induction_schema) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
140 |
apply(rule_tac y="t" in strong_exhaust1) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
141 |
apply(blast) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
142 |
apply(blast) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
143 |
apply(blast) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
144 |
apply(blast) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
145 |
apply(rule_tac as="as" in strong_exhaust2) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
146 |
apply(blast) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
147 |
apply(blast) |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
148 |
apply(relation "measure (sum_case (\<lambda>y. size (snd y)) (\<lambda>z. size (snd z)))") |
2503
cc5d23547341
simplified exhaust proofs
Christian Urban <urbanc@in.tum.de>
parents:
2500
diff
changeset
|
149 |
apply(simp_all add: trm_assn.size) |
2498
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
150 |
done |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
151 |
|
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
152 |
text {* *} |
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
153 |
|
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
154 |
|
c7534584a7a0
use also induct_schema for the Let-example (permute_bn is used)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
155 |
(* |
2490 | 156 |
proof - |
157 |
have x: "\<And>(p::perm) (c::'a::fs). P1 c (p \<bullet> t)" |
|
158 |
and y: "\<And>(p::perm) (c::'a::fs). P2 c (p \<bullet> as)" |
|
159 |
apply(induct rule: trm_assn.inducts) |
|
160 |
apply(simp) |
|
161 |
apply(rule a1) |
|
162 |
apply(simp) |
|
163 |
apply(rule a2) |
|
164 |
apply(assumption) |
|
165 |
apply(assumption) |
|
166 |
-- "lam case" |
|
167 |
apply(simp) |
|
168 |
apply(subgoal_tac "\<exists>q. (q \<bullet> {atom (p \<bullet> name)}) \<sharp>* c \<and> supp (Lam (p \<bullet> name) (p \<bullet> trm)) \<sharp>* q") |
|
169 |
apply(erule exE) |
|
170 |
apply(erule conjE) |
|
171 |
apply(drule supp_perm_eq[symmetric]) |
|
172 |
apply(simp) |
|
173 |
apply(thin_tac "?X = ?Y") |
|
174 |
apply(rule a3) |
|
175 |
apply(simp add: atom_eqvt permute_set_eq) |
|
176 |
apply(simp only: permute_plus[symmetric]) |
|
177 |
apply(rule at_set_avoiding2) |
|
178 |
apply(simp add: finite_supp) |
|
179 |
apply(simp add: finite_supp) |
|
180 |
apply(simp add: finite_supp) |
|
181 |
apply(simp add: freshs fresh_star_def) |
|
182 |
--"let case" |
|
183 |
apply(simp) |
|
184 |
thm trm_assn.eq_iff |
|
185 |
thm eq_iffs |
|
186 |
apply(subgoal_tac "\<exists>q. (q \<bullet> set (bn (p \<bullet> assn))) \<sharp>* c \<and> supp (Abs_lst (bn (p \<bullet> assn)) (p \<bullet> trm)) \<sharp>* q") |
|
187 |
apply(erule exE) |
|
188 |
apply(erule conjE) |
|
189 |
prefer 2 |
|
190 |
apply(rule at_set_avoiding2) |
|
191 |
apply(rule fin_bn) |
|
192 |
apply(simp add: finite_supp) |
|
193 |
apply(simp add: finite_supp) |
|
194 |
apply(simp add: abs_fresh) |
|
195 |
apply(rule_tac t = "Let (p \<bullet> assn) (p \<bullet> trm)" in subst) |
|
196 |
prefer 2 |
|
197 |
apply(rule a4) |
|
198 |
prefer 4 |
|
199 |
apply(simp add: eq_iffs) |
|
200 |
apply(rule conjI) |
|
201 |
prefer 2 |
|
202 |
apply(simp add: set_eqvt trm_assn.fv_bn_eqvt) |
|
203 |
apply(subst permute_plus[symmetric]) |
|
204 |
apply(blast) |
|
205 |
prefer 2 |
|
206 |
apply(simp add: eq_iffs) |
|
207 |
thm eq_iffs |
|
208 |
apply(subst permute_plus[symmetric]) |
|
209 |
apply(blast) |
|
210 |
apply(simp add: supps) |
|
211 |
apply(simp add: fresh_star_def freshs) |
|
212 |
apply(drule supp_perm_eq[symmetric]) |
|
213 |
apply(simp) |
|
214 |
apply(simp add: eq_iffs) |
|
215 |
apply(simp) |
|
216 |
apply(thin_tac "?X = ?Y") |
|
217 |
apply(rule a4) |
|
218 |
apply(simp add: set_eqvt trm_assn.fv_bn_eqvt) |
|
219 |
apply(subst permute_plus[symmetric]) |
|
220 |
apply(blast) |
|
221 |
apply(subst permute_plus[symmetric]) |
|
222 |
apply(blast) |
|
223 |
apply(simp add: supps) |
|
224 |
thm at_set_avoiding2 |
|
225 |
--"HERE" |
|
226 |
apply(rule at_set_avoiding2) |
|
227 |
apply(rule fin_bn) |
|
228 |
apply(simp add: finite_supp) |
|
229 |
apply(simp add: finite_supp) |
|
230 |
apply(simp add: fresh_star_def freshs) |
|
231 |
apply(rule ballI) |
|
232 |
apply(simp add: eqvts permute_bn) |
|
233 |
apply(rule a5) |
|
234 |
apply(simp add: permute_bn) |
|
235 |
apply(rule a6) |
|
236 |
apply simp |
|
237 |
apply simp |
|
238 |
done |
|
239 |
then have a: "P1 c (0 \<bullet> t)" by blast |
|
240 |
have "P2 c (permute_bn 0 (0 \<bullet> l))" using b' by blast |
|
241 |
then show "P1 c t" and "P2 c l" using a permute_bn_zero by simp_all |
|
242 |
qed |
|
243 |
*) |
|
1600 | 244 |
|
2438
abafea9b39bb
corrected bug with fv-function generation (that was the problem with recursive binders)
Christian Urban <urbanc@in.tum.de>
parents:
2436
diff
changeset
|
245 |
text {* *} |
1731
3832a31a73b1
a test with let having multiple bodies
Christian Urban <urbanc@in.tum.de>
parents:
1685
diff
changeset
|
246 |
|
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2120
diff
changeset
|
247 |
(* |
1731
3832a31a73b1
a test with let having multiple bodies
Christian Urban <urbanc@in.tum.de>
parents:
1685
diff
changeset
|
248 |
|
1644
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
249 |
primrec |
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
250 |
permute_bn_raw |
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
251 |
where |
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
252 |
"permute_bn_raw pi (Lnil_raw) = Lnil_raw" |
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
253 |
| "permute_bn_raw pi (Lcons_raw a t l) = Lcons_raw (pi \<bullet> a) t (permute_bn_raw pi l)" |
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
254 |
|
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
255 |
quotient_definition |
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
256 |
"permute_bn :: perm \<Rightarrow> lts \<Rightarrow> lts" |
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
257 |
is |
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
258 |
"permute_bn_raw" |
1639
a98d03fb9d53
added experiemental permute_bn
Christian Urban <urbanc@in.tum.de>
parents:
1638
diff
changeset
|
259 |
|
1644
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
260 |
lemma [quot_respect]: "((op =) ===> alpha_lts_raw ===> alpha_lts_raw) permute_bn_raw permute_bn_raw" |
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
261 |
apply simp |
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
262 |
apply clarify |
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
263 |
apply (erule alpha_trm_raw_alpha_lts_raw_alpha_bn_raw.inducts) |
2039
39df91a90f87
Move ExLet to NewParser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1774
diff
changeset
|
264 |
apply (rule TrueI)+ |
1644
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
265 |
apply simp_all |
2039
39df91a90f87
Move ExLet to NewParser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1774
diff
changeset
|
266 |
apply (rule_tac [!] alpha_trm_raw_alpha_lts_raw_alpha_bn_raw.intros) |
39df91a90f87
Move ExLet to NewParser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1774
diff
changeset
|
267 |
apply simp_all |
1644
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
268 |
done |
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
269 |
|
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
270 |
lemmas permute_bn = permute_bn_raw.simps[quot_lifted] |
1639
a98d03fb9d53
added experiemental permute_bn
Christian Urban <urbanc@in.tum.de>
parents:
1638
diff
changeset
|
271 |
|
1642
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
272 |
lemma permute_bn_zero: |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
273 |
"permute_bn 0 a = a" |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
274 |
apply(induct a rule: trm_lts.inducts(2)) |
2039
39df91a90f87
Move ExLet to NewParser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1774
diff
changeset
|
275 |
apply(rule TrueI)+ |
39df91a90f87
Move ExLet to NewParser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1774
diff
changeset
|
276 |
apply(simp_all add:permute_bn) |
1642
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
277 |
done |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
278 |
|
1640
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
279 |
lemma permute_bn_add: |
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
280 |
"permute_bn (p + q) a = permute_bn p (permute_bn q a)" |
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
281 |
oops |
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
282 |
|
1643
953403c5faa0
Showed Let substitution.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1642
diff
changeset
|
283 |
lemma permute_bn_alpha_bn: "alpha_bn lts (permute_bn q lts)" |
953403c5faa0
Showed Let substitution.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1642
diff
changeset
|
284 |
apply(induct lts rule: trm_lts.inducts(2)) |
2039
39df91a90f87
Move ExLet to NewParser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1774
diff
changeset
|
285 |
apply(rule TrueI)+ |
1644
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
286 |
apply(simp_all add:permute_bn eqvts trm_lts.eq_iff) |
1643
953403c5faa0
Showed Let substitution.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1642
diff
changeset
|
287 |
done |
1641 | 288 |
|
1642
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
289 |
lemma perm_bn: |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
290 |
"p \<bullet> bn l = bn(permute_bn p l)" |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
291 |
apply(induct l rule: trm_lts.inducts(2)) |
2039
39df91a90f87
Move ExLet to NewParser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1774
diff
changeset
|
292 |
apply(rule TrueI)+ |
1644
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
293 |
apply(simp_all add:permute_bn eqvts) |
1642
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
294 |
done |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
295 |
|
1757 | 296 |
lemma fv_perm_bn: |
297 |
"fv_bn l = fv_bn (permute_bn p l)" |
|
298 |
apply(induct l rule: trm_lts.inducts(2)) |
|
2039
39df91a90f87
Move ExLet to NewParser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1774
diff
changeset
|
299 |
apply(rule TrueI)+ |
1757 | 300 |
apply(simp_all add:permute_bn eqvts) |
301 |
done |
|
302 |
||
1643
953403c5faa0
Showed Let substitution.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1642
diff
changeset
|
303 |
lemma Lt_subst: |
1685
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1658
diff
changeset
|
304 |
"supp (Abs_lst (bn lts) trm) \<sharp>* q \<Longrightarrow> (Lt lts trm) = Lt (permute_bn q lts) (q \<bullet> trm)" |
2039
39df91a90f87
Move ExLet to NewParser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1774
diff
changeset
|
305 |
apply (simp add: trm_lts.eq_iff permute_bn_alpha_bn) |
1643
953403c5faa0
Showed Let substitution.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1642
diff
changeset
|
306 |
apply (rule_tac x="q" in exI) |
953403c5faa0
Showed Let substitution.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1642
diff
changeset
|
307 |
apply (simp add: alphas) |
953403c5faa0
Showed Let substitution.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1642
diff
changeset
|
308 |
apply (simp add: perm_bn[symmetric]) |
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
2039
diff
changeset
|
309 |
apply(rule conjI) |
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
2039
diff
changeset
|
310 |
apply(drule supp_perm_eq) |
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
2039
diff
changeset
|
311 |
apply(simp add: abs_eq_iff) |
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
2039
diff
changeset
|
312 |
apply(simp add: alphas_abs alphas) |
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
2039
diff
changeset
|
313 |
apply(drule conjunct1) |
1643
953403c5faa0
Showed Let substitution.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1642
diff
changeset
|
314 |
apply (simp add: trm_lts.supp) |
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
2039
diff
changeset
|
315 |
apply(simp add: supp_abs) |
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
parents:
2039
diff
changeset
|
316 |
apply (simp add: trm_lts.supp) |
1643
953403c5faa0
Showed Let substitution.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1642
diff
changeset
|
317 |
done |
953403c5faa0
Showed Let substitution.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1642
diff
changeset
|
318 |
|
953403c5faa0
Showed Let substitution.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1642
diff
changeset
|
319 |
|
1642
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
320 |
lemma fin_bn: |
1685
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1658
diff
changeset
|
321 |
"finite (set (bn l))" |
1642
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
322 |
apply(induct l rule: trm_lts.inducts(2)) |
1644
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
323 |
apply(simp_all add:permute_bn eqvts) |
1642
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
324 |
done |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
325 |
|
1765
9a894c42e80e
more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents:
1759
diff
changeset
|
326 |
thm trm_lts.inducts[no_vars] |
9a894c42e80e
more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents:
1759
diff
changeset
|
327 |
|
1638
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
328 |
lemma |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
329 |
fixes t::trm |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
330 |
and l::lts |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
331 |
and c::"'a::fs" |
1640
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
332 |
assumes a1: "\<And>name c. P1 c (Vr name)" |
1638
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
333 |
and a2: "\<And>trm1 trm2 c. \<lbrakk>\<And>d. P1 d trm1; \<And>d. P1 d trm2\<rbrakk> \<Longrightarrow> P1 c (Ap trm1 trm2)" |
1640
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
334 |
and a3: "\<And>name trm c. \<lbrakk>atom name \<sharp> c; \<And>d. P1 d trm\<rbrakk> \<Longrightarrow> P1 c (Lm name trm)" |
1685
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1658
diff
changeset
|
335 |
and a4: "\<And>lts trm c. \<lbrakk>set (bn lts) \<sharp>* c; \<And>d. P2 d lts; \<And>d. P1 d trm\<rbrakk> \<Longrightarrow> P1 c (Lt lts trm)" |
1638
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
336 |
and a5: "\<And>c. P2 c Lnil" |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
337 |
and a6: "\<And>name trm lts c. \<lbrakk>\<And>d. P1 d trm; \<And>d. P2 d lts\<rbrakk> \<Longrightarrow> P2 c (Lcons name trm lts)" |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
338 |
shows "P1 c t" and "P2 c l" |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
339 |
proof - |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
340 |
have "(\<And>(p::perm) (c::'a::fs). P1 c (p \<bullet> t))" and |
1642
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
341 |
b': "(\<And>(p::perm) (q::perm) (c::'a::fs). P2 c (permute_bn p (q \<bullet> l)))" |
1638
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
342 |
apply(induct rule: trm_lts.inducts) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
343 |
apply(simp) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
344 |
apply(rule a1) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
345 |
apply(simp) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
346 |
apply(rule a2) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
347 |
apply(simp) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
348 |
apply(simp) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
349 |
apply(simp) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
350 |
apply(subgoal_tac "\<exists>q. (q \<bullet> (atom (p \<bullet> name))) \<sharp> c \<and> supp (Lm (p \<bullet> name) (p \<bullet> trm)) \<sharp>* q") |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
351 |
apply(erule exE) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
352 |
apply(rule_tac t="Lm (p \<bullet> name) (p \<bullet> trm)" |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
353 |
and s="q\<bullet> Lm (p \<bullet> name) (p \<bullet> trm)" in subst) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
354 |
apply(rule supp_perm_eq) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
355 |
apply(simp) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
356 |
apply(simp) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
357 |
apply(rule a3) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
358 |
apply(simp add: atom_eqvt) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
359 |
apply(subst permute_plus[symmetric]) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
360 |
apply(blast) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
361 |
apply(rule at_set_avoiding2_atom) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
362 |
apply(simp add: finite_supp) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
363 |
apply(simp add: finite_supp) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
364 |
apply(simp add: fresh_def) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
365 |
apply(simp add: trm_lts.fv[simplified trm_lts.supp]) |
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
366 |
apply(simp) |
1685
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1658
diff
changeset
|
367 |
apply(subgoal_tac "\<exists>q. (q \<bullet> set (bn (p \<bullet> lts))) \<sharp>* c \<and> supp (Abs_lst (bn (p \<bullet> lts)) (p \<bullet> trm)) \<sharp>* q") |
1638
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
368 |
apply(erule exE) |
1641 | 369 |
apply(erule conjE) |
1774
c34347ec7ab3
separated general nominal theory into separate folder
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
370 |
thm Lt_subst |
1641 | 371 |
apply(subst Lt_subst) |
372 |
apply assumption |
|
1638
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
373 |
apply(rule a4) |
1685
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1658
diff
changeset
|
374 |
apply(simp add:perm_bn[symmetric]) |
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1658
diff
changeset
|
375 |
apply(simp add: eqvts) |
1641 | 376 |
apply (simp add: fresh_star_def fresh_def) |
1640
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
377 |
apply(rotate_tac 1) |
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
378 |
apply(drule_tac x="q + p" in meta_spec) |
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
379 |
apply(simp) |
1642
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
380 |
apply(rule at_set_avoiding2) |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
381 |
apply(rule fin_bn) |
1641 | 382 |
apply(simp add: finite_supp) |
383 |
apply(simp add: finite_supp) |
|
1658 | 384 |
apply(simp add: fresh_star_def fresh_def supp_abs) |
1644
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
385 |
apply(simp add: eqvts permute_bn) |
1640
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
386 |
apply(rule a5) |
1644
0e705352bcef
Properly defined permute_bn. No more sorry's in Let strong induction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1643
diff
changeset
|
387 |
apply(simp add: permute_bn) |
1640
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
388 |
apply(rule a6) |
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
389 |
apply simp |
cd5a6db05540
trying to prove the string induction for let.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1639
diff
changeset
|
390 |
apply simp |
1642
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
391 |
done |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
392 |
then have a: "P1 c (0 \<bullet> t)" by blast |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
393 |
have "P2 c (permute_bn 0 (0 \<bullet> l))" using b' by blast |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
394 |
then show "P1 c t" and "P2 c l" using a permute_bn_zero by simp_all |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
395 |
qed |
06f44d498cef
Only let substitution is left.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1641
diff
changeset
|
396 |
|
1638
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
397 |
|
36798cdbc452
first attempt of strong induction for lets with assignments
Christian Urban <urbanc@in.tum.de>
parents:
1602
diff
changeset
|
398 |
|
1602
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
399 |
lemma lets_bla: |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
400 |
"x \<noteq> z \<Longrightarrow> y \<noteq> z \<Longrightarrow> x \<noteq> y \<Longrightarrow>(Lt (Lcons x (Vr y) Lnil) (Vr x)) \<noteq> (Lt (Lcons x (Vr z) Lnil) (Vr x))" |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
401 |
by (simp add: trm_lts.eq_iff) |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
402 |
|
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
403 |
lemma lets_ok: |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
404 |
"(Lt (Lcons x (Vr y) Lnil) (Vr x)) = (Lt (Lcons y (Vr y) Lnil) (Vr y))" |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
405 |
apply (simp add: trm_lts.eq_iff) |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
406 |
apply (rule_tac x="(x \<leftrightarrow> y)" in exI) |
2039
39df91a90f87
Move ExLet to NewParser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1774
diff
changeset
|
407 |
apply (simp_all add: alphas eqvts supp_at_base fresh_star_def) |
1602
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
408 |
done |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
409 |
|
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
410 |
lemma lets_ok3: |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
411 |
"x \<noteq> y \<Longrightarrow> |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
412 |
(Lt (Lcons x (Ap (Vr y) (Vr x)) (Lcons y (Vr y) Lnil)) (Ap (Vr x) (Vr y))) \<noteq> |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
413 |
(Lt (Lcons y (Ap (Vr x) (Vr y)) (Lcons x (Vr x) Lnil)) (Ap (Vr x) (Vr y)))" |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
414 |
apply (simp add: alphas trm_lts.eq_iff) |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
415 |
done |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
416 |
|
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
417 |
|
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
418 |
lemma lets_not_ok1: |
1685
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1658
diff
changeset
|
419 |
"x \<noteq> y \<Longrightarrow> |
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1658
diff
changeset
|
420 |
(Lt (Lcons x (Vr x) (Lcons y (Vr y) Lnil)) (Ap (Vr x) (Vr y))) \<noteq> |
1602
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
421 |
(Lt (Lcons y (Vr x) (Lcons x (Vr y) Lnil)) (Ap (Vr x) (Vr y)))" |
1685
721d92623c9d
Lets finally abstract lists.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1658
diff
changeset
|
422 |
apply (simp add: alphas trm_lts.eq_iff fresh_star_def eqvts) |
1602
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
423 |
done |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
424 |
|
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
425 |
lemma lets_nok: |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
426 |
"x \<noteq> y \<Longrightarrow> x \<noteq> z \<Longrightarrow> z \<noteq> y \<Longrightarrow> |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
427 |
(Lt (Lcons x (Ap (Vr z) (Vr z)) (Lcons y (Vr z) Lnil)) (Ap (Vr x) (Vr y))) \<noteq> |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
428 |
(Lt (Lcons y (Vr z) (Lcons x (Ap (Vr z) (Vr z)) Lnil)) (Ap (Vr x) (Vr y)))" |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
429 |
apply (simp add: alphas trm_lts.eq_iff fresh_star_def) |
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
430 |
done |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2120
diff
changeset
|
431 |
*) |
1602
a7e60da429e2
Move Let properties to ExLet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1600
diff
changeset
|
432 |
|
1600 | 433 |
end |
434 |
||
435 |
||
436 |