1247
|
1 |
|
|
2 |
open GroupDefs;
|
|
3 |
|
|
4 |
|
|
5 |
(* bool *)
|
|
6 |
|
|
7 |
(*this is really overkill - should be rather proven 'inline'*)
|
|
8 |
|
|
9 |
goalw thy [times_bool_def] "(x * y) * z = x * (y * (z::bool))";
|
1899
|
10 |
by (Fast_tac 1);
|
1247
|
11 |
qed "bool_assoc";
|
|
12 |
|
|
13 |
goalw thy [times_bool_def, one_bool_def] "1 * x = (x::bool)";
|
1899
|
14 |
by (Fast_tac 1);
|
1247
|
15 |
qed "bool_left_unit";
|
|
16 |
|
|
17 |
goalw thy [times_bool_def, one_bool_def] "x * 1 = (x::bool)";
|
1899
|
18 |
by (Fast_tac 1);
|
1247
|
19 |
qed "bool_right_unit";
|
|
20 |
|
|
21 |
goalw thy [times_bool_def, inv_bool_def, one_bool_def] "inv(x) * x = (1::bool)";
|
1899
|
22 |
by (Fast_tac 1);
|
1247
|
23 |
qed "bool_left_inv";
|
|
24 |
|
|
25 |
goalw thy [times_bool_def] "x * y = (y * (x::bool))";
|
1899
|
26 |
by (Fast_tac 1);
|
1247
|
27 |
qed "bool_commut";
|
|
28 |
|
|
29 |
|
|
30 |
(* cartesian products *)
|
|
31 |
|
1266
|
32 |
val prod_ss = simpset_of "Prod";
|
|
33 |
|
1247
|
34 |
goalw thy [times_prod_def] "(x * y) * z = x * (y * (z::'a::semigroup*'b::semigroup))";
|
|
35 |
by (simp_tac (prod_ss addsimps [assoc]) 1);
|
|
36 |
qed "prod_assoc";
|
|
37 |
|
|
38 |
goalw thy [times_prod_def, one_prod_def] "1 * x = (x::'a::monoid*'b::monoid)";
|
|
39 |
by (simp_tac (prod_ss addsimps [Monoid.left_unit]) 1);
|
1465
|
40 |
by (rtac (surjective_pairing RS sym) 1);
|
1247
|
41 |
qed "prod_left_unit";
|
|
42 |
|
|
43 |
goalw thy [times_prod_def, one_prod_def] "x * 1 = (x::'a::monoid*'b::monoid)";
|
|
44 |
by (simp_tac (prod_ss addsimps [Monoid.right_unit]) 1);
|
1465
|
45 |
by (rtac (surjective_pairing RS sym) 1);
|
1247
|
46 |
qed "prod_right_unit";
|
|
47 |
|
|
48 |
goalw thy [times_prod_def, inv_prod_def, one_prod_def] "inv x * x = (1::'a::group*'b::group)";
|
|
49 |
by (simp_tac (prod_ss addsimps [left_inv]) 1);
|
|
50 |
qed "prod_left_inv";
|
|
51 |
|
|
52 |
goalw thy [times_prod_def] "x * y = y * (x::'a::agroup*'b::agroup)";
|
|
53 |
by (simp_tac (prod_ss addsimps [commut]) 1);
|
|
54 |
qed "prod_commut";
|
|
55 |
|
|
56 |
|
|
57 |
(* function spaces *)
|
|
58 |
|
|
59 |
goalw thy [times_fun_def] "(x * y) * z = x * (y * (z::'a => 'b::semigroup))";
|
|
60 |
by (stac expand_fun_eq 1);
|
1465
|
61 |
by (rtac allI 1);
|
|
62 |
by (rtac assoc 1);
|
1247
|
63 |
qed "fun_assoc";
|
|
64 |
|
|
65 |
goalw thy [times_fun_def, one_fun_def] "1 * x = (x::'a => 'b::monoid)";
|
|
66 |
by (stac expand_fun_eq 1);
|
1465
|
67 |
by (rtac allI 1);
|
|
68 |
by (rtac Monoid.left_unit 1);
|
1247
|
69 |
qed "fun_left_unit";
|
|
70 |
|
|
71 |
goalw thy [times_fun_def, one_fun_def] "x * 1 = (x::'a => 'b::monoid)";
|
|
72 |
by (stac expand_fun_eq 1);
|
1465
|
73 |
by (rtac allI 1);
|
|
74 |
by (rtac Monoid.right_unit 1);
|
1247
|
75 |
qed "fun_right_unit";
|
|
76 |
|
|
77 |
goalw thy [times_fun_def, inv_fun_def, one_fun_def] "inv x * x = (1::'a => 'b::group)";
|
|
78 |
by (stac expand_fun_eq 1);
|
1465
|
79 |
by (rtac allI 1);
|
|
80 |
by (rtac left_inv 1);
|
1247
|
81 |
qed "fun_left_inv";
|
|
82 |
|
|
83 |
goalw thy [times_fun_def] "x * y = y * (x::'a => 'b::agroup)";
|
|
84 |
by (stac expand_fun_eq 1);
|
1465
|
85 |
by (rtac allI 1);
|
|
86 |
by (rtac commut 1);
|
1247
|
87 |
qed "fun_commut";
|