src/HOL/Trancl.ML
author nipkow
Mon Apr 27 16:45:11 1998 +0200 (1998-04-27)
changeset 4830 bd73675adbed
parent 4799 82b0ed20c2cb
child 4838 196100237656
permissions -rw-r--r--
Added a few lemmas.
Renamed expand_const -> split_const.
oheimb@4764
     1
(*  Title:      HOL/Trancl
clasohm@923
     2
    ID:         $Id$
clasohm@1465
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
clasohm@923
     4
    Copyright   1992  University of Cambridge
clasohm@923
     5
oheimb@4764
     6
For Trancl.thy.  Theorems about the transitive closure of a relation
clasohm@923
     7
*)
clasohm@923
     8
clasohm@923
     9
open Trancl;
clasohm@923
    10
clasohm@923
    11
(** The relation rtrancl **)
clasohm@923
    12
clasohm@923
    13
goal Trancl.thy "mono(%s. id Un (r O s))";
clasohm@923
    14
by (rtac monoI 1);
clasohm@923
    15
by (REPEAT (ares_tac [monoI, subset_refl, comp_mono, Un_mono] 1));
clasohm@923
    16
qed "rtrancl_fun_mono";
clasohm@923
    17
clasohm@923
    18
val rtrancl_unfold = rtrancl_fun_mono RS (rtrancl_def RS def_lfp_Tarski);
clasohm@923
    19
clasohm@923
    20
(*Reflexivity of rtrancl*)
clasohm@972
    21
goal Trancl.thy "(a,a) : r^*";
clasohm@923
    22
by (stac rtrancl_unfold 1);
paulson@2891
    23
by (Blast_tac 1);
clasohm@923
    24
qed "rtrancl_refl";
clasohm@923
    25
paulson@1921
    26
Addsimps [rtrancl_refl];
paulson@1921
    27
AddSIs   [rtrancl_refl];
paulson@1921
    28
paulson@1921
    29
clasohm@923
    30
(*Closure under composition with r*)
paulson@1921
    31
goal Trancl.thy "!!r. [| (a,b) : r^*;  (b,c) : r |] ==> (a,c) : r^*";
clasohm@923
    32
by (stac rtrancl_unfold 1);
paulson@2891
    33
by (Blast_tac 1);
clasohm@923
    34
qed "rtrancl_into_rtrancl";
clasohm@923
    35
clasohm@923
    36
(*rtrancl of r contains r*)
nipkow@1301
    37
goal Trancl.thy "!!p. p : r ==> p : r^*";
paulson@1552
    38
by (split_all_tac 1);
nipkow@1301
    39
by (etac (rtrancl_refl RS rtrancl_into_rtrancl) 1);
clasohm@923
    40
qed "r_into_rtrancl";
clasohm@923
    41
clasohm@923
    42
(*monotonicity of rtrancl*)
clasohm@923
    43
goalw Trancl.thy [rtrancl_def] "!!r s. r <= s ==> r^* <= s^*";
paulson@1552
    44
by (REPEAT(ares_tac [lfp_mono,Un_mono,comp_mono,subset_refl] 1));
clasohm@923
    45
qed "rtrancl_mono";
clasohm@923
    46
clasohm@923
    47
(** standard induction rule **)
clasohm@923
    48
clasohm@923
    49
val major::prems = goal Trancl.thy 
clasohm@972
    50
  "[| (a,b) : r^*; \
clasohm@972
    51
\     !!x. P((x,x)); \
clasohm@972
    52
\     !!x y z.[| P((x,y)); (x,y): r^*; (y,z): r |]  ==>  P((x,z)) |] \
clasohm@972
    53
\  ==>  P((a,b))";
clasohm@923
    54
by (rtac ([rtrancl_def, rtrancl_fun_mono, major] MRS def_induct) 1);
wenzelm@4089
    55
by (blast_tac (claset() addIs prems) 1);
clasohm@923
    56
