src/HOL/ex/MonoidGroup.thy
author wenzelm
Sat, 27 May 2006 17:42:02 +0200
changeset 19736 d8d0f8f51d69
parent 17388 495c799df31d
child 21404 eb85850d3eb7
permissions -rw-r--r--
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
     1
(*  Title:      HOL/ex/MonoidGroup.thy
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
     2
    ID:         $Id$
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
     3
    Author:     Markus Wenzel
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
     4
*)
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
     5
17388
495c799df31d tuned headers etc.;
wenzelm
parents: 16417
diff changeset
     6
header {* Monoids and Groups as predicates over record schemes *}
10357
wenzelm
parents: 9297
diff changeset
     7
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 14981
diff changeset
     8
theory MonoidGroup imports Main begin
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
     9
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    10
record 'a monoid_sig =
11019
wenzelm
parents: 10357
diff changeset
    11
  times :: "'a => 'a => 'a"
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    12
  one :: 'a
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    13
9297
wenzelm
parents: 9279
diff changeset
    14
record 'a group_sig = "'a monoid_sig" +
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    15
  inv :: "'a => 'a"
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    16
19736
wenzelm
parents: 17388
diff changeset
    17
definition
11939
c5e69470f03b updated records;
wenzelm
parents: 11019
diff changeset
    18
  monoid :: "(| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |) => bool"
19736
wenzelm
parents: 17388
diff changeset
    19
  "monoid M = (\<forall>x y z.
11019
wenzelm
parents: 10357
diff changeset
    20
    times M (times M x y) z = times M x (times M y z) \<and>
19736
wenzelm
parents: 17388
diff changeset
    21
    times M (one M) x = x \<and> times M x (one M) = x)"
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    22
11939
c5e69470f03b updated records;
wenzelm
parents: 11019
diff changeset
    23
  group :: "(| times :: 'a => 'a => 'a, one :: 'a, inv :: 'a => 'a, ... :: 'b |) => bool"
19736
wenzelm
parents: 17388
diff changeset
    24
  "group G = (monoid G \<and> (\<forall>x. times G (inv G x) x = one G))"
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    25
11939
c5e69470f03b updated records;
wenzelm
parents: 11019
diff changeset
    26
  reverse :: "(| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |) =>
11019
wenzelm
parents: 10357
diff changeset
    27
    (| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |)"
19736
wenzelm
parents: 17388
diff changeset
    28
  "reverse M = M (| times := \<lambda>x y. times M y x |)"
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    29
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    30
end