src/HOL/Algebra/Group.thy
author ballarin
Mon Feb 10 09:45:22 2003 +0100 (2003-02-10)
changeset 13813 722593f2f068
child 13817 7e031a968443
permissions -rw-r--r--
New development of algebra: Groups.
ballarin@13813
     1
(*
ballarin@13813
     2
  Title:  HOL/Algebra/Group.thy
ballarin@13813
     3
  Id:     $Id$
ballarin@13813
     4
  Author: Clemens Ballarin, started 4 February 2003
ballarin@13813
     5
ballarin@13813
     6
Based on work by Florian Kammueller, L C Paulson and Markus Wenzel.
ballarin@13813
     7
*)
ballarin@13813
     8
ballarin@13813
     9
header {* Algebraic Structures up to Abelian Groups *}
ballarin@13813
    10
ballarin@13813
    11
theory Group = FuncSet:
ballarin@13813
    12
ballarin@13813
    13
text {*
ballarin@13813
    14
  Definitions follow Jacobson, Basic Algebra I, Freeman, 1985; with
ballarin@13813
    15
  the exception of \emph{magma} which, following Bourbaki, is a set
ballarin@13813
    16
  together with a binary, closed operation.
ballarin@13813
    17
*}
ballarin@13813
    18
ballarin@13813
    19
section {* From Magmas to Groups *}
ballarin@13813
    20
ballarin@13813
    21
subsection {* Definitions *}
ballarin@13813
    22
ballarin@13813
    23
record 'a magma =
ballarin@13813
    24
  carrier :: "'a set"
ballarin@13813
    25
  mult :: "['a, 'a] => 'a" (infixl "\<otimes>\<index>" 70)
ballarin@13813
    26
ballarin@13813
    27
record 'a group = "'a magma" +
ballarin@13813
    28
  one :: 'a ("\<one>\<index>")
ballarin@13813
    29
  m_inv :: "'a => 'a" ("inv\<index> _" [81] 80)
ballarin@13813
    30
ballarin@13813
    31
locale magma = struct G +
ballarin@13813
    32
  assumes m_closed [intro, simp]:
ballarin@13813
    33
    "[| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
ballarin@13813
    34
ballarin@13813
    35
locale semigroup = magma +
ballarin@13813
    36
  assumes m_assoc:
ballarin@13813
    37
    "[| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