qed "rtrancl_full_induct";
clasohm@923
    57
clasohm@923
    58
(*nice induction rule*)
clasohm@923
    59
val major::prems = goal Trancl.thy
clasohm@972
    60
    "[| (a::'a,b) : r^*;    \
clasohm@923
    61
\       P(a); \
clasohm@1465
    62
\       !!y z.[| (a,y) : r^*;  (y,z) : r;  P(y) |] ==> P(z) |]  \
clasohm@923
    63
\     ==> P(b)";
clasohm@923
    64
(*by induction on this formula*)
clasohm@972
    65
by (subgoal_tac "! y. (a::'a,b) = (a,y) --> P(y)" 1);
clasohm@923
    66
(*now solve first subgoal: this formula is sufficient*)
paulson@2891
    67
by (Blast_tac 1);
clasohm@923
    68
(*now do the induction*)
clasohm@923
    69
by (resolve_tac [major RS rtrancl_full_induct] 1);
wenzelm@4089
    70
by (blast_tac (claset() addIs prems) 1);
wenzelm@4089
    71
by (blast_tac (claset() addIs prems) 1);
clasohm@923
    72
qed "rtrancl_induct";
clasohm@923
    73
nipkow@1746
    74
bind_thm
nipkow@1746
    75
  ("rtrancl_induct2",
nipkow@1746
    76
   Prod_Syntax.split_rule
nipkow@1746
    77
     (read_instantiate [("a","(ax,ay)"), ("b","(bx,by)")] rtrancl_induct));
nipkow@1706
    78
clasohm@923
    79
(*transitivity of transitive closure!! -- by induction.*)
paulson@1642
    80
goalw Trancl.thy [trans_def] "trans(r^*)";
paulson@4153
    81
by Safe_tac;
paulson@1642
    82
by (eres_inst_tac [("b","z")] rtrancl_induct 1);
wenzelm@4089
    83
by (ALLGOALS(blast_tac (claset() addIs [rtrancl_into_rtrancl])));
paulson@1642
    84
qed "trans_rtrancl";
paulson@1642
    85
paulson@1642
    86
bind_thm ("rtrancl_trans", trans_rtrancl RS transD);
paulson@1642
    87
clasohm@923
    88
clasohm@923
    89
(*elimination of rtrancl -- by induction on a special formula*)
clasohm@923
    90
val major::prems = goal Trancl.thy
clasohm@1465
    91
    "[| (a::'a,b) : r^*;  (a = b) ==> P;        \
clasohm@1465
    92
\       !!y.[| (a,y) : r^*; (y,b) : r |] ==> P  \
clasohm@923
    93
\    |] ==> P";
clasohm@972
    94
by (subgoal_tac "(a::'a) = b  | (? y. (a,y) : r^* & (y,b) : r)" 1);
clasohm@923
    95
by (rtac (major RS rtrancl_induct) 2);
wenzelm@4089
    96
by (blast_tac (claset() addIs prems) 2);
wenzelm@4089
    97
by (blast_tac (claset() addIs prems) 2);
clasohm@923
    98
by (REPEAT (eresolve_tac ([asm_rl,exE,disjE,conjE]@prems) 1));
clasohm@923
    99
qed "rtranclE";
clasohm@923
   100
paulson@1642
   101
bind_thm ("rtrancl_into_rtrancl2", r_into_rtrancl RS rtrancl_trans);
paulson@1642
   102
paulson@1642
   103
paulson@1642
   104
(*** More r^* equations and inclusions ***)
paulson@1642
   105
paulson@1642
   106
goal Trancl.thy "(r^*)^* = r^*";
paulson@1642
   107
by (rtac set_ext 1);
paulson@1642
   108
by (res_inst_tac [("p","x")] PairE 1);
paulson@1642
   109
by (hyp_subst_tac 1);
paulson@1642
   110
by (rtac iffI 1);
paulson@1552
   111
