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