src/HOL/Algebra/Group.thy
author paulson
Wed, 26 May 2004 11:43:50 +0200
changeset 14803 f7557773cc87
parent 14761 28b5eb4a867f
child 14852 fffab59e0050
permissions -rw-r--r--
more group isomorphisms
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
13949
0ce528cd6f19 HOL-Algebra complete for release Isabelle2003 (modulo section headers).
ballarin
parents: 13944
diff changeset
     9
header {* Groups *}
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    10
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
    11
theory Group = FuncSet + Lattice:
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    12
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
    13
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    14
section {* From Magmas to Groups *}
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    15
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    16
text {*
14706
71590b7733b7 tuned document;
wenzelm
parents: 14693
diff changeset
    17
  Definitions follow \cite{Jacobson:1985}; with the exception of
71590b7733b7 tuned document;
wenzelm
parents: 14693
diff changeset
    18
  \emph{magma} which, following Bourbaki, is a set together with a
71590b7733b7 tuned document;
wenzelm
parents: 14693
diff changeset
    19
  binary, closed operation.
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    20
*}
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    21
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    22
subsection {* Definitions *}
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    23
14286
0ae66ffb9784 New structure "partial_object" as common root for lattices and magmas.
ballarin
parents: 14254
diff changeset
    24
record 'a semigroup = "'a partial_object" +
13813
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
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
    30