by (etac rtrancl_induct 1);
paulson@1642
   112
by (rtac rtrancl_refl 1);
wenzelm@4089
   113
by (blast_tac (claset() addIs [rtrancl_trans]) 1);
paulson@1642
   114
by (etac r_into_rtrancl 1);
paulson@1642
   115
qed "rtrancl_idemp";
paulson@1642
   116
Addsimps [rtrancl_idemp];
paulson@1642
   117
nipkow@4830
   118
goal thy "R^* O R^* = R^*";
nipkow@4830
   119
br set_ext 1;
nipkow@4830
   120
by(split_all_tac 1);
nipkow@4830
   121
by(blast_tac (claset() addIs [rtrancl_trans]) 1);
nipkow@4830
   122
qed "rtrancl_idemp_self_comp";
nipkow@4830
   123
Addsimps [rtrancl_idemp_self_comp];
nipkow@4830
   124
paulson@1642
   125
goal Trancl.thy "!!r s. r <= s^* ==> r^* <= s^*";
paulson@2031
   126
by (dtac rtrancl_mono 1);
paulson@1642
   127
by (Asm_full_simp_tac 1);
paulson@1642
   128
qed "rtrancl_subset_rtrancl";
paulson@1642
   129
paulson@1642
   130
goal Trancl.thy "!!R. [| R <= S; S <= R^* |] ==> S^* = R^*";
paulson@1642
   131
by (dtac rtrancl_mono 1);
paulson@1642
   132
by (dtac rtrancl_mono 1);
paulson@1642
   133
by (Asm_full_simp_tac 1);
paulson@2891
   134
by (Blast_tac 1);
paulson@1642
   135
qed "rtrancl_subset";
paulson@1642
   136
paulson@1642
   137
goal Trancl.thy "!!R. (R^* Un S^*)^* = (R Un S)^*";
wenzelm@4089
   138
by (blast_tac (claset() addSIs [rtrancl_subset]
paulson@2922
   139
                       addIs [r_into_rtrancl, rtrancl_mono RS subsetD]) 1);
paulson@1642
   140
qed "rtrancl_Un_rtrancl";
nipkow@1496
   141
paulson@1642
   142
goal Trancl.thy "(R^=)^* = R^*";
wenzelm@4089
   143
by (blast_tac (claset() addSIs [rtrancl_subset]
paulson@2922
   144
                       addIs  [rtrancl_refl, r_into_rtrancl]) 1);
paulson@1642
   145
qed "rtrancl_reflcl";
paulson@1642
   146
Addsimps [rtrancl_reflcl];
paulson@1642
   147
nipkow@3439
   148
goal Trancl.thy "!!r. (x,y) : (r^-1)^* ==> (x,y) : (r^*)^-1";
paulson@4746
   149
by (rtac converseI 1);
paulson@1642
   150
by (etac rtrancl_induct 1);
paulson@1642
   151
by (rtac rtrancl_refl 1);
wenzelm@4089
   152
by (blast_tac (claset() addIs [r_into_rtrancl,rtrancl_trans]) 1);
paulson@4746
   153
qed "rtrancl_converseD";
paulson@1642
   154
nipkow@3439
   155
goal Trancl.thy "!!r. (x,y) : (r^*)^-1 ==> (x,y) : (r^-1)^*";
paulson@4746
   156
by (dtac converseD 1);
paulson@1642
   157
by (etac rtrancl_induct 1);
paulson@1642
   158
by (rtac rtrancl_refl 1);
wenzelm@4089
   159
by (blast_tac (claset() addIs [r_into_rtrancl,rtrancl_trans]) 1);
paulson@4746
   160
qed "rtrancl_converseI";
paulson@1642
   161
nipkow@3439
   162
goal Trancl.thy "(r^-1)^* = (r^*)^-1";
oheimb@4799
   163
by (safe_tac (claset() addSDs [rtrancl_converseD] addSIs [rtrancl_converseI]
oheimb@4799
   164
			addSaltern ("split_all_tac", split_all_tac)));
