src/HOL/AxClasses/Tutorial/Group.ML
author wenzelm
Tue, 27 May 1997 15:45:07 +0200
changeset 3362 0b268cff9344
parent 2907 0e272e4c7cb2
child 5069 3ea049f7979d
permissions -rw-r--r--
NJ 1.09.2x as factory default!

(*  Title:      HOL/AxClasses/Tutorial/Group.ML
    ID:         $Id$
    Author:     Markus Wenzel, TU Muenchen

Some basic theorems of group theory.
*)

open Group;

fun sub r = standard (r RS subst);
fun ssub r = standard (r RS ssubst);


goal Group.thy "x <*> inverse x = (1::'a::group)";
by (rtac (sub left_unit) 1);
back();
by (rtac (sub assoc) 1);
by (rtac (sub left_inverse) 1);
back();
back();
by (rtac (ssub assoc) 1);
back();
by (rtac (ssub left_inverse) 1);
by (rtac (ssub assoc) 1);
by (rtac (ssub left_unit) 1);
by (rtac (ssub left_inverse) 1);
by (rtac refl 1);
qed "right_inverse";


goal Group.thy "x <*> 1 = (x::'a::group)";
by (rtac (sub left_inverse) 1);
by (rtac (sub assoc) 1);
by (rtac (ssub right_inverse) 1);
by (rtac (ssub left_unit) 1);
by (rtac refl 1);
qed "right_unit";


goal Group.thy "e <*> x = x --> e = (1::'a::group)";
by (rtac impI 1);
by (rtac (sub right_unit) 1);
back();
by (res_inst_tac [("x", "x")] (sub right_inverse) 1);
by (rtac (sub assoc) 1);
by (rtac arg_cong 1);
back();
by (assume_tac 1);
qed "strong_one_unit";


goal Group.thy "EX! e. ALL x. e <*> x = (x::'a::group)";
by (rtac ex1I 1);
by (rtac allI 1);
by (rtac left_unit 1);
by (rtac mp 1);
by (rtac strong_one_unit 1);
by (etac allE 1);
by (assume_tac 1);
qed "ex1_unit";


goal Group.thy "ALL x. EX! e. e <*> x = (x::'a::group)";
by (rtac allI 1);
by (rtac ex1I 1);
by (rtac left_unit 1);
by (rtac (strong_one_unit RS mp) 1);
by (assume_tac 1);
qed "ex1_unit'";


goal Group.thy "y <*> x = 1 --> y = inverse (x::'a::group)";
by (rtac impI 1);
by (rtac (sub right_unit) 1);
back();
back();
by (rtac (sub right_unit) 1);
by (res_inst_tac [("x", "x")] (sub right_inverse) 1);
by (rtac (sub assoc) 1);
by (rtac (sub assoc) 1);
by (rtac arg_cong 1);
back();
by (rtac (ssub left_inverse) 1);
by (assume_tac 1);
qed "one_inverse";


goal Group.thy "ALL x. EX! y. y <*> x = (1::'a::group)";
by (rtac allI 1);
by (rtac ex1I 1);
by (rtac left_inverse 1);
by (rtac mp 1);
by (rtac one_inverse 1);
by (assume_tac 1);
qed "ex1_inverse";


goal Group.thy "inverse (x <*> y) = inverse y <*> inverse (x::'a::group)";
by (rtac sym 1);
by (rtac mp 1);
by (rtac one_inverse 1);
by (rtac (ssub assoc) 1);
by (rtac (sub assoc) 1);
back();
by (rtac (ssub left_inverse) 1);
by (rtac (ssub left_unit) 1);
by (rtac (ssub left_inverse) 1);
by (rtac refl 1);
qed "inverse_product";


goal Group.thy "inverse (inverse x) = (x::'a::group)";
by (rtac sym 1);
by (rtac (one_inverse RS mp) 1);
by (rtac (ssub right_inverse) 1);
by (rtac refl 1);
qed "inverse_inv";