ballarin@13813
    38
     (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
ballarin@13813
    39
ballarin@13813
    40
locale group = semigroup +
ballarin@13813
    41
  assumes one_closed [intro, simp]: "\<one> \<in> carrier G"
ballarin@13813
    42
    and inv_closed [intro, simp]: "x \<in> carrier G ==> inv x \<in> carrier G"
ballarin@13813
    43
    and l_one [simp]: "x \<in> carrier G ==> \<one> \<otimes> x = x"
ballarin@13813
    44
    and l_inv: "x \<in> carrier G ==> inv x \<otimes> x = \<one>"
ballarin@13813
    45
ballarin@13813
    46
subsection {* Cancellation Laws and Basic Properties *}
ballarin@13813
    47
ballarin@13813
    48
lemma (in group) l_cancel [simp]:
ballarin@13813
    49
  "[| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
ballarin@13813
    50
   (x \<otimes> y = x \<otimes> z) = (y = z)"
ballarin@13813
    51
proof
ballarin@13813
    52
  assume eq: "x \<otimes> y = x \<otimes> z"
ballarin@13813
    53
    and G: "x \<in> carrier G" "y \<in> carrier G" "z \<in> carrier G"
ballarin@13813
    54
  then have "(inv x \<otimes> x) \<otimes> y = (inv x \<otimes> x) \<otimes> z" by (simp add: m_assoc)
ballarin@13813
    55
  with G show "y = z" by (simp add: l_inv)
ballarin@13813
    56
next
ballarin@13813
    57
  assume eq: "y = z"
ballarin@13813
    58
    and G: "x \<in> carrier G" "y \<in> carrier G" "z \<in> carrier G"
ballarin@13813
    59
  then show "x \<otimes> y = x \<otimes> z" by simp
ballarin@13813
    60
qed
ballarin@13813
    61
ballarin@13813
    62
lemma (in group) r_one [simp]:  
ballarin@13813
    63
  "x \<in> carrier G ==> x \<otimes> \<one> = x"
ballarin@13813
    64
proof -
ballarin@13813
    65
  assume x: "x \<in> carrier G"
ballarin@13813
    66
  then have "inv x \<otimes> (x \<otimes> \<one>) = inv x \<otimes> x"
ballarin@13813
    67
    by (simp add: m_assoc [symmetric] l_inv)
ballarin@13813
    68
  with x show ?thesis by simp 
ballarin@13813
    69
qed
ballarin@13813
    70
ballarin@13813
    71
lemma (in group) r_inv:
ballarin@13813
    72
  "x \<in> carrier G ==> x \<otimes> inv x = \<one>"
ballarin@13813
    73
proof -
ballarin@13813
    74
  assume x: "x \<in> carrier G"
ballarin@13813
    75
  then have "inv x \<otimes> (x \<otimes> inv x) = inv x \<otimes> \<one>"
ballarin@13813
    76
    by (simp add: m_assoc [symmetric] l_inv)
ballarin@13813
    77
  with x show ?thesis by (simp del: r_one)
ballarin@13813
    78
qed
ballarin@13813
    79
ballarin@13813
    80
lemma (in group) r_cancel [simp]:
ballarin@13813
    81
  "[| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
ballarin@13813
    82
   (y \<otimes> x = z \<otimes> x) = (y = z)"
ballarin@13813
    83
proof
ballarin@13813
    84
  assume eq: "y \<otimes> x = z \<otimes> x"
ballarin@13813
    85
    and G: "x \<in> carrier G" "y \<in> carrier G" "z \<in> carrier G"
ballarin@13813
    86
  then have "y \<otimes> (x \<otimes> inv x) = z \<otimes> (x \<otimes> inv x)"
ballarin@13813
    87
    by (simp add: m_assoc [symmetric])
ballarin@13813
    88
  with G show "y = z" by (simp add: r_inv)
ballarin@13813
    89
next
ballarin@13813
    90
  assume eq: "y = z"
ballarin@13813
    91
    and G: "x \<in> carrier G" "y \<in> carrier G" "z \<in> carrier G"
ballarin@13813
    92
  then show "y \<otimes> x = z \<otimes> x" by simp
ballarin@13813
    93
qed
ballarin@13813
    94
ballarin@13813
    95
lemma (in group) inv_inv [simp]:
ballarin@13813
    96
  "x \<in> carrier G ==> inv (inv x) = x"
ballarin@13813
    97
proof -
ballarin@13813
    98
  assume x: "x \<in> carrier G"
ballarin@13813
    99
  then have "inv x \<otimes> inv (inv x) = inv x \<otimes> x" by (simp add: l_inv r_inv)
ballarin@13813
   100
  with x show ?thesis by simp
ballarin@13813
   101
qed
ballarin@13813
   102
ballarin@13813
   103
lemma (in group) inv_mult:
ballarin@13813
   104
  "[| x \<in> carrier G; y \<in> carrier G |] ==> inv (x \<otimes> y) = inv y \<otimes> inv x"
ballarin@13813
   105
proof -
ballarin@13813
   106
  assume G: "x \<in> carrier G" "y \<in> carrier G"
ballarin@13813
   107
  then have "inv (x \<otimes> y) \<otimes> (x \<otimes> y) = (inv y \<otimes> inv x) \<otimes> (x \<otimes> y)"
ballarin@13813
   108
    by (simp add: m_assoc l_inv) (simp add: m_assoc [symmetric] l_inv)
ballarin@13813
   109
  with G show ?thesis by simp
ballarin@13813
   110
qed
ballarin@13813
   111
ballarin@13813
   112
subsection {* Substructures *}
ballarin@13813
   113
ballarin@13813
   114
locale submagma = var H + struct G +
ballarin@13813
   115
  assumes subset [intro, simp]: "H \<subseteq> carrier G"
ballarin@13813
   116
    and m_closed [intro, simp]: "[| x \<in> H; y \<in> H |] ==> x \<otimes> y \<in> H"
ballarin@13813
   117
ballarin@13813
   118
declare (in submagma) magma.intro [intro] semigroup.intro [intro]
ballarin@13813
   119
ballarin@13813
   120
(*
ballarin@13813
   121
alternative definition of submagma
ballarin@13813
   122
ballarin@13813
   123
locale submagma = var H + struct G +
ballarin@13813
   124
  assumes subset [intro, simp]: "carrier H \<subseteq> carrier G"
ballarin@13813
   125
    and m_equal [simp]: "mult H = mult G"
ballarin@13813
   126
    and m_closed [intro, simp]:
ballarin@13813
   127
      "[| x \<in> carrier H; y \<in> carrier H |] ==> x \<otimes> y \<in> carrier H"
ballarin@13813
   128
*)
ballarin@13813
   129
ballarin@13813
   130
lemma submagma_imp_subset:
ballarin@13813
   131
  "submagma H G ==> H \<subseteq> carrier G"
ballarin@13813
   132
  by (rule submagma.subset)
ballarin@13813
   133
ballarin@13813
   134
lemma (in submagma) subsetD [dest, simp]:
ballarin@13813
   135
  "x \<in> H ==> x \<in> carrier G"
ballarin@13813
   136
  using subset by blast
ballarin@13813
   137
ballarin@13813
   138
lemma (in submagma) magmaI [intro]:
ballarin@13813
   139
  includes magma G
ballarin@13813
   140
  shows "magma (G(| carrier := H |))"
ballarin@13813
   141
  by rule simp
ballarin@13813
   142
ballarin@13813
   143
lemma (in submagma) semigroup_axiomsI [intro]:
ballarin@13813
   144
  includes semigroup G
ballarin@13813
   145
  shows "semigroup_axioms (G(| carrier := H |))"
ballarin@13813
   146
    by rule (simp add: m_assoc)
ballarin@13813
   147
ballarin@13813
   148
lemma (in submagma) semigroupI [intro]:
ballarin@13813
   149
  includes semigroup G
ballarin@13813
   150
  shows "semigroup (G(| carrier := H |))"
ballarin@13813
   151
  using prems by fast
ballarin@13813
   152
ballarin@13813
   153
locale subgroup = submagma H G +
ballarin@13813
   154
  assumes one_closed [intro, simp]: "\<one> \<in> H"
ballarin@13813
   155
    and m_inv_closed [intro, simp]: "x \<in> H ==> inv x \<in> H"
ballarin@13813
   156
ballarin@13813
   157
declare (in subgroup) group.intro [intro]
ballarin@13813
   158
ballarin@13813
   159
lemma (in subgroup) group_axiomsI [intro]:
ballarin@13813
   160
  includes group G
ballarin@13813
   161
  shows "group_axioms (G(| carrier := H |))"
ballarin@13813
   162
  by rule (simp_all add: l_inv)
ballarin@13813
   163
ballarin@13813
   164
lemma (in subgroup) groupI [intro]:
ballarin@13813
   165
  includes group G
ballarin@13813
   166
  shows "group (G(| carrier := H |))"
ballarin@13813
   167
  using prems by fast
ballarin@13813
   168
ballarin@13813
   169
text {*
ballarin@13813
   170
  Since @{term H} is nonempty, it contains some element @{term x}.  Since
ballarin@13813
   171
  it is closed under inverse, it contains @{text "inv x"}.  Since
ballarin@13813
   172
  it is closed under product, it contains @{text "x \<otimes> inv x = \<one>"}.
ballarin@13813
   173
*}
ballarin@13813
   174
ballarin@13813
   175
lemma (in group) one_in_subset:
ballarin@13813
   176
  "[| H \<subseteq> carrier G; H \<noteq> {}; \<forall>a \<in> H. inv a \<in> H; \<forall>a\<in>H. \<forall>b\<in>H. a \<otimes> b \<in> H |]
ballarin@13813
   177
   ==> \<one> \<in> H"
ballarin@13813
   178
by (force simp add: l_inv)
ballarin@13813
   179
ballarin@13813
   180
text {* A characterization of subgroups: closed, non-empty subset. *}
ballarin@13813
   181
ballarin@13813
   182
lemma (in group) subgroupI:
ballarin@13813
   183
  assumes subset: "H \<subseteq> carrier G" and non_empty: "H \<noteq> {}"
ballarin@13813
   184
    and inv: "!!a. a \<in> H ==> inv a \<in> H"
ballarin@13813
   185
    and mult: "!!a b. [|a \<in> H; b \<in> H|] ==> a \<otimes> b \<in> H"
ballarin@13813
   186
  shows "subgroup H G"
ballarin@13813
   187
proof
ballarin@13813
   188
  from subset and mult show "submagma H G" ..
ballarin@13813
   189
next
ballarin@13813
   190
  have "\<one> \<in> H" by (rule one_in_subset) (auto simp only: prems)
ballarin@13813
   191
  with inv show "subgroup_axioms H G"
ballarin@13813
   192
    by (intro subgroup_axioms.intro) simp_all
ballarin@13813
   193
qed
ballarin@13813
   194
ballarin@13813
   195
text {*
ballarin@13813
   196
  Repeat facts of submagmas for subgroups.  Necessary???
ballarin@13813
   197
*}
ballarin@13813
   198
ballarin@13813
   199
lemma (in subgroup) subset:
ballarin@13813
   200
  "H \<subseteq> carrier G"
ballarin@13813
   201
  ..
ballarin@13813
   202
ballarin@13813
   203
lemma (in subgroup) m_closed:
ballarin@13813
   204
  "[| x \<in> H; y \<in> H |] ==> x \<otimes> y \<in> H"
ballarin@13813
   205
  ..
ballarin@13813
   206
ballarin@13813
   207
declare magma.m_closed [simp]
ballarin@13813
   208
ballarin@13813
   209
declare group.one_closed [iff] group.inv_closed [simp]
ballarin@13813
   210
  group.l_one [simp] group.r_one [simp] group.inv_inv [simp]
ballarin@13813
   211
ballarin@13813
   212
lemma subgroup_nonempty:
ballarin@13813
   213
  "~ subgroup {} G"
ballarin@13813
   214
  by (blast dest: subgroup.one_closed)
ballarin@13813
   215
ballarin@13813
   216
lemma (in subgroup) finite_imp_card_positive:
ballarin@13813
   217
  "finite (carrier G) ==> 0 < card H"
ballarin@13813
   218
proof (rule classical)
ballarin@13813
   219
  have sub: "subgroup H G" using prems ..
ballarin@13813
   220
  assume fin: "finite (carrier G)"
ballarin@13813
   221
    and zero: "~ 0 < card H"
ballarin@13813
   222
  then have "finite H" by (blast intro: finite_subset dest: subset)
ballarin@13813
   223
  with zero sub have "subgroup {} G" by simp
ballarin@13813
   224
  with subgroup_nonempty show ?thesis by contradiction
ballarin@13813
   225
qed
ballarin@13813
   226
ballarin@13813
   227
subsection {* Direct Products *}
ballarin@13813
   228
ballarin@13813
   229
constdefs
ballarin@13813
   230
  DirProdMagma ::
ballarin@13813
   231
    "[('a, 'c) magma_scheme, ('b, 'd) magma_scheme] => ('a \<times> 'b) magma"
ballarin@13813
   232
    (infixr "\<times>\<^sub>m" 80)
ballarin@13813
   233
  "G \<times>\<^sub>m H == (| carrier = carrier G \<times> carrier H,
ballarin@13813
   234
    mult = (%(xg, xh) (yg, yh). (mult G xg yg, mult H xh yh)) |)"
