src/HOL/ex/MonoidGroup.thy
author wenzelm
Thu, 25 Oct 2001 22:43:05 +0200
changeset 11939 c5e69470f03b
parent 11019 e968e5bfe98d
child 14981 e73f8140af78
permissions -rw-r--r--
updated records;
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
9297
wenzelm
parents: 9279
diff changeset
     4
    License:    GPL (GNU GENERAL PUBLIC LICENSE)
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
     5
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
     6
Monoids and Groups as predicates over record schemes.
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
     7
*)
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
     8
10357
wenzelm
parents: 9297
diff changeset
     9
header {* Monoids and Groups *}
wenzelm
parents: 9297
diff changeset
    10
9297
wenzelm
parents: 9279
diff changeset
    11
theory MonoidGroup = Main:
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    12
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    13
record 'a monoid_sig =
11019
wenzelm
parents: 10357
diff changeset
    14
  times :: "'a => 'a => 'a"
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    15
  one :: 'a
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    16
9297
wenzelm
parents: 9279
diff changeset
    17
record 'a group_sig = "'a monoid_sig" +
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    18
  inv :: "'a => 'a"
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    19
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    20
constdefs
11939
c5e69470f03b updated records;
wenzelm
parents: 11019
diff changeset
    21
  monoid :: "(| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |) => bool"
11019
wenzelm
parents: 10357
diff changeset
    22
  "monoid M == \<forall>x y z.
wenzelm
parents: 10357
diff changeset
    23
    times M (times M x y) z = times M x (times M y z) \<and>
wenzelm
parents: 10357
diff changeset
    24
    times M (one M) x = x \<and> times M x (one M) = x"
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    25
11939
c5e69470f03b updated records;
wenzelm
parents: 11019
diff changeset
    26
  group :: "(| times :: 'a => 'a => 'a, one :: 'a, inv :: 'a => 'a, ... :: 'b |) => bool"
11019
wenzelm
parents: 10357
diff changeset
    27
  "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
    28
11939
c5e69470f03b updated records;
wenzelm
parents: 11019
diff changeset
    29
  reverse :: "(| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |) =>
11019
wenzelm
parents: 10357
diff changeset
    30
    (| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |)"
wenzelm
parents: 10357
diff changeset
    31
  "reverse M == M (| times := \<lambda>x y. times M y x |)"
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    32
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
    33
end