src/HOL/Algebra/Sylow.thy
 author blanchet Tue Nov 07 15:16:42 2017 +0100 (21 months ago) changeset 67022 49309fe530fd parent 64914 51f015bd4565 child 67399 eab6ce8368fa permissions -rw-r--r--
more robust parsing for THF proofs (esp. polymorphic Leo-III proofs)
```     1 (*  Title:      HOL/Algebra/Sylow.thy
```
```     2     Author:     Florian Kammueller, with new proofs by L C Paulson
```
```     3 *)
```
```     4
```
```     5 theory Sylow
```
```     6   imports Coset Exponent
```
```     7 begin
```
```     8
```
```     9 text \<open>See also @{cite "Kammueller-Paulson:1999"}.\<close>
```
```    10
```
```    11 text \<open>The combinatorial argument is in theory @{theory Exponent}.\<close>
```
```    12
```
```    13 lemma le_extend_mult: "\<lbrakk>0 < c; a \<le> b\<rbrakk> \<Longrightarrow> a \<le> b * c"
```
```    14   for c :: nat
```
```    15   by (metis divisors_zero dvd_triv_left leI less_le_trans nat_dvd_not_less zero_less_iff_neq_zero)
```
```    16
```
```    17 locale sylow = group +
```
```    18   fixes p and a and m and calM and RelM
```
```    19   assumes prime_p: "prime p"
```
```    20     and order_G: "order G = (p^a) * m"
```
```    21     and finite_G[iff]: "finite (carrier G)"
```
```    22   defines "calM \<equiv> {s. s \<subseteq> carrier G \<and> card s = p^a}"
```
```    23     and "RelM \<equiv> {(N1, N2). N1 \<in> calM \<and> N2 \<in> calM \<and> (\<exists>g \<in> carrier G. N1 = N2 #> g)}"
```
```    24 begin
```
```    25
```
```    26 lemma RelM_refl_on: "refl_on calM RelM"
```
```    27   by (auto simp: refl_on_def RelM_def calM_def) (blast intro!: coset_mult_one [symmetric])
```
```    28
```
```    29 lemma RelM_sym: "sym RelM"
```
```    30 proof (unfold sym_def RelM_def, clarify)
```
```    31   fix y g
```
```    32   assume "y \<in> calM"
```
```    33     and g: "g \<in> carrier G"
```
```    34   then have "y = y #> g #> (inv g)"
```
```    35     by (simp add: coset_mult_assoc calM_def)
```
```    36   then show "\<exists>g'\<in>carrier G. y = y #> g #> g'"
```
```    37     by (blast intro: g)
```
```    38 qed
```
```    39
```
```    40 lemma RelM_trans: "trans RelM"
```
```    41   by (auto simp add: trans_def RelM_def calM_def coset_mult_assoc)
```
```    42
```
```    43 lemma RelM_equiv: "equiv calM RelM"
```
```    44   unfolding equiv_def by (blast intro: RelM_refl_on RelM_sym RelM_trans)
```
```    45
```
```    46 lemma M_subset_calM_prep: "M' \<in> calM // RelM  \<Longrightarrow> M' \<subseteq> calM"
```
```    47   unfolding RelM_def by (blast elim!: quotientE)
```
```    48
```
```    49 end
```
```    50
```
```    51 subsection \<open>Main Part of the Proof\<close>
```
```    52
```
```    53 locale sylow_central = sylow +
```
```    54   fixes H and M1 and M
```
```    55   assumes M_in_quot: "M \<in> calM // RelM"
```
```    56     and not_dvd_M: "\<not> (p ^ Suc (multiplicity p m) dvd card M)"
```
```    57     and M1_in_M: "M1 \<in> M"
```
```    58   defines "H \<equiv> {g. g \<in> carrier G \<and> M1 #> g = M1}"
```
```    59 begin
```
```    60
```
```    61 lemma M_subset_calM: "M \<subseteq> calM"
```
```    62   by (rule M_in_quot [THEN M_subset_calM_prep])
```
```    63
```
```    64 lemma card_M1: "card M1 = p^a"
```
```    65   using M1_in_M M_subset_calM calM_def by blast
```
```    66
```
```    67 lemma exists_x_in_M1: "\<exists>x. x \<in> M1"
```
```    68   using prime_p [THEN prime_gt_Suc_0_nat] card_M1
```
```    69   by (metis Suc_lessD card_eq_0_iff empty_subsetI equalityI gr_implies_not0 nat_zero_less_power_iff subsetI)
```
```    70
```
```    71 lemma M1_subset_G [simp]: "M1 \<subseteq> carrier G"
```
```    72   using M1_in_M M_subset_calM calM_def mem_Collect_eq subsetCE by blast
```
```    73
```
```    74 lemma M1_inj_H: "\<exists>f \<in> H\<rightarrow>M1. inj_on f H"
```
```    75 proof -
```
```    76   from exists_x_in_M1 obtain m1 where m1M: "m1 \<in> M1"..
```
```    77   have m1: "m1 \<in> carrier G"
```
```    78     by (simp add: m1M M1_subset_G [THEN subsetD])
```
```    79   show ?thesis
```
```    80   proof
```
```    81     show "inj_on (\<lambda>z\<in>H. m1 \<otimes> z) H"
```
```    82       by (simp add: inj_on_def l_cancel [of m1 x y, THEN iffD1] H_def m1)
```
```    83     show "restrict (op \<otimes> m1) H \<in> H \<rightarrow> M1"
```
```    84     proof (rule restrictI)
```
```    85       fix z
```
```    86       assume zH: "z \<in> H"
```
```    87       show "m1 \<otimes> z \<in> M1"
```
```    88       proof -
```
```    89         from zH
```
```    90         have zG: "z \<in> carrier G" and M1zeq: "M1 #> z = M1"
```
```    91           by (auto simp add: H_def)
```
```    92         show ?thesis
```
```    93           by (rule subst [OF M1zeq]) (simp add: m1M zG rcosI)
```
```    94       qed
```
```    95     qed
```
```    96   qed
```
```    97 qed
```
```    98
```
```    99 end
```
```   100
```
```   101
```
```   102 subsection \<open>Discharging the Assumptions of \<open>sylow_central\<close>\<close>
```
```   103
```
```   104 context sylow
```
```   105 begin
```
```   106
```
```   107 lemma EmptyNotInEquivSet: "{} \<notin> calM // RelM"
```
```   108   by (blast elim!: quotientE dest: RelM_equiv [THEN equiv_class_self])
```
```   109
```
```   110 lemma existsM1inM: "M \<in> calM // RelM \<Longrightarrow> \<exists>M1. M1 \<in> M"
```
```   111   using RelM_equiv equiv_Eps_in by blast
```
```   112
```
```   113 lemma zero_less_o_G: "0 < order G"
```
```   114   by (simp add: order_def card_gt_0_iff carrier_not_empty)
```
```   115
```
```   116 lemma zero_less_m: "m > 0"
```
```   117   using zero_less_o_G by (simp add: order_G)
```
```   118
```
```   119 lemma card_calM: "card calM = (p^a) * m choose p^a"
```
```   120   by (simp add: calM_def n_subsets order_G [symmetric] order_def)
```
```   121
```
```   122 lemma zero_less_card_calM: "card calM > 0"
```
```   123   by (simp add: card_calM zero_less_binomial le_extend_mult zero_less_m)
```
```   124
```
```   125 lemma max_p_div_calM: "\<not> (p ^ Suc (multiplicity p m) dvd card calM)"
```
```   126 proof
```
```   127   assume "p ^ Suc (multiplicity p m) dvd card calM"
```
```   128   with zero_less_card_calM prime_p
```
```   129   have "Suc (multiplicity p m) \<le> multiplicity p (card calM)"
```
```   130     by (intro multiplicity_geI) auto
```
```   131   then have "multiplicity p m < multiplicity p (card calM)" by simp
```
```   132   also have "multiplicity p m = multiplicity p (card calM)"
```
```   133     by (simp add: const_p_fac prime_p zero_less_m card_calM)
```
```   134   finally show False by simp
```
```   135 qed
```
```   136
```
```   137 lemma finite_calM: "finite calM"
```
```   138   unfolding calM_def by (rule finite_subset [where B = "Pow (carrier G)"]) auto
```
```   139
```
```   140 lemma lemma_A1: "\<exists>M \<in> calM // RelM. \<not> (p ^ Suc (multiplicity p m) dvd card M)"
```
```   141   using RelM_equiv equiv_imp_dvd_card finite_calM max_p_div_calM by blast
```
```   142
```
```   143 end
```
```   144
```
```   145
```
```   146 subsubsection \<open>Introduction and Destruct Rules for \<open>H\<close>\<close>
```
```   147
```
```   148 context sylow_central
```
```   149 begin
```
```   150
```
```   151 lemma H_I: "\<lbrakk>g \<in> carrier G; M1 #> g = M1\<rbrakk> \<Longrightarrow> g \<in> H"
```
```   152   by (simp add: H_def)
```
```   153
```
```   154 lemma H_into_carrier_G: "x \<in> H \<Longrightarrow> x \<in> carrier G"
```
```   155   by (simp add: H_def)
```
```   156
```
```   157 lemma in_H_imp_eq: "g \<in> H \<Longrightarrow> M1 #> g = M1"
```
```   158   by (simp add: H_def)
```
```   159
```
```   160 lemma H_m_closed: "\<lbrakk>x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> x \<otimes> y \<in> H"
```
```   161   by (simp add: H_def coset_mult_assoc [symmetric])
```
```   162
```
```   163 lemma H_not_empty: "H \<noteq> {}"
```
```   164   apply (simp add: H_def)
```
```   165   apply (rule exI [of _ \<one>])
```
```   166   apply simp
```
```   167   done
```
```   168
```
```   169 lemma H_is_subgroup: "subgroup H G"
```
```   170   apply (rule subgroupI)
```
```   171      apply (rule subsetI)
```
```   172      apply (erule H_into_carrier_G)
```
```   173     apply (rule H_not_empty)
```
```   174    apply (simp add: H_def)
```
```   175    apply clarify
```
```   176    apply (erule_tac P = "\<lambda>z. lhs z = M1" for lhs in subst)
```
```   177    apply (simp add: coset_mult_assoc )
```
```   178   apply (blast intro: H_m_closed)
```
```   179   done
```
```   180
```
```   181
```
```   182 lemma rcosetGM1g_subset_G: "\<lbrakk>g \<in> carrier G; x \<in> M1 #> g\<rbrakk> \<Longrightarrow> x \<in> carrier G"
```
```   183   by (blast intro: M1_subset_G [THEN r_coset_subset_G, THEN subsetD])
```
```   184
```
```   185 lemma finite_M1: "finite M1"
```
```   186   by (rule finite_subset [OF M1_subset_G finite_G])
```
```   187
```
```   188 lemma finite_rcosetGM1g: "g \<in> carrier G \<Longrightarrow> finite (M1 #> g)"
```
```   189   using rcosetGM1g_subset_G finite_G M1_subset_G cosets_finite rcosetsI by blast
```
```   190
```
```   191 lemma M1_cardeq_rcosetGM1g: "g \<in> carrier G \<Longrightarrow> card (M1 #> g) = card M1"
```
```   192   by (simp add: card_cosets_equal rcosetsI)
```
```   193
```
```   194 lemma M1_RelM_rcosetGM1g: "g \<in> carrier G \<Longrightarrow> (M1, M1 #> g) \<in> RelM"
```
```   195   apply (simp add: RelM_def calM_def card_M1)
```
```   196   apply (rule conjI)
```
```   197    apply (blast intro: rcosetGM1g_subset_G)
```
```   198   apply (simp add: card_M1 M1_cardeq_rcosetGM1g)
```
```   199   apply (metis M1_subset_G coset_mult_assoc coset_mult_one r_inv_ex)
```
```   200   done
```
```   201
```
```   202 end
```
```   203
```
```   204
```
```   205 subsection \<open>Equal Cardinalities of \<open>M\<close> and the Set of Cosets\<close>
```
```   206
```
```   207 text \<open>Injections between @{term M} and @{term "rcosets\<^bsub>G\<^esub> H"} show that
```
```   208  their cardinalities are equal.\<close>
```
```   209
```
```   210 lemma ElemClassEquiv: "\<lbrakk>equiv A r; C \<in> A // r\<rbrakk> \<Longrightarrow> \<forall>x \<in> C. \<forall>y \<in> C. (x, y) \<in> r"
```
```   211   unfolding equiv_def quotient_def sym_def trans_def by blast
```
```   212
```
```   213 context sylow_central
```
```   214 begin
```
```   215
```
```   216 lemma M_elem_map: "M2 \<in> M \<Longrightarrow> \<exists>g. g \<in> carrier G \<and> M1 #> g = M2"
```
```   217   using M1_in_M M_in_quot [THEN RelM_equiv [THEN ElemClassEquiv]]
```
```   218   by (simp add: RelM_def) (blast dest!: bspec)
```
```   219
```
```   220 lemmas M_elem_map_carrier = M_elem_map [THEN someI_ex, THEN conjunct1]
```
```   221
```
```   222 lemmas M_elem_map_eq = M_elem_map [THEN someI_ex, THEN conjunct2]
```
```   223
```
```   224 lemma M_funcset_rcosets_H:
```
```   225   "(\<lambda>x\<in>M. H #> (SOME g. g \<in> carrier G \<and> M1 #> g = x)) \<in> M \<rightarrow> rcosets H"
```
```   226   by (metis (lifting) H_is_subgroup M_elem_map_carrier rcosetsI restrictI subgroup_imp_subset)
```
```   227
```
```   228 lemma inj_M_GmodH: "\<exists>f \<in> M \<rightarrow> rcosets H. inj_on f M"
```
```   229   apply (rule bexI)
```
```   230    apply (rule_tac [2] M_funcset_rcosets_H)
```
```   231   apply (rule inj_onI, simp)
```
```   232   apply (rule trans [OF _ M_elem_map_eq])
```
```   233    prefer 2 apply assumption
```
```   234   apply (rule M_elem_map_eq [symmetric, THEN trans], assumption)
```
```   235   apply (rule coset_mult_inv1)
```
```   236      apply (erule_tac [2] M_elem_map_carrier)+
```
```   237    apply (rule_tac [2] M1_subset_G)
```
```   238   apply (rule coset_join1 [THEN in_H_imp_eq])
```
```   239     apply (rule_tac [3] H_is_subgroup)
```
```   240    prefer 2 apply (blast intro: M_elem_map_carrier)
```
```   241   apply (simp add: coset_mult_inv2 H_def M_elem_map_carrier subset_eq)
```
```   242   done
```
```   243
```
```   244 end
```
```   245
```
```   246
```
```   247 subsubsection \<open>The Opposite Injection\<close>
```
```   248
```
```   249 context sylow_central
```
```   250 begin
```
```   251
```
```   252 lemma H_elem_map: "H1 \<in> rcosets H \<Longrightarrow> \<exists>g. g \<in> carrier G \<and> H #> g = H1"
```
```   253   by (auto simp: RCOSETS_def)
```
```   254
```
```   255 lemmas H_elem_map_carrier = H_elem_map [THEN someI_ex, THEN conjunct1]
```
```   256
```
```   257 lemmas H_elem_map_eq = H_elem_map [THEN someI_ex, THEN conjunct2]
```
```   258
```
```   259 lemma rcosets_H_funcset_M:
```
```   260   "(\<lambda>C \<in> rcosets H. M1 #> (@g. g \<in> carrier G \<and> H #> g = C)) \<in> rcosets H \<rightarrow> M"
```
```   261   apply (simp add: RCOSETS_def)
```
```   262   apply (fast intro: someI2
```
```   263       intro!: M1_in_M in_quotient_imp_closed [OF RelM_equiv M_in_quot _  M1_RelM_rcosetGM1g])
```
```   264   done
```
```   265
```
```   266 text \<open>Close to a duplicate of \<open>inj_M_GmodH\<close>.\<close>
```
```   267 lemma inj_GmodH_M: "\<exists>g \<in> rcosets H\<rightarrow>M. inj_on g (rcosets H)"
```
```   268   apply (rule bexI)
```
```   269    apply (rule_tac [2] rcosets_H_funcset_M)
```
```   270   apply (rule inj_onI)
```
```   271   apply (simp)
```
```   272   apply (rule trans [OF _ H_elem_map_eq])
```
```   273    prefer 2 apply assumption
```
```   274   apply (rule H_elem_map_eq [symmetric, THEN trans], assumption)
```
```   275   apply (rule coset_mult_inv1)
```
```   276      apply (erule_tac [2] H_elem_map_carrier)+
```
```   277    apply (rule_tac [2] H_is_subgroup [THEN subgroup.subset])
```
```   278   apply (rule coset_join2)
```
```   279     apply (blast intro: H_elem_map_carrier)
```
```   280    apply (rule H_is_subgroup)
```
```   281   apply (simp add: H_I coset_mult_inv2 H_elem_map_carrier)
```
```   282   done
```
```   283
```
```   284 lemma calM_subset_PowG: "calM \<subseteq> Pow (carrier G)"
```
```   285   by (auto simp: calM_def)
```
```   286
```
```   287
```
```   288 lemma finite_M: "finite M"
```
```   289   by (metis M_subset_calM finite_calM rev_finite_subset)
```
```   290
```
```   291 lemma cardMeqIndexH: "card M = card (rcosets H)"
```
```   292   apply (insert inj_M_GmodH inj_GmodH_M)
```
```   293   apply (blast intro: card_bij finite_M H_is_subgroup
```
```   294       rcosets_subset_PowG [THEN finite_subset]
```
```   295       finite_Pow_iff [THEN iffD2])
```
```   296   done
```
```   297
```
```   298 lemma index_lem: "card M * card H = order G"
```
```   299   by (simp add: cardMeqIndexH lagrange H_is_subgroup)
```
```   300
```
```   301 lemma lemma_leq1: "p^a \<le> card H"
```
```   302   apply (rule dvd_imp_le)
```
```   303    apply (rule div_combine [OF prime_imp_prime_elem[OF prime_p] not_dvd_M])
```
```   304    prefer 2 apply (blast intro: subgroup.finite_imp_card_positive H_is_subgroup)
```
```   305   apply (simp add: index_lem order_G power_add mult_dvd_mono multiplicity_dvd zero_less_m)
```
```   306   done
```
```   307
```
```   308 lemma lemma_leq2: "card H \<le> p^a"
```
```   309   apply (subst card_M1 [symmetric])
```
```   310   apply (cut_tac M1_inj_H)
```
```   311   apply (blast intro!: M1_subset_G intro: card_inj H_into_carrier_G finite_subset [OF _ finite_G])
```
```   312   done
```
```   313
```
```   314 lemma card_H_eq: "card H = p^a"
```
```   315   by (blast intro: le_antisym lemma_leq1 lemma_leq2)
```
```   316
```
```   317 end
```
```   318
```
```   319 lemma (in sylow) sylow_thm: "\<exists>H. subgroup H G \<and> card H = p^a"
```
```   320   using lemma_A1
```
```   321   apply clarify
```
```   322   apply (frule existsM1inM, clarify)
```
```   323   apply (subgoal_tac "sylow_central G p a m M1 M")
```
```   324    apply (blast dest: sylow_central.H_is_subgroup sylow_central.card_H_eq)
```
```   325   apply (simp add: sylow_central_def sylow_central_axioms_def sylow_axioms calM_def RelM_def)
```
```   326   done
```
```   327
```
```   328 text \<open>Needed because the locale's automatic definition refers to
```
```   329   @{term "semigroup G"} and @{term "group_axioms G"} rather than
```
```   330   simply to @{term "group G"}.\<close>
```
```   331 lemma sylow_eq: "sylow G p a m \<longleftrightarrow> group G \<and> sylow_axioms G p a m"
```
```   332   by (simp add: sylow_def group_def)
```
```   333
```
```   334
```
```   335 subsection \<open>Sylow's Theorem\<close>
```
```   336
```
```   337 theorem sylow_thm:
```
```   338   "\<lbrakk>prime p; group G; order G = (p^a) * m; finite (carrier G)\<rbrakk>
```
```   339     \<Longrightarrow> \<exists>H. subgroup H G \<and> card H = p^a"
```
```   340   by (rule sylow.sylow_thm [of G p a m]) (simp add: sylow_eq sylow_axioms_def)
```
```   341
```
```   342 end
```