ballarin@13813
   235
ballarin@13813
   236
  DirProdGroup ::
ballarin@13813
   237
    "[('a, 'c) group_scheme, ('b, 'd) group_scheme] => ('a \<times> 'b) group"
ballarin@13813
   238
    (infixr "\<times>\<^sub>g" 80)
ballarin@13813
   239
  "G \<times>\<^sub>g H == (| carrier = carrier (G \<times>\<^sub>m H),
ballarin@13813
   240
    mult = mult (G \<times>\<^sub>m H),
ballarin@13813
   241
    one = (one G, one H),
ballarin@13813
   242
    m_inv = (%(g, h). (m_inv G g, m_inv H h)) |)"
ballarin@13813
   243
ballarin@13813
   244
lemma DirProdMagma_magma:
ballarin@13813
   245
  includes magma G + magma H
ballarin@13813
   246
  shows "magma (G \<times>\<^sub>m H)"
ballarin@13813
   247
  by rule (auto simp add: DirProdMagma_def)
ballarin@13813
   248
ballarin@13813
   249
lemma DirProdMagma_semigroup_axioms:
ballarin@13813
   250
  includes semigroup G + semigroup H
ballarin@13813
   251
  shows "semigroup_axioms (G \<times>\<^sub>m H)"
ballarin@13813
   252
  by rule (auto simp add: DirProdMagma_def G.m_assoc H.m_assoc)
