src/HOL/Algebra/Group.thy
author paulson <lp15@cam.ac.uk>
Sun, 08 Jul 2018 23:35:33 +0100
changeset 68605 440aa6b7d99a
parent 68555 22d51874f37d
child 68662 227f85b1b98c
permissions -rw-r--r--
removal of smt
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.
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
     5
With additional contributions from Martin Baillon and Paulo Emílio de Vilhena.
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
     6
*)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
     7
28823
dcbef866c9e2 tuned unfold_locales invocation
haftmann
parents: 27714
diff changeset
     8
theory Group
68188
2af1f142f855 move FuncSet back to HOL-Library (amending 493b818e8e10)
immler
parents: 68072
diff changeset
     9
imports Complete_Lattice "HOL-Library.FuncSet"
28823
dcbef866c9e2 tuned unfold_locales invocation
haftmann
parents: 27714
diff changeset
    10
begin
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    11
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
    12
section \<open>Monoids and Groups\<close>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    13
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
    14
subsection \<open>Definitions\<close>
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
    15
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
    16
text \<open>
58622
aa99568f56de more antiquotations;
wenzelm
parents: 57512
diff changeset
    17
  Definitions follow @{cite "Jacobson:1985"}.
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
    18
\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    19
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    20
record 'a monoid =  "'a partial_object" +
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    21
  mult    :: "['a, 'a] \<Rightarrow> 'a" (infixl "\<otimes>\<index>" 70)
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    22
  one     :: 'a ("\<one>\<index>")
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
    23
35847
19f1f7066917 eliminated old constdefs;
wenzelm
parents: 35416
diff changeset
    24
definition
14852
paulson
parents: 14803
diff changeset
    25
  m_inv :: "('a, 'b) monoid_scheme => 'a => 'a" ("inv\<index> _" [81] 80)
67091
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
    26
  where "inv\<^bsub>G\<^esub> x = (THE y. y \<in> carrier G \<and> x \<otimes>\<^bsub>G\<^esub> y = \<one>\<^bsub>G\<^esub> \<and> y \<otimes>\<^bsub>G\<^esub> x = \<one>\<^bsub>G\<^esub>)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    27
35847
19f1f7066917 eliminated old constdefs;
wenzelm
parents: 35416
diff changeset
    28
definition
14651
02b8f3bcf7fe improved notation;
wenzelm
parents: 14551
diff changeset
    29
  Units :: "_ => 'a set"
67443
3abf6a722518 standardized towards new-style formal comments: isabelle update_comments;
wenzelm
parents: 67399
diff changeset
    30
  \<comment> \<open>The set of invertible elements\<close>
67091
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
    31
  where "Units G = {y. y \<in> carrier G \<and> (\<exists>x \<in> carrier G. x \<otimes>\<^bsub>G\<^esub> y = \<one>\<^bsub>G\<^esub> \<and> y \<otimes>\<^bsub>G\<^esub> x = \<one>\<^bsub>G\<^esub>)}"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    32
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    33
consts
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
    34
  pow :: "[('a, 'm) monoid_scheme, 'a, 'b::semiring_1] => 'a"  (infixr "[^]\<index>" 75)
35850
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    35
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    36
overloading nat_pow == "pow :: [_, 'a, nat] => 'a"
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    37
begin
55415
05f5fdb8d093 renamed 'nat_{case,rec}' to '{case,rec}_nat'
blanchet
parents: 47108
diff changeset
    38
  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
    39
end
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    40
35850
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    41
overloading int_pow == "pow :: [_, 'a, int] => 'a"
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    42
begin
dd2636f0f608 modernized overloaded definitions;
wenzelm
parents: 35849
diff changeset
    43
  definition "int_pow G a z =
