src/HOL/Algebra/Sylow.thy
changeset 14666 65f8680c3f16
parent 14651 02b8f3bcf7fe
child 14706 71590b7733b7
equal deleted inserted replaced
14665:d2e5df3d1201 14666:65f8680c3f16
     2     ID:         $Id$
     2     ID:         $Id$
     3     Author:     Florian Kammueller, with new proofs by L C Paulson
     3     Author:     Florian Kammueller, with new proofs by L C Paulson
     4 
     4 
     5 See Florian Kamm\"uller and L. C. Paulson,
     5 See Florian Kamm\"uller and L. C. Paulson,
     6     A Formal Proof of Sylow's theorem:
     6     A Formal Proof of Sylow's theorem:
     7 	An Experiment in Abstract Algebra with Isabelle HOL
     7         An Experiment in Abstract Algebra with Isabelle HOL
     8     J. Automated Reasoning 23 (1999), 235-264
     8     J. Automated Reasoning 23 (1999), 235-264
     9 *)
     9 *)
    10 
    10 
    11 header{*Sylow's theorem using locales*}
    11 header{*Sylow's theorem using locales*}
    12 
    12 
    13 theory Sylow = Coset:
    13 theory Sylow = Coset:
    14 
    14 
    15 subsection {*Order of a Group and Lagrange's Theorem*}
    15 subsection {*Order of a Group and Lagrange's Theorem*}
    16 
    16 
    17 constdefs
    17 constdefs
    18   order     :: "('a,'b) semigroup_scheme => nat"
    18   order :: "('a, 'b) semigroup_scheme => nat"
    19   "order S == card (carrier S)"
    19   "order S == card (carrier S)"
    20 
    20 
    21 theorem (in coset) lagrange:
    21 theorem (in coset) lagrange:
    22      "[| finite(carrier G); subgroup H G |] 
    22      "[| finite(carrier G); subgroup H G |]
    23       ==> card(rcosets G H) * card(H) = order(G)"
    23       ==> card(rcosets G H) * card(H) = order(G)"
    24 apply (simp (no_asm_simp) add: order_def setrcos_part_G [symmetric])
    24 apply (simp (no_asm_simp) add: order_def setrcos_part_G [symmetric])
    25 apply (subst mult_commute)
    25 apply (subst mult_commute)
    26 apply (rule card_partition)
    26 apply (rule card_partition)
    27    apply (simp add: setrcos_subset_PowG [THEN finite_subset])
    27    apply (simp add: setrcos_subset_PowG [THEN finite_subset])
    38   assumes prime_p:   "p \<in> prime"
    38   assumes prime_p:   "p \<in> prime"
    39       and order_G:   "order(G) = (p^a) * m"
    39       and order_G:   "order(G) = (p^a) * m"
    40       and finite_G [iff]:  "finite (carrier G)"
    40       and finite_G [iff]:  "finite (carrier G)"
    41   defines "calM == {s. s <= carrier(G) & card(s) = p^a}"
    41   defines "calM == {s. s <= carrier(G) & card(s) = p^a}"
    42       and "RelM == {(N1,N2). N1 \<in> calM & N2 \<in> calM &
    42       and "RelM == {(N1,N2). N1 \<in> calM & N2 \<in> calM &
    43 		  	     (\<exists>g \<in> carrier(G). N1 = (N2 #> g) )}"
    43                              (\<exists>g \<in> carrier(G). N1 = (N2 #> g) )}"
    44 
    44 
    45 lemma (in sylow) RelM_refl: "refl calM RelM"
    45 lemma (in sylow) RelM_refl: "refl calM RelM"
    46 apply (auto simp add: refl_def RelM_def calM_def) 
    46 apply (auto simp add: refl_def RelM_def calM_def)
    47 apply (blast intro!: coset_mult_one [symmetric]) 
    47 apply (blast intro!: coset_mult_one [symmetric])
    48 done
    48 done
    49 
    49 
    50 lemma (in sylow) RelM_sym: "sym RelM"
    50 lemma (in sylow) RelM_sym: "sym RelM"
    51 proof (unfold sym_def RelM_def, clarify)
    51 proof (unfold sym_def RelM_def, clarify)
    52   fix y g
    52   fix y g
    56   thus "\<exists>g'\<in>carrier G. y = y #> g #> g'"
    56   thus "\<exists>g'\<in>carrier G. y = y #> g #> g'"
    57    by (blast intro: g inv_closed)
    57    by (blast intro: g inv_closed)
    58 qed
    58 qed
    59 
    59 
    60 lemma (in sylow) RelM_trans: "trans RelM"
    60 lemma (in sylow) RelM_trans: "trans RelM"
    61 by (auto simp add: trans_def RelM_def calM_def coset_mult_assoc) 
    61 by (auto simp add: trans_def RelM_def calM_def coset_mult_assoc)
    62 
    62 
    63 lemma (in sylow) RelM_equiv: "equiv calM RelM"
    63 lemma (in sylow) RelM_equiv: "equiv calM RelM"
    64 apply (unfold equiv_def)
    64 apply (unfold equiv_def)
    65 apply (blast intro: RelM_refl RelM_sym RelM_trans)
    65 apply (blast intro: RelM_refl RelM_sym RelM_trans)
    66 done
    66 done
    89 done
    89 done
    90 
    90 
    91 lemma card_nonempty: "0 < card(S) ==> S \<noteq> {}"
    91 lemma card_nonempty: "0 < card(S) ==> S \<noteq> {}"
    92 by force
    92 by force
    93 
    93 
    94 lemma (in sylow_central) exists_x_in_M1: "\<exists>x. x\<in>M1" 
    94 lemma (in sylow_central) exists_x_in_M1: "\<exists>x. x\<in>M1"
    95 apply (subgoal_tac "0 < card M1") 
    95 apply (subgoal_tac "0 < card M1")
    96  apply (blast dest: card_nonempty) 
    96  apply (blast dest: card_nonempty)
    97 apply (cut_tac prime_p [THEN prime_imp_one_less])
    97 apply (cut_tac prime_p [THEN prime_imp_one_less])
    98 apply (simp (no_asm_simp) add: card_M1)
    98 apply (simp (no_asm_simp) add: card_M1)
    99 done
    99 done
   100 
   100 
   101 lemma (in sylow_central) M1_subset_G [simp]: "M1 <= carrier G"
   101 lemma (in sylow_central) M1_subset_G [simp]: "M1 <= carrier G"
   110     from exists_x_in_M1 obtain m1 where m1M: "m1 \<in> M1"..
   110     from exists_x_in_M1 obtain m1 where m1M: "m1 \<in> M1"..
   111     have m1G: "m1 \<in> carrier G" by (simp add: m1M M1_subset_G [THEN subsetD])
   111     have m1G: "m1 \<in> carrier G" by (simp add: m1M M1_subset_G [THEN subsetD])
   112     show ?thesis
   112     show ?thesis
   113     proof
   113     proof
   114       show "inj_on (\<lambda>z\<in>H. m1 \<otimes> z) H"
   114       show "inj_on (\<lambda>z\<in>H. m1 \<otimes> z) H"
   115 	by (simp add: inj_on_def l_cancel [of m1 x y, THEN iffD1] H_def m1G)
   115         by (simp add: inj_on_def l_cancel [of m1 x y, THEN iffD1] H_def m1G)
   116       show "restrict (op \<otimes> m1) H \<in> H \<rightarrow> M1"
   116       show "restrict (op \<otimes> m1) H \<in> H \<rightarrow> M1"
   117       proof (rule restrictI)
   117       proof (rule restrictI)
   118 	fix z assume zH: "z \<in> H"
   118         fix z assume zH: "z \<in> H"
   119 	show "m1 \<otimes> z \<in> M1"
   119         show "m1 \<otimes> z \<in> M1"
   120 	proof -
   120         proof -
   121 	  from zH
   121           from zH
   122 	  have zG: "z \<in> carrier G" and M1zeq: "M1 #> z = M1" 
   122           have zG: "z \<in> carrier G" and M1zeq: "M1 #> z = M1"
   123 	    by (auto simp add: H_def)
   123             by (auto simp add: H_def)
   124 	  show ?thesis
   124           show ?thesis
   125 	    by (rule subst [OF M1zeq], simp add: m1M zG rcosI)
   125             by (rule subst [OF M1zeq], simp add: m1M zG rcosI)
   126 	qed
   126         qed
   127       qed
   127       qed
   128     qed
   128     qed
   129   qed
   129   qed
   130 
   130 
   131 
   131 
   133 
   133 
   134 lemma (in sylow) EmptyNotInEquivSet: "{} \<notin> calM // RelM"
   134 lemma (in sylow) EmptyNotInEquivSet: "{} \<notin> calM // RelM"
   135 by (blast elim!: quotientE dest: RelM_equiv [THEN equiv_class_self])
   135 by (blast elim!: quotientE dest: RelM_equiv [THEN equiv_class_self])
   136 
   136 
   137 lemma (in sylow) existsM1inM: "M \<in> calM // RelM ==> \<exists>M1. M1 \<in> M"
   137 lemma (in sylow) existsM1inM: "M \<in> calM // RelM ==> \<exists>M1. M1 \<in> M"
   138 apply (subgoal_tac "M \<noteq> {}") 
   138 apply (subgoal_tac "M \<noteq> {}")
   139  apply blast 
   139  apply blast
   140 apply (cut_tac EmptyNotInEquivSet, blast)
   140 apply (cut_tac EmptyNotInEquivSet, blast)
   141 done
   141 done
   142 
   142 
   143 lemma (in sylow) zero_less_o_G: "0 < order(G)"
   143 lemma (in sylow) zero_less_o_G: "0 < order(G)"
   144 apply (unfold order_def)
   144 apply (unfold order_def)
   243 subsection{*Equal Cardinalities of @{term M} and @{term "rcosets G H"}*}
   243 subsection{*Equal Cardinalities of @{term M} and @{term "rcosets G H"}*}
   244 
   244 
   245 text{*Injections between @{term M} and @{term "rcosets G H"} show that
   245 text{*Injections between @{term M} and @{term "rcosets G H"} show that
   246  their cardinalities are equal.*}
   246  their cardinalities are equal.*}
   247 
   247 
   248 lemma ElemClassEquiv: 
   248 lemma ElemClassEquiv:
   249      "[| equiv A r; C\<in>A // r |] ==> \<forall>x \<in> C. \<forall>y \<in> C. (x,y)\<in>r"
   249      "[| equiv A r; C\<in>A // r |] ==> \<forall>x \<in> C. \<forall>y \<in> C. (x,y)\<in>r"
   250 apply (unfold equiv_def quotient_def sym_def trans_def, blast)
   250 apply (unfold equiv_def quotient_def sym_def trans_def, blast)
   251 done
   251 done
   252 
   252 
   253 lemma (in sylow_central) M_elem_map:
   253 lemma (in sylow_central) M_elem_map:
   255 apply (cut_tac M1_in_M M_in_quot [THEN RelM_equiv [THEN ElemClassEquiv]])
   255 apply (cut_tac M1_in_M M_in_quot [THEN RelM_equiv [THEN ElemClassEquiv]])
   256 apply (simp add: RelM_def)
   256 apply (simp add: RelM_def)
   257 apply (blast dest!: bspec)
   257 apply (blast dest!: bspec)
   258 done
   258 done
   259 
   259 
   260 lemmas (in sylow_central) M_elem_map_carrier = 
   260 lemmas (in sylow_central) M_elem_map_carrier =
   261 	M_elem_map [THEN someI_ex, THEN conjunct1]
   261         M_elem_map [THEN someI_ex, THEN conjunct1]
   262 
   262 
   263 lemmas (in sylow_central) M_elem_map_eq =
   263 lemmas (in sylow_central) M_elem_map_eq =
   264 	M_elem_map [THEN someI_ex, THEN conjunct2]
   264         M_elem_map [THEN someI_ex, THEN conjunct2]
   265 
   265 
   266 lemma (in sylow_central) M_funcset_setrcos_H:
   266 lemma (in sylow_central) M_funcset_setrcos_H:
   267      "(%x:M. H #> (SOME g. g \<in> carrier G & M1 #> g = x)) \<in> M \<rightarrow> rcosets G H"
   267      "(%x:M. H #> (SOME g. g \<in> carrier G & M1 #> g = x)) \<in> M \<rightarrow> rcosets G H"
   268 apply (rule setrcosI [THEN restrictI])
   268 apply (rule setrcosI [THEN restrictI])
   269 apply (rule H_is_subgroup [THEN subgroup.subset])
   269 apply (rule H_is_subgroup [THEN subgroup.subset])
   291 
   291 
   292 lemma (in sylow_central) H_elem_map:
   292 lemma (in sylow_central) H_elem_map:
   293      "H1\<in>rcosets G H ==> \<exists>g. g \<in> carrier G & H #> g = H1"
   293      "H1\<in>rcosets G H ==> \<exists>g. g \<in> carrier G & H #> g = H1"
   294 by (auto simp add: setrcos_eq)
   294 by (auto simp add: setrcos_eq)
   295 
   295 
   296 lemmas (in sylow_central) H_elem_map_carrier = 
   296 lemmas (in sylow_central) H_elem_map_carrier =
   297 	H_elem_map [THEN someI_ex, THEN conjunct1]
   297         H_elem_map [THEN someI_ex, THEN conjunct1]
   298 
   298 
   299 lemmas (in sylow_central) H_elem_map_eq =
   299 lemmas (in sylow_central) H_elem_map_eq =
   300 	H_elem_map [THEN someI_ex, THEN conjunct2]
   300         H_elem_map [THEN someI_ex, THEN conjunct2]
   301 
   301 
   302 
   302 
   303 lemma EquivElemClass: 
   303 lemma EquivElemClass:
   304      "[|equiv A r; M\<in>A // r; M1\<in>M; (M1, M2)\<in>r |] ==> M2\<in>M"
   304      "[|equiv A r; M\<in>A // r; M1\<in>M; (M1, M2)\<in>r |] ==> M2\<in>M"
   305 apply (unfold equiv_def quotient_def sym_def trans_def, blast)
   305 apply (unfold equiv_def quotient_def sym_def trans_def, blast)
   306 done
   306 done
   307 
   307 
   308 lemma (in sylow_central) setrcos_H_funcset_M:
   308 lemma (in sylow_central) setrcos_H_funcset_M:
   327 apply (rule coset_mult_inv1)
   327 apply (rule coset_mult_inv1)
   328 apply (erule_tac [2] H_elem_map_carrier)+
   328 apply (erule_tac [2] H_elem_map_carrier)+
   329 apply (rule_tac [2] H_is_subgroup [THEN subgroup.subset])
   329 apply (rule_tac [2] H_is_subgroup [THEN subgroup.subset])
   330 apply (rule coset_join2)
   330 apply (rule coset_join2)
   331 apply (blast intro: m_closed inv_closed H_elem_map_carrier)
   331 apply (blast intro: m_closed inv_closed H_elem_map_carrier)
   332 apply (rule H_is_subgroup) 
   332 apply (rule H_is_subgroup)
   333 apply (simp add: H_I coset_mult_inv2 M1_subset_G H_elem_map_carrier)
   333 apply (simp add: H_I coset_mult_inv2 M1_subset_G H_elem_map_carrier)
   334 done
   334 done
   335 
   335 
   336 lemma (in sylow_central) calM_subset_PowG: "calM <= Pow(carrier G)"
   336 lemma (in sylow_central) calM_subset_PowG: "calM <= Pow(carrier G)"
   337 by (auto simp add: calM_def)
   337 by (auto simp add: calM_def)
   342 apply (rule M_subset_calM [THEN subset_trans])
   342 apply (rule M_subset_calM [THEN subset_trans])
   343 apply (rule calM_subset_PowG, blast)
   343 apply (rule calM_subset_PowG, blast)
   344 done
   344 done
   345 
   345 
   346 lemma (in sylow_central) cardMeqIndexH: "card(M) = card(rcosets G H)"
   346 lemma (in sylow_central) cardMeqIndexH: "card(M) = card(rcosets G H)"
   347 apply (insert inj_M_GmodH inj_GmodH_M) 
   347 apply (insert inj_M_GmodH inj_GmodH_M)
   348 apply (blast intro: card_bij finite_M H_is_subgroup 
   348 apply (blast intro: card_bij finite_M H_is_subgroup
   349              setrcos_subset_PowG [THEN finite_subset] 
   349              setrcos_subset_PowG [THEN finite_subset]
   350              finite_Pow_iff [THEN iffD2])
   350              finite_Pow_iff [THEN iffD2])
   351 done
   351 done
   352 
   352 
   353 lemma (in sylow_central) index_lem: "card(M) * card(H) = order(G)"
   353 lemma (in sylow_central) index_lem: "card(M) * card(H) = order(G)"
   354 by (simp add: cardMeqIndexH lagrange H_is_subgroup)
   354 by (simp add: cardMeqIndexH lagrange H_is_subgroup)
   362 done
   362 done
   363 
   363 
   364 lemma (in sylow_central) lemma_leq2: "card(H) <= p^a"
   364 lemma (in sylow_central) lemma_leq2: "card(H) <= p^a"
   365 apply (subst card_M1 [symmetric])
   365 apply (subst card_M1 [symmetric])
   366 apply (cut_tac M1_inj_H)
   366 apply (cut_tac M1_inj_H)
   367 apply (blast intro!: M1_subset_G intro: 
   367 apply (blast intro!: M1_subset_G intro:
   368              card_inj H_into_carrier_G finite_subset [OF _ finite_G])
   368              card_inj H_into_carrier_G finite_subset [OF _ finite_G])
   369 done
   369 done
   370 
   370 
   371 lemma (in sylow_central) card_H_eq: "card(H) = p^a"
   371 lemma (in sylow_central) card_H_eq: "card(H) = p^a"
   372 by (blast intro: le_anti_sym lemma_leq1 lemma_leq2)
   372 by (blast intro: le_anti_sym lemma_leq1 lemma_leq2)
   373 
   373 
   374 lemma (in sylow) sylow_thm: "\<exists>H. subgroup H G & card(H) = p^a"
   374 lemma (in sylow) sylow_thm: "\<exists>H. subgroup H G & card(H) = p^a"
   375 apply (cut_tac lemma_A1, clarify) 
   375 apply (cut_tac lemma_A1, clarify)
   376 apply (frule existsM1inM, clarify) 
   376 apply (frule existsM1inM, clarify)
   377 apply (subgoal_tac "sylow_central G p a m M1 M")
   377 apply (subgoal_tac "sylow_central G p a m M1 M")
   378  apply (blast dest:  sylow_central.H_is_subgroup sylow_central.card_H_eq)
   378  apply (blast dest:  sylow_central.H_is_subgroup sylow_central.card_H_eq)
   379 apply (simp add: sylow_central_def sylow_central_axioms_def prems) 
   379 apply (simp add: sylow_central_def sylow_central_axioms_def prems)
   380 done
   380 done
   381 
   381 
   382 text{*Needed because the locale's automatic definition refers to
   382 text{*Needed because the locale's automatic definition refers to
   383    @{term "semigroup G"} and @{term "group_axioms G"} rather than 
   383    @{term "semigroup G"} and @{term "group_axioms G"} rather than
   384   simply to @{term "group G"}.*}
   384   simply to @{term "group G"}.*}
   385 lemma sylow_eq: "sylow G p a m = (group G & sylow_axioms G p a m)"
   385 lemma sylow_eq: "sylow G p a m = (group G & sylow_axioms G p a m)"
   386 by (simp add: sylow_def group_def)
   386 by (simp add: sylow_def group_def)
   387 
   387 
   388 theorem sylow_thm:
   388 theorem sylow_thm:
   389      "[|p \<in> prime;  group(G);  order(G) = (p^a) * m; finite (carrier G)|]
   389      "[|p \<in> prime;  group(G);  order(G) = (p^a) * m; finite (carrier G)|]
   390       ==> \<exists>H. subgroup H G & card(H) = p^a"
   390       ==> \<exists>H. subgroup H G & card(H) = p^a"
   391 apply (rule sylow.sylow_thm [of G p a m])
   391 apply (rule sylow.sylow_thm [of G p a m])
   392 apply (simp add: sylow_eq sylow_axioms_def) 
   392 apply (simp add: sylow_eq sylow_axioms_def)
   393 done
   393 done
   394 
   394 
   395 end
   395 end