ballarin@13813
   253
ballarin@13813
   254
lemma DirProdMagma_semigroup:
ballarin@13813
   255
  includes semigroup G + semigroup H
ballarin@13813
   256
  shows "semigroup (G \<times>\<^sub>m H)"
ballarin@13813
   257
  using prems
ballarin@13813
   258
  by (fast intro: semigroup.intro
ballarin@13813
   259
    DirProdMagma_magma DirProdMagma_semigroup_axioms)
ballarin@13813
   260
ballarin@13813
   261
lemma DirProdGroup_magma:
ballarin@13813
   262
  includes magma G + magma H
ballarin@13813
   263
  shows "magma (G \<times>\<^sub>g H)"
ballarin@13813
   264
  by rule (auto simp add: DirProdGroup_def DirProdMagma_def)
ballarin@13813
   265
ballarin@13813
   266
lemma DirProdGroup_semigroup_axioms:
ballarin@13813
   267
  includes semigroup G + semigroup H
ballarin@13813
   268
  shows "semigroup_axioms (G \<times>\<^sub>g H)"
ballarin@13813
   269
  by rule
ballarin@13813
   270
    (auto simp add: DirProdGroup_def DirProdMagma_def G.m_assoc H.m_assoc)
ballarin@13813
   271
ballarin@13813
   272
