src/CCL/Fix.ML
author wenzelm
Sun, 22 Jan 2006 18:46:00 +0100
changeset 18743 7ff2934480c9
parent 17955 3b34516662c6
permissions -rw-r--r--
added restore_body;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
     1
(*  Title:      CCL/Fix.ML
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1459
d12da312eff4 expanded tabs
clasohm
parents: 757
diff changeset
     3
    Author:     Martin Coen, Cambridge University Computer Laboratory
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
(*** Fixed Point Induction ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
     9
val [base,step,incl] = goalw (the_context ()) [INCL_def]
3837
d7f033c74b38 fixed dots;
wenzelm
parents: 2035
diff changeset
    10
    "[| P(bot);  !!x. P(x) ==> P(f(x));  INCL(P) |] ==> P(fix(f))";
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    11
by (rtac (incl RS spec RS mp) 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
by (rtac (Nat_ind RS ballI) 1 THEN atac 1);
8
c3d2c6dcf3f0 Installation of new simplfier. Previously appeared to set up the old
lcp
parents: 0
diff changeset
    13
by (ALLGOALS (simp_tac term_ss));
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
by (REPEAT (ares_tac [base,step] 1));
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    15
qed "fix_ind";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
(*** Inclusive Predicates ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
    19
val prems = goalw (the_context ()) [INCL_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
     "INCL(P) <-> (ALL f. (ALL n:Nat. P(f ^ n ` bot)) --> P(fix(f)))";
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    21
by (rtac iff_refl 1);
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    22
qed "inclXH";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
    24
val prems = goal (the_context ())
3837
d7f033c74b38 fixed dots;
wenzelm
parents: 2035
diff changeset
    25
     "[| !!f. ALL n:Nat. P(f^n`bot) ==> P(fix(f)) |] ==> INCL(%x. P(x))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
by (fast_tac (term_cs addIs (prems @ [XH_to_I inclXH])) 1);
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    27
qed "inclI";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
    29
val incl::prems = goal (the_context ())
3837
d7f033c74b38 fixed dots;
wenzelm
parents: 2035
diff changeset
    30
     "[| INCL(P);  !!n. n:Nat ==> P(f^n`bot) |] ==> P(fix(f))";
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
    31
by (fast_tac (term_cs addIs ([ballI RS (incl RS (XH_to_D inclXH) RS spec RS mp)]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
                       @ prems)) 1);
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    33
qed "inclD";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
    35
val incl::prems = goal (the_context ())
3837
d7f033c74b38 fixed dots;
wenzelm
parents: 2035
diff changeset
    36
     "[| INCL(P);  (ALL n:Nat. P(f^n`bot))-->P(fix(f)) ==> R |] ==> R";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
by (fast_tac (term_cs addIs ([incl RS inclD] @ prems)) 1);
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    38
qed "inclE";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
(*** Lemmas for Inclusive Predicates ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
5062
fbdb0b541314 isatool fixgoal;
wenzelm
parents: 3837
diff changeset
    43
Goal "INCL(%x.~ a(x) [= t)";
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    44
by (rtac inclI 1);
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    45
by (dtac bspec 1);
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    46
by (rtac zeroT 1);
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    47
by (etac contrapos 1);
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    48
by (rtac po_trans 1);
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    49
by (assume_tac 2);
2035
e329b36d9136 Ran expandshort; used stac instead of ssubst
paulson
parents: 1459
diff changeset
    50
by (stac napplyBzero 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
by (rtac po_cong 1 THEN rtac po_bot 1);
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    52
qed "npo_INCL";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
    54
val prems = goal (the_context ()) "[| INCL(P);  INCL(Q) |] ==> INCL(%x. P(x) & Q(x))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
by (fast_tac (set_cs addSIs ([inclI] @ (prems RL [inclD]))) 1);;
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    56
qed "conj_INCL";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
    58
val prems = goal (the_context ()) "[| !!a. INCL(P(a)) |] ==> INCL(%x. ALL a. P(a,x))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
by (fast_tac (set_cs addSIs ([inclI] @ (prems RL [inclD]))) 1);;
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    60
qed "all_INCL";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
    62
val prems = goal (the_context ()) "[| !!a. a:A ==> INCL(P(a)) |] ==> INCL(%x. ALL a:A. P(a,x))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
by (fast_tac (set_cs addSIs ([inclI] @ (prems RL [inclD]))) 1);;
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    64
qed "ball_INCL";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
5062
fbdb0b541314 isatool fixgoal;
wenzelm
parents: 3837
diff changeset
    66
Goal "INCL(%x. a(x) = (b(x)::'a::prog))";
8
c3d2c6dcf3f0 Installation of new simplfier. Previously appeared to set up the old
lcp
parents: 0
diff changeset
    67
by (simp_tac (term_ss addsimps [eq_iff]) 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
by (REPEAT (resolve_tac [conj_INCL,po_INCL] 1));
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    69
qed "eq_INCL";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
(*** Derivation of Reachability Condition ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
(* Fixed points of idgen *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
5062
fbdb0b541314 isatool fixgoal;
wenzelm
parents: 3837
diff changeset
    75
Goal "idgen(fix(idgen)) = fix(idgen)";
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    76
by (rtac (fixB RS sym) 1);
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    77
qed "fix_idgenfp";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
5062
fbdb0b541314 isatool fixgoal;
wenzelm
parents: 3837
diff changeset
    79
Goalw [idgen_def] "idgen(lam x. x) = lam x. x";
8
c3d2c6dcf3f0 Installation of new simplfier. Previously appeared to set up the old
lcp
parents: 0
diff changeset
    80
by (simp_tac term_ss 1);
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    81
by (rtac (term_case RS allI) 1);
8
c3d2c6dcf3f0 Installation of new simplfier. Previously appeared to set up the old
lcp
parents: 0
diff changeset
    82
by (ALLGOALS (simp_tac term_ss));
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    83
qed "id_idgenfp";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    85
(* All fixed points are lam-expressions *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
    87
val [prem] = goal (the_context ()) "idgen(d) = d ==> d = lam x.?f(x)";
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    88
by (rtac (prem RS subst) 1);
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    89
by (rewtac idgen_def);
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
    90
by (rtac refl 1);
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    91
qed "idgenfp_lam";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    92
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
(* Lemmas for rewriting fixed points of idgen *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    94
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
    95
val prems = goalw (the_context ()) [idgen_def]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    96
    "[| a = b;  a ` t = u |] ==> b ` t = u";
8
c3d2c6dcf3f0 Installation of new simplfier. Previously appeared to set up the old
lcp
parents: 0
diff changeset
    97
by (simp_tac (term_ss addsimps (prems RL [sym])) 1);
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
    98
qed "l_lemma";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    99
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   100
val idgen_lemmas =
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
   101
    let fun mk_thm s = prove_goalw (the_context ()) [idgen_def] s
8
c3d2c6dcf3f0 Installation of new simplfier. Previously appeared to set up the old
lcp
parents: 0
diff changeset
   102
           (fn [prem] => [rtac (prem RS l_lemma) 1,simp_tac term_ss 1])
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
    in map mk_thm
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   104
          [    "idgen(d) = d ==> d ` bot = bot",
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
               "idgen(d) = d ==> d ` true = true",
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   106
               "idgen(d) = d ==> d ` false = false",
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   107
               "idgen(d) = d ==> d ` <a,b> = <d ` a,d ` b>",
3837
d7f033c74b38 fixed dots;
wenzelm
parents: 2035
diff changeset
   108
               "idgen(d) = d ==> d ` (lam x. f(x)) = lam x. d ` f(x)"]
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   109
    end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   110
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
   111
(* Proof of Reachability law - show that fix and lam x.x both give LEAST fixed points
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   112
                               of idgen and hence are they same *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   113
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
   114
val [p1,p2,p3] = goal (the_context ())
3837
d7f033c74b38 fixed dots;
wenzelm
parents: 2035
diff changeset
   115
    "[| ALL x. t ` x [= u ` x;  EX f. t=lam x. f(x);  EX f. u=lam x. f(x) |] ==> t [= u";
2035
e329b36d9136 Ran expandshort; used stac instead of ssubst
paulson
parents: 1459
diff changeset
   116
by (stac (p2 RS cond_eta) 1);
e329b36d9136 Ran expandshort; used stac instead of ssubst
paulson
parents: 1459
diff changeset
   117
by (stac (p3 RS cond_eta) 1);
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   118
by (rtac (p1 RS (po_lam RS iffD2)) 1);
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
   119
qed "po_eta";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   120
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
   121
val [prem] = goalw (the_context ()) [idgen_def] "idgen(d) = d ==> d = lam x.?f(x)";
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   122
by (rtac (prem RS subst) 1);
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   123
by (rtac refl 1);
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
   124
qed "po_eta_lemma";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   125
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
   126
val [prem] = goal (the_context ())
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   127
    "idgen(d) = d ==> \
3837
d7f033c74b38 fixed dots;
wenzelm
parents: 2035
diff changeset
   128
\      {p. EX a b. p=<a,b> & (EX t. a=fix(idgen) ` t & b = d ` t)} <=   \
d7f033c74b38 fixed dots;
wenzelm
parents: 2035
diff changeset
   129
\      POgen({p. EX a b. p=<a,b> & (EX t. a=fix(idgen) ` t  & b = d ` t)})";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   130
by (REPEAT (step_tac term_cs 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   131
by (term_case_tac "t" 1);
8
c3d2c6dcf3f0 Installation of new simplfier. Previously appeared to set up the old
lcp
parents: 0
diff changeset
   132
by (ALLGOALS (simp_tac (term_ss addsimps (POgenXH::([prem,fix_idgenfp] RL idgen_lemmas)))));
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   133
by (ALLGOALS (fast_tac set_cs));
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
   134
qed "lemma1";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   135
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
   136
val [prem] = goal (the_context ())
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   137
    "idgen(d) = d ==> fix(idgen) [= d";
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   138
by (rtac (allI RS po_eta) 1);
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   139
by (rtac (lemma1 RSN(2,po_coinduct)) 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   140
by (ALLGOALS (fast_tac (term_cs addIs [prem,po_eta_lemma,fix_idgenfp])));
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
   141
qed "fix_least_idgen";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   142
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
   143
val [prem] = goal (the_context ())
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   144
    "idgen(d) = d ==> \
3837
d7f033c74b38 fixed dots;
wenzelm
parents: 2035
diff changeset
   145
\      {p. EX a b. p=<a,b> & b = d ` a} <= POgen({p. EX a b. p=<a,b> & b = d ` a})";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   146
by (REPEAT (step_tac term_cs 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   147
by (term_case_tac "a" 1);
8
c3d2c6dcf3f0 Installation of new simplfier. Previously appeared to set up the old
lcp
parents: 0
diff changeset
   148
by (ALLGOALS (simp_tac (term_ss addsimps (POgenXH::([prem] RL idgen_lemmas)))));
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   149
by (ALLGOALS (fast_tac set_cs));
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
   150
qed "lemma2";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   151
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
   152
val [prem] = goal (the_context ())
3837
d7f033c74b38 fixed dots;
wenzelm
parents: 2035
diff changeset
   153
    "idgen(d) = d ==> lam x. x [= d";
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   154
by (rtac (allI RS po_eta) 1);
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   155
by (rtac (lemma2 RSN(2,po_coinduct)) 1);
8
c3d2c6dcf3f0 Installation of new simplfier. Previously appeared to set up the old
lcp
parents: 0
diff changeset
   156
by (simp_tac term_ss 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   157
by (ALLGOALS (fast_tac (term_cs addIs [prem,po_eta_lemma,fix_idgenfp])));
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
   158
qed "id_least_idgen";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   159
5062
fbdb0b541314 isatool fixgoal;
wenzelm
parents: 3837
diff changeset
   160
Goal  "fix(idgen) = lam x. x";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   161
by (fast_tac (term_cs addIs [eq_iff RS iffD2,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   162
                             id_idgenfp RS fix_least_idgen,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   163
                             fix_idgenfp RS id_least_idgen]) 1);
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
   164
qed "reachability";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   165
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   166
(********)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   167
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
   168
val [prem] = goal (the_context ()) "f = lam x. x ==> f`t = t";
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   169
by (rtac (prem RS sym RS subst) 1);
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   170
by (rtac applyB 1);
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
   171
qed "id_apply";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   172
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 5062
diff changeset
   173
val prems = goal (the_context ())
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   174
     "[| P(bot);  P(true);  P(false);  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   175
\        !!x y.[| P(x);  P(y) |] ==> P(<x,y>);  \
3837
d7f033c74b38 fixed dots;
wenzelm
parents: 2035
diff changeset
   176
\        !!u.(!!x. P(u(x))) ==> P(lam x. u(x));  INCL(P) |] ==> \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   177
\     P(t)";
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   178
by (rtac (reachability RS id_apply RS subst) 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   179
by (res_inst_tac [("x","t")] spec 1);
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   180
by (rtac fix_ind 1);
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   181
by (rewtac idgen_def);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   182
by (REPEAT_SOME (ares_tac [allI]));
2035
e329b36d9136 Ran expandshort; used stac instead of ssubst
paulson
parents: 1459
diff changeset
   183
by (stac applyBbot 1);
642
0db578095e6a CCL/Gfp/coinduct2, coinduct3: modified proofs to suppress deep unification
lcp
parents: 442
diff changeset
   184
by (resolve_tac prems 1);
17955
3b34516662c6 avoid shortcuts from OldGoals;
wenzelm
parents: 17456
diff changeset
   185
by (rtac (applyB RS ssubst) 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   186
by (res_inst_tac [("t","xa")] term_case 1);
8
c3d2c6dcf3f0 Installation of new simplfier. Previously appeared to set up the old
lcp
parents: 0
diff changeset
   187
by (ALLGOALS (simp_tac term_ss));
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   188
by (ALLGOALS (fast_tac (term_cs addIs ([all_INCL,INCL_subst] @ prems))));
757
2ca12511676d added qed and qed_goal[w]
clasohm
parents: 642
diff changeset
   189
qed "term_ind";