src/HOL/AxClasses/Tutorial/Group.ML
changeset 1247 18b1441fb603
child 1465 5d7a7e439cec
equal deleted inserted replaced
1246:706cfddca75c 1247:18b1441fb603
       
     1 (*  Title:      HOL/AxClasses/Tutorial/Group.ML
       
     2     ID:         $Id$
       
     3     Author:     Markus Wenzel, TU Muenchen
       
     4 
       
     5 Some basic theorems of group theory.
       
     6 *)
       
     7 
       
     8 open Group;
       
     9 
       
    10 fun sub r = standard (r RS subst);
       
    11 fun ssub r = standard (r RS ssubst);
       
    12 
       
    13 
       
    14 goal Group.thy "x <*> inv x = (1::'a::group)";
       
    15 br (sub left_unit) 1;
       
    16 back();
       
    17 br (sub assoc) 1;
       
    18 br (sub left_inv) 1;
       
    19 back();
       
    20 back();
       
    21 br (ssub assoc) 1;
       
    22 back();
       
    23 br (ssub left_inv) 1;
       
    24 br (ssub assoc) 1;
       
    25 br (ssub left_unit) 1;
       
    26 br (ssub left_inv) 1;
       
    27 br refl 1;
       
    28 qed "right_inv";
       
    29 
       
    30 
       
    31 goal Group.thy "x <*> 1 = (x::'a::group)";
       
    32 br (sub left_inv) 1;
       
    33 br (sub assoc) 1;
       
    34 br (ssub right_inv) 1;
       
    35 br (ssub left_unit) 1;
       
    36 br refl 1;
       
    37 qed "right_unit";
       
    38 
       
    39 
       
    40 goal Group.thy "e <*> x = x --> e = (1::'a::group)";
       
    41 br impI 1;
       
    42 br (sub right_unit) 1;
       
    43 back();
       
    44 by (res_inst_tac [("x", "x")] (sub right_inv) 1);
       
    45 br (sub assoc) 1;
       
    46 br arg_cong 1;
       
    47 back();
       
    48 ba 1;
       
    49 qed "strong_one_unit";
       
    50 
       
    51 
       
    52 goal Group.thy "EX! e. ALL x. e <*> x = (x::'a::group)";
       
    53 br ex1I 1;
       
    54 br allI 1;
       
    55 br left_unit 1;
       
    56 br mp 1;
       
    57 br strong_one_unit 1;
       
    58 be allE 1;
       
    59 ba 1;
       
    60 qed "ex1_unit";
       
    61 
       
    62 
       
    63 goal Group.thy "ALL x. EX! e. e <*> x = (x::'a::group)";
       
    64 br allI 1;
       
    65 br ex1I 1;
       
    66 br left_unit 1;
       
    67 br (strong_one_unit RS mp) 1;
       
    68 ba 1;
       
    69 qed "ex1_unit'";
       
    70 
       
    71 
       
    72 goal Group.thy "y <*> x = 1 --> y = inv (x::'a::group)";
       
    73 br impI 1;
       
    74 br (sub right_unit) 1;
       
    75 back();
       
    76 back();
       
    77 br (sub right_unit) 1;
       
    78 by (res_inst_tac [("x", "x")] (sub right_inv) 1);
       
    79 br (sub assoc) 1;
       
    80 br (sub assoc) 1;
       
    81 br arg_cong 1;
       
    82 back();
       
    83 br (ssub left_inv) 1;
       
    84 ba 1;
       
    85 qed "one_inv";
       
    86 
       
    87 
       
    88 goal Group.thy "ALL x. EX! y. y <*> x = (1::'a::group)";
       
    89 br allI 1;
       
    90 br ex1I 1;
       
    91 br left_inv 1;
       
    92 br mp 1;
       
    93 br one_inv 1;
       
    94 ba 1;
       
    95 qed "ex1_inv";
       
    96 
       
    97 
       
    98 goal Group.thy "inv (x <*> y) = inv y <*> inv (x::'a::group)";
       
    99 br sym 1;
       
   100 br mp 1;
       
   101 br one_inv 1;
       
   102 br (ssub assoc) 1;
       
   103 br (sub assoc) 1;
       
   104 back();
       
   105 br (ssub left_inv) 1;
       
   106 br (ssub left_unit) 1;
       
   107 br (ssub left_inv) 1;
       
   108 br refl 1;
       
   109 qed "inv_product";
       
   110 
       
   111 
       
   112 goal Group.thy "inv (inv x) = (x::'a::group)";
       
   113 br sym 1;
       
   114 br (one_inv RS mp) 1;
       
   115 br (ssub right_inv) 1;
       
   116 br refl 1;
       
   117 qed "inv_inv";
       
   118