10   | 
    10   | 
    11 Goalw [id_def] "(a,a) : id";    | 
    11 Goalw [id_def] "(a,a) : id";    | 
    12 by (Blast_tac 1);  | 
    12 by (Blast_tac 1);  | 
    13 qed "idI";  | 
    13 qed "idI";  | 
    14   | 
    14   | 
    15 val major::prems = goalw thy [id_def]  | 
    15 val major::prems = Goalw [id_def]  | 
    16     "[| p: id;  !!x.[| p = (x,x) |] ==> P  \  | 
    16     "[| p: id;  !!x.[| p = (x,x) |] ==> P  \  | 
    17 \    |] ==>  P";    | 
    17 \    |] ==>  P";    | 
    18 by (rtac (major RS CollectE) 1);  | 
    18 by (rtac (major RS CollectE) 1);  | 
    19 by (etac exE 1);  | 
    19 by (etac exE 1);  | 
    20 by (eresolve_tac prems 1);  | 
    20 by (eresolve_tac prems 1);  | 
    32     "[| (a,b):s; (b,c):r |] ==> (a,c) : r O s";  | 
    32     "[| (a,b):s; (b,c):r |] ==> (a,c) : r O s";  | 
    33 by (Blast_tac 1);  | 
    33 by (Blast_tac 1);  | 
    34 qed "compI";  | 
    34 qed "compI";  | 
    35   | 
    35   | 
    36 (*proof requires higher-level assumptions or a delaying of hyp_subst_tac*)  | 
    36 (*proof requires higher-level assumptions or a delaying of hyp_subst_tac*)  | 
    37 val prems = goalw thy [comp_def]  | 
    37 val prems = Goalw [comp_def]  | 
    38     "[| xz : r O s;  \  | 
    38     "[| xz : r O s;  \  | 
    39 \       !!x y z. [| xz = (x,z);  (x,y):s;  (y,z):r |] ==> P \  | 
    39 \       !!x y z. [| xz = (x,z);  (x,y):s;  (y,z):r |] ==> P \  | 
    40 \    |] ==> P";  | 
    40 \    |] ==> P";  | 
    41 by (cut_facts_tac prems 1);  | 
    41 by (cut_facts_tac prems 1);  | 
    42 by (REPEAT (eresolve_tac [CollectE, splitE, exE, conjE] 1   | 
    42 by (REPEAT (eresolve_tac [CollectE, splitE, exE, conjE] 1   | 
    43      ORELSE ares_tac prems 1));  | 
    43      ORELSE ares_tac prems 1));  | 
    44 qed "compE";  | 
    44 qed "compE";  | 
    45   | 
    45   | 
    46 val prems = goal thy  | 
    46 val prems = Goal  | 
    47     "[| (a,c) : r O s;  \  | 
    47     "[| (a,c) : r O s;  \  | 
    48 \       !!y. [| (a,y):s;  (y,c):r |] ==> P \  | 
    48 \       !!y. [| (a,y):s;  (y,c):r |] ==> P \  | 
    49 \    |] ==> P";  | 
    49 \    |] ==> P";  | 
    50 by (rtac compE 1);  | 
    50 by (rtac compE 1);  | 
    51 by (REPEAT (ares_tac prems 1 ORELSE eresolve_tac [Pair_inject,ssubst] 1));  | 
    51 by (REPEAT (ares_tac prems 1 ORELSE eresolve_tac [Pair_inject,ssubst] 1));  | 
    76 by (Blast_tac 1);  | 
    76 by (Blast_tac 1);  | 
    77 qed "comp_subset_Sigma";  | 
    77 qed "comp_subset_Sigma";  | 
    78   | 
    78   | 
    79 (** Natural deduction for trans(r) **)  | 
    79 (** Natural deduction for trans(r) **)  | 
    80   | 
    80   | 
    81 val prems = goalw thy [trans_def]  | 
    81 val prems = Goalw [trans_def]  | 
    82     "(!! x y z. [| (x,y):r;  (y,z):r |] ==> (x,z):r) ==> trans(r)";  | 
    82     "(!! x y z. [| (x,y):r;  (y,z):r |] ==> (x,z):r) ==> trans(r)";  | 
    83 by (REPEAT (ares_tac (prems@[allI,impI]) 1));  | 
    83 by (REPEAT (ares_tac (prems@[allI,impI]) 1));  | 
    84 qed "transI";  | 
    84 qed "transI";  | 
    85   | 
    85   | 
    86 Goalw [trans_def] "[| trans(r);  (a,b):r;  (b,c):r |] ==> (a,c):r";  | 
    86 Goalw [trans_def] "[| trans(r);  (a,b):r;  (b,c):r |] ==> (a,c):r";  |