src/HOL/Algebra/Group.thy
author haftmann
Thu, 24 Aug 2017 17:41:49 +0200
changeset 66501 5a42eddc11c1
parent 66453 cc19f7ca2ed6
child 66579 2db3fe23fdaf
permissions -rw-r--r--
swapping of theory dependency yields less pervasive syntax requiring popular symbols \<mu>, \<nu>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35849
b5522b51cb1e standard headers;
wenzelm
parents: 35848
diff changeset
     1
(*  Title:      HOL/Algebra/Group.thy
b5522b51cb1e standard headers;
wenzelm
parents: 35848
diff changeset
     2
    Author:     Clemens Ballarin, started 4 February 2003
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
     3
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
     4
Based on work by Florian Kammueller, L C Paulson and Markus Wenzel.
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
     5
*)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
     6
28823
dcbef866c9e2 tuned unfold_locales invocation
haftmann
parents: 27714
diff changeset
     7
theory Group
66501
5a42eddc11c1 swapping of theory dependency yields less pervasive syntax requiring popular symbols \<mu>, \<nu>
haftmann
parents: 66453
diff changeset
     8
imports Order "HOL-Library.FuncSet"
28823
dcbef866c9e2 tuned unfold_locales invocation
haftmann
parents: 27714
diff changeset
     9
begin
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    10
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
    11
section \<open>Monoids and Groups\<close>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    12
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
    13
subsection \<open>Definitions\<close>
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
    14
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
    15
text \<open>
58622
aa99568f56de more antiquotations;
wenzelm
parents: 57512
diff changeset
    16
  Definitions follow @{cite "Jacobson:1985"}.
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
    17
\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    18
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    19
record 'a monoid =  "'a partial_object" +
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    20
  mult    :: "['a, 'a] \<Rightarrow> 'a" (infixl "\<otimes>\<index>" 70)
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    21
  one     :: 'a ("\<one>\<index>")
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
    22
35847
19f1f7066917 eliminated old constdefs;
wenzelm
parents: 35416
diff changeset
    23
definition
14852
paulson
parents: 14803
diff changeset
    24
  m_inv :: "('a, 'b) monoid_scheme => 'a => 'a" ("inv\<index> _" [81] 80)
35848
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
    25
  where "inv\<^bsub>G\<^esub> x = (THE y. y \<in> carrier G & x \<otimes>\<^bsub>G\<^esub> y = \<one>\<^bsub>G\<^esub> & y \<otimes>\<^bsub>G\<^esub> x = \<one>\<^bsub>G\<^esub>)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    26
35847
19f1f7066917 eliminated old constdefs;
wenzelm
parents: 35416
diff changeset
    27
definition
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
    28
  Units :: "_ => 'a set"
63167
0909deb8059b isabelle update_cartouches -c -t;
wenzelm
parents: 61628
diff changeset
    29
  \<comment>\<open>The set of invertible elements\<close>
35848
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
    30
  where "Units G = {y. y \<in> carrier G & (\<exists>x \<in> carrier G. x \<otimes>\<^bsub>G\<^esub> y = \<one>\<^bsub>G\<^esub> & y \<otimes>\<^bsub>G\<^esub> x = \<one>\<^bsub>G\<^esub>)}"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    31
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    32
consts
47108
2a1953f0d20d merged fork with new numeral representation (see NEWS)
huffman
parents: 46559
diff changeset
    33
  pow :: "[('a, 'm) monoid_scheme, 'a, 'b::semiring_1] => 'a"  (infixr "'(^')\<index>" 75)
35850
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    34
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    35
overloading nat_pow == "pow :: [_, 'a, nat] => 'a"
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    36
begin
55415
05f5fdb8d093 renamed 'nat_{case,rec}' to '{case,rec}_nat'
blanchet
parents: 47108
diff changeset
    37
  definition "nat_pow G a n = rec_nat \<one>\<^bsub>G\<^esub> (%u b. b \<otimes>\<^bsub>G\<^esub> a) n"
35850
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    38
end
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    39
35850
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    40
overloading int_pow == "pow :: [_, 'a, int] => 'a"
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    41
begin
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    42
  definition "int_pow G a z =
55415
05f5fdb8d093 renamed 'nat_{case,rec}' to '{case,rec}_nat'
blanchet
parents: 47108
diff changeset
    43
   (let p = rec_nat \<one>\<^bsub>G\<^esub> (%u b. b \<otimes>\<^bsub>G\<^esub> a)
46559
69a273fcd53a avoid using constant Int.neg
huffman
parents: 46008
diff changeset
    44
    in if z < 0 then inv\<^bsub>G\<^esub> (p (nat (-z))) else p (nat z))"
35850
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    45
end
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    46
61628
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
    47
lemma int_pow_int: "x (^)\<^bsub>G\<^esub> (int n) = x (^)\<^bsub>G\<^esub> n"
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
    48
by(simp add: int_pow_def nat_pow_def)
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
    49
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
    50