paulson@4746
   165
qed "rtrancl_converse";
paulson@1642
   166
nipkow@1706
   167
val major::prems = goal Trancl.thy
nipkow@1706
   168
    "[| (a,b) : r^*; P(b); \
nipkow@1706
   169
\       !!y z.[| (y,z) : r;  (z,b) : r^*;  P(z) |] ==> P(y) |]  \
nipkow@1706
   170
\     ==> P(a)";
paulson@4746
   171
by (rtac ((major RS converseI RS rtrancl_converseI) RS rtrancl_induct) 1);
paulson@2031
   172
by (resolve_tac prems 1);
paulson@4746
   173
by (blast_tac (claset() addIs prems addSDs[rtrancl_converseD])1);
paulson@4746
   174
qed "converse_rtrancl_induct";
nipkow@1706
   175
nipkow@1706
   176
val prems = goal Trancl.thy
nipkow@1706
   177
 "[| ((a,b),(c,d)) : r^*; P c d; \
nipkow@1706
   178
\    !!x y z u.[| ((x,y),(z,u)) : r;  ((z,u),(c,d)) : r^*;  P z u |] ==> P x y\
nipkow@1706
   179
\ |] ==> P a b";
paulson@2031
   180
by (res_inst_tac[("R","P")]splitD 1);
paulson@4746
   181
by (res_inst_tac[("P","split P")]converse_rtrancl_induct 1);
paulson@2031
   182
by (resolve_tac prems 1);
paulson@2031
   183
by (Simp_tac 1);
paulson@2031
   184
by (resolve_tac prems 1);
paulson@2031
   185
by (split_all_tac 1);
paulson@2031
   186
by (Asm_full_simp_tac 1);
paulson@2031
   187
by (REPEAT(ares_tac prems 1));
paulson@4746
   188
qed "converse_rtrancl_induct2";
nipkow@1496
   189
nipkow@3413
   190
val major::prems = goal Trancl.thy
nipkow@3413
   191
 "[| (x,z):r^*; \
nipkow@3413
   192
\    x=z ==> P; \
nipkow@3413
   193
\    !!y. [| (x,y):r; (y,z):r^* |] ==> P \
nipkow@3413
   194
\ |] ==> P";
nipkow@3413
   195
by (subgoal_tac "x = z  | (? y. (x,y) : r & (y,z) : r^*)" 1);
paulson@4746
   196
by (rtac (major RS converse_rtrancl_induct) 2);
wenzelm@4089
   197
by (blast_tac (claset() addIs prems) 2);
wenzelm@4089
   198
by (blast_tac (claset() addIs prems) 2);
nipkow@3413
   199
by (REPEAT (eresolve_tac ([asm_rl,exE,disjE,conjE]@prems) 1));
nipkow@3413
   200
qed "rtranclE2";
nipkow@3413
   201
nipkow@3413
   202
goal Trancl.thy "r O r^* = r^* O r";
wenzelm@4089
   203
by (blast_tac (claset() addEs [rtranclE, rtranclE2] 
paulson@3723
   204
	               addIs [rtrancl_into_rtrancl, rtrancl_into_rtrancl2]) 1);
nipkow@3413
   205
qed "r_comp_rtrancl_eq";
nipkow@3413
   206
clasohm@923
   207
clasohm@923
   208
(**** The relation trancl ****)
clasohm@923
   209
nipkow@3413
   210
goalw Trancl.thy [trancl_def] "!!p.[| p:r^+; r <= s |] ==> p:s^+";
wenzelm@4089
   211
by (blast_tac (claset() addIs [rtrancl_mono RS subsetD]) 1);
nipkow@3413
   212
qed "trancl_mono";
nipkow@3413
   213
clasohm@923
   214
(** Conversions between trancl and rtrancl **)
clasohm@923
   215
oheimb@4764
   216
