src/CCL/trancl.ML
author wenzelm
Thu, 30 Nov 2000 20:04:49 +0100
changeset 10549 5e19ae8d9582
parent 0 a5a9c433f639
permissions -rw-r--r--
cases/induct: tuned handling of facts ('consumes');
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     1
(*  Title: 	CCL/trancl
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
For trancl.thy.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
Modified version of
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
    Title: 	HOL/trancl.ML
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
    Copyright   1992  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
open Trancl;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
(** Natural deduction for trans(r) **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
val prems = goalw Trancl.thy [trans_def]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
    "(!! x y z. [| <x,y>:r;  <y,z>:r |] ==> <x,z>:r) ==> trans(r)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
by (REPEAT (ares_tac (prems@[allI,impI]) 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
val transI = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
val major::prems = goalw Trancl.thy [trans_def]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
    "[| trans(r);  <a,b>:r;  <b,c>:r |] ==> <a,c>:r";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
by (cut_facts_tac [major] 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
by (fast_tac (FOL_cs addIs prems) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
val transD = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
(** Identity relation **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
goalw Trancl.thy [id_def] "<a,a> : id";  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
by (rtac CollectI 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
by (rtac exI 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
by (rtac refl 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
val idI = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
val major::prems = goalw Trancl.thy [id_def]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
    "[| p: id;  !!x.[| p = <x,x> |] ==> P  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
\    |] ==>  P";  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
by (rtac (major RS CollectE) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
by (etac exE 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
by (eresolve_tac prems 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
val idE = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
(** Composition of two relations **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
val prems = goalw Trancl.thy [comp_def]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
    "[| <a,b>:s; <b,c>:r |] ==> <a,c> : r O s";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
by (fast_tac (set_cs addIs prems) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
val compI = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    50
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
(*proof requires higher-level assumptions or a delaying of hyp_subst_tac*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
val prems = goalw Trancl.thy [comp_def]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
    "[| xz : r O s;  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
\       !!x y z. [| xz = <x,z>;  <x,y>:s;  <y,z>:r |] ==> P \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
\    |] ==> P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    56
by (cut_facts_tac prems 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
by (REPEAT (eresolve_tac [CollectE, exE, conjE] 1 ORELSE ares_tac prems 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
val compE = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
val prems = goal Trancl.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
    "[| <a,c> : r O s;  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
\       !!y. [| <a,y>:s;  <y,c>:r |] ==> P \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
\    |] ==> P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
by (rtac compE 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
by (REPEAT (ares_tac prems 1 ORELSE eresolve_tac [pair_inject,ssubst] 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
val compEpair = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
val comp_cs = set_cs addIs [compI,idI] 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
		       addEs [compE,idE] 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
		       addSEs [pair_inject];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
val prems = goal Trancl.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
    "[| r'<=r; s'<=s |] ==> (r' O s') <= (r O s)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
by (cut_facts_tac prems 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
by (fast_tac comp_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
val comp_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
(** The relation rtrancl **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
goal Trancl.thy "mono(%s. id Un (r O s))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
by (rtac monoI 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
by (REPEAT (ares_tac [monoI, subset_refl, comp_mono, Un_mono] 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    83
val rtrancl_fun_mono = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    85
val rtrancl_unfold = rtrancl_fun_mono RS (rtrancl_def RS def_lfp_Tarski);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    87
(*Reflexivity of rtrancl*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    88
goal Trancl.thy "<a,a> : r^*";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    89
br (rtrancl_unfold RS ssubst) 1;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    90
by (fast_tac comp_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    91
val rtrancl_refl = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    92
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
(*Closure under composition with r*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    94
val prems = goal Trancl.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    95
    "[| <a,b> : r^*;  <b,c> : r |] ==> <a,c> : r^*";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    96
br (rtrancl_unfold RS ssubst) 1;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    97
by (fast_tac (comp_cs addIs prems) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    98
val rtrancl_into_rtrancl = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    99
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   100
(*rtrancl of r contains r*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   101
val [prem] = goal Trancl.thy "[| <a,b> : r |] ==> <a,b> : r^*";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   102
by (rtac (rtrancl_refl RS rtrancl_into_rtrancl) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
by (rtac prem 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   104
val r_into_rtrancl = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   106
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   107
(** standard induction rule **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   108
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   109
val major::prems = goal Trancl.thy 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   110
  "[| <a,b> : r^*; \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   111
\     !!x. P(<x,x>); \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   112
\     !!x y z.[| P(<x,y>); <x,y>: r^*; <y,z>: r |]  ==>  P(<x,z>) |] \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   113
\  ==>  P(<a,b>)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   114
by (rtac (major RS (rtrancl_def RS def_induct)) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   115
by (rtac rtrancl_fun_mono 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   116
by (fast_tac (comp_cs addIs prems) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   117
val rtrancl_full_induct = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   118
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   119
(*nice induction rule*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   120
val major::prems = goal Trancl.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   121
    "[| <a,b> : r^*;    \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   122
\       P(a); \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   123
\	!!y z.[| <a,y> : r^*;  <y,z> : r;  P(y) |] ==> P(z) |]  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   124
\     ==> P(b)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   125
(*by induction on this formula*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   126
by (subgoal_tac "ALL y. <a,b> = <a,y> --> P(y)" 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   127
(*now solve first subgoal: this formula is sufficient*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   128
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   129
(*now do the induction*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   130
by (resolve_tac [major RS rtrancl_full_induct] 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   131
by (fast_tac (comp_cs addIs prems) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   132
by (fast_tac (comp_cs addIs prems) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   133
val rtrancl_induct = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   134
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   135
(*transitivity of transitive closure!! -- by induction.*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   136
goal Trancl.thy "trans(r^*)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   137
by (rtac transI 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   138
by (res_inst_tac [("b","z")] rtrancl_induct 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   139
by (DEPTH_SOLVE (eresolve_tac [asm_rl, rtrancl_into_rtrancl] 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   140
val trans_rtrancl = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   141
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   142
(*elimination of rtrancl -- by induction on a special formula*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   143
val major::prems = goal Trancl.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   144
    "[| <a,b> : r^*;  (a = b) ==> P; \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   145
\	!!y.[| <a,y> : r^*; <y,b> : r |] ==> P |] \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   146
\    ==> P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   147
by (subgoal_tac "a = b  | (EX y. <a,y> : r^* & <y,b> : r)" 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   148
by (rtac (major RS rtrancl_induct) 2);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   149
by (fast_tac (set_cs addIs prems) 2);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   150
by (fast_tac (set_cs addIs prems) 2);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   151
by (REPEAT (eresolve_tac ([asm_rl,exE,disjE,conjE]@prems) 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   152
val rtranclE = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   153
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   154
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   155
(**** The relation trancl ****)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   156
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   157
(** Conversions between trancl and rtrancl **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   158
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   159
val [major] = goalw Trancl.thy [trancl_def]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   160
    "[| <a,b> : r^+ |] ==> <a,b> : r^*";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   161
by (resolve_tac [major RS compEpair] 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   162
by (REPEAT (ares_tac [rtrancl_into_rtrancl] 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   163
val trancl_into_rtrancl = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   164
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   165
(*r^+ contains r*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   166
val [prem] = goalw Trancl.thy [trancl_def]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   167
   "[| <a,b> : r |] ==> <a,b> : r^+";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   168
by (REPEAT (ares_tac [prem,compI,rtrancl_refl] 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   169
val r_into_trancl = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   170
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   171
(*intro rule by definition: from rtrancl and r*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   172
val prems = goalw Trancl.thy [trancl_def]
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   173
    "[| <a,b> : r^*;  <b,c> : r |]   ==>  <a,c> : r^+";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   174
by (REPEAT (resolve_tac ([compI]@prems) 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   175
val rtrancl_into_trancl1 = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   176
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   177
(*intro rule from r and rtrancl*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   178
val prems = goal Trancl.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   179
    "[| <a,b> : r;  <b,c> : r^* |]   ==>  <a,c> : r^+";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   180
by (resolve_tac (prems RL [rtranclE]) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   181
by (etac subst 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   182
by (resolve_tac (prems RL [r_into_trancl]) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   183
by (rtac (trans_rtrancl RS transD RS rtrancl_into_trancl1) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   184
by (REPEAT (ares_tac (prems@[r_into_rtrancl]) 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   185
val rtrancl_into_trancl2 = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   186
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   187
(*elimination of r^+ -- NOT an induction rule*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   188
val major::prems = goal Trancl.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   189
    "[| <a,b> : r^+;  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   190
\       <a,b> : r ==> P; \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   191
\	!!y.[| <a,y> : r^+;  <y,b> : r |] ==> P  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   192
\    |] ==> P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   193
by (subgoal_tac "<a,b> : r | (EX y. <a,y> : r^+  &  <y,b> : r)" 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   194
by (REPEAT (eresolve_tac ([asm_rl,disjE,exE,conjE]@prems) 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   195
by (rtac (rewrite_rule [trancl_def] major RS compEpair) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   196
by (etac rtranclE 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   197
by (fast_tac comp_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   198
by (fast_tac (comp_cs addSIs [rtrancl_into_trancl1]) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   199
val tranclE = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   200
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   201
(*Transitivity of r^+.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   202
  Proved by unfolding since it uses transitivity of rtrancl. *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   203
goalw Trancl.thy [trancl_def] "trans(r^+)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   204
by (rtac transI 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   205
by (REPEAT (etac compEpair 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   206
by (rtac (rtrancl_into_rtrancl RS (trans_rtrancl RS transD RS compI)) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   207
by (REPEAT (assume_tac 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   208
val trans_trancl = result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   209
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   210
val prems = goal Trancl.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   211
    "[| <a,b> : r;  <b,c> : r^+ |]   ==>  <a,c> : r^+";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   212
by (rtac (r_into_trancl RS (trans_trancl RS transD)) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   213
by (resolve_tac prems 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   214
by (resolve_tac prems 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   215
val trancl_into_trancl2 = result();