author | oheimb |
Sat, 15 Feb 1997 17:52:31 +0100 | |
changeset 2637 | e9b203f854ae |
parent 2482 | 87383dd9f4b5 |
child 3016 | 15763781afb0 |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: ZF/wf.ML |
0 | 2 |
ID: $Id$ |
1461 | 3 |
Author: Tobias Nipkow and Lawrence C Paulson |
0 | 4 |
Copyright 1992 University of Cambridge |
5 |
||
6 |
For wf.thy. Well-founded Recursion |
|
7 |
||
8 |
Derived first for transitive relations, and finally for arbitrary WF relations |
|
9 |
via wf_trancl and trans_trancl. |
|
10 |
||
11 |
It is difficult to derive this general case directly, using r^+ instead of |
|
12 |
r. In is_recfun, the two occurrences of the relation must have the same |
|
13 |
form. Inserting r^+ in the_recfun or wftrec yields a recursion rule with |
|
14 |
r^+ -`` {a} instead of r-``{a}. This recursion rule is stronger in |
|
15 |
principle, but harder to use, especially to prove wfrec_eclose_eq in |
|
16 |
epsilon.ML. Expanding out the definition of wftrec in wfrec would yield |
|
17 |
a mess. |
|
18 |
*) |
|
19 |
||
20 |
open WF; |
|
21 |
||
22 |
||
23 |
(*** Well-founded relations ***) |
|
24 |
||
435 | 25 |
(** Equivalences between wf and wf_on **) |
26 |
||
27 |
goalw WF.thy [wf_def, wf_on_def] "!!A r. wf(r) ==> wf[A](r)"; |
|
2469 | 28 |
by (Fast_tac 1); |
760 | 29 |
qed "wf_imp_wf_on"; |
435 | 30 |
|
31 |
goalw WF.thy [wf_def, wf_on_def] "!!r. wf[field(r)](r) ==> wf(r)"; |
|
2469 | 32 |
by (Fast_tac 1); |
760 | 33 |
qed "wf_on_field_imp_wf"; |
435 | 34 |
|
35 |
goal WF.thy "wf(r) <-> wf[field(r)](r)"; |
|
2469 | 36 |
by (fast_tac (!claset addSEs [wf_imp_wf_on, wf_on_field_imp_wf]) 1); |
760 | 37 |
qed "wf_iff_wf_on_field"; |
0 | 38 |
|
435 | 39 |
goalw WF.thy [wf_on_def, wf_def] "!!A B r. [| wf[A](r); B<=A |] ==> wf[B](r)"; |
2469 | 40 |
by (Fast_tac 1); |
760 | 41 |
qed "wf_on_subset_A"; |
435 | 42 |
|
43 |
goalw WF.thy [wf_on_def, wf_def] "!!A r s. [| wf[A](r); s<=r |] ==> wf[A](s)"; |
|
2469 | 44 |
by (Fast_tac 1); |
760 | 45 |
qed "wf_on_subset_r"; |
435 | 46 |
|
47 |
(** Introduction rules for wf_on **) |
|
48 |
||
49 |
(*If every non-empty subset of A has an r-minimal element then wf[A](r).*) |
|
50 |
val [prem] = goalw WF.thy [wf_on_def, wf_def] |
|
51 |
"[| !!Z u. [| Z<=A; u:Z; ALL x:Z. EX y:Z. <y,x>:r |] ==> False |] \ |
|
52 |
\ ==> wf[A](r)"; |
|
0 | 53 |
by (rtac (equals0I RS disjCI RS allI) 1); |
435 | 54 |
by (res_inst_tac [ ("Z", "Z") ] prem 1); |
2469 | 55 |
by (ALLGOALS (Fast_tac)); |
760 | 56 |
qed "wf_onI"; |
0 | 57 |
|
435 | 58 |
(*If r allows well-founded induction over A then wf[A](r) |
59 |
Premise is equivalent to |
|
60 |
!!B. ALL x:A. (ALL y. <y,x>: r --> y:B) --> x:B ==> A<=B *) |
|
61 |
val [prem] = goal WF.thy |
|
62 |
"[| !!y B. [| ALL x:A. (ALL y:A. <y,x>:r --> y:B) --> x:B; y:A \ |
|
63 |
\ |] ==> y:B |] \ |
|
64 |
\ ==> wf[A](r)"; |
|
437 | 65 |
by (rtac wf_onI 1); |
435 | 66 |
by (res_inst_tac [ ("c", "u") ] (prem RS DiffE) 1); |
67 |
by (contr_tac 3); |
|
2469 | 68 |
by (Fast_tac 2); |
69 |
by (Fast_tac 1); |
|
760 | 70 |
qed "wf_onI2"; |
0 | 71 |
|
72 |
||
73 |
(** Well-founded Induction **) |
|
74 |
||
75 |
(*Consider the least z in domain(r) Un {a} such that P(z) does not hold...*) |
|
494 | 76 |
val [major,minor] = goalw WF.thy [wf_def] |
0 | 77 |
"[| wf(r); \ |
78 |
\ !!x.[| ALL y. <y,x>: r --> P(y) |] ==> P(x) \ |
|
79 |
\ |] ==> P(a)"; |
|
80 |
by (res_inst_tac [ ("x", "{z:domain(r) Un {a}. ~P(z)}") ] (major RS allE) 1); |
|
81 |
by (etac disjE 1); |
|
2469 | 82 |
by (fast_tac (!claset addEs [equalityE]) 1); |
83 |
by (asm_full_simp_tac (!simpset addsimps [domainI]) 1); |
|
2482
87383dd9f4b5
Default rewrite rules for quantification over Collect(A,P)
paulson
parents:
2469
diff
changeset
|
84 |
by (fast_tac (!claset addSDs [minor]) 1); |
760 | 85 |
qed "wf_induct"; |
0 | 86 |
|
87 |
(*Perform induction on i, then prove the wf(r) subgoal using prems. *) |
|
88 |
fun wf_ind_tac a prems i = |
|
89 |
EVERY [res_inst_tac [("a",a)] wf_induct i, |
|
1461 | 90 |
rename_last_tac a ["1"] (i+1), |
91 |
ares_tac prems i]; |
|
0 | 92 |
|
485 | 93 |
(*The form of this rule is designed to match wfI*) |
0 | 94 |
val wfr::amem::prems = goal WF.thy |
95 |
"[| wf(r); a:A; field(r)<=A; \ |
|
96 |
\ !!x.[| x: A; ALL y. <y,x>: r --> P(y) |] ==> P(x) \ |
|
97 |
\ |] ==> P(a)"; |
|
98 |
by (rtac (amem RS rev_mp) 1); |
|
99 |
by (wf_ind_tac "a" [wfr] 1); |
|
100 |
by (rtac impI 1); |
|
101 |
by (eresolve_tac prems 1); |
|
2469 | 102 |
by (fast_tac (!claset addIs (prems RL [subsetD])) 1); |
760 | 103 |
qed "wf_induct2"; |
0 | 104 |
|
2469 | 105 |
goal domrange.thy "!!r A. field(r Int A*A) <= A"; |
106 |
by (Fast_tac 1); |
|
760 | 107 |
qed "field_Int_square"; |
435 | 108 |
|
109 |
val wfr::amem::prems = goalw WF.thy [wf_on_def] |
|
1461 | 110 |
"[| wf[A](r); a:A; \ |
111 |
\ !!x.[| x: A; ALL y:A. <y,x>: r --> P(y) |] ==> P(x) \ |
|
435 | 112 |
\ |] ==> P(a)"; |
113 |
by (rtac ([wfr, amem, field_Int_square] MRS wf_induct2) 1); |
|
114 |
by (REPEAT (ares_tac prems 1)); |
|
2469 | 115 |
by (Fast_tac 1); |
760 | 116 |
qed "wf_on_induct"; |
435 | 117 |
|
118 |
fun wf_on_ind_tac a prems i = |
|
119 |
EVERY [res_inst_tac [("a",a)] wf_on_induct i, |
|
1461 | 120 |
rename_last_tac a ["1"] (i+2), |
121 |
REPEAT (ares_tac prems i)]; |
|
435 | 122 |
|
123 |
(*If r allows well-founded induction then wf(r)*) |
|
124 |
val [subs,indhyp] = goal WF.thy |
|
125 |
"[| field(r)<=A; \ |
|
126 |
\ !!y B. [| ALL x:A. (ALL y:A. <y,x>:r --> y:B) --> x:B; y:A \ |
|
127 |
\ |] ==> y:B |] \ |
|
128 |
\ ==> wf(r)"; |
|
437 | 129 |
by (rtac ([wf_onI2, subs] MRS (wf_on_subset_A RS wf_on_field_imp_wf)) 1); |
435 | 130 |
by (REPEAT (ares_tac [indhyp] 1)); |
760 | 131 |
qed "wfI"; |
435 | 132 |
|
133 |
||
134 |
(*** Properties of well-founded relations ***) |
|
135 |
||
136 |
goal WF.thy "!!r. wf(r) ==> <a,a> ~: r"; |
|
137 |
by (wf_ind_tac "a" [] 1); |
|
2469 | 138 |
by (Fast_tac 1); |
760 | 139 |
qed "wf_not_refl"; |
435 | 140 |
|
141 |
goal WF.thy "!!r. [| wf(r); <a,x>:r; <x,a>:r |] ==> P"; |
|
142 |
by (subgoal_tac "ALL x. <a,x>:r --> <x,a>:r --> P" 1); |
|
143 |
by (wf_ind_tac "a" [] 2); |
|
2469 | 144 |
by (Fast_tac 2); |
145 |
by (Fast_tac 1); |
|
760 | 146 |
qed "wf_asym"; |
0 | 147 |
|
435 | 148 |
goal WF.thy "!!r. [| wf[A](r); a: A |] ==> <a,a> ~: r"; |
149 |
by (wf_on_ind_tac "a" [] 1); |
|
2469 | 150 |
by (Fast_tac 1); |
760 | 151 |
qed "wf_on_not_refl"; |
435 | 152 |
|
153 |
goal WF.thy "!!r. [| wf[A](r); <a,b>:r; <b,a>:r; a:A; b:A |] ==> P"; |
|
154 |
by (subgoal_tac "ALL y:A. <a,y>:r --> <y,a>:r --> P" 1); |
|
155 |
by (wf_on_ind_tac "a" [] 2); |
|
2469 | 156 |
by (Fast_tac 2); |
157 |
by (Fast_tac 1); |
|
760 | 158 |
qed "wf_on_asym"; |
435 | 159 |
|
160 |
(*Needed to prove well_ordI. Could also reason that wf[A](r) means |
|
161 |
wf(r Int A*A); thus wf( (r Int A*A)^+ ) and use wf_not_refl *) |
|
162 |
goal WF.thy |
|
163 |
"!!r. [| wf[A](r); <a,b>:r; <b,c>:r; <c,a>:r; a:A; b:A; c:A |] ==> P"; |
|
164 |
by (subgoal_tac |
|
165 |
"ALL y:A. ALL z:A. <a,y>:r --> <y,z>:r --> <z,a>:r --> P" 1); |
|
166 |
by (wf_on_ind_tac "a" [] 2); |
|
2469 | 167 |
by (Fast_tac 2); |
168 |
by (Fast_tac 1); |
|
760 | 169 |
qed "wf_on_chain3"; |
435 | 170 |
|
171 |
||
172 |
(*retains the universal formula for later use!*) |
|
173 |
val bchain_tac = EVERY' [rtac (bspec RS mp), assume_tac, assume_tac ]; |
|
174 |
||
175 |
(*transitive closure of a WF relation is WF provided A is downwards closed*) |
|
176 |
val [wfr,subs] = goal WF.thy |
|
177 |
"[| wf[A](r); r-``A <= A |] ==> wf[A](r^+)"; |
|
437 | 178 |
by (rtac wf_onI2 1); |
435 | 179 |
by (bchain_tac 1); |
180 |
by (eres_inst_tac [("a","y")] (wfr RS wf_on_induct) 1); |
|
181 |
by (rtac (impI RS ballI) 1); |
|
0 | 182 |
by (etac tranclE 1); |
435 | 183 |
by (etac (bspec RS mp) 1 THEN assume_tac 1); |
2469 | 184 |
by (Fast_tac 1); |
435 | 185 |
by (cut_facts_tac [subs] 1); |
186 |
(*astar_tac is slightly faster*) |
|
2469 | 187 |
by (Best_tac 1); |
760 | 188 |
qed "wf_on_trancl"; |
435 | 189 |
|
190 |
goal WF.thy "!!r. wf(r) ==> wf(r^+)"; |
|
2469 | 191 |
by (asm_full_simp_tac (!simpset addsimps [wf_iff_wf_on_field]) 1); |
437 | 192 |
by (rtac (trancl_type RS field_rel_subset RSN (2, wf_on_subset_A)) 1); |
193 |
by (etac wf_on_trancl 1); |
|
2469 | 194 |
by (Fast_tac 1); |
760 | 195 |
qed "wf_trancl"; |
0 | 196 |
|
435 | 197 |
|
198 |
||
0 | 199 |
(** r-``{a} is the set of everything under a in r **) |
200 |
||
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
201 |
bind_thm ("underI", (vimage_singleton_iff RS iffD2)); |
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
202 |
bind_thm ("underD", (vimage_singleton_iff RS iffD1)); |
0 | 203 |
|
204 |
(** is_recfun **) |
|
205 |
||
206 |
val [major] = goalw WF.thy [is_recfun_def] |
|
207 |
"is_recfun(r,a,H,f) ==> f: r-``{a} -> range(f)"; |
|
2033 | 208 |
by (stac major 1); |
0 | 209 |
by (rtac (lamI RS rangeI RS lam_type) 1); |
210 |
by (assume_tac 1); |
|
760 | 211 |
qed "is_recfun_type"; |
0 | 212 |
|
213 |
val [isrec,rel] = goalw WF.thy [is_recfun_def] |
|
214 |
"[| is_recfun(r,a,H,f); <x,a>:r |] ==> f`x = H(x, restrict(f,r-``{x}))"; |
|
443
10884e64c241
added parentheses made necessary by new constrain precedence
clasohm
parents:
437
diff
changeset
|
215 |
by (res_inst_tac [("P", "%x.?t(x) = (?u::i)")] (isrec RS ssubst) 1); |
0 | 216 |
by (rtac (rel RS underI RS beta) 1); |
760 | 217 |
qed "apply_recfun"; |
0 | 218 |
|
219 |
(*eresolve_tac transD solves <a,b>:r using transitivity AT MOST ONCE |
|
220 |
spec RS mp instantiates induction hypotheses*) |
|
221 |
fun indhyp_tac hyps = |
|
6
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
222 |
resolve_tac (TrueI::refl::hyps) ORELSE' |
0 | 223 |
(cut_facts_tac hyps THEN' |
224 |
DEPTH_SOLVE_1 o (ares_tac [TrueI, ballI] ORELSE' |
|
1461 | 225 |
eresolve_tac [underD, transD, spec RS mp])); |
0 | 226 |
|
6
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
227 |
(*** NOTE! some simplifications need a different solver!! ***) |
2637
e9b203f854ae
reflecting my recent changes of the simplifier and classical reasoner
oheimb
parents:
2482
diff
changeset
|
228 |
val wf_super_ss = !simpset setSolver indhyp_tac; |
0 | 229 |
|
230 |
val prems = goalw WF.thy [is_recfun_def] |
|
231 |
"[| wf(r); trans(r); is_recfun(r,a,H,f); is_recfun(r,b,H,g) |] ==> \ |
|
232 |
\ <x,a>:r --> <x,b>:r --> f`x=g`x"; |
|
233 |
by (cut_facts_tac prems 1); |
|
234 |
by (wf_ind_tac "x" prems 1); |
|
235 |
by (REPEAT (rtac impI 1 ORELSE etac ssubst 1)); |
|
236 |
by (rewtac restrict_def); |
|
6
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
237 |
by (asm_simp_tac (wf_super_ss addsimps [vimage_singleton_iff]) 1); |
760 | 238 |
qed "is_recfun_equal_lemma"; |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
239 |
bind_thm ("is_recfun_equal", (is_recfun_equal_lemma RS mp RS mp)); |
0 | 240 |
|
241 |
val prems as [wfr,transr,recf,recg,_] = goal WF.thy |
|
242 |
"[| wf(r); trans(r); \ |
|
243 |
\ is_recfun(r,a,H,f); is_recfun(r,b,H,g); <b,a>:r |] ==> \ |
|
244 |
\ restrict(f, r-``{b}) = g"; |
|
245 |
by (cut_facts_tac prems 1); |
|
246 |
by (rtac (consI1 RS restrict_type RS fun_extension) 1); |
|
247 |
by (etac is_recfun_type 1); |
|
248 |
by (ALLGOALS |
|
6
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
249 |
(asm_simp_tac (wf_super_ss addsimps |
1461 | 250 |
[ [wfr,transr,recf,recg] MRS is_recfun_equal ]))); |
760 | 251 |
qed "is_recfun_cut"; |
0 | 252 |
|
253 |
(*** Main Existence Lemma ***) |
|
254 |
||
255 |
val prems = goal WF.thy |
|
256 |
"[| wf(r); trans(r); is_recfun(r,a,H,f); is_recfun(r,a,H,g) |] ==> f=g"; |
|
257 |
by (cut_facts_tac prems 1); |
|
258 |
by (rtac fun_extension 1); |
|
259 |
by (REPEAT (ares_tac [is_recfun_equal] 1 |
|
260 |
ORELSE eresolve_tac [is_recfun_type,underD] 1)); |
|
760 | 261 |
qed "is_recfun_functional"; |
0 | 262 |
|
263 |
(*If some f satisfies is_recfun(r,a,H,-) then so does the_recfun(r,a,H) *) |
|
264 |
val prems = goalw WF.thy [the_recfun_def] |
|
265 |
"[| is_recfun(r,a,H,f); wf(r); trans(r) |] \ |
|
266 |
\ ==> is_recfun(r, a, H, the_recfun(r,a,H))"; |
|
267 |
by (rtac (ex1I RS theI) 1); |
|
268 |
by (REPEAT (ares_tac (prems@[is_recfun_functional]) 1)); |
|
760 | 269 |
qed "is_the_recfun"; |
0 | 270 |
|
271 |
val prems = goal WF.thy |
|
272 |
"[| wf(r); trans(r) |] ==> is_recfun(r, a, H, the_recfun(r,a,H))"; |
|
273 |
by (cut_facts_tac prems 1); |
|
274 |
by (wf_ind_tac "a" prems 1); |
|
275 |
by (res_inst_tac [("f", "lam y: r-``{a1}. wftrec(r,y,H)")] is_the_recfun 1); |
|
276 |
by (REPEAT (assume_tac 2)); |
|
277 |
by (rewrite_goals_tac [is_recfun_def, wftrec_def]); |
|
278 |
(*Applying the substitution: must keep the quantified assumption!!*) |
|
6
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
279 |
by (REPEAT (dtac underD 1 ORELSE resolve_tac [refl, lam_cong] 1)); |
0 | 280 |
by (fold_tac [is_recfun_def]); |
6
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
281 |
by (rtac (consI1 RS restrict_type RSN (2,fun_extension) RS subst_context) 1); |
0 | 282 |
by (rtac is_recfun_type 1); |
283 |
by (ALLGOALS |
|
6
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
284 |
(asm_simp_tac |
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
285 |
(wf_super_ss addsimps [underI RS beta, apply_recfun, is_recfun_cut]))); |
760 | 286 |
qed "unfold_the_recfun"; |
0 | 287 |
|
288 |
||
289 |
(*** Unfolding wftrec ***) |
|
290 |
||
291 |
val prems = goal WF.thy |
|
292 |
"[| wf(r); trans(r); <b,a>:r |] ==> \ |
|
293 |
\ restrict(the_recfun(r,a,H), r-``{b}) = the_recfun(r,b,H)"; |
|
294 |
by (REPEAT (ares_tac (prems @ [is_recfun_cut, unfold_the_recfun]) 1)); |
|
760 | 295 |
qed "the_recfun_cut"; |
0 | 296 |
|
297 |
(*NOT SUITABLE FOR REWRITING since it is recursive!*) |
|
6
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
298 |
goalw WF.thy [wftrec_def] |
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
299 |
"!!r. [| wf(r); trans(r) |] ==> \ |
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
300 |
\ wftrec(r,a,H) = H(a, lam x: r-``{a}. wftrec(r,x,H))"; |
2033 | 301 |
by (stac (rewrite_rule [is_recfun_def] unfold_the_recfun) 1); |
6
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
302 |
by (ALLGOALS (asm_simp_tac |
2469 | 303 |
(!simpset addsimps [vimage_singleton_iff RS iff_sym, the_recfun_cut]))); |
760 | 304 |
qed "wftrec"; |
0 | 305 |
|
306 |
(** Removal of the premise trans(r) **) |
|
307 |
||
308 |
(*NOT SUITABLE FOR REWRITING since it is recursive!*) |
|
309 |
val [wfr] = goalw WF.thy [wfrec_def] |
|
310 |
"wf(r) ==> wfrec(r,a,H) = H(a, lam x:r-``{a}. wfrec(r,x,H))"; |
|
2033 | 311 |
by (stac (wfr RS wf_trancl RS wftrec) 1); |
0 | 312 |
by (rtac trans_trancl 1); |
6
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
313 |
by (rtac (vimage_pair_mono RS restrict_lam_eq RS subst_context) 1); |
0 | 314 |
by (etac r_into_trancl 1); |
315 |
by (rtac subset_refl 1); |
|
760 | 316 |
qed "wfrec"; |
0 | 317 |
|
318 |
(*This form avoids giant explosions in proofs. NOTE USE OF == *) |
|
319 |
val rew::prems = goal WF.thy |
|
320 |
"[| !!x. h(x)==wfrec(r,x,H); wf(r) |] ==> \ |
|
321 |
\ h(a) = H(a, lam x: r-``{a}. h(x))"; |
|
322 |
by (rewtac rew); |
|
323 |
by (REPEAT (resolve_tac (prems@[wfrec]) 1)); |
|
760 | 324 |
qed "def_wfrec"; |
0 | 325 |
|
326 |
val prems = goal WF.thy |
|
327 |
"[| wf(r); a:A; field(r)<=A; \ |
|
328 |
\ !!x u. [| x: A; u: Pi(r-``{x}, B) |] ==> H(x,u) : B(x) \ |
|
329 |
\ |] ==> wfrec(r,a,H) : B(a)"; |
|
330 |
by (res_inst_tac [("a","a")] wf_induct2 1); |
|
2033 | 331 |
by (stac wfrec 4); |
0 | 332 |
by (REPEAT (ares_tac (prems@[lam_type]) 1 |
333 |
ORELSE eresolve_tac [spec RS mp, underD] 1)); |
|
760 | 334 |
qed "wfrec_type"; |
435 | 335 |
|
336 |
||
337 |
goalw WF.thy [wf_on_def, wfrec_on_def] |
|
338 |
"!!A r. [| wf[A](r); a: A |] ==> \ |
|
339 |
\ wfrec[A](r,a,H) = H(a, lam x: (r-``{a}) Int A. wfrec[A](r,x,H))"; |
|
437 | 340 |
by (etac (wfrec RS trans) 1); |
2469 | 341 |
by (asm_simp_tac (!simpset addsimps [vimage_Int_square, cons_subset_iff]) 1); |
760 | 342 |
qed "wfrec_on"; |
435 | 343 |