author | wenzelm |
Mon, 22 Jun 1998 17:13:09 +0200 | |
changeset 5068 | fb28eaa07e01 |
parent 4833 | 2e53109d4bc8 |
child 5143 | b94cd208f073 |
permissions | -rw-r--r-- |
2640 | 1 |
(* Title: HOLCF/Fix.ML |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
2 |
ID: $Id$ |
1461 | 3 |
Author: Franz Regensburger |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
4 |
Copyright 1993 Technische Universitaet Muenchen |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
5 |
|
2640 | 6 |
Lemmas for Fix.thy |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
7 |
*) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
8 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
9 |
open Fix; |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
10 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
11 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
12 |
(* derive inductive properties of iterate from primitive recursion *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
13 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
14 |
|
2640 | 15 |
qed_goal "iterate_0" thy "iterate 0 F x = x" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
16 |
(fn prems => |
1461 | 17 |
[ |
18 |
(resolve_tac (nat_recs iterate_def) 1) |
|
19 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
20 |
|
2640 | 21 |
qed_goal "iterate_Suc" thy "iterate (Suc n) F x = F`(iterate n F x)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
22 |
(fn prems => |
1461 | 23 |
[ |
24 |
(resolve_tac (nat_recs iterate_def) 1) |
|
25 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
26 |
|
1267 | 27 |
Addsimps [iterate_0, iterate_Suc]; |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
28 |
|
2640 | 29 |
qed_goal "iterate_Suc2" thy "iterate (Suc n) F x = iterate n F (F`x)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
30 |
(fn prems => |
1461 | 31 |
[ |
32 |
(nat_ind_tac "n" 1), |
|
33 |
(Simp_tac 1), |
|
2033 | 34 |
(stac iterate_Suc 1), |
35 |
(stac iterate_Suc 1), |
|
36 |
(etac ssubst 1), |
|
37 |
(rtac refl 1) |
|
1461 | 38 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
39 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
40 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
41 |
(* the sequence of function itertaions is a chain *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
42 |
(* This property is essential since monotonicity of iterate makes no sense *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
43 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
44 |
|
4720 | 45 |
qed_goalw "chain_iterate2" thy [chain] |
46 |
" x << F`x ==> chain (%i. iterate i F x)" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
47 |
(fn prems => |
1461 | 48 |
[ |
49 |
(cut_facts_tac prems 1), |
|
50 |
(strip_tac 1), |
|
51 |
(Simp_tac 1), |
|
52 |
(nat_ind_tac "i" 1), |
|
53 |
(Asm_simp_tac 1), |
|
54 |
(Asm_simp_tac 1), |
|
55 |
(etac monofun_cfun_arg 1) |
|
56 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
57 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
58 |
|
4720 | 59 |
qed_goal "chain_iterate" thy |
60 |
"chain (%i. iterate i F UU)" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
61 |
(fn prems => |
1461 | 62 |
[ |
4720 | 63 |
(rtac chain_iterate2 1), |
1461 | 64 |
(rtac minimal 1) |
65 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
66 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
67 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
68 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
69 |
(* Kleene's fixed point theorems for continuous functions in pointed *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
70 |
(* omega cpo's *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
71 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
72 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
73 |
|
2640 | 74 |
qed_goalw "Ifix_eq" thy [Ifix_def] "Ifix F =F`(Ifix F)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
75 |
(fn prems => |
1461 | 76 |
[ |
2033 | 77 |
(stac contlub_cfun_arg 1), |
4720 | 78 |
(rtac chain_iterate 1), |
1461 | 79 |
(rtac antisym_less 1), |
80 |
(rtac lub_mono 1), |
|
4720 | 81 |
(rtac chain_iterate 1), |
1461 | 82 |
(rtac ch2ch_fappR 1), |
4720 | 83 |
(rtac chain_iterate 1), |
1461 | 84 |
(rtac allI 1), |
85 |
(rtac (iterate_Suc RS subst) 1), |
|
4720 | 86 |
(rtac (chain_iterate RS chainE RS spec) 1), |
1461 | 87 |
(rtac is_lub_thelub 1), |
88 |
(rtac ch2ch_fappR 1), |
|
4720 | 89 |
(rtac chain_iterate 1), |
1461 | 90 |
(rtac ub_rangeI 1), |
91 |
(rtac allI 1), |
|
92 |
(rtac (iterate_Suc RS subst) 1), |
|
93 |
(rtac is_ub_thelub 1), |
|
4720 | 94 |
(rtac chain_iterate 1) |
1461 | 95 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
96 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
97 |
|
2640 | 98 |
qed_goalw "Ifix_least" thy [Ifix_def] "F`x=x ==> Ifix(F) << x" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
99 |
(fn prems => |
1461 | 100 |
[ |
101 |
(cut_facts_tac prems 1), |
|
102 |
(rtac is_lub_thelub 1), |
|
4720 | 103 |
(rtac chain_iterate 1), |
1461 | 104 |
(rtac ub_rangeI 1), |
105 |
(strip_tac 1), |
|
106 |
(nat_ind_tac "i" 1), |
|
107 |
(Asm_simp_tac 1), |
|
108 |
(Asm_simp_tac 1), |
|
109 |
(res_inst_tac [("t","x")] subst 1), |
|
110 |
(atac 1), |
|
111 |
(etac monofun_cfun_arg 1) |
|
112 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
113 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
114 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
115 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
116 |
(* monotonicity and continuity of iterate *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
117 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
118 |
|
2640 | 119 |
qed_goalw "monofun_iterate" thy [monofun] "monofun(iterate(i))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
120 |
(fn prems => |
1461 | 121 |
[ |
122 |
(strip_tac 1), |
|
123 |
(nat_ind_tac "i" 1), |
|
124 |
(Asm_simp_tac 1), |
|
125 |
(Asm_simp_tac 1), |
|
126 |
(rtac (less_fun RS iffD2) 1), |
|
127 |
(rtac allI 1), |
|
128 |
(rtac monofun_cfun 1), |
|
129 |
(atac 1), |
|
130 |
(rtac (less_fun RS iffD1 RS spec) 1), |
|
131 |
(atac 1) |
|
132 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
133 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
134 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
135 |
(* the following lemma uses contlub_cfun which itself is based on a *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
136 |
(* diagonalisation lemma for continuous functions with two arguments. *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
137 |
(* In this special case it is the application function fapp *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
138 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
139 |
|
2640 | 140 |
qed_goalw "contlub_iterate" thy [contlub] "contlub(iterate(i))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
141 |
(fn prems => |
1461 | 142 |
[ |
143 |
(strip_tac 1), |
|
144 |
(nat_ind_tac "i" 1), |
|
145 |
(Asm_simp_tac 1), |
|
146 |
(rtac (lub_const RS thelubI RS sym) 1), |
|
147 |
(Asm_simp_tac 1), |
|
148 |
(rtac ext 1), |
|
2033 | 149 |
(stac thelub_fun 1), |
4720 | 150 |
(rtac chainI 1), |
1461 | 151 |
(rtac allI 1), |
152 |
(rtac (less_fun RS iffD2) 1), |
|
153 |
(rtac allI 1), |
|
4720 | 154 |
(rtac (chainE RS spec) 1), |
1461 | 155 |
(rtac (monofun_fapp1 RS ch2ch_MF2LR) 1), |
156 |
(rtac allI 1), |
|
157 |
(rtac monofun_fapp2 1), |
|
158 |
(atac 1), |
|
159 |
(rtac ch2ch_fun 1), |
|
160 |
(rtac (monofun_iterate RS ch2ch_monofun) 1), |
|
161 |
(atac 1), |
|
2033 | 162 |
(stac thelub_fun 1), |
1461 | 163 |
(rtac (monofun_iterate RS ch2ch_monofun) 1), |
164 |
(atac 1), |
|
165 |
(rtac contlub_cfun 1), |
|
166 |
(atac 1), |
|
167 |
(etac (monofun_iterate RS ch2ch_monofun RS ch2ch_fun) 1) |
|
168 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
169 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
170 |
|
2640 | 171 |
qed_goal "cont_iterate" thy "cont(iterate(i))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
172 |
(fn prems => |
1461 | 173 |
[ |
174 |
(rtac monocontlub2cont 1), |
|
175 |
(rtac monofun_iterate 1), |
|
176 |
(rtac contlub_iterate 1) |
|
177 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
178 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
179 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
180 |
(* a lemma about continuity of iterate in its third argument *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
181 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
182 |
|
2640 | 183 |
qed_goal "monofun_iterate2" thy "monofun(iterate n F)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
184 |
(fn prems => |
1461 | 185 |
[ |
186 |
(rtac monofunI 1), |
|
187 |
(strip_tac 1), |
|
188 |
(nat_ind_tac "n" 1), |
|
189 |
(Asm_simp_tac 1), |
|
190 |
(Asm_simp_tac 1), |
|
191 |
(etac monofun_cfun_arg 1) |
|
192 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
193 |
|
2640 | 194 |
qed_goal "contlub_iterate2" thy "contlub(iterate n F)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
195 |
(fn prems => |
1461 | 196 |
[ |
197 |
(rtac contlubI 1), |
|
198 |
(strip_tac 1), |
|
199 |
(nat_ind_tac "n" 1), |
|
200 |
(Simp_tac 1), |
|
201 |
(Simp_tac 1), |
|
3044
3e3087aa69e7
Updates because nat_ind_tac no longer appends "1" to the ind.var.
nipkow
parents:
2841
diff
changeset
|
202 |
(res_inst_tac [("t","iterate n F (lub(range(%u. Y u)))"), |
3e3087aa69e7
Updates because nat_ind_tac no longer appends "1" to the ind.var.
nipkow
parents:
2841
diff
changeset
|
203 |
("s","lub(range(%i. iterate n F (Y i)))")] ssubst 1), |
1461 | 204 |
(atac 1), |
205 |
(rtac contlub_cfun_arg 1), |
|
206 |
(etac (monofun_iterate2 RS ch2ch_monofun) 1) |
|
207 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
208 |
|
2640 | 209 |
qed_goal "cont_iterate2" thy "cont (iterate n F)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
210 |
(fn prems => |
1461 | 211 |
[ |
212 |
(rtac monocontlub2cont 1), |
|
213 |
(rtac monofun_iterate2 1), |
|
214 |
(rtac contlub_iterate2 1) |
|
215 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
216 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
217 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
218 |
(* monotonicity and continuity of Ifix *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
219 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
220 |
|
2640 | 221 |
qed_goalw "monofun_Ifix" thy [monofun,Ifix_def] "monofun(Ifix)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
222 |
(fn prems => |
1461 | 223 |
[ |
224 |
(strip_tac 1), |
|
225 |
(rtac lub_mono 1), |
|
4720 | 226 |
(rtac chain_iterate 1), |
227 |
(rtac chain_iterate 1), |
|
1461 | 228 |
(rtac allI 1), |
229 |
(rtac (less_fun RS iffD1 RS spec) 1), |
|
230 |
(etac (monofun_iterate RS monofunE RS spec RS spec RS mp) 1) |
|
231 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
232 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
233 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
234 |
(* since iterate is not monotone in its first argument, special lemmas must *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
235 |
(* be derived for lubs in this argument *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
236 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
237 |
|
4720 | 238 |
qed_goal "chain_iterate_lub" thy |
239 |
"chain(Y) ==> chain(%i. lub(range(%ia. iterate ia (Y i) UU)))" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
240 |
(fn prems => |
1461 | 241 |
[ |
242 |
(cut_facts_tac prems 1), |
|
4720 | 243 |
(rtac chainI 1), |
1461 | 244 |
(strip_tac 1), |
245 |
(rtac lub_mono 1), |
|
4720 | 246 |
(rtac chain_iterate 1), |
247 |
(rtac chain_iterate 1), |
|
1461 | 248 |
(strip_tac 1), |
4720 | 249 |
(etac (monofun_iterate RS ch2ch_monofun RS ch2ch_fun RS chainE |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
250 |
RS spec) 1) |
1461 | 251 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
252 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
253 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
254 |
(* this exchange lemma is analog to the one for monotone functions *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
255 |
(* observe that monotonicity is not really needed. The propagation of *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
256 |
(* chains is the essential argument which is usually derived from monot. *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
257 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
258 |
|
2640 | 259 |
qed_goal "contlub_Ifix_lemma1" thy |
4720 | 260 |
"chain(Y) ==>iterate n (lub(range Y)) y = lub(range(%i. iterate n (Y i) y))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
261 |
(fn prems => |
1461 | 262 |
[ |
263 |
(cut_facts_tac prems 1), |
|
264 |
(rtac (thelub_fun RS subst) 1), |
|
265 |
(rtac (monofun_iterate RS ch2ch_monofun) 1), |
|
266 |
(atac 1), |
|
267 |
(rtac fun_cong 1), |
|
2033 | 268 |
(stac (contlub_iterate RS contlubE RS spec RS mp) 1), |
1461 | 269 |
(atac 1), |
270 |
(rtac refl 1) |
|
271 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
272 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
273 |
|
4720 | 274 |
qed_goal "ex_lub_iterate" thy "chain(Y) ==>\ |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
275 |
\ lub(range(%i. lub(range(%ia. iterate i (Y ia) UU)))) =\ |
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
276 |
\ lub(range(%i. lub(range(%ia. iterate ia (Y i) UU))))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
277 |
(fn prems => |
1461 | 278 |
[ |
279 |
(cut_facts_tac prems 1), |
|
280 |
(rtac antisym_less 1), |
|
281 |
(rtac is_lub_thelub 1), |
|
282 |
(rtac (contlub_Ifix_lemma1 RS ext RS subst) 1), |
|
283 |
(atac 1), |
|
4720 | 284 |
(rtac chain_iterate 1), |
1461 | 285 |
(rtac ub_rangeI 1), |
286 |
(strip_tac 1), |
|
287 |
(rtac lub_mono 1), |
|
288 |
(etac (monofun_iterate RS ch2ch_monofun RS ch2ch_fun) 1), |
|
4720 | 289 |
(etac chain_iterate_lub 1), |
1461 | 290 |
(strip_tac 1), |
291 |
(rtac is_ub_thelub 1), |
|
4720 | 292 |
(rtac chain_iterate 1), |
1461 | 293 |
(rtac is_lub_thelub 1), |
4720 | 294 |
(etac chain_iterate_lub 1), |
1461 | 295 |
(rtac ub_rangeI 1), |
296 |
(strip_tac 1), |
|
297 |
(rtac lub_mono 1), |
|
4720 | 298 |
(rtac chain_iterate 1), |
1461 | 299 |
(rtac (contlub_Ifix_lemma1 RS ext RS subst) 1), |
300 |
(atac 1), |
|
4720 | 301 |
(rtac chain_iterate 1), |
1461 | 302 |
(strip_tac 1), |
303 |
(rtac is_ub_thelub 1), |
|
304 |
(etac (monofun_iterate RS ch2ch_monofun RS ch2ch_fun) 1) |
|
305 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
306 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
307 |
|
2640 | 308 |
qed_goalw "contlub_Ifix" thy [contlub,Ifix_def] "contlub(Ifix)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
309 |
(fn prems => |
1461 | 310 |
[ |
311 |
(strip_tac 1), |
|
2033 | 312 |
(stac (contlub_Ifix_lemma1 RS ext) 1), |
1461 | 313 |
(atac 1), |
314 |
(etac ex_lub_iterate 1) |
|
315 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
316 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
317 |
|
2640 | 318 |
qed_goal "cont_Ifix" thy "cont(Ifix)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
319 |
(fn prems => |
1461 | 320 |
[ |
321 |
(rtac monocontlub2cont 1), |
|
322 |
(rtac monofun_Ifix 1), |
|
323 |
(rtac contlub_Ifix 1) |
|
324 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
325 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
326 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
327 |
(* propagate properties of Ifix to its continuous counterpart *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
328 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
329 |
|
2640 | 330 |
qed_goalw "fix_eq" thy [fix_def] "fix`F = F`(fix`F)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
331 |
(fn prems => |
1461 | 332 |
[ |
4098 | 333 |
(asm_simp_tac (simpset() addsimps [cont_Ifix]) 1), |
1461 | 334 |
(rtac Ifix_eq 1) |
335 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
336 |
|
2640 | 337 |
qed_goalw "fix_least" thy [fix_def] "F`x = x ==> fix`F << x" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
338 |
(fn prems => |
1461 | 339 |
[ |
340 |
(cut_facts_tac prems 1), |
|
4098 | 341 |
(asm_simp_tac (simpset() addsimps [cont_Ifix]) 1), |
1461 | 342 |
(etac Ifix_least 1) |
343 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
344 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
345 |
|
2640 | 346 |
qed_goal "fix_eqI" thy |
1274 | 347 |
"[| F`x = x; !z. F`z = z --> x << z |] ==> x = fix`F" |
348 |
(fn prems => |
|
1461 | 349 |
[ |
350 |
(cut_facts_tac prems 1), |
|
351 |
(rtac antisym_less 1), |
|
352 |
(etac allE 1), |
|
353 |
(etac mp 1), |
|
354 |
(rtac (fix_eq RS sym) 1), |
|
355 |
(etac fix_least 1) |
|
356 |
]); |
|
1274 | 357 |
|
358 |
||
2640 | 359 |
qed_goal "fix_eq2" thy "f == fix`F ==> f = F`f" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
360 |
(fn prems => |
1461 | 361 |
[ |
362 |
(rewrite_goals_tac prems), |
|
363 |
(rtac fix_eq 1) |
|
364 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
365 |
|
2640 | 366 |
qed_goal "fix_eq3" thy "f == fix`F ==> f`x = F`f`x" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
367 |
(fn prems => |
1461 | 368 |
[ |
369 |
(rtac trans 1), |
|
370 |
(rtac ((hd prems) RS fix_eq2 RS cfun_fun_cong) 1), |
|
371 |
(rtac refl 1) |
|
372 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
373 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
374 |
fun fix_tac3 thm i = ((rtac trans i) THEN (rtac (thm RS fix_eq3) i)); |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
375 |
|
2640 | 376 |
qed_goal "fix_eq4" thy "f = fix`F ==> f = F`f" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
377 |
(fn prems => |
1461 | 378 |
[ |
379 |
(cut_facts_tac prems 1), |
|
380 |
(hyp_subst_tac 1), |
|
381 |
(rtac fix_eq 1) |
|
382 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
383 |
|
2640 | 384 |
qed_goal "fix_eq5" thy "f = fix`F ==> f`x = F`f`x" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
385 |
(fn prems => |
1461 | 386 |
[ |
387 |
(rtac trans 1), |
|
388 |
(rtac ((hd prems) RS fix_eq4 RS cfun_fun_cong) 1), |
|
389 |
(rtac refl 1) |
|
390 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
391 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
392 |
fun fix_tac5 thm i = ((rtac trans i) THEN (rtac (thm RS fix_eq5) i)); |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
393 |
|
3652 | 394 |
(* proves the unfolding theorem for function equations f = fix`... *) |
395 |
fun fix_prover thy fixeq s = prove_goal thy s (fn prems => [ |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
396 |
(rtac trans 1), |
3652 | 397 |
(rtac (fixeq RS fix_eq4) 1), |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
398 |
(rtac trans 1), |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
399 |
(rtac beta_cfun 1), |
2566 | 400 |
(Simp_tac 1) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
401 |
]); |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
402 |
|
3652 | 403 |
(* proves the unfolding theorem for function definitions f == fix`... *) |
404 |
fun fix_prover2 thy fixdef s = prove_goal thy s (fn prems => [ |
|
1461 | 405 |
(rtac trans 1), |
406 |
(rtac (fix_eq2) 1), |
|
407 |
(rtac fixdef 1), |
|
408 |
(rtac beta_cfun 1), |
|
2566 | 409 |
(Simp_tac 1) |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
410 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
411 |
|
3652 | 412 |
(* proves an application case for a function from its unfolding thm *) |
413 |
fun case_prover thy unfold s = prove_goal thy s (fn prems => [ |
|
414 |
(cut_facts_tac prems 1), |
|
415 |
(rtac trans 1), |
|
416 |
(stac unfold 1), |
|
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4423
diff
changeset
|
417 |
Auto_tac |
3652 | 418 |
]); |
419 |
||
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
420 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
421 |
(* better access to definitions *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
422 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
423 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
424 |
|
2640 | 425 |
qed_goal "Ifix_def2" thy "Ifix=(%x. lub(range(%i. iterate i x UU)))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
426 |
(fn prems => |
1461 | 427 |
[ |
428 |
(rtac ext 1), |
|
429 |
(rewtac Ifix_def), |
|
430 |
(rtac refl 1) |
|
431 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
432 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
433 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
434 |
(* direct connection between fix and iteration without Ifix *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
435 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
436 |
|
2640 | 437 |
qed_goalw "fix_def2" thy [fix_def] |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
438 |
"fix`F = lub(range(%i. iterate i F UU))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
439 |
(fn prems => |
1461 | 440 |
[ |
441 |
(fold_goals_tac [Ifix_def]), |
|
4098 | 442 |
(asm_simp_tac (simpset() addsimps [cont_Ifix]) 1) |
1461 | 443 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
444 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
445 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
446 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
447 |
(* Lemmas about admissibility and fixed point induction *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
448 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
449 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
450 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
451 |
(* access to definitions *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
452 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
453 |
|
3460 | 454 |
qed_goalw "admI" thy [adm_def] |
4720 | 455 |
"(!!Y. [| chain(Y); !i. P(Y(i)) |] ==> P(lub(range(Y)))) ==> adm(P)" |
3460 | 456 |
(fn prems => [fast_tac (HOL_cs addIs prems) 1]); |
457 |
||
458 |
qed_goalw "admD" thy [adm_def] |
|
4720 | 459 |
"!!P. [| adm(P); chain(Y); !i. P(Y(i)) |] ==> P(lub(range(Y)))" |
3460 | 460 |
(fn prems => [fast_tac HOL_cs 1]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
461 |
|
2640 | 462 |
qed_goalw "admw_def2" thy [admw_def] |
3842 | 463 |
"admw(P) = (!F.(!n. P(iterate n F UU)) -->\ |
464 |
\ P (lub(range(%i. iterate i F UU))))" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
465 |
(fn prems => |
1461 | 466 |
[ |
467 |
(rtac refl 1) |
|
468 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
469 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
470 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
471 |
(* an admissible formula is also weak admissible *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
472 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
473 |
|
3460 | 474 |
qed_goalw "adm_impl_admw" thy [admw_def] "!!P. adm(P)==>admw(P)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
475 |
(fn prems => |
1461 | 476 |
[ |
477 |
(strip_tac 1), |
|
3460 | 478 |
(etac admD 1), |
4720 | 479 |
(rtac chain_iterate 1), |
1461 | 480 |
(atac 1) |
481 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
482 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
483 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
484 |
(* fixed point induction *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
485 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
486 |
|
2640 | 487 |
qed_goal "fix_ind" thy |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
488 |
"[| adm(P);P(UU);!!x. P(x) ==> P(F`x)|] ==> P(fix`F)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
489 |
(fn prems => |
1461 | 490 |
[ |
491 |
(cut_facts_tac prems 1), |
|
2033 | 492 |
(stac fix_def2 1), |
3460 | 493 |
(etac admD 1), |
4720 | 494 |
(rtac chain_iterate 1), |
1461 | 495 |
(rtac allI 1), |
496 |
(nat_ind_tac "i" 1), |
|
2033 | 497 |
(stac iterate_0 1), |
1461 | 498 |
(atac 1), |
2033 | 499 |
(stac iterate_Suc 1), |
1461 | 500 |
(resolve_tac prems 1), |
501 |
(atac 1) |
|
502 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
503 |
|
2640 | 504 |
qed_goal "def_fix_ind" thy "[| f == fix`F; adm(P); \ |
2568 | 505 |
\ P(UU);!!x. P(x) ==> P(F`x)|] ==> P f" (fn prems => [ |
506 |
(cut_facts_tac prems 1), |
|
507 |
(asm_simp_tac HOL_ss 1), |
|
508 |
(etac fix_ind 1), |
|
509 |
(atac 1), |
|
510 |
(eresolve_tac prems 1)]); |
|
511 |
||
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
512 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
513 |
(* computational induction for weak admissible formulae *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
514 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
515 |
|
2640 | 516 |
qed_goal "wfix_ind" thy |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
517 |
"[| admw(P); !n. P(iterate n F UU)|] ==> P(fix`F)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
518 |
(fn prems => |
1461 | 519 |
[ |
520 |
(cut_facts_tac prems 1), |
|
2033 | 521 |
(stac fix_def2 1), |
1461 | 522 |
(rtac (admw_def2 RS iffD1 RS spec RS mp) 1), |
523 |
(atac 1), |
|
524 |
(rtac allI 1), |
|
525 |
(etac spec 1) |
|
526 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
527 |
|
2640 | 528 |
qed_goal "def_wfix_ind" thy "[| f == fix`F; admw(P); \ |
2568 | 529 |
\ !n. P(iterate n F UU) |] ==> P f" (fn prems => [ |
530 |
(cut_facts_tac prems 1), |
|
531 |
(asm_simp_tac HOL_ss 1), |
|
532 |
(etac wfix_ind 1), |
|
533 |
(atac 1)]); |
|
534 |
||
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
535 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
536 |
(* for chain-finite (easy) types every formula is admissible *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
537 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
538 |
|
2640 | 539 |
qed_goalw "adm_max_in_chain" thy [adm_def] |
4720 | 540 |
"!Y. chain(Y::nat=>'a) --> (? n. max_in_chain n Y) ==> adm(P::'a=>bool)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
541 |
(fn prems => |
1461 | 542 |
[ |
543 |
(cut_facts_tac prems 1), |
|
544 |
(strip_tac 1), |
|
545 |
(rtac exE 1), |
|
546 |
(rtac mp 1), |
|
547 |
(etac spec 1), |
|
548 |
(atac 1), |
|
2033 | 549 |
(stac (lub_finch1 RS thelubI) 1), |
1461 | 550 |
(atac 1), |
551 |
(atac 1), |
|
552 |
(etac spec 1) |
|
553 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
554 |
|
4720 | 555 |
bind_thm ("adm_chfin" ,chfin RS adm_max_in_chain); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
556 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
557 |
(* ------------------------------------------------------------------------ *) |
4720 | 558 |
(* some lemmata for functions with flat/chfin domain/range types *) |
2354 | 559 |
(* ------------------------------------------------------------------------ *) |
560 |
||
3324 | 561 |
qed_goalw "adm_chfindom" thy [adm_def] "adm (%(u::'a::cpo->'b::chfin). P(u`s))" |
562 |
(fn _ => [ |
|
2354 | 563 |
strip_tac 1, |
564 |
dtac chfin_fappR 1, |
|
565 |
eres_inst_tac [("x","s")] allE 1, |
|
4098 | 566 |
fast_tac (HOL_cs addss (simpset() addsimps [chfin])) 1]); |
2354 | 567 |
|
3324 | 568 |
(* adm_flat not needed any more, since it is a special case of adm_chfindom *) |
2354 | 569 |
|
1992 | 570 |
(* ------------------------------------------------------------------------ *) |
3326 | 571 |
(* improved admisibility introduction *) |
1992 | 572 |
(* ------------------------------------------------------------------------ *) |
573 |
||
3460 | 574 |
qed_goalw "admI2" thy [adm_def] |
4720 | 575 |
"(!!Y. [| chain Y; !i. P (Y i); !i. ? j. i < j & Y i ~= Y j & Y i << Y j |]\ |
1992 | 576 |
\ ==> P(lub (range Y))) ==> adm P" |
577 |
(fn prems => [ |
|
2033 | 578 |
strip_tac 1, |
579 |
etac increasing_chain_adm_lemma 1, atac 1, |
|
580 |
eresolve_tac prems 1, atac 1, atac 1]); |
|
1992 | 581 |
|
582 |
||
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
583 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
584 |
(* admissibility of special formulae and propagation *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
585 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
586 |
|
2640 | 587 |
qed_goalw "adm_less" thy [adm_def] |
3842 | 588 |
"[|cont u;cont v|]==> adm(%x. u x << v x)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
589 |
(fn prems => |
1461 | 590 |
[ |
591 |
(cut_facts_tac prems 1), |
|
592 |
(strip_tac 1), |
|
593 |
(etac (cont2contlub RS contlubE RS spec RS mp RS ssubst) 1), |
|
594 |
(atac 1), |
|
595 |
(etac (cont2contlub RS contlubE RS spec RS mp RS ssubst) 1), |
|
596 |
(atac 1), |
|
597 |
(rtac lub_mono 1), |
|
598 |
(cut_facts_tac prems 1), |
|
599 |
(etac (cont2mono RS ch2ch_monofun) 1), |
|
600 |
(atac 1), |
|
601 |
(cut_facts_tac prems 1), |
|
602 |
(etac (cont2mono RS ch2ch_monofun) 1), |
|
603 |
(atac 1), |
|
604 |
(atac 1) |
|
605 |
]); |
|
3460 | 606 |
Addsimps [adm_less]; |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
607 |
|
2640 | 608 |
qed_goal "adm_conj" thy |
3460 | 609 |
"!!P. [| adm P; adm Q |] ==> adm(%x. P x & Q x)" |
610 |
(fn prems => [fast_tac (HOL_cs addEs [admD] addIs [admI]) 1]); |
|
611 |
Addsimps [adm_conj]; |
|
612 |
||
3842 | 613 |
qed_goalw "adm_not_free" thy [adm_def] "adm(%x. t)" |
3460 | 614 |
(fn prems => [fast_tac HOL_cs 1]); |
615 |
Addsimps [adm_not_free]; |
|
616 |
||
617 |
qed_goalw "adm_not_less" thy [adm_def] |
|
618 |
"!!t. cont t ==> adm(%x.~ (t x) << u)" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
619 |
(fn prems => |
1461 | 620 |
[ |
621 |
(strip_tac 1), |
|
622 |
(rtac contrapos 1), |
|
623 |
(etac spec 1), |
|
624 |
(rtac trans_less 1), |
|
625 |
(atac 2), |
|
626 |
(etac (cont2mono RS monofun_fun_arg) 1), |
|
627 |
(rtac is_ub_thelub 1), |
|
628 |
(atac 1) |
|
629 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
630 |
|
3460 | 631 |
qed_goal "adm_all" thy |
3842 | 632 |
"!!P. !y. adm(P y) ==> adm(%x.!y. P y x)" |
3460 | 633 |
(fn prems => [fast_tac (HOL_cs addIs [admI] addEs [admD]) 1]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
634 |
|
1779 | 635 |
bind_thm ("adm_all2", allI RS adm_all); |
625 | 636 |
|
2640 | 637 |
qed_goal "adm_subst" thy |
3460 | 638 |
"!!P. [|cont t; adm P|] ==> adm(%x. P (t x))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
639 |
(fn prems => |
1461 | 640 |
[ |
3460 | 641 |
(rtac admI 1), |
2033 | 642 |
(stac (cont2contlub RS contlubE RS spec RS mp) 1), |
1461 | 643 |
(atac 1), |
644 |
(atac 1), |
|
3460 | 645 |
(etac admD 1), |
646 |
(etac (cont2mono RS ch2ch_monofun) 1), |
|
1461 | 647 |
(atac 1), |
648 |
(atac 1) |
|
649 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
650 |
|
2640 | 651 |
qed_goal "adm_UU_not_less" thy "adm(%x.~ UU << t(x))" |
3460 | 652 |
(fn prems => [Simp_tac 1]); |
653 |
||
654 |
qed_goalw "adm_not_UU" thy [adm_def] |
|
655 |
"!!t. cont(t)==> adm(%x.~ (t x) = UU)" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
656 |
(fn prems => |
1461 | 657 |
[ |
658 |
(strip_tac 1), |
|
659 |
(rtac contrapos 1), |
|
660 |
(etac spec 1), |
|
661 |
(rtac (chain_UU_I RS spec) 1), |
|
662 |
(rtac (cont2mono RS ch2ch_monofun) 1), |
|
663 |
(atac 1), |
|
664 |
(atac 1), |
|
665 |
(rtac (cont2contlub RS contlubE RS spec RS mp RS subst) 1), |
|
666 |
(atac 1), |
|
667 |
(atac 1), |
|
668 |
(atac 1) |
|
669 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
670 |
|
2640 | 671 |
qed_goal "adm_eq" thy |
3460 | 672 |
"!!u. [|cont u ; cont v|]==> adm(%x. u x = v x)" |
4098 | 673 |
(fn prems => [asm_simp_tac (simpset() addsimps [po_eq_conv]) 1]); |
3460 | 674 |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
675 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
676 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
677 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
678 |
(* admissibility for disjunction is hard to prove. It takes 10 Lemmas *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
679 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
680 |
|
1992 | 681 |
local |
682 |
||
2619 | 683 |
val adm_disj_lemma1 = prove_goal HOL.thy |
3842 | 684 |
"!n. P(Y n)|Q(Y n) ==> (? i.!j. R i j --> Q(Y(j))) | (!i.? j. R i j & P(Y(j)))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
685 |
(fn prems => |
1461 | 686 |
[ |
687 |
(cut_facts_tac prems 1), |
|
688 |
(fast_tac HOL_cs 1) |
|
689 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
690 |
|
2640 | 691 |
val adm_disj_lemma2 = prove_goal thy |
4720 | 692 |
"!!Q. [| adm(Q); ? X. chain(X) & (!n. Q(X(n))) &\ |
1992 | 693 |
\ lub(range(Y))=lub(range(X))|] ==> Q(lub(range(Y)))" |
4098 | 694 |
(fn _ => [fast_tac (claset() addEs [admD] addss simpset()) 1]); |
2619 | 695 |
|
4720 | 696 |
val adm_disj_lemma3 = prove_goalw thy [chain] |
697 |
"!!Q. chain(Y) ==> chain(%m. if m < Suc i then Y(Suc i) else Y m)" |
|
2619 | 698 |
(fn _ => |
1461 | 699 |
[ |
4833 | 700 |
Asm_simp_tac 1, |
2619 | 701 |
safe_tac HOL_cs, |
702 |
subgoal_tac "ia = i" 1, |
|
703 |
Asm_simp_tac 1, |
|
704 |
trans_tac 1 |
|
1461 | 705 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
706 |
|
2619 | 707 |
val adm_disj_lemma4 = prove_goal Nat.thy |
708 |
"!!Q. !j. i < j --> Q(Y(j)) ==> !n. Q( if n < Suc i then Y(Suc i) else Y n)" |
|
709 |
(fn _ => |
|
1461 | 710 |
[ |
4833 | 711 |
Asm_simp_tac 1, |
2619 | 712 |
strip_tac 1, |
713 |
etac allE 1, |
|
714 |
etac mp 1, |
|
715 |
trans_tac 1 |
|
1461 | 716 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
717 |
|
2640 | 718 |
val adm_disj_lemma5 = prove_goal thy |
4720 | 719 |
"!!Y::nat=>'a::cpo. [| chain(Y); ! j. i < j --> Q(Y(j)) |] ==>\ |
1992 | 720 |
\ lub(range(Y)) = lub(range(%m. if m< Suc(i) then Y(Suc(i)) else Y m))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
721 |
(fn prems => |
1461 | 722 |
[ |
2619 | 723 |
safe_tac (HOL_cs addSIs [lub_equal2,adm_disj_lemma3]), |
2764 | 724 |
atac 2, |
4833 | 725 |
Asm_simp_tac 1, |
2619 | 726 |
res_inst_tac [("x","i")] exI 1, |
727 |
strip_tac 1, |
|
728 |
trans_tac 1 |
|
1461 | 729 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
730 |
|
2640 | 731 |
val adm_disj_lemma6 = prove_goal thy |
4720 | 732 |
"[| chain(Y::nat=>'a::cpo); ? i. ! j. i < j --> Q(Y(j)) |] ==>\ |
733 |
\ ? X. chain(X) & (! n. Q(X(n))) & lub(range(Y)) = lub(range(X))" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
734 |
(fn prems => |
1461 | 735 |
[ |
736 |
(cut_facts_tac prems 1), |
|
737 |
(etac exE 1), |
|
3842 | 738 |
(res_inst_tac [("x","%m. if m<Suc(i) then Y(Suc(i)) else Y m")] exI 1), |
1461 | 739 |
(rtac conjI 1), |
740 |
(rtac adm_disj_lemma3 1), |
|
741 |
(atac 1), |
|
742 |
(rtac conjI 1), |
|
743 |
(rtac adm_disj_lemma4 1), |
|
744 |
(atac 1), |
|
745 |
(rtac adm_disj_lemma5 1), |
|
746 |
(atac 1), |
|
747 |
(atac 1) |
|
748 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
749 |
|
2640 | 750 |
val adm_disj_lemma7 = prove_goal thy |
4720 | 751 |
"[| chain(Y::nat=>'a::cpo); ! i. ? j. i < j & P(Y(j)) |] ==>\ |
752 |
\ chain(%m. Y(Least(%j. m<j & P(Y(j)))))" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
753 |
(fn prems => |
1461 | 754 |
[ |
755 |
(cut_facts_tac prems 1), |
|
4720 | 756 |
(rtac chainI 1), |
1461 | 757 |
(rtac allI 1), |
758 |
(rtac chain_mono3 1), |
|
759 |
(atac 1), |
|
1675 | 760 |
(rtac Least_le 1), |
1461 | 761 |
(rtac conjI 1), |
762 |
(rtac Suc_lessD 1), |
|
763 |
(etac allE 1), |
|
764 |
(etac exE 1), |
|
1675 | 765 |
(rtac (LeastI RS conjunct1) 1), |
1461 | 766 |
(atac 1), |
767 |
(etac allE 1), |
|
768 |
(etac exE 1), |
|
1675 | 769 |
(rtac (LeastI RS conjunct2) 1), |
1461 | 770 |
(atac 1) |
771 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
772 |
|
2640 | 773 |
val adm_disj_lemma8 = prove_goal thy |
2619 | 774 |
"[| ! i. ? j. i < j & P(Y(j)) |] ==> ! m. P(Y(LEAST j::nat. m<j & P(Y(j))))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
775 |
(fn prems => |
1461 | 776 |
[ |
777 |
(cut_facts_tac prems 1), |
|
778 |
(strip_tac 1), |
|
779 |
(etac allE 1), |
|
780 |
(etac exE 1), |
|
1675 | 781 |
(etac (LeastI RS conjunct2) 1) |
1461 | 782 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
783 |
|
2640 | 784 |
val adm_disj_lemma9 = prove_goal thy |
4720 | 785 |
"[| chain(Y::nat=>'a::cpo); ! i. ? j. i < j & P(Y(j)) |] ==>\ |
1992 | 786 |
\ lub(range(Y)) = lub(range(%m. Y(Least(%j. m<j & P(Y(j))))))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
787 |
(fn prems => |
1461 | 788 |
[ |
789 |
(cut_facts_tac prems 1), |
|
790 |
(rtac antisym_less 1), |
|
791 |
(rtac lub_mono 1), |
|
792 |
(atac 1), |
|
793 |
(rtac adm_disj_lemma7 1), |
|
794 |
(atac 1), |
|
795 |
(atac 1), |
|
796 |
(strip_tac 1), |
|
797 |
(rtac (chain_mono RS mp) 1), |
|
798 |
(atac 1), |
|
799 |
(etac allE 1), |
|
800 |
(etac exE 1), |
|
1675 | 801 |
(rtac (LeastI RS conjunct1) 1), |
1461 | 802 |
(atac 1), |
803 |
(rtac lub_mono3 1), |
|
804 |
(rtac adm_disj_lemma7 1), |
|
805 |
(atac 1), |
|
806 |
(atac 1), |
|
807 |
(atac 1), |
|
808 |
(strip_tac 1), |
|
809 |
(rtac exI 1), |
|
810 |
(rtac (chain_mono RS mp) 1), |
|
811 |
(atac 1), |
|
812 |
(rtac lessI 1) |
|
813 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
814 |
|
2640 | 815 |
val adm_disj_lemma10 = prove_goal thy |
4720 | 816 |
"[| chain(Y::nat=>'a::cpo); ! i. ? j. i < j & P(Y(j)) |] ==>\ |
817 |
\ ? X. chain(X) & (! n. P(X(n))) & lub(range(Y)) = lub(range(X))" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
818 |
(fn prems => |
1461 | 819 |
[ |
820 |
(cut_facts_tac prems 1), |
|
1675 | 821 |
(res_inst_tac [("x","%m. Y(Least(%j. m<j & P(Y(j))))")] exI 1), |
1461 | 822 |
(rtac conjI 1), |
823 |
(rtac adm_disj_lemma7 1), |
|
824 |
(atac 1), |
|
825 |
(atac 1), |
|
826 |
(rtac conjI 1), |
|
827 |
(rtac adm_disj_lemma8 1), |
|
828 |
(atac 1), |
|
829 |
(rtac adm_disj_lemma9 1), |
|
830 |
(atac 1), |
|
831 |
(atac 1) |
|
832 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
833 |
|
2640 | 834 |
val adm_disj_lemma12 = prove_goal thy |
4720 | 835 |
"[| adm(P); chain(Y);? i. ! j. i < j --> P(Y(j))|]==>P(lub(range(Y)))" |
1992 | 836 |
(fn prems => |
837 |
[ |
|
838 |
(cut_facts_tac prems 1), |
|
839 |
(etac adm_disj_lemma2 1), |
|
840 |
(etac adm_disj_lemma6 1), |
|
841 |
(atac 1) |
|
842 |
]); |
|
430 | 843 |
|
1992 | 844 |
in |
845 |
||
2640 | 846 |
val adm_lemma11 = prove_goal thy |
4720 | 847 |
"[| adm(P); chain(Y); ! i. ? j. i < j & P(Y(j)) |]==>P(lub(range(Y)))" |
430 | 848 |
(fn prems => |
1461 | 849 |
[ |
850 |
(cut_facts_tac prems 1), |
|
851 |
(etac adm_disj_lemma2 1), |
|
852 |
(etac adm_disj_lemma10 1), |
|
853 |
(atac 1) |
|
854 |
]); |
|
430 | 855 |
|
2640 | 856 |
val adm_disj = prove_goal thy |
3842 | 857 |
"!!P. [| adm P; adm Q |] ==> adm(%x. P x | Q x)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
858 |
(fn prems => |
1461 | 859 |
[ |
3460 | 860 |
(rtac admI 1), |
1461 | 861 |
(rtac (adm_disj_lemma1 RS disjE) 1), |
862 |
(atac 1), |
|
863 |
(rtac disjI2 1), |
|
864 |
(etac adm_disj_lemma12 1), |
|
865 |
(atac 1), |
|
866 |
(atac 1), |
|
867 |
(rtac disjI1 1), |
|
1992 | 868 |
(etac adm_lemma11 1), |
1461 | 869 |
(atac 1), |
870 |
(atac 1) |
|
871 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
872 |
|
1992 | 873 |
end; |
874 |
||
875 |
bind_thm("adm_lemma11",adm_lemma11); |
|
876 |
bind_thm("adm_disj",adm_disj); |
|
430 | 877 |
|
2640 | 878 |
qed_goal "adm_imp" thy |
4720 | 879 |
"!!P. [| adm(%x.~(P x)); adm Q |] ==> adm(%x. P x --> Q x)" (K [ |
3842 | 880 |
(subgoal_tac "(%x. P x --> Q x) = (%x. ~P x | Q x)" 1), |
4720 | 881 |
(etac ssubst 1), |
3652 | 882 |
(etac adm_disj 1), |
883 |
(atac 1), |
|
4720 | 884 |
(Simp_tac 1) |
1461 | 885 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
886 |
|
5068 | 887 |
Goal "!! P. [| adm (%x. P x --> Q x); adm (%x. Q x --> P x) |] \ |
3460 | 888 |
\ ==> adm (%x. P x = Q x)"; |
4423 | 889 |
by (subgoal_tac "(%x. P x = Q x) = (%x. (P x --> Q x) & (Q x --> P x))" 1); |
3460 | 890 |
by (Asm_simp_tac 1); |
891 |
by (rtac ext 1); |
|
892 |
by (fast_tac HOL_cs 1); |
|
893 |
qed"adm_iff"; |
|
894 |
||
895 |
||
2640 | 896 |
qed_goal "adm_not_conj" thy |
1681 | 897 |
"[| adm (%x. ~ P x); adm (%x. ~ Q x) |] ==> adm (%x. ~ (P x & Q x))"(fn prems=>[ |
2033 | 898 |
cut_facts_tac prems 1, |
899 |
subgoal_tac |
|
900 |
"(%x. ~ (P x & Q x)) = (%x. ~ P x | ~ Q x)" 1, |
|
901 |
rtac ext 2, |
|
902 |
fast_tac HOL_cs 2, |
|
903 |
etac ssubst 1, |
|
904 |
etac adm_disj 1, |
|
905 |
atac 1]); |
|
1675 | 906 |
|
2566 | 907 |
val adm_lemmas = [adm_imp,adm_disj,adm_eq,adm_not_UU,adm_UU_not_less, |
3460 | 908 |
adm_all2,adm_not_less,adm_not_free,adm_not_conj,adm_conj,adm_less, |
909 |
adm_iff]; |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
910 |
|
2566 | 911 |
Addsimps adm_lemmas; |