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