goalw Trancl.thy [trancl_def]
oheimb@4764
   217
    "!!p. p : r^+ ==> p : r^*";
oheimb@4764
   218
by (split_all_tac 1);
oheimb@4764
   219
by (etac compEpair 1);
clasohm@923
   220
by (REPEAT (ares_tac [rtrancl_into_rtrancl] 1));
clasohm@923
   221
qed "trancl_into_rtrancl";
clasohm@923
   222
clasohm@923
   223
(*r^+ contains r*)
oheimb@4764
   224
goalw Trancl.thy [trancl_def]
oheimb@4764
   225
   "!!p. p : r ==> p : r^+";
oheimb@4764
   226
by (split_all_tac 1);
clasohm@923
   227
by (REPEAT (ares_tac [prem,compI,rtrancl_refl] 1));
clasohm@923
   228
qed "r_into_trancl";
clasohm@923
   229
clasohm@923
   230
(*intro rule by definition: from rtrancl and r*)
clasohm@923
   231
val prems = goalw Trancl.thy [trancl_def]
clasohm@972
   232
    "[| (a,b) : r^*;  (b,c) : r |]   ==>  (a,c) : r^+";
clasohm@923
   233
by (REPEAT (resolve_tac ([compI]@prems) 1));
clasohm@923
   234
qed "rtrancl_into_trancl1";
clasohm@923
   235
clasohm@923
   236
(*intro rule from r and rtrancl*)
clasohm@923
   237
val prems = goal Trancl.thy
clasohm@972
   238
    "[| (a,b) : r;  (b,c) : r^* |]   ==>  (a,c) : r^+";
clasohm@923
   239
by (resolve_tac (prems RL [rtranclE]) 1);
clasohm@923
   240
by (etac subst 1);
clasohm@923
   241
by (resolve_tac (prems RL [r_into_trancl]) 1);
nipkow@1122
   242
by (rtac (rtrancl_trans RS rtrancl_into_trancl1) 1);
clasohm@923
   243
by (REPEAT (ares_tac (prems@[r_into_rtrancl]) 1));
clasohm@923
   244
qed "rtrancl_into_trancl2";
clasohm@923
   245
paulson@1642
   246
(*Nice induction rule for trancl*)
paulson@1642
   247
val major::prems = goal Trancl.thy
paulson@1642
   248
  "[| (a,b) : r^+;                                      \
paulson@1642
   249
\     !!y.  [| (a,y) : r |] ==> P(y);                   \
paulson@1642
   250
\     !!y z.[| (a,y) : r^+;  (y,z) : r;  P(y) |] ==> P(z)       \
paulson@1642
   251
\  |] ==> P(b)";
paulson@1642
   252
by (rtac (rewrite_rule [trancl_def] major  RS  compEpair) 1);
paulson@1642
   253
(*by induction on this formula*)
paulson@1642
   254
by (subgoal_tac "ALL z. (y,z) : r --> P(z)" 1);
paulson@1642
   255
(*now solve first subgoal: this formula is sufficient*)
paulson@2891
   256
by (Blast_tac 1);
paulson@1642
   257
by (etac rtrancl_induct 1);
wenzelm@4089
   258
by (ALLGOALS (blast_tac (claset() addIs (rtrancl_into_trancl1::prems))));
paulson@1642
   259
qed "trancl_induct";
paulson@1642
   260
clasohm@923
   261
(*elimination of r^+ -- NOT an induction rule*)
clasohm@923
   262
val major::prems = goal Trancl.thy
clasohm@972
   263
    "[| (a::'a,b) : r^+;  \
clasohm@972
   264
\       (a,b) : r ==> P; \
clasohm@1465
   265
\       !!y.[| (a,y) : r^+;  (y,b) : r |] ==> P  \
clasohm@923
   266
\    |] ==> P";
clasohm@972
   267
by (subgoal_tac "(a::'a,b) : r | (? y. (a,y) : r^+  &  (y,b) : r)" 1);
clasohm@923
   268
