author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
Tue, 02 Feb 2010 11:56:37 +0100 | |
changeset 1024 | b3deb964ad26 |
parent 1023 | 7c12f5476d1b |
child 1025 | 559419060d99 |
permissions | -rw-r--r-- |
1011 | 1 |
theory LamEx |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
2 |
imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "../QuotMain" "Abs" "../QuotProd" |
1011 | 3 |
begin |
4 |
||
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
5 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
6 |
(* lemmas that should be in Nominal \<dots>\<dots>must be cleaned *) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
7 |
lemma supp_finite_set: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
8 |
fixes S::"atom set" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
9 |
assumes "finite S" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
10 |
shows "supp S = S" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
11 |
apply(rule finite_supp_unique) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
12 |
apply(simp add: supports_def) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
13 |
apply(auto simp add: permute_set_eq swap_atom)[1] |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
14 |
apply(metis) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
15 |
apply(rule assms) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
16 |
apply(auto simp add: permute_set_eq swap_atom)[1] |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
17 |
done |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
18 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
19 |
|
1011 | 20 |
atom_decl name |
21 |
||
22 |
datatype rlam = |
|
23 |
rVar "name" |
|
24 |
| rApp "rlam" "rlam" |
|
25 |
| rLam "name" "rlam" |
|
26 |
||
27 |
fun |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
28 |
rfv :: "rlam \<Rightarrow> atom set" |
1011 | 29 |
where |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
30 |
rfv_var: "rfv (rVar a) = {atom a}" |
1011 | 31 |
| rfv_app: "rfv (rApp t1 t2) = (rfv t1) \<union> (rfv t2)" |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
32 |
| rfv_lam: "rfv (rLam a t) = (rfv t) - {atom a}" |
1011 | 33 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
34 |
instantiation rlam :: pt |
1011 | 35 |
begin |
36 |
||
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
37 |
primrec |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
38 |
permute_rlam |
1011 | 39 |
where |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
40 |
"permute_rlam pi (rVar a) = rVar (pi \<bullet> a)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
41 |
| "permute_rlam pi (rApp t1 t2) = rApp (permute_rlam pi t1) (permute_rlam pi t2)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
42 |
| "permute_rlam pi (rLam a t) = rLam (pi \<bullet> a) (permute_rlam pi t)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
43 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
44 |
instance |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
45 |
apply default |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
46 |
apply(induct_tac [!] x) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
47 |
apply(simp_all) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
48 |
done |
1011 | 49 |
|
50 |
end |
|
51 |
||
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
52 |
instantiation rlam :: fs |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
53 |
begin |
1011 | 54 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
55 |
lemma neg_conj: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
56 |
"\<not>(P \<and> Q) \<longleftrightarrow> (\<not>P) \<or> (\<not>Q)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
57 |
by simp |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
58 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
59 |
lemma infinite_Un: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
60 |
"infinite (S \<union> T) \<longleftrightarrow> infinite S \<or> infinite T" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
61 |
by simp |
1011 | 62 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
63 |
instance |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
64 |
apply default |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
65 |
apply(induct_tac x) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
66 |
(* var case *) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
67 |
apply(simp add: supp_def) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
68 |
apply(fold supp_def)[1] |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
69 |
apply(simp add: supp_at_base) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
70 |
(* app case *) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
71 |
apply(simp only: supp_def) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
72 |
apply(simp only: permute_rlam.simps) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
73 |
apply(simp only: rlam.inject) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
74 |
apply(simp only: neg_conj) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
75 |
apply(simp only: Collect_disj_eq) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
76 |
apply(simp only: infinite_Un) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
77 |
apply(simp only: Collect_disj_eq) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
78 |
apply(simp) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
79 |
(* lam case *) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
80 |
apply(simp only: supp_def) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
81 |
apply(simp only: permute_rlam.simps) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
82 |
apply(simp only: rlam.inject) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
83 |
apply(simp only: neg_conj) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
84 |
apply(simp only: Collect_disj_eq) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
85 |
apply(simp only: infinite_Un) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
86 |
apply(simp only: Collect_disj_eq) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
87 |
apply(simp) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
88 |
apply(fold supp_def)[1] |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
89 |
apply(simp add: supp_at_base) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
90 |
done |
1011 | 91 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
92 |
end |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
93 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
94 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
95 |
(* for the eqvt proof of the alpha-equivalence *) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
96 |
declare permute_rlam.simps[eqvt] |
1011 | 97 |
|
98 |
lemma rfv_eqvt[eqvt]: |
|
99 |
shows "(pi\<bullet>rfv t) = rfv (pi\<bullet>t)" |
|
100 |
apply(induct t) |
|
101 |
apply(simp_all) |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
102 |
apply(simp add: permute_set_eq atom_eqvt) |
1011 | 103 |
apply(simp add: union_eqvt) |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
104 |
apply(simp add: Diff_eqvt) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
105 |
apply(simp add: permute_set_eq atom_eqvt) |
1011 | 106 |
done |
107 |
||
108 |
inductive |
|
109 |
alpha :: "rlam \<Rightarrow> rlam \<Rightarrow> bool" ("_ \<approx> _" [100, 100] 100) |
|
110 |
where |
|
111 |
a1: "a = b \<Longrightarrow> (rVar a) \<approx> (rVar b)" |
|
112 |
| a2: "\<lbrakk>t1 \<approx> t2; s1 \<approx> s2\<rbrakk> \<Longrightarrow> rApp t1 s1 \<approx> rApp t2 s2" |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
113 |
| a3: "\<exists>pi. (({atom a}, t) \<approx>gen alpha rfv pi ({atom b}, s)) \<Longrightarrow> rLam a t \<approx> rLam b s" |
1011 | 114 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
115 |
thm alpha.induct |
1011 | 116 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
117 |
lemma a3_inverse: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
118 |
assumes "rLam a t \<approx> rLam b s" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
119 |
shows "\<exists>pi. (({atom a}, t) \<approx>gen alpha rfv pi ({atom b}, s))" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
120 |
using assms |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
121 |
apply(erule_tac alpha.cases) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
122 |
apply(auto) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
123 |
done |
1011 | 124 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
125 |
text {* should be automatic with new version of eqvt-machinery *} |
1011 | 126 |
lemma alpha_eqvt: |
127 |
shows "t \<approx> s \<Longrightarrow> (pi \<bullet> t) \<approx> (pi \<bullet> s)" |
|
128 |
apply(induct rule: alpha.induct) |
|
129 |
apply(simp add: a1) |
|
130 |
apply(simp add: a2) |
|
131 |
apply(simp) |
|
132 |
apply(rule a3) |
|
1023
7c12f5476d1b
Generalized the eqvt proof for single binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1021
diff
changeset
|
133 |
apply(rule alpha_gen_eqvt_atom) |
7c12f5476d1b
Generalized the eqvt proof for single binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1021
diff
changeset
|
134 |
apply(rule rfv_eqvt) |
7c12f5476d1b
Generalized the eqvt proof for single binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1021
diff
changeset
|
135 |
apply assumption |
1011 | 136 |
done |
137 |
||
138 |
lemma alpha_refl: |
|
139 |
shows "t \<approx> t" |
|
140 |
apply(induct t rule: rlam.induct) |
|
141 |
apply(simp add: a1) |
|
142 |
apply(simp add: a2) |
|
143 |
apply(rule a3) |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
144 |
apply(rule_tac x="0" in exI) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
145 |
apply(rule alpha_gen_refl) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
146 |
apply(assumption) |
1011 | 147 |
done |
148 |
||
149 |
lemma alpha_sym: |
|
150 |
shows "t \<approx> s \<Longrightarrow> s \<approx> t" |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
151 |
apply(induct rule: alpha.induct) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
152 |
apply(simp add: a1) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
153 |
apply(simp add: a2) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
154 |
apply(rule a3) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
155 |
apply(rule alpha_gen_atom_sym) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
156 |
apply(rule alpha_eqvt) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
157 |
apply(assumption)+ |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
158 |
done |
1011 | 159 |
|
160 |
lemma alpha_trans: |
|
161 |
shows "t1 \<approx> t2 \<Longrightarrow> t2 \<approx> t3 \<Longrightarrow> t1 \<approx> t3" |
|
162 |
apply(induct arbitrary: t3 rule: alpha.induct) |
|
163 |
apply(erule alpha.cases) |
|
164 |
apply(simp_all) |
|
165 |
apply(simp add: a1) |
|
166 |
apply(rotate_tac 4) |
|
167 |
apply(erule alpha.cases) |
|
168 |
apply(simp_all) |
|
169 |
apply(simp add: a2) |
|
170 |
apply(erule alpha.cases) |
|
171 |
apply(simp_all) |
|
1020
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
172 |
apply(rule a3) |
1021
bacf3584640e
General alpha_gen_trans for one-variable abstraction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1020
diff
changeset
|
173 |
apply(rule alpha_gen_atom_trans) |
bacf3584640e
General alpha_gen_trans for one-variable abstraction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1020
diff
changeset
|
174 |
apply(rule alpha_eqvt) |
bacf3584640e
General alpha_gen_trans for one-variable abstraction.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1020
diff
changeset
|
175 |
apply(assumption)+ |
1011 | 176 |
done |
177 |
||
178 |
lemma alpha_equivp: |
|
179 |
shows "equivp alpha" |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
180 |
apply(rule equivpI) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
181 |
unfolding reflp_def symp_def transp_def |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
182 |
apply(auto intro: alpha_refl alpha_sym alpha_trans) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
183 |
done |
1011 | 184 |
|
185 |
lemma alpha_rfv: |
|
186 |
shows "t \<approx> s \<Longrightarrow> rfv t = rfv s" |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
187 |
apply(induct rule: alpha.induct) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
188 |
apply(simp_all add: alpha_gen.simps) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
189 |
done |
1011 | 190 |
|
191 |
quotient_type lam = rlam / alpha |
|
192 |
by (rule alpha_equivp) |
|
193 |
||
194 |
quotient_definition |
|
195 |
"Var :: name \<Rightarrow> lam" |
|
196 |
as |
|
197 |
"rVar" |
|
198 |
||
199 |
quotient_definition |
|
200 |
"App :: lam \<Rightarrow> lam \<Rightarrow> lam" |
|
201 |
as |
|
202 |
"rApp" |
|
203 |
||
204 |
quotient_definition |
|
205 |
"Lam :: name \<Rightarrow> lam \<Rightarrow> lam" |
|
206 |
as |
|
207 |
"rLam" |
|
208 |
||
209 |
quotient_definition |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
210 |
"fv :: lam \<Rightarrow> atom set" |
1011 | 211 |
as |
212 |
"rfv" |
|
213 |
||
214 |
lemma perm_rsp[quot_respect]: |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
215 |
"(op = ===> alpha ===> alpha) permute permute" |
1011 | 216 |
apply(auto) |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
217 |
apply(rule alpha_eqvt) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
218 |
apply(simp) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
219 |
done |
1011 | 220 |
|
221 |
lemma rVar_rsp[quot_respect]: |
|
222 |
"(op = ===> alpha) rVar rVar" |
|
223 |
by (auto intro: a1) |
|
224 |
||
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
225 |
lemma rApp_rsp[quot_respect]: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
226 |
"(alpha ===> alpha ===> alpha) rApp rApp" |
1011 | 227 |
by (auto intro: a2) |
228 |
||
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
229 |
lemma rLam_rsp[quot_respect]: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
230 |
"(op = ===> alpha ===> alpha) rLam rLam" |
1011 | 231 |
apply(auto) |
232 |
apply(rule a3) |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
233 |
apply(rule_tac x="0" in exI) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
234 |
unfolding fresh_star_def |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
235 |
apply(simp add: fresh_star_def fresh_zero_perm alpha_gen.simps) |
1011 | 236 |
apply(simp add: alpha_rfv) |
237 |
done |
|
238 |
||
239 |
lemma rfv_rsp[quot_respect]: |
|
240 |
"(alpha ===> op =) rfv rfv" |
|
241 |
apply(simp add: alpha_rfv) |
|
242 |
done |
|
243 |
||
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
244 |
|
1011 | 245 |
section {* lifted theorems *} |
246 |
||
247 |
lemma lam_induct: |
|
248 |
"\<lbrakk>\<And>name. P (Var name); |
|
249 |
\<And>lam1 lam2. \<lbrakk>P lam1; P lam2\<rbrakk> \<Longrightarrow> P (App lam1 lam2); |
|
250 |
\<And>name lam. P lam \<Longrightarrow> P (Lam name lam)\<rbrakk> |
|
251 |
\<Longrightarrow> P lam" |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
252 |
apply (lifting rlam.induct) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
253 |
done |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
254 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
255 |
instantiation lam :: pt |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
256 |
begin |
1011 | 257 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
258 |
quotient_definition |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
259 |
"permute_lam :: perm \<Rightarrow> lam \<Rightarrow> lam" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
260 |
as |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
261 |
"permute :: perm \<Rightarrow> rlam \<Rightarrow> rlam" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
262 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
263 |
lemma permute_lam [simp]: |
1011 | 264 |
shows "pi \<bullet> Var a = Var (pi \<bullet> a)" |
265 |
and "pi \<bullet> App t1 t2 = App (pi \<bullet> t1) (pi \<bullet> t2)" |
|
266 |
and "pi \<bullet> Lam a t = Lam (pi \<bullet> a) (pi \<bullet> t)" |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
267 |
apply(lifting permute_rlam.simps) |
1011 | 268 |
done |
269 |
||
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
270 |
instance |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
271 |
apply default |
1011 | 272 |
apply(induct_tac [!] x rule: lam_induct) |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
273 |
apply(simp_all) |
1011 | 274 |
done |
275 |
||
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
276 |
end |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
277 |
|
1011 | 278 |
lemma fv_lam [simp]: |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
279 |
shows "fv (Var a) = {atom a}" |
1011 | 280 |
and "fv (App t1 t2) = fv t1 \<union> fv t2" |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
281 |
and "fv (Lam a t) = fv t - {atom a}" |
1011 | 282 |
apply(lifting rfv_var rfv_app rfv_lam) |
283 |
done |
|
284 |
||
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
285 |
lemma fv_eqvt: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
286 |
shows "(p \<bullet> fv t) = fv (p \<bullet> t)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
287 |
apply(lifting rfv_eqvt) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
288 |
done |
1011 | 289 |
|
290 |
lemma a1: |
|
291 |
"a = b \<Longrightarrow> Var a = Var b" |
|
292 |
by (lifting a1) |
|
293 |
||
294 |
lemma a2: |
|
295 |
"\<lbrakk>x = xa; xb = xc\<rbrakk> \<Longrightarrow> App x xb = App xa xc" |
|
296 |
by (lifting a2) |
|
297 |
||
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
298 |
lemma alpha_gen_rsp_pre: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
299 |
assumes a5: "\<And>t s. R t s \<Longrightarrow> R (pi \<bullet> t) (pi \<bullet> s)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
300 |
and a1: "R s1 t1" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
301 |
and a2: "R s2 t2" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
302 |
and a3: "\<And>a b c d. R a b \<Longrightarrow> R c d \<Longrightarrow> R1 a c = R2 b d" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
303 |
and a4: "\<And>x y. R x y \<Longrightarrow> fv1 x = fv2 y" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
304 |
shows "(a, s1) \<approx>gen R1 fv1 pi (b, s2) = (a, t1) \<approx>gen R2 fv2 pi (b, t2)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
305 |
apply (simp add: alpha_gen.simps) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
306 |
apply (simp only: a4[symmetric, OF a1] a4[symmetric, OF a2]) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
307 |
apply auto |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
308 |
apply (subst a3[symmetric]) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
309 |
apply (rule a5) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
310 |
apply (rule a1) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
311 |
apply (rule a2) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
312 |
apply (assumption) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
313 |
apply (subst a3) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
314 |
apply (rule a5) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
315 |
apply (rule a1) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
316 |
apply (rule a2) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
317 |
apply (assumption) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
318 |
done |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
319 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
320 |
lemma [quot_respect]: "(prod_rel op = alpha ===> |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
321 |
(alpha ===> alpha ===> op =) ===> (alpha ===> op =) ===> op = ===> prod_rel op = alpha ===> op =) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
322 |
alpha_gen alpha_gen" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
323 |
apply simp |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
324 |
apply clarify |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
325 |
apply (rule alpha_gen_rsp_pre[of "alpha",OF alpha_eqvt]) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
326 |
apply auto |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
327 |
done |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
328 |
|
1020
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
329 |
(* |
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
330 |
(* pi_abs would be also sufficient to prove the next lemma *) |
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
331 |
lemma replam_eqvt: "pi \<bullet> (rep_lam x) = rep_lam (pi \<bullet> x)" |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
332 |
apply (unfold rep_lam_def) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
333 |
sorry |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
334 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
335 |
lemma [quot_preserve]: "(prod_fun id rep_lam ---> |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
336 |
(abs_lam ---> abs_lam ---> id) ---> (abs_lam ---> id) ---> id ---> (prod_fun id rep_lam) ---> id) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
337 |
alpha_gen = alpha_gen" |
1020
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
338 |
apply (simp add: expand_fun_eq alpha_gen.simps Quotient_abs_rep[OF Quotient_lam]) |
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
339 |
apply (simp add: replam_eqvt) |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
340 |
apply (simp only: Quotient_abs_rep[OF Quotient_lam]) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
341 |
apply auto |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
342 |
done |
1020
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
343 |
*) |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
344 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
345 |
lemma alpha_prs [quot_preserve]: "(rep_lam ---> rep_lam ---> id) alpha = (op =)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
346 |
apply (simp add: expand_fun_eq) |
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
347 |
apply (simp add: Quotient_rel_rep[OF Quotient_lam]) |
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
348 |
done |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
349 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
350 |
lemma a3: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
351 |
"\<exists>pi. ({atom a}, t) \<approx>gen (op =) fv pi ({atom b}, s) \<Longrightarrow> Lam a t = Lam b s" |
1020
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
352 |
apply (unfold alpha_gen) |
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
353 |
apply (lifting a3[unfolded alpha_gen]) |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
354 |
done |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
355 |
|
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
356 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
357 |
lemma a3_inv: |
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
358 |
"Lam a t = Lam b s \<Longrightarrow> \<exists>pi. ({atom a}, t) \<approx>gen (op =) fv pi ({atom b}, s)" |
1020
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
359 |
apply (unfold alpha_gen) |
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
360 |
apply (lifting a3_inverse[unfolded alpha_gen]) |
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
361 |
done |
1011 | 362 |
|
363 |
lemma alpha_cases: |
|
364 |
"\<lbrakk>a1 = a2; \<And>a b. \<lbrakk>a1 = Var a; a2 = Var b; a = b\<rbrakk> \<Longrightarrow> P; |
|
1020
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
365 |
\<And>t1 t2 s1 s2. \<lbrakk>a1 = App t1 s1; a2 = App t2 s2; t1 = t2; s1 = s2\<rbrakk> \<Longrightarrow> P; |
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
366 |
\<And>a t b s. \<lbrakk>a1 = Lam a t; a2 = Lam b s; \<exists>pi. ({atom a}, t) \<approx>gen (op =) fv pi ({atom b}, s)\<rbrakk> |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
367 |
\<Longrightarrow> P\<rbrakk> |
1011 | 368 |
\<Longrightarrow> P" |
1020
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
369 |
unfolding alpha_gen |
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
370 |
apply (lifting alpha.cases[unfolded alpha_gen]) |
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
371 |
done |
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
372 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
373 |
(* not sure whether needed *) |
1011 | 374 |
lemma alpha_induct: |
375 |
"\<lbrakk>qx = qxa; \<And>a b. a = b \<Longrightarrow> qxb (Var a) (Var b); |
|
376 |
\<And>x xa xb xc. \<lbrakk>x = xa; qxb x xa; xb = xc; qxb xb xc\<rbrakk> \<Longrightarrow> qxb (App x xb) (App xa xc); |
|
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
377 |
\<And>a t b s. \<exists>pi. ({atom a}, t) \<approx>gen \<lambda>x1 x2. x1 = x2 \<and> qxb x1 x2 fv pi ({atom b}, s) \<Longrightarrow> qxb (Lam a t) (Lam b s)\<rbrakk> |
1011 | 378 |
\<Longrightarrow> qxb qx qxa" |
1020
89ccda903f4a
With unfolding Rep/Abs_eqvt no longer needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1019
diff
changeset
|
379 |
unfolding alpha_gen by (lifting alpha.induct[unfolded alpha_gen]) |
1011 | 380 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
381 |
(* should they lift automatically *) |
1011 | 382 |
lemma lam_inject [simp]: |
383 |
shows "(Var a = Var b) = (a = b)" |
|
384 |
and "(App t1 t2 = App s1 s2) = (t1 = s1 \<and> t2 = s2)" |
|
385 |
apply(lifting rlam.inject(1) rlam.inject(2)) |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
386 |
apply(regularize) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
387 |
prefer 2 |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
388 |
apply(regularize) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
389 |
prefer 2 |
1011 | 390 |
apply(auto) |
391 |
apply(drule alpha.cases) |
|
392 |
apply(simp_all) |
|
393 |
apply(simp add: alpha.a1) |
|
394 |
apply(drule alpha.cases) |
|
395 |
apply(simp_all) |
|
396 |
apply(drule alpha.cases) |
|
397 |
apply(simp_all) |
|
398 |
apply(rule alpha.a2) |
|
399 |
apply(simp_all) |
|
400 |
done |
|
401 |
||
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
402 |
thm a3_inv |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
403 |
lemma Lam_pseudo_inject: |
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
404 |
shows "(Lam a t = Lam b s) = (\<exists>pi. ({atom a}, t) \<approx>gen (op =) fv pi ({atom b}, s))" |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
405 |
apply(rule iffI) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
406 |
apply(rule a3_inv) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
407 |
apply(assumption) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
408 |
apply(rule a3) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
409 |
apply(assumption) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
410 |
done |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
411 |
|
1011 | 412 |
lemma rlam_distinct: |
413 |
shows "\<not>(rVar nam \<approx> rApp rlam1' rlam2')" |
|
414 |
and "\<not>(rApp rlam1' rlam2' \<approx> rVar nam)" |
|
415 |
and "\<not>(rVar nam \<approx> rLam nam' rlam')" |
|
416 |
and "\<not>(rLam nam' rlam' \<approx> rVar nam)" |
|
417 |
and "\<not>(rApp rlam1 rlam2 \<approx> rLam nam' rlam')" |
|
418 |
and "\<not>(rLam nam' rlam' \<approx> rApp rlam1 rlam2)" |
|
419 |
apply auto |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
420 |
apply (erule alpha.cases) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
421 |
apply (simp_all only: rlam.distinct) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
422 |
apply (erule alpha.cases) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
423 |
apply (simp_all only: rlam.distinct) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
424 |
apply (erule alpha.cases) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
425 |
apply (simp_all only: rlam.distinct) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
426 |
apply (erule alpha.cases) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
427 |
apply (simp_all only: rlam.distinct) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
428 |
apply (erule alpha.cases) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
429 |
apply (simp_all only: rlam.distinct) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
430 |
apply (erule alpha.cases) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
431 |
apply (simp_all only: rlam.distinct) |
1011 | 432 |
done |
433 |
||
434 |
lemma lam_distinct[simp]: |
|
435 |
shows "Var nam \<noteq> App lam1' lam2'" |
|
436 |
and "App lam1' lam2' \<noteq> Var nam" |
|
437 |
and "Var nam \<noteq> Lam nam' lam'" |
|
438 |
and "Lam nam' lam' \<noteq> Var nam" |
|
439 |
and "App lam1 lam2 \<noteq> Lam nam' lam'" |
|
440 |
and "Lam nam' lam' \<noteq> App lam1 lam2" |
|
441 |
apply(lifting rlam_distinct(1) rlam_distinct(2) rlam_distinct(3) rlam_distinct(4) rlam_distinct(5) rlam_distinct(6)) |
|
442 |
done |
|
443 |
||
444 |
lemma var_supp1: |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
445 |
shows "(supp (Var a)) = (supp a)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
446 |
apply (simp add: supp_def) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
447 |
done |
1011 | 448 |
|
449 |
lemma var_supp: |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
450 |
shows "(supp (Var a)) = {a:::name}" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
451 |
using var_supp1 by (simp add: supp_at_base) |
1011 | 452 |
|
453 |
lemma app_supp: |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
454 |
shows "supp (App t1 t2) = (supp t1) \<union> (supp t2)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
455 |
apply(simp only: supp_def lam_inject) |
1011 | 456 |
apply(simp add: Collect_imp_eq Collect_neg_eq) |
457 |
done |
|
458 |
||
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
459 |
(* supp for lam *) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
460 |
lemma lam_supp1: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
461 |
shows "(supp (atom x, t)) supports (Lam x t) " |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
462 |
apply(simp add: supports_def) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
463 |
apply(fold fresh_def) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
464 |
apply(simp add: fresh_Pair swap_fresh_fresh) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
465 |
apply(clarify) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
466 |
apply(subst swap_at_base_simps(3)) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
467 |
apply(simp_all add: fresh_atom) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
468 |
done |
1011 | 469 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
470 |
lemma lam_fsupp1: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
471 |
assumes a: "finite (supp t)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
472 |
shows "finite (supp (Lam x t))" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
473 |
apply(rule supports_finite) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
474 |
apply(rule lam_supp1) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
475 |
apply(simp add: a supp_Pair supp_atom) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
476 |
done |
1011 | 477 |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
478 |
instance lam :: fs |
1011 | 479 |
apply(default) |
480 |
apply(induct_tac x rule: lam_induct) |
|
481 |
apply(simp add: var_supp) |
|
482 |
apply(simp add: app_supp) |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
483 |
apply(simp add: lam_fsupp1) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
484 |
done |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
485 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
486 |
lemma supp_fv: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
487 |
shows "supp t = fv t" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
488 |
apply(induct t rule: lam_induct) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
489 |
apply(simp add: var_supp) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
490 |
apply(simp add: app_supp) |
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
491 |
apply(subgoal_tac "supp (Lam name lam) = supp (Abs {atom name} lam)") |
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
492 |
apply(simp add: supp_Abs) |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
493 |
apply(simp (no_asm) add: supp_def permute_set_eq atom_eqvt) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
494 |
apply(simp add: Lam_pseudo_inject) |
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
495 |
apply(simp add: Abs_eq_iff) |
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
496 |
apply(simp add: alpha_gen.simps) |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
497 |
apply(simp add: supp_eqvt[symmetric] fv_eqvt[symmetric]) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
498 |
done |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
499 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
500 |
lemma lam_supp2: |
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
501 |
shows "supp (Lam x t) = supp (Abs {atom x} t)" |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
502 |
apply(simp add: supp_def permute_set_eq atom_eqvt) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
503 |
apply(simp add: Lam_pseudo_inject) |
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
504 |
apply(simp add: Abs_eq_iff) |
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
505 |
apply(simp add: alpha_gen supp_fv) |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
506 |
done |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
507 |
|
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
508 |
lemma lam_supp: |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
509 |
shows "supp (Lam x t) = ((supp t) - {atom x})" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
510 |
apply(simp add: lam_supp2) |
1019
d7b8c4243cd6
Lam2 finished apart from Rep_eqvt.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1017
diff
changeset
|
511 |
apply(simp add: supp_Abs) |
1011 | 512 |
done |
513 |
||
514 |
lemma fresh_lam: |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
515 |
"(atom a \<sharp> Lam b t) \<longleftrightarrow> (a = b) \<or> (a \<noteq> b \<and> atom a \<sharp> t)" |
1011 | 516 |
apply(simp add: fresh_def) |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
517 |
apply(simp add: lam_supp) |
1011 | 518 |
apply(auto) |
519 |
done |
|
520 |
||
521 |
lemma lam_induct_strong: |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
522 |
fixes a::"'a::fs" |
1011 | 523 |
assumes a1: "\<And>name b. P b (Var name)" |
524 |
and a2: "\<And>lam1 lam2 b. \<lbrakk>\<And>c. P c lam1; \<And>c. P c lam2\<rbrakk> \<Longrightarrow> P b (App lam1 lam2)" |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
525 |
and a3: "\<And>name lam b. \<lbrakk>\<And>c. P c lam; (atom name) \<sharp> b\<rbrakk> \<Longrightarrow> P b (Lam name lam)" |
1011 | 526 |
shows "P a lam" |
527 |
proof - |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
528 |
have "\<And>pi a. P a (pi \<bullet> lam)" |
1011 | 529 |
proof (induct lam rule: lam_induct) |
530 |
case (1 name pi) |
|
531 |
show "P a (pi \<bullet> Var name)" |
|
532 |
apply (simp) |
|
533 |
apply (rule a1) |
|
534 |
done |
|
535 |
next |
|
536 |
case (2 lam1 lam2 pi) |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
537 |
have b1: "\<And>pi a. P a (pi \<bullet> lam1)" by fact |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
538 |
have b2: "\<And>pi a. P a (pi \<bullet> lam2)" by fact |
1011 | 539 |
show "P a (pi \<bullet> App lam1 lam2)" |
540 |
apply (simp) |
|
541 |
apply (rule a2) |
|
542 |
apply (rule b1) |
|
543 |
apply (rule b2) |
|
544 |
done |
|
545 |
next |
|
546 |
case (3 name lam pi a) |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
547 |
have b: "\<And>pi a. P a (pi \<bullet> lam)" by fact |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
548 |
obtain c::name where fr: "atom c\<sharp>(a, pi\<bullet>name, pi\<bullet>lam)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
549 |
apply(rule obtain_atom) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
550 |
apply(auto) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
551 |
sorry |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
552 |
from b fr have p: "P a (Lam c (((c \<leftrightarrow> (pi \<bullet> name)) + pi)\<bullet>lam))" |
1011 | 553 |
apply - |
554 |
apply(rule a3) |
|
555 |
apply(blast) |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
556 |
apply(simp add: fresh_Pair) |
1011 | 557 |
done |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
558 |
have eq: "(atom c \<rightleftharpoons> atom (pi\<bullet>name)) \<bullet> Lam (pi \<bullet> name) (pi \<bullet> lam) = Lam (pi \<bullet> name) (pi \<bullet> lam)" |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
559 |
apply(rule swap_fresh_fresh) |
1011 | 560 |
using fr |
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
561 |
apply(simp add: fresh_lam fresh_Pair) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
562 |
apply(simp add: fresh_lam fresh_Pair) |
1011 | 563 |
done |
564 |
show "P a (pi \<bullet> Lam name lam)" |
|
565 |
apply (simp) |
|
566 |
apply(subst eq[symmetric]) |
|
567 |
using p |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
568 |
apply(simp only: permute_lam) |
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
569 |
apply(simp add: flip_def) |
1011 | 570 |
done |
571 |
qed |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
572 |
then have "P a (0 \<bullet> lam)" by blast |
1011 | 573 |
then show "P a lam" by simp |
574 |
qed |
|
575 |
||
576 |
||
577 |
lemma var_fresh: |
|
578 |
fixes a::"name" |
|
1017
4239a0784e5f
All should be ok now.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1011
diff
changeset
|
579 |
shows "(atom a \<sharp> (Var b)) = (atom a \<sharp> b)" |
1011 | 580 |
apply(simp add: fresh_def) |
581 |
apply(simp add: var_supp1) |
|
582 |
done |
|
583 |
||
584 |
||
585 |
||
586 |
end |
|
587 |