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