lemma DirProdGroup_semigroup:
ballarin@13813
   273
  includes semigroup G + semigroup H
ballarin@13813
   274
  shows "semigroup (G \<times>\<^sub>g H)"
ballarin@13813
   275
  using prems
ballarin@13813
   276
  by (fast intro: semigroup.intro
ballarin@13813
   277
    DirProdGroup_magma DirProdGroup_semigroup_axioms)
ballarin@13813
   278
ballarin@13813
   279
(* ... and further lemmas for group ... *)
ballarin@13813
   280
ballarin@13813
   281
lemma
ballarin@13813
   282
  includes group G + group H
ballarin@13813
   283
  shows "group (G \<times>\<^sub>g H)"
ballarin@13813
   284
by rule
ballarin@13813
   285
  (auto intro: magma.intro semigroup_axioms.intro group_axioms.intro
ballarin@13813
   286
    simp add: DirProdGroup_def DirProdMagma_def
ballarin@13813
   287
      G.m_assoc H.m_assoc G.l_inv H.l_inv)
ballarin@13813
   288
ballarin@13813
   289
subsection {* Homomorphisms *}
ballarin@13813
   290
ballarin@13813
   291
constdefs
ballarin@13813
   292
  hom :: "[('a, 'c) magma_scheme, ('b, 'd) magma_scheme] => ('a => 'b)set"
ballarin@13813
   293
  "hom G H ==
ballarin@13813
   294
    {h. h \<in> carrier G -> carrier H &
ballarin@13813
   295
      (\<forall>x \<in> carrier G. \<forall>y \<in> carrier G. h (mult G x y) = mult H (h x) (h y))}"
ballarin@13813
   296
ballarin@13813
   297
lemma (in semigroup) hom:
ballarin@13813
   298
  includes semigroup G
ballarin@13813
   299
  shows "semigroup (| carrier = hom G G, mult = op o |)"
ballarin@13813
   300
proof
ballarin@13813
   301
  show "magma (| carrier = hom G G, mult = op o |)"
ballarin@13813
   302
    by rule (simp add: Pi_def hom_def)
ballarin@13813
   303
next
ballarin@13813
   304
  show "semigroup_axioms (| carrier = hom G G, mult = op o |)"
ballarin@13813
   305
    by rule (simp add: o_assoc)
ballarin@13813
   306
qed
ballarin@13813
   307
ballarin@13813
   308
lemma hom_mult:
ballarin@13813
   309
  "[| h \<in> hom G H; x \<in> carrier G; y \<in> carrier G |] 
ballarin@13813
   310
   ==> h (mult G x y) = mult H (h x) (h y)"
ballarin@13813
   311
  by (simp add: hom_def) 
ballarin@13813
   312
ballarin@13813
   313