constdefs (structure G)
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
    31
  m_inv :: "_ => 'a => 'a" ("inv\<index> _" [81] 80)
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
    32
  "inv x == (THE y. y \<in> carrier G & x \<otimes> y = \<one> & y \<otimes> x = \<one>)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    33
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
    34
  Units :: "_ => 'a set"
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
    35
  "Units G == {y. y \<in> carrier G & (EX x : carrier G. x \<otimes> y = \<one> & y \<otimes> x = \<one>)}"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    36
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    37
consts
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    38
  pow :: "[('a, 'm) monoid_scheme, 'a, 'b::number] => 'a" (infixr "'(^')\<index>" 75)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    39
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    40
defs (overloaded)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    41
  nat_pow_def: "pow G a n == nat_rec \<one>\<^bsub>G\<^esub> (%u b. b \<otimes>\<^bsub>G\<^esub> a) n"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    42
  int_pow_def: "pow G a z ==
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    43
    let p = nat_rec \<one>\<^bsub>G\<^esub> (%u b. b \<otimes>\<^bsub>G\<^esub> a)
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    44
    in if neg z then inv\<^bsub>G\<^esub> (p (nat (-z))) else p (nat z)"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    45
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    46
locale magma = struct G +
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    47
  assumes m_closed [intro, simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    48
    "[| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    49
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    50
locale semigroup = magma +
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    51
  assumes m_assoc:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    52
    "[| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    53
    (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    54
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    55
locale monoid = semigroup +
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    56
  assumes one_closed [intro, simp]: "\<one> \<in> carrier G"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    57
    and l_one [simp]: "x \<in> carrier G ==> \<one> \<otimes> x = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    58
    and r_one [simp]: "x \<in> carrier G ==> x \<otimes> \<one> = x"
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
    59
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    60
lemma monoidI:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    61
  includes struct G
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    62
  assumes m_closed:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    63
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    64
    and one_closed: "\<one> \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    65
    and m_assoc:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    66
      "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    67
      (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    68
    and l_one: "!!x. x \<in> carrier G ==> \<one> \<otimes> x = x"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    69
    and r_one: "!!x. x \<in> carrier G ==> x \<otimes> \<one> = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    70
  shows "monoid G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    71
  by (fast intro!: monoid.intro magma.intro semigroup_axioms.intro
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    72
    semigroup.intro monoid_axioms.intro
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    73
    intro: prems)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    74
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    75
lemma (in monoid) Units_closed [dest]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    76
  "x \<in> Units G ==> x \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    77
  by (unfold Units_def) fast
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    78
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    79
lemma (in monoid) inv_unique:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    80
  assumes eq: "y \<otimes> x = \<one>"  "x \<otimes> y' = \<one>"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    81
    and G: "x \<in> carrier G"  "y \<in> carrier G"  "y' \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    82
  shows "y = y'"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    83
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    84
  from G eq have "y = y \<otimes> (x \<otimes> y')" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    85
  also from G have "... = (y \<otimes> x) \<otimes> y'" by (simp add: m_assoc)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    86
  also from G eq have "... = y'" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    87
  finally show ?thesis .
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    88
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    89
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
    90
lemma (in monoid) Units_one_closed [intro, simp]:
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
    91
  "\<one> \<in> Units G"
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
    92
  by (unfold Units_def) auto
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
    93
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    94
lemma (in monoid) Units_inv_closed [intro, simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    95
  "x \<in> Units G ==> inv x \<in> carrier G"
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
    96
  apply (unfold Units_def m_inv_def, auto)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    97
  apply (rule theI2, fast)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
    98
   apply (fast intro: inv_unique, fast)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    99
  done
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   100
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   101
lemma (in monoid) Units_l_inv:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   102
  "x \<in> Units G ==> inv x \<otimes> x = \<one>"
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   103
  apply (unfold Units_def m_inv_def, auto)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   104
  apply (rule theI2, fast)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   105
   apply (fast intro: inv_unique, fast)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   106
  done
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   107
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   108
lemma (in monoid) Units_r_inv:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   109
  "x \<in> Units G ==> x \<otimes> inv x = \<one>"
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   110
  apply (unfold Units_def m_inv_def, auto)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   111
  apply (rule theI2, fast)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   112
   apply (fast intro: inv_unique, fast)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   113
  done
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   114
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   115
lemma (in monoid) Units_inv_Units [intro, simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   116
  "x \<in> Units G ==> inv x \<in> Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   117
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   118
  assume x: "x \<in> Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   119
  show "inv x \<in> Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   120
    by (auto simp add: Units_def
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   121
      intro: Units_l_inv Units_r_inv x Units_closed [OF x])
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   122
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   123
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   124
lemma (in monoid) Units_l_cancel [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   125
  "[| x \<in> Units G; y \<in> carrier G; z \<in> carrier G |] ==>
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   126
   (x \<otimes> y = x \<otimes> z) = (y = z)"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   127
proof
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   128
  assume eq: "x \<otimes> y = x \<otimes> z"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   129
    and G: "x \<in> Units G"  "y \<in> carrier G"  "z \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   130
  then have "(inv x \<otimes> x) \<otimes> y = (inv x \<otimes> x) \<otimes> z"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   131
    by (simp add: m_assoc Units_closed)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   132
  with G show "y = z" by (simp add: Units_l_inv)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   133
next
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   134
  assume eq: "y = z"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   135
    and G: "x \<in> Units G"  "y \<in> carrier G"  "z \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   136
  then show "x \<otimes> y = x \<otimes> z" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   137
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   138
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   139
lemma (in monoid) Units_inv_inv [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   140
  "x \<in> Units G ==> inv (inv x) = x"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   141
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   142
  assume x: "x \<in> Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   143
  then have "inv x \<otimes> inv (inv x) = inv x \<otimes> x"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   144
    by (simp add: Units_l_inv Units_r_inv)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   145
  with x show ?thesis by (simp add: Units_closed)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   146
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   147
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   148
lemma (in monoid) inv_inj_on_Units:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   149
  "inj_on (m_inv G) (Units G)"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   150
proof (rule inj_onI)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   151
  fix x y
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   152
  assume G: "x \<in> Units G"  "y \<in> Units G" and eq: "inv x = inv y"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   153
  then have "inv (inv x) = inv (inv y)" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   154
  with G show "x = y" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   155
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   156
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   157
lemma (in monoid) Units_inv_comm:
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   158
  assumes inv: "x \<otimes> y = \<one>"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   159
    and G: "x \<in> Units G"  "y \<in> Units G"
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   160
  shows "y \<otimes> x = \<one>"
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   161
proof -
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   162
  from G have "x \<otimes> y \<otimes> x = x \<otimes> \<one>" by (auto simp add: inv Units_closed)
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   163
  with G show ?thesis by (simp del: r_one add: m_assoc Units_closed)
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   164
qed
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   165
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   166
text {* Power *}
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   167
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   168
lemma (in monoid) nat_pow_closed [intro, simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   169
  "x \<in> carrier G ==> x (^) (n::nat) \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   170
  by (induct n) (simp_all add: nat_pow_def)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   171
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   172
lemma (in monoid) nat_pow_0 [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   173
  "x (^) (0::nat) = \<one>"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   174
  by (simp add: nat_pow_def)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   175
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   176
lemma (in monoid) nat_pow_Suc [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   177
  "x (^) (Suc n) = x (^) n \<otimes> x"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   178
  by (simp add: nat_pow_def)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   179
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   180
lemma (in monoid) nat_pow_one [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   181
  "\<one> (^) (n::nat) = \<one>"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   182
  by (induct n) simp_all
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   183
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   184
lemma (in monoid) nat_pow_mult:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   185
  "x \<in> carrier G ==> x (^) (n::nat) \<otimes> x (^) m = x (^) (n + m)"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   186
  by (induct m) (simp_all add: m_assoc [THEN sym])
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   187
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   188
lemma (in monoid) nat_pow_pow:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   189
  "x \<in> carrier G ==> (x (^) n) (^) m = x (^) (n * m::nat)"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   190
  by (induct m) (simp, simp add: nat_pow_mult add_commute)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   191
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   192
text {*
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   193
  A group is a monoid all of whose elements are invertible.
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   194
*}
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   195
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   196
locale group = monoid +
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   197
  assumes Units: "carrier G <= Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   198
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   199
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   200
lemma (in group) is_group: "group G"
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   201
  by (rule group.intro [OF prems]) 
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   202
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   203
theorem groupI:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   204
  includes struct G
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   205
  assumes m_closed [simp]:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   206
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   207
    and one_closed [simp]: "\<one> \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   208
    and m_assoc:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   209
      "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   210
      (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   211
    and l_one [simp]: "!!x. x \<in> carrier G ==> \<one> \<otimes> x = x"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   212
    and l_inv_ex: "!!x. x \<in> carrier G ==> EX y : carrier G. y \<otimes> x = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   213
  shows "group G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   214
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   215
  have l_cancel [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   216
    "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   217
    (x \<otimes> y = x \<otimes> z) = (y = z)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   218
  proof
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   219
    fix x y z
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   220
    assume eq: "x \<otimes> y = x \<otimes> z"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   221
      and G: "x \<in> carrier G"  "y \<in> carrier G"  "z \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   222
    with l_inv_ex obtain x_inv where xG: "x_inv \<in> carrier G"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   223
      and l_inv: "x_inv \<otimes> x = \<one>" by fast
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   224
    from G eq xG have "(x_inv \<otimes> x) \<otimes> y = (x_inv \<otimes> x) \<otimes> z"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   225
      by (simp add: m_assoc)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   226
    with G show "y = z" by (simp add: l_inv)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   227
  next
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   228
    fix x y z
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   229
    assume eq: "y = z"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   230
      and G: "x \<in> carrier G"  "y \<in> carrier G"  "z \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   231
    then show "x \<otimes> y = x \<otimes> z" by simp
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   232
  qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   233
  have r_one:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   234
    "!!x. x \<in> carrier G ==> x \<otimes> \<one> = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   235
  proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   236
    fix x
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   237
    assume x: "x \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   238
    with l_inv_ex obtain x_inv where xG: "x_inv \<in> carrier G"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   239
      and l_inv: "x_inv \<otimes> x = \<one>" by fast
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   240
    from x xG have "x_inv \<otimes> (x \<otimes> \<one>) = x_inv \<otimes> x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   241
      by (simp add: m_assoc [symmetric] l_inv)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   242
    with x xG show "x \<otimes> \<one> = x" by simp
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   243
  qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   244
  have inv_ex:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   245
    "!!x. x \<in> carrier G ==> EX y : carrier G. y \<otimes> x = \<one> & x \<otimes> y = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   246
  proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   247
    fix x
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   248
    assume x: "x \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   249
    with l_inv_ex obtain y where y: "y \<in> carrier G"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   250
      and l_inv: "y \<otimes> x = \<one>" by fast
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   251
    from x y have "y \<otimes> (x \<otimes> y) = y \<otimes> \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   252
      by (simp add: m_assoc [symmetric] l_inv r_one)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   253
    with x y have r_inv: "x \<otimes> y = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   254
      by simp
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   255
    from x y show "EX y : carrier G. y \<otimes> x = \<one> & x \<otimes> y = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   256
      by (fast intro: l_inv r_inv)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   257
  qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   258
  then have carrier_subset_Units: "carrier G <= Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   259
    by (unfold Units_def) fast
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   260
  show ?thesis
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   261
    by (fast intro!: group.intro magma.intro semigroup_axioms.intro
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   262
      semigroup.intro monoid_axioms.intro group_axioms.intro
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   263
      carrier_subset_Units intro: prems r_one)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   264
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   265
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   266
lemma (in monoid) monoid_groupI:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   267
  assumes l_inv_ex:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   268
    "!!x. x \<in> carrier G ==> EX y : carrier G. y \<otimes> x = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   269
  shows "group G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   270
  by (rule groupI) (auto intro: m_assoc l_inv_ex)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   271
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   272
lemma (in group) Units_eq [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   273
  "Units G = carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   274
proof
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   275
  show "Units G <= carrier G" by fast
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   276
next
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   277
  show "carrier G <= Units G" by (rule Units)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   278
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   279
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   280
lemma (in group) inv_closed [intro, simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   281
  "x \<in> carrier G ==> inv x \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   282
  using Units_inv_closed by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   283
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   284
lemma (in group) l_inv:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   285
  "x \<in> carrier G ==> inv x \<otimes> x = \<one>"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   286
  using Units_l_inv by simp
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   287
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   288
subsection {* Cancellation Laws and Basic Properties *}
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   289
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   290
lemma (in group) l_cancel [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   291
  "[| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   292
   (x \<otimes> y = x \<otimes> z) = (y = z)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   293
  using Units_l_inv by simp
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   294
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   295
lemma (in group) r_inv:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   296
  "x \<in> carrier G ==> x \<otimes> inv x = \<one>"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   297
proof -
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   298
  assume x: "x \<in> carrier G"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   299
  then have "inv x \<otimes> (x \<otimes> inv x) = inv x \<otimes> \<one>"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   300
    by (simp add: m_assoc [symmetric] l_inv)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   301
  with x show ?thesis by (simp del: r_one)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   302
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   303
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   304
lemma (in group) r_cancel [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   305
  "[| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   306
   (y \<otimes> x = z \<otimes> x) = (y = z)"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   307
proof
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   308
  assume eq: "y \<otimes> x = z \<otimes> x"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   309
    and G: "x \<in> carrier G"  "y \<in> carrier G"  "z \<in> carrier G"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   310
  then have "y \<otimes> (x \<otimes> inv x) = z \<otimes> (x \<otimes> inv x)"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   311
    by (simp add: m_assoc [symmetric])
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   312
  with G show "y = z" by (simp add: r_inv)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   313
next
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   314
  assume eq: "y = z"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   315
    and G: "x \<in> carrier G"  "y \<in> carrier G"  "z \<in> carrier G"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   316
  then show "y \<otimes> x = z \<otimes> x" by simp
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   317
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   318
13854
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   319
lemma (in group) inv_one [simp]:
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   320
  "inv \<one> = \<one>"
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   321
proof -
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   322
  have "inv \<one> = \<one> \<otimes> (inv \<one>)" by simp
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   323
  moreover have "... = \<one>" by (simp add: r_inv)
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   324
  finally show ?thesis .
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   325
qed
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   326
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   327
lemma (in group) inv_inv [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   328
  "x \<in> carrier G ==> inv (inv x) = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   329
  using Units_inv_inv by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   330
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   331
lemma (in group) inv_inj:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   332
  "inj_on (m_inv G) (carrier G)"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   333
  using inv_inj_on_Units by simp
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   334
13854
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   335
lemma (in group) inv_mult_group:
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   336
  "[| 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
   337
proof -
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   338
  assume G: "x \<in> carrier G"  "y \<in> carrier G"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   339
  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
   340
    by (simp add: m_assoc l_inv) (simp add: m_assoc [symmetric] l_inv)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   341
  with G show ?thesis by simp
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   342
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   343
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   344
lemma (in group) inv_comm:
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   345
  "[| x \<otimes> y = \<one>; x \<in> carrier G; y \<in> carrier G |] ==> y \<otimes> x = \<one>"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   346
  by (rule Units_inv_comm) auto
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   347
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   348
lemma (in group) inv_equality:
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   349
     "[|y \<otimes> x = \<one>; x \<in> carrier G; y \<in> carrier G|] ==> inv x = y"
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   350
apply (simp add: m_inv_def)
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   351
apply (rule the_equality)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   352
 apply (simp add: inv_comm [of y x])
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   353
apply (rule r_cancel [THEN iffD1], auto)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   354
done
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   355
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   356
text {* Power *}
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   357
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   358
lemma (in group) int_pow_def2:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   359
  "a (^) (z::int) = (if neg z then inv (a (^) (nat (-z))) else a (^) (nat z))"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   360
  by (simp add: int_pow_def nat_pow_def Let_def)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   361
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   362
lemma (in group) int_pow_0 [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   363
  "x (^) (0::int) = \<one>"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   364
  by (simp add: int_pow_def2)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   365
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   366
lemma (in group) int_pow_one [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   367
  "\<one> (^) (z::int) = \<one>"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   368
  by (simp add: int_pow_def2)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   369
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   370
subsection {* Substructures *}
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   371
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   372
locale submagma = var H + struct G +
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   373
  assumes subset [intro, simp]: "H \<subseteq> carrier G"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   374
    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
   375
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   376
declare (in submagma) magma.intro [intro] semigroup.intro [intro]
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   377
  semigroup_axioms.intro [intro]
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   378
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   379
lemma submagma_imp_subset:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   380
  "submagma H G ==> H \<subseteq> carrier G"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   381
  by (rule submagma.subset)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   382
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   383
lemma (in submagma) subsetD [dest, simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   384
  "x \<in> H ==> x \<in> carrier G"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   385
  using subset by blast
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   386
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   387
lemma (in submagma) magmaI [intro]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   388
  includes magma G
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   389
  shows "magma (G(| carrier := H |))"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   390
  by rule simp
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   391
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   392
lemma (in submagma) semigroup_axiomsI [intro]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   393
  includes semigroup G
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   394
  shows "semigroup_axioms (G(| carrier := H |))"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   395
    by rule (simp add: m_assoc)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   396
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   397
lemma (in submagma) semigroupI [intro]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   398
  includes semigroup G
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   399
  shows "semigroup (G(| carrier := H |))"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   400
  using prems by fast
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   401
14551
2cb6ff394bfb Various changes to HOL-Algebra;
ballarin
parents: 14286
diff changeset
   402
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   403
locale subgroup = submagma H G +
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   404
  assumes one_closed [intro, simp]: "\<one> \<in> H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   405
    and m_inv_closed [intro, simp]: "x \<in> H ==> inv x \<in> H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   406
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   407
declare (in subgroup) group.intro [intro]
13949
0ce528cd6f19 HOL-Algebra complete for release Isabelle2003 (modulo section headers).
ballarin
parents: 13944
diff changeset
   408
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   409
lemma (in subgroup) group_axiomsI [intro]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   410
  includes group G
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   411
  shows "group_axioms (G(| carrier := H |))"
14254
342634f38451 Isar/Locales: <loc>.intro and <loc>.axioms no longer intro? and elim? by
ballarin
parents: 13975
diff changeset
   412
  by (rule group_axioms.intro) (auto intro: l_inv r_inv simp add: Units_def)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   413
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   414
lemma (in subgroup) groupI [intro]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   415
  includes group G
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   416
  shows "group (G(| carrier := H |))"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   417
  by (rule groupI) (auto intro: m_assoc l_inv)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   418
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   419
text {*
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   420
  Since @{term H} is nonempty, it contains some element @{term x}.  Since
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   421
  it is closed under inverse, it contains @{text "inv x"}.  Since
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   422
  it is closed under product, it contains @{text "x \<otimes> inv x = \<one>"}.
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   423
*}
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   424
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   425
lemma (in group) one_in_subset:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   426
  "[| 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
   427
   ==> \<one> \<in> H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   428
by (force simp add: l_inv)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   429
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   430
text {* A characterization of subgroups: closed, non-empty subset. *}
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   431
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   432
lemma (in group) subgroupI:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   433
  assumes subset: "H \<subseteq> carrier G" and non_empty: "H \<noteq> {}"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   434
    and inv: "!!a. a \<in> H ==> inv a \<in> H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   435
    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
   436
  shows "subgroup H G"
14254
342634f38451 Isar/Locales: <loc>.intro and <loc>.axioms no longer intro? and elim? by
ballarin
parents: 13975
diff changeset
   437
proof (rule subgroup.intro)
342634f38451 Isar/Locales: <loc>.intro and <loc>.axioms no longer intro? and elim? by
ballarin
parents: 13975
diff changeset
   438
  from subset and mult show "submagma H G" by (rule submagma.intro)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   439
next
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   440
  have "\<one> \<in> H" by (rule one_in_subset) (auto simp only: prems)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   441
  with inv show "subgroup_axioms H G"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   442
    by (intro subgroup_axioms.intro) simp_all
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   443
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   444
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   445
text {*
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   446
  Repeat facts of submagmas for subgroups.  Necessary???
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   447
*}
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   448
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   449
lemma (in subgroup) subset:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   450
  "H \<subseteq> carrier G"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   451
  ..
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   452
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   453
lemma (in subgroup) m_closed:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   454
  "[| x \<in> H; y \<in> H |] ==> x \<otimes> y \<in> H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   455
  ..
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   456
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   457
declare magma.m_closed [simp]
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   458
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   459
declare monoid.one_closed [iff] group.inv_closed [simp]
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   460
  monoid.l_one [simp] monoid.r_one [simp] group.inv_inv [simp]
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   461
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   462
lemma subgroup_nonempty:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   463
  "~ subgroup {} G"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   464
  by (blast dest: subgroup.one_closed)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   465
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   466
lemma (in subgroup) finite_imp_card_positive:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   467
  "finite (carrier G) ==> 0 < card H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   468
proof (rule classical)
14254
342634f38451 Isar/Locales: <loc>.intro and <loc>.axioms no longer intro? and elim? by
ballarin
parents: 13975
diff changeset
   469
  have sub: "subgroup H G" using prems by (rule subgroup.intro)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   470
  assume fin: "finite (carrier G)"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   471
    and zero: "~ 0 < card H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   472
  then have "finite H" by (blast intro: finite_subset dest: subset)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   473
  with zero sub have "subgroup {} G" by simp
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   474
  with subgroup_nonempty show ?thesis by contradiction
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   475
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   476
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   477
(*
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   478
lemma (in monoid) Units_subgroup:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   479
  "subgroup (Units G) G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   480
*)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   481
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   482
subsection {* Direct Products *}
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   483
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
   484
constdefs (structure G and H)
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
   485
  DirProdSemigroup :: "_ => _ => ('a \<times> 'b) semigroup"  (infixr "\<times>\<^sub>s" 80)
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   486
  "G \<times>\<^sub>s H == (| carrier = carrier G \<times> carrier H,
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   487
    mult = (%(g, h) (g', h'). (g \<otimes>\<^bsub>G\<^esub> g', h \<otimes>\<^bsub>H\<^esub> h')) |)"
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   488
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
   489
  DirProdGroup :: "_ => _ => ('a \<times> 'b) monoid"  (infixr "\<times>\<^sub>g" 80)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   490
  "G \<times>\<^sub>g H == semigroup.extend (G \<times>\<^sub>s H) (| one = (\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>H\<^esub>) |)"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   491
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   492
lemma DirProdSemigroup_magma:
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   493
  includes magma G + magma H
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   494
  shows "magma (G \<times>\<^sub>s H)"
14254
342634f38451 Isar/Locales: <loc>.intro and <loc>.axioms no longer intro? and elim? by
ballarin
parents: 13975
diff changeset
   495
  by (rule magma.intro) (auto simp add: DirProdSemigroup_def)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   496
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   497
lemma DirProdSemigroup_semigroup_axioms:
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   498
  includes semigroup G + semigroup H
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   499
  shows "semigroup_axioms (G \<times>\<^sub>s H)"
14254
342634f38451 Isar/Locales: <loc>.intro and <loc>.axioms no longer intro? and elim? by
ballarin
parents: 13975
diff changeset
   500
  by (rule semigroup_axioms.intro)
342634f38451 Isar/Locales: <loc>.intro and <loc>.axioms no longer intro? and elim? by
ballarin
parents: 13975
diff changeset
   501
    (auto simp add: DirProdSemigroup_def G.m_assoc H.m_assoc)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   502
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   503
lemma DirProdSemigroup_semigroup:
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   504
  includes semigroup G + semigroup H
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   505
  shows "semigroup (G \<times>\<^sub>s H)"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   506
  using prems
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   507
  by (fast intro: semigroup.intro
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   508
    DirProdSemigroup_magma DirProdSemigroup_semigroup_axioms)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   509
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   510
lemma DirProdGroup_magma:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   511
  includes magma G + magma H
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   512
  shows "magma (G \<times>\<^sub>g H)"
14254
342634f38451 Isar/Locales: <loc>.intro and <loc>.axioms no longer intro? and elim? by
ballarin
parents: 13975
diff changeset
   513
  by (rule magma.intro)
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
   514
    (auto simp add: DirProdGroup_def DirProdSemigroup_def semigroup.defs)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   515
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   516
lemma DirProdGroup_semigroup_axioms:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   517
  includes semigroup G + semigroup H
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   518
  shows "semigroup_axioms (G \<times>\<^sub>g H)"
14254
342634f38451 Isar/Locales: <loc>.intro and <loc>.axioms no longer intro? and elim? by
ballarin
parents: 13975
diff changeset
   519
  by (rule semigroup_axioms.intro)
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
   520
    (auto simp add: DirProdGroup_def DirProdSemigroup_def semigroup.defs
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   521
      G.m_assoc H.m_assoc)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   522
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   523
lemma DirProdGroup_semigroup:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   524
  includes semigroup G + semigroup H
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   525
  shows "semigroup (G \<times>\<^sub>g H)"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   526
  using prems
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   527
  by (fast intro: semigroup.intro
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   528
    DirProdGroup_magma DirProdGroup_semigroup_axioms)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   529
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
   530
text {* \dots\ and further lemmas for group \dots *}
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   531
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   532
lemma DirProdGroup_group:
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   533
  includes group G + group H
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   534
  shows "group (G \<times>\<^sub>g H)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   535
  by (rule groupI)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   536
    (auto intro: G.m_assoc H.m_assoc G.l_inv H.l_inv
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
   537
      simp add: DirProdGroup_def DirProdSemigroup_def semigroup.defs)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   538
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   539
lemma carrier_DirProdGroup [simp]:
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   540
     "carrier (G \<times>\<^sub>g H) = carrier G \<times> carrier H"
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
   541
  by (simp add: DirProdGroup_def DirProdSemigroup_def semigroup.defs)
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   542
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   543
lemma one_DirProdGroup [simp]:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   544
     "\<one>\<^bsub>(G \<times>\<^sub>g H)\<^esub> = (\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>H\<^esub>)"
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
   545
  by (simp add: DirProdGroup_def DirProdSemigroup_def semigroup.defs)
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   546
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   547
lemma mult_DirProdGroup [simp]:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   548
     "(g, h) \<otimes>\<^bsub>(G \<times>\<^sub>g H)\<^esub> (g', h') = (g \<otimes>\<^bsub>G\<^esub> g', h \<otimes>\<^bsub>H\<^esub> h')"
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
   549
  by (simp add: DirProdGroup_def DirProdSemigroup_def semigroup.defs)
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   550
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   551
lemma inv_DirProdGroup [simp]:
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   552
  includes group G + group H
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   553
  assumes g: "g \<in> carrier G"
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   554
      and h: "h \<in> carrier H"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   555
  shows "m_inv (G \<times>\<^sub>g H) (g, h) = (inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h)"
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   556
  apply (rule group.inv_equality [OF DirProdGroup_group])
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   557
  apply (simp_all add: prems group_def group.l_inv)
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   558
  done
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   559
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   560
subsection {* Isomorphisms *}
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   561
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
   562
constdefs (structure G and H)
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
   563
  hom :: "_ => _ => ('a => 'b) set"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   564
  "hom G H ==
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   565
    {h. h \<in> carrier G -> carrier H &
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   566
      (\<forall>x \<in> carrier G. \<forall>y \<in> carrier G. h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y)}"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   567
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   568
lemma (in semigroup) hom:
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   569
     "semigroup (| carrier = hom G G, mult = op o |)"
14254
342634f38451 Isar/Locales: <loc>.intro and <loc>.axioms no longer intro? and elim? by
ballarin
parents: 13975
diff changeset
   570
proof (rule semigroup.intro)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   571
  show "magma (| carrier = hom G G, mult = op o |)"
14254
342634f38451 Isar/Locales: <loc>.intro and <loc>.axioms no longer intro? and elim? by
ballarin
parents: 13975
diff changeset
   572
    by (rule magma.intro) (simp add: Pi_def hom_def)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   573
next
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   574
  show "semigroup_axioms (| carrier = hom G G, mult = op o |)"
14254
342634f38451 Isar/Locales: <loc>.intro and <loc>.axioms no longer intro? and elim? by
ballarin
parents: 13975
diff changeset
   575
    by (rule semigroup_axioms.intro) (simp add: o_assoc)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   576
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   577
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   578
lemma hom_mult:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   579
  "[| h \<in> hom G H; x \<in> carrier G; y \<in> carrier G |]
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   580
   ==> h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   581
  by (simp add: hom_def)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   582
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   583
lemma hom_closed:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   584
  "[| h \<in> hom G H; x \<in> carrier G |] ==> h x \<in> carrier H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   585
  by (auto simp add: hom_def funcset_mem)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   586
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   587
lemma (in group) hom_compose:
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   588
     "[|h \<in> hom G H; i \<in> hom H I|] ==> compose (carrier G) i h \<in> hom G I"
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   589
apply (auto simp add: hom_def funcset_compose) 
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   590
apply (simp add: compose_def funcset_mem)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   591
done
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   592
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   593
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   594
subsection {* Isomorphisms *}
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   595
14803
f7557773cc87 more group isomorphisms
paulson
parents: 14761
diff changeset
   596
constdefs
f7557773cc87 more group isomorphisms
paulson
parents: 14761
diff changeset
   597
  iso :: "_ => _ => ('a => 'b) set"  (infixr "\<cong>" 60)
f7557773cc87 more group isomorphisms
paulson
parents: 14761
diff changeset
   598
  "G \<cong> H == {h. h \<in> hom G H & bij_betw h (carrier G) (carrier H)}"
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   599
14803
f7557773cc87 more group isomorphisms
paulson
parents: 14761
diff changeset
   600
lemma iso_refl: "(%x. x) \<in> G \<cong> G"
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   601
by (simp add: iso_def hom_def inj_on_def bij_betw_def Pi_def) 
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   602
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   603
lemma (in group) iso_sym:
14803
f7557773cc87 more group isomorphisms
paulson
parents: 14761
diff changeset
   604
     "h \<in> G \<cong> H \<Longrightarrow> Inv (carrier G) h \<in> H \<cong> G"
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   605
apply (simp add: iso_def bij_betw_Inv) 
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   606
apply (subgoal_tac "Inv (carrier G) h \<in> carrier H \<rightarrow> carrier G") 
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   607
 prefer 2 apply (simp add: bij_betw_imp_funcset [OF bij_betw_Inv]) 
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   608
apply (simp add: hom_def bij_betw_def Inv_f_eq funcset_mem f_Inv_f) 
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   609
done
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   610
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   611
lemma (in group) iso_trans: 
14803
f7557773cc87 more group isomorphisms
paulson
parents: 14761
diff changeset
   612
     "[|h \<in> G \<cong> H; i \<in> H \<cong> I|] ==> (compose (carrier G) i h) \<in> G \<cong> I"
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   613
by (auto simp add: iso_def hom_compose bij_betw_compose)
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   614
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   615
lemma DirProdGroup_commute_iso:
14803
f7557773cc87 more group isomorphisms
paulson
parents: 14761
diff changeset
   616
  shows "(%(x,y). (y,x)) \<in> (G \<times>\<^sub>g H) \<cong> (H \<times>\<^sub>g G)"
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   617
by (auto simp add: iso_def hom_def inj_on_def bij_betw_def Pi_def) 
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   618
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   619
lemma DirProdGroup_assoc_iso:
14803
f7557773cc87 more group isomorphisms
paulson
parents: 14761
diff changeset
   620
  shows "(%(x,y,z). (x,(y,z))) \<in> (G \<times>\<^sub>g H \<times>\<^sub>g I) \<cong> (G \<times>\<^sub>g (H \<times>\<^sub>g I))"
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   621
by (auto simp add: iso_def hom_def inj_on_def bij_betw_def Pi_def) 
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   622
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   623
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   624
locale group_hom = group G + group H + var h +
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   625
  assumes homh: "h \<in> hom G H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   626
  notes hom_mult [simp] = hom_mult [OF homh]
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   627
    and hom_closed [simp] = hom_closed [OF homh]
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   628
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   629
lemma (in group_hom) one_closed [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   630
  "h \<one> \<in> carrier H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   631
  by simp
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   632
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   633
lemma (in group_hom) hom_one [simp]:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   634
  "h \<one> = \<one>\<^bsub>H\<^esub>"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   635
proof -
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   636
  have "h \<one> \<otimes>\<^bsub>H\<^esub> \<one>\<^bsub>H\<^esub> = h \<one> \<otimes>\<^sub>2 h \<one>"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   637
    by (simp add: hom_mult [symmetric] del: hom_mult)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   638
  then show ?thesis by (simp del: r_one)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   639
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   640
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   641
lemma (in group_hom) inv_closed [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   642
  "x \<in> carrier G ==> h (inv x) \<in> carrier H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   643
  by simp
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   644
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   645
lemma (in group_hom) hom_inv [simp]:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   646
  "x \<in> carrier G ==> h (inv x) = inv\<^bsub>H\<^esub> (h x)"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   647
proof -
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   648
  assume x: "x \<in> carrier G"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   649
  then have "h x \<otimes>\<^bsub>H\<^esub> h (inv x) = \<one>\<^bsub>H\<^esub>"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   650
    by (simp add: hom_mult [symmetric] G.r_inv del: hom_mult)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   651
  also from x have "... = h x \<otimes>\<^bsub>H\<^esub> inv\<^bsub>H\<^esub> (h x)"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   652
    by (simp add: hom_mult [symmetric] H.r_inv del: hom_mult)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   653
  finally have "h x \<otimes>\<^bsub>H\<^esub> h (inv x) = h x \<otimes>\<^bsub>H\<^esub> inv\<^bsub>H\<^esub> (h x)" .
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   654
  with x show ?thesis by simp
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   655
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   656
13949
0ce528cd6f19 HOL-Algebra complete for release Isabelle2003 (modulo section headers).
ballarin
parents: 13944
diff changeset
   657
subsection {* Commutative Structures *}
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   658
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   659
text {*
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   660
  Naming convention: multiplicative structures that are commutative
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   661
  are called \emph{commutative}, additive structures are called
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   662
  \emph{Abelian}.
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   663
*}
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   664
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   665
subsection {* Definition *}
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   666
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   667
locale comm_semigroup = semigroup +
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   668
  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
   669
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   670
lemma (in comm_semigroup) m_lcomm:
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   671
  "[| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   672
   x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   673
proof -
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   674
  assume xyz: "x \<in> carrier G"  "y \<in> carrier G"  "z \<in> carrier G"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   675
  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
   676
  also from xyz have "... = (y \<otimes> x) \<otimes> z" by (simp add: m_comm)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   677
  also from xyz have "... = y \<otimes> (x \<otimes> z)" by (simp add: m_assoc)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   678
  finally show ?thesis .
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   679
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   680
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   681
lemmas (in comm_semigroup) m_ac = m_assoc m_comm m_lcomm
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   682
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   683
locale comm_monoid = comm_semigroup + monoid
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   684
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   685
lemma comm_monoidI:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   686
  includes struct G
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   687
  assumes m_closed:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   688
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   689
    and one_closed: "\<one> \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   690
    and m_assoc:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   691
      "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   692
      (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   693
    and l_one: "!!x. x \<in> carrier G ==> \<one> \<otimes> x = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   694
    and m_comm:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   695
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y = y \<otimes> x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   696
  shows "comm_monoid G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   697
  using l_one
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   698
  by (auto intro!: comm_monoid.intro magma.intro semigroup_axioms.intro
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   699
    comm_semigroup_axioms.intro monoid_axioms.intro
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   700
    intro: prems simp: m_closed one_closed m_comm)
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   701
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   702
lemma (in monoid) monoid_comm_monoidI:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   703
  assumes m_comm:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   704
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y = y \<otimes> x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   705
  shows "comm_monoid G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   706
  by (rule comm_monoidI) (auto intro: m_assoc m_comm)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   707
(*lemma (in comm_monoid) r_one [simp]:
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   708
  "x \<in> carrier G ==> x \<otimes> \<one> = x"
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   709
proof -
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   710
  assume G: "x \<in> carrier G"
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   711
  then have "x \<otimes> \<one> = \<one> \<otimes> x" by (simp add: m_comm)
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   712
  also from G have "... = x" by simp
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   713
  finally show ?thesis .
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   714
qed*)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   715
lemma (in comm_monoid) nat_pow_distr:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   716
  "[| x \<in> carrier G; y \<in> carrier G |] ==>
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   717
  (x \<otimes> y) (^) (n::nat) = x (^) n \<otimes> y (^) n"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   718
  by (induct n) (simp, simp add: m_ac)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   719
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   720
locale comm_group = comm_monoid + group
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   721
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   722
lemma (in group) group_comm_groupI:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   723
  assumes m_comm: "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   724
      x \<otimes> y = y \<otimes> x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   725
  shows "comm_group G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   726
  by (fast intro: comm_group.intro comm_semigroup_axioms.intro
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   727
                  is_group prems)
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   728
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   729
lemma comm_groupI:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   730
  includes struct G
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   731
  assumes m_closed:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   732
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   733
    and one_closed: "\<one> \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   734
    and m_assoc:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   735
      "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   736
      (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   737
    and m_comm:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   738
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y = y \<otimes> x"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   739
    and l_one: "!!x. x \<in> carrier G ==> \<one> \<otimes> x = x"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   740
    and l_inv_ex: "!!x. x \<in> carrier G ==> EX y : carrier G. y \<otimes> x = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   741
  shows "comm_group G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   742
  by (fast intro: group.group_comm_groupI groupI prems)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   743
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   744
lemma (in comm_group) inv_mult:
13854
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   745
  "[| x \<in> carrier G; y \<in> carrier G |] ==> inv (x \<otimes> y) = inv x \<otimes> inv y"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   746
  by (simp add: m_ac inv_mult_group)
13854
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   747
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   748
subsection {* Lattice of subgroups of a group *}
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   749
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   750
text_raw {* \label{sec:subgroup-lattice} *}
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   752
theorem (in group) subgroups_partial_order:
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   753
  "partial_order (| carrier = {H. subgroup H G}, le = op \<subseteq> |)"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   754
  by (rule partial_order.intro) simp_all
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   755
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   756
lemma (in group) subgroup_self:
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   757
  "subgroup (carrier G) G"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   758
  by (rule subgroupI) auto
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   759
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   760
lemma (in group) subgroup_imp_group:
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   761
  "subgroup H G ==> group (G(| carrier := H |))"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   762
  using subgroup.groupI [OF _ group.intro] .
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   763
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   764
lemma (in group) is_monoid [intro, simp]:
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   765
  "monoid G"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   766
  by (rule monoid.intro)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   767
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   768
lemma (in group) subgroup_inv_equality:
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   769
  "[| subgroup H G; x \<in> H |] ==> m_inv (G (| carrier := H |)) x = inv x"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   770
apply (rule_tac inv_equality [THEN sym])
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   771
  apply (rule group.l_inv [OF subgroup_imp_group, simplified], assumption+)
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   772
 apply (rule subsetD [OF subgroup.subset], assumption+)
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   773
apply (rule subsetD [OF subgroup.subset], assumption)
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   774
apply (rule_tac group.inv_closed [OF subgroup_imp_group, simplified], assumption+)
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   775
done
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   776
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   777
theorem (in group) subgroups_Inter:
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   778
  assumes subgr: "(!!H. H \<in> A ==> subgroup H G)"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   779
    and not_empty: "A ~= {}"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   780
  shows "subgroup (\<Inter>A) G"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   781
proof (rule subgroupI)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   782
  from subgr [THEN subgroup.subset] and not_empty
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   783
  show "\<Inter>A \<subseteq> carrier G" by blast
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   784
next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   785
  from subgr [THEN subgroup.one_closed]
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   786
  show "\<Inter>A ~= {}" by blast
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   787
next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   788
  fix x assume "x \<in> \<Inter>A"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   789
  with subgr [THEN subgroup.m_inv_closed]
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   790
  show "inv x \<in> \<Inter>A" by blast
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   791
next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   792
  fix x y assume "x \<in> \<Inter>A" "y \<in> \<Inter>A"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   793
  with subgr [THEN subgroup.m_closed]
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   794
  show "x \<otimes> y \<in> \<Inter>A" by blast
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   795
qed
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   796
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   797
theorem (in group) subgroups_complete_lattice:
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   798
  "complete_lattice (| carrier = {H. subgroup H G}, le = op \<subseteq> |)"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   799
    (is "complete_lattice ?L")
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   800
proof (rule partial_order.complete_lattice_criterion1)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   801
  show "partial_order ?L" by (rule subgroups_partial_order)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   802
next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   803
  have "greatest ?L (carrier G) (carrier ?L)"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   804
    by (unfold greatest_def) (simp add: subgroup.subset subgroup_self)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   805
  then show "EX G. greatest ?L G (carrier ?L)" ..
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   806
next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   807
  fix A
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   808
  assume L: "A \<subseteq> carrier ?L" and non_empty: "A ~= {}"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   809
  then have Int_subgroup: "subgroup (\<Inter>A) G"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   810
    by (fastsimp intro: subgroups_Inter)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   811
  have "greatest ?L (\<Inter>A) (Lower ?L A)"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   812
    (is "greatest ?L ?Int _")
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   813
  proof (rule greatest_LowerI)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   814
    fix H
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   815
    assume H: "H \<in> A"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   816
    with L have subgroupH: "subgroup H G" by auto
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   817
    from subgroupH have submagmaH: "submagma H G" by (rule subgroup.axioms)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   818
    from subgroupH have groupH: "group (G (| carrier := H |))" (is "group ?H")
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   819
      by (rule subgroup_imp_group)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   820
    from groupH have monoidH: "monoid ?H"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   821
      by (rule group.is_monoid)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   822
    from H have Int_subset: "?Int \<subseteq> H" by fastsimp
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   823
    then show "le ?L ?Int H" by simp
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   824
  next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   825
    fix H
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   826
    assume H: "H \<in> Lower ?L A"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   827
    with L Int_subgroup show "le ?L H ?Int" by (fastsimp intro: Inter_greatest)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   828
  next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   829
    show "A \<subseteq> carrier ?L" by (rule L)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   830
  next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   831
    show "?Int \<in> carrier ?L" by simp (rule Int_subgroup)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   832
  qed
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   833
  then show "EX I. greatest ?L I (Lower ?L A)" ..
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   834
qed
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   835
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   836
end