src/ZF/ex/Group.thy
changeset 27618 72fe9939a2ab
parent 26199 04817a8802f2
child 29223 e09c53289830
equal deleted inserted replaced
27617:dee36037a832 27618:72fe9939a2ab
    93      "\<And>x. x \<in> carrier(G) \<Longrightarrow> \<exists>y \<in> carrier(G). y \<cdot> x = \<one> & x \<cdot> y = \<one>"
    93      "\<And>x. x \<in> carrier(G) \<Longrightarrow> \<exists>y \<in> carrier(G). y \<cdot> x = \<one> & x \<cdot> y = \<one>"
    94 
    94 
    95 lemma (in group) is_group [simp]: "group(G)" by (rule group_axioms)
    95 lemma (in group) is_group [simp]: "group(G)" by (rule group_axioms)
    96 
    96 
    97 theorem groupI:
    97 theorem groupI:
    98   includes struct G
    98   fixes G (structure)
    99   assumes m_closed [simp]:
    99   assumes m_closed [simp]:
   100       "\<And>x y. \<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> \<Longrightarrow> x \<cdot> y \<in> carrier(G)"
   100       "\<And>x y. \<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> \<Longrightarrow> x \<cdot> y \<in> carrier(G)"
   101     and one_closed [simp]: "\<one> \<in> carrier(G)"
   101     and one_closed [simp]: "\<one> \<in> carrier(G)"
   102     and m_assoc:
   102     and m_assoc:
   103       "\<And>x y z. \<lbrakk>x \<in> carrier(G); y \<in> carrier(G); z \<in> carrier(G)\<rbrakk> \<Longrightarrow>
   103       "\<And>x y z. \<lbrakk>x \<in> carrier(G); y \<in> carrier(G); z \<in> carrier(G)\<rbrakk> \<Longrightarrow>
   257 lemma subgroup_imp_subset:
   257 lemma subgroup_imp_subset:
   258   "subgroup(H,G) \<Longrightarrow> H \<subseteq> carrier(G)"
   258   "subgroup(H,G) \<Longrightarrow> H \<subseteq> carrier(G)"
   259   by (rule subgroup.subset)
   259   by (rule subgroup.subset)
   260 
   260 
   261 lemma (in subgroup) group_axiomsI [intro]:
   261 lemma (in subgroup) group_axiomsI [intro]:
   262   includes group G
   262   assumes "group(G)"
   263   shows "group_axioms (update_carrier(G,H))"
   263   shows "group_axioms (update_carrier(G,H))"
   264 by (force intro: group_axioms.intro l_inv r_inv) 
   264 proof -
       
   265   interpret group [G] by fact
       
   266   show ?thesis by (force intro: group_axioms.intro l_inv r_inv)
       
   267 qed
   265 
   268 
   266 lemma (in subgroup) is_group [intro]:
   269 lemma (in subgroup) is_group [intro]:
   267   includes group G
   270   assumes "group(G)"
   268   shows "group (update_carrier(G,H))"
   271   shows "group (update_carrier(G,H))"
       
   272 proof -
       
   273   interpret group [G] by fact
       
   274   show ?thesis
   269   by (rule groupI) (auto intro: m_assoc l_inv mem_carrier)
   275   by (rule groupI) (auto intro: m_assoc l_inv mem_carrier)
       
   276 qed
   270 
   277 
   271 text {*
   278 text {*
   272   Since @{term H} is nonempty, it contains some element @{term x}.  Since
   279   Since @{term H} is nonempty, it contains some element @{term x}.  Since
   273   it is closed under inverse, it contains @{text "inv x"}.  Since
   280   it is closed under inverse, it contains @{text "inv x"}.  Since
   274   it is closed under product, it contains @{text "x \<cdot> inv x = \<one>"}.
   281   it is closed under product, it contains @{text "x \<cdot> inv x = \<one>"}.
   304                    \<in> (carrier(G) \<times> carrier(H)) \<times> (carrier(G) \<times> carrier(H)).
   311                    \<in> (carrier(G) \<times> carrier(H)) \<times> (carrier(G) \<times> carrier(H)).
   305                 <g \<cdot>\<^bsub>G\<^esub> g', h \<cdot>\<^bsub>H\<^esub> h'>),
   312                 <g \<cdot>\<^bsub>G\<^esub> g', h \<cdot>\<^bsub>H\<^esub> h'>),
   306               <\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>H\<^esub>>, 0>"
   313               <\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>H\<^esub>>, 0>"
   307 
   314 
   308 lemma DirProdGroup_group:
   315 lemma DirProdGroup_group:
   309   includes group G + group H
   316   assumes "group(G)" and "group(H)"
   310   shows "group (G \<Otimes> H)"
   317   shows "group (G \<Otimes> H)"
   311   by (force intro!: groupI G.m_assoc H.m_assoc G.l_inv H.l_inv
   318 proof -
       
   319   interpret G: group [G] by fact
       
   320   interpret H: group [H] by fact
       
   321   show ?thesis by (force intro!: groupI G.m_assoc H.m_assoc G.l_inv H.l_inv
   312           simp add: DirProdGroup_def)
   322           simp add: DirProdGroup_def)
       
   323 qed
   313 
   324 
   314 lemma carrier_DirProdGroup [simp]:
   325 lemma carrier_DirProdGroup [simp]:
   315      "carrier (G \<Otimes> H) = carrier(G) \<times> carrier(H)"
   326      "carrier (G \<Otimes> H) = carrier(G) \<times> carrier(H)"
   316   by (simp add: DirProdGroup_def)
   327   by (simp add: DirProdGroup_def)
   317 
   328 
   323      "[|g \<in> carrier(G); h \<in> carrier(H); g' \<in> carrier(G); h' \<in> carrier(H)|]
   334      "[|g \<in> carrier(G); h \<in> carrier(H); g' \<in> carrier(G); h' \<in> carrier(H)|]
   324       ==> <g, h> \<cdot>\<^bsub>G \<Otimes> H\<^esub> <g', h'> = <g \<cdot>\<^bsub>G\<^esub> g', h \<cdot>\<^bsub>H\<^esub> h'>"
   335       ==> <g, h> \<cdot>\<^bsub>G \<Otimes> H\<^esub> <g', h'> = <g \<cdot>\<^bsub>G\<^esub> g', h \<cdot>\<^bsub>H\<^esub> h'>"
   325   by (simp add: DirProdGroup_def)
   336   by (simp add: DirProdGroup_def)
   326 
   337 
   327 lemma inv_DirProdGroup [simp]:
   338 lemma inv_DirProdGroup [simp]:
   328   includes group G + group H
   339   assumes "group(G)" and "group(H)"
   329   assumes g: "g \<in> carrier(G)"
   340   assumes g: "g \<in> carrier(G)"
   330       and h: "h \<in> carrier(H)"
   341       and h: "h \<in> carrier(H)"
   331   shows "inv \<^bsub>G \<Otimes> H\<^esub> <g, h> = <inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h>"
   342   shows "inv \<^bsub>G \<Otimes> H\<^esub> <g, h> = <inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h>"
   332   apply (rule group.inv_equality [OF DirProdGroup_group])
   343   apply (rule group.inv_equality [OF DirProdGroup_group])
   333   apply (simp_all add: prems group.l_inv)
   344   apply (simp_all add: prems group.l_inv)
   381 lemma (in group) iso_trans: 
   392 lemma (in group) iso_trans: 
   382      "\<lbrakk>h \<in> G \<cong> H; i \<in> H \<cong> I\<rbrakk> \<Longrightarrow> i O h \<in> G \<cong> I"
   393      "\<lbrakk>h \<in> G \<cong> H; i \<in> H \<cong> I\<rbrakk> \<Longrightarrow> i O h \<in> G \<cong> I"
   383   by (auto simp add: iso_def hom_compose comp_bij)
   394   by (auto simp add: iso_def hom_compose comp_bij)
   384 
   395 
   385 lemma DirProdGroup_commute_iso:
   396 lemma DirProdGroup_commute_iso:
   386   includes group G + group H
   397   assumes "group(G)" and "group(H)"
   387   shows "(\<lambda><x,y> \<in> carrier(G \<Otimes> H). <y,x>) \<in> (G \<Otimes> H) \<cong> (H \<Otimes> G)"
   398   shows "(\<lambda><x,y> \<in> carrier(G \<Otimes> H). <y,x>) \<in> (G \<Otimes> H) \<cong> (H \<Otimes> G)"
   388   by (auto simp add: iso_def hom_def inj_def surj_def bij_def) 
   399 proof -
       
   400   interpret group [G] by fact
       
   401   interpret group [H] by fact
       
   402   show ?thesis by (auto simp add: iso_def hom_def inj_def surj_def bij_def)
       
   403 qed
   389 
   404 
   390 lemma DirProdGroup_assoc_iso:
   405 lemma DirProdGroup_assoc_iso:
   391   includes group G + group H + group I
   406   assumes "group(G)" and "group(H)" and "group(I)"
   392   shows "(\<lambda><<x,y>,z> \<in> carrier((G \<Otimes> H) \<Otimes> I). <x,<y,z>>)
   407   shows "(\<lambda><<x,y>,z> \<in> carrier((G \<Otimes> H) \<Otimes> I). <x,<y,z>>)
   393           \<in> ((G \<Otimes> H) \<Otimes> I) \<cong> (G \<Otimes> (H \<Otimes> I))"
   408           \<in> ((G \<Otimes> H) \<Otimes> I) \<cong> (G \<Otimes> (H \<Otimes> I))"
   394   by (auto intro: lam_type simp add: iso_def hom_def inj_def surj_def bij_def) 
   409 proof -
       
   410   interpret group [G] by fact
       
   411   interpret group [H] by fact
       
   412   interpret group [I] by fact
       
   413   show ?thesis
       
   414     by (auto intro: lam_type simp add: iso_def hom_def inj_def surj_def bij_def) 
       
   415 qed
   395 
   416 
   396 text{*Basis for homomorphism proofs: we assume two groups @{term G} and
   417 text{*Basis for homomorphism proofs: we assume two groups @{term G} and
   397   @term{H}, with a homomorphism @{term h} between them*}
   418   @term{H}, with a homomorphism @{term h} between them*}
   398 locale group_hom = group G + group H + var h +
   419 locale group_hom = group G + group H + var h +
   399   assumes homh: "h \<in> hom(G,H)"
   420   assumes homh: "h \<in> hom(G,H)"
   844   r_congruent :: "[i,i] => i" ("rcong\<index> _" [60] 60) where
   865   r_congruent :: "[i,i] => i" ("rcong\<index> _" [60] 60) where
   845   "rcong\<^bsub>G\<^esub> H == {<x,y> \<in> carrier(G) * carrier(G). inv\<^bsub>G\<^esub> x \<cdot>\<^bsub>G\<^esub> y \<in> H}"
   866   "rcong\<^bsub>G\<^esub> H == {<x,y> \<in> carrier(G) * carrier(G). inv\<^bsub>G\<^esub> x \<cdot>\<^bsub>G\<^esub> y \<in> H}"
   846 
   867 
   847 
   868 
   848 lemma (in subgroup) equiv_rcong:
   869 lemma (in subgroup) equiv_rcong:
   849    includes group G
   870    assumes "group(G)"
   850    shows "equiv (carrier(G), rcong H)"
   871    shows "equiv (carrier(G), rcong H)"
   851 proof (simp add: equiv_def, intro conjI)
   872 proof -
   852   show "rcong H \<subseteq> carrier(G) \<times> carrier(G)"
   873   interpret group [G] by fact
   853     by (auto simp add: r_congruent_def) 
   874   show ?thesis proof (simp add: equiv_def, intro conjI)
   854 next
   875     show "rcong H \<subseteq> carrier(G) \<times> carrier(G)"
   855   show "refl (carrier(G), rcong H)"
   876       by (auto simp add: r_congruent_def) 
   856     by (auto simp add: r_congruent_def refl_def) 
   877   next
   857 next
   878     show "refl (carrier(G), rcong H)"
   858   show "sym (rcong H)"
   879       by (auto simp add: r_congruent_def refl_def) 
   859   proof (simp add: r_congruent_def sym_def, clarify)
   880   next
   860     fix x y
   881     show "sym (rcong H)"
   861     assume [simp]: "x \<in> carrier(G)" "y \<in> carrier(G)" 
   882     proof (simp add: r_congruent_def sym_def, clarify)
   862        and "inv x \<cdot> y \<in> H"
   883       fix x y
   863     hence "inv (inv x \<cdot> y) \<in> H" by (simp add: m_inv_closed) 
   884       assume [simp]: "x \<in> carrier(G)" "y \<in> carrier(G)" 
   864     thus "inv y \<cdot> x \<in> H" by (simp add: inv_mult_group)
   885 	and "inv x \<cdot> y \<in> H"
   865   qed
   886       hence "inv (inv x \<cdot> y) \<in> H" by (simp add: m_inv_closed) 
   866 next
   887       thus "inv y \<cdot> x \<in> H" by (simp add: inv_mult_group)
   867   show "trans (rcong H)"
   888     qed
   868   proof (simp add: r_congruent_def trans_def, clarify)
   889   next
   869     fix x y z
   890     show "trans (rcong H)"
   870     assume [simp]: "x \<in> carrier(G)" "y \<in> carrier(G)" "z \<in> carrier(G)"
   891     proof (simp add: r_congruent_def trans_def, clarify)
   871        and "inv x \<cdot> y \<in> H" and "inv y \<cdot> z \<in> H"
   892       fix x y z
   872     hence "(inv x \<cdot> y) \<cdot> (inv y \<cdot> z) \<in> H" by simp
   893       assume [simp]: "x \<in> carrier(G)" "y \<in> carrier(G)" "z \<in> carrier(G)"
   873     hence "inv x \<cdot> (y \<cdot> inv y) \<cdot> z \<in> H" by (simp add: m_assoc del: inv) 
   894 	and "inv x \<cdot> y \<in> H" and "inv y \<cdot> z \<in> H"
   874     thus "inv x \<cdot> z \<in> H" by simp
   895       hence "(inv x \<cdot> y) \<cdot> (inv y \<cdot> z) \<in> H" by simp
       
   896       hence "inv x \<cdot> (y \<cdot> inv y) \<cdot> z \<in> H" by (simp add: m_assoc del: inv) 
       
   897       thus "inv x \<cdot> z \<in> H" by simp
       
   898     qed
   875   qed
   899   qed
   876 qed
   900 qed
   877 
   901 
   878 text{*Equivalence classes of @{text rcong} correspond to left cosets.
   902 text{*Equivalence classes of @{text rcong} correspond to left cosets.
   879   Was there a mistake in the definitions? I'd have expected them to
   903   Was there a mistake in the definitions? I'd have expected them to
   880   correspond to right cosets.*}
   904   correspond to right cosets.*}
   881 lemma (in subgroup) l_coset_eq_rcong:
   905 lemma (in subgroup) l_coset_eq_rcong:
   882   includes group G
   906   assumes "group(G)"
   883   assumes a: "a \<in> carrier(G)"
   907   assumes a: "a \<in> carrier(G)"
   884   shows "a <# H = (rcong H) `` {a}" 
   908   shows "a <# H = (rcong H) `` {a}" 
   885 by (force simp add: r_congruent_def l_coset_def m_assoc [symmetric] a
   909 proof -
   886                 Collect_image_eq) 
   910   interpret group [G] by fact
   887 
   911   show ?thesis
       
   912     by (force simp add: r_congruent_def l_coset_def m_assoc [symmetric] a
       
   913       Collect_image_eq) 
       
   914 qed
   888 
   915 
   889 lemma (in group) rcos_equation:
   916 lemma (in group) rcos_equation:
   890   includes subgroup H G
   917   assumes "subgroup(H, G)"
   891   shows
   918   shows
   892      "\<lbrakk>ha \<cdot> a = h \<cdot> b; a \<in> carrier(G);  b \<in> carrier(G);  
   919      "\<lbrakk>ha \<cdot> a = h \<cdot> b; a \<in> carrier(G);  b \<in> carrier(G);  
   893         h \<in> H;  ha \<in> H;  hb \<in> H\<rbrakk>
   920         h \<in> H;  ha \<in> H;  hb \<in> H\<rbrakk>
   894       \<Longrightarrow> hb \<cdot> a \<in> (\<Union>h\<in>H. {h \<cdot> b})"
   921       \<Longrightarrow> hb \<cdot> a \<in> (\<Union>h\<in>H. {h \<cdot> b})" (is "PROP ?P")
   895 apply (rule UN_I [of "hb \<cdot> ((inv ha) \<cdot> h)"], simp)
   922 proof -
   896 apply (simp add: m_assoc transpose_inv)
   923   interpret subgroup [H G] by fact
   897 done
   924   show "PROP ?P"
   898 
   925     apply (rule UN_I [of "hb \<cdot> ((inv ha) \<cdot> h)"], simp)
       
   926     apply (simp add: m_assoc transpose_inv)
       
   927     done
       
   928 qed
   899 
   929 
   900 lemma (in group) rcos_disjoint:
   930 lemma (in group) rcos_disjoint:
   901   includes subgroup H G
   931   assumes "subgroup(H, G)"
   902   shows "\<lbrakk>a \<in> rcosets H; b \<in> rcosets H; a\<noteq>b\<rbrakk> \<Longrightarrow> a \<inter> b = 0"
   932   shows "\<lbrakk>a \<in> rcosets H; b \<in> rcosets H; a\<noteq>b\<rbrakk> \<Longrightarrow> a \<inter> b = 0" (is "PROP ?P")
   903 apply (simp add: RCOSETS_def r_coset_def)
   933 proof -
   904 apply (blast intro: rcos_equation prems sym)
   934   interpret subgroup [H G] by fact
   905 done
   935   show "PROP ?P"
       
   936     apply (simp add: RCOSETS_def r_coset_def)
       
   937     apply (blast intro: rcos_equation prems sym)
       
   938     done
       
   939 qed
   906 
   940 
   907 
   941 
   908 subsection {*Order of a Group and Lagrange's Theorem*}
   942 subsection {*Order of a Group and Lagrange's Theorem*}
   909 
   943 
   910 definition
   944 definition
   911   order :: "i => i" where
   945   order :: "i => i" where
   912   "order(S) == |carrier(S)|"
   946   "order(S) == |carrier(S)|"
   913 
   947 
   914 lemma (in group) rcos_self:
   948 lemma (in group) rcos_self:
   915   includes subgroup
   949   assumes "subgroup(H, G)"
   916   shows "x \<in> carrier(G) \<Longrightarrow> x \<in> H #> x"
   950   shows "x \<in> carrier(G) \<Longrightarrow> x \<in> H #> x" (is "PROP ?P")
   917 apply (simp add: r_coset_def)
   951 proof -
   918 apply (rule_tac x="\<one>" in bexI, auto) 
   952   interpret subgroup [H G] by fact
   919 done
   953   show "PROP ?P"
       
   954     apply (simp add: r_coset_def)
       
   955     apply (rule_tac x="\<one>" in bexI) apply (auto)
       
   956     done
       
   957 qed
   920 
   958 
   921 lemma (in group) rcosets_part_G:
   959 lemma (in group) rcosets_part_G:
   922   includes subgroup
   960   assumes "subgroup(H, G)"
   923   shows "\<Union>(rcosets H) = carrier(G)"
   961   shows "\<Union>(rcosets H) = carrier(G)"
   924 apply (rule equalityI)
   962 proof -
   925  apply (force simp add: RCOSETS_def r_coset_def)
   963   interpret subgroup [H G] by fact
   926 apply (auto simp add: RCOSETS_def intro: rcos_self prems)
   964   show ?thesis
   927 done
   965     apply (rule equalityI)
       
   966     apply (force simp add: RCOSETS_def r_coset_def)
       
   967     apply (auto simp add: RCOSETS_def intro: rcos_self prems)
       
   968     done
       
   969 qed
   928 
   970 
   929 lemma (in group) cosets_finite:
   971 lemma (in group) cosets_finite:
   930      "\<lbrakk>c \<in> rcosets H;  H \<subseteq> carrier(G);  Finite (carrier(G))\<rbrakk> \<Longrightarrow> Finite(c)"
   972      "\<lbrakk>c \<in> rcosets H;  H \<subseteq> carrier(G);  Finite (carrier(G))\<rbrakk> \<Longrightarrow> Finite(c)"
   931 apply (auto simp add: RCOSETS_def)
   973 apply (auto simp add: RCOSETS_def)
   932 apply (simp add: r_coset_subset_G [THEN subset_Finite])
   974 apply (simp add: r_coset_subset_G [THEN subset_Finite])
   997      "\<lbrakk>M1 \<in> rcosets H; M2 \<in> rcosets H; M3 \<in> rcosets H\<rbrakk>
  1039      "\<lbrakk>M1 \<in> rcosets H; M2 \<in> rcosets H; M3 \<in> rcosets H\<rbrakk>
   998       \<Longrightarrow> M1 <#> M2 <#> M3 = M1 <#> (M2 <#> M3)"
  1040       \<Longrightarrow> M1 <#> M2 <#> M3 = M1 <#> (M2 <#> M3)"
   999 by (auto simp add: RCOSETS_def rcos_sum m_assoc)
  1041 by (auto simp add: RCOSETS_def rcos_sum m_assoc)
  1000 
  1042 
  1001 lemma (in subgroup) subgroup_in_rcosets:
  1043 lemma (in subgroup) subgroup_in_rcosets:
  1002   includes group G
  1044   assumes "group(G)"
  1003   shows "H \<in> rcosets H"
  1045   shows "H \<in> rcosets H"
  1004 proof -
  1046 proof -
       
  1047   interpret group [G] by fact
  1005   have "H #> \<one> = H"
  1048   have "H #> \<one> = H"
  1006     using _ subgroup_axioms by (rule coset_join2) simp_all
  1049     using _ subgroup_axioms by (rule coset_join2) simp_all
  1007   then show ?thesis
  1050   then show ?thesis
  1008     by (auto simp add: RCOSETS_def intro: sym)
  1051     by (auto simp add: RCOSETS_def intro: sym)
  1009 qed
  1052 qed