1 (* Title: HOL/Algebra/Sylow.thy
3 Author: Florian Kammueller, with new proofs by L C Paulson
6 header {* Sylow's theorem *}
8 theory Sylow imports Coset begin
11 See also \cite{Kammueller-Paulson:1999}.
14 text{*The combinatorial argument is in theory Exponent*}
16 locale sylow = group +
17 fixes p and a and m and calM and RelM
18 assumes prime_p: "p \<in> prime"
19 and order_G: "order(G) = (p^a) * m"
20 and finite_G [iff]: "finite (carrier G)"
21 defines "calM == {s. s \<subseteq> carrier(G) & card(s) = p^a}"
22 and "RelM == {(N1,N2). N1 \<in> calM & N2 \<in> calM &
23 (\<exists>g \<in> carrier(G). N1 = (N2 #> g) )}"
25 lemma (in sylow) RelM_refl: "refl calM RelM"
26 apply (auto simp add: refl_def RelM_def calM_def)
27 apply (blast intro!: coset_mult_one [symmetric])
30 lemma (in sylow) RelM_sym: "sym RelM"
31 proof (unfold sym_def RelM_def, clarify)
34 and g: "g \<in> carrier G"
35 hence "y = y #> g #> (inv g)" by (simp add: coset_mult_assoc calM_def)
36 thus "\<exists>g'\<in>carrier G. y = y #> g #> g'"
37 by (blast intro: g inv_closed)
40 lemma (in sylow) RelM_trans: "trans RelM"
41 by (auto simp add: trans_def RelM_def calM_def coset_mult_assoc)
43 lemma (in sylow) RelM_equiv: "equiv calM RelM"
44 apply (unfold equiv_def)
45 apply (blast intro: RelM_refl RelM_sym RelM_trans)
48 lemma (in sylow) M_subset_calM_prep: "M' \<in> calM // RelM ==> M' \<subseteq> calM"
49 apply (unfold RelM_def)
50 apply (blast elim!: quotientE)
53 subsection{*Main Part of the Proof*}
56 locale sylow_central = sylow +
58 assumes M_in_quot: "M \<in> calM // RelM"
59 and not_dvd_M: "~(p ^ Suc(exponent p m) dvd card(M))"
60 and M1_in_M: "M1 \<in> M"
61 defines "H == {g. g\<in>carrier G & M1 #> g = M1}"
63 lemma (in sylow_central) M_subset_calM: "M \<subseteq> calM"
64 by (rule M_in_quot [THEN M_subset_calM_prep])
66 lemma (in sylow_central) card_M1: "card(M1) = p^a"
67 apply (cut_tac M_subset_calM M1_in_M)
68 apply (simp add: calM_def, blast)
71 lemma card_nonempty: "0 < card(S) ==> S \<noteq> {}"
74 lemma (in sylow_central) exists_x_in_M1: "\<exists>x. x\<in>M1"
75 apply (subgoal_tac "0 < card M1")
76 apply (blast dest: card_nonempty)
77 apply (cut_tac prime_p [THEN prime_imp_one_less])
78 apply (simp (no_asm_simp) add: card_M1)
81 lemma (in sylow_central) M1_subset_G [simp]: "M1 \<subseteq> carrier G"
82 apply (rule subsetD [THEN PowD])
83 apply (rule_tac [2] M1_in_M)
84 apply (rule M_subset_calM [THEN subset_trans])
85 apply (auto simp add: calM_def)
88 lemma (in sylow_central) M1_inj_H: "\<exists>f \<in> H\<rightarrow>M1. inj_on f H"
90 from exists_x_in_M1 obtain m1 where m1M: "m1 \<in> M1"..
91 have m1G: "m1 \<in> carrier G" by (simp add: m1M M1_subset_G [THEN subsetD])
94 show "inj_on (\<lambda>z\<in>H. m1 \<otimes> z) H"
95 by (simp add: inj_on_def l_cancel [of m1 x y, THEN iffD1] H_def m1G)
96 show "restrict (op \<otimes> m1) H \<in> H \<rightarrow> M1"
97 proof (rule restrictI)
98 fix z assume zH: "z \<in> H"
99 show "m1 \<otimes> z \<in> M1"
102 have zG: "z \<in> carrier G" and M1zeq: "M1 #> z = M1"
103 by (auto simp add: H_def)
105 by (rule subst [OF M1zeq], simp add: m1M zG rcosI)
112 subsection{*Discharging the Assumptions of @{text sylow_central}*}
114 lemma (in sylow) EmptyNotInEquivSet: "{} \<notin> calM // RelM"
115 by (blast elim!: quotientE dest: RelM_equiv [THEN equiv_class_self])
117 lemma (in sylow) existsM1inM: "M \<in> calM // RelM ==> \<exists>M1. M1 \<in> M"
118 apply (subgoal_tac "M \<noteq> {}")
120 apply (cut_tac EmptyNotInEquivSet, blast)
123 lemma (in sylow) zero_less_o_G: "0 < order(G)"
124 apply (unfold order_def)
125 apply (blast intro: one_closed zero_less_card_empty)
128 lemma (in sylow) zero_less_m: "0 < m"
129 apply (cut_tac zero_less_o_G)
130 apply (simp add: order_G)
133 lemma (in sylow) card_calM: "card(calM) = (p^a) * m choose p^a"
134 by (simp add: calM_def n_subsets order_G [symmetric] order_def)
136 lemma (in sylow) zero_less_card_calM: "0 < card calM"
137 by (simp add: card_calM zero_less_binomial le_extend_mult zero_less_m)
139 lemma (in sylow) max_p_div_calM:
140 "~ (p ^ Suc(exponent p m) dvd card(calM))"
141 apply (subgoal_tac "exponent p m = exponent p (card calM) ")
142 apply (cut_tac zero_less_card_calM prime_p)
143 apply (force dest: power_Suc_exponent_Not_dvd)
144 apply (simp add: card_calM zero_less_m [THEN const_p_fac])
147 lemma (in sylow) finite_calM: "finite calM"
148 apply (unfold calM_def)
149 apply (rule_tac B = "Pow (carrier G) " in finite_subset)
153 lemma (in sylow) lemma_A1:
154 "\<exists>M \<in> calM // RelM. ~ (p ^ Suc(exponent p m) dvd card(M))"
155 apply (rule max_p_div_calM [THEN contrapos_np])
156 apply (simp add: finite_calM equiv_imp_dvd_card [OF _ RelM_equiv])
160 subsubsection{*Introduction and Destruct Rules for @{term H}*}
162 lemma (in sylow_central) H_I: "[|g \<in> carrier G; M1 #> g = M1|] ==> g \<in> H"
165 lemma (in sylow_central) H_into_carrier_G: "x \<in> H ==> x \<in> carrier G"
168 lemma (in sylow_central) in_H_imp_eq: "g : H ==> M1 #> g = M1"
171 lemma (in sylow_central) H_m_closed: "[| x\<in>H; y\<in>H|] ==> x \<otimes> y \<in> H"
173 apply (simp add: coset_mult_assoc [symmetric] m_closed)
176 lemma (in sylow_central) H_not_empty: "H \<noteq> {}"
177 apply (simp add: H_def)
178 apply (rule exI [of _ \<one>], simp)
181 lemma (in sylow_central) H_is_subgroup: "subgroup H G"
182 apply (rule subgroupI)
184 apply (erule H_into_carrier_G)
185 apply (rule H_not_empty)
186 apply (simp add: H_def, clarify)
187 apply (erule_tac P = "%z. ?lhs(z) = M1" in subst)
188 apply (simp add: coset_mult_assoc )
189 apply (blast intro: H_m_closed)
193 lemma (in sylow_central) rcosetGM1g_subset_G:
194 "[| g \<in> carrier G; x \<in> M1 #> g |] ==> x \<in> carrier G"
195 by (blast intro: M1_subset_G [THEN r_coset_subset_G, THEN subsetD])
197 lemma (in sylow_central) finite_M1: "finite M1"
198 by (rule finite_subset [OF M1_subset_G finite_G])
200 lemma (in sylow_central) finite_rcosetGM1g: "g\<in>carrier G ==> finite (M1 #> g)"
201 apply (rule finite_subset)
203 apply (erule rcosetGM1g_subset_G, assumption)
204 apply (rule finite_G)
207 lemma (in sylow_central) M1_cardeq_rcosetGM1g:
208 "g \<in> carrier G ==> card(M1 #> g) = card(M1)"
209 by (simp (no_asm_simp) add: M1_subset_G card_cosets_equal rcosetsI)
211 lemma (in sylow_central) M1_RelM_rcosetGM1g:
212 "g \<in> carrier G ==> (M1, M1 #> g) \<in> RelM"
213 apply (simp (no_asm) add: RelM_def calM_def card_M1 M1_subset_G)
215 apply (blast intro: rcosetGM1g_subset_G)
216 apply (simp (no_asm_simp) add: card_M1 M1_cardeq_rcosetGM1g)
217 apply (rule bexI [of _ "inv g"])
218 apply (simp_all add: coset_mult_assoc M1_subset_G)
222 subsection{*Equal Cardinalities of @{term M} and the Set of Cosets*}
224 text{*Injections between @{term M} and @{term "rcosets\<^bsub>G\<^esub> H"} show that
225 their cardinalities are equal.*}
227 lemma ElemClassEquiv:
228 "[| equiv A r; C \<in> A // r |] ==> \<forall>x \<in> C. \<forall>y \<in> C. (x,y)\<in>r"
229 by (unfold equiv_def quotient_def sym_def trans_def, blast)
231 lemma (in sylow_central) M_elem_map:
232 "M2 \<in> M ==> \<exists>g. g \<in> carrier G & M1 #> g = M2"
233 apply (cut_tac M1_in_M M_in_quot [THEN RelM_equiv [THEN ElemClassEquiv]])
234 apply (simp add: RelM_def)
235 apply (blast dest!: bspec)
238 lemmas (in sylow_central) M_elem_map_carrier =
239 M_elem_map [THEN someI_ex, THEN conjunct1]
241 lemmas (in sylow_central) M_elem_map_eq =
242 M_elem_map [THEN someI_ex, THEN conjunct2]
244 lemma (in sylow_central) M_funcset_rcosets_H:
245 "(%x:M. H #> (SOME g. g \<in> carrier G & M1 #> g = x)) \<in> M \<rightarrow> rcosets H"
246 apply (rule rcosetsI [THEN restrictI])
247 apply (rule H_is_subgroup [THEN subgroup.subset])
248 apply (erule M_elem_map_carrier)
251 lemma (in sylow_central) inj_M_GmodH: "\<exists>f \<in> M\<rightarrow>rcosets H. inj_on f M"
253 apply (rule_tac [2] M_funcset_rcosets_H)
254 apply (rule inj_onI, simp)
255 apply (rule trans [OF _ M_elem_map_eq])
256 prefer 2 apply assumption
257 apply (rule M_elem_map_eq [symmetric, THEN trans], assumption)
258 apply (rule coset_mult_inv1)
259 apply (erule_tac [2] M_elem_map_carrier)+
260 apply (rule_tac [2] M1_subset_G)
261 apply (rule coset_join1 [THEN in_H_imp_eq])
262 apply (rule_tac [3] H_is_subgroup)
263 prefer 2 apply (blast intro: m_closed M_elem_map_carrier inv_closed)
264 apply (simp add: coset_mult_inv2 H_def M_elem_map_carrier subset_def)
268 subsubsection{*The opposite injection*}
270 lemma (in sylow_central) H_elem_map:
271 "H1 \<in> rcosets H ==> \<exists>g. g \<in> carrier G & H #> g = H1"
272 by (auto simp add: RCOSETS_def)
274 lemmas (in sylow_central) H_elem_map_carrier =
275 H_elem_map [THEN someI_ex, THEN conjunct1]
277 lemmas (in sylow_central) H_elem_map_eq =
278 H_elem_map [THEN someI_ex, THEN conjunct2]
281 lemma EquivElemClass:
282 "[|equiv A r; M \<in> A//r; M1\<in>M; (M1,M2) \<in> r |] ==> M2 \<in> M"
283 by (unfold equiv_def quotient_def sym_def trans_def, blast)
286 lemma (in sylow_central) rcosets_H_funcset_M:
287 "(\<lambda>C \<in> rcosets H. M1 #> (@g. g \<in> carrier G \<and> H #> g = C)) \<in> rcosets H \<rightarrow> M"
288 apply (simp add: RCOSETS_def)
289 apply (fast intro: someI2
290 intro!: restrictI M1_in_M
291 EquivElemClass [OF RelM_equiv M_in_quot _ M1_RelM_rcosetGM1g])
294 text{*close to a duplicate of @{text inj_M_GmodH}*}
295 lemma (in sylow_central) inj_GmodH_M:
296 "\<exists>g \<in> rcosets H\<rightarrow>M. inj_on g (rcosets H)"
298 apply (rule_tac [2] rcosets_H_funcset_M)
301 apply (rule trans [OF _ H_elem_map_eq])
302 prefer 2 apply assumption
303 apply (rule H_elem_map_eq [symmetric, THEN trans], assumption)
304 apply (rule coset_mult_inv1)
305 apply (erule_tac [2] H_elem_map_carrier)+
306 apply (rule_tac [2] H_is_subgroup [THEN subgroup.subset])
307 apply (rule coset_join2)
308 apply (blast intro: m_closed inv_closed H_elem_map_carrier)
309 apply (rule H_is_subgroup)
310 apply (simp add: H_I coset_mult_inv2 M1_subset_G H_elem_map_carrier)
313 lemma (in sylow_central) calM_subset_PowG: "calM \<subseteq> Pow(carrier G)"
314 by (auto simp add: calM_def)
317 lemma (in sylow_central) finite_M: "finite M"
318 apply (rule finite_subset)
319 apply (rule M_subset_calM [THEN subset_trans])
320 apply (rule calM_subset_PowG, blast)
323 lemma (in sylow_central) cardMeqIndexH: "card(M) = card(rcosets H)"
324 apply (insert inj_M_GmodH inj_GmodH_M)
325 apply (blast intro: card_bij finite_M H_is_subgroup
326 rcosets_subset_PowG [THEN finite_subset]
327 finite_Pow_iff [THEN iffD2])
330 lemma (in sylow_central) index_lem: "card(M) * card(H) = order(G)"
331 by (simp add: cardMeqIndexH lagrange H_is_subgroup)
333 lemma (in sylow_central) lemma_leq1: "p^a \<le> card(H)"
334 apply (rule dvd_imp_le)
335 apply (rule div_combine [OF prime_p not_dvd_M])
336 prefer 2 apply (blast intro: subgroup.finite_imp_card_positive H_is_subgroup)
337 apply (simp add: index_lem order_G power_add mult_dvd_mono power_exponent_dvd
341 lemma (in sylow_central) lemma_leq2: "card(H) \<le> p^a"
342 apply (subst card_M1 [symmetric])
343 apply (cut_tac M1_inj_H)
344 apply (blast intro!: M1_subset_G intro:
345 card_inj H_into_carrier_G finite_subset [OF _ finite_G])
348 lemma (in sylow_central) card_H_eq: "card(H) = p^a"
349 by (blast intro: le_anti_sym lemma_leq1 lemma_leq2)
351 lemma (in sylow) sylow_thm: "\<exists>H. subgroup H G & card(H) = p^a"
352 apply (cut_tac lemma_A1, clarify)
353 apply (frule existsM1inM, clarify)
354 apply (subgoal_tac "sylow_central G p a m M1 M")
355 apply (blast dest: sylow_central.H_is_subgroup sylow_central.card_H_eq)
356 apply (simp add: sylow_central_def sylow_central_axioms_def prems)
359 text{*Needed because the locale's automatic definition refers to
360 @{term "semigroup G"} and @{term "group_axioms G"} rather than
361 simply to @{term "group G"}.*}
362 lemma sylow_eq: "sylow G p a m = (group G & sylow_axioms G p a m)"
363 by (simp add: sylow_def group_def)
366 "[|p \<in> prime; group(G); order(G) = (p^a) * m; finite (carrier G)|]
367 ==> \<exists>H. subgroup H G & card(H) = p^a"
368 apply (rule sylow.sylow_thm [of G p a m])
369 apply (simp add: sylow_eq sylow_axioms_def)