by (REPEAT (eresolve_tac ([asm_rl,disjE,exE,conjE]@prems) 1));
clasohm@923
   269
by (rtac (rewrite_rule [trancl_def] major RS compEpair) 1);
clasohm@923
   270
by (etac rtranclE 1);
paulson@2891
   271
by (Blast_tac 1);
wenzelm@4089
   272
by (blast_tac (claset() addSIs [rtrancl_into_trancl1]) 1);
clasohm@923
   273
qed "tranclE";
clasohm@923
   274
clasohm@923
   275
(*Transitivity of r^+.
clasohm@923
   276
  Proved by unfolding since it uses transitivity of rtrancl. *)
clasohm@923
   277
goalw Trancl.thy [trancl_def] "trans(r^+)";
clasohm@923
   278
by (rtac transI 1);
clasohm@923
   279
by (REPEAT (etac compEpair 1));
nipkow@1122
   280
by (rtac (rtrancl_into_rtrancl RS (rtrancl_trans RS compI)) 1);
clasohm@923
   281
by (REPEAT (assume_tac 1));
clasohm@923
   282
qed "trans_trancl";
clasohm@923
   283
paulson@1642
   284
bind_thm ("trancl_trans", trans_trancl RS transD);
paulson@1642
   285
nipkow@3413
   286
goalw Trancl.thy [trancl_def]
nipkow@3413
   287
  "!!r. [| (x,y):r^*; (y,z):r^+ |] ==> (x,z):r^+";
wenzelm@4089
   288
by (blast_tac (claset() addIs [rtrancl_trans,r_into_rtrancl]) 1);
nipkow@3413
   289
qed "rtrancl_trancl_trancl";
nipkow@3413
   290
clasohm@923
   291
val prems = goal Trancl.thy
clasohm@972
   292
    "[| (a,b) : r;  (b,c) : r^+ |]   ==>  (a,c) : r^+";
clasohm@923
   293
by (rtac (r_into_trancl RS (trans_trancl RS transD)) 1);
clasohm@923
   294
by (resolve_tac prems 1);
clasohm@923
   295
by (resolve_tac prems 1);
clasohm@923
   296
qed "trancl_into_trancl2";
clasohm@923
   297
nipkow@3413
   298
(* primitive recursion for trancl over finite relations: *)
nipkow@3413
   299
goal Trancl.thy "(insert (y,x) r)^+ = r^+ Un {(a,b). (a,y):r^* & (x,b):r^*}";
paulson@3457
   300
by (rtac equalityI 1);
paulson@3457
   301
 by (rtac subsetI 1);
paulson@3457
   302
 by (split_all_tac 1);
paulson@3457
   303
 by (etac trancl_induct 1);
wenzelm@4089
   304
  by (blast_tac (claset() addIs [r_into_trancl]) 1);
wenzelm@4089
   305
 by (blast_tac (claset() addIs
nipkow@3413
   306
     [rtrancl_into_trancl1,trancl_into_rtrancl,r_into_trancl,trancl_trans]) 1);
paulson@3457
   307
by (rtac subsetI 1);
wenzelm@4089
   308
by (blast_tac (claset() addIs
nipkow@3413
   309
     [rtrancl_into_trancl2, rtrancl_trancl_trancl,
nipkow@3413
   310
      impOfSubs rtrancl_mono, trancl_mono]) 1);
nipkow@3413
   311
qed "trancl_insert";
nipkow@3413
   312
nipkow@3439
   313
goalw Trancl.thy [trancl_def] "(r^-1)^+ = (r^+)^-1";
paulson@4746
   314
by (simp_tac (simpset() addsimps [rtrancl_converse,converse_comp]) 1);
oheimb@4764
   315
by (simp_tac (simpset() addsimps [rtrancl_converse RS sym,r_comp_rtrancl_eq])1);
paulson@4746
   316
