src/HOL/ex/MonoidGroup.thy
author nipkow
Fri Mar 06 17:38:47 2009 +0100 (2009-03-06)
changeset 30313 b2441b0c8d38
parent 21404 eb85850d3eb7
child 41460 ea56b98aee83
permissions -rw-r--r--
added lemmas
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@21404
    18
  monoid :: "(| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |) => bool" where
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@21404
    23
definition
wenzelm@21404
    24
  group :: "(| times :: 'a => 'a => 'a, one :: 'a, inv :: 'a => 'a, ... :: 'b |) => bool" where
wenzelm@19736
    25
  "group G = (monoid G \<and> (\<forall>x. times G (inv G x) x = one G))"
wenzelm@5199
    26
wenzelm@21404
    27
definition
wenzelm@11939
    28
  reverse :: "(| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |) =>
wenzelm@21404
    29
    (| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |)" where
wenzelm@19736
    30
  "reverse M = M (| times := \<lambda>x y. times M y x |)"
wenzelm@5199
    31
wenzelm@5199
    32
end