locale monoid =
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
    51
  fixes G (structure)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    52
  assumes m_closed [intro, simp]:
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    53
         "\<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> x \<otimes> y \<in> carrier G"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    54
      and m_assoc:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    55
         "\<lbrakk>x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> 
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    56
          \<Longrightarrow> (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    57
      and one_closed [intro, simp]: "\<one> \<in> carrier G"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    58
      and l_one [simp]: "x \<in> carrier G \<Longrightarrow> \<one> \<otimes> x = x"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    59
      and r_one [simp]: "x \<in> carrier G \<Longrightarrow> x \<otimes> \<one> = x"
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
    60
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    61
lemma monoidI:
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
    62
  fixes G (structure)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    63
  assumes m_closed:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    64
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    65
    and one_closed: "\<one> \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    66
    and m_assoc:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    67
      "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    68
      (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    69
    and l_one: "!!x. x \<in> carrier G ==> \<one> \<otimes> x = x"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    70
    and r_one: "!!x. x \<in> carrier G ==> x \<otimes> \<one> = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    71
  shows "monoid G"
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
    72
  by (fast intro!: monoid.intro intro: assms)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    73
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    74
lemma (in monoid) Units_closed [dest]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    75
  "x \<in> Units G ==> x \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    76
  by (unfold Units_def) fast
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    77
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    78
lemma (in monoid) inv_unique:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    79
  assumes eq: "y \<otimes> x = \<one>"  "x \<otimes> y' = \<one>"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    80
    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
    81
  shows "y = y'"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    82
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    83
  from G eq have "y = y \<otimes> (x \<otimes> y')" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    84
  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
    85
  also from G eq have "... = y'" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    86
  finally show ?thesis .
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    87
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    88
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    89
lemma (in monoid) Units_m_closed [intro, simp]:
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    90
  assumes x: "x \<in> Units G" and y: "y \<in> Units G"
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    91
  shows "x \<otimes> y \<in> Units G"
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    92
proof -
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    93
  from x obtain x' where x: "x \<in> carrier G" "x' \<in> carrier G" and xinv: "x \<otimes> x' = \<one>" "x' \<otimes> x = \<one>"
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    94
    unfolding Units_def by fast
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    95
  from y obtain y' where y: "y \<in> carrier G" "y' \<in> carrier G" and yinv: "y \<otimes> y' = \<one>" "y' \<otimes> y = \<one>"
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    96
    unfolding Units_def by fast
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    97
  from x y xinv yinv have "y' \<otimes> (x' \<otimes> x) \<otimes> y = \<one>" by simp
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    98
  moreover from x y xinv yinv have "x \<otimes> (y \<otimes> y') \<otimes> x' = \<one>" by simp
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    99
  moreover note x y
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   100
  ultimately show ?thesis unfolding Units_def
63167
0909deb8059b isabelle update_cartouches -c -t;
wenzelm
parents: 61628
diff changeset
   101
    \<comment> "Must avoid premature use of \<open>hyp_subst_tac\<close>."
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   102
    apply (rule_tac CollectI)
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   103
    apply (rule)
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   104
    apply (fast)
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   105
    apply (rule bexI [where x = "y' \<otimes> x'"])
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   106
    apply (auto simp: m_assoc)
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   107
    done
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   108
qed
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   109
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   110
lemma (in monoid) Units_one_closed [intro, simp]:
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   111
  "\<one> \<in> Units G"
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   112
  by (unfold Units_def) auto
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   113
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   114
lemma (in monoid) Units_inv_closed [intro, simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   115
  "x \<in> Units G ==> inv x \<in> carrier G"
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   116
  apply (unfold Units_def m_inv_def, auto)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   117
  apply (rule theI2, fast)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   118
   apply (fast intro: inv_unique, fast)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   119
  done
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   120
19981
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   121
lemma (in monoid) Units_l_inv_ex:
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   122
  "x \<in> Units G ==> \<exists>y \<in> carrier G. y \<otimes> x = \<one>"
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   123
  by (unfold Units_def) auto
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   124
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   125
lemma (in monoid) Units_r_inv_ex:
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   126
  "x \<in> Units G ==> \<exists>y \<in> carrier G. x \<otimes> y = \<one>"
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   127
  by (unfold Units_def) auto
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   128
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   129
lemma (in monoid) Units_l_inv [simp]:
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   130
  "x \<in> Units G ==> inv x \<otimes> x = \<one>"
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   131
  apply (unfold Units_def m_inv_def, auto)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   132
  apply (rule theI2, fast)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   133
   apply (fast intro: inv_unique, fast)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   134
  done
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   135
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   136
lemma (in monoid) Units_r_inv [simp]:
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   137
  "x \<in> Units G ==> x \<otimes> inv x = \<one>"
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   138
  apply (unfold Units_def m_inv_def, auto)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   139
  apply (rule theI2, fast)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   140
   apply (fast intro: inv_unique, fast)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   141
  done
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   142
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   143
lemma (in monoid) Units_inv_Units [intro, simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   144
  "x \<in> Units G ==> inv x \<in> Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   145
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   146
  assume x: "x \<in> Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   147
  show "inv x \<in> Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   148
    by (auto simp add: Units_def
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   149
      intro: Units_l_inv Units_r_inv x Units_closed [OF x])
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   150
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   151
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   152
lemma (in monoid) Units_l_cancel [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   153
  "[| x \<in> Units G; y \<in> carrier G; z \<in> carrier G |] ==>
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   154
   (x \<otimes> y = x \<otimes> z) = (y = z)"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   155
proof
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   156
  assume eq: "x \<otimes> y = x \<otimes> z"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   157
    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
   158
  then have "(inv x \<otimes> x) \<otimes> y = (inv x \<otimes> x) \<otimes> z"
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   159
    by (simp add: m_assoc Units_closed del: Units_l_inv)
44472
6f2943e34d60 tuned proofs;
wenzelm
parents: 41528
diff changeset
   160
  with G show "y = z" by simp
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   161
next
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   162
  assume eq: "y = z"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   163
    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
   164
  then show "x \<otimes> y = x \<otimes> z" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   165
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   166
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   167
lemma (in monoid) Units_inv_inv [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   168
  "x \<in> Units G ==> inv (inv x) = x"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   169
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   170
  assume x: "x \<in> Units G"
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   171
  then have "inv x \<otimes> inv (inv x) = inv x \<otimes> x" by simp
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   172
  with x show ?thesis by (simp add: Units_closed del: Units_l_inv Units_r_inv)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   173
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   174
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   175
lemma (in monoid) inv_inj_on_Units:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   176
  "inj_on (m_inv G) (Units G)"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   177
proof (rule inj_onI)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   178
  fix x y
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   179
  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
   180
  then have "inv (inv x) = inv (inv y)" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   181
  with G show "x = y" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   182
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   183
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   184
lemma (in monoid) Units_inv_comm:
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   185
  assumes inv: "x \<otimes> y = \<one>"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   186
    and G: "x \<in> Units G"  "y \<in> Units G"
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   187
  shows "y \<otimes> x = \<one>"
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   188
proof -
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   189
  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
   190
  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
   191
qed
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   192
61628
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   193
lemma (in monoid) carrier_not_empty: "carrier G \<noteq> {}"
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   194
by auto
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   195
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   196
text \<open>Power\<close>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   197
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   198
lemma (in monoid) nat_pow_closed [intro, simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   199
  "x \<in> carrier G ==> x (^) (n::nat) \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   200
  by (induct n) (simp_all add: nat_pow_def)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   201
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   202
lemma (in monoid) nat_pow_0 [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   203
  "x (^) (0::nat) = \<one>"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   204
  by (simp add: nat_pow_def)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   205
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   206
lemma (in monoid) nat_pow_Suc [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   207
  "x (^) (Suc n) = x (^) n \<otimes> x"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   208
  by (simp add: nat_pow_def)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   209
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   210
lemma (in monoid) nat_pow_one [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   211
  "\<one> (^) (n::nat) = \<one>"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   212
  by (induct n) simp_all
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   213
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   214
lemma (in monoid) nat_pow_mult:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   215
  "x \<in> carrier G ==> x (^) (n::nat) \<otimes> x (^) m = x (^) (n + m)"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   216
  by (induct m) (simp_all add: m_assoc [THEN sym])
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   217
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   218
lemma (in monoid) nat_pow_pow:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   219
  "x \<in> carrier G ==> (x (^) n) (^) m = x (^) (n * m::nat)"
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57271
diff changeset
   220
  by (induct m) (simp, simp add: nat_pow_mult add.commute)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   221
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   222
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   223
(* Jacobson defines submonoid here. *)
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   224
(* Jacobson defines the order of a monoid here. *)
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   225
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   226
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   227
subsection \<open>Groups\<close>
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   228
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   229
text \<open>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   230
  A group is a monoid all of whose elements are invertible.
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   231
\<close>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   232
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   233
locale group = monoid +
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   234
  assumes Units: "carrier G <= Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   235
26199
04817a8802f2 explicit referencing of background facts;
wenzelm
parents: 23350
diff changeset
   236
lemma (in group) is_group: "group G" by (rule group_axioms)
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   237
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   238
theorem groupI:
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
   239
  fixes G (structure)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   240
  assumes m_closed [simp]:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   241
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   242
    and one_closed [simp]: "\<one> \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   243
    and m_assoc:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   244
      "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   245
      (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   246
    and l_one [simp]: "!!x. x \<in> carrier G ==> \<one> \<otimes> x = x"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   247
    and l_inv_ex: "!!x. x \<in> carrier G ==> \<exists>y \<in> carrier G. y \<otimes> x = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   248
  shows "group G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   249
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   250
  have l_cancel [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   251
    "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   252
    (x \<otimes> y = x \<otimes> z) = (y = z)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   253
  proof
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   254
    fix x y z
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   255
    assume eq: "x \<otimes> y = x \<otimes> z"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   256
      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
   257
    with l_inv_ex obtain x_inv where xG: "x_inv \<in> carrier G"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   258
      and l_inv: "x_inv \<otimes> x = \<one>" by fast
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   259
    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
   260
      by (simp add: m_assoc)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   261
    with G show "y = z" by (simp add: l_inv)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   262
  next
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   263
    fix x y z
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   264
    assume eq: "y = z"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   265
      and G: "x \<in> carrier G"  "y \<in> carrier G"  "z \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   266
    then show "x \<otimes> y = x \<otimes> z" by simp
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   267
  qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   268
  have r_one:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   269
    "!!x. x \<in> carrier G ==> x \<otimes> \<one> = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   270
  proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   271
    fix x
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   272
    assume x: "x \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   273
    with l_inv_ex obtain x_inv where xG: "x_inv \<in> carrier G"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   274
      and l_inv: "x_inv \<otimes> x = \<one>" by fast
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   275
    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
   276
      by (simp add: m_assoc [symmetric] l_inv)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   277
    with x xG show "x \<otimes> \<one> = x" by simp
13936
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
  have inv_ex:
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   280
    "!!x. x \<in> carrier G ==> \<exists>y \<in> carrier G. y \<otimes> x = \<one> & x \<otimes> y = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   281
  proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   282
    fix x
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   283
    assume x: "x \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   284
    with l_inv_ex obtain y where y: "y \<in> carrier G"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   285
      and l_inv: "y \<otimes> x = \<one>" by fast
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   286
    from x y have "y \<otimes> (x \<otimes> y) = y \<otimes> \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   287
      by (simp add: m_assoc [symmetric] l_inv r_one)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   288
    with x y have r_inv: "x \<otimes> y = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   289
      by simp
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   290
    from x y show "\<exists>y \<in> carrier G. y \<otimes> x = \<one> & x \<otimes> y = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   291
      by (fast intro: l_inv r_inv)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   292
  qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   293
  then have carrier_subset_Units: "carrier G <= Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   294
    by (unfold Units_def) fast
61169
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 58622
diff changeset
   295
  show ?thesis
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 58622
diff changeset
   296
    by standard (auto simp: r_one m_assoc carrier_subset_Units)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   297
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   298
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   299
lemma (in monoid) group_l_invI:
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   300
  assumes l_inv_ex:
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   301
    "!!x. x \<in> carrier G ==> \<exists>y \<in> carrier G. y \<otimes> x = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   302
  shows "group G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   303
  by (rule groupI) (auto intro: m_assoc l_inv_ex)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   304
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   305
lemma (in group) Units_eq [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   306
  "Units G = carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   307
proof
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   308
  show "Units G <= carrier G" by fast
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   309
next
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   310
  show "carrier G <= Units G" by (rule Units)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   311
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   312
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   313
lemma (in group) inv_closed [intro, simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   314
  "x \<in> carrier G ==> inv x \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   315
  using Units_inv_closed by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   316
19981
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   317
lemma (in group) l_inv_ex [simp]:
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   318
  "x \<in> carrier G ==> \<exists>y \<in> carrier G. y \<otimes> x = \<one>"
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   319
  using Units_l_inv_ex by simp
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   320
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   321
lemma (in group) r_inv_ex [simp]:
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   322
  "x \<in> carrier G ==> \<exists>y \<in> carrier G. x \<otimes> y = \<one>"
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   323
  using Units_r_inv_ex by simp
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   324
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   325
lemma (in group) l_inv [simp]:
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   326
  "x \<in> carrier G ==> inv x \<otimes> x = \<one>"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   327
  using Units_l_inv by simp
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   328
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
   329
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   330
subsection \<open>Cancellation Laws and Basic Properties\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   331
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   332
lemma (in group) l_cancel [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   333
  "[| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   334
   (x \<otimes> y = x \<otimes> z) = (y = z)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   335
  using Units_l_inv by simp
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   336
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   337
lemma (in group) r_inv [simp]:
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   338
  "x \<in> carrier G ==> x \<otimes> inv x = \<one>"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   339
proof -
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   340
  assume x: "x \<in> carrier G"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   341
  then have "inv x \<otimes> (x \<otimes> inv x) = inv x \<otimes> \<one>"
44472
6f2943e34d60 tuned proofs;
wenzelm
parents: 41528
diff changeset
   342
    by (simp add: m_assoc [symmetric])
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   343
  with x show ?thesis by (simp del: r_one)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   344
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   345
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   346
lemma (in group) r_cancel [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   347
  "[| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   348
   (y \<otimes> x = z \<otimes> x) = (y = z)"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   349
proof
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   350
  assume eq: "y \<otimes> x = z \<otimes> x"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   351
    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
   352
  then have "y \<otimes> (x \<otimes> inv x) = z \<otimes> (x \<otimes> inv x)"
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   353
    by (simp add: m_assoc [symmetric] del: r_inv Units_r_inv)
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   354
  with G show "y = z" by simp
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   355
next
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   356
  assume eq: "y = z"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   357
    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
   358
  then show "y \<otimes> x = z \<otimes> x" by simp
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   359
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   360
13854
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   361
lemma (in group) inv_one [simp]:
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   362
  "inv \<one> = \<one>"
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   363
proof -
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   364
  have "inv \<one> = \<one> \<otimes> (inv \<one>)" by (simp del: r_inv Units_r_inv)
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   365
  moreover have "... = \<one>" by simp
13854
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   366
  finally show ?thesis .
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   367
qed
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   368
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   369
lemma (in group) inv_inv [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   370
  "x \<in> carrier G ==> inv (inv x) = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   371
  using Units_inv_inv by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   372
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   373
lemma (in group) inv_inj:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   374
  "inj_on (m_inv G) (carrier G)"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   375
  using inv_inj_on_Units by simp
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   376
13854
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   377
lemma (in group) inv_mult_group:
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   378
  "[| 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
   379
proof -
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   380
  assume G: "x \<in> carrier G"  "y \<in> carrier G"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   381
  then have "inv (x \<otimes> y) \<otimes> (x \<otimes> y) = (inv y \<otimes> inv x) \<otimes> (x \<otimes> y)"
44472
6f2943e34d60 tuned proofs;
wenzelm
parents: 41528
diff changeset
   382
    by (simp add: m_assoc) (simp add: m_assoc [symmetric])
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   383
  with G show ?thesis by (simp del: l_inv Units_l_inv)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   384
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   385
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   386
lemma (in group) inv_comm:
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   387
  "[| 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
   388
  by (rule Units_inv_comm) auto
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   389
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   390
lemma (in group) inv_equality:
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   391
     "[|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
   392
apply (simp add: m_inv_def)
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   393
apply (rule the_equality)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   394
 apply (simp add: inv_comm [of y x])
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   395
apply (rule r_cancel [THEN iffD1], auto)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   396
done
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   397
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   398
(* Contributed by Joachim Breitner *)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   399
lemma (in group) inv_solve_left:
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   400
  "\<lbrakk> a \<in> carrier G; b \<in> carrier G; c \<in> carrier G \<rbrakk> \<Longrightarrow> a = inv b \<otimes> c \<longleftrightarrow> c = b \<otimes> a"
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   401
  by (metis inv_equality l_inv_ex l_one m_assoc r_inv)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   402
lemma (in group) inv_solve_right:
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   403
  "\<lbrakk> a \<in> carrier G; b \<in> carrier G; c \<in> carrier G \<rbrakk> \<Longrightarrow> a = b \<otimes> inv c \<longleftrightarrow> b = a \<otimes> c"
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   404
  by (metis inv_equality l_inv_ex l_one m_assoc r_inv)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   405
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   406
text \<open>Power\<close>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   407
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   408
lemma (in group) int_pow_def2:
46559
69a273fcd53a avoid using constant Int.neg
huffman
parents: 46008
diff changeset
   409
  "a (^) (z::int) = (if z < 0 then inv (a (^) (nat (-z))) else a (^) (nat z))"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   410
  by (simp add: int_pow_def nat_pow_def Let_def)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   411
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   412
lemma (in group) int_pow_0 [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   413
  "x (^) (0::int) = \<one>"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   414
  by (simp add: int_pow_def2)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   415
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   416
lemma (in group) int_pow_one [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   417
  "\<one> (^) (z::int) = \<one>"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   418
  by (simp add: int_pow_def2)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   419
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   420
(* The following are contributed by Joachim Breitner *)
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
   421
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   422
lemma (in group) int_pow_closed [intro, simp]:
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   423
  "x \<in> carrier G ==> x (^) (i::int) \<in> carrier G"
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   424
  by (simp add: int_pow_def2)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   425
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   426
lemma (in group) int_pow_1 [simp]:
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   427
  "x \<in> carrier G \<Longrightarrow> x (^) (1::int) = x"
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   428
  by (simp add: int_pow_def2)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   429
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   430
lemma (in group) int_pow_neg:
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   431
  "x \<in> carrier G \<Longrightarrow> x (^) (-i::int) = inv (x (^) i)"
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   432
  by (simp add: int_pow_def2)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   433
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   434
lemma (in group) int_pow_mult:
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   435
  "x \<in> carrier G \<Longrightarrow> x (^) (i + j::int) = x (^) i \<otimes> x (^) j"
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   436
proof -
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   437
  have [simp]: "-i - j = -j - i" by simp
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   438
  assume "x : carrier G" then
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   439
  show ?thesis
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   440
    by (auto simp add: int_pow_def2 inv_solve_left inv_solve_right nat_add_distrib [symmetric] nat_pow_mult )
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   441
qed
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   442
61628
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   443
lemma (in group) int_pow_diff:
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   444
  "x \<in> carrier G \<Longrightarrow> x (^) (n - m :: int) = x (^) n \<otimes> inv (x (^) m)"
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   445
by(simp only: diff_conv_add_uminus int_pow_mult int_pow_neg)
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   446
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   447
lemma (in group) inj_on_multc: "c \<in> carrier G \<Longrightarrow> inj_on (\<lambda>x. x \<otimes> c) (carrier G)"
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   448
by(simp add: inj_on_def)
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   449
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   450
lemma (in group) inj_on_cmult: "c \<in> carrier G \<Longrightarrow> inj_on (\<lambda>x. c \<otimes> x) (carrier G)"
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   451
by(simp add: inj_on_def)
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   452
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   453
subsection \<open>Subgroups\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   454
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
   455
locale subgroup =
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
   456
  fixes H and G (structure)
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   457
  assumes subset: "H \<subseteq> carrier G"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   458
    and m_closed [intro, simp]: "\<lbrakk>x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> x \<otimes> y \<in> H"
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
   459
    and one_closed [simp]: "\<one> \<in> H"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   460
    and m_inv_closed [intro,simp]: "x \<in> H \<Longrightarrow> inv x \<in> H"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   461
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
   462
lemma (in subgroup) is_subgroup:
26199
04817a8802f2 explicit referencing of background facts;
wenzelm
parents: 23350
diff changeset
   463
  "subgroup H G" by (rule subgroup_axioms)
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
   464
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   465
declare (in subgroup) group.intro [intro]
13949
0ce528cd6f19 HOL-Algebra complete for release Isabelle2003 (modulo section headers).
ballarin
parents: 13944
diff changeset
   466
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   467
lemma (in subgroup) mem_carrier [simp]:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   468
  "x \<in> H \<Longrightarrow> x \<in> carrier G"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   469
  using subset by blast
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   470
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   471
lemma subgroup_imp_subset:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   472
  "subgroup H G \<Longrightarrow> H \<subseteq> carrier G"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   473
  by (rule subgroup.subset)
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   474
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   475
lemma (in subgroup) subgroup_is_group [intro]:
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   476
  assumes "group G"
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   477
  shows "group (G\<lparr>carrier := H\<rparr>)"
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   478
proof -
29237
e90d9d51106b More porting to new locales.
ballarin
parents: 28823
diff changeset
   479
  interpret group G by fact
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   480
  show ?thesis
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   481
    apply (rule monoid.group_l_invI)
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   482
    apply (unfold_locales) [1]
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   483
    apply (auto intro: m_assoc l_inv mem_carrier)
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   484
    done
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   485
qed
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   486
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   487
text \<open>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   488
  Since @{term H} is nonempty, it contains some element @{term x}.  Since
63167
0909deb8059b isabelle update_cartouches -c -t;
wenzelm
parents: 61628
diff changeset
   489
  it is closed under inverse, it contains \<open>inv x\<close>.  Since
0909deb8059b isabelle update_cartouches -c -t;
wenzelm
parents: 61628
diff changeset
   490
  it is closed under product, it contains \<open>x \<otimes> inv x = \<one>\<close>.
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   491
\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   492
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   493
lemma (in group) one_in_subset:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   494
  "[| 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
   495
   ==> \<one> \<in> H"
44472
6f2943e34d60 tuned proofs;
wenzelm
parents: 41528
diff changeset
   496
by force
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   497
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   498
text \<open>A characterization of subgroups: closed, non-empty subset.\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   499
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   500
lemma (in group) subgroupI:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   501
  assumes subset: "H \<subseteq> carrier G" and non_empty: "H \<noteq> {}"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   502
    and inv: "!!a. a \<in> H \<Longrightarrow> inv a \<in> H"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   503
    and mult: "!!a b. \<lbrakk>a \<in> H; b \<in> H\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> H"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   504
  shows "subgroup H G"
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
   505
proof (simp add: subgroup_def assms)
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
   506
  show "\<one> \<in> H" by (rule one_in_subset) (auto simp only: assms)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   507
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   508
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   509
declare monoid.one_closed [iff] group.inv_closed [simp]
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   510
  monoid.l_one [simp] monoid.r_one [simp] group.inv_inv [simp]
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   511
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   512
lemma subgroup_nonempty:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   513
  "~ subgroup {} G"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   514
  by (blast dest: subgroup.one_closed)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   515
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   516
lemma (in subgroup) finite_imp_card_positive:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   517
  "finite (carrier G) ==> 0 < card H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   518
proof (rule classical)
41528
276078f01ada eliminated global prems;
wenzelm
parents: 41413
diff changeset
   519
  assume "finite (carrier G)" and a: "~ 0 < card H"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   520
  then have "finite H" by (blast intro: finite_subset [OF subset])
41528
276078f01ada eliminated global prems;
wenzelm
parents: 41413
diff changeset
   521
  with is_subgroup a have "subgroup {} G" by simp
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   522
  with subgroup_nonempty show ?thesis by contradiction
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   523
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   524
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   525
(*
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   526
lemma (in monoid) Units_subgroup:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   527
  "subgroup (Units G) G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   528
*)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   529
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
   530
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   531
subsection \<open>Direct Products\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   532
35848
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   533
definition
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   534
  DirProd :: "_ \<Rightarrow> _ \<Rightarrow> ('a \<times> 'b) monoid" (infixr "\<times>\<times>" 80) where
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   535
  "G \<times>\<times> H =
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   536
    \<lparr>carrier = carrier G \<times> carrier H,
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   537
     mult = (\<lambda>(g, h) (g', h'). (g \<otimes>\<^bsub>G\<^esub> g', h \<otimes>\<^bsub>H\<^esub> h')),
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   538
     one = (\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>H\<^esub>)\<rparr>"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   539
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   540
lemma DirProd_monoid:
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   541
  assumes "monoid G" and "monoid H"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   542
  shows "monoid (G \<times>\<times> H)"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   543
proof -
30729
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   544
  interpret G: monoid G by fact
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   545
  interpret H: monoid H by fact
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
   546
  from assms
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   547
  show ?thesis by (unfold monoid_def DirProd_def, auto) 
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   548
qed
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   549
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   550
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   551
text\<open>Does not use the previous result because it's easier just to use auto.\<close>
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   552
lemma DirProd_group:
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   553
  assumes "group G" and "group H"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   554
  shows "group (G \<times>\<times> H)"
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   555
proof -
30729
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   556
  interpret G: group G by fact
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   557
  interpret H: group H by fact
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   558
  show ?thesis by (rule groupI)
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   559
     (auto intro: G.m_assoc H.m_assoc G.l_inv H.l_inv
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   560
           simp add: DirProd_def)
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   561
qed
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   562
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   563
lemma carrier_DirProd [simp]:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   564
     "carrier (G \<times>\<times> H) = carrier G \<times> carrier H"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   565
  by (simp add: DirProd_def)
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   566
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   567
lemma one_DirProd [simp]:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   568
     "\<one>\<^bsub>G \<times>\<times> H\<^esub> = (\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>H\<^esub>)"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   569
  by (simp add: DirProd_def)
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   570
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   571
lemma mult_DirProd [simp]:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   572
     "(g, h) \<otimes>\<^bsub>(G \<times>\<times> H)\<^esub> (g', h') = (g \<otimes>\<^bsub>G\<^esub> g', h \<otimes>\<^bsub>H\<^esub> h')"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   573
  by (simp add: DirProd_def)
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   574
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   575
lemma inv_DirProd [simp]:
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   576
  assumes "group G" and "group H"
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   577
  assumes g: "g \<in> carrier G"
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   578
      and h: "h \<in> carrier H"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   579
  shows "m_inv (G \<times>\<times> H) (g, h) = (inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h)"
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   580
proof -
30729
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   581
  interpret G: group G by fact
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   582
  interpret H: group H by fact
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   583
  interpret Prod: group "G \<times>\<times> H"
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
   584
    by (auto intro: DirProd_group group.intro group.axioms assms)
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   585
  show ?thesis by (simp add: Prod.inv_equality g h)
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   586
qed
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   587
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   588
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   589
subsection \<open>Homomorphisms and Isomorphisms\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   590
35847
19f1f7066917 eliminated old constdefs;
wenzelm
parents: 35416
diff changeset
   591
definition
19f1f7066917 eliminated old constdefs;
wenzelm
parents: 35416
diff changeset
   592
  hom :: "_ => _ => ('a => 'b) set" where
35848
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   593
  "hom G H =
61384
9f5145281888 prefer symbols;
wenzelm
parents: 61382
diff changeset
   594
    {h. h \<in> carrier G \<rightarrow> carrier H &
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   595
      (\<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
   596
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   597
lemma (in group) hom_compose:
31754
b5260f5272a4 tuned FuncSet
nipkow
parents: 31727
diff changeset
   598
  "[|h \<in> hom G H; i \<in> hom H I|] ==> compose (carrier G) i h \<in> hom G I"
44890
22f665a2e91c new fastforce replacing fastsimp - less confusing name
nipkow
parents: 44655
diff changeset
   599
by (fastforce simp add: hom_def compose_def)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   600
35848
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   601
definition
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   602
  iso :: "_ => _ => ('a => 'b) set" (infixr "\<cong>" 60)
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   603
  where "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
   604
14803
f7557773cc87 more group isomorphisms
paulson
parents: 14761
diff changeset
   605
lemma iso_refl: "(%x. x) \<in> G \<cong> G"
31727
2621a957d417 Made Pi_I [simp]
nipkow
parents: 30729
diff changeset
   606
by (simp add: iso_def hom_def inj_on_def bij_betw_def Pi_def)
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   607
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   608
lemma (in group) iso_sym:
33057
764547b68538 inv_onto -> inv_into
nipkow
parents: 32989
diff changeset
   609
     "h \<in> G \<cong> H \<Longrightarrow> inv_into (carrier G) h \<in> H \<cong> G"
764547b68538 inv_onto -> inv_into
nipkow
parents: 32989
diff changeset
   610
apply (simp add: iso_def bij_betw_inv_into) 
764547b68538 inv_onto -> inv_into
nipkow
parents: 32989
diff changeset
   611
apply (subgoal_tac "inv_into (carrier G) h \<in> carrier H \<rightarrow> carrier G") 
764547b68538 inv_onto -> inv_into
nipkow
parents: 32989
diff changeset
   612
 prefer 2 apply (simp add: bij_betw_imp_funcset [OF bij_betw_inv_into]) 
764547b68538 inv_onto -> inv_into
nipkow
parents: 32989
diff changeset
   613
apply (simp add: hom_def bij_betw_def inv_into_f_eq f_inv_into_f Pi_def)
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   614
done
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   615
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   616
lemma (in group) iso_trans: 
14803
f7557773cc87 more group isomorphisms
paulson
parents: 14761
diff changeset
   617
     "[|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
   618
by (auto simp add: iso_def hom_compose bij_betw_compose)
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   619
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   620
lemma DirProd_commute_iso:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   621
  shows "(\<lambda>(x,y). (y,x)) \<in> (G \<times>\<times> H) \<cong> (H \<times>\<times> G)"
31754
b5260f5272a4 tuned FuncSet
nipkow
parents: 31727
diff changeset
   622
by (auto simp add: iso_def hom_def inj_on_def bij_betw_def)
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   623
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   624
lemma DirProd_assoc_iso:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   625
  shows "(\<lambda>(x,y,z). (x,(y,z))) \<in> (G \<times>\<times> H \<times>\<times> I) \<cong> (G \<times>\<times> (H \<times>\<times> I))"
31727
2621a957d417 Made Pi_I [simp]
nipkow
parents: 30729
diff changeset
   626
by (auto simp add: iso_def hom_def inj_on_def bij_betw_def)
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   627
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   628
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   629
text\<open>Basis for homomorphism proofs: we assume two groups @{term G} and
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   630
  @{term H}, with a homomorphism @{term h} between them\<close>
61565
352c73a689da Qualifiers in locale expressions default to mandatory regardless of the command.
ballarin
parents: 61384
diff changeset
   631
locale group_hom = G?: group G + H?: group H for G (structure) and H (structure) +
29237
e90d9d51106b More porting to new locales.
ballarin
parents: 28823
diff changeset
   632
  fixes h
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   633
  assumes homh: "h \<in> hom G H"
29240
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   634
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   635
lemma (in group_hom) hom_mult [simp]:
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   636
  "[| x \<in> carrier G; y \<in> carrier G |] ==> h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y"
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   637
proof -
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   638
  assume "x \<in> carrier G" "y \<in> carrier G"
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   639
  with homh [unfolded hom_def] show ?thesis by simp
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   640
qed
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   641
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   642
lemma (in group_hom) hom_closed [simp]:
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   643
  "x \<in> carrier G ==> h x \<in> carrier H"
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   644
proof -
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   645
  assume "x \<in> carrier G"
31754
b5260f5272a4 tuned FuncSet
nipkow
parents: 31727
diff changeset
   646
  with homh [unfolded hom_def] show ?thesis by auto
29240
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
   647
qed
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   648
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   649
lemma (in group_hom) one_closed [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   650
  "h \<one> \<in> carrier H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   651
  by simp
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   652
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   653
lemma (in group_hom) hom_one [simp]:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   654
  "h \<one> = \<one>\<^bsub>H\<^esub>"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   655
proof -
15076
4b3d280ef06a New prover for transitive and reflexive-transitive closure of relations.
ballarin
parents: 14963
diff changeset
   656
  have "h \<one> \<otimes>\<^bsub>H\<^esub> \<one>\<^bsub>H\<^esub> = h \<one> \<otimes>\<^bsub>H\<^esub> h \<one>"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   657
    by (simp add: hom_mult [symmetric] del: hom_mult)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   658
  then show ?thesis by (simp del: r_one)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   659
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   660
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   661
lemma (in group_hom) inv_closed [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   662
  "x \<in> carrier G ==> h (inv x) \<in> carrier H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   663
  by simp
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   664
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   665
lemma (in group_hom) hom_inv [simp]:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   666
  "x \<in> carrier G ==> h (inv x) = inv\<^bsub>H\<^esub> (h x)"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   667
proof -
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   668
  assume x: "x \<in> carrier G"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   669
  then have "h x \<otimes>\<^bsub>H\<^esub> h (inv x) = \<one>\<^bsub>H\<^esub>"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   670
    by (simp add: hom_mult [symmetric] del: hom_mult)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   671
  also from x have "... = h x \<otimes>\<^bsub>H\<^esub> inv\<^bsub>H\<^esub> (h x)"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   672
    by (simp add: hom_mult [symmetric] del: hom_mult)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   673
  finally have "h x \<otimes>\<^bsub>H\<^esub> h (inv x) = h x \<otimes>\<^bsub>H\<^esub> inv\<^bsub>H\<^esub> (h x)" .
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   674
  with x show ?thesis by (simp del: H.r_inv H.Units_r_inv)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   675
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   676
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   677
(* Contributed by Joachim Breitner *)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   678
lemma (in group) int_pow_is_hom:
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   679
  "x \<in> carrier G \<Longrightarrow> (op(^) x) \<in> hom \<lparr> carrier = UNIV, mult = op +, one = 0::int \<rparr> G "
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   680
  unfolding hom_def by (simp add: int_pow_mult)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   681
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
   682
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   683
subsection \<open>Commutative Structures\<close>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   684
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   685
text \<open>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   686
  Naming convention: multiplicative structures that are commutative
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   687
  are called \emph{commutative}, additive structures are called
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   688
  \emph{Abelian}.
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   689
\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   690
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   691
locale comm_monoid = monoid +
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   692
  assumes m_comm: "\<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> x \<otimes> y = y \<otimes> x"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   693
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   694
lemma (in comm_monoid) m_lcomm:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   695
  "\<lbrakk>x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk> \<Longrightarrow>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   696
   x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   697
proof -
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   698
  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
   699
  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
   700
  also from xyz have "... = (y \<otimes> x) \<otimes> z" by (simp add: m_comm)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   701
  also from xyz have "... = y \<otimes> (x \<otimes> z)" by (simp add: m_assoc)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   702
  finally show ?thesis .
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   703
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   704
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   705
lemmas (in comm_monoid) m_ac = m_assoc m_comm m_lcomm
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   706
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   707
lemma comm_monoidI:
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
   708
  fixes G (structure)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   709
  assumes m_closed:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   710
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   711
    and one_closed: "\<one> \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   712
    and m_assoc:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   713
      "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   714
      (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   715
    and l_one: "!!x. x \<in> carrier G ==> \<one> \<otimes> x = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   716
    and m_comm:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   717
      "!!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
   718
  shows "comm_monoid G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   719
  using l_one
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   720
    by (auto intro!: comm_monoid.intro comm_monoid_axioms.intro monoid.intro 
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
   721
             intro: assms simp: m_closed one_closed m_comm)
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   722
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   723
lemma (in monoid) monoid_comm_monoidI:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   724
  assumes m_comm:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   725
      "!!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
   726
  shows "comm_monoid G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   727
  by (rule comm_monoidI) (auto intro: m_assoc m_comm)
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   728
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   729
(*lemma (in comm_monoid) r_one [simp]:
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   730
  "x \<in> carrier G ==> x \<otimes> \<one> = x"
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   731
proof -
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   732
  assume G: "x \<in> carrier G"
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   733
  then have "x \<otimes> \<one> = \<one> \<otimes> x" by (simp add: m_comm)
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   734
  also from G have "... = x" by simp
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   735
  finally show ?thesis .
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   736
qed*)
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   737
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   738
lemma (in comm_monoid) nat_pow_distr:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   739
  "[| x \<in> carrier G; y \<in> carrier G |] ==>
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   740
  (x \<otimes> y) (^) (n::nat) = x (^) n \<otimes> y (^) n"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   741
  by (induct n) (simp, simp add: m_ac)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   742
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   743
locale comm_group = comm_monoid + group
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   744
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   745
lemma (in group) group_comm_groupI:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   746
  assumes m_comm: "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   747
      x \<otimes> y = y \<otimes> x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   748
  shows "comm_group G"
61169
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 58622
diff changeset
   749
  by standard (simp_all add: m_comm)
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
   750
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   751
lemma comm_groupI:
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
   752
  fixes G (structure)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   753
  assumes m_closed:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   754
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   755
    and one_closed: "\<one> \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   756
    and m_assoc:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   757
      "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   758
      (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   759
    and m_comm:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   760
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y = y \<otimes> x"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   761
    and l_one: "!!x. x \<in> carrier G ==> \<one> \<otimes> x = x"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   762
    and l_inv_ex: "!!x. x \<in> carrier G ==> \<exists>y \<in> carrier G. y \<otimes> x = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   763
  shows "comm_group G"
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
   764
  by (fast intro: group.group_comm_groupI groupI assms)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   765
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   766
lemma (in comm_group) inv_mult:
13854
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   767
  "[| 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
   768
  by (simp add: m_ac inv_mult_group)
13854
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   769
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
   770
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   771
subsection \<open>The Lattice of Subgroups of a Group\<close>
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   772
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   773
text_raw \<open>\label{sec:subgroup-lattice}\<close>
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   774
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   775
theorem (in group) subgroups_partial_order:
55926
3ef14caf5637 more symbols;
wenzelm
parents: 55415
diff changeset
   776
  "partial_order \<lparr>carrier = {H. subgroup H G}, eq = op =, le = op \<subseteq>\<rparr>"
61169
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 58622
diff changeset
   777
  by standard simp_all
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   778
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   779
lemma (in group) subgroup_self:
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   780
  "subgroup (carrier G) G"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   781
  by (rule subgroupI) auto
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   782
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   783
lemma (in group) subgroup_imp_group:
55926
3ef14caf5637 more symbols;
wenzelm
parents: 55415
diff changeset
   784
  "subgroup H G ==> group (G\<lparr>carrier := H\<rparr>)"
26199
04817a8802f2 explicit referencing of background facts;
wenzelm
parents: 23350
diff changeset
   785
  by (erule subgroup.subgroup_is_group) (rule group_axioms)
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   786
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   787
lemma (in group) is_monoid [intro, simp]:
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   788
  "monoid G"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   789
  by (auto intro: monoid.intro m_assoc) 
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   790
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   791
lemma (in group) subgroup_inv_equality:
55926
3ef14caf5637 more symbols;
wenzelm
parents: 55415
diff changeset
   792
  "[| subgroup H G; x \<in> H |] ==> m_inv (G \<lparr>carrier := H\<rparr>) x = inv x"
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   793
apply (rule_tac inv_equality [THEN sym])
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   794
  apply (rule group.l_inv [OF subgroup_imp_group, simplified], assumption+)
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   795
 apply (rule subsetD [OF subgroup.subset], assumption+)
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   796
apply (rule subsetD [OF subgroup.subset], assumption)
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   797
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
   798
done
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   799
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   800
theorem (in group) subgroups_Inter:
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   801
  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
   802
    and not_empty: "A ~= {}"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   803
  shows "subgroup (\<Inter>A) G"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   804
proof (rule subgroupI)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   805
  from subgr [THEN subgroup.subset] and not_empty
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   806
  show "\<Inter>A \<subseteq> carrier G" by blast
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   807
next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   808
  from subgr [THEN subgroup.one_closed]
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   809
  show "\<Inter>A ~= {}" by blast
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   810
next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   811
  fix x assume "x \<in> \<Inter>A"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   812
  with subgr [THEN subgroup.m_inv_closed]
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   813
  show "inv x \<in> \<Inter>A" by blast
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   814
next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   815
  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
   816
  with subgr [THEN subgroup.m_closed]
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   817
  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
   818
qed
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
   819
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   820
end