55415
05f5fdb8d093 renamed 'nat_{case,rec}' to '{case,rec}_nat'
blanchet
parents: 47108
diff changeset
    44
   (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
    45
    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
    46
end
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    47
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
    48
lemma int_pow_int: "x [^]\<^bsub>G\<^esub> (int n) = x [^]\<^bsub>G\<^esub> n"
61628
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
    49
by(simp add: int_pow_def nat_pow_def)
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
    50
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
    51
locale monoid =
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
    52
  fixes G (structure)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
    53
  assumes m_closed [intro, simp]:
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    54
         "\<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
    55
      and m_assoc:
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
    56
         "\<lbrakk>x \<in> carrier G; y \<in> carrier G; z \<in> carrier G\<rbrakk>
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    57
          \<Longrightarrow> (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    58
      and one_closed [intro, simp]: "\<one> \<in> carrier G"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    59
      and l_one [simp]: "x \<in> carrier G \<Longrightarrow> \<one> \<otimes> x = x"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
    60
      and r_one [simp]: "x \<in> carrier G \<Longrightarrow> x \<otimes> \<one> = x"
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
    61
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    62
lemma monoidI:
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
    63
  fixes G (structure)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    64
  assumes m_closed:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    65
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    66
    and one_closed: "\<one> \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    67
    and m_assoc:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    68
      "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    69
      (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    70
    and l_one: "!!x. x \<in> carrier G ==> \<one> \<otimes> x = x"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    71
    and r_one: "!!x. x \<in> carrier G ==> x \<otimes> \<one> = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    72
  shows "monoid G"
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
    73
  by (fast intro!: monoid.intro intro: assms)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    74
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    75
lemma (in monoid) Units_closed [dest]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    76
  "x \<in> Units G ==> x \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    77
  by (unfold Units_def) fast
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    78
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
    79
lemma (in monoid) one_unique:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
    80
  assumes "u \<in> carrier G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
    81
    and "\<And>x. x \<in> carrier G \<Longrightarrow> u \<otimes> x = x"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
    82
  shows "u = \<one>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
    83
  using assms(2)[OF one_closed] r_one[OF assms(1)] by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
    84
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    85
lemma (in monoid) inv_unique:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    86
  assumes eq: "y \<otimes> x = \<one>"  "x \<otimes> y' = \<one>"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
    87
    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
    88
  shows "y = y'"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    89
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    90
  from G eq have "y = y \<otimes> (x \<otimes> y')" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    91
  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
    92
  also from G eq have "... = y'" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    93
  finally show ?thesis .
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    94
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
    95
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
    96
lemma (in monoid) Units_m_closed [simp, intro]:
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    97
  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
    98
  shows "x \<otimes> y \<in> Units G"
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
    99
proof -
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   100
  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
   101
    unfolding Units_def by fast
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   102
  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
   103
    unfolding Units_def by fast
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   104
  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
   105
  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
   106
  moreover note x y
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   107
  ultimately show ?thesis unfolding Units_def
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   108
    by simp (metis m_assoc m_closed)
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   109
qed
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   110
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   111
lemma (in monoid) Units_one_closed [intro, simp]:
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   112
  "\<one> \<in> Units G"
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   113
  by (unfold Units_def) auto
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   114
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   115
lemma (in monoid) Units_inv_closed [intro, simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   116
  "x \<in> Units G ==> inv x \<in> carrier G"
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   117
  apply (unfold Units_def m_inv_def, auto)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   118
  apply (rule theI2, fast)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   119
   apply (fast intro: inv_unique, fast)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   120
  done
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   121
19981
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   122
lemma (in monoid) Units_l_inv_ex:
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   123
  "x \<in> Units G ==> \<exists>y \<in> carrier G. y \<otimes> x = \<one>"
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   124
  by (unfold Units_def) auto
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   125
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   126
lemma (in monoid) Units_r_inv_ex:
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   127
  "x \<in> Units G ==> \<exists>y \<in> carrier G. x \<otimes> y = \<one>"
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   128
  by (unfold Units_def) auto
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   129
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   130
lemma (in monoid) Units_l_inv [simp]:
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   131
  "x \<in> Units G ==> inv x \<otimes> x = \<one>"
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   132
  apply (unfold Units_def m_inv_def, auto)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   133
  apply (rule theI2, fast)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   134
   apply (fast intro: inv_unique, fast)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   135
  done
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   136
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   137
lemma (in monoid) Units_r_inv [simp]:
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   138
  "x \<in> Units G ==> x \<otimes> inv x = \<one>"
68458
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   139
  by (metis (full_types) Units_closed Units_inv_closed Units_l_inv Units_r_inv_ex inv_unique)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   140
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   141
lemma (in monoid) inv_one [simp]:
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   142
  "inv \<one> = \<one>"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   143
  by (metis Units_one_closed Units_r_inv l_one monoid.Units_inv_closed monoid_axioms)
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   144
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   145
lemma (in monoid) Units_inv_Units [intro, simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   146
  "x \<in> Units G ==> inv x \<in> Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   147
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   148
  assume x: "x \<in> Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   149
  show "inv x \<in> Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   150
    by (auto simp add: Units_def
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   151
      intro: Units_l_inv Units_r_inv x Units_closed [OF x])
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   152
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   153
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   154
lemma (in monoid) Units_l_cancel [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   155
  "[| x \<in> Units G; y \<in> carrier G; z \<in> carrier G |] ==>
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   156
   (x \<otimes> y = x \<otimes> z) = (y = z)"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   157
proof
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   158
  assume eq: "x \<otimes> y = x \<otimes> z"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   159
    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
   160
  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
   161
    by (simp add: m_assoc Units_closed del: Units_l_inv)
44472
6f2943e34d60 tuned proofs;
wenzelm
parents: 41528
diff changeset
   162
  with G show "y = z" by simp
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   163
next
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   164
  assume eq: "y = z"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   165
    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
   166
  then show "x \<otimes> y = x \<otimes> z" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   167
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   168
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   169
lemma (in monoid) Units_inv_inv [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   170
  "x \<in> Units G ==> inv (inv x) = x"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   171
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   172
  assume x: "x \<in> Units G"
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   173
  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
   174
  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
   175
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   176
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   177
lemma (in monoid) inv_inj_on_Units:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   178
  "inj_on (m_inv G) (Units G)"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   179
proof (rule inj_onI)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   180
  fix x y
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   181
  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
   182
  then have "inv (inv x) = inv (inv y)" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   183
  with G show "x = y" by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   184
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   185
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   186
lemma (in monoid) Units_inv_comm:
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   187
  assumes inv: "x \<otimes> y = \<one>"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   188
    and G: "x \<in> Units G"  "y \<in> Units G"
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   189
  shows "y \<otimes> x = \<one>"
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   190
proof -
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   191
  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
   192
  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
   193
qed
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   194
61628
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   195
lemma (in monoid) carrier_not_empty: "carrier G \<noteq> {}"
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   196
by auto
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   197
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   198
text \<open>Power\<close>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   199
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   200
lemma (in monoid) nat_pow_closed [intro, simp]:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   201
  "x \<in> carrier G ==> x [^] (n::nat) \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   202
  by (induct n) (simp_all add: nat_pow_def)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   203
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   204
lemma (in monoid) nat_pow_0 [simp]:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   205
  "x [^] (0::nat) = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   206
  by (simp add: nat_pow_def)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   207
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   208
lemma (in monoid) nat_pow_Suc [simp]:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   209
  "x [^] (Suc n) = x [^] n \<otimes> x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   210
  by (simp add: nat_pow_def)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   211
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   212
lemma (in monoid) nat_pow_one [simp]:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   213
  "\<one> [^] (n::nat) = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   214
  by (induct n) simp_all
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   215
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   216
lemma (in monoid) nat_pow_mult:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   217
  "x \<in> carrier G ==> x [^] (n::nat) \<otimes> x [^] m = x [^] (n + m)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   218
  by (induct m) (simp_all add: m_assoc [THEN sym])
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   219
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   220
lemma (in monoid) nat_pow_comm:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   221
  "x \<in> carrier G \<Longrightarrow> (x [^] (n::nat)) \<otimes> (x [^] (m :: nat)) = (x [^] m) \<otimes> (x [^] n)"
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   222
  using nat_pow_mult[of x n m] nat_pow_mult[of x m n] by (simp add: add.commute)
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   223
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   224
lemma (in monoid) nat_pow_Suc2:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   225
  "x \<in> carrier G \<Longrightarrow> x [^] (Suc n) = x \<otimes> (x [^] n)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   226
  using nat_pow_mult[of x 1 n] Suc_eq_plus1[of n]
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   227
  by (metis One_nat_def Suc_eq_plus1_left l_one nat.rec(1) nat_pow_Suc nat_pow_def)
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   228
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   229
lemma (in monoid) nat_pow_pow:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   230
  "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
   231
  by (induct m) (simp, simp add: nat_pow_mult add.commute)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   232
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   233
lemma (in monoid) nat_pow_consistent:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   234
  "x [^] (n :: nat) = x [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> n"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   235
  unfolding nat_pow_def by simp
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   236
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   237
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   238
(* Jacobson defines submonoid here. *)
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   239
(* Jacobson defines the order of a monoid here. *)
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   240
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   241
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   242
subsection \<open>Groups\<close>
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   243
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   244
text \<open>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   245
  A group is a monoid all of whose elements are invertible.
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   246
\<close>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   247
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   248
locale group = monoid +
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   249
  assumes Units: "carrier G <= Units G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   250
26199
04817a8802f2 explicit referencing of background facts;
wenzelm
parents: 23350
diff changeset
   251
lemma (in group) is_group: "group G" by (rule group_axioms)
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   252
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   253
theorem groupI:
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
   254
  fixes G (structure)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   255
  assumes m_closed [simp]:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   256
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   257
    and one_closed [simp]: "\<one> \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   258
    and m_assoc:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   259
      "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   260
      (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   261
    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
   262
    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
   263
  shows "group G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   264
proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   265
  have l_cancel [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   266
    "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   267
    (x \<otimes> y = x \<otimes> z) = (y = z)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   268
  proof
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   269
    fix x y z
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   270
    assume eq: "x \<otimes> y = x \<otimes> z"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   271
      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
   272
    with l_inv_ex obtain x_inv where xG: "x_inv \<in> carrier G"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   273
      and l_inv: "x_inv \<otimes> x = \<one>" by fast
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   274
    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
   275
      by (simp add: m_assoc)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   276
    with G show "y = z" by (simp add: l_inv)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   277
  next
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   278
    fix x y z
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   279
    assume eq: "y = z"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   280
      and G: "x \<in> carrier G"  "y \<in> carrier G"  "z \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   281
    then show "x \<otimes> y = x \<otimes> z" by simp
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   282
  qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   283
  have r_one:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   284
    "!!x. x \<in> carrier G ==> x \<otimes> \<one> = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   285
  proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   286
    fix x
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   287
    assume x: "x \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   288
    with l_inv_ex obtain x_inv where xG: "x_inv \<in> carrier G"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   289
      and l_inv: "x_inv \<otimes> x = \<one>" by fast
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   290
    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
   291
      by (simp add: m_assoc [symmetric] l_inv)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   292
    with x xG show "x \<otimes> \<one> = x" by simp
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   293
  qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   294
  have inv_ex:
67091
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
   295
    "\<And>x. x \<in> carrier G \<Longrightarrow> \<exists>y \<in> carrier G. y \<otimes> x = \<one> \<and> x \<otimes> y = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   296
  proof -
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   297
    fix x
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   298
    assume x: "x \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   299
    with l_inv_ex obtain y where y: "y \<in> carrier G"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   300
      and l_inv: "y \<otimes> x = \<one>" by fast
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   301
    from x y have "y \<otimes> (x \<otimes> y) = y \<otimes> \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   302
      by (simp add: m_assoc [symmetric] l_inv r_one)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   303
    with x y have r_inv: "x \<otimes> y = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   304
      by simp
67091
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
   305
    from x y show "\<exists>y \<in> carrier G. y \<otimes> x = \<one> \<and> x \<otimes> y = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   306
      by (fast intro: l_inv r_inv)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   307
  qed
67091
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
   308
  then have carrier_subset_Units: "carrier G \<subseteq> Units G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   309
    by (unfold Units_def) fast
61169
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 58622
diff changeset
   310
  show ?thesis
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 58622
diff changeset
   311
    by standard (auto simp: r_one m_assoc carrier_subset_Units)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   312
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   313
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   314
lemma (in monoid) group_l_invI:
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   315
  assumes l_inv_ex:
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   316
    "!!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
   317
  shows "group G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   318
  by (rule groupI) (auto intro: m_assoc l_inv_ex)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   319
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   320
lemma (in group) Units_eq [simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   321
  "Units G = carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   322
proof
67091
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
   323
  show "Units G \<subseteq> carrier G" by fast
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   324
next
67091
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
   325
  show "carrier G \<subseteq> Units G" by (rule Units)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   326
qed
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   327
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   328
lemma (in group) inv_closed [intro, simp]:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   329
  "x \<in> carrier G ==> inv x \<in> carrier G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   330
  using Units_inv_closed by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   331
19981
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   332
lemma (in group) l_inv_ex [simp]:
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   333
  "x \<in> carrier G ==> \<exists>y \<in> carrier G. y \<otimes> x = \<one>"
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   334
  using Units_l_inv_ex by simp
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   335
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   336
lemma (in group) r_inv_ex [simp]:
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   337
  "x \<in> carrier G ==> \<exists>y \<in> carrier G. x \<otimes> y = \<one>"
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   338
  using Units_r_inv_ex by simp
c0f124a0d385 Minor new lemmas.
ballarin
parents: 19931
diff changeset
   339
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   340
lemma (in group) l_inv [simp]:
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   341
  "x \<in> carrier G ==> inv x \<otimes> x = \<one>"
68399
0b71d08528f0 resolution of name clashes in Algebra
paulson <lp15@cam.ac.uk>
parents: 68188
diff changeset
   342
  by simp
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   343
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
   344
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   345
subsection \<open>Cancellation Laws and Basic Properties\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   346
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   347
lemma (in group) r_inv [simp]:
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   348
  "x \<in> carrier G ==> x \<otimes> inv x = \<one>"
68399
0b71d08528f0 resolution of name clashes in Algebra
paulson <lp15@cam.ac.uk>
parents: 68188
diff changeset
   349
  by simp
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   350
68399
0b71d08528f0 resolution of name clashes in Algebra
paulson <lp15@cam.ac.uk>
parents: 68188
diff changeset
   351
lemma (in group) right_cancel [simp]:
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   352
  "[| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   353
   (y \<otimes> x = z \<otimes> x) = (y = z)"
68399
0b71d08528f0 resolution of name clashes in Algebra
paulson <lp15@cam.ac.uk>
parents: 68188
diff changeset
   354
  by (metis inv_closed m_assoc r_inv r_one)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   355
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   356
lemma (in group) inv_inv [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   357
  "x \<in> carrier G ==> inv (inv x) = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   358
  using Units_inv_inv by simp
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   359
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   360
lemma (in group) inv_inj:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   361
  "inj_on (m_inv G) (carrier G)"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   362
  using inv_inj_on_Units by simp
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   363
13854
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
   364
lemma (in group) inv_mult_group:
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   365
  "[| 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
   366
proof -
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   367
  assume G: "x \<in> carrier G"  "y \<in> carrier G"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   368
  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
   369
    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
   370
  with G show ?thesis by (simp del: l_inv Units_l_inv)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   371
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   372
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   373
lemma (in group) inv_comm:
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   374
  "[| 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
   375
  by (rule Units_inv_comm) auto
13940
c67798653056 HOL-Algebra: New polynomial development added.
ballarin
parents: 13936
diff changeset
   376
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   377
lemma (in group) inv_equality:
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   378
     "[|y \<otimes> x = \<one>; x \<in> carrier G; y \<in> carrier G|] ==> inv x = y"
68399
0b71d08528f0 resolution of name clashes in Algebra
paulson <lp15@cam.ac.uk>
parents: 68188
diff changeset
   379
  using inv_unique r_inv by blast
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   380
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   381
(* Contributed by Joachim Breitner *)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   382
lemma (in group) inv_solve_left:
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   383
  "\<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
   384
  by (metis inv_equality l_inv_ex l_one m_assoc r_inv)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   385
lemma (in group) inv_solve_right:
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   386
  "\<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
   387
  by (metis inv_equality l_inv_ex l_one m_assoc r_inv)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   388
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   389
text \<open>Power\<close>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   390
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   391
lemma (in group) int_pow_def2:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   392
  "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
   393
  by (simp add: int_pow_def nat_pow_def Let_def)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   394
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   395
lemma (in group) int_pow_0 [simp]:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   396
  "x [^] (0::int) = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   397
  by (simp add: int_pow_def2)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   398
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   399
lemma (in group) int_pow_one [simp]:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   400
  "\<one> [^] (z::int) = \<one>"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   401
  by (simp add: int_pow_def2)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   402
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   403
(* The following are contributed by Joachim Breitner *)
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
   404
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   405
lemma (in group) int_pow_closed [intro, simp]:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   406
  "x \<in> carrier G ==> x [^] (i::int) \<in> carrier G"
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   407
  by (simp add: int_pow_def2)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   408
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   409
lemma (in group) int_pow_1 [simp]:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   410
  "x \<in> carrier G \<Longrightarrow> x [^] (1::int) = x"
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   411
  by (simp add: int_pow_def2)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   412
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   413
lemma (in group) int_pow_neg:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   414
  "x \<in> carrier G \<Longrightarrow> x [^] (-i::int) = inv (x [^] i)"
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   415
  by (simp add: int_pow_def2)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   416
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   417
lemma (in group) int_pow_mult:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   418
  "x \<in> carrier G \<Longrightarrow> x [^] (i + j::int) = x [^] i \<otimes> x [^] j"
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   419
proof -
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   420
  have [simp]: "-i - j = -j - i" by simp
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67443
diff changeset
   421
  assume "x \<in> carrier G" then
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   422
  show ?thesis
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   423
    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
   424
qed
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
   425
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   426
lemma (in group) nat_pow_inv:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   427
  "x \<in> carrier G \<Longrightarrow> (inv x) [^] (i :: nat) = inv (x [^] i)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   428
proof (induction i)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   429
  case 0 thus ?case by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   430
next
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   431
  case (Suc i)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   432
  have "(inv x) [^] Suc i = ((inv x) [^] i) \<otimes> inv x"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   433
    by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   434
  also have " ... = (inv (x [^] i)) \<otimes> inv x"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   435
    by (simp add: Suc.IH Suc.prems)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   436
  also have " ... = inv (x \<otimes> (x [^] i))"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   437
    using inv_mult_group[OF Suc.prems nat_pow_closed[OF Suc.prems, of i]] by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   438
  also have " ... = inv (x [^] (Suc i))"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   439
    using Suc.prems nat_pow_Suc2 by auto
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   440
  finally show ?case .
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   441
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   442
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   443
lemma (in group) int_pow_inv:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   444
  "x \<in> carrier G \<Longrightarrow> (inv x) [^] (i :: int) = inv (x [^] i)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   445
  by (simp add: nat_pow_inv int_pow_def2)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   446
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   447
lemma (in group) int_pow_pow:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   448
  assumes "x \<in> carrier G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   449
  shows "(x [^] (n :: int)) [^] (m :: int) = x [^] (n * m :: int)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   450
proof (cases)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   451
  assume n_ge: "n \<ge> 0" thus ?thesis
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   452
  proof (cases)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   453
    assume m_ge: "m \<ge> 0" thus ?thesis
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   454
      using n_ge nat_pow_pow[OF assms, of "nat n" "nat m"] int_pow_def2
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   455
      by (simp add: mult_less_0_iff nat_mult_distrib)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   456
  next
68605
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   457
    assume m_lt: "\<not> m \<ge> 0" 
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   458
    with n_ge show ?thesis
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   459
      apply (simp add: int_pow_def2 mult_less_0_iff)
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   460
      by (metis assms mult_minus_right n_ge nat_mult_distrib nat_pow_pow)
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   461
  qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   462
next
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   463
  assume n_lt: "\<not> n \<ge> 0" thus ?thesis
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   464
  proof (cases)
68605
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   465
    assume m_ge: "m \<ge> 0" 
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   466
    have "inv x [^] (nat m * nat (- n)) = inv x [^] nat (- (m * n))"
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   467
      by (metis (full_types) m_ge mult_minus_right nat_mult_distrib)
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   468
    with m_ge n_lt show ?thesis
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   469
      by (simp add: int_pow_def2 mult_less_0_iff assms mult.commute nat_pow_inv nat_pow_pow)
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   470
  next
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   471
    assume m_lt: "\<not> m \<ge> 0" thus ?thesis
68605
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   472
      using n_lt by (auto simp: int_pow_def2 mult_less_0_iff assms nat_mult_distrib_neg nat_pow_inv nat_pow_pow)
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   473
  qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   474
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   475
61628
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   476
lemma (in group) int_pow_diff:
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
   477
  "x \<in> carrier G \<Longrightarrow> x [^] (n - m :: int) = x [^] n \<otimes> inv (x [^] m)"
61628
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   478
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
   479
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   480
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
   481
by(simp add: inj_on_def)
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   482
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   483
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
   484
by(simp add: inj_on_def)
8dd2bd4fe30b add lemmas about monoids and groups
Andreas Lochbihler
parents: 61565
diff changeset
   485
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   486
(*Following subsection contributed by Martin Baillon*)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   487
subsection \<open>Submonoids\<close>
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   488
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   489
locale submonoid =
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   490
  fixes H and G (structure)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   491
  assumes subset: "H \<subseteq> carrier G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   492
    and m_closed [intro, simp]: "\<lbrakk>x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> x \<otimes> y \<in> H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   493
    and one_closed [simp]: "\<one> \<in> H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   494
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   495
lemma (in submonoid) is_submonoid:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   496
  "submonoid H G" by (rule submonoid_axioms)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   497
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   498
lemma (in submonoid) mem_carrier [simp]:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   499
  "x \<in> H \<Longrightarrow> x \<in> carrier G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   500
  using subset by blast
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   501
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   502
lemma (in submonoid) submonoid_is_monoid [intro]:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   503
  assumes "monoid G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   504
  shows "monoid (G\<lparr>carrier := H\<rparr>)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   505
proof -
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   506
  interpret monoid G by fact
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   507
  show ?thesis
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   508
    by (simp add: monoid_def m_assoc)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   509
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   510
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   511
lemma submonoid_nonempty:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   512
  "~ submonoid {} G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   513
  by (blast dest: submonoid.one_closed)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   514
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   515
lemma (in submonoid) finite_monoid_imp_card_positive:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   516
  "finite (carrier G) ==> 0 < card H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   517
proof (rule classical)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   518
  assume "finite (carrier G)" and a: "~ 0 < card H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   519
  then have "finite H" by (blast intro: finite_subset [OF subset])
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   520
  with is_submonoid a have "submonoid {} G" by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   521
  with submonoid_nonempty show ?thesis by contradiction
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   522
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   523
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   524
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   525
lemma (in monoid) monoid_incl_imp_submonoid :
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   526
  assumes "H \<subseteq> carrier G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   527
and "monoid (G\<lparr>carrier := H\<rparr>)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   528
shows "submonoid H G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   529
proof (intro submonoid.intro[OF assms(1)])
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   530
  have ab_eq : "\<And> a b. a \<in> H \<Longrightarrow> b \<in> H \<Longrightarrow> a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> b = a \<otimes> b" using assms by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   531
  have "\<And>a b. a \<in> H \<Longrightarrow> b \<in> H \<Longrightarrow> a \<otimes> b \<in> carrier (G\<lparr>carrier := H\<rparr>) "
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   532
    using assms ab_eq unfolding group_def using monoid.m_closed by fastforce
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   533
  thus "\<And>a b. a \<in> H \<Longrightarrow> b \<in> H \<Longrightarrow> a \<otimes> b \<in> H" by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   534
  show "\<one> \<in> H " using monoid.one_closed[OF assms(2)] assms by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   535
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   536
68517
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   537
lemma (in monoid) inv_unique':
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   538
  assumes "x \<in> carrier G" "y \<in> carrier G"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   539
  shows "\<lbrakk> x \<otimes> y = \<one>; y \<otimes> x = \<one> \<rbrakk> \<Longrightarrow> y = inv x"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   540
proof -
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   541
  assume "x \<otimes> y = \<one>" and l_inv: "y \<otimes> x = \<one>"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   542
  hence unit: "x \<in> Units G"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   543
    using assms unfolding Units_def by auto
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   544
  show "y = inv x"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   545
    using inv_unique[OF l_inv Units_r_inv[OF unit] assms Units_inv_closed[OF unit]] .
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   546
qed
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   547
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   548
lemma (in monoid) m_inv_monoid_consistent: (* contributed by Paulo *)
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   549
  assumes "x \<in> Units (G \<lparr> carrier := H \<rparr>)" and "submonoid H G"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   550
  shows "inv\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> x = inv x"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   551
proof -
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   552
  have monoid: "monoid (G \<lparr> carrier := H \<rparr>)"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   553
    using submonoid.submonoid_is_monoid[OF assms(2) monoid_axioms] .
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   554
  obtain y where y: "y \<in> H" "x \<otimes> y = \<one>" "y \<otimes> x = \<one>"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   555
    using assms(1) unfolding Units_def by auto
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   556
  have x: "x \<in> H" and in_carrier: "x \<in> carrier G" "y \<in> carrier G"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   557
    using y(1) submonoid.subset[OF assms(2)] assms(1) unfolding Units_def by auto
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   558
  show ?thesis
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   559
    using monoid.inv_unique'[OF monoid, of x y] x y
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   560
    using inv_unique'[OF in_carrier y(2-3)] by auto
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   561
qed
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   562
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   563
subsection \<open>Subgroups\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   564
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
   565
locale subgroup =
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
   566
  fixes H and G (structure)
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   567
  assumes subset: "H \<subseteq> carrier G"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   568
    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
   569
    and one_closed [simp]: "\<one> \<in> H"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   570
    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
   571
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
   572
lemma (in subgroup) is_subgroup:
26199
04817a8802f2 explicit referencing of background facts;
wenzelm
parents: 23350
diff changeset
   573
  "subgroup H G" by (rule subgroup_axioms)
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
   574
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   575
declare (in subgroup) group.intro [intro]
13949
0ce528cd6f19 HOL-Algebra complete for release Isabelle2003 (modulo section headers).
ballarin
parents: 13944
diff changeset
   576
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   577
lemma (in subgroup) mem_carrier [simp]:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   578
  "x \<in> H \<Longrightarrow> x \<in> carrier G"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   579
  using subset by blast
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   580
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   581
lemma (in subgroup) subgroup_is_group [intro]:
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   582
  assumes "group G"
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   583
  shows "group (G\<lparr>carrier := H\<rparr>)"
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   584
proof -
29237
e90d9d51106b More porting to new locales.
ballarin
parents: 28823
diff changeset
   585
  interpret group G by fact
68458
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   586
  have "Group.monoid (G\<lparr>carrier := H\<rparr>)"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   587
    by (simp add: monoid_axioms submonoid.intro submonoid.submonoid_is_monoid subset)
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   588
  then show ?thesis
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   589
    by (rule monoid.group_l_invI) (auto intro: l_inv mem_carrier)
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   590
qed
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   591
68555
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
   592
lemma subgroup_is_submonoid:
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
   593
  assumes "subgroup H G" shows "submonoid H G"
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
   594
  using assms by (auto intro: submonoid.intro simp add: subgroup_def)
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
   595
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
   596
lemma (in group) subgroup_Units:
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
   597
  assumes "subgroup H G" shows "H \<subseteq> Units (G \<lparr> carrier := H \<rparr>)"
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
   598
  using group.Units[OF subgroup.subgroup_is_group[OF assms group_axioms]] by simp
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
   599
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
   600
lemma (in group) m_inv_consistent:
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   601
  assumes "subgroup H G" "x \<in> H"
68555
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
   602
  shows "inv\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> x = inv x"
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
   603
  using assms m_inv_monoid_consistent[OF _ subgroup_is_submonoid] subgroup_Units[of H] by auto
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   604
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   605
lemma (in group) int_pow_consistent: (* by Paulo *)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   606
  assumes "subgroup H G" "x \<in> H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   607
  shows "x [^] (n :: int) = x [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> n"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   608
proof (cases)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   609
  assume ge: "n \<ge> 0"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   610
  hence "x [^] n = x [^] (nat n)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   611
    using int_pow_def2 by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   612
  also have " ... = x [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> (nat n)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   613
    using nat_pow_consistent by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   614
  also have " ... = x [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> n"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   615
    using group.int_pow_def2[OF subgroup.subgroup_is_group[OF assms(1) is_group]] ge by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   616
  finally show ?thesis .
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   617
next
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   618
  assume "\<not> n \<ge> 0" hence lt: "n < 0" by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   619
  hence "x [^] n = inv (x [^] (nat (- n)))"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   620
    using int_pow_def2 by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   621
  also have " ... = (inv x) [^] (nat (- n))"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   622
    by (metis assms nat_pow_inv subgroup.mem_carrier)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   623
  also have " ... = (inv\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> x) [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> (nat (- n))"
68555
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
   624
    using m_inv_consistent[OF assms] nat_pow_consistent by auto
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   625
  also have " ... = inv\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> (x [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> (nat (- n)))"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   626
    using group.nat_pow_inv[OF subgroup.subgroup_is_group[OF assms(1) is_group]] assms(2) by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   627
  also have " ... = x [^]\<^bsub>(G \<lparr> carrier := H \<rparr>)\<^esub> n"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   628
    using group.int_pow_def2[OF subgroup.subgroup_is_group[OF assms(1) is_group]] lt by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   629
  finally show ?thesis .
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   630
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   631
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   632
text \<open>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   633
  Since @{term H} is nonempty, it contains some element @{term x}.  Since
63167
0909deb8059b isabelle update_cartouches -c -t;
wenzelm
parents: 61628
diff changeset
   634
  it is closed under inverse, it contains \<open>inv x\<close>.  Since
0909deb8059b isabelle update_cartouches -c -t;
wenzelm
parents: 61628
diff changeset
   635
  it is closed under product, it contains \<open>x \<otimes> inv x = \<one>\<close>.
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   636
\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   637
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   638
lemma (in group) one_in_subset:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   639
  "[| 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
   640
   ==> \<one> \<in> H"
44472
6f2943e34d60 tuned proofs;
wenzelm
parents: 41528
diff changeset
   641
by force
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   642
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   643
text \<open>A characterization of subgroups: closed, non-empty subset.\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   644
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   645
lemma (in group) subgroupI:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   646
  assumes subset: "H \<subseteq> carrier G" and non_empty: "H \<noteq> {}"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   647
    and inv: "!!a. a \<in> H \<Longrightarrow> inv a \<in> H"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   648
    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
   649
  shows "subgroup H G"
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
   650
proof (simp add: subgroup_def assms)
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
   651
  show "\<one> \<in> H" by (rule one_in_subset) (auto simp only: assms)
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   652
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   653
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   654
lemma (in group) subgroupE:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   655
  assumes "subgroup H G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   656
  shows "H \<subseteq> carrier G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   657
    and "H \<noteq> {}"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   658
    and "\<And>a. a \<in> H \<Longrightarrow> inv a \<in> H"
68517
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   659
    and "\<And>a b. \<lbrakk> a \<in> H; b \<in> H \<rbrakk> \<Longrightarrow> a \<otimes> b \<in> H"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   660
  using assms unfolding subgroup_def[of H G] by auto
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   661
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   662
declare monoid.one_closed [iff] group.inv_closed [simp]
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   663
  monoid.l_one [simp] monoid.r_one [simp] group.inv_inv [simp]
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   664
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   665
lemma subgroup_nonempty:
67091
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
   666
  "\<not> subgroup {} G"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   667
  by (blast dest: subgroup.one_closed)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   668
68517
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   669
lemma (in subgroup) finite_imp_card_positive: "finite (carrier G) \<Longrightarrow> 0 < card H"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
   670
  using subset one_closed card_gt_0_iff finite_subset by blast
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   671
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   672
(*Following 3 lemmas contributed by Martin Baillon*)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   673
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   674
lemma (in subgroup) subgroup_is_submonoid :
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   675
  "submonoid H G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   676
  by (simp add: submonoid.intro subset)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   677
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   678
lemma (in group) submonoid_subgroupI :
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   679
  assumes "submonoid H G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   680
    and "\<And>a. a \<in> H \<Longrightarrow> inv a \<in> H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   681
  shows "subgroup H G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   682
  by (metis assms subgroup_def submonoid_def)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   683
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   684
lemma (in group) group_incl_imp_subgroup:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   685
  assumes "H \<subseteq> carrier G"
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   686
    and "group (G\<lparr>carrier := H\<rparr>)"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   687
  shows "subgroup H G"
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   688
proof (intro submonoid_subgroupI[OF monoid_incl_imp_submonoid[OF assms(1)]])
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   689
  show "monoid (G\<lparr>carrier := H\<rparr>)" using group_def assms by blast
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   690
  have ab_eq : "\<And> a b. a \<in> H \<Longrightarrow> b \<in> H \<Longrightarrow> a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> b = a \<otimes> b" using assms by simp
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   691
  fix a  assume aH : "a \<in> H"
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   692
  have " inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> carrier G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   693
    using assms aH group.inv_closed[OF assms(2)] by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   694
  moreover have "\<one>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> = \<one>" using assms monoid.one_closed ab_eq one_def by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   695
  hence "a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a= \<one>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   696
    using assms ab_eq aH  group.r_inv[OF assms(2)] by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   697
  hence "a \<otimes> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a= \<one>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   698
    using aH assms group.inv_closed[OF assms(2)] ab_eq by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   699
  ultimately have "inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = inv a"
68605
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   700
    by (metis aH assms(1) contra_subsetD group.inv_inv is_group local.inv_equality)
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   701
  moreover have "inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> H" 
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
   702
    using aH group.inv_closed[OF assms(2)] by auto
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   703
  ultimately show "inv a \<in> H" by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   704
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   705
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
   706
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   707
subsection \<open>Direct Products\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   708
35848
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   709
definition
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   710
  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
   711
  "G \<times>\<times> H =
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   712
    \<lparr>carrier = carrier G \<times> carrier H,
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   713
     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
   714
     one = (\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>H\<^esub>)\<rparr>"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   715
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   716
lemma DirProd_monoid:
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   717
  assumes "monoid G" and "monoid H"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   718
  shows "monoid (G \<times>\<times> H)"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   719
proof -
30729
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   720
  interpret G: monoid G by fact
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   721
  interpret H: monoid H by fact
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
   722
  from assms
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   723
  show ?thesis by (unfold monoid_def DirProd_def, auto)
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   724
qed
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   725
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   726
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   727
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
   728
lemma DirProd_group:
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   729
  assumes "group G" and "group H"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   730
  shows "group (G \<times>\<times> H)"
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   731
proof -
30729
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   732
  interpret G: group G by fact
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   733
  interpret H: group H by fact
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   734
  show ?thesis by (rule groupI)
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   735
     (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
   736
           simp add: DirProd_def)
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   737
qed
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   738
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   739
lemma carrier_DirProd [simp]:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   740
     "carrier (G \<times>\<times> H) = carrier G \<times> carrier H"
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   741
  by (simp add: DirProd_def)
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   742
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   743
lemma one_DirProd [simp]:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   744
     "\<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
   745
  by (simp add: DirProd_def)
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   746
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   747
lemma mult_DirProd [simp]:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   748
     "(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
   749
  by (simp add: DirProd_def)
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   750
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   751
lemma DirProd_assoc :
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   752
"(G \<times>\<times> H \<times>\<times> I) = (G \<times>\<times> (H \<times>\<times> I))"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   753
  by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   754
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   755
lemma inv_DirProd [simp]:
27611
2c01c0bdb385 Removed uses of context element includes.
ballarin
parents: 26805
diff changeset
   756
  assumes "group G" and "group H"
13944
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   757
  assumes g: "g \<in> carrier G"
9b34607cd83e new proofs about direct products, etc.
paulson
parents: 13943
diff changeset
   758
      and h: "h \<in> carrier H"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   759
  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
   760
proof -
30729
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   761
  interpret G: group G by fact
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   762
  interpret H: group H by fact
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29240
diff changeset
   763
  interpret Prod: group "G \<times>\<times> H"
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
   764
    by (auto intro: DirProd_group group.intro group.axioms assms)
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   765
  show ?thesis by (simp add: Prod.inv_equality g h)
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   766
qed
27698
197f0517f0bd Unit_inv_l, Unit_inv_r made [simp].
ballarin
parents: 27611
diff changeset
   767
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   768
lemma DirProd_subgroups :
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   769
  assumes "group G"
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   770
    and "subgroup H G"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   771
    and "group K"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   772
    and "subgroup I K"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   773
  shows "subgroup (H \<times> I) (G \<times>\<times> K)"
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   774
proof (intro group.group_incl_imp_subgroup[OF DirProd_group[OF assms(1)assms(3)]])
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   775
  have "H \<subseteq> carrier G" "I \<subseteq> carrier K" using subgroup.subset assms apply blast+.
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   776
  thus "(H \<times> I) \<subseteq> carrier (G \<times>\<times> K)" unfolding DirProd_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   777
  have "Group.group ((G\<lparr>carrier := H\<rparr>) \<times>\<times> (K\<lparr>carrier := I\<rparr>))"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   778
    using DirProd_group[OF subgroup.subgroup_is_group[OF assms(2)assms(1)]
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   779
        subgroup.subgroup_is_group[OF assms(4)assms(3)]].
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   780
  moreover have "((G\<lparr>carrier := H\<rparr>) \<times>\<times> (K\<lparr>carrier := I\<rparr>)) = ((G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   781
    unfolding DirProd_def using assms apply simp.
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   782
  ultimately show "Group.group ((G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>)" by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   783
qed
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
   784
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
   785
subsection \<open>Homomorphisms and Isomorphisms\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
   786
35847
19f1f7066917 eliminated old constdefs;
wenzelm
parents: 35416
diff changeset
   787
definition
19f1f7066917 eliminated old constdefs;
wenzelm
parents: 35416
diff changeset
   788
  hom :: "_ => _ => ('a => 'b) set" where
35848
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   789
  "hom G H =
67091
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
   790
    {h. h \<in> carrier G \<rightarrow> carrier H \<and>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
   791
      (\<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
   792
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   793
lemma (in group) hom_compose:
31754
b5260f5272a4 tuned FuncSet
nipkow
parents: 31727
diff changeset
   794
  "[|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
   795
by (fastforce simp add: hom_def compose_def)
13943
83d842ccd4aa moving Bij.thy from GroupTheory to Algebra
paulson
parents: 13940
diff changeset
   796
35848
5443079512ea slightly more uniform definitions -- eliminated old-style meta-equality;
wenzelm
parents: 35847
diff changeset
   797
definition
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   798
  iso :: "_ => _ => ('a => 'b) set"
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   799
  where "iso G H = {h. h \<in> hom G H \<and> bij_betw h (carrier G) (carrier H)}"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   800
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   801
definition
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   802
  is_iso :: "_ \<Rightarrow> _ \<Rightarrow> bool" (infixr "\<cong>" 60)
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   803
  where "G \<cong> H = (iso G H  \<noteq> {})"
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   804
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   805
lemma iso_set_refl: "(\<lambda>x. x) \<in> iso G G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   806
  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
   807
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   808
corollary iso_refl : "G \<cong> G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   809
  using iso_set_refl unfolding is_iso_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   810
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   811
lemma (in group) iso_set_sym:
68458
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   812
  assumes "h \<in> iso G H"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   813
  shows "inv_into (carrier G) h \<in> iso H G"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   814
proof -
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   815
  have h: "h \<in> hom G H" "bij_betw h (carrier G) (carrier H)"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   816
    using assms by (auto simp add: iso_def bij_betw_inv_into)
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   817
  then have HG: "bij_betw (inv_into (carrier G) h) (carrier H) (carrier G)"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   818
    by (simp add: bij_betw_inv_into)
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   819
  have "inv_into (carrier G) h \<in> hom H G"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   820
    unfolding hom_def
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   821
  proof safe
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   822
    show *: "\<And>x. x \<in> carrier H \<Longrightarrow> inv_into (carrier G) h x \<in> carrier G"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   823
      by (meson HG bij_betwE)
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   824
    show "inv_into (carrier G) h (x \<otimes>\<^bsub>H\<^esub> y) = inv_into (carrier G) h x \<otimes> inv_into (carrier G) h y"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   825
      if "x \<in> carrier H" "y \<in> carrier H" for x y
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   826
    proof (rule inv_into_f_eq)
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   827
      show "inj_on h (carrier G)"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   828
        using bij_betw_def h(2) by blast
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   829
      show "inv_into (carrier G) h x \<otimes> inv_into (carrier G) h y \<in> carrier G"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   830
        by (simp add: * that)
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   831
      show "h (inv_into (carrier G) h x \<otimes> inv_into (carrier G) h y) = x \<otimes>\<^bsub>H\<^esub> y"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   832
        using h bij_betw_inv_into_right [of h] unfolding hom_def by (simp add: "*" that)
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   833
    qed
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   834
  qed
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   835
  then show ?thesis
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   836
    by (simp add: Group.iso_def bij_betw_inv_into h)
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   837
qed
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   838
68458
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   839
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   840
corollary (in group) iso_sym: "G \<cong> H \<Longrightarrow> H \<cong> G"
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   841
  using iso_set_sym unfolding is_iso_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   842
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   843
lemma (in group) iso_set_trans:
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   844
     "[|h \<in> iso G H; i \<in> iso H I|] ==> (compose (carrier G) i h) \<in> iso G I"
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   845
by (auto simp add: iso_def hom_compose bij_betw_compose)
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
   846
68458
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
   847
corollary (in group) iso_trans: "\<lbrakk>G \<cong> H ; H \<cong> I\<rbrakk> \<Longrightarrow> G \<cong> I"
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   848
  using iso_set_trans unfolding is_iso_def by blast
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   849
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   850
(* Next four lemmas contributed by Paulo. *)
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   851
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   852
lemma (in monoid) hom_imp_img_monoid:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   853
  assumes "h \<in> hom G H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   854
  shows "monoid (H \<lparr> carrier := h ` (carrier G), one := h \<one>\<^bsub>G\<^esub> \<rparr>)" (is "monoid ?h_img")
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   855
proof (rule monoidI)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   856
  show "\<one>\<^bsub>?h_img\<^esub> \<in> carrier ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   857
    by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   858
next
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   859
  fix x y z assume "x \<in> carrier ?h_img" "y \<in> carrier ?h_img" "z \<in> carrier ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   860
  then obtain g1 g2 g3
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   861
    where g1: "g1 \<in> carrier G" "x = h g1"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   862
      and g2: "g2 \<in> carrier G" "y = h g2"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   863
      and g3: "g3 \<in> carrier G" "z = h g3"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   864
    using image_iff[where ?f = h and ?A = "carrier G"] by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   865
  have aux_lemma:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   866
    "\<And>a b. \<lbrakk> a \<in> carrier G; b \<in> carrier G \<rbrakk> \<Longrightarrow> h a \<otimes>\<^bsub>(?h_img)\<^esub> h b = h (a \<otimes> b)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   867
    using assms unfolding hom_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   868
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   869
  show "x \<otimes>\<^bsub>(?h_img)\<^esub> \<one>\<^bsub>(?h_img)\<^esub> = x"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   870
    using aux_lemma[OF g1(1) one_closed] g1(2) r_one[OF g1(1)] by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   871
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   872
  show "\<one>\<^bsub>(?h_img)\<^esub> \<otimes>\<^bsub>(?h_img)\<^esub> x = x"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   873
    using aux_lemma[OF one_closed g1(1)] g1(2) l_one[OF g1(1)] by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   874
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   875
  have "x \<otimes>\<^bsub>(?h_img)\<^esub> y = h (g1 \<otimes> g2)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   876
    using aux_lemma g1 g2 by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   877
  thus "x \<otimes>\<^bsub>(?h_img)\<^esub> y \<in> carrier ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   878
    using g1(1) g2(1) by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   879
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   880
  have "(x \<otimes>\<^bsub>(?h_img)\<^esub> y) \<otimes>\<^bsub>(?h_img)\<^esub> z = h ((g1 \<otimes> g2) \<otimes> g3)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   881
    using aux_lemma g1 g2 g3 by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   882
  also have " ... = h (g1 \<otimes> (g2 \<otimes> g3))"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   883
    using m_assoc[OF g1(1) g2(1) g3(1)] by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   884
  also have " ... = x \<otimes>\<^bsub>(?h_img)\<^esub> (y \<otimes>\<^bsub>(?h_img)\<^esub> z)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   885
    using aux_lemma g1 g2 g3 by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   886
  finally show "(x \<otimes>\<^bsub>(?h_img)\<^esub> y) \<otimes>\<^bsub>(?h_img)\<^esub> z = x \<otimes>\<^bsub>(?h_img)\<^esub> (y \<otimes>\<^bsub>(?h_img)\<^esub> z)" .
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   887
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   888
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   889
lemma (in group) hom_imp_img_group:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   890
  assumes "h \<in> hom G H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   891
  shows "group (H \<lparr> carrier := h ` (carrier G), one := h \<one>\<^bsub>G\<^esub> \<rparr>)" (is "group ?h_img")
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   892
proof -
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   893
  interpret monoid ?h_img
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   894
    using hom_imp_img_monoid[OF assms] .
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   895
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   896
  show ?thesis
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   897
  proof (unfold_locales)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   898
    show "carrier ?h_img \<subseteq> Units ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   899
    proof (auto simp add: Units_def)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   900
      have aux_lemma:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   901
        "\<And>g1 g2. \<lbrakk> g1 \<in> carrier G; g2 \<in> carrier G \<rbrakk> \<Longrightarrow> h g1 \<otimes>\<^bsub>H\<^esub> h g2 = h (g1 \<otimes> g2)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   902
        using assms unfolding hom_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   903
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   904
      fix g1 assume g1: "g1 \<in> carrier G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   905
      thus "\<exists>g2 \<in> carrier G. (h g2) \<otimes>\<^bsub>H\<^esub> (h g1) = h \<one> \<and> (h g1) \<otimes>\<^bsub>H\<^esub> (h g2) = h \<one>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   906
        using aux_lemma[OF g1 inv_closed[OF g1]]
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   907
              aux_lemma[OF inv_closed[OF g1] g1]
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   908
              inv_closed by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   909
    qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   910
  qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   911
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   912
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   913
lemma (in group) iso_imp_group:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   914
  assumes "G \<cong> H" and "monoid H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   915
  shows "group H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   916
proof -
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   917
  obtain \<phi> where phi: "\<phi> \<in> iso G H" "inv_into (carrier G) \<phi> \<in> iso H G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   918
    using iso_set_sym assms unfolding is_iso_def by blast
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   919
  define \<psi> where psi_def: "\<psi> = inv_into (carrier G) \<phi>"
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   920
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   921
  from phi
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   922
  have surj: "\<phi> ` (carrier G) = (carrier H)" "\<psi> ` (carrier H) = (carrier G)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   923
   and inj: "inj_on \<phi> (carrier G)" "inj_on \<psi> (carrier H)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   924
   and phi_hom: "\<And>g1 g2. \<lbrakk> g1 \<in> carrier G; g2 \<in> carrier G \<rbrakk> \<Longrightarrow> \<phi> (g1 \<otimes> g2) = (\<phi> g1) \<otimes>\<^bsub>H\<^esub> (\<phi> g2)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   925
   and psi_hom: "\<And>h1 h2. \<lbrakk> h1 \<in> carrier H; h2 \<in> carrier H \<rbrakk> \<Longrightarrow> \<psi> (h1 \<otimes>\<^bsub>H\<^esub> h2) = (\<psi> h1) \<otimes> (\<psi> h2)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   926
   using psi_def unfolding iso_def bij_betw_def hom_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   927
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   928
  have phi_one: "\<phi> \<one> = \<one>\<^bsub>H\<^esub>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   929
  proof -
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   930
    have "(\<phi> \<one>) \<otimes>\<^bsub>H\<^esub> \<one>\<^bsub>H\<^esub> = (\<phi> \<one>) \<otimes>\<^bsub>H\<^esub> (\<phi> \<one>)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   931
      by (metis assms(2) image_eqI monoid.r_one one_closed phi_hom r_one surj(1))
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   932
    thus ?thesis
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   933
      by (metis (no_types, hide_lams) Units_eq Units_one_closed assms(2) f_inv_into_f imageI
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   934
          monoid.l_one monoid.one_closed phi_hom psi_def r_one surj)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   935
  qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   936
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   937
  have "carrier H \<subseteq> Units H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   938
  proof
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   939
    fix h assume h: "h \<in> carrier H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   940
    let ?inv_h = "\<phi> (inv (\<psi> h))"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   941
    have "h \<otimes>\<^bsub>H\<^esub> ?inv_h = \<phi> (\<psi> h) \<otimes>\<^bsub>H\<^esub> ?inv_h"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   942
      by (simp add: f_inv_into_f h psi_def surj(1))
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   943
    also have " ... = \<phi> ((\<psi> h) \<otimes> inv (\<psi> h))"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   944
      by (metis h imageI inv_closed phi_hom surj(2))
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   945
    also have " ... = \<phi> \<one>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   946
      by (simp add: h inv_into_into psi_def surj(1))
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   947
    finally have 1: "h \<otimes>\<^bsub>H\<^esub> ?inv_h = \<one>\<^bsub>H\<^esub>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   948
      using phi_one by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   949
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   950
    have "?inv_h \<otimes>\<^bsub>H\<^esub> h = ?inv_h \<otimes>\<^bsub>H\<^esub> \<phi> (\<psi> h)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   951
      by (simp add: f_inv_into_f h psi_def surj(1))
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   952
    also have " ... = \<phi> (inv (\<psi> h) \<otimes> (\<psi> h))"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   953
      by (metis h imageI inv_closed phi_hom surj(2))
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   954
    also have " ... = \<phi> \<one>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   955
      by (simp add: h inv_into_into psi_def surj(1))
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   956
    finally have 2: "?inv_h \<otimes>\<^bsub>H\<^esub> h = \<one>\<^bsub>H\<^esub>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   957
      using phi_one by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   958
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   959
    thus "h \<in> Units H" unfolding Units_def using 1 2 h surj by fastforce
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   960
  qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   961
  thus ?thesis unfolding group_def group_axioms_def using assms(2) by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   962
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   963
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   964
corollary (in group) iso_imp_img_group:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   965
  assumes "h \<in> iso G H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   966
  shows "group (H \<lparr> one := h \<one> \<rparr>)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   967
proof -
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   968
  let ?h_img = "H \<lparr> carrier := h ` (carrier G), one := h \<one> \<rparr>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   969
  have "h \<in> iso G ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   970
    using assms unfolding iso_def hom_def bij_betw_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   971
  hence "G \<cong> ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   972
    unfolding is_iso_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   973
  hence "group ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   974
    using iso_imp_group[of ?h_img] hom_imp_img_monoid[of h H] assms unfolding iso_def by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   975
  moreover have "carrier H = carrier ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   976
    using assms unfolding iso_def bij_betw_def by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   977
  hence "H \<lparr> one := h \<one> \<rparr> = ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   978
    by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   979
  ultimately show ?thesis by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   980
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   981
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   982
lemma DirProd_commute_iso_set:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   983
  shows "(\<lambda>(x,y). (y,x)) \<in> iso (G \<times>\<times> H) (H \<times>\<times> G)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   984
  by (auto simp add: iso_def hom_def inj_on_def bij_betw_def)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   985
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   986
corollary DirProd_commute_iso :
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   987
"(G \<times>\<times> H) \<cong> (H \<times>\<times> G)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   988
  using DirProd_commute_iso_set unfolding is_iso_def by blast
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   989
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   990
lemma DirProd_assoc_iso_set:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   991
  shows "(\<lambda>(x,y,z). (x,(y,z))) \<in> iso (G \<times>\<times> H \<times>\<times> I) (G \<times>\<times> (H \<times>\<times> I))"
31754
b5260f5272a4 tuned FuncSet
nipkow
parents: 31727
diff changeset
   992
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
   993
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
   994
lemma (in group) DirProd_iso_set_trans:
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   995
  assumes "g \<in> iso G G2"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   996
    and "h \<in> iso H I"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   997
  shows "(\<lambda>(x,y). (g x, h y)) \<in> iso (G \<times>\<times> H) (G2 \<times>\<times> I)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   998
proof-
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
   999
  have "(\<lambda>(x,y). (g x, h y)) \<in> hom (G \<times>\<times> H) (G2 \<times>\<times> I)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1000
    using assms unfolding iso_def hom_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1001
  moreover have " inj_on (\<lambda>(x,y). (g x, h y)) (carrier (G \<times>\<times> H))"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1002
    using assms unfolding iso_def DirProd_def bij_betw_def inj_on_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1003
  moreover have "(\<lambda>(x, y). (g x, h y)) ` carrier (G \<times>\<times> H) = carrier (G2 \<times>\<times> I)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1004
    using assms unfolding iso_def bij_betw_def image_def DirProd_def by fastforce
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1005
  ultimately show "(\<lambda>(x,y). (g x, h y)) \<in> iso (G \<times>\<times> H) (G2 \<times>\<times> I)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1006
    unfolding iso_def bij_betw_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1007
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1008
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1009
corollary (in group) DirProd_iso_trans :
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1010
  assumes "G \<cong> G2"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1011
    and "H \<cong> I"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1012
  shows "G \<times>\<times> H \<cong> G2 \<times>\<times> I"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1013
  using DirProd_iso_set_trans assms unfolding is_iso_def by blast
14761
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
  1014
28b5eb4a867f more results about isomorphisms
paulson
parents: 14751
diff changeset
  1015
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
  1016
text\<open>Basis for homomorphism proofs: we assume two groups @{term G} and
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
  1017
  @{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
  1018
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
  1019
  fixes h
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1020
  assumes homh: "h \<in> hom G H"
29240
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
  1021
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
  1022
lemma (in group_hom) hom_mult [simp]:
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
  1023
  "[| 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
  1024
proof -
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
  1025
  assume "x \<in> carrier G" "y \<in> carrier G"
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
  1026
  with homh [unfolded hom_def] show ?thesis by simp
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
  1027
qed
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
  1028
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
  1029
lemma (in group_hom) hom_closed [simp]:
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
  1030
  "x \<in> carrier G ==> h x \<in> carrier H"
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
  1031
proof -
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
  1032
  assume "x \<in> carrier G"
31754
b5260f5272a4 tuned FuncSet
nipkow
parents: 31727
diff changeset
  1033
  with homh [unfolded hom_def] show ?thesis by auto
29240
bb81c3709fb6 More porting to new locales.
ballarin
parents: 29237
diff changeset
  1034
qed
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1035
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1036
lemma (in group_hom) one_closed [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1037
  "h \<one> \<in> carrier H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1038
  by simp
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1039
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1040
lemma (in group_hom) hom_one [simp]:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1041
  "h \<one> = \<one>\<^bsub>H\<^esub>"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1042
proof -
15076
4b3d280ef06a New prover for transitive and reflexive-transitive closure of relations.
ballarin
parents: 14963
diff changeset
  1043
  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
  1044
    by (simp add: hom_mult [symmetric] del: hom_mult)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1045
  then show ?thesis by (simp del: r_one)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1046
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1047
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1048
lemma (in group_hom) inv_closed [simp]:
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1049
  "x \<in> carrier G ==> h (inv x) \<in> carrier H"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1050
  by simp
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1051
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1052
lemma (in group_hom) hom_inv [simp]:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1053
  "x \<in> carrier G ==> h (inv x) = inv\<^bsub>H\<^esub> (h x)"
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1054
proof -
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1055
  assume x: "x \<in> carrier G"
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1056
  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
  1057
    by (simp add: hom_mult [symmetric] del: hom_mult)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1058
  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
  1059
    by (simp add: hom_mult [symmetric] del: hom_mult)
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1060
  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
  1061
  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
  1062
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1063
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
  1064
(* Contributed by Joachim Breitner *)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
  1065
lemma (in group) int_pow_is_hom:
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 67342
diff changeset
  1066
  "x \<in> carrier G \<Longrightarrow> (([^]) x) \<in> hom \<lparr> carrier = UNIV, mult = (+), one = 0::int \<rparr> G "
57271
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
  1067
  unfolding hom_def by (simp add: int_pow_mult)
3a20f8a24b13 Lemmas contributed by Joachim Breitner.
ballarin
parents: 55926
diff changeset
  1068
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1069
(* Next six lemmas contributed by Paulo. *)
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1070
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1071
lemma (in group_hom) img_is_subgroup: "subgroup (h ` (carrier G)) H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1072
  apply (rule subgroupI)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1073
  apply (auto simp add: image_subsetI)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1074
  apply (metis (no_types, hide_lams) G.inv_closed hom_inv image_iff)
68605
440aa6b7d99a removal of smt
paulson <lp15@cam.ac.uk>
parents: 68555
diff changeset
  1075
  by (metis G.monoid_axioms hom_mult image_eqI monoid.m_closed)
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1076
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1077
lemma (in group_hom) subgroup_img_is_subgroup:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1078
  assumes "subgroup I G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1079
  shows "subgroup (h ` I) H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1080
proof -
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1081
  have "h \<in> hom (G \<lparr> carrier := I \<rparr>) H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1082
    using G.subgroupE[OF assms] subgroup.mem_carrier[OF assms] homh
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1083
    unfolding hom_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1084
  hence "group_hom (G \<lparr> carrier := I \<rparr>) H h"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1085
    using subgroup.subgroup_is_group[OF assms G.is_group] is_group
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1086
    unfolding group_hom_def group_hom_axioms_def by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1087
  thus ?thesis
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1088
    using group_hom.img_is_subgroup[of "G \<lparr> carrier := I \<rparr>" H h] by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1089
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1090
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1091
lemma (in group_hom) induced_group_hom:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1092
  assumes "subgroup I G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1093
  shows "group_hom (G \<lparr> carrier := I \<rparr>) (H \<lparr> carrier := h ` I \<rparr>) h"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1094
proof -
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1095
  have "h \<in> hom (G \<lparr> carrier := I \<rparr>) (H \<lparr> carrier := h ` I \<rparr>)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1096
    using homh subgroup.mem_carrier[OF assms] unfolding hom_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1097
  thus ?thesis
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1098
    unfolding group_hom_def group_hom_axioms_def
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1099
    using subgroup.subgroup_is_group[OF assms G.is_group]
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1100
          subgroup.subgroup_is_group[OF subgroup_img_is_subgroup[OF assms] is_group] by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1101
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1102
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1103
lemma (in group) canonical_inj_is_hom:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1104
  assumes "subgroup H G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1105
  shows "group_hom (G \<lparr> carrier := H \<rparr>) G id"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1106
  unfolding group_hom_def group_hom_axioms_def hom_def
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1107
  using subgroup.subgroup_is_group[OF assms is_group]
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1108
        is_group subgroup.subset[OF assms] by auto
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1109
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1110
lemma (in group_hom) nat_pow_hom:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1111
  "x \<in> carrier G \<Longrightarrow> h (x [^] (n :: nat)) = (h x) [^]\<^bsub>H\<^esub> n"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1112
  by (induction n) auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1113
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1114
lemma (in group_hom) int_pow_hom:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1115
  "x \<in> carrier G \<Longrightarrow> h (x [^] (n :: int)) = (h x) [^]\<^bsub>H\<^esub> n"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1116
  using int_pow_def2 nat_pow_hom by (simp add: G.int_pow_def2)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1117
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
  1118
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
  1119
subsection \<open>Commutative Structures\<close>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1120
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
  1121
text \<open>
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1122
  Naming convention: multiplicative structures that are commutative
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1123
  are called \emph{commutative}, additive structures are called
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1124
  \emph{Abelian}.
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
  1125
\<close>
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1126
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
  1127
locale comm_monoid = monoid +
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
  1128
  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
  1129
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
  1130
lemma (in comm_monoid) m_lcomm:
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
  1131
  "\<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
  1132
   x \<otimes> (y \<otimes> z) = y \<otimes> (x \<otimes> z)"
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1133
proof -
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1134
  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
  1135
  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
  1136
  also from xyz have "... = (y \<otimes> x) \<otimes> z" by (simp add: m_comm)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1137
  also from xyz have "... = y \<otimes> (x \<otimes> z)" by (simp add: m_assoc)
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1138
  finally show ?thesis .
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1139
qed
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1140
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
  1141
lemmas (in comm_monoid) m_ac = m_assoc m_comm m_lcomm
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1142
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1143
lemma comm_monoidI:
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
  1144
  fixes G (structure)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1145
  assumes m_closed:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1146
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1147
    and one_closed: "\<one> \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1148
    and m_assoc:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1149
      "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1150
      (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1151
    and l_one: "!!x. x \<in> carrier G ==> \<one> \<otimes> x = x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1152
    and m_comm:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1153
      "!!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
  1154
  shows "comm_monoid G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1155
  using l_one
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1156
    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
  1157
             intro: assms simp: m_closed one_closed m_comm)
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
  1158
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1159
lemma (in monoid) monoid_comm_monoidI:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1160
  assumes m_comm:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1161
      "!!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
  1162
  shows "comm_monoid G"
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1163
  by (rule comm_monoidI) (auto intro: m_assoc m_comm)
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
  1164
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1165
lemma (in comm_monoid) nat_pow_distr:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1166
  "[| x \<in> carrier G; y \<in> carrier G |] ==>
67341
df79ef3b3a41 Renamed (^) to [^] in preparation of the move from "op X" to (X)
nipkow
parents: 67091
diff changeset
  1167
  (x \<otimes> y) [^] (n::nat) = x [^] n \<otimes> y [^] n"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1168
  by (induct n) (simp, simp add: m_ac)
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1169
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1170
lemma (in comm_monoid) submonoid_is_comm_monoid :
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1171
  assumes "submonoid H G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1172
  shows "comm_monoid (G\<lparr>carrier := H\<rparr>)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1173
proof (intro monoid.monoid_comm_monoidI)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1174
  show "monoid (G\<lparr>carrier := H\<rparr>)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1175
    using submonoid.submonoid_is_monoid assms comm_monoid_axioms comm_monoid_def by blast
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1176
  show "\<And>x y. x \<in> carrier (G\<lparr>carrier := H\<rparr>) \<Longrightarrow> y \<in> carrier (G\<lparr>carrier := H\<rparr>)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1177
        \<Longrightarrow> x \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> y = y \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> x" apply simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1178
    using  assms comm_monoid_axioms_def submonoid.mem_carrier
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1179
    by (metis m_comm)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1180
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1181
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1182
locale comm_group = comm_monoid + group
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1183
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1184
lemma (in group) group_comm_groupI:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1185
  assumes m_comm: "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1186
      x \<otimes> y = y \<otimes> x"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1187
  shows "comm_group G"
61169
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 58622
diff changeset
  1188
  by standard (simp_all add: m_comm)
13817
7e031a968443 Product operator added --- preliminary.
ballarin
parents: 13813
diff changeset
  1189
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1190
lemma comm_groupI:
19783
82f365a14960 Improved parameter management of locales.
ballarin
parents: 19699
diff changeset
  1191
  fixes G (structure)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1192
  assumes m_closed:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1193
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y \<in> carrier G"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1194
    and one_closed: "\<one> \<in> carrier G"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1195
    and m_assoc:
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1196
      "!!x y z. [| x \<in> carrier G; y \<in> carrier G; z \<in> carrier G |] ==>
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1197
      (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1198
    and m_comm:
14693
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1199
      "!!x y. [| x \<in> carrier G; y \<in> carrier G |] ==> x \<otimes> y = y \<otimes> x"
4deda204e1d8 improved syntax;
wenzelm
parents: 14651
diff changeset
  1200
    and l_one: "!!x. x \<in> carrier G ==> \<one> \<otimes> x = x"
14963
d584e32f7d46 removal of magmas and semigroups
paulson
parents: 14852
diff changeset
  1201
    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
  1202
  shows "comm_group G"
27714
27b4d7c01f8b Tuned (for the sake of a meaningless log entry).
ballarin
parents: 27713
diff changeset
  1203
  by (fast intro: group.group_comm_groupI groupI assms)
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1204
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1205
lemma comm_groupE:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1206
  fixes G (structure)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1207
  assumes "comm_group G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1208
  shows "\<And>x y. \<lbrakk> x \<in> carrier G; y \<in> carrier G \<rbrakk> \<Longrightarrow> x \<otimes> y \<in> carrier G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1209
    and "\<one> \<in> carrier G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1210
    and "\<And>x y z. \<lbrakk> x \<in> carrier G; y \<in> carrier G; z \<in> carrier G \<rbrakk> \<Longrightarrow> (x \<otimes> y) \<otimes> z = x \<otimes> (y \<otimes> z)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1211
    and "\<And>x y. \<lbrakk> x \<in> carrier G; y \<in> carrier G \<rbrakk> \<Longrightarrow> x \<otimes> y = y \<otimes> x"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1212
    and "\<And>x. x \<in> carrier G \<Longrightarrow> \<one> \<otimes> x = x"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1213
    and "\<And>x. x \<in> carrier G \<Longrightarrow> \<exists>y \<in> carrier G. y \<otimes> x = \<one>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1214
  apply (simp_all add: group.axioms assms comm_group.axioms comm_monoid.m_comm comm_monoid.m_ac(1))
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1215
  by (simp_all add: Group.group.axioms(1) assms comm_group.axioms(2) monoid.m_closed group.r_inv_ex)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1216
13936
d3671b878828 Greatly extended CRing. Added Module.
ballarin
parents: 13854
diff changeset
  1217
lemma (in comm_group) inv_mult:
13854
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
  1218
  "[| 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
  1219
  by (simp add: m_ac inv_mult_group)
13854
91c9ab25fece First distributed version of Group and Ring theory.
ballarin
parents: 13835
diff changeset
  1220
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1221
(* Next three lemmas contributed by Paulo. *)
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1222
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1223
lemma (in comm_monoid) hom_imp_img_comm_monoid:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1224
  assumes "h \<in> hom G H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1225
  shows "comm_monoid (H \<lparr> carrier := h ` (carrier G), one := h \<one>\<^bsub>G\<^esub> \<rparr>)" (is "comm_monoid ?h_img")
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1226
proof (rule monoid.monoid_comm_monoidI)
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1227
  show "monoid ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1228
    using hom_imp_img_monoid[OF assms] .
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1229
next
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1230
  fix x y assume "x \<in> carrier ?h_img" "y \<in> carrier ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1231
  then obtain g1 g2
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1232
    where g1: "g1 \<in> carrier G" "x = h g1"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1233
      and g2: "g2 \<in> carrier G" "y = h g2"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1234
    by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1235
  have "x \<otimes>\<^bsub>(?h_img)\<^esub> y = h (g1 \<otimes> g2)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1236
    using g1 g2 assms unfolding hom_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1237
  also have " ... = h (g2 \<otimes> g1)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1238
    using m_comm[OF g1(1) g2(1)] by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1239
  also have " ... = y \<otimes>\<^bsub>(?h_img)\<^esub> x"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1240
    using g1 g2 assms unfolding hom_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1241
  finally show "x \<otimes>\<^bsub>(?h_img)\<^esub> y = y \<otimes>\<^bsub>(?h_img)\<^esub> x" .
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1242
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1243
68517
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
  1244
lemma (in comm_group) hom_imp_img_comm_group:
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
  1245
  assumes "h \<in> hom G H"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
  1246
  shows "comm_group (H \<lparr> carrier := h ` (carrier G), one := h \<one>\<^bsub>G\<^esub> \<rparr>)"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
  1247
  unfolding comm_group_def
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
  1248
  using hom_imp_img_group[OF assms] hom_imp_img_comm_monoid[OF assms] by simp
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
  1249
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1250
lemma (in comm_group) iso_imp_img_comm_group:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1251
  assumes "h \<in> iso G H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1252
  shows "comm_group (H \<lparr> one := h \<one>\<^bsub>G\<^esub> \<rparr>)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1253
proof -
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1254
  let ?h_img = "H \<lparr> carrier := h ` (carrier G), one := h \<one> \<rparr>"
68517
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
  1255
  have "comm_group ?h_img"
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
  1256
    using hom_imp_img_comm_group[of h H] assms unfolding iso_def by auto
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1257
  moreover have "carrier H = carrier ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1258
    using assms unfolding iso_def bij_betw_def by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1259
  hence "H \<lparr> one := h \<one> \<rparr> = ?h_img"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1260
    by simp
68517
6b5f15387353 a few new lemmas
paulson <lp15@cam.ac.uk>
parents: 68458
diff changeset
  1261
  ultimately show ?thesis by simp
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1262
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1263
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1264
lemma (in comm_group) iso_imp_comm_group:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1265
  assumes "G \<cong> H" "monoid H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1266
  shows "comm_group H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1267
proof -
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1268
  obtain h where h: "h \<in> iso G H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1269
    using assms(1) unfolding is_iso_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1270
  hence comm_gr: "comm_group (H \<lparr> one := h \<one> \<rparr>)"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1271
    using iso_imp_img_comm_group[of h H] by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1272
  hence "\<And>x. x \<in> carrier H \<Longrightarrow> h \<one> \<otimes>\<^bsub>H\<^esub> x = x"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1273
    using monoid.l_one[of "H \<lparr> one := h \<one> \<rparr>"] unfolding comm_group_def comm_monoid_def by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1274
  moreover have "h \<one> \<in> carrier H"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1275
    using h one_closed unfolding iso_def hom_def by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1276
  ultimately have "h \<one> = \<one>\<^bsub>H\<^esub>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1277
    using monoid.one_unique[OF assms(2), of "h \<one>"] by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1278
  hence "H = H \<lparr> one := h \<one> \<rparr>"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1279
    by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1280
  thus ?thesis
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1281
    using comm_gr by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1282
qed
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1283
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1284
(*A subgroup of a subgroup is a subgroup of the group*)
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1285
lemma (in group) incl_subgroup:
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1286
  assumes "subgroup J G"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1287
    and "subgroup I (G\<lparr>carrier:=J\<rparr>)"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1288
  shows "subgroup I G" unfolding subgroup_def
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1289
proof
68452
c027dfbfad30 more on infinite products. Also subgroup_imp_subset -> subgroup.subset
paulson <lp15@cam.ac.uk>
parents: 68445
diff changeset
  1290
  have H1: "I \<subseteq> carrier (G\<lparr>carrier:=J\<rparr>)" using assms(2) subgroup.subset by blast
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1291
  also have H2: "...\<subseteq>J" by simp
68452
c027dfbfad30 more on infinite products. Also subgroup_imp_subset -> subgroup.subset
paulson <lp15@cam.ac.uk>
parents: 68445
diff changeset
  1292
  also  have "...\<subseteq>(carrier G)"  by (simp add: assms(1) subgroup.subset)
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1293
  finally have H: "I \<subseteq> carrier G" by simp
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1294
  have "(\<And>x y. \<lbrakk>x \<in> I ; y \<in> I\<rbrakk> \<Longrightarrow> x \<otimes> y \<in> I)" using assms(2) by (auto simp add: subgroup_def)
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1295
  thus  "I \<subseteq> carrier G \<and> (\<forall>x y. x \<in> I \<longrightarrow> y \<in> I \<longrightarrow> x \<otimes> y \<in> I)"  using H by blast
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1296
  have K: "\<one> \<in> I" using assms(2) by (auto simp add: subgroup_def)
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1297
  have "(\<And>x. x \<in> I \<Longrightarrow> inv x \<in> I)" using assms  subgroup.m_inv_closed H
68555
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
  1298
    by (metis H1 H2 m_inv_consistent subsetCE)
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1299
  thus "\<one> \<in> I \<and> (\<forall>x. x \<in> I \<longrightarrow> inv x \<in> I)" using K by blast
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1300
qed
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1301
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1302
(*A subgroup included in another subgroup is a subgroup of the subgroup*)
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1303
lemma (in group) subgroup_incl:
68555
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
  1304
  assumes "subgroup I G" and "subgroup J G" and "I \<subseteq> J"
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
  1305
  shows "subgroup I (G \<lparr> carrier := J \<rparr>)"
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
  1306
  using group.group_incl_imp_subgroup[of "G \<lparr> carrier := J \<rparr>" I]
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
  1307
        assms(1-2)[THEN subgroup.subgroup_is_group[OF _ group_axioms]] assms(3) by auto
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1308
20318
0e0ea63fe768 Restructured algebra library, added ideals and quotient rings.
ballarin
parents: 19984
diff changeset
  1309
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
  1310
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
  1311
61382
efac889fccbc isabelle update_cartouches;
wenzelm
parents: 61169
diff changeset
  1312
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
  1313
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1314
theorem (in group) subgroups_partial_order:
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 67342
diff changeset
  1315
  "partial_order \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>"
61169
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 58622
diff changeset
  1316
  by standard simp_all
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1317
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1318
lemma (in group) subgroup_self:
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1319
  "subgroup (carrier G) G"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1320
  by (rule subgroupI) auto
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1321
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1322
lemma (in group) subgroup_imp_group:
55926
3ef14caf5637 more symbols;
wenzelm
parents: 55415
diff changeset
  1323
  "subgroup H G ==> group (G\<lparr>carrier := H\<rparr>)"
26199
04817a8802f2 explicit referencing of background facts;
wenzelm
parents: 23350
diff changeset
  1324
  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
  1325
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1326
lemma (in group) is_monoid [intro, simp]:
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1327
  "monoid G"
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1328
  by (auto intro: monoid.intro m_assoc)
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1329
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1330
lemma (in group) subgroup_mult_equality:
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1331
  "\<lbrakk> subgroup H G; h1 \<in> H; h2 \<in> H \<rbrakk> \<Longrightarrow>  h1 \<otimes>\<^bsub>G \<lparr> carrier := H \<rparr>\<^esub> h2 = h1 \<otimes> h2"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1332
  unfolding subgroup_def by simp
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1333
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1334
theorem (in group) subgroups_Inter:
67091
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
  1335
  assumes subgr: "(\<And>H. H \<in> A \<Longrightarrow> subgroup H G)"
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
  1336
    and not_empty: "A \<noteq> {}"
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1337
  shows "subgroup (\<Inter>A) G"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1338
proof (rule subgroupI)
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1339
  from subgr [THEN subgroup.subset] and not_empty
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1340
  show "\<Inter>A \<subseteq> carrier G" by blast
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1341
next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1342
  from subgr [THEN subgroup.one_closed]
67091
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
  1343
  show "\<Inter>A \<noteq> {}" by blast
14751
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1344
next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1345
  fix x assume "x \<in> \<Inter>A"
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1346
  with subgr [THEN subgroup.m_inv_closed]
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1347
  show "inv x \<in> \<Inter>A" by blast
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1348
next
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1349
  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
  1350
  with subgr [THEN subgroup.m_closed]
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1351
  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
  1352
qed
0d7850e27fed Change of theory hierarchy: Group is now based in Lattice.
ballarin
parents: 14706
diff changeset
  1353
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1354
lemma (in group) subgroups_Inter_pair :
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1355
  assumes  "subgroup I G"
68443
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1356
    and  "subgroup J G"
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1357
  shows "subgroup (I\<inter>J) G" using subgroups_Inter[ where ?A = "{I,J}"] assms by auto
43055b016688 New material from Martin Baillon and Paulo Emílio de Vilhena
paulson <lp15@cam.ac.uk>
parents: 68399
diff changeset
  1358
66579
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1359
theorem (in group) subgroups_complete_lattice:
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 67342
diff changeset
  1360
  "complete_lattice \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>"
66579
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1361
    (is "complete_lattice ?L")
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1362
proof (rule partial_order.complete_lattice_criterion1)
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1363
  show "partial_order ?L" by (rule subgroups_partial_order)
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1364
next
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1365
  have "greatest ?L (carrier G) (carrier ?L)"
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1366
    by (unfold greatest_def) (simp add: subgroup.subset subgroup_self)
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1367
  then show "\<exists>G. greatest ?L G (carrier ?L)" ..
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1368
next
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1369
  fix A
67091
1393c2340eec more symbols;
wenzelm
parents: 66579
diff changeset
  1370
  assume L: "A \<subseteq> carrier ?L" and non_empty: "A \<noteq> {}"
66579
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1371
  then have Int_subgroup: "subgroup (\<Inter>A) G"
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1372
    by (fastforce intro: subgroups_Inter)
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1373
  have "greatest ?L (\<Inter>A) (Lower ?L A)" (is "greatest _ ?Int _")
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1374
  proof (rule greatest_LowerI)
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1375
    fix H
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1376
    assume H: "H \<in> A"
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1377
    with L have subgroupH: "subgroup H G" by auto
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1378
    from subgroupH have groupH: "group (G \<lparr>carrier := H\<rparr>)" (is "group ?H")
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1379
      by (rule subgroup_imp_group)
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1380
    from groupH have monoidH: "monoid ?H"
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1381
      by (rule group.is_monoid)
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1382
    from H have Int_subset: "?Int \<subseteq> H" by fastforce
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1383
    then show "le ?L ?Int H" by simp
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1384
  next
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1385
    fix H
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1386
    assume H: "H \<in> Lower ?L A"
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1387
    with L Int_subgroup show "le ?L H ?Int"
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1388
      by (fastforce simp: Lower_def intro: Inter_greatest)
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1389
  next
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1390
    show "A \<subseteq> carrier ?L" by (rule L)
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1391
  next
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1392
    show "?Int \<in> carrier ?L" by simp (rule Int_subgroup)
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1393
  qed
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1394
  then show "\<exists>I. greatest ?L I (Lower ?L A)" ..
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1395
qed
2db3fe23fdaf Revert 5a42eddc11c1.
ballarin
parents: 66501
diff changeset
  1396
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1397
subsection\<open>Jeremy Avigad's @{text"More_Group"} material\<close>
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1398
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1399
text \<open>
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1400
  Show that the units in any monoid give rise to a group.
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1401
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1402
  The file Residues.thy provides some infrastructure to use
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1403
  facts about the unit group within the ring locale.
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1404
\<close>
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1405
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1406
definition units_of :: "('a, 'b) monoid_scheme \<Rightarrow> 'a monoid"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1407
  where "units_of G =
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1408
    \<lparr>carrier = Units G, Group.monoid.mult = Group.monoid.mult G, one  = one G\<rparr>"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1409
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1410
lemma (in monoid) units_group: "group (units_of G)"
68458
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1411
proof -
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1412
  have "\<And>x y z. \<lbrakk>x \<in> Units G; y \<in> Units G; z \<in> Units G\<rbrakk> \<Longrightarrow> x \<otimes> y \<otimes> z = x \<otimes> (y \<otimes> z)"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1413
    by (simp add: Units_closed m_assoc)
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1414
  moreover have "\<And>x. x \<in> Units G \<Longrightarrow> \<exists>y\<in>Units G. y \<otimes> x = \<one>"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1415
    using Units_l_inv by blast
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1416
  ultimately show ?thesis
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1417
    unfolding units_of_def
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1418
    by (force intro!: groupI)
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1419
qed
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1420
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1421
lemma (in comm_monoid) units_comm_group: "comm_group (units_of G)"
68458
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1422
proof -
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1423
  have "\<And>x y. \<lbrakk>x \<in> carrier (units_of G); y \<in> carrier (units_of G)\<rbrakk>
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1424
              \<Longrightarrow> x \<otimes>\<^bsub>units_of G\<^esub> y = y \<otimes>\<^bsub>units_of G\<^esub> x"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1425
    by (simp add: Units_closed m_comm units_of_def)
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1426
  then show ?thesis
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1427
    by (rule group.group_comm_groupI [OF units_group]) auto
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1428
qed
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1429
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1430
lemma units_of_carrier: "carrier (units_of G) = Units G"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1431
  by (auto simp: units_of_def)
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1432
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1433
lemma units_of_mult: "mult (units_of G) = mult G"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1434
  by (auto simp: units_of_def)
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1435
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1436
lemma units_of_one: "one (units_of G) = one G"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1437
  by (auto simp: units_of_def)
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1438
68555
22d51874f37d a few more lemmas from Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68551
diff changeset
  1439
lemma (in monoid) units_of_inv:
68458
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1440
  assumes "x \<in> Units G"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1441
  shows "m_inv (units_of G) x = m_inv G x"
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1442
  by (simp add: assms group.inv_equality units_group units_of_carrier units_of_mult units_of_one)
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1443
68551
b680e74eb6f2 More on Algebra by Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68517
diff changeset
  1444
lemma units_of_units [simp] : "Units (units_of G) = Units G"
b680e74eb6f2 More on Algebra by Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68517
diff changeset
  1445
  unfolding units_of_def Units_def by force
b680e74eb6f2 More on Algebra by Paulo and Martin
paulson <lp15@cam.ac.uk>
parents: 68517
diff changeset
  1446
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1447
lemma (in group) surj_const_mult: "a \<in> carrier G \<Longrightarrow> (\<lambda>x. a \<otimes> x) ` carrier G = carrier G"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1448
  apply (auto simp add: image_def)
68458
023b353911c5 Algebra tidy-up
paulson <lp15@cam.ac.uk>
parents: 68452
diff changeset
  1449
  by (metis inv_closed inv_solve_left m_closed)
68445
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1450
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1451
lemma (in group) l_cancel_one [simp]: "x \<in> carrier G \<Longrightarrow> a \<in> carrier G \<Longrightarrow> x \<otimes> a = x \<longleftrightarrow> a = one G"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1452
  by (metis Units_eq Units_l_cancel monoid.r_one monoid_axioms one_closed)
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1453
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1454
lemma (in group) r_cancel_one [simp]: "x \<in> carrier G \<Longrightarrow> a \<in> carrier G \<Longrightarrow> a \<otimes> x = x \<longleftrightarrow> a = one G"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1455
  by (metis monoid.l_one monoid_axioms one_closed right_cancel)
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1456
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1457
lemma (in group) l_cancel_one' [simp]: "x \<in> carrier G \<Longrightarrow> a \<in> carrier G \<Longrightarrow> x = x \<otimes> a \<longleftrightarrow> a = one G"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1458
  using l_cancel_one by fastforce
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1459
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1460
lemma (in group) r_cancel_one' [simp]: "x \<in> carrier G \<Longrightarrow> a \<in> carrier G \<Longrightarrow> x = a \<otimes> x \<longleftrightarrow> a = one G"
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1461
  using r_cancel_one by fastforce
c183a6a69f2d reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories
paulson <lp15@cam.ac.uk>
parents: 68443
diff changeset
  1462
13813
722593f2f068 New development of algebra: Groups.
ballarin
parents:
diff changeset
  1463
end