author | paulson |
Fri, 07 Mar 1997 10:21:11 +0100 | |
changeset 2749 | 2f477a0e690d |
parent 2640 | ee4dfce170a0 |
child 2764 | d56b5df57d73 |
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 |
|
2640 | 45 |
qed_goalw "is_chain_iterate2" thy [is_chain] |
1461 | 46 |
" x << F`x ==> is_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 |
|
2640 | 59 |
qed_goal "is_chain_iterate" thy |
1461 | 60 |
"is_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 |
[ |
63 |
(rtac is_chain_iterate2 1), |
|
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), |
1461 | 78 |
(rtac is_chain_iterate 1), |
79 |
(rtac antisym_less 1), |
|
80 |
(rtac lub_mono 1), |
|
81 |
(rtac is_chain_iterate 1), |
|
82 |
(rtac ch2ch_fappR 1), |
|
83 |
(rtac is_chain_iterate 1), |
|
84 |
(rtac allI 1), |
|
85 |
(rtac (iterate_Suc RS subst) 1), |
|
86 |
(rtac (is_chain_iterate RS is_chainE RS spec) 1), |
|
87 |
(rtac is_lub_thelub 1), |
|
88 |
(rtac ch2ch_fappR 1), |
|
89 |
(rtac is_chain_iterate 1), |
|
90 |
(rtac ub_rangeI 1), |
|
91 |
(rtac allI 1), |
|
92 |
(rtac (iterate_Suc RS subst) 1), |
|
93 |
(rtac is_ub_thelub 1), |
|
94 |
(rtac is_chain_iterate 1) |
|
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), |
|
103 |
(rtac is_chain_iterate 1), |
|
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), |
1461 | 150 |
(rtac is_chainI 1), |
151 |
(rtac allI 1), |
|
152 |
(rtac (less_fun RS iffD2) 1), |
|
153 |
(rtac allI 1), |
|
154 |
(rtac (is_chainE RS spec) 1), |
|
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), |
|
202 |
(res_inst_tac [("t","iterate n1 F (lub(range(%u. Y u)))"), |
|
203 |
("s","lub(range(%i. iterate n1 F (Y i)))")] ssubst 1), |
|
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), |
|
226 |
(rtac is_chain_iterate 1), |
|
227 |
(rtac is_chain_iterate 1), |
|
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 |
|
2640 | 238 |
qed_goal "is_chain_iterate_lub" thy |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
239 |
"is_chain(Y) ==> is_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), |
|
243 |
(rtac is_chainI 1), |
|
244 |
(strip_tac 1), |
|
245 |
(rtac lub_mono 1), |
|
246 |
(rtac is_chain_iterate 1), |
|
247 |
(rtac is_chain_iterate 1), |
|
248 |
(strip_tac 1), |
|
249 |
(etac (monofun_iterate RS ch2ch_monofun RS ch2ch_fun RS is_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 |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
260 |
"is_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 |
|
2640 | 274 |
qed_goal "ex_lub_iterate" thy "is_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), |
|
284 |
(rtac is_chain_iterate 1), |
|
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), |
|
289 |
(etac is_chain_iterate_lub 1), |
|
290 |
(strip_tac 1), |
|
291 |
(rtac is_ub_thelub 1), |
|
292 |
(rtac is_chain_iterate 1), |
|
293 |
(rtac is_lub_thelub 1), |
|
294 |
(etac is_chain_iterate_lub 1), |
|
295 |
(rtac ub_rangeI 1), |
|
296 |
(strip_tac 1), |
|
297 |
(rtac lub_mono 1), |
|
298 |
(rtac is_chain_iterate 1), |
|
299 |
(rtac (contlub_Ifix_lemma1 RS ext RS subst) 1), |
|
300 |
(atac 1), |
|
301 |
(rtac is_chain_iterate 1), |
|
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 |
[ |
333 |
(asm_simp_tac (!simpset addsimps [cont_Ifix]) 1), |
|
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), |
|
341 |
(asm_simp_tac (!simpset addsimps [cont_Ifix]) 1), |
|
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 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
394 |
fun fix_prover thy fixdef thm = prove_goal thy thm |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
395 |
(fn prems => |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
396 |
[ |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
397 |
(rtac trans 1), |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
398 |
(rtac (fixdef RS fix_eq4) 1), |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
399 |
(rtac trans 1), |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
400 |
(rtac beta_cfun 1), |
2566 | 401 |
(Simp_tac 1) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
402 |
]); |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
403 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
404 |
(* use this one for definitions! *) |
297 | 405 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
406 |
fun fix_prover2 thy fixdef thm = prove_goal thy thm |
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
407 |
(fn prems => |
1461 | 408 |
[ |
409 |
(rtac trans 1), |
|
410 |
(rtac (fix_eq2) 1), |
|
411 |
(rtac fixdef 1), |
|
412 |
(rtac beta_cfun 1), |
|
2566 | 413 |
(Simp_tac 1) |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
414 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
415 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
416 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
417 |
(* better access to definitions *) |
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 |
|
2640 | 421 |
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
|
422 |
(fn prems => |
1461 | 423 |
[ |
424 |
(rtac ext 1), |
|
425 |
(rewtac Ifix_def), |
|
426 |
(rtac refl 1) |
|
427 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
428 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
429 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
430 |
(* direct connection between fix and iteration without Ifix *) |
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 |
|
2640 | 433 |
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
|
434 |
"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
|
435 |
(fn prems => |
1461 | 436 |
[ |
437 |
(fold_goals_tac [Ifix_def]), |
|
438 |
(asm_simp_tac (!simpset addsimps [cont_Ifix]) 1) |
|
439 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
440 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
441 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
442 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
443 |
(* Lemmas about admissibility and fixed point induction *) |
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 |
(* access to definitions *) |
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 |
|
2640 | 450 |
qed_goalw "adm_def2" thy [adm_def] |
1461 | 451 |
"adm(P) = (!Y. is_chain(Y) --> (!i.P(Y(i))) --> P(lub(range(Y))))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
452 |
(fn prems => |
1461 | 453 |
[ |
454 |
(rtac refl 1) |
|
455 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
456 |
|
2640 | 457 |
qed_goalw "admw_def2" thy [admw_def] |
1461 | 458 |
"admw(P) = (!F.(!n.P(iterate n F UU)) -->\ |
459 |
\ 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
|
460 |
(fn prems => |
1461 | 461 |
[ |
462 |
(rtac refl 1) |
|
463 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
464 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
465 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
466 |
(* an admissible formula is also weak admissible *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
467 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
468 |
|
2640 | 469 |
qed_goalw "adm_impl_admw" thy [admw_def] "adm(P)==>admw(P)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
470 |
(fn prems => |
1461 | 471 |
[ |
472 |
(cut_facts_tac prems 1), |
|
473 |
(strip_tac 1), |
|
474 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
|
475 |
(atac 1), |
|
476 |
(rtac is_chain_iterate 1), |
|
477 |
(atac 1) |
|
478 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
479 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
480 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
481 |
(* fixed point induction *) |
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 |
|
2640 | 484 |
qed_goal "fix_ind" thy |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
485 |
"[| 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
|
486 |
(fn prems => |
1461 | 487 |
[ |
488 |
(cut_facts_tac prems 1), |
|
2033 | 489 |
(stac fix_def2 1), |
1461 | 490 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
491 |
(atac 1), |
|
492 |
(rtac is_chain_iterate 1), |
|
493 |
(rtac allI 1), |
|
494 |
(nat_ind_tac "i" 1), |
|
2033 | 495 |
(stac iterate_0 1), |
1461 | 496 |
(atac 1), |
2033 | 497 |
(stac iterate_Suc 1), |
1461 | 498 |
(resolve_tac prems 1), |
499 |
(atac 1) |
|
500 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
501 |
|
2640 | 502 |
qed_goal "def_fix_ind" thy "[| f == fix`F; adm(P); \ |
2568 | 503 |
\ P(UU);!!x. P(x) ==> P(F`x)|] ==> P f" (fn prems => [ |
504 |
(cut_facts_tac prems 1), |
|
505 |
(asm_simp_tac HOL_ss 1), |
|
506 |
(etac fix_ind 1), |
|
507 |
(atac 1), |
|
508 |
(eresolve_tac prems 1)]); |
|
509 |
||
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
510 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
511 |
(* computational induction for weak admissible formulae *) |
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 |
|
2640 | 514 |
qed_goal "wfix_ind" thy |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
515 |
"[| 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
|
516 |
(fn prems => |
1461 | 517 |
[ |
518 |
(cut_facts_tac prems 1), |
|
2033 | 519 |
(stac fix_def2 1), |
1461 | 520 |
(rtac (admw_def2 RS iffD1 RS spec RS mp) 1), |
521 |
(atac 1), |
|
522 |
(rtac allI 1), |
|
523 |
(etac spec 1) |
|
524 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
525 |
|
2640 | 526 |
qed_goal "def_wfix_ind" thy "[| f == fix`F; admw(P); \ |
2568 | 527 |
\ !n. P(iterate n F UU) |] ==> P f" (fn prems => [ |
528 |
(cut_facts_tac prems 1), |
|
529 |
(asm_simp_tac HOL_ss 1), |
|
530 |
(etac wfix_ind 1), |
|
531 |
(atac 1)]); |
|
532 |
||
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
533 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
534 |
(* 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
|
535 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
536 |
|
2640 | 537 |
qed_goalw "adm_max_in_chain" thy [adm_def] |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
538 |
"!Y. is_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
|
539 |
(fn prems => |
1461 | 540 |
[ |
541 |
(cut_facts_tac prems 1), |
|
542 |
(strip_tac 1), |
|
543 |
(rtac exE 1), |
|
544 |
(rtac mp 1), |
|
545 |
(etac spec 1), |
|
546 |
(atac 1), |
|
2033 | 547 |
(stac (lub_finch1 RS thelubI) 1), |
1461 | 548 |
(atac 1), |
549 |
(atac 1), |
|
550 |
(etac spec 1) |
|
551 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
552 |
|
2640 | 553 |
qed_goalw "adm_chain_finite" thy [chain_finite_def] |
1461 | 554 |
"chain_finite(x::'a) ==> adm(P::'a=>bool)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
555 |
(fn prems => |
1461 | 556 |
[ |
557 |
(cut_facts_tac prems 1), |
|
558 |
(etac adm_max_in_chain 1) |
|
559 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
560 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
561 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
562 |
(* flat types are chain_finite *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
563 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
564 |
|
2640 | 565 |
qed_goalw "flat_imp_chain_finite" thy [flat_def,chain_finite_def] |
2275 | 566 |
"flat(x::'a)==>chain_finite(x::'a)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
567 |
(fn prems => |
1461 | 568 |
[ |
569 |
(rewtac max_in_chain_def), |
|
570 |
(cut_facts_tac prems 1), |
|
571 |
(strip_tac 1), |
|
1675 | 572 |
(case_tac "!i.Y(i)=UU" 1), |
1461 | 573 |
(res_inst_tac [("x","0")] exI 1), |
574 |
(strip_tac 1), |
|
575 |
(rtac trans 1), |
|
576 |
(etac spec 1), |
|
577 |
(rtac sym 1), |
|
578 |
(etac spec 1), |
|
579 |
(rtac (chain_mono2 RS exE) 1), |
|
580 |
(fast_tac HOL_cs 1), |
|
581 |
(atac 1), |
|
582 |
(res_inst_tac [("x","Suc(x)")] exI 1), |
|
583 |
(strip_tac 1), |
|
584 |
(rtac disjE 1), |
|
585 |
(atac 3), |
|
586 |
(rtac mp 1), |
|
587 |
(dtac spec 1), |
|
588 |
(etac spec 1), |
|
589 |
(etac (le_imp_less_or_eq RS disjE) 1), |
|
590 |
(etac (chain_mono RS mp) 1), |
|
591 |
(atac 1), |
|
592 |
(hyp_subst_tac 1), |
|
593 |
(rtac refl_less 1), |
|
594 |
(res_inst_tac [("P","Y(Suc(x)) = UU")] notE 1), |
|
595 |
(atac 2), |
|
596 |
(rtac mp 1), |
|
597 |
(etac spec 1), |
|
598 |
(Asm_simp_tac 1) |
|
599 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
600 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
601 |
|
1779 | 602 |
bind_thm ("adm_flat", flat_imp_chain_finite RS adm_chain_finite); |
2275 | 603 |
(* flat(?x::?'a) ==> adm(?P::?'a => bool) *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
604 |
|
2354 | 605 |
(* ------------------------------------------------------------------------ *) |
606 |
(* some properties of flat *) |
|
607 |
(* ------------------------------------------------------------------------ *) |
|
608 |
||
2640 | 609 |
qed_goalw "flatI" thy [flat_def] "!x y::'a.x<<y-->x=UU|x=y==>flat(x::'a)" |
610 |
(fn prems => [rtac (hd(prems)) 1]); |
|
611 |
||
612 |
qed_goalw "flatE" thy [flat_def] "flat(x::'a)==>!x y::'a.x<<y-->x=UU|x=y" |
|
613 |
(fn prems => [rtac (hd(prems)) 1]); |
|
614 |
||
615 |
qed_goalw "flat_flat" thy [flat_def] "flat(x::'a::flat)" |
|
616 |
(fn prems => [rtac ax_flat 1]); |
|
617 |
||
618 |
qed_goalw "flatdom2monofun" thy [flat_def] |
|
2354 | 619 |
"[| flat(x::'a::pcpo); f UU = UU |] ==> monofun (f::'a=>'b::pcpo)" |
620 |
(fn prems => |
|
621 |
[ |
|
622 |
cut_facts_tac prems 1, |
|
623 |
fast_tac ((HOL_cs addss !simpset) addSIs [monofunI]) 1 |
|
624 |
]); |
|
625 |
||
626 |
||
2640 | 627 |
qed_goalw "flat_eq" thy [flat_def] |
2275 | 628 |
"[| flat (x::'a); (a::'a) ~= UU |] ==> a << b = (a = b)" (fn prems=>[ |
2033 | 629 |
(cut_facts_tac prems 1), |
630 |
(fast_tac (HOL_cs addIs [refl_less]) 1)]); |
|
1992 | 631 |
|
2354 | 632 |
|
633 |
(* ------------------------------------------------------------------------ *) |
|
634 |
(* some lemmata for functions with flat/chain_finite domain/range types *) |
|
635 |
(* ------------------------------------------------------------------------ *) |
|
636 |
||
2640 | 637 |
qed_goalw "chfinI" thy [chain_finite_def] |
638 |
"!Y::nat=>'a.is_chain Y-->(? n.max_in_chain n Y)==>chain_finite(x::'a)" |
|
639 |
(fn prems => [rtac (hd(prems)) 1]); |
|
640 |
||
641 |
qed_goalw "chfinE" Fix.thy [chain_finite_def] |
|
642 |
"chain_finite(x::'a)==>!Y::nat=>'a.is_chain Y-->(? n.max_in_chain n Y)" |
|
643 |
(fn prems => [rtac (hd(prems)) 1]); |
|
644 |
||
645 |
qed_goalw "chfin_chfin" thy [chain_finite_def] "chain_finite(x::'a::chfin)" |
|
646 |
(fn prems => [rtac ax_chfin 1]); |
|
647 |
||
648 |
qed_goal "chfin2finch" thy |
|
649 |
"[| is_chain (Y::nat=>'a); chain_finite(x::'a) |] ==> finite_chain Y" |
|
2354 | 650 |
(fn prems => |
651 |
[ |
|
652 |
cut_facts_tac prems 1, |
|
653 |
fast_tac (HOL_cs addss |
|
654 |
(!simpset addsimps [chain_finite_def,finite_chain_def])) 1 |
|
655 |
]); |
|
656 |
||
2640 | 657 |
bind_thm("flat_subclass_chfin",flat_flat RS flat_imp_chain_finite RS chfinE); |
658 |
||
659 |
qed_goal "chfindom_monofun2cont" thy |
|
2354 | 660 |
"[| chain_finite(x::'a::pcpo); monofun f |] ==> cont (f::'a=>'b::pcpo)" |
661 |
(fn prems => |
|
662 |
[ |
|
663 |
cut_facts_tac prems 1, |
|
664 |
rtac monocontlub2cont 1, |
|
665 |
atac 1, |
|
666 |
rtac contlubI 1, |
|
667 |
strip_tac 1, |
|
668 |
dtac (chfin2finch COMP swap_prems_rl) 1, |
|
669 |
atac 1, |
|
670 |
rtac antisym_less 1, |
|
671 |
fast_tac ((HOL_cs addIs [is_ub_thelub,ch2ch_monofun]) |
|
672 |
addss (HOL_ss addsimps [finite_chain_def,maxinch_is_thelub])) 1, |
|
673 |
dtac (monofun_finch2finch COMP swap_prems_rl) 1, |
|
674 |
atac 1, |
|
675 |
fast_tac ((HOL_cs |
|
676 |
addIs [is_ub_thelub,(monofunE RS spec RS spec RS mp)]) |
|
677 |
addss (HOL_ss addsimps [finite_chain_def,maxinch_is_thelub])) 1 |
|
678 |
]); |
|
679 |
||
680 |
bind_thm("flatdom_monofun2cont",flat_imp_chain_finite RS chfindom_monofun2cont); |
|
681 |
(* [| flat ?x; monofun ?f |] ==> cont ?f *) |
|
682 |
||
2640 | 683 |
qed_goal "flatdom_strict2cont" thy |
2354 | 684 |
"[| flat(x::'a::pcpo); f UU = UU |] ==> cont (f::'a=>'b::pcpo)" |
685 |
(fn prems => |
|
686 |
[ |
|
687 |
cut_facts_tac prems 1, |
|
688 |
fast_tac ((HOL_cs addSIs [flatdom2monofun, |
|
689 |
flat_imp_chain_finite RS chfindom_monofun2cont])) 1 |
|
690 |
]); |
|
691 |
||
2640 | 692 |
qed_goal "chfin_fappR" thy |
2354 | 693 |
"[| is_chain (Y::nat => 'a->'b); chain_finite(x::'b) |] ==> \ |
694 |
\ !s. ? n. lub(range(Y))`s = Y n`s" |
|
695 |
(fn prems => |
|
696 |
[ |
|
697 |
cut_facts_tac prems 1, |
|
698 |
rtac allI 1, |
|
699 |
rtac (contlub_cfun_fun RS ssubst) 1, |
|
700 |
atac 1, |
|
701 |
fast_tac (HOL_cs addSIs [thelubI,lub_finch2,chfin2finch,ch2ch_fappL])1 |
|
702 |
]); |
|
703 |
||
2640 | 704 |
qed_goalw "adm_chfindom" thy [adm_def] |
2354 | 705 |
"chain_finite (x::'b) ==> adm (%(u::'a->'b). P(u`s))" (fn prems => [ |
706 |
cut_facts_tac prems 1, |
|
707 |
strip_tac 1, |
|
708 |
dtac chfin_fappR 1, |
|
709 |
atac 1, |
|
710 |
eres_inst_tac [("x","s")] allE 1, |
|
711 |
fast_tac (HOL_cs addss !simpset) 1]); |
|
712 |
||
713 |
bind_thm("adm_flatdom",flat_imp_chain_finite RS adm_chfindom); |
|
714 |
(* flat ?x ==> adm (%u. ?P (u`?s)) *) |
|
715 |
||
716 |
||
1992 | 717 |
(* ------------------------------------------------------------------------ *) |
718 |
(* lemmata for improved admissibility introdution rule *) |
|
719 |
(* ------------------------------------------------------------------------ *) |
|
720 |
||
721 |
qed_goal "infinite_chain_adm_lemma" Porder.thy |
|
722 |
"[|is_chain Y; !i. P (Y i); \ |
|
723 |
\ (!!Y. [| is_chain Y; !i. P (Y i); ~ finite_chain Y |] ==> P (lub (range Y)))\ |
|
724 |
\ |] ==> P (lub (range Y))" |
|
725 |
(fn prems => [ |
|
2033 | 726 |
cut_facts_tac prems 1, |
727 |
case_tac "finite_chain Y" 1, |
|
728 |
eresolve_tac prems 2, atac 2, atac 2, |
|
729 |
rewtac finite_chain_def, |
|
730 |
safe_tac HOL_cs, |
|
731 |
etac (lub_finch1 RS thelubI RS ssubst) 1, atac 1, etac spec 1]); |
|
1992 | 732 |
|
733 |
qed_goal "increasing_chain_adm_lemma" Porder.thy |
|
734 |
"[|is_chain Y; !i. P (Y i); \ |
|
735 |
\ (!!Y. [| is_chain Y; !i. P (Y i); !i. ? j. i < j & Y i ~= Y j & Y i << Y j|]\ |
|
736 |
\ ==> P (lub (range Y))) |] ==> P (lub (range Y))" |
|
737 |
(fn prems => [ |
|
2033 | 738 |
cut_facts_tac prems 1, |
739 |
etac infinite_chain_adm_lemma 1, atac 1, etac thin_rl 1, |
|
740 |
rewtac finite_chain_def, |
|
741 |
safe_tac HOL_cs, |
|
742 |
etac swap 1, |
|
743 |
rewtac max_in_chain_def, |
|
744 |
resolve_tac prems 1, atac 1, atac 1, |
|
745 |
fast_tac (HOL_cs addDs [le_imp_less_or_eq] |
|
746 |
addEs [chain_mono RS mp]) 1]); |
|
1992 | 747 |
|
2640 | 748 |
qed_goalw "admI" thy [adm_def] |
1992 | 749 |
"(!!Y. [| is_chain Y; !i. P (Y i); !i. ? j. i < j & Y i ~= Y j & Y i << Y j |]\ |
750 |
\ ==> P(lub (range Y))) ==> adm P" |
|
751 |
(fn prems => [ |
|
2033 | 752 |
strip_tac 1, |
753 |
etac increasing_chain_adm_lemma 1, atac 1, |
|
754 |
eresolve_tac prems 1, atac 1, atac 1]); |
|
1992 | 755 |
|
756 |
||
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
757 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
758 |
(* continuous isomorphisms are strict *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
759 |
(* a prove for embedding projection pairs is similar *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
760 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
761 |
|
2640 | 762 |
qed_goal "iso_strict" thy |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
763 |
"!!f g.[|!y.f`(g`y)=(y::'b) ; !x.g`(f`x)=(x::'a) |] \ |
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
764 |
\ ==> f`UU=UU & g`UU=UU" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
765 |
(fn prems => |
1461 | 766 |
[ |
767 |
(rtac conjI 1), |
|
768 |
(rtac UU_I 1), |
|
769 |
(res_inst_tac [("s","f`(g`(UU::'b))"),("t","UU::'b")] subst 1), |
|
770 |
(etac spec 1), |
|
771 |
(rtac (minimal RS monofun_cfun_arg) 1), |
|
772 |
(rtac UU_I 1), |
|
773 |
(res_inst_tac [("s","g`(f`(UU::'a))"),("t","UU::'a")] subst 1), |
|
774 |
(etac spec 1), |
|
775 |
(rtac (minimal RS monofun_cfun_arg) 1) |
|
776 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
777 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
778 |
|
2640 | 779 |
qed_goal "isorep_defined" thy |
1461 | 780 |
"[|!x.rep`(abs`x)=x;!y.abs`(rep`y)=y; z~=UU|] ==> rep`z ~= UU" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
781 |
(fn prems => |
1461 | 782 |
[ |
783 |
(cut_facts_tac prems 1), |
|
784 |
(etac swap 1), |
|
785 |
(dtac notnotD 1), |
|
786 |
(dres_inst_tac [("f","abs")] cfun_arg_cong 1), |
|
787 |
(etac box_equals 1), |
|
788 |
(fast_tac HOL_cs 1), |
|
789 |
(etac (iso_strict RS conjunct1) 1), |
|
790 |
(atac 1) |
|
791 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
792 |
|
2640 | 793 |
qed_goal "isoabs_defined" thy |
1461 | 794 |
"[|!x.rep`(abs`x) = x;!y.abs`(rep`y)=y ; z~=UU|] ==> abs`z ~= UU" |
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), |
|
798 |
(etac swap 1), |
|
799 |
(dtac notnotD 1), |
|
800 |
(dres_inst_tac [("f","rep")] cfun_arg_cong 1), |
|
801 |
(etac box_equals 1), |
|
802 |
(fast_tac HOL_cs 1), |
|
803 |
(etac (iso_strict RS conjunct2) 1), |
|
804 |
(atac 1) |
|
805 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
806 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
807 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
808 |
(* propagation of flatness and chainfiniteness by continuous isomorphisms *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
809 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
810 |
|
2640 | 811 |
qed_goalw "chfin2chfin" thy [chain_finite_def] |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
812 |
"!!f g.[|chain_finite(x::'a); !y.f`(g`y)=(y::'b) ; !x.g`(f`x)=(x::'a) |] \ |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
813 |
\ ==> chain_finite(y::'b)" |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
814 |
(fn prems => |
1461 | 815 |
[ |
816 |
(rewtac max_in_chain_def), |
|
817 |
(strip_tac 1), |
|
818 |
(rtac exE 1), |
|
819 |
(res_inst_tac [("P","is_chain(%i.g`(Y i))")] mp 1), |
|
820 |
(etac spec 1), |
|
821 |
(etac ch2ch_fappR 1), |
|
822 |
(rtac exI 1), |
|
823 |
(strip_tac 1), |
|
824 |
(res_inst_tac [("s","f`(g`(Y x))"),("t","Y(x)")] subst 1), |
|
825 |
(etac spec 1), |
|
826 |
(res_inst_tac [("s","f`(g`(Y j))"),("t","Y(j)")] subst 1), |
|
827 |
(etac spec 1), |
|
828 |
(rtac cfun_arg_cong 1), |
|
829 |
(rtac mp 1), |
|
830 |
(etac spec 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 |
qed_goalw "flat2flat" thy [flat_def] |
2275 | 835 |
"!!f g.[|flat(x::'a); !y.f`(g`y)=(y::'b) ; !x.g`(f`x)=(x::'a) |] \ |
836 |
\ ==> flat(y::'b)" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
837 |
(fn prems => |
1461 | 838 |
[ |
839 |
(strip_tac 1), |
|
840 |
(rtac disjE 1), |
|
841 |
(res_inst_tac [("P","g`x<<g`y")] mp 1), |
|
842 |
(etac monofun_cfun_arg 2), |
|
843 |
(dtac spec 1), |
|
844 |
(etac spec 1), |
|
845 |
(rtac disjI1 1), |
|
846 |
(rtac trans 1), |
|
847 |
(res_inst_tac [("s","f`(g`x)"),("t","x")] subst 1), |
|
848 |
(etac spec 1), |
|
849 |
(etac cfun_arg_cong 1), |
|
850 |
(rtac (iso_strict RS conjunct1) 1), |
|
851 |
(atac 1), |
|
852 |
(atac 1), |
|
853 |
(rtac disjI2 1), |
|
854 |
(res_inst_tac [("s","f`(g`x)"),("t","x")] subst 1), |
|
855 |
(etac spec 1), |
|
856 |
(res_inst_tac [("s","f`(g`y)"),("t","y")] subst 1), |
|
857 |
(etac spec 1), |
|
858 |
(etac cfun_arg_cong 1) |
|
859 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
860 |
|
625 | 861 |
(* ------------------------------------------------------------------------- *) |
862 |
(* a result about functions with flat codomain *) |
|
863 |
(* ------------------------------------------------------------------------- *) |
|
864 |
||
2640 | 865 |
qed_goalw "flat_codom" thy [flat_def] |
2275 | 866 |
"[|flat(y::'b);f`(x::'a)=(c::'b)|] ==> f`(UU::'a)=(UU::'b) | (!z.f`(z::'a)=c)" |
625 | 867 |
(fn prems => |
1461 | 868 |
[ |
869 |
(cut_facts_tac prems 1), |
|
1675 | 870 |
(case_tac "f`(x::'a)=(UU::'b)" 1), |
1461 | 871 |
(rtac disjI1 1), |
872 |
(rtac UU_I 1), |
|
873 |
(res_inst_tac [("s","f`(x)"),("t","UU::'b")] subst 1), |
|
874 |
(atac 1), |
|
875 |
(rtac (minimal RS monofun_cfun_arg) 1), |
|
1675 | 876 |
(case_tac "f`(UU::'a)=(UU::'b)" 1), |
1461 | 877 |
(etac disjI1 1), |
878 |
(rtac disjI2 1), |
|
879 |
(rtac allI 1), |
|
880 |
(res_inst_tac [("s","f`x"),("t","c")] subst 1), |
|
881 |
(atac 1), |
|
882 |
(res_inst_tac [("a","f`(UU::'a)")] (refl RS box_equals) 1), |
|
883 |
(etac allE 1),(etac allE 1), |
|
884 |
(dtac mp 1), |
|
1780 | 885 |
(res_inst_tac [("fo","f")] (minimal RS monofun_cfun_arg) 1), |
1461 | 886 |
(etac disjE 1), |
887 |
(contr_tac 1), |
|
888 |
(atac 1), |
|
889 |
(etac allE 1), |
|
890 |
(etac allE 1), |
|
891 |
(dtac mp 1), |
|
1780 | 892 |
(res_inst_tac [("fo","f")] (minimal RS monofun_cfun_arg) 1), |
1461 | 893 |
(etac disjE 1), |
894 |
(contr_tac 1), |
|
895 |
(atac 1) |
|
896 |
]); |
|
625 | 897 |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
898 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
899 |
(* admissibility of special formulae and propagation *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
900 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
901 |
|
2640 | 902 |
qed_goalw "adm_less" thy [adm_def] |
1461 | 903 |
"[|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
|
904 |
(fn prems => |
1461 | 905 |
[ |
906 |
(cut_facts_tac prems 1), |
|
907 |
(strip_tac 1), |
|
908 |
(etac (cont2contlub RS contlubE RS spec RS mp RS ssubst) 1), |
|
909 |
(atac 1), |
|
910 |
(etac (cont2contlub RS contlubE RS spec RS mp RS ssubst) 1), |
|
911 |
(atac 1), |
|
912 |
(rtac lub_mono 1), |
|
913 |
(cut_facts_tac prems 1), |
|
914 |
(etac (cont2mono RS ch2ch_monofun) 1), |
|
915 |
(atac 1), |
|
916 |
(cut_facts_tac prems 1), |
|
917 |
(etac (cont2mono RS ch2ch_monofun) 1), |
|
918 |
(atac 1), |
|
919 |
(atac 1) |
|
920 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
921 |
|
2640 | 922 |
qed_goal "adm_conj" thy |
1461 | 923 |
"[| 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
|
924 |
(fn prems => |
1461 | 925 |
[ |
926 |
(cut_facts_tac prems 1), |
|
927 |
(rtac (adm_def2 RS iffD2) 1), |
|
928 |
(strip_tac 1), |
|
929 |
(rtac conjI 1), |
|
930 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
|
931 |
(atac 1), |
|
932 |
(atac 1), |
|
933 |
(fast_tac HOL_cs 1), |
|
934 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
|
935 |
(atac 1), |
|
936 |
(atac 1), |
|
937 |
(fast_tac HOL_cs 1) |
|
938 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
939 |
|
2640 | 940 |
qed_goal "adm_cong" thy |
1461 | 941 |
"(!x. P x = Q x) ==> adm P = adm Q " |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
942 |
(fn prems => |
1461 | 943 |
[ |
944 |
(cut_facts_tac prems 1), |
|
945 |
(res_inst_tac [("s","P"),("t","Q")] subst 1), |
|
946 |
(rtac refl 2), |
|
947 |
(rtac ext 1), |
|
948 |
(etac spec 1) |
|
949 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
950 |
|
2640 | 951 |
qed_goalw "adm_not_free" thy [adm_def] "adm(%x.t)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
952 |
(fn prems => |
1461 | 953 |
[ |
954 |
(fast_tac HOL_cs 1) |
|
955 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
956 |
|
2640 | 957 |
qed_goalw "adm_not_less" thy [adm_def] |
1461 | 958 |
"cont t ==> adm(%x.~ (t x) << u)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
959 |
(fn prems => |
1461 | 960 |
[ |
961 |
(cut_facts_tac prems 1), |
|
962 |
(strip_tac 1), |
|
963 |
(rtac contrapos 1), |
|
964 |
(etac spec 1), |
|
965 |
(rtac trans_less 1), |
|
966 |
(atac 2), |
|
967 |
(etac (cont2mono RS monofun_fun_arg) 1), |
|
968 |
(rtac is_ub_thelub 1), |
|
969 |
(atac 1) |
|
970 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
971 |
|
2640 | 972 |
qed_goal "adm_all" thy |
1461 | 973 |
" !y.adm(P y) ==> adm(%x.!y.P y x)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
974 |
(fn prems => |
1461 | 975 |
[ |
976 |
(cut_facts_tac prems 1), |
|
977 |
(rtac (adm_def2 RS iffD2) 1), |
|
978 |
(strip_tac 1), |
|
979 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
|
980 |
(etac spec 1), |
|
981 |
(atac 1), |
|
982 |
(rtac allI 1), |
|
983 |
(dtac spec 1), |
|
984 |
(etac spec 1) |
|
985 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
986 |
|
1779 | 987 |
bind_thm ("adm_all2", allI RS adm_all); |
625 | 988 |
|
2640 | 989 |
qed_goal "adm_subst" thy |
1461 | 990 |
"[|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
|
991 |
(fn prems => |
1461 | 992 |
[ |
993 |
(cut_facts_tac prems 1), |
|
994 |
(rtac (adm_def2 RS iffD2) 1), |
|
995 |
(strip_tac 1), |
|
2033 | 996 |
(stac (cont2contlub RS contlubE RS spec RS mp) 1), |
1461 | 997 |
(atac 1), |
998 |
(atac 1), |
|
999 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
|
1000 |
(atac 1), |
|
1001 |
(rtac (cont2mono RS ch2ch_monofun) 1), |
|
1002 |
(atac 1), |
|
1003 |
(atac 1), |
|
1004 |
(atac 1) |
|
1005 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1006 |
|
2640 | 1007 |
qed_goal "adm_UU_not_less" thy "adm(%x.~ UU << t(x))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1008 |
(fn prems => |
1461 | 1009 |
[ |
1010 |
(res_inst_tac [("P2","%x.False")] (adm_cong RS iffD1) 1), |
|
1011 |
(Asm_simp_tac 1), |
|
1012 |
(rtac adm_not_free 1) |
|
1013 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1014 |
|
2640 | 1015 |
qed_goalw "adm_not_UU" thy [adm_def] |
1461 | 1016 |
"cont(t)==> adm(%x.~ (t x) = UU)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1017 |
(fn prems => |
1461 | 1018 |
[ |
1019 |
(cut_facts_tac prems 1), |
|
1020 |
(strip_tac 1), |
|
1021 |
(rtac contrapos 1), |
|
1022 |
(etac spec 1), |
|
1023 |
(rtac (chain_UU_I RS spec) 1), |
|
1024 |
(rtac (cont2mono RS ch2ch_monofun) 1), |
|
1025 |
(atac 1), |
|
1026 |
(atac 1), |
|
1027 |
(rtac (cont2contlub RS contlubE RS spec RS mp RS subst) 1), |
|
1028 |
(atac 1), |
|
1029 |
(atac 1), |
|
1030 |
(atac 1) |
|
1031 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1032 |
|
2640 | 1033 |
qed_goal "adm_eq" thy |
1461 | 1034 |
"[|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
|
1035 |
(fn prems => |
1461 | 1036 |
[ |
1037 |
(rtac (adm_cong RS iffD1) 1), |
|
1038 |
(rtac allI 1), |
|
1039 |
(rtac iffI 1), |
|
1040 |
(rtac antisym_less 1), |
|
1041 |
(rtac antisym_less_inverse 3), |
|
1042 |
(atac 3), |
|
1043 |
(etac conjunct1 1), |
|
1044 |
(etac conjunct2 1), |
|
1045 |
(rtac adm_conj 1), |
|
1046 |
(rtac adm_less 1), |
|
1047 |
(resolve_tac prems 1), |
|
1048 |
(resolve_tac prems 1), |
|
1049 |
(rtac adm_less 1), |
|
1050 |
(resolve_tac prems 1), |
|
1051 |
(resolve_tac prems 1) |
|
1052 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1053 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1054 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1055 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1056 |
(* 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
|
1057 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1058 |
|
1992 | 1059 |
local |
1060 |
||
2619 | 1061 |
val adm_disj_lemma1 = prove_goal HOL.thy |
1062 |
"!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
|
1063 |
(fn prems => |
1461 | 1064 |
[ |
1065 |
(cut_facts_tac prems 1), |
|
1066 |
(fast_tac HOL_cs 1) |
|
1067 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1068 |
|
2640 | 1069 |
val adm_disj_lemma2 = prove_goal thy |
2619 | 1070 |
"!!Q. [| adm(Q); ? X.is_chain(X) & (!n.Q(X(n))) &\ |
1992 | 1071 |
\ lub(range(Y))=lub(range(X))|] ==> Q(lub(range(Y)))" |
2619 | 1072 |
(fn _ => [fast_tac (!claset addEs [adm_def2 RS iffD1 RS spec RS mp RS mp] |
1073 |
addss !simpset) 1]); |
|
1074 |
||
2640 | 1075 |
val adm_disj_lemma3 = prove_goalw thy [is_chain] |
2619 | 1076 |
"!!Q. is_chain(Y) ==> is_chain(%m. if m < Suc i then Y(Suc i) else Y m)" |
1077 |
(fn _ => |
|
1461 | 1078 |
[ |
2619 | 1079 |
asm_simp_tac (!simpset setloop (split_tac[expand_if])) 1, |
1080 |
safe_tac HOL_cs, |
|
1081 |
subgoal_tac "ia = i" 1, |
|
1082 |
Asm_simp_tac 1, |
|
1083 |
trans_tac 1 |
|
1461 | 1084 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1085 |
|
2619 | 1086 |
val adm_disj_lemma4 = prove_goal Nat.thy |
1087 |
"!!Q. !j. i < j --> Q(Y(j)) ==> !n. Q( if n < Suc i then Y(Suc i) else Y n)" |
|
1088 |
(fn _ => |
|
1461 | 1089 |
[ |
2619 | 1090 |
asm_simp_tac (!simpset setloop (split_tac[expand_if])) 1, |
1091 |
strip_tac 1, |
|
1092 |
etac allE 1, |
|
1093 |
etac mp 1, |
|
1094 |
trans_tac 1 |
|
1461 | 1095 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1096 |
|
2640 | 1097 |
val adm_disj_lemma5 = prove_goal thy |
2619 | 1098 |
"!!Y::nat=>'a. [| is_chain(Y); ! j. i < j --> Q(Y(j)) |] ==>\ |
1992 | 1099 |
\ 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
|
1100 |
(fn prems => |
1461 | 1101 |
[ |
2619 | 1102 |
safe_tac (HOL_cs addSIs [lub_equal2,adm_disj_lemma3]), |
1103 |
asm_simp_tac (!simpset setloop (split_tac[expand_if])) 1, |
|
1104 |
res_inst_tac [("x","i")] exI 1, |
|
1105 |
strip_tac 1, |
|
1106 |
trans_tac 1 |
|
1461 | 1107 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1108 |
|
2640 | 1109 |
val adm_disj_lemma6 = prove_goal thy |
1992 | 1110 |
"[| is_chain(Y::nat=>'a); ? i. ! j. i < j --> Q(Y(j)) |] ==>\ |
1111 |
\ ? X. is_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
|
1112 |
(fn prems => |
1461 | 1113 |
[ |
1114 |
(cut_facts_tac prems 1), |
|
1115 |
(etac exE 1), |
|
1116 |
(res_inst_tac [("x","%m.if m<Suc(i) then Y(Suc(i)) else Y m")] exI 1), |
|
1117 |
(rtac conjI 1), |
|
1118 |
(rtac adm_disj_lemma3 1), |
|
1119 |
(atac 1), |
|
1120 |
(rtac conjI 1), |
|
1121 |
(rtac adm_disj_lemma4 1), |
|
1122 |
(atac 1), |
|
1123 |
(rtac adm_disj_lemma5 1), |
|
1124 |
(atac 1), |
|
1125 |
(atac 1) |
|
1126 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1127 |
|
2640 | 1128 |
val adm_disj_lemma7 = prove_goal thy |
1992 | 1129 |
"[| is_chain(Y::nat=>'a); ! i. ? j. i < j & P(Y(j)) |] ==>\ |
1130 |
\ is_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
|
1131 |
(fn prems => |
1461 | 1132 |
[ |
1133 |
(cut_facts_tac prems 1), |
|
1134 |
(rtac is_chainI 1), |
|
1135 |
(rtac allI 1), |
|
1136 |
(rtac chain_mono3 1), |
|
1137 |
(atac 1), |
|
1675 | 1138 |
(rtac Least_le 1), |
1461 | 1139 |
(rtac conjI 1), |
1140 |
(rtac Suc_lessD 1), |
|
1141 |
(etac allE 1), |
|
1142 |
(etac exE 1), |
|
1675 | 1143 |
(rtac (LeastI RS conjunct1) 1), |
1461 | 1144 |
(atac 1), |
1145 |
(etac allE 1), |
|
1146 |
(etac exE 1), |
|
1675 | 1147 |
(rtac (LeastI RS conjunct2) 1), |
1461 | 1148 |
(atac 1) |
1149 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1150 |
|
2640 | 1151 |
val adm_disj_lemma8 = prove_goal thy |
2619 | 1152 |
"[| ! 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
|
1153 |
(fn prems => |
1461 | 1154 |
[ |
1155 |
(cut_facts_tac prems 1), |
|
1156 |
(strip_tac 1), |
|
1157 |
(etac allE 1), |
|
1158 |
(etac exE 1), |
|
1675 | 1159 |
(etac (LeastI RS conjunct2) 1) |
1461 | 1160 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1161 |
|
2640 | 1162 |
val adm_disj_lemma9 = prove_goal thy |
1992 | 1163 |
"[| is_chain(Y::nat=>'a); ! i. ? j. i < j & P(Y(j)) |] ==>\ |
1164 |
\ 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
|
1165 |
(fn prems => |
1461 | 1166 |
[ |
1167 |
(cut_facts_tac prems 1), |
|
1168 |
(rtac antisym_less 1), |
|
1169 |
(rtac lub_mono 1), |
|
1170 |
(atac 1), |
|
1171 |
(rtac adm_disj_lemma7 1), |
|
1172 |
(atac 1), |
|
1173 |
(atac 1), |
|
1174 |
(strip_tac 1), |
|
1175 |
(rtac (chain_mono RS mp) 1), |
|
1176 |
(atac 1), |
|
1177 |
(etac allE 1), |
|
1178 |
(etac exE 1), |
|
1675 | 1179 |
(rtac (LeastI RS conjunct1) 1), |
1461 | 1180 |
(atac 1), |
1181 |
(rtac lub_mono3 1), |
|
1182 |
(rtac adm_disj_lemma7 1), |
|
1183 |
(atac 1), |
|
1184 |
(atac 1), |
|
1185 |
(atac 1), |
|
1186 |
(strip_tac 1), |
|
1187 |
(rtac exI 1), |
|
1188 |
(rtac (chain_mono RS mp) 1), |
|
1189 |
(atac 1), |
|
1190 |
(rtac lessI 1) |
|
1191 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1192 |
|
2640 | 1193 |
val adm_disj_lemma10 = prove_goal thy |
1992 | 1194 |
"[| is_chain(Y::nat=>'a); ! i. ? j. i < j & P(Y(j)) |] ==>\ |
1195 |
\ ? X. is_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
|
1196 |
(fn prems => |
1461 | 1197 |
[ |
1198 |
(cut_facts_tac prems 1), |
|
1675 | 1199 |
(res_inst_tac [("x","%m. Y(Least(%j. m<j & P(Y(j))))")] exI 1), |
1461 | 1200 |
(rtac conjI 1), |
1201 |
(rtac adm_disj_lemma7 1), |
|
1202 |
(atac 1), |
|
1203 |
(atac 1), |
|
1204 |
(rtac conjI 1), |
|
1205 |
(rtac adm_disj_lemma8 1), |
|
1206 |
(atac 1), |
|
1207 |
(rtac adm_disj_lemma9 1), |
|
1208 |
(atac 1), |
|
1209 |
(atac 1) |
|
1210 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1211 |
|
2640 | 1212 |
val adm_disj_lemma12 = prove_goal thy |
1992 | 1213 |
"[| adm(P); is_chain(Y);? i. ! j. i < j --> P(Y(j))|]==>P(lub(range(Y)))" |
1214 |
(fn prems => |
|
1215 |
[ |
|
1216 |
(cut_facts_tac prems 1), |
|
1217 |
(etac adm_disj_lemma2 1), |
|
1218 |
(etac adm_disj_lemma6 1), |
|
1219 |
(atac 1) |
|
1220 |
]); |
|
430 | 1221 |
|
1992 | 1222 |
in |
1223 |
||
2640 | 1224 |
val adm_lemma11 = prove_goal thy |
430 | 1225 |
"[| adm(P); is_chain(Y); ! i. ? j. i < j & P(Y(j)) |]==>P(lub(range(Y)))" |
1226 |
(fn prems => |
|
1461 | 1227 |
[ |
1228 |
(cut_facts_tac prems 1), |
|
1229 |
(etac adm_disj_lemma2 1), |
|
1230 |
(etac adm_disj_lemma10 1), |
|
1231 |
(atac 1) |
|
1232 |
]); |
|
430 | 1233 |
|
2640 | 1234 |
val adm_disj = prove_goal thy |
1461 | 1235 |
"[| 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
|
1236 |
(fn prems => |
1461 | 1237 |
[ |
1238 |
(cut_facts_tac prems 1), |
|
1239 |
(rtac (adm_def2 RS iffD2) 1), |
|
1240 |
(strip_tac 1), |
|
1241 |
(rtac (adm_disj_lemma1 RS disjE) 1), |
|
1242 |
(atac 1), |
|
1243 |
(rtac disjI2 1), |
|
1244 |
(etac adm_disj_lemma12 1), |
|
1245 |
(atac 1), |
|
1246 |
(atac 1), |
|
1247 |
(rtac disjI1 1), |
|
1992 | 1248 |
(etac adm_lemma11 1), |
1461 | 1249 |
(atac 1), |
1250 |
(atac 1) |
|
1251 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1252 |
|
1992 | 1253 |
end; |
1254 |
||
1255 |
bind_thm("adm_lemma11",adm_lemma11); |
|
1256 |
bind_thm("adm_disj",adm_disj); |
|
430 | 1257 |
|
2640 | 1258 |
qed_goal "adm_imp" thy |
1461 | 1259 |
"[| adm(%x.~(P x)); 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
|
1260 |
(fn prems => |
1461 | 1261 |
[ |
1262 |
(cut_facts_tac prems 1), |
|
1263 |
(res_inst_tac [("P2","%x.~(P x)|Q x")] (adm_cong RS iffD1) 1), |
|
1264 |
(fast_tac HOL_cs 1), |
|
1265 |
(rtac adm_disj 1), |
|
1266 |
(atac 1), |
|
1267 |
(atac 1) |
|
1268 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1269 |
|
2640 | 1270 |
qed_goal "adm_not_conj" thy |
1681 | 1271 |
"[| adm (%x. ~ P x); adm (%x. ~ Q x) |] ==> adm (%x. ~ (P x & Q x))"(fn prems=>[ |
2033 | 1272 |
cut_facts_tac prems 1, |
1273 |
subgoal_tac |
|
1274 |
"(%x. ~ (P x & Q x)) = (%x. ~ P x | ~ Q x)" 1, |
|
1275 |
rtac ext 2, |
|
1276 |
fast_tac HOL_cs 2, |
|
1277 |
etac ssubst 1, |
|
1278 |
etac adm_disj 1, |
|
1279 |
atac 1]); |
|
1675 | 1280 |
|
2566 | 1281 |
val adm_lemmas = [adm_imp,adm_disj,adm_eq,adm_not_UU,adm_UU_not_less, |
1992 | 1282 |
adm_all2,adm_not_less,adm_not_free,adm_not_conj,adm_conj,adm_less]; |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1283 |
|
2566 | 1284 |
Addsimps adm_lemmas; |
1285 |