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