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