src/HOL/GroupTheory/Sylow.thy
changeset 13870 cf947d1ec5ff
parent 13869 18112403c809
child 13871 26e5f5e624f6
equal deleted inserted replaced
13869:18112403c809 13870:cf947d1ec5ff
     1 (*  Title:      HOL/GroupTheory/Sylow
       
     2     ID:         $Id$
       
     3     Author:     Florian Kammueller, with new proofs by L C Paulson
       
     4 
       
     5 See Florian Kamm\"uller and L. C. Paulson,
       
     6     A Formal Proof of Sylow's theorem:
       
     7 	An Experiment in Abstract Algebra with Isabelle HOL
       
     8     J. Automated Reasoning 23 (1999), 235-264
       
     9 *)
       
    10 
       
    11 header{*Sylow's theorem using locales*}
       
    12 
       
    13 theory Sylow = Coset:
       
    14 
       
    15 text{*The combinatorial argument is in theory Exponent*}
       
    16 
       
    17 locale sylow = coset +
       
    18   fixes p and a and m and calM and RelM
       
    19   assumes prime_p:   "p \<in> prime"
       
    20       and order_G:   "order(G) = (p^a) * m"
       
    21       and finite_G [iff]:  "finite (carrier G)"
       
    22   defines "calM == {s. s <= carrier(G) & card(s) = p^a}"
       
    23       and "RelM == {(N1,N2). N1 \<in> calM & N2 \<in> calM &
       
    24 		  	     (\<exists>g \<in> carrier(G). N1 = (N2 #> g) )}"
       
    25 
       
    26 lemma (in sylow) RelM_refl: "refl calM RelM"
       
    27 apply (auto simp add: refl_def RelM_def calM_def) 
       
    28 apply (blast intro!: coset_sum_zero [symmetric]) 
       
    29 done
       
    30 
       
    31 lemma (in sylow) RelM_sym: "sym RelM"
       
    32 proof (unfold sym_def RelM_def, clarify)
       
    33   fix y g
       
    34   assume   "y \<in> calM"
       
    35     and g: "g \<in> carrier G"
       
    36   hence "y = y #> g #> (\<ominus>g)" by (simp add: coset_sum_assoc calM_def)
       
    37   thus "\<exists>g'\<in>carrier G. y = y #> g #> g'"
       
    38    by (blast intro: g minus_closed)
       
    39 qed
       
    40 
       
    41 lemma (in sylow) RelM_trans: "trans RelM"
       
    42 by (auto simp add: trans_def RelM_def calM_def coset_sum_assoc) 
       
    43 
       
    44 lemma (in sylow) RelM_equiv: "equiv calM RelM"
       
    45 apply (unfold equiv_def)
       
    46 apply (blast intro: RelM_refl RelM_sym RelM_trans)
       
    47 done
       
    48 
       
    49 lemma (in sylow) M_subset_calM_prep: "M' \<in> calM // RelM  ==> M' <= calM"
       
    50 apply (unfold RelM_def)
       
    51 apply (blast elim!: quotientE)
       
    52 done
       
    53 
       
    54 subsection{*Main Part of the Proof*}
       
    55 
       
    56 
       
    57 locale sylow_central = sylow +
       
    58   fixes H and M1 and M
       
    59   assumes M_in_quot:  "M \<in> calM // RelM"
       
    60       and not_dvd_M:  "~(p ^ Suc(exponent p m) dvd card(M))"
       
    61       and M1_in_M:    "M1 \<in> M"
       
    62   defines "H == {g. g\<in>carrier G & M1 #> g = M1}"
       
    63 
       
    64 lemma (in sylow_central) M_subset_calM: "M <= calM"
       
    65 by (rule M_in_quot [THEN M_subset_calM_prep])
       
    66 
       
    67 lemma (in sylow_central) card_M1: "card(M1) = p^a"
       
    68 apply (cut_tac M_subset_calM M1_in_M)
       
    69 apply (simp add: calM_def, blast)
       
    70 done
       
    71 
       
    72 lemma card_nonempty: "0 < card(S) ==> S \<noteq> {}"
       
    73 by force
       
    74 
       
    75 lemma (in sylow_central) exists_x_in_M1: "\<exists>x. x\<in>M1" 
       
    76 apply (subgoal_tac "0 < card M1") 
       
    77  apply (blast dest: card_nonempty) 
       
    78 apply (cut_tac prime_p [THEN prime_imp_one_less])
       
    79 apply (simp (no_asm_simp) add: card_M1)
       
    80 done
       
    81 
       
    82 lemma (in sylow_central) M1_subset_G [simp]: "M1 <= carrier G"
       
    83 apply (rule subsetD [THEN PowD])
       
    84 apply (rule_tac [2] M1_in_M)
       
    85 apply (rule M_subset_calM [THEN subset_trans])
       
    86 apply (auto simp add: calM_def)
       
    87 done
       
    88 
       
    89 lemma (in sylow_central) M1_inj_H: "\<exists>f \<in> H\<rightarrow>M1. inj_on f H"
       
    90 apply (rule exists_x_in_M1 [THEN exE])
       
    91 apply (rule_tac x = "%z: H. sum G x z" in bexI)
       
    92  apply (rule inj_onI)
       
    93  apply (rule left_cancellation)
       
    94     apply (auto simp add: H_def M1_subset_G [THEN subsetD])
       
    95 apply (rule restrictI)
       
    96 apply (simp add: H_def, clarify) 
       
    97 apply (erule subst)
       
    98 apply (simp add: rcosI)
       
    99 done
       
   100 
       
   101 subsection{*Discharging the Assumptions of @{text sylow_central}*}
       
   102 
       
   103 lemma (in sylow) EmptyNotInEquivSet: "{} \<notin> calM // RelM"
       
   104 by (blast elim!: quotientE dest: RelM_equiv [THEN equiv_class_self])
       
   105 
       
   106 lemma (in sylow) existsM1inM: "M \<in> calM // RelM ==> \<exists>M1. M1 \<in> M"
       
   107 apply (subgoal_tac "M \<noteq> {}") 
       
   108  apply blast 
       
   109 apply (cut_tac EmptyNotInEquivSet, blast)
       
   110 done
       
   111 
       
   112 lemma (in sylow) zero_less_o_G: "0 < order(G)"
       
   113 apply (unfold order_def)
       
   114 apply (blast intro: zero_closed zero_less_card_empty)
       
   115 done
       
   116 
       
   117 lemma (in sylow) zero_less_m: "0 < m"
       
   118 apply (cut_tac zero_less_o_G)
       
   119 apply (simp add: order_G)
       
   120 done
       
   121 
       
   122 lemma (in sylow) card_calM: "card(calM) = (p^a) * m choose p^a"
       
   123 by (simp add: calM_def n_subsets order_G [symmetric] order_def)
       
   124 
       
   125 lemma (in sylow) zero_less_card_calM: "0 < card calM"
       
   126 by (simp add: card_calM zero_less_binomial le_extend_mult zero_less_m)
       
   127 
       
   128 lemma (in sylow) max_p_div_calM:
       
   129      "~ (p ^ Suc(exponent p m) dvd card(calM))"
       
   130 apply (subgoal_tac "exponent p m = exponent p (card calM) ")
       
   131  apply (cut_tac zero_less_card_calM prime_p)
       
   132  apply (force dest: power_Suc_exponent_Not_dvd)
       
   133 apply (simp add: card_calM zero_less_m [THEN const_p_fac])
       
   134 done
       
   135 
       
   136 lemma (in sylow) finite_calM: "finite calM"
       
   137 apply (unfold calM_def)
       
   138 apply (rule_tac B = "Pow (carrier G) " in finite_subset)
       
   139 apply auto
       
   140 done
       
   141 
       
   142 lemma (in sylow) lemma_A1:
       
   143      "\<exists>M \<in> calM // RelM. ~ (p ^ Suc(exponent p m) dvd card(M))"
       
   144 apply (rule max_p_div_calM [THEN contrapos_np])
       
   145 apply (simp add: finite_calM equiv_imp_dvd_card [OF _ RelM_equiv])
       
   146 done
       
   147 
       
   148 
       
   149 subsubsection{*Introduction and Destruct Rules for @{term H}*}
       
   150 
       
   151 lemma (in sylow_central) H_I: "[|g \<in> carrier G; M1 #> g = M1|] ==> g \<in> H"
       
   152 by (simp add: H_def)
       
   153 
       
   154 lemma (in sylow_central) H_into_carrier_G: "x \<in> H ==> x \<in> carrier G"
       
   155 by (simp add: H_def)
       
   156 
       
   157 lemma (in sylow_central) in_H_imp_eq: "g : H ==> M1 #> g = M1"
       
   158 by (simp add: H_def)
       
   159 
       
   160 lemma (in sylow_central) H_sum_closed: "[| x\<in>H; y\<in>H|] ==> x \<oplus> y \<in> H"
       
   161 apply (unfold H_def)
       
   162 apply (simp add: coset_sum_assoc [symmetric] sum_closed)
       
   163 done
       
   164 
       
   165 lemma (in sylow_central) H_not_empty: "H \<noteq> {}"
       
   166 apply (simp add: H_def)
       
   167 apply (rule exI [of _ \<zero>], simp)
       
   168 done
       
   169 
       
   170 lemma (in sylow_central) H_is_subgroup: "subgroup H G"
       
   171 apply (rule subgroupI)
       
   172 apply (rule subsetI)
       
   173 apply (erule H_into_carrier_G)
       
   174 apply (rule H_not_empty)
       
   175 apply (simp add: H_def, clarify)
       
   176 apply (erule_tac P = "%z. ?lhs(z) = M1" in subst)
       
   177 apply (simp add: coset_sum_assoc )
       
   178 apply (blast intro: H_sum_closed)
       
   179 done
       
   180 
       
   181 
       
   182 lemma (in sylow_central) rcosetGM1g_subset_G:
       
   183      "[| g \<in> carrier G; x \<in> M1 #>  g |] ==> x \<in> carrier G"
       
   184 by (blast intro: M1_subset_G [THEN r_coset_subset_G, THEN subsetD])
       
   185 
       
   186 lemma (in sylow_central) finite_M1: "finite M1"
       
   187 by (rule finite_subset [OF M1_subset_G finite_G])
       
   188 
       
   189 lemma (in sylow_central) finite_rcosetGM1g: "g\<in>carrier G ==> finite (M1 #> g)"
       
   190 apply (rule finite_subset)
       
   191 apply (rule subsetI)
       
   192 apply (erule rcosetGM1g_subset_G, assumption)
       
   193 apply (rule finite_G)
       
   194 done
       
   195 
       
   196 lemma (in sylow_central) M1_cardeq_rcosetGM1g:
       
   197      "g \<in> carrier G ==> card(M1 #> g) = card(M1)"
       
   198 by (simp (no_asm_simp) add: M1_subset_G card_cosets_equal setrcosI)
       
   199 
       
   200 lemma (in sylow_central) M1_RelM_rcosetGM1g:
       
   201      "g \<in> carrier G ==> (M1, M1 #> g) \<in> RelM"
       
   202 apply (simp (no_asm) add: RelM_def calM_def card_M1 M1_subset_G)
       
   203 apply (rule conjI)
       
   204  apply (blast intro: rcosetGM1g_subset_G)
       
   205 apply (simp (no_asm_simp) add: card_M1 M1_cardeq_rcosetGM1g)
       
   206 apply (rule bexI [of _ "\<ominus>g"])
       
   207 apply (simp_all add: coset_sum_assoc M1_subset_G)
       
   208 done
       
   209 
       
   210 
       
   211 
       
   212 subsection{*Equal Cardinalities of @{term M} and @{term "rcosets G H"}*}
       
   213 
       
   214 text{*Injections between @{term M} and @{term "rcosets G H"} show that
       
   215  their cardinalities are equal.*}
       
   216 
       
   217 lemma ElemClassEquiv: 
       
   218      "[| equiv A r; C\<in>A // r |] ==> \<forall>x \<in> C. \<forall>y \<in> C. (x,y)\<in>r"
       
   219 apply (unfold equiv_def quotient_def sym_def trans_def, blast)
       
   220 done
       
   221 
       
   222 lemma (in sylow_central) M_elem_map:
       
   223      "M2 \<in> M ==> \<exists>g. g \<in> carrier G & M1 #> g = M2"
       
   224 apply (cut_tac M1_in_M M_in_quot [THEN RelM_equiv [THEN ElemClassEquiv]])
       
   225 apply (simp add: RelM_def)
       
   226 apply (blast dest!: bspec)
       
   227 done
       
   228 
       
   229 lemmas (in sylow_central) M_elem_map_carrier = 
       
   230 	M_elem_map [THEN someI_ex, THEN conjunct1]
       
   231 
       
   232 lemmas (in sylow_central) M_elem_map_eq =
       
   233 	M_elem_map [THEN someI_ex, THEN conjunct2]
       
   234 
       
   235 lemma (in sylow_central) M_funcset_setrcos_H:
       
   236      "(%x:M. H #> (SOME g. g \<in> carrier G & M1 #> g = x)) \<in> M \<rightarrow> rcosets G H"
       
   237 apply (rule setrcosI [THEN restrictI])
       
   238 apply (rule H_is_subgroup [THEN subgroup_imp_subset])
       
   239 apply (erule M_elem_map_carrier)
       
   240 done
       
   241 
       
   242 lemma (in sylow_central) inj_M_GmodH: "\<exists>f \<in> M\<rightarrow>rcosets G H. inj_on f M"
       
   243 apply (rule bexI)
       
   244 apply (rule_tac [2] M_funcset_setrcos_H)
       
   245 apply (rule inj_onI, simp)
       
   246 apply (rule trans [OF _ M_elem_map_eq])
       
   247 prefer 2 apply assumption
       
   248 apply (rule M_elem_map_eq [symmetric, THEN trans], assumption)
       
   249 apply (rule coset_sum_minus1)
       
   250 apply (erule_tac [2] M_elem_map_carrier)+
       
   251 apply (rule_tac [2] M1_subset_G)
       
   252 apply (rule coset_join1 [THEN in_H_imp_eq])
       
   253 apply (rule_tac [3] H_is_subgroup)
       
   254 prefer 2 apply (blast intro: sum_closed M_elem_map_carrier minus_closed)
       
   255 apply (simp add: coset_sum_minus2 H_def M_elem_map_carrier subset_def)
       
   256 done
       
   257 
       
   258 
       
   259 (** the opposite injection **)
       
   260 
       
   261 lemma (in sylow_central) H_elem_map:
       
   262      "H1\<in>rcosets G H ==> \<exists>g. g \<in> carrier G & H #> g = H1"
       
   263 by (auto simp add: setrcos_eq)
       
   264 
       
   265 lemmas (in sylow_central) H_elem_map_carrier = 
       
   266 	H_elem_map [THEN someI_ex, THEN conjunct1]
       
   267 
       
   268 lemmas (in sylow_central) H_elem_map_eq =
       
   269 	H_elem_map [THEN someI_ex, THEN conjunct2]
       
   270 
       
   271 
       
   272 lemma EquivElemClass: 
       
   273      "[|equiv A r; M\<in>A // r; M1\<in>M; (M1, M2)\<in>r |] ==> M2\<in>M"
       
   274 apply (unfold equiv_def quotient_def sym_def trans_def, blast)
       
   275 done
       
   276 
       
   277 lemma (in sylow_central) setrcos_H_funcset_M:
       
   278      "(\<lambda>C \<in> rcosets G H. M1 #> (@g. g \<in> carrier G \<and> H #> g = C))
       
   279       \<in> rcosets G H \<rightarrow> M"
       
   280 apply (simp add: setrcos_eq)
       
   281 apply (fast intro: someI2
       
   282             intro!: restrictI M1_in_M
       
   283               EquivElemClass [OF RelM_equiv M_in_quot _  M1_RelM_rcosetGM1g])
       
   284 done
       
   285 
       
   286 text{*close to a duplicate of @{text inj_M_GmodH}*}
       
   287 lemma (in sylow_central) inj_GmodH_M:
       
   288      "\<exists>g \<in> rcosets G H\<rightarrow>M. inj_on g (rcosets G H)"
       
   289 apply (rule bexI)
       
   290 apply (rule_tac [2] setrcos_H_funcset_M)
       
   291 apply (rule inj_onI)
       
   292 apply (simp)
       
   293 apply (rule trans [OF _ H_elem_map_eq])
       
   294 prefer 2 apply assumption
       
   295 apply (rule H_elem_map_eq [symmetric, THEN trans], assumption)
       
   296 apply (rule coset_sum_minus1)
       
   297 apply (erule_tac [2] H_elem_map_carrier)+
       
   298 apply (rule_tac [2] H_is_subgroup [THEN subgroup_imp_subset])
       
   299 apply (rule coset_join2)
       
   300 apply (blast intro: sum_closed minus_closed H_elem_map_carrier)
       
   301 apply (rule H_is_subgroup) 
       
   302 apply (simp add: H_I coset_sum_minus2 M1_subset_G H_elem_map_carrier)
       
   303 done
       
   304 
       
   305 lemma (in sylow_central) calM_subset_PowG: "calM <= Pow(carrier G)"
       
   306 by (auto simp add: calM_def)
       
   307 
       
   308 
       
   309 lemma (in sylow_central) finite_M: "finite M"
       
   310 apply (rule finite_subset)
       
   311 apply (rule M_subset_calM [THEN subset_trans])
       
   312 apply (rule calM_subset_PowG, blast)
       
   313 done
       
   314 
       
   315 lemma (in sylow_central) cardMeqIndexH: "card(M) = card(rcosets G H)"
       
   316 apply (insert inj_M_GmodH inj_GmodH_M) 
       
   317 apply (blast intro: card_bij finite_M H_is_subgroup 
       
   318              setrcos_subset_PowG [THEN finite_subset] 
       
   319              finite_Pow_iff [THEN iffD2])
       
   320 done
       
   321 
       
   322 lemma (in sylow_central) index_lem: "card(M) * card(H) = order(G)"
       
   323 by (simp add: cardMeqIndexH lagrange H_is_subgroup)
       
   324 
       
   325 lemma (in sylow_central) lemma_leq1: "p^a <= card(H)"
       
   326 apply (rule dvd_imp_le)
       
   327  apply (rule div_combine [OF prime_p not_dvd_M])
       
   328  prefer 2 apply (blast intro: subgroup_card_positive H_is_subgroup)
       
   329 apply (simp add: index_lem order_G power_add mult_dvd_mono power_exponent_dvd
       
   330                  zero_less_m)
       
   331 done
       
   332 
       
   333 lemma (in sylow_central) lemma_leq2: "card(H) <= p^a"
       
   334 apply (subst card_M1 [symmetric])
       
   335 apply (cut_tac M1_inj_H)
       
   336 apply (blast intro!: M1_subset_G intro: 
       
   337              card_inj H_into_carrier_G finite_subset [OF _ finite_G])
       
   338 done
       
   339 
       
   340 lemma (in sylow_central) card_H_eq: "card(H) = p^a"
       
   341 by (blast intro: le_anti_sym lemma_leq1 lemma_leq2)
       
   342 
       
   343 lemma (in sylow) sylow_thm: "\<exists>H. subgroup H G & card(H) = p^a"
       
   344 apply (cut_tac lemma_A1, clarify) 
       
   345 apply (frule existsM1inM, clarify) 
       
   346 apply (subgoal_tac "sylow_central G p a m M1 M")
       
   347  apply (blast dest:  sylow_central.H_is_subgroup sylow_central.card_H_eq)
       
   348 apply (simp add: sylow_central_def sylow_central_axioms_def prems) 
       
   349 done
       
   350 
       
   351 text{*Needed because the locale's automatic definition refers to
       
   352    @{term "semigroup G"} and @{term "group_axioms G"} rather than 
       
   353   simply to @{term "group G"}.*}
       
   354 lemma sylow_eq: "sylow G p a m = (group G & sylow_axioms G p a m)"
       
   355 by (simp add: sylow_def group_def)
       
   356 
       
   357 theorem sylow_thm:
       
   358      "[|p \<in> prime;  group(G);  order(G) = (p^a) * m; finite (carrier G)|]
       
   359       ==> \<exists>H. subgroup H G & card(H) = p^a"
       
   360 apply (rule sylow.sylow_thm [of G p a m])
       
   361 apply (simp add: sylow_eq sylow_axioms_def) 
       
   362 done
       
   363 
       
   364 end