qed "trancl_converse";
nipkow@3413
   317
oheimb@4764
   318
val irrefl_tranclI = prove_goal Trancl.thy 
oheimb@4764
   319
	"!!r. r^-1 Int r^+ = {} ==> !x. (x, x) ~: r^+" (K [
oheimb@4764
   320
	rtac allI 1,
oheimb@4764
   321
	subgoal_tac "!y. (x, y) : r^+ --> x~=y" 1,
oheimb@4764
   322
	 Fast_tac 1,
oheimb@4764
   323
	strip_tac 1,
oheimb@4764
   324
	etac trancl_induct 1,
oheimb@4764
   325
	 auto_tac (claset() addEs [equals0D, r_into_trancl], simpset())]);
nipkow@1130
   326
clasohm@923
   327
val major::prems = goal Trancl.thy
paulson@1642
   328
    "[| (a,b) : r^*;  r <= A Times A |] ==> a=b | a:A";
clasohm@923
   329
by (cut_facts_tac prems 1);
clasohm@923
   330
by (rtac (major RS rtrancl_induct) 1);
clasohm@923
   331
by (rtac (refl RS disjI1) 1);
paulson@2891
   332
by (Blast_tac 1);
paulson@1642
   333
val lemma = result();
clasohm@923
   334
clasohm@923
   335
goalw Trancl.thy [trancl_def]
paulson@1642
   336
    "!!r. r <= A Times A ==> r^+ <= A Times A";
wenzelm@4089
   337
by (blast_tac (claset() addSDs [lemma]) 1);
clasohm@923
   338
qed "trancl_subset_Sigma";
nipkow@1130
   339
oheimb@4764
   340
oheimb@4764
   341
goal Trancl.thy "(r^+)^= = r^*";
oheimb@4799
   342
by (safe_tac (claset() addSaltern ("split_all_tac", split_all_tac)));
oheimb@4764
   343
by  (etac trancl_into_rtrancl 1);
oheimb@4764
   344
by (etac rtranclE 1);
oheimb@4772
   345
by  (Auto_tac );
oheimb@4764
   346
by (etac rtrancl_into_trancl1 1);
oheimb@4764
   347
ba 1;
oheimb@4764
   348
qed "reflcl_trancl";
oheimb@4764
   349
Addsimps[reflcl_trancl];
oheimb@4764
   350
oheimb@4764
   351
goal Trancl.thy "(r^=)^+ = r^*";
oheimb@4799
   352
by (safe_tac (claset() addSaltern ("split_all_tac", split_all_tac)));
oheimb@4764
   353
by  (dtac trancl_into_rtrancl 1);
oheimb@4764
   354
by  (Asm_full_simp_tac 1);
oheimb@4764
   355
by (etac rtranclE 1);
oheimb@4764
   356
by  Safe_tac;
oheimb@4764
   357
by  (rtac r_into_trancl 1);
oheimb@4764
   358
by  (Simp_tac 1);
oheimb@4764
   359
by (rtac rtrancl_into_trancl1 1);
oheimb@4764
   360
by (etac (rtrancl_reflcl RS equalityD2 RS subsetD) 1);
oheimb@4764
   361
by (Fast_tac 1);
oheimb@4764
   362
qed "trancl_reflcl";
oheimb@4764
   363
Addsimps[trancl_reflcl];
oheimb@4764
   364
oheimb@4764
   365
qed_goal "trancl_empty" Trancl.thy "{}^+ = {}" 
oheimb@4764
   366
  (K [auto_tac (claset() addEs [trancl_induct], simpset())]);
oheimb@4764
   367
Addsimps[trancl_empty];
oheimb@4764
   368
oheimb@4764
   369
qed_goal "rtrancl_empty" Trancl.thy "{}^* = id" 
oheimb@4764
   370
  (K [rtac (reflcl_trancl RS subst) 1, Simp_tac 1]);
oheimb@4764
   371
Addsimps[rtrancl_empty];