src/ZF/WF.ML
author paulson
Fri, 15 Feb 2002 12:07:27 +0100
changeset 12891 92af5c3a10fb
parent 12884 5d18148e9059
permissions -rw-r--r--
a new definition of "restrict"
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9907
473a6604da94 tuned ML code (the_context, bind_thms(s));
wenzelm
parents: 9883
diff changeset
     1
(*  Title:      ZF/WF.ML
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
     3
    Author:     Tobias Nipkow and Lawrence C Paulson
4515
44af72721564 Now calls Blast_tac more often
paulson
parents: 4091
diff changeset
     4
    Copyright   1998  University of Cambridge
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
4515
44af72721564 Now calls Blast_tac more often
paulson
parents: 4091
diff changeset
     6
Well-founded Recursion
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
Derived first for transitive relations, and finally for arbitrary WF relations
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
via wf_trancl and trans_trancl.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
It is difficult to derive this general case directly, using r^+ instead of
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
r.  In is_recfun, the two occurrences of the relation must have the same
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
form.  Inserting r^+ in the_recfun or wftrec yields a recursion rule with
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
r^+ -`` {a} instead of r-``{a}.  This recursion rule is stronger in
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
principle, but harder to use, especially to prove wfrec_eclose_eq in
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
epsilon.ML.  Expanding out the definition of wftrec in wfrec would yield
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
a mess.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
(*** Well-founded relations ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    23
(** Equivalences between wf and wf_on **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    24
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
    25
Goalw [wf_def, wf_on_def] "wf(r) ==> wf[A](r)";
4515
44af72721564 Now calls Blast_tac more often
paulson
parents: 4091
diff changeset
    26
by (Clarify_tac 1);  (*essential for Blast_tac's efficiency*)
3016
15763781afb0 Conversion to use blast_tac
paulson
parents: 2637
diff changeset
    27
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
    28
qed "wf_imp_wf_on";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    29
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
    30
Goalw [wf_def, wf_on_def] "wf[field(r)](r) ==> wf(r)";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    31
by (Fast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
    32
qed "wf_on_field_imp_wf";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    33
5067
62b6288e6005 isatool fixgoal;
wenzelm
parents: 4515
diff changeset
    34
Goal "wf(r) <-> wf[field(r)](r)";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3016
diff changeset
    35
by (blast_tac (claset() addIs [wf_imp_wf_on, wf_on_field_imp_wf]) 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
    36
qed "wf_iff_wf_on_field";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
    38
Goalw [wf_on_def, wf_def] "[| wf[A](r);  B<=A |] ==> wf[B](r)";
5265
9d1d4c43c76d Disjointness reasoning by AddEs [equals0E, sym RS equals0E]
paulson
parents: 5147
diff changeset
    39
by (Fast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
    40
qed "wf_on_subset_A";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    41
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
    42
Goalw [wf_on_def, wf_def] "[| wf[A](r);  s<=r |] ==> wf[A](s)";
5265
9d1d4c43c76d Disjointness reasoning by AddEs [equals0E, sym RS equals0E]
paulson
parents: 5147
diff changeset
    43
by (Fast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
    44
qed "wf_on_subset_r";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    45
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    46
(** Introduction rules for wf_on **)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    47
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    48
(*If every non-empty subset of A has an r-minimal element then wf[A](r).*)
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
    49
val [prem] = Goalw [wf_on_def, wf_def]
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    50
    "[| !!Z u. [| Z<=A;  u:Z;  ALL x:Z. EX y:Z. <y,x>:r |] ==> False |] \
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    51
\    ==>  wf[A](r)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
by (rtac (equals0I RS disjCI RS allI) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    53
by (res_inst_tac [ ("Z", "Z") ] prem 1);
3016
15763781afb0 Conversion to use blast_tac
paulson
parents: 2637
diff changeset
    54
by (ALLGOALS Blast_tac);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
    55
qed "wf_onI";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    56
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    57
(*If r allows well-founded induction over A then wf[A](r)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    58
  Premise is equivalent to 
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    59
  !!B. ALL x:A. (ALL y. <y,x>: r --> y:B) --> x:B ==> A<=B  *)
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
    60
val [prem] = Goal
12884
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
    61
    "[| !!y B. [| ALL x:A. (ALL y:A. <y,x>:r --> y:B) --> x:B;   y:A |]   \
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
    62
\              ==> y:B |] \
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    63
\    ==>  wf[A](r)";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
    64
by (rtac wf_onI 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    65
by (res_inst_tac [ ("c", "u") ] (prem RS DiffE) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
    66
by (contr_tac 3);
3016
15763781afb0 Conversion to use blast_tac
paulson
parents: 2637
diff changeset
    67
by (Blast_tac 2);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2033
diff changeset
    68
by (Fast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
    69
qed "wf_onI2";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
(** Well-founded Induction **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
(*Consider the least z in domain(r) Un {a} such that P(z) does not hold...*)
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
    75
val [major,minor] = Goalw [wf_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
    "[| wf(r);          \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
\       !!x.[| ALL y. <y,x>: r --> P(y) |] ==> P(x) \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
\    |]  ==>  P(a)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
by (res_inst_tac [ ("x", "{z:domain(r) Un {a}. ~P(z)}") ]  (major RS allE) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
by (etac disjE 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3016
diff changeset
    81
by (blast_tac (claset() addEs [equalityE]) 1);
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3016
diff changeset
    82
by (asm_full_simp_tac (simpset() addsimps [domainI]) 1);
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3016
diff changeset
    83
by (blast_tac (claset() addSDs [minor]) 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
    84
qed "wf_induct";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    85
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
(*Perform induction on i, then prove the wf(r) subgoal using prems. *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    87
fun wf_ind_tac a prems i = 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    88
    EVERY [res_inst_tac [("a",a)] wf_induct i,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
    89
           rename_last_tac a ["1"] (i+1),
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
    90
           ares_tac prems i];
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    91
485
5e00a676a211 Axiom of choice, cardinality results, etc.
lcp
parents: 443
diff changeset
    92
(*The form of this rule is designed to match wfI*)
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
    93
val wfr::amem::prems = Goal
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    94
    "[| wf(r);  a:A;  field(r)<=A;  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    95
\       !!x.[| x: A;  ALL y. <y,x>: r --> P(y) |] ==> P(x) \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    96
\    |]  ==>  P(a)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    97
by (rtac (amem RS rev_mp) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    98
by (wf_ind_tac "a" [wfr] 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    99
by (rtac impI 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   100
by (eresolve_tac prems 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3016
diff changeset
   101
by (blast_tac (claset() addIs (prems RL [subsetD])) 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   102
qed "wf_induct2";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
9180
3bda56c0d70d tidying and unbatchifying
paulson
parents: 9173
diff changeset
   104
Goal "field(r Int A*A) <= A";
3016
15763781afb0 Conversion to use blast_tac
paulson
parents: 2637
diff changeset
   105
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   106
qed "field_Int_square";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   107
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
   108
val wfr::amem::prems = Goalw [wf_on_def]
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
   109
    "[| wf[A](r);  a:A;                                         \
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
   110
\       !!x.[| x: A;  ALL y:A. <y,x>: r --> P(y) |] ==> P(x)    \
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   111
\    |]  ==>  P(a)";
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   112
by (rtac ([wfr, amem, field_Int_square] MRS wf_induct2) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   113
by (REPEAT (ares_tac prems 1));
3016
15763781afb0 Conversion to use blast_tac
paulson
parents: 2637
diff changeset
   114
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   115
qed "wf_on_induct";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   116
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   117
fun wf_on_ind_tac a prems i = 
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   118
    EVERY [res_inst_tac [("a",a)] wf_on_induct i,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
   119
           rename_last_tac a ["1"] (i+2),
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
   120
           REPEAT (ares_tac prems i)];
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   121
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   122
(*If r allows well-founded induction then wf(r)*)
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
   123
val [subs,indhyp] = Goal
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   124
    "[| field(r)<=A;  \
12884
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   125
\       !!y B. [| ALL x:A. (ALL y:A. <y,x>:r --> y:B) --> x:B;  y:A|]  \
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   126
\              ==> y:B |] \
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   127
\    ==>  wf(r)";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   128
by (rtac ([wf_onI2, subs] MRS (wf_on_subset_A RS wf_on_field_imp_wf)) 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   129
by (REPEAT (ares_tac [indhyp] 1));
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   130
qed "wfI";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   131
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   132
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   133
(*** Properties of well-founded relations ***)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   134
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5067
diff changeset
   135
Goal "wf(r) ==> <a,a> ~: r";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   136
by (wf_ind_tac "a" [] 1);
3016
15763781afb0 Conversion to use blast_tac
paulson
parents: 2637
diff changeset
   137
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   138
qed "wf_not_refl";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   139
5452
b38332431a8c New theorem wf_not_sym and well-formed wf_asym
paulson
parents: 5321
diff changeset
   140
Goal "wf(r) ==> ALL x. <a,x>:r --> <x,a> ~: r";
b38332431a8c New theorem wf_not_sym and well-formed wf_asym
paulson
parents: 5321
diff changeset
   141
by (wf_ind_tac "a" [] 1);
3016
15763781afb0 Conversion to use blast_tac
paulson
parents: 2637
diff changeset
   142
by (Blast_tac 1);
5452
b38332431a8c New theorem wf_not_sym and well-formed wf_asym
paulson
parents: 5321
diff changeset
   143
qed_spec_mp "wf_not_sym";
b38332431a8c New theorem wf_not_sym and well-formed wf_asym
paulson
parents: 5321
diff changeset
   144
b38332431a8c New theorem wf_not_sym and well-formed wf_asym
paulson
parents: 5321
diff changeset
   145
(* [| wf(r);  <a,x> : r;  ~P ==> <x,a> : r |] ==> P *)
b38332431a8c New theorem wf_not_sym and well-formed wf_asym
paulson
parents: 5321
diff changeset
   146
bind_thm ("wf_asym", wf_not_sym RS swap);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   147
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5067
diff changeset
   148
Goal "[| wf[A](r); a: A |] ==> <a,a> ~: r";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   149
by (wf_on_ind_tac "a" [] 1);
3016
15763781afb0 Conversion to use blast_tac
paulson
parents: 2637
diff changeset
   150
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   151
qed "wf_on_not_refl";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   152
5452
b38332431a8c New theorem wf_not_sym and well-formed wf_asym
paulson
parents: 5321
diff changeset
   153
Goal "[| wf[A](r);  a:A;  b:A |] ==> <a,b>:r --> <b,a>~:r";
b38332431a8c New theorem wf_not_sym and well-formed wf_asym
paulson
parents: 5321
diff changeset
   154
by (res_inst_tac [("x","b")] bspec 1);
b38332431a8c New theorem wf_not_sym and well-formed wf_asym
paulson
parents: 5321
diff changeset
   155
by (assume_tac 2);
b38332431a8c New theorem wf_not_sym and well-formed wf_asym
paulson
parents: 5321
diff changeset
   156
by (wf_on_ind_tac "a" [] 1);
3016
15763781afb0 Conversion to use blast_tac
paulson
parents: 2637
diff changeset
   157
by (Blast_tac 1);
5452
b38332431a8c New theorem wf_not_sym and well-formed wf_asym
paulson
parents: 5321
diff changeset
   158
qed_spec_mp "wf_on_not_sym";
b38332431a8c New theorem wf_not_sym and well-formed wf_asym
paulson
parents: 5321
diff changeset
   159
9173
422968aeed49 fixed some weak elim rules
paulson
parents: 7570
diff changeset
   160
(* [| wf[A](r); ~Z ==> <a,b> : r;
422968aeed49 fixed some weak elim rules
paulson
parents: 7570
diff changeset
   161
      <b,a> ~: r ==> Z; ~Z ==> a : A; ~Z ==> b : A |] ==> Z *)
422968aeed49 fixed some weak elim rules
paulson
parents: 7570
diff changeset
   162
bind_thm ("wf_on_asym", permute_prems 1 2 (cla_make_elim wf_on_not_sym));
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   163
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   164
(*Needed to prove well_ordI.  Could also reason that wf[A](r) means
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   165
  wf(r Int A*A);  thus wf( (r Int A*A)^+ ) and use wf_not_refl *)
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
   166
Goal "[| wf[A](r); <a,b>:r; <b,c>:r; <c,a>:r; a:A; b:A; c:A |] ==> P";
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
   167
by (subgoal_tac "ALL y:A. ALL z:A. <a,y>:r --> <y,z>:r --> <z,a>:r --> P" 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   168
by (wf_on_ind_tac "a" [] 2);
3016
15763781afb0 Conversion to use blast_tac
paulson
parents: 2637
diff changeset
   169
by (Blast_tac 2);
15763781afb0 Conversion to use blast_tac
paulson
parents: 2637
diff changeset
   170
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   171
qed "wf_on_chain3";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   172
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   173
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   174
(*retains the universal formula for later use!*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   175
val bchain_tac = EVERY' [rtac (bspec RS mp), assume_tac, assume_tac ];
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   176
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   177
(*transitive closure of a WF relation is WF provided A is downwards closed*)
9907
473a6604da94 tuned ML code (the_context, bind_thms(s));
wenzelm
parents: 9883
diff changeset
   178
val [wfr,subs] = goal (the_context ())
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   179
    "[| wf[A](r);  r-``A <= A |] ==> wf[A](r^+)";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   180
by (rtac wf_onI2 1);
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   181
by (bchain_tac 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   182
by (eres_inst_tac [("a","y")] (wfr RS wf_on_induct) 1);
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   183
by (cut_facts_tac [subs] 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3016
diff changeset
   184
by (blast_tac (claset() addEs [tranclE]) 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   185
qed "wf_on_trancl";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   186
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5067
diff changeset
   187
Goal "wf(r) ==> wf(r^+)";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3016
diff changeset
   188
by (asm_full_simp_tac (simpset() addsimps [wf_iff_wf_on_field]) 1);
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   189
by (rtac (trancl_type RS field_rel_subset RSN (2, wf_on_subset_A)) 1);
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   190
by (etac wf_on_trancl 1);
3016
15763781afb0 Conversion to use blast_tac
paulson
parents: 2637
diff changeset
   191
by (Blast_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   192
qed "wf_trancl";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   193
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   194
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   195
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   196
(** r-``{a} is the set of everything under a in r **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   197
6112
5e4871c5136b datatype package improvements
paulson
parents: 5452
diff changeset
   198
bind_thm ("underI", vimage_singleton_iff RS iffD2);
5e4871c5136b datatype package improvements
paulson
parents: 5452
diff changeset
   199
bind_thm ("underD", vimage_singleton_iff RS iffD1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   200
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   201
(** is_recfun **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   202
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
   203
Goalw [is_recfun_def] "is_recfun(r,a,H,f) ==> f: r-``{a} -> range(f)";
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
   204
by (etac ssubst 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   205
by (rtac (lamI RS rangeI RS lam_type) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   206
by (assume_tac 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   207
qed "is_recfun_type";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   208
9907
473a6604da94 tuned ML code (the_context, bind_thms(s));
wenzelm
parents: 9883
diff changeset
   209
val [isrec,rel] = goalw (the_context ()) [is_recfun_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   210
    "[| 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
   211
by (res_inst_tac [("P", "%x.?t(x) = (?u::i)")] (isrec RS ssubst) 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   212
by (rtac (rel RS underI RS beta) 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   213
qed "apply_recfun";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   214
12891
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   215
Goal "[| wf(r);  trans(r);  is_recfun(r,a,H,f);  is_recfun(r,b,H,g) |]  \
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   216
\     ==> <x,a>:r --> <x,b>:r --> f`x=g`x";
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   217
by (forw_inst_tac [("f","f")] is_recfun_type 1); 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   218
by (forw_inst_tac [("f","g")] is_recfun_type 1); 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   219
by (asm_full_simp_tac (simpset() addsimps [is_recfun_def]) 1); 
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
   220
by (wf_ind_tac "x" [] 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   221
by (REPEAT (rtac impI 1 ORELSE etac ssubst 1));
12884
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   222
by (asm_simp_tac (simpset() addsimps [vimage_singleton_iff, restrict_def]) 1); 
12891
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   223
by (res_inst_tac [("t","%z. H(?x,z)")] subst_context 1); 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   224
by (subgoal_tac "ALL y : r-``{x1}. ALL z. <y,z>:f <-> <y,z>:g" 1);
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   225
 by (blast_tac (claset() addDs [transD]) 1); 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   226
by (asm_full_simp_tac (simpset() addsimps [apply_iff]) 1); 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   227
by (blast_tac (claset() addDs [transD] addIs [sym]) 1); 
6112
5e4871c5136b datatype package improvements
paulson
parents: 5452
diff changeset
   228
qed_spec_mp "is_recfun_equal";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   229
12884
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   230
Goal "[| wf(r);  trans(r);       \
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   231
\        is_recfun(r,a,H,f);  is_recfun(r,b,H,g);  <b,a>:r |]  \
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   232
\     ==> restrict(f, r-``{b}) = g";
12891
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   233
by (forw_inst_tac [("f","f")] is_recfun_type 1); 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   234
by (rtac fun_extension 1);
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   235
  by (blast_tac (claset() addDs [transD] addIs [restrict_type2]) 1); 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   236
 by (etac is_recfun_type 1);
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   237
by (Asm_full_simp_tac 1);
12884
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   238
by (blast_tac (claset() addDs [transD]
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   239
			addIs [is_recfun_equal]) 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   240
qed "is_recfun_cut";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   241
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   242
(*** Main Existence Lemma ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   243
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
   244
Goal "[| wf(r); trans(r); is_recfun(r,a,H,f); is_recfun(r,a,H,g) |]  ==>  f=g";
12891
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   245
by (blast_tac (claset() addIs [fun_extension, is_recfun_type, 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   246
                               is_recfun_equal]) 1); 
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   247
qed "is_recfun_functional";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   248
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   249
(*If some f satisfies is_recfun(r,a,H,-) then so does the_recfun(r,a,H) *)
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
   250
Goalw [the_recfun_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   251
    "[| is_recfun(r,a,H,f);  wf(r);  trans(r) |]  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   252
\    ==> is_recfun(r, a, H, the_recfun(r,a,H))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   253
by (rtac (ex1I RS theI) 1);
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
   254
by (REPEAT (ares_tac [is_recfun_functional] 1));
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   255
qed "is_the_recfun";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   256
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
   257
Goal "[| wf(r);  trans(r) |] ==> is_recfun(r, a, H, the_recfun(r,a,H))";
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
   258
by (wf_ind_tac "a" [] 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   259
by (res_inst_tac [("f", "lam y: r-``{a1}. wftrec(r,y,H)")] is_the_recfun 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   260
by (REPEAT (assume_tac 2));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   261
by (rewrite_goals_tac [is_recfun_def, wftrec_def]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   262
(*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
   263
by (REPEAT (dtac underD 1 ORELSE resolve_tac [refl, lam_cong] 1));
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   264
by (fold_tac [is_recfun_def]);
12891
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   265
by (res_inst_tac [("t","%z. H(?x,z)")] subst_context 1); 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   266
by (rtac fun_extension 1);
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   267
  by (blast_tac (claset() addIs [is_recfun_type]) 1);
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   268
 by (rtac (lam_type RS restrict_type2) 1); 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   269
  by (Blast_tac 1); 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12884
diff changeset
   270
 by (blast_tac (claset() addDs [transD]) 1); 
12884
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   271
by (ftac (spec RS mp) 1 THEN assume_tac 1);
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   272
by (subgoal_tac "<xa,a1> : r" 1);
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   273
by (dres_inst_tac [("x1","xa")] (spec RS mp) 1 THEN assume_tac 1);
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   274
by (asm_full_simp_tac
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   275
     (simpset() addsimps [vimage_singleton_iff, underI RS beta, apply_recfun, 
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   276
                          is_recfun_cut]) 1);
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   277
by (blast_tac (claset() addDs [transD]) 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   278
qed "unfold_the_recfun";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   279
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   280
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   281
(*** Unfolding wftrec ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   282
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
   283
Goal "[| wf(r);  trans(r);  <b,a>:r |] ==> \
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
   284
\     restrict(the_recfun(r,a,H), r-``{b}) = the_recfun(r,b,H)";
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
   285
by (REPEAT (ares_tac [is_recfun_cut, unfold_the_recfun] 1));
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   286
qed "the_recfun_cut";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   287
4515
44af72721564 Now calls Blast_tac more often
paulson
parents: 4091
diff changeset
   288
(*NOT SUITABLE FOR REWRITING: it is recursive!*)
5067
62b6288e6005 isatool fixgoal;
wenzelm
parents: 4515
diff changeset
   289
Goalw [wftrec_def]
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
   290
    "[| wf(r);  trans(r) |] ==> \
6
8ce8c4d13d4d Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents: 0
diff changeset
   291
\         wftrec(r,a,H) = H(a, lam x: r-``{a}. wftrec(r,x,H))";
2033
639de962ded4 Ran expandshort; used stac instead of ssubst
paulson
parents: 1461
diff changeset
   292
by (stac (rewrite_rule [is_recfun_def] unfold_the_recfun) 1);
4515
44af72721564 Now calls Blast_tac more often
paulson
parents: 4091
diff changeset
   293
by (ALLGOALS 
44af72721564 Now calls Blast_tac more often
paulson
parents: 4091
diff changeset
   294
    (asm_simp_tac
44af72721564 Now calls Blast_tac more often
paulson
parents: 4091
diff changeset
   295
     (simpset() addsimps [vimage_singleton_iff RS iff_sym, the_recfun_cut])));
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   296
qed "wftrec";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   297
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   298
(** Removal of the premise trans(r) **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   299
4515
44af72721564 Now calls Blast_tac more often
paulson
parents: 4091
diff changeset
   300
(*NOT SUITABLE FOR REWRITING: it is recursive!*)
9907
473a6604da94 tuned ML code (the_context, bind_thms(s));
wenzelm
parents: 9883
diff changeset
   301
val [wfr] = goalw (the_context ()) [wfrec_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   302
    "wf(r) ==> wfrec(r,a,H) = H(a, lam x:r-``{a}. wfrec(r,x,H))";
2033
639de962ded4 Ran expandshort; used stac instead of ssubst
paulson
parents: 1461
diff changeset
   303
by (stac (wfr RS wf_trancl RS wftrec) 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   304
by (rtac trans_trancl 1);
6
8ce8c4d13d4d Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents: 0
diff changeset
   305
by (rtac (vimage_pair_mono RS restrict_lam_eq RS subst_context) 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   306
by (etac r_into_trancl 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   307
by (rtac subset_refl 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   308
qed "wfrec";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   309
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   310
(*This form avoids giant explosions in proofs.  NOTE USE OF == *)
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
   311
val rew::prems = Goal
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   312
    "[| !!x. h(x)==wfrec(r,x,H);  wf(r) |] ==> \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   313
\    h(a) = H(a, lam x: r-``{a}. h(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   314
by (rewtac rew);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   315
by (REPEAT (resolve_tac (prems@[wfrec]) 1));
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   316
qed "def_wfrec";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   317
5321
f8848433d240 got rid of some goal thy commands
paulson
parents: 5265
diff changeset
   318
val prems = Goal
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   319
    "[| wf(r);  a:A;  field(r)<=A;  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   320
\       !!x u. [| x: A;  u: Pi(r-``{x}, B) |] ==> H(x,u) : B(x)   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   321
\    |] ==> wfrec(r,a,H) : B(a)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   322
by (res_inst_tac [("a","a")] wf_induct2 1);
2033
639de962ded4 Ran expandshort; used stac instead of ssubst
paulson
parents: 1461
diff changeset
   323
by (stac wfrec 4);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   324
by (REPEAT (ares_tac (prems@[lam_type]) 1
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   325
     ORELSE eresolve_tac [spec RS mp, underD] 1));
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   326
qed "wfrec_type";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   327
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   328
5067
62b6288e6005 isatool fixgoal;
wenzelm
parents: 4515
diff changeset
   329
Goalw [wf_on_def, wfrec_on_def]
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5137
diff changeset
   330
 "[| wf[A](r);  a: A |] ==> \
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   331
\        wfrec[A](r,a,H) = H(a, lam x: (r-``{a}) Int A. wfrec[A](r,x,H))";
437
435875e4b21d modifications for cardinal arithmetic
lcp
parents: 435
diff changeset
   332
by (etac (wfrec RS trans) 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3016
diff changeset
   333
by (asm_simp_tac (simpset() addsimps [vimage_Int_square, cons_subset_iff]) 1);
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 494
diff changeset
   334
qed "wfrec_on";
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents: 6
diff changeset
   335
12884
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   336
(*Minimal-element characterization of well-foundedness*)
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   337
Goalw [wf_def] 
5d18148e9059 tidied. no more special simpset (super_ss)
paulson
parents: 9907
diff changeset
   338
     "wf(r) <-> (ALL Q x. x:Q --> (EX z:Q. ALL y. <y,z>:r --> y~:Q))";
9883
c1c8647af477 a number of new theorems
paulson
parents: 9180
diff changeset
   339
by (Blast_tac 1);
c1c8647af477 a number of new theorems
paulson
parents: 9180
diff changeset
   340
qed "wf_eq_minimal";
c1c8647af477 a number of new theorems
paulson
parents: 9180
diff changeset
   341