author | paulson |
Thu, 26 Sep 1996 15:14:23 +0200 | |
changeset 2033 | 639de962ded4 |
parent 1992 | 0256c8b71ff1 |
child 2275 | dbce3dce821a |
permissions | -rw-r--r-- |
1461 | 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 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
6 |
Lemmas for fix.thy |
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 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
15 |
qed_goal "iterate_0" Fix.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 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
21 |
qed_goal "iterate_Suc" Fix.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 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
29 |
qed_goal "iterate_Suc2" Fix.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 |
|
892 | 45 |
qed_goalw "is_chain_iterate2" Fix.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 |
|
892 | 59 |
qed_goal "is_chain_iterate" Fix.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 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
74 |
qed_goalw "Ifix_eq" Fix.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 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
98 |
qed_goalw "Ifix_least" Fix.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 |
|
892 | 119 |
qed_goalw "monofun_iterate" Fix.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 |
|
892 | 140 |
qed_goalw "contlub_iterate" Fix.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 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
171 |
qed_goal "cont_iterate" Fix.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 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
183 |
qed_goal "monofun_iterate2" Fix.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 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
194 |
qed_goal "contlub_iterate2" Fix.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 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
209 |
qed_goal "cont_iterate2" Fix.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 |
|
892 | 221 |
qed_goalw "monofun_Ifix" Fix.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 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
235 |
(* 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
|
236 |
(* be derived for lubs in this argument *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
237 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
238 |
|
892 | 239 |
qed_goal "is_chain_iterate_lub" Fix.thy |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
240 |
"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
|
241 |
(fn prems => |
1461 | 242 |
[ |
243 |
(cut_facts_tac prems 1), |
|
244 |
(rtac is_chainI 1), |
|
245 |
(strip_tac 1), |
|
246 |
(rtac lub_mono 1), |
|
247 |
(rtac is_chain_iterate 1), |
|
248 |
(rtac is_chain_iterate 1), |
|
249 |
(strip_tac 1), |
|
250 |
(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
|
251 |
RS spec) 1) |
1461 | 252 |
]); |
243
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 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
255 |
(* 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
|
256 |
(* 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
|
257 |
(* 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
|
258 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
259 |
|
892 | 260 |
qed_goal "contlub_Ifix_lemma1" Fix.thy |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
261 |
"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
|
262 |
(fn prems => |
1461 | 263 |
[ |
264 |
(cut_facts_tac prems 1), |
|
265 |
(rtac (thelub_fun RS subst) 1), |
|
266 |
(rtac (monofun_iterate RS ch2ch_monofun) 1), |
|
267 |
(atac 1), |
|
268 |
(rtac fun_cong 1), |
|
2033 | 269 |
(stac (contlub_iterate RS contlubE RS spec RS mp) 1), |
1461 | 270 |
(atac 1), |
271 |
(rtac refl 1) |
|
272 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
273 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
274 |
|
892 | 275 |
qed_goal "ex_lub_iterate" Fix.thy "is_chain(Y) ==>\ |
1168
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 i (Y ia) UU)))) =\ |
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
277 |
\ 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
|
278 |
(fn prems => |
1461 | 279 |
[ |
280 |
(cut_facts_tac prems 1), |
|
281 |
(rtac antisym_less 1), |
|
282 |
(rtac is_lub_thelub 1), |
|
283 |
(rtac (contlub_Ifix_lemma1 RS ext RS subst) 1), |
|
284 |
(atac 1), |
|
285 |
(rtac is_chain_iterate 1), |
|
286 |
(rtac ub_rangeI 1), |
|
287 |
(strip_tac 1), |
|
288 |
(rtac lub_mono 1), |
|
289 |
(etac (monofun_iterate RS ch2ch_monofun RS ch2ch_fun) 1), |
|
290 |
(etac is_chain_iterate_lub 1), |
|
291 |
(strip_tac 1), |
|
292 |
(rtac is_ub_thelub 1), |
|
293 |
(rtac is_chain_iterate 1), |
|
294 |
(rtac is_lub_thelub 1), |
|
295 |
(etac is_chain_iterate_lub 1), |
|
296 |
(rtac ub_rangeI 1), |
|
297 |
(strip_tac 1), |
|
298 |
(rtac lub_mono 1), |
|
299 |
(rtac is_chain_iterate 1), |
|
300 |
(rtac (contlub_Ifix_lemma1 RS ext RS subst) 1), |
|
301 |
(atac 1), |
|
302 |
(rtac is_chain_iterate 1), |
|
303 |
(strip_tac 1), |
|
304 |
(rtac is_ub_thelub 1), |
|
305 |
(etac (monofun_iterate RS ch2ch_monofun RS ch2ch_fun) 1) |
|
306 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
307 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
308 |
|
892 | 309 |
qed_goalw "contlub_Ifix" Fix.thy [contlub,Ifix_def] "contlub(Ifix)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
310 |
(fn prems => |
1461 | 311 |
[ |
312 |
(strip_tac 1), |
|
2033 | 313 |
(stac (contlub_Ifix_lemma1 RS ext) 1), |
1461 | 314 |
(atac 1), |
315 |
(etac ex_lub_iterate 1) |
|
316 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
317 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
318 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
319 |
qed_goal "cont_Ifix" Fix.thy "cont(Ifix)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
320 |
(fn prems => |
1461 | 321 |
[ |
322 |
(rtac monocontlub2cont 1), |
|
323 |
(rtac monofun_Ifix 1), |
|
324 |
(rtac contlub_Ifix 1) |
|
325 |
]); |
|
243
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 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
328 |
(* propagate properties of Ifix to its continuous counterpart *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
329 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
330 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
331 |
qed_goalw "fix_eq" Fix.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
|
332 |
(fn prems => |
1461 | 333 |
[ |
334 |
(asm_simp_tac (!simpset addsimps [cont_Ifix]) 1), |
|
335 |
(rtac Ifix_eq 1) |
|
336 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
337 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
338 |
qed_goalw "fix_least" Fix.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
|
339 |
(fn prems => |
1461 | 340 |
[ |
341 |
(cut_facts_tac prems 1), |
|
342 |
(asm_simp_tac (!simpset addsimps [cont_Ifix]) 1), |
|
343 |
(etac Ifix_least 1) |
|
344 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
345 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
346 |
|
1274 | 347 |
qed_goal "fix_eqI" Fix.thy |
348 |
"[| F`x = x; !z. F`z = z --> x << z |] ==> x = fix`F" |
|
349 |
(fn prems => |
|
1461 | 350 |
[ |
351 |
(cut_facts_tac prems 1), |
|
352 |
(rtac antisym_less 1), |
|
353 |
(etac allE 1), |
|
354 |
(etac mp 1), |
|
355 |
(rtac (fix_eq RS sym) 1), |
|
356 |
(etac fix_least 1) |
|
357 |
]); |
|
1274 | 358 |
|
359 |
||
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
360 |
qed_goal "fix_eq2" Fix.thy "f == fix`F ==> f = F`f" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
361 |
(fn prems => |
1461 | 362 |
[ |
363 |
(rewrite_goals_tac prems), |
|
364 |
(rtac fix_eq 1) |
|
365 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
366 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
367 |
qed_goal "fix_eq3" Fix.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
|
368 |
(fn prems => |
1461 | 369 |
[ |
370 |
(rtac trans 1), |
|
371 |
(rtac ((hd prems) RS fix_eq2 RS cfun_fun_cong) 1), |
|
372 |
(rtac refl 1) |
|
373 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
374 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
375 |
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
|
376 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
377 |
qed_goal "fix_eq4" Fix.thy "f = fix`F ==> f = F`f" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
378 |
(fn prems => |
1461 | 379 |
[ |
380 |
(cut_facts_tac prems 1), |
|
381 |
(hyp_subst_tac 1), |
|
382 |
(rtac fix_eq 1) |
|
383 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
384 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
385 |
qed_goal "fix_eq5" Fix.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
|
386 |
(fn prems => |
1461 | 387 |
[ |
388 |
(rtac trans 1), |
|
389 |
(rtac ((hd prems) RS fix_eq4 RS cfun_fun_cong) 1), |
|
390 |
(rtac refl 1) |
|
391 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
392 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
393 |
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
|
394 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
395 |
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
|
396 |
(fn prems => |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
397 |
[ |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
398 |
(rtac trans 1), |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
399 |
(rtac (fixdef RS fix_eq4) 1), |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
400 |
(rtac trans 1), |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
401 |
(rtac beta_cfun 1), |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
402 |
(cont_tacR 1), |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
403 |
(rtac refl 1) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
404 |
]); |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
405 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
406 |
(* use this one for definitions! *) |
297 | 407 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
408 |
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
|
409 |
(fn prems => |
1461 | 410 |
[ |
411 |
(rtac trans 1), |
|
412 |
(rtac (fix_eq2) 1), |
|
413 |
(rtac fixdef 1), |
|
414 |
(rtac beta_cfun 1), |
|
415 |
(cont_tacR 1) |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
416 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
417 |
|
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 |
(* better access to definitions *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
420 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
421 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
422 |
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
423 |
qed_goal "Ifix_def2" Fix.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
|
424 |
(fn prems => |
1461 | 425 |
[ |
426 |
(rtac ext 1), |
|
427 |
(rewtac Ifix_def), |
|
428 |
(rtac refl 1) |
|
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 |
(* direct connection between fix and iteration without Ifix *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
433 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
434 |
|
892 | 435 |
qed_goalw "fix_def2" Fix.thy [fix_def] |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
436 |
"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
|
437 |
(fn prems => |
1461 | 438 |
[ |
439 |
(fold_goals_tac [Ifix_def]), |
|
440 |
(asm_simp_tac (!simpset addsimps [cont_Ifix]) 1) |
|
441 |
]); |
|
243
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 |
|
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 |
(* Lemmas about admissibility and fixed point induction *) |
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 |
|
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 |
(* access to definitions *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
450 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
451 |
|
892 | 452 |
qed_goalw "adm_def2" Fix.thy [adm_def] |
1461 | 453 |
"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
|
454 |
(fn prems => |
1461 | 455 |
[ |
456 |
(rtac refl 1) |
|
457 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
458 |
|
892 | 459 |
qed_goalw "admw_def2" Fix.thy [admw_def] |
1461 | 460 |
"admw(P) = (!F.(!n.P(iterate n F UU)) -->\ |
461 |
\ 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
|
462 |
(fn prems => |
1461 | 463 |
[ |
464 |
(rtac refl 1) |
|
465 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
466 |
|
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 |
(* an admissible formula is also weak admissible *) |
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 |
|
892 | 471 |
qed_goalw "adm_impl_admw" Fix.thy [admw_def] "adm(P)==>admw(P)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
472 |
(fn prems => |
1461 | 473 |
[ |
474 |
(cut_facts_tac prems 1), |
|
475 |
(strip_tac 1), |
|
476 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
|
477 |
(atac 1), |
|
478 |
(rtac is_chain_iterate 1), |
|
479 |
(atac 1) |
|
480 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
481 |
|
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 |
(* fixed point induction *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
484 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
485 |
|
892 | 486 |
qed_goal "fix_ind" Fix.thy |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
487 |
"[| 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
|
488 |
(fn prems => |
1461 | 489 |
[ |
490 |
(cut_facts_tac prems 1), |
|
2033 | 491 |
(stac fix_def2 1), |
1461 | 492 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
493 |
(atac 1), |
|
494 |
(rtac is_chain_iterate 1), |
|
495 |
(rtac allI 1), |
|
496 |
(nat_ind_tac "i" 1), |
|
2033 | 497 |
(stac iterate_0 1), |
1461 | 498 |
(atac 1), |
2033 | 499 |
(stac iterate_Suc 1), |
1461 | 500 |
(resolve_tac prems 1), |
501 |
(atac 1) |
|
502 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
503 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
504 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
505 |
(* computational induction for weak admissible formulae *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
506 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
507 |
|
892 | 508 |
qed_goal "wfix_ind" Fix.thy |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
509 |
"[| 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
|
510 |
(fn prems => |
1461 | 511 |
[ |
512 |
(cut_facts_tac prems 1), |
|
2033 | 513 |
(stac fix_def2 1), |
1461 | 514 |
(rtac (admw_def2 RS iffD1 RS spec RS mp) 1), |
515 |
(atac 1), |
|
516 |
(rtac allI 1), |
|
517 |
(etac spec 1) |
|
518 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
519 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
520 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
521 |
(* 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
|
522 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
523 |
|
892 | 524 |
qed_goalw "adm_max_in_chain" Fix.thy [adm_def] |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
525 |
"!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
|
526 |
(fn prems => |
1461 | 527 |
[ |
528 |
(cut_facts_tac prems 1), |
|
529 |
(strip_tac 1), |
|
530 |
(rtac exE 1), |
|
531 |
(rtac mp 1), |
|
532 |
(etac spec 1), |
|
533 |
(atac 1), |
|
2033 | 534 |
(stac (lub_finch1 RS thelubI) 1), |
1461 | 535 |
(atac 1), |
536 |
(atac 1), |
|
537 |
(etac spec 1) |
|
538 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
539 |
|
892 | 540 |
qed_goalw "adm_chain_finite" Fix.thy [chain_finite_def] |
1461 | 541 |
"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
|
542 |
(fn prems => |
1461 | 543 |
[ |
544 |
(cut_facts_tac prems 1), |
|
545 |
(etac adm_max_in_chain 1) |
|
546 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
547 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
548 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
549 |
(* flat types are chain_finite *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
550 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
551 |
|
1410
324aa8134639
changed predicate flat to is_flat in theory Fix.thy
regensbu
parents:
1274
diff
changeset
|
552 |
qed_goalw "flat_imp_chain_finite" Fix.thy [is_flat_def,chain_finite_def] |
1461 | 553 |
"is_flat(x::'a)==>chain_finite(x::'a)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
554 |
(fn prems => |
1461 | 555 |
[ |
556 |
(rewtac max_in_chain_def), |
|
557 |
(cut_facts_tac prems 1), |
|
558 |
(strip_tac 1), |
|
1675 | 559 |
(case_tac "!i.Y(i)=UU" 1), |
1461 | 560 |
(res_inst_tac [("x","0")] exI 1), |
561 |
(strip_tac 1), |
|
562 |
(rtac trans 1), |
|
563 |
(etac spec 1), |
|
564 |
(rtac sym 1), |
|
565 |
(etac spec 1), |
|
566 |
(rtac (chain_mono2 RS exE) 1), |
|
567 |
(fast_tac HOL_cs 1), |
|
568 |
(atac 1), |
|
569 |
(res_inst_tac [("x","Suc(x)")] exI 1), |
|
570 |
(strip_tac 1), |
|
571 |
(rtac disjE 1), |
|
572 |
(atac 3), |
|
573 |
(rtac mp 1), |
|
574 |
(dtac spec 1), |
|
575 |
(etac spec 1), |
|
576 |
(etac (le_imp_less_or_eq RS disjE) 1), |
|
577 |
(etac (chain_mono RS mp) 1), |
|
578 |
(atac 1), |
|
579 |
(hyp_subst_tac 1), |
|
580 |
(rtac refl_less 1), |
|
581 |
(res_inst_tac [("P","Y(Suc(x)) = UU")] notE 1), |
|
582 |
(atac 2), |
|
583 |
(rtac mp 1), |
|
584 |
(etac spec 1), |
|
585 |
(Asm_simp_tac 1) |
|
586 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
587 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
588 |
|
1779 | 589 |
bind_thm ("adm_flat", flat_imp_chain_finite RS adm_chain_finite); |
1410
324aa8134639
changed predicate flat to is_flat in theory Fix.thy
regensbu
parents:
1274
diff
changeset
|
590 |
(* is_flat(?x::?'a) ==> adm(?P::?'a => bool) *) |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
591 |
|
1410
324aa8134639
changed predicate flat to is_flat in theory Fix.thy
regensbu
parents:
1274
diff
changeset
|
592 |
qed_goalw "flat_void" Fix.thy [is_flat_def] "is_flat(UU::void)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
593 |
(fn prems => |
1461 | 594 |
[ |
595 |
(strip_tac 1), |
|
596 |
(rtac disjI1 1), |
|
597 |
(rtac unique_void2 1) |
|
598 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
599 |
|
1992 | 600 |
qed_goalw "flat_eq" Fix.thy [is_flat_def] |
2033 | 601 |
"[| is_flat (x::'a); (a::'a) ~= UU |] ==> a << b = (a = b)" (fn prems=>[ |
602 |
(cut_facts_tac prems 1), |
|
603 |
(fast_tac (HOL_cs addIs [refl_less]) 1)]); |
|
1992 | 604 |
|
605 |
(* ------------------------------------------------------------------------ *) |
|
606 |
(* lemmata for improved admissibility introdution rule *) |
|
607 |
(* ------------------------------------------------------------------------ *) |
|
608 |
||
609 |
qed_goal "infinite_chain_adm_lemma" Porder.thy |
|
610 |
"[|is_chain Y; !i. P (Y i); \ |
|
611 |
\ (!!Y. [| is_chain Y; !i. P (Y i); ~ finite_chain Y |] ==> P (lub (range Y)))\ |
|
612 |
\ |] ==> P (lub (range Y))" |
|
613 |
(fn prems => [ |
|
2033 | 614 |
cut_facts_tac prems 1, |
615 |
case_tac "finite_chain Y" 1, |
|
616 |
eresolve_tac prems 2, atac 2, atac 2, |
|
617 |
rewtac finite_chain_def, |
|
618 |
safe_tac HOL_cs, |
|
619 |
etac (lub_finch1 RS thelubI RS ssubst) 1, atac 1, etac spec 1]); |
|
1992 | 620 |
|
621 |
qed_goal "increasing_chain_adm_lemma" Porder.thy |
|
622 |
"[|is_chain Y; !i. P (Y i); \ |
|
623 |
\ (!!Y. [| is_chain Y; !i. P (Y i); !i. ? j. i < j & Y i ~= Y j & Y i << Y j|]\ |
|
624 |
\ ==> P (lub (range Y))) |] ==> P (lub (range Y))" |
|
625 |
(fn prems => [ |
|
2033 | 626 |
cut_facts_tac prems 1, |
627 |
etac infinite_chain_adm_lemma 1, atac 1, etac thin_rl 1, |
|
628 |
rewtac finite_chain_def, |
|
629 |
safe_tac HOL_cs, |
|
630 |
etac swap 1, |
|
631 |
rewtac max_in_chain_def, |
|
632 |
resolve_tac prems 1, atac 1, atac 1, |
|
633 |
fast_tac (HOL_cs addDs [le_imp_less_or_eq] |
|
634 |
addEs [chain_mono RS mp]) 1]); |
|
1992 | 635 |
|
636 |
qed_goalw "admI" Fix.thy [adm_def] |
|
637 |
"(!!Y. [| is_chain Y; !i. P (Y i); !i. ? j. i < j & Y i ~= Y j & Y i << Y j |]\ |
|
638 |
\ ==> P(lub (range Y))) ==> adm P" |
|
639 |
(fn prems => [ |
|
2033 | 640 |
strip_tac 1, |
641 |
etac increasing_chain_adm_lemma 1, atac 1, |
|
642 |
eresolve_tac prems 1, atac 1, atac 1]); |
|
1992 | 643 |
|
644 |
||
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
645 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
646 |
(* continuous isomorphisms are strict *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
647 |
(* a prove for embedding projection pairs is similar *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
648 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
649 |
|
892 | 650 |
qed_goal "iso_strict" Fix.thy |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
651 |
"!!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
|
652 |
\ ==> f`UU=UU & g`UU=UU" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
653 |
(fn prems => |
1461 | 654 |
[ |
655 |
(rtac conjI 1), |
|
656 |
(rtac UU_I 1), |
|
657 |
(res_inst_tac [("s","f`(g`(UU::'b))"),("t","UU::'b")] subst 1), |
|
658 |
(etac spec 1), |
|
659 |
(rtac (minimal RS monofun_cfun_arg) 1), |
|
660 |
(rtac UU_I 1), |
|
661 |
(res_inst_tac [("s","g`(f`(UU::'a))"),("t","UU::'a")] subst 1), |
|
662 |
(etac spec 1), |
|
663 |
(rtac (minimal RS monofun_cfun_arg) 1) |
|
664 |
]); |
|
243
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 |
|
892 | 667 |
qed_goal "isorep_defined" Fix.thy |
1461 | 668 |
"[|!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
|
669 |
(fn prems => |
1461 | 670 |
[ |
671 |
(cut_facts_tac prems 1), |
|
672 |
(etac swap 1), |
|
673 |
(dtac notnotD 1), |
|
674 |
(dres_inst_tac [("f","abs")] cfun_arg_cong 1), |
|
675 |
(etac box_equals 1), |
|
676 |
(fast_tac HOL_cs 1), |
|
677 |
(etac (iso_strict RS conjunct1) 1), |
|
678 |
(atac 1) |
|
679 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
680 |
|
892 | 681 |
qed_goal "isoabs_defined" Fix.thy |
1461 | 682 |
"[|!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
|
683 |
(fn prems => |
1461 | 684 |
[ |
685 |
(cut_facts_tac prems 1), |
|
686 |
(etac swap 1), |
|
687 |
(dtac notnotD 1), |
|
688 |
(dres_inst_tac [("f","rep")] cfun_arg_cong 1), |
|
689 |
(etac box_equals 1), |
|
690 |
(fast_tac HOL_cs 1), |
|
691 |
(etac (iso_strict RS conjunct2) 1), |
|
692 |
(atac 1) |
|
693 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
694 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
695 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
696 |
(* propagation of flatness and chainfiniteness by continuous isomorphisms *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
697 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
698 |
|
892 | 699 |
qed_goalw "chfin2chfin" Fix.thy [chain_finite_def] |
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
892
diff
changeset
|
700 |
"!!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
|
701 |
\ ==> chain_finite(y::'b)" |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
702 |
(fn prems => |
1461 | 703 |
[ |
704 |
(rewtac max_in_chain_def), |
|
705 |
(strip_tac 1), |
|
706 |
(rtac exE 1), |
|
707 |
(res_inst_tac [("P","is_chain(%i.g`(Y i))")] mp 1), |
|
708 |
(etac spec 1), |
|
709 |
(etac ch2ch_fappR 1), |
|
710 |
(rtac exI 1), |
|
711 |
(strip_tac 1), |
|
712 |
(res_inst_tac [("s","f`(g`(Y x))"),("t","Y(x)")] subst 1), |
|
713 |
(etac spec 1), |
|
714 |
(res_inst_tac [("s","f`(g`(Y j))"),("t","Y(j)")] subst 1), |
|
715 |
(etac spec 1), |
|
716 |
(rtac cfun_arg_cong 1), |
|
717 |
(rtac mp 1), |
|
718 |
(etac spec 1), |
|
719 |
(atac 1) |
|
720 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
721 |
|
1410
324aa8134639
changed predicate flat to is_flat in theory Fix.thy
regensbu
parents:
1274
diff
changeset
|
722 |
qed_goalw "flat2flat" Fix.thy [is_flat_def] |
324aa8134639
changed predicate flat to is_flat in theory Fix.thy
regensbu
parents:
1274
diff
changeset
|
723 |
"!!f g.[|is_flat(x::'a); !y.f`(g`y)=(y::'b) ; !x.g`(f`x)=(x::'a) |] \ |
324aa8134639
changed predicate flat to is_flat in theory Fix.thy
regensbu
parents:
1274
diff
changeset
|
724 |
\ ==> is_flat(y::'b)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
725 |
(fn prems => |
1461 | 726 |
[ |
727 |
(strip_tac 1), |
|
728 |
(rtac disjE 1), |
|
729 |
(res_inst_tac [("P","g`x<<g`y")] mp 1), |
|
730 |
(etac monofun_cfun_arg 2), |
|
731 |
(dtac spec 1), |
|
732 |
(etac spec 1), |
|
733 |
(rtac disjI1 1), |
|
734 |
(rtac trans 1), |
|
735 |
(res_inst_tac [("s","f`(g`x)"),("t","x")] subst 1), |
|
736 |
(etac spec 1), |
|
737 |
(etac cfun_arg_cong 1), |
|
738 |
(rtac (iso_strict RS conjunct1) 1), |
|
739 |
(atac 1), |
|
740 |
(atac 1), |
|
741 |
(rtac disjI2 1), |
|
742 |
(res_inst_tac [("s","f`(g`x)"),("t","x")] subst 1), |
|
743 |
(etac spec 1), |
|
744 |
(res_inst_tac [("s","f`(g`y)"),("t","y")] subst 1), |
|
745 |
(etac spec 1), |
|
746 |
(etac cfun_arg_cong 1) |
|
747 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
748 |
|
625 | 749 |
(* ------------------------------------------------------------------------- *) |
750 |
(* a result about functions with flat codomain *) |
|
751 |
(* ------------------------------------------------------------------------- *) |
|
752 |
||
1410
324aa8134639
changed predicate flat to is_flat in theory Fix.thy
regensbu
parents:
1274
diff
changeset
|
753 |
qed_goalw "flat_codom" Fix.thy [is_flat_def] |
324aa8134639
changed predicate flat to is_flat in theory Fix.thy
regensbu
parents:
1274
diff
changeset
|
754 |
"[|is_flat(y::'b);f`(x::'a)=(c::'b)|] ==> f`(UU::'a)=(UU::'b) | (!z.f`(z::'a)=c)" |
625 | 755 |
(fn prems => |
1461 | 756 |
[ |
757 |
(cut_facts_tac prems 1), |
|
1675 | 758 |
(case_tac "f`(x::'a)=(UU::'b)" 1), |
1461 | 759 |
(rtac disjI1 1), |
760 |
(rtac UU_I 1), |
|
761 |
(res_inst_tac [("s","f`(x)"),("t","UU::'b")] subst 1), |
|
762 |
(atac 1), |
|
763 |
(rtac (minimal RS monofun_cfun_arg) 1), |
|
1675 | 764 |
(case_tac "f`(UU::'a)=(UU::'b)" 1), |
1461 | 765 |
(etac disjI1 1), |
766 |
(rtac disjI2 1), |
|
767 |
(rtac allI 1), |
|
768 |
(res_inst_tac [("s","f`x"),("t","c")] subst 1), |
|
769 |
(atac 1), |
|
770 |
(res_inst_tac [("a","f`(UU::'a)")] (refl RS box_equals) 1), |
|
771 |
(etac allE 1),(etac allE 1), |
|
772 |
(dtac mp 1), |
|
1780 | 773 |
(res_inst_tac [("fo","f")] (minimal RS monofun_cfun_arg) 1), |
1461 | 774 |
(etac disjE 1), |
775 |
(contr_tac 1), |
|
776 |
(atac 1), |
|
777 |
(etac allE 1), |
|
778 |
(etac allE 1), |
|
779 |
(dtac mp 1), |
|
1780 | 780 |
(res_inst_tac [("fo","f")] (minimal RS monofun_cfun_arg) 1), |
1461 | 781 |
(etac disjE 1), |
782 |
(contr_tac 1), |
|
783 |
(atac 1) |
|
784 |
]); |
|
625 | 785 |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
786 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
787 |
(* admissibility of special formulae and propagation *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
788 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
789 |
|
892 | 790 |
qed_goalw "adm_less" Fix.thy [adm_def] |
1461 | 791 |
"[|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
|
792 |
(fn prems => |
1461 | 793 |
[ |
794 |
(cut_facts_tac prems 1), |
|
795 |
(strip_tac 1), |
|
796 |
(etac (cont2contlub RS contlubE RS spec RS mp RS ssubst) 1), |
|
797 |
(atac 1), |
|
798 |
(etac (cont2contlub RS contlubE RS spec RS mp RS ssubst) 1), |
|
799 |
(atac 1), |
|
800 |
(rtac lub_mono 1), |
|
801 |
(cut_facts_tac prems 1), |
|
802 |
(etac (cont2mono RS ch2ch_monofun) 1), |
|
803 |
(atac 1), |
|
804 |
(cut_facts_tac prems 1), |
|
805 |
(etac (cont2mono RS ch2ch_monofun) 1), |
|
806 |
(atac 1), |
|
807 |
(atac 1) |
|
808 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
809 |
|
892 | 810 |
qed_goal "adm_conj" Fix.thy |
1461 | 811 |
"[| 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
|
812 |
(fn prems => |
1461 | 813 |
[ |
814 |
(cut_facts_tac prems 1), |
|
815 |
(rtac (adm_def2 RS iffD2) 1), |
|
816 |
(strip_tac 1), |
|
817 |
(rtac conjI 1), |
|
818 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
|
819 |
(atac 1), |
|
820 |
(atac 1), |
|
821 |
(fast_tac HOL_cs 1), |
|
822 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
|
823 |
(atac 1), |
|
824 |
(atac 1), |
|
825 |
(fast_tac HOL_cs 1) |
|
826 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
827 |
|
892 | 828 |
qed_goal "adm_cong" Fix.thy |
1461 | 829 |
"(!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
|
830 |
(fn prems => |
1461 | 831 |
[ |
832 |
(cut_facts_tac prems 1), |
|
833 |
(res_inst_tac [("s","P"),("t","Q")] subst 1), |
|
834 |
(rtac refl 2), |
|
835 |
(rtac ext 1), |
|
836 |
(etac spec 1) |
|
837 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
838 |
|
892 | 839 |
qed_goalw "adm_not_free" Fix.thy [adm_def] "adm(%x.t)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
840 |
(fn prems => |
1461 | 841 |
[ |
842 |
(fast_tac HOL_cs 1) |
|
843 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
844 |
|
892 | 845 |
qed_goalw "adm_not_less" Fix.thy [adm_def] |
1461 | 846 |
"cont t ==> adm(%x.~ (t x) << u)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
847 |
(fn prems => |
1461 | 848 |
[ |
849 |
(cut_facts_tac prems 1), |
|
850 |
(strip_tac 1), |
|
851 |
(rtac contrapos 1), |
|
852 |
(etac spec 1), |
|
853 |
(rtac trans_less 1), |
|
854 |
(atac 2), |
|
855 |
(etac (cont2mono RS monofun_fun_arg) 1), |
|
856 |
(rtac is_ub_thelub 1), |
|
857 |
(atac 1) |
|
858 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
859 |
|
892 | 860 |
qed_goal "adm_all" Fix.thy |
1461 | 861 |
" !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
|
862 |
(fn prems => |
1461 | 863 |
[ |
864 |
(cut_facts_tac prems 1), |
|
865 |
(rtac (adm_def2 RS iffD2) 1), |
|
866 |
(strip_tac 1), |
|
867 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
|
868 |
(etac spec 1), |
|
869 |
(atac 1), |
|
870 |
(rtac allI 1), |
|
871 |
(dtac spec 1), |
|
872 |
(etac spec 1) |
|
873 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
874 |
|
1779 | 875 |
bind_thm ("adm_all2", allI RS adm_all); |
625 | 876 |
|
892 | 877 |
qed_goal "adm_subst" Fix.thy |
1461 | 878 |
"[|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
|
879 |
(fn prems => |
1461 | 880 |
[ |
881 |
(cut_facts_tac prems 1), |
|
882 |
(rtac (adm_def2 RS iffD2) 1), |
|
883 |
(strip_tac 1), |
|
2033 | 884 |
(stac (cont2contlub RS contlubE RS spec RS mp) 1), |
1461 | 885 |
(atac 1), |
886 |
(atac 1), |
|
887 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
|
888 |
(atac 1), |
|
889 |
(rtac (cont2mono RS ch2ch_monofun) 1), |
|
890 |
(atac 1), |
|
891 |
(atac 1), |
|
892 |
(atac 1) |
|
893 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
894 |
|
892 | 895 |
qed_goal "adm_UU_not_less" Fix.thy "adm(%x.~ UU << t(x))" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
896 |
(fn prems => |
1461 | 897 |
[ |
898 |
(res_inst_tac [("P2","%x.False")] (adm_cong RS iffD1) 1), |
|
899 |
(Asm_simp_tac 1), |
|
900 |
(rtac adm_not_free 1) |
|
901 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
902 |
|
892 | 903 |
qed_goalw "adm_not_UU" Fix.thy [adm_def] |
1461 | 904 |
"cont(t)==> adm(%x.~ (t x) = UU)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
905 |
(fn prems => |
1461 | 906 |
[ |
907 |
(cut_facts_tac prems 1), |
|
908 |
(strip_tac 1), |
|
909 |
(rtac contrapos 1), |
|
910 |
(etac spec 1), |
|
911 |
(rtac (chain_UU_I RS spec) 1), |
|
912 |
(rtac (cont2mono RS ch2ch_monofun) 1), |
|
913 |
(atac 1), |
|
914 |
(atac 1), |
|
915 |
(rtac (cont2contlub RS contlubE RS spec RS mp RS subst) 1), |
|
916 |
(atac 1), |
|
917 |
(atac 1), |
|
918 |
(atac 1) |
|
919 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
920 |
|
892 | 921 |
qed_goal "adm_eq" Fix.thy |
1461 | 922 |
"[|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
|
923 |
(fn prems => |
1461 | 924 |
[ |
925 |
(rtac (adm_cong RS iffD1) 1), |
|
926 |
(rtac allI 1), |
|
927 |
(rtac iffI 1), |
|
928 |
(rtac antisym_less 1), |
|
929 |
(rtac antisym_less_inverse 3), |
|
930 |
(atac 3), |
|
931 |
(etac conjunct1 1), |
|
932 |
(etac conjunct2 1), |
|
933 |
(rtac adm_conj 1), |
|
934 |
(rtac adm_less 1), |
|
935 |
(resolve_tac prems 1), |
|
936 |
(resolve_tac prems 1), |
|
937 |
(rtac adm_less 1), |
|
938 |
(resolve_tac prems 1), |
|
939 |
(resolve_tac prems 1) |
|
940 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
941 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
942 |
|
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
943 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
944 |
(* 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
|
945 |
(* ------------------------------------------------------------------------ *) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
946 |
|
1992 | 947 |
local |
948 |
||
949 |
val adm_disj_lemma1 = prove_goal Pcpo.thy |
|
950 |
"[| is_chain Y; !n.P (Y n) | Q(Y n)|]\ |
|
951 |
\ ==> (? i.!j. i<j --> Q(Y(j))) | (!i.? j.i<j & P(Y(j)))" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
952 |
(fn prems => |
1461 | 953 |
[ |
954 |
(cut_facts_tac prems 1), |
|
955 |
(fast_tac HOL_cs 1) |
|
956 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
957 |
|
1992 | 958 |
val adm_disj_lemma2 = prove_goal Fix.thy |
959 |
"[| adm(Q); ? X.is_chain(X) & (!n.Q(X(n))) &\ |
|
960 |
\ lub(range(Y))=lub(range(X))|] ==> Q(lub(range(Y)))" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
961 |
(fn prems => |
1461 | 962 |
[ |
963 |
(cut_facts_tac prems 1), |
|
964 |
(etac exE 1), |
|
965 |
(etac conjE 1), |
|
966 |
(etac conjE 1), |
|
967 |
(res_inst_tac [("s","lub(range(X))"),("t","lub(range(Y))")] ssubst 1), |
|
968 |
(atac 1), |
|
969 |
(rtac (adm_def2 RS iffD1 RS spec RS mp RS mp) 1), |
|
970 |
(atac 1), |
|
971 |
(atac 1), |
|
972 |
(atac 1) |
|
973 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
974 |
|
1992 | 975 |
val adm_disj_lemma3 = prove_goal Fix.thy |
976 |
"[| is_chain(Y); ! j. i < j --> Q(Y(j)) |] ==>\ |
|
977 |
\ is_chain(%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
|
978 |
(fn prems => |
1461 | 979 |
[ |
980 |
(cut_facts_tac prems 1), |
|
981 |
(rtac is_chainI 1), |
|
982 |
(rtac allI 1), |
|
983 |
(res_inst_tac [("m","i"),("n","ia")] nat_less_cases 1), |
|
984 |
(res_inst_tac [("s","False"),("t","ia < Suc(i)")] ssubst 1), |
|
985 |
(rtac iffI 1), |
|
986 |
(etac FalseE 2), |
|
987 |
(rtac notE 1), |
|
988 |
(rtac (not_less_eq RS iffD2) 1), |
|
989 |
(atac 1), |
|
990 |
(atac 1), |
|
991 |
(res_inst_tac [("s","False"),("t","Suc(ia) < Suc(i)")] ssubst 1), |
|
992 |
(Asm_simp_tac 1), |
|
993 |
(rtac iffI 1), |
|
994 |
(etac FalseE 2), |
|
995 |
(rtac notE 1), |
|
996 |
(etac less_not_sym 1), |
|
997 |
(atac 1), |
|
998 |
(Asm_simp_tac 1), |
|
999 |
(etac (is_chainE RS spec) 1), |
|
1000 |
(hyp_subst_tac 1), |
|
1001 |
(Asm_simp_tac 1), |
|
1675 | 1002 |
(Asm_simp_tac 1), |
2033 | 1003 |
(asm_simp_tac (!simpset addsimps [less_Suc_eq]) 1) |
1461 | 1004 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1005 |
|
1992 | 1006 |
val adm_disj_lemma4 = prove_goal Fix.thy |
1007 |
"[| ! j. i < j --> Q(Y(j)) |] ==>\ |
|
1008 |
\ ! n. Q( if n < Suc i then Y(Suc i) else Y n)" |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1009 |
(fn prems => |
1461 | 1010 |
[ |
1011 |
(cut_facts_tac prems 1), |
|
1012 |
(rtac allI 1), |
|
1013 |
(res_inst_tac [("m","n"),("n","Suc(i)")] nat_less_cases 1), |
|
1992 | 1014 |
(res_inst_tac[("s","Y(Suc(i))"), |
2033 | 1015 |
("t","if n<Suc(i) then Y(Suc(i)) else Y n")] ssubst 1), |
1461 | 1016 |
(Asm_simp_tac 1), |
1017 |
(etac allE 1), |
|
1018 |
(rtac mp 1), |
|
1019 |
(atac 1), |
|
1020 |
(Asm_simp_tac 1), |
|
1992 | 1021 |
(res_inst_tac[("s","Y(n)"), |
2033 | 1022 |
("t","if n<Suc(i) then Y(Suc(i)) else Y(n)")] ssubst 1), |
1461 | 1023 |
(Asm_simp_tac 1), |
1024 |
(hyp_subst_tac 1), |
|
1025 |
(dtac spec 1), |
|
1026 |
(rtac mp 1), |
|
1027 |
(atac 1), |
|
1028 |
(Asm_simp_tac 1), |
|
1992 | 1029 |
(res_inst_tac [("s","Y(n)"), |
2033 | 1030 |
("t","if n < Suc(i) then Y(Suc(i)) else Y(n)")]ssubst 1), |
1461 | 1031 |
(res_inst_tac [("s","False"),("t","n < Suc(i)")] ssubst 1), |
1032 |
(rtac iffI 1), |
|
1033 |
(etac FalseE 2), |
|
1034 |
(rtac notE 1), |
|
1035 |
(etac less_not_sym 1), |
|
1036 |
(atac 1), |
|
1037 |
(Asm_simp_tac 1), |
|
1038 |
(dtac spec 1), |
|
1039 |
(rtac mp 1), |
|
1040 |
(atac 1), |
|
1041 |
(etac Suc_lessD 1) |
|
1042 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1043 |
|
1992 | 1044 |
val adm_disj_lemma5 = prove_goal Fix.thy |
1045 |
"[| is_chain(Y::nat=>'a); ! j. i < j --> Q(Y(j)) |] ==>\ |
|
1046 |
\ 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
|
1047 |
(fn prems => |
1461 | 1048 |
[ |
1049 |
(cut_facts_tac prems 1), |
|
1050 |
(rtac lub_equal2 1), |
|
1051 |
(atac 2), |
|
1052 |
(rtac adm_disj_lemma3 2), |
|
1053 |
(atac 2), |
|
1054 |
(atac 2), |
|
1055 |
(res_inst_tac [("x","i")] exI 1), |
|
1056 |
(strip_tac 1), |
|
1057 |
(res_inst_tac [("s","False"),("t","ia < Suc(i)")] ssubst 1), |
|
1058 |
(rtac iffI 1), |
|
1059 |
(etac FalseE 2), |
|
1060 |
(rtac notE 1), |
|
1061 |
(rtac (not_less_eq RS iffD2) 1), |
|
1062 |
(atac 1), |
|
1063 |
(atac 1), |
|
2033 | 1064 |
(stac if_False 1), |
1461 | 1065 |
(rtac refl 1) |
1066 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1067 |
|
1992 | 1068 |
val adm_disj_lemma6 = prove_goal Fix.thy |
1069 |
"[| is_chain(Y::nat=>'a); ? i. ! j. i < j --> Q(Y(j)) |] ==>\ |
|
1070 |
\ ? 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
|
1071 |
(fn prems => |
1461 | 1072 |
[ |
1073 |
(cut_facts_tac prems 1), |
|
1074 |
(etac exE 1), |
|
1075 |
(res_inst_tac [("x","%m.if m<Suc(i) then Y(Suc(i)) else Y m")] exI 1), |
|
1076 |
(rtac conjI 1), |
|
1077 |
(rtac adm_disj_lemma3 1), |
|
1078 |
(atac 1), |
|
1079 |
(atac 1), |
|
1080 |
(rtac conjI 1), |
|
1081 |
(rtac adm_disj_lemma4 1), |
|
1082 |
(atac 1), |
|
1083 |
(rtac adm_disj_lemma5 1), |
|
1084 |
(atac 1), |
|
1085 |
(atac 1) |
|
1086 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1087 |
|
1992 | 1088 |
val adm_disj_lemma7 = prove_goal Fix.thy |
1089 |
"[| is_chain(Y::nat=>'a); ! i. ? j. i < j & P(Y(j)) |] ==>\ |
|
1090 |
\ 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
|
1091 |
(fn prems => |
1461 | 1092 |
[ |
1093 |
(cut_facts_tac prems 1), |
|
1094 |
(rtac is_chainI 1), |
|
1095 |
(rtac allI 1), |
|
1096 |
(rtac chain_mono3 1), |
|
1097 |
(atac 1), |
|
1675 | 1098 |
(rtac Least_le 1), |
1461 | 1099 |
(rtac conjI 1), |
1100 |
(rtac Suc_lessD 1), |
|
1101 |
(etac allE 1), |
|
1102 |
(etac exE 1), |
|
1675 | 1103 |
(rtac (LeastI RS conjunct1) 1), |
1461 | 1104 |
(atac 1), |
1105 |
(etac allE 1), |
|
1106 |
(etac exE 1), |
|
1675 | 1107 |
(rtac (LeastI RS conjunct2) 1), |
1461 | 1108 |
(atac 1) |
1109 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1110 |
|
1992 | 1111 |
val adm_disj_lemma8 = prove_goal Fix.thy |
1112 |
"[| ! i. ? j. i < j & P(Y(j)) |] ==> ! m. P(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
|
1113 |
(fn prems => |
1461 | 1114 |
[ |
1115 |
(cut_facts_tac prems 1), |
|
1116 |
(strip_tac 1), |
|
1117 |
(etac allE 1), |
|
1118 |
(etac exE 1), |
|
1675 | 1119 |
(etac (LeastI RS conjunct2) 1) |
1461 | 1120 |
]); |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1121 |
|
1992 | 1122 |
val adm_disj_lemma9 = prove_goal Fix.thy |
1123 |
"[| is_chain(Y::nat=>'a); ! i. ? j. i < j & P(Y(j)) |] ==>\ |
|
1124 |
\ 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
|
1125 |
(fn prems => |
1461 | 1126 |
[ |
1127 |
(cut_facts_tac prems 1), |
|
1128 |
(rtac antisym_less 1), |
|
1129 |
(rtac lub_mono 1), |
|
1130 |
(atac 1), |
|
1131 |
(rtac adm_disj_lemma7 1), |
|
1132 |
(atac 1), |
|
1133 |
(atac 1), |
|
1134 |
(strip_tac 1), |
|
1135 |
(rtac (chain_mono RS mp) 1), |
|
1136 |
(atac 1), |
|
1137 |
(etac allE 1), |
|
1138 |
(etac exE 1), |
|
1675 | 1139 |
(rtac (LeastI RS conjunct1) 1), |
1461 | 1140 |
(atac 1), |
1141 |
(rtac lub_mono3 1), |
|
1142 |
(rtac adm_disj_lemma7 1), |
|
1143 |
(atac 1), |
|
1144 |
(atac 1), |
|
1145 |
(atac 1), |
|
1146 |
(strip_tac 1), |
|
1147 |
(rtac exI 1), |
|
1148 |
(rtac (chain_mono RS mp) 1), |
|
1149 |
(atac 1), |
|
1150 |
(rtac lessI 1) |
|
1151 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1152 |
|
1992 | 1153 |
val adm_disj_lemma10 = prove_goal Fix.thy |
1154 |
"[| is_chain(Y::nat=>'a); ! i. ? j. i < j & P(Y(j)) |] ==>\ |
|
1155 |
\ ? 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
|
1156 |
(fn prems => |
1461 | 1157 |
[ |
1158 |
(cut_facts_tac prems 1), |
|
1675 | 1159 |
(res_inst_tac [("x","%m. Y(Least(%j. m<j & P(Y(j))))")] exI 1), |
1461 | 1160 |
(rtac conjI 1), |
1161 |
(rtac adm_disj_lemma7 1), |
|
1162 |
(atac 1), |
|
1163 |
(atac 1), |
|
1164 |
(rtac conjI 1), |
|
1165 |
(rtac adm_disj_lemma8 1), |
|
1166 |
(atac 1), |
|
1167 |
(rtac adm_disj_lemma9 1), |
|
1168 |
(atac 1), |
|
1169 |
(atac 1) |
|
1170 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1171 |
|
1992 | 1172 |
val adm_disj_lemma12 = prove_goal Fix.thy |
1173 |
"[| adm(P); is_chain(Y);? i. ! j. i < j --> P(Y(j))|]==>P(lub(range(Y)))" |
|
1174 |
(fn prems => |
|
1175 |
[ |
|
1176 |
(cut_facts_tac prems 1), |
|
1177 |
(etac adm_disj_lemma2 1), |
|
1178 |
(etac adm_disj_lemma6 1), |
|
1179 |
(atac 1) |
|
1180 |
]); |
|
430 | 1181 |
|
1992 | 1182 |
in |
1183 |
||
1184 |
val adm_lemma11 = prove_goal Fix.thy |
|
430 | 1185 |
"[| adm(P); is_chain(Y); ! i. ? j. i < j & P(Y(j)) |]==>P(lub(range(Y)))" |
1186 |
(fn prems => |
|
1461 | 1187 |
[ |
1188 |
(cut_facts_tac prems 1), |
|
1189 |
(etac adm_disj_lemma2 1), |
|
1190 |
(etac adm_disj_lemma10 1), |
|
1191 |
(atac 1) |
|
1192 |
]); |
|
430 | 1193 |
|
1992 | 1194 |
val adm_disj = prove_goal Fix.thy |
1461 | 1195 |
"[| 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
|
1196 |
(fn prems => |
1461 | 1197 |
[ |
1198 |
(cut_facts_tac prems 1), |
|
1199 |
(rtac (adm_def2 RS iffD2) 1), |
|
1200 |
(strip_tac 1), |
|
1201 |
(rtac (adm_disj_lemma1 RS disjE) 1), |
|
1202 |
(atac 1), |
|
1203 |
(atac 1), |
|
1204 |
(rtac disjI2 1), |
|
1205 |
(etac adm_disj_lemma12 1), |
|
1206 |
(atac 1), |
|
1207 |
(atac 1), |
|
1208 |
(rtac disjI1 1), |
|
1992 | 1209 |
(etac adm_lemma11 1), |
1461 | 1210 |
(atac 1), |
1211 |
(atac 1) |
|
1212 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1213 |
|
1992 | 1214 |
end; |
1215 |
||
1216 |
bind_thm("adm_lemma11",adm_lemma11); |
|
1217 |
bind_thm("adm_disj",adm_disj); |
|
430 | 1218 |
|
1872 | 1219 |
qed_goal "adm_imp" Fix.thy |
1461 | 1220 |
"[| 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
|
1221 |
(fn prems => |
1461 | 1222 |
[ |
1223 |
(cut_facts_tac prems 1), |
|
1224 |
(res_inst_tac [("P2","%x.~(P x)|Q x")] (adm_cong RS iffD1) 1), |
|
1225 |
(fast_tac HOL_cs 1), |
|
1226 |
(rtac adm_disj 1), |
|
1227 |
(atac 1), |
|
1228 |
(atac 1) |
|
1229 |
]); |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
1230 |
|
1675 | 1231 |
qed_goal "adm_not_conj" Fix.thy |
1681 | 1232 |
"[| adm (%x. ~ P x); adm (%x. ~ Q x) |] ==> adm (%x. ~ (P x & Q x))"(fn prems=>[ |
2033 | 1233 |
cut_facts_tac prems 1, |
1234 |
subgoal_tac |
|
1235 |
"(%x. ~ (P x & Q x)) = (%x. ~ P x | ~ Q x)" 1, |
|
1236 |
rtac ext 2, |
|
1237 |
fast_tac HOL_cs 2, |
|
1238 |
etac ssubst 1, |
|
1239 |
etac adm_disj 1, |
|
1240 |
atac 1]); |
|
1675 | 1241 |
|
1992 | 1242 |
val adm_thms = [adm_imp,adm_disj,adm_eq,adm_not_UU,adm_UU_not_less, |
1243 |
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
|
1244 |