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