src/HOL/Trancl.ML
author nipkow
Sun, 28 May 1995 17:17:43 +0200
changeset 1130 0df0df1685a8
parent 1128 64b30e3cc6d4
child 1301 42782316d510
permissions -rw-r--r--
Added trancl_cs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     1
(*  Title: 	HOL/trancl
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     2
    ID:         $Id$
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     4
    Copyright   1992  University of Cambridge
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     5
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     6
For trancl.thy.  Theorems about the transitive closure of a relation
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     7
*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     8
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     9
open Trancl;
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    10
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    11
(** The relation rtrancl **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    12
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    13
goal Trancl.thy "mono(%s. id Un (r O s))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    14
by (rtac monoI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    15
by (REPEAT (ares_tac [monoI, subset_refl, comp_mono, Un_mono] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    16
qed "rtrancl_fun_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    17
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    18
val rtrancl_unfold = rtrancl_fun_mono RS (rtrancl_def RS def_lfp_Tarski);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    19
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    20
(*Reflexivity of rtrancl*)
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    21
goal Trancl.thy "(a,a) : r^*";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    22
by (stac rtrancl_unfold 1);
1128
64b30e3cc6d4 Trancl is now based on Relation which used to be in Integ.
nipkow
parents: 1122
diff changeset
    23
by (fast_tac rel_cs 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    24
qed "rtrancl_refl";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    25
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    26
(*Closure under composition with r*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    27
val prems = goal Trancl.thy
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    28
    "[| (a,b) : r^*;  (b,c) : r |] ==> (a,c) : r^*";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    29
by (stac rtrancl_unfold 1);
1128
64b30e3cc6d4 Trancl is now based on Relation which used to be in Integ.
nipkow
parents: 1122
diff changeset
    30
by (fast_tac (rel_cs addIs prems) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    31
qed "rtrancl_into_rtrancl";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    32
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    33
(*rtrancl of r contains r*)
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    34
val [prem] = goal Trancl.thy "[| (a,b) : r |] ==> (a,b) : r^*";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    35
by (rtac (rtrancl_refl RS rtrancl_into_rtrancl) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    36
by (rtac prem 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    37
qed "r_into_rtrancl";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    38
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    39
(*monotonicity of rtrancl*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    40
goalw Trancl.thy [rtrancl_def] "!!r s. r <= s ==> r^* <= s^*";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    41
by(REPEAT(ares_tac [lfp_mono,Un_mono,comp_mono,subset_refl] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    42
qed "rtrancl_mono";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    43
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    44
(** standard induction rule **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    45
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    46
val major::prems = goal Trancl.thy 
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    47
  "[| (a,b) : r^*; \
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    48
\     !!x. P((x,x)); \
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    49
\     !!x y z.[| P((x,y)); (x,y): r^*; (y,z): r |]  ==>  P((x,z)) |] \
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    50
\  ==>  P((a,b))";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    51
by (rtac ([rtrancl_def, rtrancl_fun_mono, major] MRS def_induct) 1);
1128
64b30e3cc6d4 Trancl is now based on Relation which used to be in Integ.
nipkow
parents: 1122
diff changeset
    52
by (fast_tac (rel_cs addIs prems) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    53
qed "rtrancl_full_induct";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    54
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    55
(*nice induction rule*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    56
val major::prems = goal Trancl.thy
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    57
    "[| (a::'a,b) : r^*;    \
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    58
\       P(a); \
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    59
\	!!y z.[| (a,y) : r^*;  (y,z) : r;  P(y) |] ==> P(z) |]  \
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    60
\     ==> P(b)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    61
(*by induction on this formula*)
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    62
by (subgoal_tac "! y. (a::'a,b) = (a,y) --> P(y)" 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    63
(*now solve first subgoal: this formula is sufficient*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    64
by (fast_tac HOL_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    65
(*now do the induction*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    66
by (resolve_tac [major RS rtrancl_full_induct] 1);
1128
64b30e3cc6d4 Trancl is now based on Relation which used to be in Integ.
nipkow
parents: 1122
diff changeset
    67
by (fast_tac (rel_cs addIs prems) 1);
64b30e3cc6d4 Trancl is now based on Relation which used to be in Integ.
nipkow
parents: 1122
diff changeset
    68
by (fast_tac (rel_cs addIs prems) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    69
qed "rtrancl_induct";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    70
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    71
(*transitivity of transitive closure!! -- by induction.*)
1122
20b708827030 renamed trans_rtrancl to rtrancl_trans and modified it by expanding trans.
nipkow
parents: 1121
diff changeset
    72
goal Trancl.thy "!!r. [| (a,b):r^*; (b,c):r^* |] ==> (a,c):r^*";
20b708827030 renamed trans_rtrancl to rtrancl_trans and modified it by expanding trans.
nipkow
parents: 1121
diff changeset
    73
by (eres_inst_tac [("b","c")] rtrancl_induct 1);
20b708827030 renamed trans_rtrancl to rtrancl_trans and modified it by expanding trans.
nipkow
parents: 1121
diff changeset
    74
by(ALLGOALS(fast_tac (HOL_cs addIs [rtrancl_into_rtrancl])));
20b708827030 renamed trans_rtrancl to rtrancl_trans and modified it by expanding trans.
nipkow
parents: 1121
diff changeset
    75
qed "rtrancl_trans";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    76
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    77
(*elimination of rtrancl -- by induction on a special formula*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    78
val major::prems = goal Trancl.thy
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    79
    "[| (a::'a,b) : r^*;  (a = b) ==> P; 	\
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    80
\	!!y.[| (a,y) : r^*; (y,b) : r |] ==> P 	\
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    81
\    |] ==> P";
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    82
by (subgoal_tac "(a::'a) = b  | (? y. (a,y) : r^* & (y,b) : r)" 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    83
by (rtac (major RS rtrancl_induct) 2);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    84
by (fast_tac (set_cs addIs prems) 2);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    85
by (fast_tac (set_cs addIs prems) 2);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    86
by (REPEAT (eresolve_tac ([asm_rl,exE,disjE,conjE]@prems) 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    87
qed "rtranclE";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    88
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    89
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    90
(**** The relation trancl ****)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    91
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    92
(** Conversions between trancl and rtrancl **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    93
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    94
val [major] = goalw Trancl.thy [trancl_def]
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
    95
    "(a,b) : r^+ ==> (a,b) : r^*";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    96
by (resolve_tac [major RS compEpair] 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    97
by (REPEAT (ares_tac [rtrancl_into_rtrancl] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    98
qed "trancl_into_rtrancl";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    99
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   100
(*r^+ contains r*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   101
val [prem] = goalw Trancl.thy [trancl_def]
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   102
   "[| (a,b) : r |] ==> (a,b) : r^+";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   103
by (REPEAT (ares_tac [prem,compI,rtrancl_refl] 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   104
qed "r_into_trancl";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   105
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   106
(*intro rule by definition: from rtrancl and r*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   107
val prems = goalw Trancl.thy [trancl_def]
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   108
    "[| (a,b) : r^*;  (b,c) : r |]   ==>  (a,c) : r^+";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   109
by (REPEAT (resolve_tac ([compI]@prems) 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   110
qed "rtrancl_into_trancl1";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   111
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   112
(*intro rule from r and rtrancl*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   113
val prems = goal Trancl.thy
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   114
    "[| (a,b) : r;  (b,c) : r^* |]   ==>  (a,c) : r^+";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   115
by (resolve_tac (prems RL [rtranclE]) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   116
by (etac subst 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   117
by (resolve_tac (prems RL [r_into_trancl]) 1);
1122
20b708827030 renamed trans_rtrancl to rtrancl_trans and modified it by expanding trans.
nipkow
parents: 1121
diff changeset
   118
by (rtac (rtrancl_trans RS rtrancl_into_trancl1) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   119
by (REPEAT (ares_tac (prems@[r_into_rtrancl]) 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   120
qed "rtrancl_into_trancl2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   121
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   122
(*elimination of r^+ -- NOT an induction rule*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   123
val major::prems = goal Trancl.thy
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   124
    "[| (a::'a,b) : r^+;  \
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   125
\       (a,b) : r ==> P; \
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   126
\	!!y.[| (a,y) : r^+;  (y,b) : r |] ==> P  \
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   127
\    |] ==> P";
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   128
by (subgoal_tac "(a::'a,b) : r | (? y. (a,y) : r^+  &  (y,b) : r)" 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   129
by (REPEAT (eresolve_tac ([asm_rl,disjE,exE,conjE]@prems) 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   130
by (rtac (rewrite_rule [trancl_def] major RS compEpair) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   131
by (etac rtranclE 1);
1128
64b30e3cc6d4 Trancl is now based on Relation which used to be in Integ.
nipkow
parents: 1122
diff changeset
   132
by (fast_tac rel_cs 1);
64b30e3cc6d4 Trancl is now based on Relation which used to be in Integ.
nipkow
parents: 1122
diff changeset
   133
by (fast_tac (rel_cs addSIs [rtrancl_into_trancl1]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   134
qed "tranclE";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   135
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   136
(*Transitivity of r^+.
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   137
  Proved by unfolding since it uses transitivity of rtrancl. *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   138
goalw Trancl.thy [trancl_def] "trans(r^+)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   139
by (rtac transI 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   140
by (REPEAT (etac compEpair 1));
1122
20b708827030 renamed trans_rtrancl to rtrancl_trans and modified it by expanding trans.
nipkow
parents: 1121
diff changeset
   141
by (rtac (rtrancl_into_rtrancl RS (rtrancl_trans RS compI)) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   142
by (REPEAT (assume_tac 1));
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   143
qed "trans_trancl";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   144
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   145
val prems = goal Trancl.thy
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   146
    "[| (a,b) : r;  (b,c) : r^+ |]   ==>  (a,c) : r^+";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   147
by (rtac (r_into_trancl RS (trans_trancl RS transD)) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   148
by (resolve_tac prems 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   149
by (resolve_tac prems 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   150
qed "trancl_into_trancl2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   151
1130
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   152
(** More about r^* **)
1121
485b49694253 Added some lemmas about r^*.
nipkow
parents: 972
diff changeset
   153
485b49694253 Added some lemmas about r^*.
nipkow
parents: 972
diff changeset
   154
goal Trancl.thy "(r^*)^* = r^*";
485b49694253 Added some lemmas about r^*.
nipkow
parents: 972
diff changeset
   155
br set_ext 1;
485b49694253 Added some lemmas about r^*.
nipkow
parents: 972
diff changeset
   156
by(res_inst_tac [("p","x")] PairE 1);
485b49694253 Added some lemmas about r^*.
nipkow
parents: 972
diff changeset
   157
by(hyp_subst_tac 1);
485b49694253 Added some lemmas about r^*.
nipkow
parents: 972
diff changeset
   158
br iffI 1;
485b49694253 Added some lemmas about r^*.
nipkow
parents: 972
diff changeset
   159
be rtrancl_induct 1;
485b49694253 Added some lemmas about r^*.
nipkow
parents: 972
diff changeset
   160
br rtrancl_refl 1;
1122
20b708827030 renamed trans_rtrancl to rtrancl_trans and modified it by expanding trans.
nipkow
parents: 1121
diff changeset
   161
by(fast_tac (HOL_cs addEs [rtrancl_trans]) 1);
1121
485b49694253 Added some lemmas about r^*.
nipkow
parents: 972
diff changeset
   162
be r_into_rtrancl 1;
485b49694253 Added some lemmas about r^*.
nipkow
parents: 972
diff changeset
   163
qed "rtrancl_idemp";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   164
1130
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   165
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   166
goal Trancl.thy "!!r. (x,y) : (converse r)^* ==> (x,y) : converse(r^*)";
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   167
br converseI 1;
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   168
be rtrancl_induct 1;
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   169
br rtrancl_refl 1;
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   170
by(fast_tac (rel_cs addIs [r_into_rtrancl,rtrancl_trans]) 1);
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   171
qed "rtrancl_converseD";
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   172
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   173
goal Trancl.thy "!!r. (x,y) : converse(r^*) ==> (x,y) : (converse r)^*";
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   174
bd converseD 1;
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   175
be rtrancl_induct 1;
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   176
br rtrancl_refl 1;
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   177
by(fast_tac (rel_cs addIs [r_into_rtrancl,rtrancl_trans]) 1);
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   178
qed "rtrancl_converseI";
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   179
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   180
goal Trancl.thy "(converse r)^* = converse(r^*)";
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   181
by(safe_tac (rel_eq_cs addSIs [rtrancl_converseI]));
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   182
by(res_inst_tac [("p","x")] PairE 1);
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   183
by(hyp_subst_tac 1);
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   184
be rtrancl_converseD 1;
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   185
qed "rtrancl_converse";
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   186
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   187
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   188
val major::prems = goal Trancl.thy
972
e61b058d58d2 changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents: 923
diff changeset
   189
    "[| (a,b) : r^*;  r <= Sigma A (%x.A) |] ==> a=b | a:A";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   190
by (cut_facts_tac prems 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   191
by (rtac (major RS rtrancl_induct) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   192
by (rtac (refl RS disjI1) 1);
1128
64b30e3cc6d4 Trancl is now based on Relation which used to be in Integ.
nipkow
parents: 1122
diff changeset
   193
by (fast_tac (rel_cs addSEs [SigmaE2]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   194
qed "trancl_subset_Sigma_lemma";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   195
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   196
goalw Trancl.thy [trancl_def]
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   197
    "!!r. r <= Sigma A (%x.A) ==> trancl(r) <= Sigma A (%x.A)";
1128
64b30e3cc6d4 Trancl is now based on Relation which used to be in Integ.
nipkow
parents: 1122
diff changeset
   198
by (fast_tac (rel_cs addSDs [trancl_subset_Sigma_lemma]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   199
qed "trancl_subset_Sigma";
1130
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   200
0df0df1685a8 Added trancl_cs
nipkow
parents: 1128
diff changeset
   201
val trancl_cs = rel_cs addIs [rtrancl_refl];