lemma hom_closed:
ballarin@13813
   314
  "[| h \<in> hom G H; x \<in> carrier G |] ==> h x \<in> carrier H"
ballarin@13813
   315
  by (auto simp add: hom_def funcset_mem)
ballarin@13813
   316
ballarin@13813
   317
locale group_hom = group G + group H + var h +
ballarin@13813
   318
  assumes homh: "h \<in> hom G H"
ballarin@13813
   319
  notes hom_mult [simp] = hom_mult [OF homh]
ballarin@13813
   320
    and hom_closed [simp] = hom_closed [OF homh]
ballarin@13813
   321
ballarin@13813
   322
lemma (in group_hom) one_closed [simp]:
ballarin@13813
   323
  "h \<one> \<in> carrier H"
ballarin@13813
   324
  by simp
ballarin@13813
   325
ballarin@13813
   326
lemma (in group_hom) hom_one [simp]:
ballarin@13813
   327
  "h \<one> = \<one>\<^sub>2"
ballarin@13813
   328
proof -
ballarin@13813
   329
  have "h \<one> \<otimes>\<^sub>2 \<one>\<^sub>2 = h \<one> \<otimes>\<^sub>2 h \<one>"
ballarin@13813
   330
    by (simp add: hom_mult [symmetric] del: hom_mult)
ballarin@13813
   331
  then show ?thesis by (simp del: r_one)
ballarin@13813
   332
qed
ballarin@13813
   333
ballarin@13813
   334
lemma (in group_hom) inv_closed [simp]:
ballarin@13813
   335
  "x \<in> carrier G ==> h (inv x) \<in> carrier H"
ballarin@13813
   336
  by simp
ballarin@13813
   337
ballarin@13813
   338
lemma (in group_hom) hom_inv [simp]:
ballarin@13813
   339
  "x \<in> carrier G ==> h (inv x) = inv\<^sub>2 (h x)"
ballarin@13813
   340
proof -
ballarin@13813
   341
  assume x: "x \<in> carrier G"
ballarin@13813
   342
  then have "h x \<otimes>\<^sub>2 h (inv x) = \<one>\<^sub>2"
ballarin@13813
   343
    by (simp add: hom_mult [symmetric] G.r_inv del: hom_mult)
ballarin@13813
   344
  also from x have "... = h x \<otimes>\<^sub>2 inv\<^sub>2 (h x)"
ballarin@13813
   345
    by (simp add: hom_mult [symmetric] H.r_inv del: hom_mult)
ballarin@13813
   346
  finally have "h x \<otimes>\<^sub>2 h (inv x) = h x \<otimes>\<^sub>2 inv\<^sub>2 (h x)" .
ballarin@13813
   347
  with x show ?thesis by simp
ballarin@13813
   348
qed
ballarin@13813
   349
ballarin@13813
   350
section {* Abelian Structures *}
ballarin@13813
   351
ballarin@13813
   352
subsection {* Definition *}
ballarin@13813
   353
ballarin@13813
   354
locale abelian_semigroup = semigroup +
ballarin@13813
   355
  assumes m_comm: "[| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y = y \<otimes> x"
ballarin@13813
   356
ballarin@13813
   357
lemma (in abelian_semigroup) m_lcomm:
ballarin@13813
   358
  "[| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
ballarin@13813
   359
   x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)"
ballarin@13813
   360
proof -
ballarin@13813
   361
  assume xyz: "x \<in> carrier G" "y \<in> carrier G" "z \<in> carrier G"
ballarin@13813
   362
  from xyz have "x \<otimes> (y \<otimes> z) = (x \<otimes> y) \<otimes> z" by (simp add: m_assoc)
ballarin@13813
   363
  also from xyz have "... = (y \<otimes> x) \<otimes> z" by (simp add: m_comm)
ballarin@13813
   364
  also from xyz have "... = y \<otimes> (x \<otimes> z)" by (simp add: m_assoc)
ballarin@13813
   365
  finally show ?thesis .
ballarin@13813
   366
qed
ballarin@13813
   367
ballarin@13813
   368
lemmas (in abelian_semigroup) ac = m_assoc m_comm m_lcomm
ballarin@13813
   369
ballarin@13813
   370
locale abelian_group = abelian_semigroup + group
ballarin@13813
   371
ballarin@13813
   372
end