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