src/HOL/AxClasses/Group/GroupDefs.ML
author wenzelm
Sat, 30 Oct 1999 20:20:48 +0200
changeset 7982 d534b897ce39
parent 5069 3ea049f7979d
child 9345 2f5f6824f888
permissions -rw-r--r--
improved presentation;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     1
(* bool *)
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     2
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     3
(*this is really overkill - should be rather proven 'inline'*)
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     4
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
     5
Goalw [times_bool_def] "(x * y) * z = x * (y * (z::bool))";
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
     6
by (Fast_tac 1);
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     7
qed "bool_assoc";
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     8
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
     9
Goalw [times_bool_def, one_bool_def] "1 * x = (x::bool)";
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
    10
by (Fast_tac 1);
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    11
qed "bool_left_unit";
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    12
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    13
Goalw [times_bool_def, one_bool_def] "x * 1 = (x::bool)";
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
    14
by (Fast_tac 1);
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    15
qed "bool_right_unit";
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    16
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    17
Goalw [times_bool_def, inverse_bool_def, one_bool_def]
2907
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1899
diff changeset
    18
  "inverse(x) * x = (1::bool)";
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
    19
by (Fast_tac 1);
2907
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1899
diff changeset
    20
qed "bool_left_inverse";
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    21
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    22
Goalw [times_bool_def] "x * y = (y * (x::bool))";
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1465
diff changeset
    23
by (Fast_tac 1);
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    24
qed "bool_commut";
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    25
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    26
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    27
(* cartesian products *)
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    28
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 2907
diff changeset
    29
val prod_ss = simpset_of Prod.thy;
1266
3ae9fe3c0f68 added local simpsets
clasohm
parents: 1247
diff changeset
    30
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    31
Goalw [times_prod_def]
2907
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1899
diff changeset
    32
  "(x * y) * z = x * (y * (z::'a::semigroup*'b::semigroup))";
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    33
by (simp_tac (prod_ss addsimps [assoc]) 1);
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    34
qed "prod_assoc";
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    35
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    36
Goalw [times_prod_def, one_prod_def] "1 * x = (x::'a::monoid*'b::monoid)";
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    37
by (simp_tac (prod_ss addsimps [Monoid.left_unit]) 1);
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
    38
by (rtac (surjective_pairing RS sym) 1);
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    39
qed "prod_left_unit";
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    40
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    41
Goalw [times_prod_def, one_prod_def] "x * 1 = (x::'a::monoid*'b::monoid)";
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    42
by (simp_tac (prod_ss addsimps [Monoid.right_unit]) 1);
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
    43
by (rtac (surjective_pairing RS sym) 1);
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    44
qed "prod_right_unit";
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    45
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    46
Goalw [times_prod_def, inverse_prod_def, one_prod_def]
2907
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1899
diff changeset
    47
  "inverse x * x = (1::'a::group*'b::group)";
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1899
diff changeset
    48
by (simp_tac (prod_ss addsimps [left_inverse]) 1);
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1899
diff changeset
    49
qed "prod_left_inverse";
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    50
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    51
Goalw [times_prod_def] "x * y = y * (x::'a::agroup*'b::agroup)";
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    52
by (simp_tac (prod_ss addsimps [commut]) 1);
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    53
qed "prod_commut";
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    54
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    55
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    56
(* function spaces *)
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    57
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    58
Goalw [times_fun_def] "(x * y) * z = x * (y * (z::'a => 'b::semigroup))";
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    59
by (stac expand_fun_eq 1);
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
    60
by (rtac allI 1);
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
    61
by (rtac assoc 1);
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    62
qed "fun_assoc";
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    63
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    64
Goalw [times_fun_def, one_fun_def] "1 * x = (x::'a => 'b::monoid)";
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    65
by (stac expand_fun_eq 1);
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
    66
by (rtac allI 1);
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
    67
by (rtac Monoid.left_unit 1);
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    68
qed "fun_left_unit";
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    69
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    70
Goalw [times_fun_def, one_fun_def] "x * 1 = (x::'a => 'b::monoid)";
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    71
by (stac expand_fun_eq 1);
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
    72
by (rtac allI 1);
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
    73
by (rtac Monoid.right_unit 1);
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    74
qed "fun_right_unit";
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    75
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    76
Goalw [times_fun_def, inverse_fun_def, one_fun_def]
2907
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1899
diff changeset
    77
  "inverse x * x = (1::'a => 'b::group)";
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    78
by (stac expand_fun_eq 1);
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
    79
by (rtac allI 1);
2907
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1899
diff changeset
    80
by (rtac left_inverse 1);
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1899
diff changeset
    81
qed "fun_left_inverse";
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    82
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    83
Goalw [times_fun_def] "x * y = y * (x::'a => 'b::agroup)";
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    84
by (stac expand_fun_eq 1);
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
    85
by (rtac allI 1);
5d7a7e439cec expanded tabs
clasohm
parents: 1266
diff changeset
    86
by (rtac commut 1);
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    87
qed "fun_commut";