src/HOL/Transitive_Closure.ML
author nipkow
Fri, 24 Nov 2000 16:49:27 +0100
changeset 10519 ade64af4c57c
parent 10213 01c2744a3786
permissions -rw-r--r--
hide many names from Datatype_Universe.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/Transitive_Closure
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     2
    ID:         $Id$
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     4
    Copyright   1992  University of Cambridge
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     5
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     6
Theorems about the transitive closure of a relation
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     7
*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     8
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     9
(** The relation rtrancl **)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    10
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    11
section "^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    12
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    13
Goal "mono(%s. Id Un (r O s))";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    14
by (rtac monoI 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    15
by (REPEAT (ares_tac [monoI, subset_refl, comp_mono, Un_mono] 1));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    16
qed "rtrancl_fun_mono";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    17
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    18
bind_thm ("rtrancl_unfold", rtrancl_fun_mono RS (rtrancl_def RS def_lfp_unfold));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    19
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    20
(*Reflexivity of rtrancl*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    21
Goal "(a,a) : r^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    22
by (stac rtrancl_unfold 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    23
by (Blast_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    24
qed "rtrancl_refl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    25
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    26
Addsimps [rtrancl_refl];
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    27
AddSIs   [rtrancl_refl];
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    28
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    29
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    30
(*Closure under composition with r*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    31
Goal "[| (a,b) : r^*;  (b,c) : r |] ==> (a,c) : r^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    32
by (stac rtrancl_unfold 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    33
by (Blast_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    34
qed "rtrancl_into_rtrancl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    35
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    36
(*rtrancl of r contains r*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    37
Goal "!!p. p : r ==> p : r^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    38
by (split_all_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    39
by (etac (rtrancl_refl RS rtrancl_into_rtrancl) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    40
qed "r_into_rtrancl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    41
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    42
AddIs [r_into_rtrancl];
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    43
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    44
(*monotonicity of rtrancl*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    45
Goalw [rtrancl_def] "r <= s ==> r^* <= s^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    46
by (REPEAT(ares_tac [lfp_mono,Un_mono,comp_mono,subset_refl] 1));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    47
qed "rtrancl_mono";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    48
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    49
(** standard induction rule **)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    50
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    51
val major::prems = Goal 
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    52
  "[| (a,b) : r^*; \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    53
\     !!x. P(x,x); \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    54
\     !!x y z.[| P(x,y); (x,y): r^*; (y,z): r |]  ==>  P(x,z) |] \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    55
\  ==>  P(a,b)";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    56
by (rtac ([rtrancl_def, rtrancl_fun_mono, major] MRS def_lfp_induct) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    57
by (blast_tac (claset() addIs prems) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    58
qed "rtrancl_full_induct";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    59
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    60
(*nice induction rule*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    61
val major::prems = Goal
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    62
    "[| (a::'a,b) : r^*;    \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    63
\       P(a); \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    64
\       !!y z.[| (a,y) : r^*;  (y,z) : r;  P(y) |] ==> P(z) |]  \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    65
\     ==> P(b)";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    66
(*by induction on this formula*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    67
by (subgoal_tac "! y. (a::'a,b) = (a,y) --> P(y)" 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    68
(*now solve first subgoal: this formula is sufficient*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    69
by (Blast_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    70
(*now do the induction*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    71
by (resolve_tac [major RS rtrancl_full_induct] 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    72
by (blast_tac (claset() addIs prems) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    73
by (blast_tac (claset() addIs prems) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    74
qed "rtrancl_induct";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    75
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    76
bind_thm ("rtrancl_induct2", split_rule
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    77
  (read_instantiate [("a","(ax,ay)"), ("b","(bx,by)")] rtrancl_induct));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    78
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    79
(*transitivity of transitive closure!! -- by induction.*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    80
Goalw [trans_def] "trans(r^*)";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    81
by Safe_tac;
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    82
by (eres_inst_tac [("b","z")] rtrancl_induct 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    83
by (ALLGOALS(blast_tac (claset() addIs [rtrancl_into_rtrancl])));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    84
qed "trans_rtrancl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    85
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    86
bind_thm ("rtrancl_trans", trans_rtrancl RS transD);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    87
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    88
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    89
(*elimination of rtrancl -- by induction on a special formula*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    90
val major::prems = Goal
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    91
    "[| (a::'a,b) : r^*;  (a = b) ==> P;        \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    92
\       !!y.[| (a,y) : r^*; (y,b) : r |] ==> P  \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    93
\    |] ==> P";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    94
by (subgoal_tac "(a::'a) = b  | (? y. (a,y) : r^* & (y,b) : r)" 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    95
by (rtac (major RS rtrancl_induct) 2);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    96
by (blast_tac (claset() addIs prems) 2);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    97
by (blast_tac (claset() addIs prems) 2);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    98
by (REPEAT (eresolve_tac ([asm_rl,exE,disjE,conjE]@prems) 1));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    99
qed "rtranclE";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   100
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   101
bind_thm ("rtrancl_into_rtrancl2", r_into_rtrancl RS rtrancl_trans);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   102
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   103
(*** More r^* equations and inclusions ***)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   104
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   105
Goal "(r^*)^* = r^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   106
by Auto_tac;
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   107
by (etac rtrancl_induct 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   108
by (rtac rtrancl_refl 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   109
by (blast_tac (claset() addIs [rtrancl_trans]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   110
qed "rtrancl_idemp";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   111
Addsimps [rtrancl_idemp];
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   112
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   113
Goal "R^* O R^* = R^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   114
by (rtac set_ext 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   115
by (split_all_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   116
by (blast_tac (claset() addIs [rtrancl_trans]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   117
qed "rtrancl_idemp_self_comp";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   118
Addsimps [rtrancl_idemp_self_comp];
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   119
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   120
Goal "r <= s^* ==> r^* <= s^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   121
by (dtac rtrancl_mono 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   122
by (Asm_full_simp_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   123
qed "rtrancl_subset_rtrancl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   124
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   125
Goal "[| R <= S; S <= R^* |] ==> S^* = R^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   126
by (dtac rtrancl_mono 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   127
by (dtac rtrancl_mono 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   128
by (Asm_full_simp_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   129
by (Blast_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   130
qed "rtrancl_subset";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   131
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   132
Goal "(R^* Un S^*)^* = (R Un S)^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   133
by (blast_tac (claset() addSIs [rtrancl_subset]
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   134
                        addIs [r_into_rtrancl, rtrancl_mono RS subsetD]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   135
qed "rtrancl_Un_rtrancl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   136
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   137
Goal "(R^=)^* = R^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   138
by (blast_tac (claset() addSIs [rtrancl_subset] addIs [r_into_rtrancl]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   139
qed "rtrancl_reflcl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   140
Addsimps [rtrancl_reflcl];
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   141
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   142
Goal "(r - Id)^* = r^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   143
by (rtac sym 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   144
by (rtac rtrancl_subset 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   145
 by (Blast_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   146
by (Clarify_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   147
by (rename_tac "a b" 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   148
by (case_tac "a=b" 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   149
 by (Blast_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   150
by (blast_tac (claset() addSIs [r_into_rtrancl]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   151
qed "rtrancl_r_diff_Id";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   152
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   153
Goal "(x,y) : (r^-1)^* ==> (y,x) : r^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   154
by (etac rtrancl_induct 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   155
by (rtac rtrancl_refl 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   156
by (blast_tac (claset() addIs [rtrancl_trans]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   157
qed "rtrancl_converseD";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   158
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   159
Goal "(y,x) : r^* ==> (x,y) : (r^-1)^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   160
by (etac rtrancl_induct 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   161
by (rtac rtrancl_refl 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   162
by (blast_tac (claset() addIs [rtrancl_trans]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   163
qed "rtrancl_converseI";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   164
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   165
Goal "(r^-1)^* = (r^*)^-1";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   166
(*blast_tac fails: the split_all_tac wrapper must be called to convert
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   167
  the set element to a pair*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   168
by (safe_tac (claset() addSDs [rtrancl_converseD] addSIs [rtrancl_converseI]));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   169
qed "rtrancl_converse";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   170
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   171
val major::prems = Goal
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   172
    "[| (a,b) : r^*; P(b); \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   173
\       !!y z.[| (y,z) : r;  (z,b) : r^*;  P(z) |] ==> P(y) |]  \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   174
\     ==> P(a)";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   175
by (rtac (major RS rtrancl_converseI RS rtrancl_induct) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   176
by (resolve_tac prems 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   177
by (blast_tac (claset() addIs prems addSDs[rtrancl_converseD])1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   178
qed "converse_rtrancl_induct";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   179
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   180
bind_thm ("converse_rtrancl_induct2", split_rule
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   181
  (read_instantiate [("a","(ax,ay)"),("b","(bx,by)")]converse_rtrancl_induct));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   182
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   183
val major::prems = Goal
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   184
 "[| (x,z):r^*; \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   185
\    x=z ==> P; \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   186
\    !!y. [| (x,y):r; (y,z):r^* |] ==> P \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   187
\ |] ==> P";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   188
by (subgoal_tac "x = z  | (? y. (x,y) : r & (y,z) : r^*)" 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   189
by (rtac (major RS converse_rtrancl_induct) 2);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   190
by (blast_tac (claset() addIs prems) 2);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   191
by (blast_tac (claset() addIs prems) 2);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   192
by (REPEAT (eresolve_tac ([asm_rl,exE,disjE,conjE]@prems) 1));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   193
qed "converse_rtranclE";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   194
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   195
bind_thm ("converse_rtranclE2", split_rule
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   196
  (read_instantiate [("x","(xa,xb)"), ("z","(za,zb)")] converse_rtranclE));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   197
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   198
Goal "r O r^* = r^* O r";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   199
by (blast_tac (claset() addEs [rtranclE, converse_rtranclE] 
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   200
	               addIs [rtrancl_into_rtrancl, rtrancl_into_rtrancl2]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   201
qed "r_comp_rtrancl_eq";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   202
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   203
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   204
(**** The relation trancl ****)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   205
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   206
section "^+";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   207
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   208
Goalw [trancl_def] "[| p:r^+; r <= s |] ==> p:s^+";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   209
by (blast_tac (claset() addIs [rtrancl_mono RS subsetD]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   210
qed "trancl_mono";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   211
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   212
(** Conversions between trancl and rtrancl **)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   214
Goalw [trancl_def]
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   215
    "!!p. p : r^+ ==> p : r^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   216
by (split_all_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   217
by (etac compEpair 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   218
by (REPEAT (ares_tac [rtrancl_into_rtrancl] 1));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   219
qed "trancl_into_rtrancl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   220
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   221
(*r^+ contains r*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   222
Goalw [trancl_def]
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   223
   "!!p. p : r ==> p : r^+";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   224
by (split_all_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   225
by (REPEAT (ares_tac [prem,compI,rtrancl_refl] 1));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   226
qed "r_into_trancl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   227
AddIs [r_into_trancl];
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   228
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   229
(*intro rule by definition: from rtrancl and r*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   230
Goalw [trancl_def] "[| (a,b) : r^*;  (b,c) : r |]   ==>  (a,c) : r^+";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   231
by Auto_tac;
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   232
qed "rtrancl_into_trancl1";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   233
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   234
(*intro rule from r and rtrancl*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   235
Goal "[| (a,b) : r;  (b,c) : r^* |]   ==>  (a,c) : r^+";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   236
by (etac rtranclE 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   237
by (blast_tac (claset() addIs [r_into_trancl]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   238
by (rtac (rtrancl_trans RS rtrancl_into_trancl1) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   239
by (REPEAT (ares_tac [r_into_rtrancl] 1));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   240
qed "rtrancl_into_trancl2";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   241
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   242
(*Nice induction rule for trancl*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   243
val major::prems = Goal
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   244
  "[| (a,b) : r^+;                                      \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   245
\     !!y.  [| (a,y) : r |] ==> P(y);                   \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   246
\     !!y z.[| (a,y) : r^+;  (y,z) : r;  P(y) |] ==> P(z)       \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   247
\  |] ==> P(b)";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   248
by (rtac (rewrite_rule [trancl_def] major  RS  compEpair) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   249
(*by induction on this formula*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   250
by (subgoal_tac "ALL z. (y,z) : r --> P(z)" 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   251
(*now solve first subgoal: this formula is sufficient*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   252
by (Blast_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   253
by (etac rtrancl_induct 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   254
by (ALLGOALS (blast_tac (claset() addIs (rtrancl_into_trancl1::prems))));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   255
qed "trancl_induct";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   256
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   257
(*Another induction rule for trancl, incorporating transitivity.*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   258
val major::prems = Goal
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   259
 "[| (x,y) : r^+; \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   260
\    !!x y. (x,y) : r ==> P x y; \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   261
\    !!x y z. [| (x,y) : r^+; P x y; (y,z) : r^+; P y z |] ==> P x z \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   262
\ |] ==> P x y";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   263
by (blast_tac (claset() addIs ([r_into_trancl,major RS trancl_induct]@prems))1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   264
qed "trancl_trans_induct";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   265
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   266
(*elimination of r^+ -- NOT an induction rule*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   267
val major::prems = Goal
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   268
    "[| (a::'a,b) : r^+;  \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   269
\       (a,b) : r ==> P; \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   270
\       !!y.[| (a,y) : r^+;  (y,b) : r |] ==> P  \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   271
\    |] ==> P";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   272
by (subgoal_tac "(a::'a,b) : r | (? y. (a,y) : r^+  &  (y,b) : r)" 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   273
by (REPEAT (eresolve_tac ([asm_rl,disjE,exE,conjE]@prems) 1));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   274
by (rtac (rewrite_rule [trancl_def] major RS compEpair) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   275
by (etac rtranclE 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   276
by (Blast_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   277
by (blast_tac (claset() addSIs [rtrancl_into_trancl1]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   278
qed "tranclE";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   279
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   280
(*Transitivity of r^+.
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   281
  Proved by unfolding since it uses transitivity of rtrancl. *)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   282
Goalw [trancl_def] "trans(r^+)";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   283
by (rtac transI 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   284
by (REPEAT (etac compEpair 1));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   285
by (rtac (rtrancl_into_rtrancl RS (rtrancl_trans RS compI)) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   286
by (REPEAT (assume_tac 1));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   287
qed "trans_trancl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   288
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   289
bind_thm ("trancl_trans", trans_trancl RS transD);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   290
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   291
Goalw [trancl_def] "[| (x,y):r^*; (y,z):r^+ |] ==> (x,z):r^+";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   292
by (blast_tac (claset() addIs [rtrancl_trans]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   293
qed "rtrancl_trancl_trancl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   294
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   295
(* "[| (a,b) : r;  (b,c) : r^+ |]   ==>  (a,c) : r^+" *)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   296
bind_thm ("trancl_into_trancl2", [trans_trancl, r_into_trancl] MRS transD);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   297
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   298
(* primitive recursion for trancl over finite relations: *)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   299
Goal "(insert (y,x) r)^+ = r^+ Un {(a,b). (a,y):r^* & (x,b):r^*}";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   300
by (rtac equalityI 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   301
 by (rtac subsetI 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   302
 by (split_all_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   303
 by (etac trancl_induct 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   304
  by (blast_tac (claset() addIs [r_into_trancl]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   305
 by (blast_tac (claset() addIs
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   306
     [rtrancl_into_trancl1,trancl_into_rtrancl,r_into_trancl,trancl_trans]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   307
by (rtac subsetI 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   308
by (blast_tac (claset() addIs
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   309
     [rtrancl_into_trancl2, rtrancl_trancl_trancl,
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   310
      impOfSubs rtrancl_mono, trancl_mono]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   311
qed "trancl_insert";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   312
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   313
Goalw [trancl_def] "(r^-1)^+ = (r^+)^-1";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   314
by (simp_tac (simpset() addsimps [rtrancl_converse,converse_comp]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   315
by (simp_tac (simpset() addsimps [rtrancl_converse RS sym,
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   316
				  r_comp_rtrancl_eq]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   317
qed "trancl_converse";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   318
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   319
Goal "(x,y) : (r^+)^-1 ==> (x,y) : (r^-1)^+";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   320
by (asm_full_simp_tac (simpset() addsimps [trancl_converse]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   321
qed "trancl_converseI";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   322
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   323
Goal "(x,y) : (r^-1)^+ ==> (x,y) : (r^+)^-1";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   324
by (asm_full_simp_tac (simpset() addsimps [trancl_converse]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   325
qed "trancl_converseD";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   326
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   327
val major::prems = Goal
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   328
    "[| (a,b) : r^+; !!y. (y,b) : r ==> P(y); \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   329
\       !!y z.[| (y,z) : r;  (z,b) : r^+;  P(z) |] ==> P(y) |]  \
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   330
\     ==> P(a)";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   331
by (rtac ((major RS converseI RS trancl_converseI) RS trancl_induct) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   332
 by (resolve_tac prems 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   333
 by (etac converseD 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   334
by (blast_tac (claset() addIs prems addSDs [trancl_converseD])1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   335
qed "converse_trancl_induct";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   336
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   337
Goal "(x,y):R^+ ==> ? z. (x,z):R & (z,y):R^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   338
be converse_trancl_induct 1;
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   339
by Auto_tac;
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   340
by (blast_tac (claset() addIs [rtrancl_trans]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   341
qed "tranclD";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   342
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   343
(*Unused*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   344
Goal "r^-1 Int r^+ = {} ==> (x, x) ~: r^+";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   345
by (subgoal_tac "!y. (x, y) : r^+ --> x~=y" 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   346
by (Fast_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   347
by (strip_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   348
by (etac trancl_induct 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   349
by (auto_tac (claset() addIs [r_into_trancl], simpset()));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   350
qed "irrefl_tranclI";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   351
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   352
Goal "!!X. [| !x. (x, x) ~: r^+; (x,y) : r |] ==> x ~= y";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   353
by (blast_tac (claset() addDs [r_into_trancl]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   354
qed "irrefl_trancl_rD";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   355
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   356
Goal "[| (a,b) : r^*;  r <= A <*> A |] ==> a=b | a:A";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   357
by (etac rtrancl_induct 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   358
by Auto_tac;
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   359
val lemma = result();
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   360
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   361
Goalw [trancl_def] "r <= A <*> A ==> r^+ <= A <*> A";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   362
by (blast_tac (claset() addSDs [lemma]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   363
qed "trancl_subset_Sigma";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   364
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   365
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   366
Goal "(r^+)^= = r^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   367
by Safe_tac;
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   368
by  (etac trancl_into_rtrancl 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   369
by (blast_tac (claset() addEs [rtranclE] addDs [rtrancl_into_trancl1]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   370
qed "reflcl_trancl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   371
Addsimps[reflcl_trancl];
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   372
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   373
Goal "(r^=)^+ = r^*";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   374
by Safe_tac;
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   375
by  (dtac trancl_into_rtrancl 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   376
by  (Asm_full_simp_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   377
by (etac rtranclE 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   378
by  Safe_tac;
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   379
by  (rtac r_into_trancl 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   380
by  (Simp_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   381
by (rtac rtrancl_into_trancl1 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   382
by (etac (rtrancl_reflcl RS equalityD2 RS subsetD) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   383
by (Fast_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   384
qed "trancl_reflcl";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   385
Addsimps[trancl_reflcl];
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   386
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   387
Goal "{}^+ = {}";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   388
by (auto_tac (claset() addEs [trancl_induct], simpset()));
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   389
qed "trancl_empty";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   390
Addsimps[trancl_empty];
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   391
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   392
Goal "{}^* = Id";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   393
by (rtac (reflcl_trancl RS subst) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   394
by (Simp_tac 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   395
qed "rtrancl_empty";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   396
Addsimps[rtrancl_empty];
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   397
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   398
Goal "(a,b):R^* ==> a=b | a~=b & (a,b):R^+";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   399
by(force_tac (claset(), simpset() addsimps [reflcl_trancl RS sym] 
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   400
				  delsimps [reflcl_trancl]) 1);
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   401
qed "rtranclD";
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   402