# HG changeset patch # User paulson # Date 1528982618 -3600 # Node ID c183a6a69f2d0a69ff907b3d64478d661e820991 # Parent ff61cbfb3f2d185b0de85a5629d222f9ab547085 reorganisation of Algebra: new material from Baillon and Vilhena, removal of duplicate names, elimination of "More_" theories diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/Coset.thy --- a/src/HOL/Algebra/Coset.thy Tue Jun 12 16:09:12 2018 +0100 +++ b/src/HOL/Algebra/Coset.thy Thu Jun 14 14:23:38 2018 +0100 @@ -1,7 +1,6 @@ (* Title: HOL/Algebra/Coset.thy - Author: Florian Kammueller - Author: L C Paulson - Author: Stephan Hohe + Authors: Florian Kammueller, L C Paulson, Stephan Hohe +With additional contributions from Martin Baillon and Paulo Emílio de Vilhena. *) theory Coset @@ -106,10 +105,9 @@ shows "h <#\<^bsub>G \ carrier := H \\<^esub> I = h <# I" using subgroup_set_mult_equality by (simp add: l_coset_eq_set_mult assms) -(* ************************************************************************** *) -subsection \Basic Properties of set_mult\ +subsection \Basic Properties of set multiplication\ lemma (in group) setmult_subset_G: assumes "H \ carrier G" "K \ carrier G" @@ -121,9 +119,7 @@ shows "H <#> K \ carrier G" using assms by (auto simp add: set_mult_def subsetD) -(* ************************************************************************** *) -(* Next lemma contributed by Martin Baillon. *) - +(* Next lemma contributed by Martin Baillon.*) lemma (in group) set_mult_assoc: assumes "M \ carrier G" "H \ carrier G" "K \ carrier G" shows "(M <#> H) <#> K = M <#> (H <#> K)" @@ -151,7 +147,6 @@ qed qed -(* ************************************************************************** *) subsection \Basic Properties of Cosets\ @@ -1087,7 +1082,6 @@ subsection \Theorems about Factor Groups and Direct product\ - lemma (in group) DirProd_normal : assumes "group K" and "H \ G" @@ -1158,5 +1152,148 @@ DirProd_group[OF normal.factorgroup_is_group normal.factorgroup_is_group] by blast +subsubsection "More Lemmas about set multiplication" + +(*A group multiplied by a subgroup stays the same*) +lemma (in group) set_mult_carrier_idem: + assumes "subgroup H G" + shows "(carrier G) <#> H = carrier G" +proof + show "(carrier G)<#>H \ carrier G" + unfolding set_mult_def using subgroup_imp_subset assms by blast +next + have " (carrier G) #> \ = carrier G" unfolding set_mult_def r_coset_def group_axioms by simp + moreover have "(carrier G) #> \ \ (carrier G) <#> H" unfolding set_mult_def r_coset_def + using assms subgroup.one_closed[OF assms] by blast + ultimately show "carrier G \ (carrier G) <#> H" by simp +qed + +(*Same lemma as above, but everything is included in a subgroup*) +lemma (in group) set_mult_subgroup_idem: + assumes "subgroup H G" + and "subgroup N (G\carrier:=H\)" + shows "H<#>N = H" + using group.set_mult_carrier_idem[OF subgroup_imp_group] subgroup_imp_subset assms + by (metis monoid.cases_scheme order_refl partial_object.simps(1) + partial_object.update_convs(1) subgroup_set_mult_equality) + +(*A normal subgroup is commutative with set_mult*) +lemma (in group) commut_normal: + assumes "subgroup H G" + and "N\G" + shows "H<#>N = N<#>H" +proof- + have aux1: "{H <#> N} = {\h\H. h <# N }" unfolding set_mult_def l_coset_def by auto + also have "... = {\h\H. N #> h }" using assms normal.coset_eq subgroup.mem_carrier by fastforce + moreover have aux2: "{N <#> H} = {\h\H. N #> h }"unfolding set_mult_def r_coset_def by auto + ultimately show "H<#>N = N<#>H" by simp +qed + +(*Same lemma as above, but everything is included in a subgroup*) +lemma (in group) commut_normal_subgroup: + assumes "subgroup H G" + and "N\(G\carrier:=H\)" + and "subgroup K (G\carrier:=H\)" + shows "K<#>N = N<#>K" +proof- + have "N \ carrier (G\carrier := H\)" using assms normal_imp_subgroup subgroup_imp_subset by blast + hence NH : "N \ H" by simp + have "K \ carrier(G\carrier := H\)" using subgroup_imp_subset assms by blast + hence KH : "K \ H" by simp + have Egal : "K <#>\<^bsub>G\carrier := H\\<^esub> N = N <#>\<^bsub>G\carrier := H\\<^esub> K" + using group.commut_normal[where ?G = "G\carrier :=H\", of K N,OF subgroup_imp_group[OF assms(1)] + assms(3) assms(2)] by auto + also have "... = N <#> K" using subgroup_set_mult_equality[of H N K, OF assms(1) NH KH] by auto + moreover have "K <#>\<^bsub>G\carrier := H\\<^esub> N = K <#> N" + using subgroup_set_mult_equality[of H K N, OF assms(1) KH NH] by auto + ultimately show "K<#>N = N<#>K" by auto +qed + + + +subsubsection "Lemmas about intersection and normal subgroups" + +lemma (in group) normal_inter: + assumes "subgroup H G" + and "subgroup K G" + and "H1\G\carrier := H\" + shows " (H1\K)\(G\carrier:= (H\K)\)" +proof- + define HK and H1K and GH and GHK + where "HK = H\K" and "H1K=H1\K" and "GH =G\carrier := H\" and "GHK = (G\carrier:= (H\K)\)" + show "H1K\GHK" + proof (intro group.normal_invI[of GHK H1K]) + show "Group.group GHK" + using GHK_def subgroups_Inter_pair subgroup_imp_group assms by blast + + next + have H1K_incl:"subgroup H1K (G\carrier:= (H\K)\)" + proof(intro subgroup_incl) + show "subgroup H1K G" + using assms normal_imp_subgroup subgroups_Inter_pair incl_subgroup H1K_def by blast + next + show "subgroup (H\K) G" using HK_def subgroups_Inter_pair assms by auto + next + have "H1 \ (carrier (G\carrier:=H\))" + using assms(3) normal_imp_subgroup subgroup_imp_subset by blast + also have "... \ H" by simp + thus "H1K \H\K" + using H1K_def calculation by auto + qed + thus "subgroup H1K GHK" using GHK_def by simp + next + show "\ x h. x\carrier GHK \ h\H1K \ x \\<^bsub>GHK\<^esub> h \\<^bsub>GHK\<^esub> inv\<^bsub>GHK\<^esub> x\ H1K" + proof- + have invHK: "\y\HK\ \ inv\<^bsub>GHK\<^esub> y = inv\<^bsub>GH\<^esub> y" + using subgroup_inv_equality assms HK_def GH_def GHK_def subgroups_Inter_pair by simp + have multHK : "\x\HK;y\HK\ \ x \\<^bsub>(G\carrier:=HK\)\<^esub> y = x \ y" + using HK_def by simp + fix x assume p: "x\carrier GHK" + fix h assume p2 : "h:H1K" + have "carrier(GHK)\HK" + using GHK_def HK_def by simp + hence xHK:"x\HK" using p by auto + hence invx:"inv\<^bsub>GHK\<^esub> x = inv\<^bsub>GH\<^esub> x" + using invHK assms GHK_def HK_def GH_def subgroup_inv_equality subgroups_Inter_pair by simp + have "H1\carrier(GH)" + using assms GH_def normal_imp_subgroup subgroup_imp_subset by blast + hence hHK:"h\HK" + using p2 H1K_def HK_def GH_def by auto + hence xhx_egal : "x \\<^bsub>GHK\<^esub> h \\<^bsub>GHK\<^esub> inv\<^bsub>GHK\<^esub>x = x \\<^bsub>GH\<^esub> h \\<^bsub>GH\<^esub> inv\<^bsub>GH\<^esub> x" + using invx invHK multHK GHK_def GH_def by auto + have xH:"x\carrier(GH)" + using xHK HK_def GH_def by auto + have hH:"h\carrier(GH)" + using hHK HK_def GH_def by auto + have "(\x\carrier (GH). \h\H1. x \\<^bsub>GH\<^esub> h \\<^bsub>GH\<^esub> inv\<^bsub>GH\<^esub> x \ H1)" + using assms normal_invE GH_def normal.inv_op_closed2 by fastforce + hence INCL_1 : "x \\<^bsub>GH\<^esub> h \\<^bsub>GH\<^esub> inv\<^bsub>GH\<^esub> x \ H1" + using xH H1K_def p2 by blast + have " x \\<^bsub>GH\<^esub> h \\<^bsub>GH\<^esub> inv\<^bsub>GH\<^esub> x \ HK" + using assms HK_def subgroups_Inter_pair hHK xHK + by (metis GH_def inf.cobounded1 subgroup_def subgroup_incl) + hence " x \\<^bsub>GH\<^esub> h \\<^bsub>GH\<^esub> inv\<^bsub>GH\<^esub> x \ K" using HK_def by simp + hence " x \\<^bsub>GH\<^esub> h \\<^bsub>GH\<^esub> inv\<^bsub>GH\<^esub> x \ H1K" using INCL_1 H1K_def by auto + thus "x \\<^bsub>GHK\<^esub> h \\<^bsub>GHK\<^esub> inv\<^bsub>GHK\<^esub> x \ H1K" using xhx_egal by simp + qed + qed +qed + + +lemma (in group) normal_inter_subgroup: + assumes "subgroup H G" + and "N \ G" + shows "(N\H) \ (G\carrier := H\)" +proof - + define K where "K = carrier G" + have "G\carrier := K\ = G" using K_def by auto + moreover have "subgroup K G" using K_def subgroup_self by blast + moreover have "normal N (G \carrier :=K\)" using assms K_def by simp + ultimately have "N \ H \ G\carrier := K \ H\" + using normal_inter[of K H N] assms(1) by blast + moreover have "K \ H = H" using K_def assms subgroup_imp_subset by blast + ultimately show "normal (N\H) (G\carrier := H\)" by auto +qed + end diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/FiniteProduct.thy --- a/src/HOL/Algebra/FiniteProduct.thy Tue Jun 12 16:09:12 2018 +0100 +++ b/src/HOL/Algebra/FiniteProduct.thy Thu Jun 14 14:23:38 2018 +0100 @@ -524,4 +524,49 @@ end +(* Jeremy Avigad. This should be generalized to arbitrary groups, not just commutative + ones, using Lagrange's theorem. *) + +lemma (in comm_group) power_order_eq_one: + assumes fin [simp]: "finite (carrier G)" + and a [simp]: "a \ carrier G" + shows "a [^] card(carrier G) = one G" +proof - + have "(\x\carrier G. x) = (\x\carrier G. a \ x)" + by (subst (2) finprod_reindex [symmetric], + auto simp add: Pi_def inj_on_const_mult surj_const_mult) + also have "\ = (\x\carrier G. a) \ (\x\carrier G. x)" + by (auto simp add: finprod_multf Pi_def) + also have "(\x\carrier G. a) = a [^] card(carrier G)" + by (auto simp add: finprod_const) + finally show ?thesis +(* uses the preceeding lemma *) + by auto +qed + + +lemma (in comm_monoid) finprod_UN_disjoint: + "finite I \ (\i\I. finite (A i)) \ (\i\I. \j\I. i \ j \ A i \ A j = {}) \ + (\i\I. \x \ A i. g x \ carrier G) \ + finprod G g (UNION I A) = finprod G (\i. finprod G g (A i)) I" + apply (induct set: finite) + apply force + apply clarsimp + apply (subst finprod_Un_disjoint) + apply blast + apply (erule finite_UN_I) + apply blast + apply (fastforce) + apply (auto intro!: funcsetI finprod_closed) + done + +lemma (in comm_monoid) finprod_Union_disjoint: + "finite C \ + \A\C. finite A \ (\x\A. f x \ carrier G) \ + \A\C. \B\C. A \ B \ A \ B = {} \ + finprod G f (\C) = finprod G (finprod G f) C" + apply (frule finprod_UN_disjoint [of C id f]) + apply auto + done + end diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/Group.thy --- a/src/HOL/Algebra/Group.thy Tue Jun 12 16:09:12 2018 +0100 +++ b/src/HOL/Algebra/Group.thy Thu Jun 14 14:23:38 2018 +0100 @@ -2,6 +2,7 @@ Author: Clemens Ballarin, started 4 February 2003 Based on work by Florian Kammueller, L C Paulson and Markus Wenzel. +With additional contributions from Martin Baillon and Paulo Emílio de Vilhena. *) theory Group @@ -52,7 +53,7 @@ assumes m_closed [intro, simp]: "\x \ carrier G; y \ carrier G\ \ x \ y \ carrier G" and m_assoc: - "\x \ carrier G; y \ carrier G; z \ carrier G\ + "\x \ carrier G; y \ carrier G; z \ carrier G\ \ (x \ y) \ z = x \ (y \ z)" and one_closed [intro, simp]: "\ \ carrier G" and l_one [simp]: "x \ carrier G \ \ \ x = x" @@ -104,13 +105,7 @@ moreover from x y xinv yinv have "x \ (y \ y') \ x' = \" by simp moreover note x y ultimately show ?thesis unfolding Units_def - \ \Must avoid premature use of \hyp_subst_tac\.\ - apply (rule_tac CollectI) - apply (rule) - apply (fast) - apply (rule bexI [where x = "y' \ x'"]) - apply (auto simp: m_assoc) - done + by simp (metis m_assoc m_closed) qed lemma (in monoid) Units_one_closed [intro, simp]: @@ -146,6 +141,10 @@ apply (fast intro: inv_unique, fast) done +lemma (in monoid) inv_one [simp]: + "inv \ = \" + by (metis Units_one_closed Units_r_inv l_one monoid.Units_inv_closed monoid_axioms) + lemma (in monoid) Units_inv_Units [intro, simp]: "x \ Units G ==> inv x \ Units G" proof - @@ -223,12 +222,12 @@ lemma (in monoid) nat_pow_comm: "x \ carrier G \ (x [^] (n::nat)) \ (x [^] (m :: nat)) = (x [^] m) \ (x [^] n)" - using nat_pow_mult[of x n m] nat_pow_mult[of x m n] by (simp add: add.commute) + using nat_pow_mult[of x n m] nat_pow_mult[of x m n] by (simp add: add.commute) lemma (in monoid) nat_pow_Suc2: "x \ carrier G \ x [^] (Suc n) = x \ (x [^] n)" using nat_pow_mult[of x 1 n] Suc_eq_plus1[of n] - by (metis One_nat_def Suc_eq_plus1_left l_one nat.rec(1) nat_pow_Suc nat_pow_def) + by (metis One_nat_def Suc_eq_plus1_left l_one nat.rec(1) nat_pow_Suc nat_pow_def) lemma (in monoid) nat_pow_pow: "x \ carrier G ==> (x [^] n) [^] m = x [^] (n * m::nat)" @@ -237,7 +236,7 @@ lemma (in monoid) nat_pow_consistent: "x [^] (n :: nat) = x [^]\<^bsub>(G \ carrier := H \)\<^esub> n" unfolding nat_pow_def by simp - + (* Jacobson defines submonoid here. *) (* Jacobson defines the order of a monoid here. *) @@ -357,14 +356,6 @@ (y \ x = z \ x) = (y = z)" by (metis inv_closed m_assoc r_inv r_one) -lemma (in group) inv_one [simp]: - "inv \ = \" -proof - - have "inv \ = \ \ (inv \)" by (simp del: r_inv Units_r_inv) - moreover have "... = \" by simp - finally show ?thesis . -qed - lemma (in group) inv_inv [simp]: "x \ carrier G ==> inv (inv x) = x" using Units_inv_inv by simp @@ -449,7 +440,7 @@ using inv_mult_group[OF Suc.prems nat_pow_closed[OF Suc.prems, of i]] by simp also have " ... = inv (x [^] (Suc i))" using Suc.prems nat_pow_Suc2 by auto - finally show ?case . + finally show ?case . qed lemma (in group) int_pow_inv: @@ -578,6 +569,7 @@ "x \ H \ x \ carrier G" using subset by blast +(*DELETE*) lemma subgroup_imp_subset: "subgroup H G \ H \ carrier G" by (rule subgroup.subset) @@ -594,9 +586,9 @@ done qed -lemma (in group) m_inv_consistent: +lemma (in group) subgroup_inv_equality: assumes "subgroup H G" "x \ H" - shows "inv x = inv\<^bsub>(G \ carrier := H \)\<^esub> x" + shows "m_inv (G \carrier := H\) x = inv x" unfolding m_inv_def apply auto using subgroup.m_inv_closed[OF assms] inv_equality by (metis (no_types, hide_lams) assms subgroup.mem_carrier) @@ -613,14 +605,14 @@ also have " ... = x [^]\<^bsub>(G \ carrier := H \)\<^esub> n" using group.int_pow_def2[OF subgroup.subgroup_is_group[OF assms(1) is_group]] ge by auto finally show ?thesis . -next +next assume "\ n \ 0" hence lt: "n < 0" by simp hence "x [^] n = inv (x [^] (nat (- n)))" using int_pow_def2 by auto also have " ... = (inv x) [^] (nat (- n))" by (metis assms nat_pow_inv subgroup.mem_carrier) also have " ... = (inv\<^bsub>(G \ carrier := H \)\<^esub> x) [^]\<^bsub>(G \ carrier := H \)\<^esub> (nat (- n))" - using m_inv_consistent[OF assms] nat_pow_consistent by auto + using subgroup_inv_equality[OF assms] nat_pow_consistent by auto also have " ... = inv\<^bsub>(G \ carrier := H \)\<^esub> (x [^]\<^bsub>(G \ carrier := H \)\<^esub> (nat (- n)))" using group.nat_pow_inv[OF subgroup.subgroup_is_group[OF assms(1) is_group]] assms(2) by auto also have " ... = x [^]\<^bsub>(G \ carrier := H \)\<^esub> n" @@ -657,7 +649,7 @@ and "H \ {}" and "\a. a \ H \ inv a \ H" and "\a b. \a \ H; b \ H\ \ a \ b \ H" - using assms subgroup_imp_subset apply blast + using assms subgroup.subset apply blast using assms subgroup_def apply auto[1] by (simp add: assms subgroup.m_closed subgroup.m_inv_closed)+ @@ -691,12 +683,12 @@ lemma (in group) group_incl_imp_subgroup: assumes "H \ carrier G" -and "group (G\carrier := H\)" -shows "subgroup H G" + and "group (G\carrier := H\)" + shows "subgroup H G" proof (intro submonoid_subgroupI[OF monoid_incl_imp_submonoid[OF assms(1)]]) show "monoid (G\carrier := H\)" using group_def assms by blast have ab_eq : "\ a b. a \ H \ b \ H \ a \\<^bsub>G\carrier := H\\<^esub> b = a \ b" using assms by simp - fix a assume aH : "a \ H" + fix a assume aH : "a \ H" have " inv\<^bsub>G\carrier := H\\<^esub> a \ carrier G" using assms aH group.inv_closed[OF assms(2)] by auto moreover have "\\<^bsub>G\carrier := H\\<^esub> = \" using assms monoid.one_closed ab_eq one_def by simp @@ -710,10 +702,6 @@ ultimately show "inv a \ H" by auto qed -(* -lemma (in monoid) Units_subgroup: - "subgroup (Units G) G" -*) subsection \Direct Products\ @@ -731,7 +719,7 @@ interpret G: monoid G by fact interpret H: monoid H by fact from assms - show ?thesis by (unfold monoid_def DirProd_def, auto) + show ?thesis by (unfold monoid_def DirProd_def, auto) qed @@ -778,16 +766,16 @@ lemma DirProd_subgroups : assumes "group G" -and "subgroup H G" -and "group K" -and "subgroup I K" -shows "subgroup (H \ I) (G \\ K)" + and "subgroup H G" + and "group K" + and "subgroup I K" + shows "subgroup (H \ I) (G \\ K)" proof (intro group.group_incl_imp_subgroup[OF DirProd_group[OF assms(1)assms(3)]]) - have "H \ carrier G" "I \ carrier K" using subgroup_imp_subset assms apply blast+. + have "H \ carrier G" "I \ carrier K" using subgroup.subset assms apply blast+. thus "(H \ I) \ carrier (G \\ K)" unfolding DirProd_def by auto have "Group.group ((G\carrier := H\) \\ (K\carrier := I\))" using DirProd_group[OF subgroup.subgroup_is_group[OF assms(2)assms(1)] - subgroup.subgroup_is_group[OF assms(4)assms(3)]]. + subgroup.subgroup_is_group[OF assms(4)assms(3)]]. moreover have "((G\carrier := H\) \\ (K\carrier := I\)) = ((G \\ K)\carrier := H \ I\)" unfolding DirProd_def using assms apply simp. ultimately show "Group.group ((G \\ K)\carrier := H \ I\)" by simp @@ -806,12 +794,12 @@ by (fastforce simp add: hom_def compose_def) definition - iso :: "_ => _ => ('a => 'b) set" + iso :: "_ => _ => ('a => 'b) set" where "iso G H = {h. h \ hom G H \ bij_betw h (carrier G) (carrier H)}" definition is_iso :: "_ \ _ \ bool" (infixr "\" 60) - where "G \ H = (iso G H \ {})" + where "G \ H = (iso G H \ {})" lemma iso_set_refl: "(\x. x) \ iso G G" by (simp add: iso_def hom_def inj_on_def bij_betw_def Pi_def) @@ -821,9 +809,9 @@ lemma (in group) iso_set_sym: "h \ iso G H \ inv_into (carrier G) h \ (iso H G)" -apply (simp add: iso_def bij_betw_inv_into) -apply (subgoal_tac "inv_into (carrier G) h \ carrier H \ carrier G") - prefer 2 apply (simp add: bij_betw_imp_funcset [OF bij_betw_inv_into]) +apply (simp add: iso_def bij_betw_inv_into) +apply (subgoal_tac "inv_into (carrier G) h \ carrier H \ carrier G") + prefer 2 apply (simp add: bij_betw_imp_funcset [OF bij_betw_inv_into]) apply (simp add: hom_def bij_betw_def inv_into_f_eq f_inv_into_f Pi_def) done @@ -831,7 +819,7 @@ "G \ H \ H \ G" using iso_set_sym unfolding is_iso_def by auto -lemma (in group) iso_set_trans: +lemma (in group) iso_set_trans: "[|h \ iso G H; i \ iso H I|] ==> (compose (carrier G) i h) \ iso G I" by (auto simp add: iso_def hom_compose bij_betw_compose) @@ -839,7 +827,7 @@ "\G \ H ; H \ I\ \ G \ I" using iso_set_trans unfolding is_iso_def by blast -(* Next four lemmas contributed by Paulo Emílio de Vilhena. *) +(* Next four lemmas contributed by Paulo. *) lemma (in monoid) hom_imp_img_monoid: assumes "h \ hom G H" @@ -909,7 +897,7 @@ obtain \ where phi: "\ \ iso G H" "inv_into (carrier G) \ \ iso H G" using iso_set_sym assms unfolding is_iso_def by blast define \ where psi_def: "\ = inv_into (carrier G) \" - + from phi have surj: "\ ` (carrier G) = (carrier H)" "\ ` (carrier H) = (carrier G)" and inj: "inj_on \ (carrier G)" "inj_on \ (carrier H)" @@ -983,7 +971,7 @@ shows "(\(x,y,z). (x,(y,z))) \ iso (G \\ H \\ I) (G \\ (H \\ I))" by (auto simp add: iso_def hom_def inj_on_def bij_betw_def) -lemma (in group) DirProd_iso_set_trans: +lemma (in group) DirProd_iso_set_trans: assumes "g \ iso G G2" and "h \ iso H I" shows "(\(x,y). (g x, h y)) \ iso (G \\ H) (G2 \\ I)" @@ -1058,7 +1046,7 @@ "x \ carrier G \ (([^]) x) \ hom \ carrier = UNIV, mult = (+), one = 0::int \ G " unfolding hom_def by (simp add: int_pow_mult) -(* Next six lemmas contributed by Paulo Emílio de Vilhena. *) +(* Next six lemmas contributed by Paulo. *) lemma (in group_hom) img_is_subgroup: "subgroup (h ` (carrier G)) H" apply (rule subgroupI) @@ -1098,7 +1086,7 @@ shows "group_hom (G \ carrier := H \) G id" unfolding group_hom_def group_hom_axioms_def hom_def using subgroup.subgroup_is_group[OF assms is_group] - is_group subgroup_imp_subset[OF assms] by auto + is_group subgroup.subset[OF assms] by auto lemma (in group_hom) nat_pow_hom: "x \ carrier G \ h (x [^] (n :: nat)) = (h x) [^]\<^bsub>H\<^esub> n" @@ -1146,7 +1134,7 @@ "!!x y. [| x \ carrier G; y \ carrier G |] ==> x \ y = y \ x" shows "comm_monoid G" using l_one - by (auto intro!: comm_monoid.intro comm_monoid_axioms.intro monoid.intro + by (auto intro!: comm_monoid.intro comm_monoid_axioms.intro monoid.intro intro: assms simp: m_closed one_closed m_comm) lemma (in monoid) monoid_comm_monoidI: @@ -1220,7 +1208,7 @@ "[| x \ carrier G; y \ carrier G |] ==> inv (x \ y) = inv x \ inv y" by (simp add: m_ac inv_mult_group) -(* Next three lemmas contributed by Paulo Emílio de Vilhena. *) +(* Next three lemmas contributed by Paulo. *) lemma (in comm_monoid) hom_imp_img_comm_monoid: assumes "h \ hom G H" @@ -1280,6 +1268,32 @@ using comm_gr by simp qed +(*A subgroup of a subgroup is a subgroup of the group*) +lemma (in group) incl_subgroup: + assumes "subgroup J G" + and "subgroup I (G\carrier:=J\)" + shows "subgroup I G" unfolding subgroup_def +proof + have H1: "I \ carrier (G\carrier:=J\)" using assms(2) subgroup_imp_subset by blast + also have H2: "...\J" by simp + also have "...\(carrier G)" by (simp add: assms(1) subgroup_imp_subset) + finally have H: "I \ carrier G" by simp + have "(\x y. \x \ I ; y \ I\ \ x \ y \ I)" using assms(2) by (auto simp add: subgroup_def) + thus "I \ carrier G \ (\x y. x \ I \ y \ I \ x \ y \ I)" using H by blast + have K: "\ \ I" using assms(2) by (auto simp add: subgroup_def) + have "(\x. x \ I \ inv x \ I)" using assms subgroup.m_inv_closed H + by (metis H1 H2 subgroup_inv_equality subsetCE) + thus "\ \ I \ (\x. x \ I \ inv x \ I)" using K by blast +qed + +(*A subgroup included in another subgroup is a subgroup of the subgroup*) +lemma (in group) subgroup_incl: + assumes "subgroup I G" + and "subgroup J G" + and "I\J" + shows "subgroup I (G\carrier:=J\)"using assms subgroup_inv_equality + by (auto simp add: subgroup_def) + subsection \The Lattice of Subgroups of a Group\ @@ -1300,16 +1314,7 @@ lemma (in group) is_monoid [intro, simp]: "monoid G" - by (auto intro: monoid.intro m_assoc) - -lemma (in group) subgroup_inv_equality: - "[| subgroup H G; x \ H |] ==> m_inv (G \carrier := H\) x = inv x" -apply (rule_tac inv_equality [THEN sym]) - apply (rule group.l_inv [OF subgroup_imp_group, simplified], assumption+) - apply (rule subsetD [OF subgroup.subset], assumption+) -apply (rule subsetD [OF subgroup.subset], assumption) -apply (rule_tac group.inv_closed [OF subgroup_imp_group, simplified], assumption+) -done + by (auto intro: monoid.intro m_assoc) lemma (in group) subgroup_mult_equality: "\ subgroup H G; h1 \ H; h2 \ H \ \ h1 \\<^bsub>G \ carrier := H \\<^esub> h2 = h1 \ h2" @@ -1336,7 +1341,7 @@ qed lemma (in group) subgroups_Inter_pair : - assumes "subgroup I G" + assumes "subgroup I G" and "subgroup J G" shows "subgroup (I\J) G" using subgroups_Inter[ where ?A = "{I,J}"] assms by auto @@ -1378,4 +1383,90 @@ then show "\I. greatest ?L I (Lower ?L A)" .. qed +subsection\Jeremy Avigad's @{text"More_Group"} material\ + +text \ + Show that the units in any monoid give rise to a group. + + The file Residues.thy provides some infrastructure to use + facts about the unit group within the ring locale. +\ + +definition units_of :: "('a, 'b) monoid_scheme \ 'a monoid" + where "units_of G = + \carrier = Units G, Group.monoid.mult = Group.monoid.mult G, one = one G\" + +lemma (in monoid) units_group: "group (units_of G)" + apply (unfold units_of_def) + apply (rule groupI) + apply auto + apply (subst m_assoc) + apply auto + apply (rule_tac x = "inv x" in bexI) + apply auto + done + +lemma (in comm_monoid) units_comm_group: "comm_group (units_of G)" + apply (rule group.group_comm_groupI) + apply (rule units_group) + apply (insert comm_monoid_axioms) + apply (unfold units_of_def Units_def comm_monoid_def comm_monoid_axioms_def) + apply auto + done + +lemma units_of_carrier: "carrier (units_of G) = Units G" + by (auto simp: units_of_def) + +lemma units_of_mult: "mult (units_of G) = mult G" + by (auto simp: units_of_def) + +lemma units_of_one: "one (units_of G) = one G" + by (auto simp: units_of_def) + +lemma (in monoid) units_of_inv: "x \ Units G \ m_inv (units_of G) x = m_inv G x" + apply (rule sym) + apply (subst m_inv_def) + apply (rule the1_equality) + apply (rule ex_ex1I) + apply (subst (asm) Units_def) + apply auto + apply (erule inv_unique) + apply auto + apply (rule Units_closed) + apply (simp_all only: units_of_carrier [symmetric]) + apply (insert units_group) + apply auto + apply (subst units_of_mult [symmetric]) + apply (subst units_of_one [symmetric]) + apply (erule group.r_inv, assumption) + apply (subst units_of_mult [symmetric]) + apply (subst units_of_one [symmetric]) + apply (erule group.l_inv, assumption) + done + +lemma (in group) inj_on_const_mult: "a \ carrier G \ inj_on (\x. a \ x) (carrier G)" + unfolding inj_on_def by auto + +lemma (in group) surj_const_mult: "a \ carrier G \ (\x. a \ x) ` carrier G = carrier G" + apply (auto simp add: image_def) + apply (rule_tac x = "(m_inv G a) \ x" in bexI) + apply auto +(* auto should get this. I suppose we need "comm_monoid_simprules" + for ac_simps rewriting. *) + apply (subst m_assoc [symmetric]) + apply auto + done + +lemma (in group) l_cancel_one [simp]: "x \ carrier G \ a \ carrier G \ x \ a = x \ a = one G" + by (metis Units_eq Units_l_cancel monoid.r_one monoid_axioms one_closed) + +lemma (in group) r_cancel_one [simp]: "x \ carrier G \ a \ carrier G \ a \ x = x \ a = one G" + by (metis monoid.l_one monoid_axioms one_closed right_cancel) + +lemma (in group) l_cancel_one' [simp]: "x \ carrier G \ a \ carrier G \ x = x \ a \ a = one G" + using l_cancel_one by fastforce + +lemma (in group) r_cancel_one' [simp]: "x \ carrier G \ a \ carrier G \ x = a \ x \ a = one G" + using r_cancel_one by fastforce + end diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/Group_Action.thy --- a/src/HOL/Algebra/Group_Action.thy Tue Jun 12 16:09:12 2018 +0100 +++ b/src/HOL/Algebra/Group_Action.thy Thu Jun 14 14:23:38 2018 +0100 @@ -1,7 +1,5 @@ -(* ************************************************************************** *) (* Title: Group_Action.thy *) (* Author: Paulo Emílio de Vilhena *) -(* ************************************************************************** *) theory Group_Action imports Bij Coset Congruence @@ -313,7 +311,7 @@ text \In this subsection, we prove the Orbit-Stabilizer theorem. Our approach is to show the existence of a bijection between - "rcosets (stabilizer G \ x)" and "orbit G \ x". Then we use + "rcosets (stabilizer G phi x)" and "orbit G phi x". Then we use Lagrange's theorem to find the cardinal of the first set.\ subsubsection \Rcosets - Supporting Lemmas\ @@ -766,11 +764,11 @@ unfolding bij_betw_def proof show "inj_on ?\ {H. subgroup H G}" - using subgroup_conjugation_is_inj assms inj_on_def subgroup_imp_subset + using subgroup_conjugation_is_inj assms inj_on_def subgroup.subset by (metis (mono_tags, lifting) inj_on_restrict_eq mem_Collect_eq) next have "\H. H \ {H. subgroup H G} \ ?\ ((inv g) <# H #> g) = H" - by (simp add: assms subgroup_imp_subset subgroup_conjugation_is_surj0 + by (simp add: assms subgroup.subset subgroup_conjugation_is_surj0 subgroup_conjugation_is_surj1 is_group) hence "\H. H \ {H. subgroup H G} \ \H' \ {H. subgroup H G}. ?\ H' = H" using assms subgroup_conjugation_is_surj1 by fastforce @@ -800,11 +798,11 @@ by (simp add: H g2 subgroup_conjugation_is_surj2) also have " ... = g1 <# (g2 <# H) #> ((inv g2) \ (inv g1))" by (simp add: H coset_mult_assoc g1 g2 group.coset_assoc - is_group l_coset_subset_G subgroup_imp_subset) + is_group l_coset_subset_G subgroup.subset) also have " ... = g1 <# (g2 <# H) #> inv (g1 \ g2)" using g1 g2 by (simp add: inv_mult_group) finally have "(?\ g1) ((?\ g2) H) = ?\ (g1 \ g2) H" - by (simp add: H g1 g2 lcos_m_assoc subgroup_imp_subset) + by (simp add: H g1 g2 lcos_m_assoc subgroup.subset) thus "?\ (g1 \ g2) H = (?\ g1) ((?\ g2) H)" by auto qed hence "\ g1 g2. \ g1 \ carrier G; g2 \ carrier G \ \ diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/Ideal.thy --- a/src/HOL/Algebra/Ideal.thy Tue Jun 12 16:09:12 2018 +0100 +++ b/src/HOL/Algebra/Ideal.thy Thu Jun 14 14:23:38 2018 +0100 @@ -14,7 +14,7 @@ locale ideal = additive_subgroup I R + ring R for I and R (structure) + assumes I_l_closed: "\a \ I; x \ carrier R\ \ x \ a \ I" - and I_r_closed: "\a \ I; x \ carrier R\ \ a \ x \ I" + and I_r_closed: "\a \ I; x \ carrier R\ \ a \ x \ I" sublocale ideal \ abelian_subgroup I R apply (intro abelian_subgroupI3 abelian_group.intro) @@ -74,7 +74,7 @@ locale maximalideal = ideal + assumes I_notcarr: "carrier R \ I" - and I_maximal: "\ideal J R; I \ J; J \ carrier R\ \ J = I \ J = carrier R" + and I_maximal: "\ideal J R; I \ J; J \ carrier R\ \ (J = I) \ (J = carrier R)" lemma (in maximalideal) is_maximalideal: "maximalideal I R" by (rule maximalideal_axioms) @@ -83,7 +83,7 @@ fixes R assumes "ideal I R" and I_notcarr: "carrier R \ I" - and I_maximal: "\J. \ideal J R; I \ J; J \ carrier R\ \ J = I \ J = carrier R" + and I_maximal: "\J. \ideal J R; I \ J; J \ carrier R\ \ (J = I) \ (J = carrier R)" shows "maximalideal I R" proof - interpret ideal I R by fact @@ -143,26 +143,17 @@ subsection \Special Ideals\ lemma (in ring) zeroideal: "ideal {\} R" - apply (intro idealI subgroup.intro) - apply (rule is_ring) - apply simp+ - apply (fold a_inv_def, simp) - apply simp+ - done + by (intro idealI subgroup.intro) (simp_all add: is_ring) lemma (in ring) oneideal: "ideal (carrier R) R" by (rule idealI) (auto intro: is_ring add.subgroupI) lemma (in "domain") zeroprimeideal: "primeideal {\} R" - apply (intro primeidealI) - apply (rule zeroideal) - apply (rule domain.axioms, rule domain_axioms) - defer 1 - apply (simp add: integral) -proof (rule ccontr, simp) - assume "carrier R = {\}" - then have "\ = \" by (rule one_zeroI) - with one_not_zero show False by simp +proof - + have "carrier R \ {\}" + by (simp add: carrier_one_not_zero) + then show ?thesis + by (metis (no_types, lifting) domain_axioms domain_def integral primeidealI singleton_iff zeroideal) qed @@ -651,6 +642,46 @@ qed +(* Next lemma contributed by Paulo Emílio de Vilhena. *) + +text \This next lemma would be trivial if placed in a theory that imports QuotRing, + but it makes more sense to have it here (easier to find and coherent with the + previous developments).\ + +lemma (in cring) cgenideal_prod: + assumes "a \ carrier R" "b \ carrier R" + shows "(PIdl a) <#> (PIdl b) = PIdl (a \ b)" +proof - + have "(carrier R #> a) <#> (carrier R #> b) = carrier R #> (a \ b)" + proof + show "(carrier R #> a) <#> (carrier R #> b) \ carrier R #> a \ b" + proof + fix x assume "x \ (carrier R #> a) <#> (carrier R #> b)" + then obtain r1 r2 where r1: "r1 \ carrier R" and r2: "r2 \ carrier R" + and "x = (r1 \ a) \ (r2 \ b)" + unfolding set_mult_def r_coset_def by blast + hence "x = (r1 \ r2) \ (a \ b)" + by (simp add: assms local.ring_axioms m_lcomm ring.ring_simprules(11)) + thus "x \ carrier R #> a \ b" + unfolding r_coset_def using r1 r2 assms by blast + qed + next + show "carrier R #> a \ b \ (carrier R #> a) <#> (carrier R #> b)" + proof + fix x assume "x \ carrier R #> a \ b" + then obtain r where r: "r \ carrier R" "x = r \ (a \ b)" + unfolding r_coset_def by blast + hence "x = (r \ a) \ (\ \ b)" + using assms by (simp add: m_assoc) + thus "x \ (carrier R #> a) <#> (carrier R #> b)" + unfolding set_mult_def r_coset_def using assms r by blast + qed + qed + thus ?thesis + using cgenideal_eq_rcos[of a] cgenideal_eq_rcos[of b] cgenideal_eq_rcos[of "a \ b"] by simp +qed + + subsection \Prime Ideals\ lemma (in ideal) primeidealCD: @@ -918,7 +949,7 @@ qed qed (simp add: zeroideal oneideal) -\ \Jacobson Theorem 2.2\ +\\"Jacobson Theorem 2.2"\ lemma (in cring) trivialideals_eq_field: assumes carrnzero: "carrier R \ {\}" shows "({I. ideal I R} = {{\}, carrier R}) = field R" diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/More_Finite_Product.thy --- a/src/HOL/Algebra/More_Finite_Product.thy Tue Jun 12 16:09:12 2018 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -(* Title: HOL/Algebra/More_Finite_Product.thy - Author: Jeremy Avigad -*) - -section \More on finite products\ - -theory More_Finite_Product - imports More_Group -begin - -lemma (in comm_monoid) finprod_UN_disjoint: - "finite I \ (\i\I. finite (A i)) \ (\i\I. \j\I. i \ j \ A i \ A j = {}) \ - (\i\I. \x \ A i. g x \ carrier G) \ - finprod G g (UNION I A) = finprod G (\i. finprod G g (A i)) I" - apply (induct set: finite) - apply force - apply clarsimp - apply (subst finprod_Un_disjoint) - apply blast - apply (erule finite_UN_I) - apply blast - apply (fastforce) - apply (auto intro!: funcsetI finprod_closed) - done - -lemma (in comm_monoid) finprod_Union_disjoint: - "finite C \ - \A\C. finite A \ (\x\A. f x \ carrier G) \ - \A\C. \B\C. A \ B \ A \ B = {} \ - finprod G f (\C) = finprod G (finprod G f) C" - apply (frule finprod_UN_disjoint [of C id f]) - apply auto - done - -lemma (in comm_monoid) finprod_one: "finite A \ (\x. x \ A \ f x = \) \ finprod G f A = \" - by (induct set: finite) auto - - -(* need better simplification rules for rings *) -(* the next one holds more generally for abelian groups *) - -lemma (in cring) sum_zero_eq_neg: "x \ carrier R \ y \ carrier R \ x \ y = \ \ x = \ y" - by (metis minus_equality) - -lemma (in domain) square_eq_one: - fixes x - assumes [simp]: "x \ carrier R" - and "x \ x = \" - shows "x = \ \ x = \\" -proof - - have "(x \ \) \ (x \ \ \) = x \ x \ \ \" - by (simp add: ring_simprules) - also from \x \ x = \\ have "\ = \" - by (simp add: ring_simprules) - finally have "(x \ \) \ (x \ \ \) = \" . - then have "(x \ \) = \ \ (x \ \ \) = \" - by (intro integral) auto - then show ?thesis - apply auto - apply (erule notE) - apply (rule sum_zero_eq_neg) - apply auto - apply (subgoal_tac "x = \ (\ \)") - apply (simp add: ring_simprules) - apply (rule sum_zero_eq_neg) - apply auto - done -qed - -lemma (in domain) inv_eq_self: "x \ Units R \ x = inv x \ x = \ \ x = \\" - by (metis Units_closed Units_l_inv square_eq_one) - - -text \ - The following translates theorems about groups to the facts about - the units of a ring. (The list should be expanded as more things are - needed.) -\ - -lemma (in ring) finite_ring_finite_units [intro]: "finite (carrier R) \ finite (Units R)" - by (rule finite_subset) auto - -lemma (in monoid) units_of_pow: - fixes n :: nat - shows "x \ Units G \ x [^]\<^bsub>units_of G\<^esub> n = x [^]\<^bsub>G\<^esub> n" - apply (induct n) - apply (auto simp add: units_group group.is_monoid - monoid.nat_pow_0 monoid.nat_pow_Suc units_of_one units_of_mult) - done - -lemma (in cring) units_power_order_eq_one: - "finite (Units R) \ a \ Units R \ a [^] card(Units R) = \" - apply (subst units_of_carrier [symmetric]) - apply (subst units_of_one [symmetric]) - apply (subst units_of_pow [symmetric]) - apply assumption - apply (rule comm_group.power_order_eq_one) - apply (rule units_comm_group) - apply (unfold units_of_def, auto) - done - -end diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/More_Group.thy --- a/src/HOL/Algebra/More_Group.thy Tue Jun 12 16:09:12 2018 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -(* Title: HOL/Algebra/More_Group.thy - Author: Jeremy Avigad -*) - -section \More on groups\ - -theory More_Group - imports Ring -begin - -text \ - Show that the units in any monoid give rise to a group. - - The file Residues.thy provides some infrastructure to use - facts about the unit group within the ring locale. -\ - -definition units_of :: "('a, 'b) monoid_scheme \ 'a monoid" - where "units_of G = - \carrier = Units G, Group.monoid.mult = Group.monoid.mult G, one = one G\" - -lemma (in monoid) units_group: "group (units_of G)" - apply (unfold units_of_def) - apply (rule groupI) - apply auto - apply (subst m_assoc) - apply auto - apply (rule_tac x = "inv x" in bexI) - apply auto - done - -lemma (in comm_monoid) units_comm_group: "comm_group (units_of G)" - apply (rule group.group_comm_groupI) - apply (rule units_group) - apply (insert comm_monoid_axioms) - apply (unfold units_of_def Units_def comm_monoid_def comm_monoid_axioms_def) - apply auto - done - -lemma units_of_carrier: "carrier (units_of G) = Units G" - by (auto simp: units_of_def) - -lemma units_of_mult: "mult (units_of G) = mult G" - by (auto simp: units_of_def) - -lemma units_of_one: "one (units_of G) = one G" - by (auto simp: units_of_def) - -lemma (in monoid) units_of_inv: "x \ Units G \ m_inv (units_of G) x = m_inv G x" - apply (rule sym) - apply (subst m_inv_def) - apply (rule the1_equality) - apply (rule ex_ex1I) - apply (subst (asm) Units_def) - apply auto - apply (erule inv_unique) - apply auto - apply (rule Units_closed) - apply (simp_all only: units_of_carrier [symmetric]) - apply (insert units_group) - apply auto - apply (subst units_of_mult [symmetric]) - apply (subst units_of_one [symmetric]) - apply (erule group.r_inv, assumption) - apply (subst units_of_mult [symmetric]) - apply (subst units_of_one [symmetric]) - apply (erule group.l_inv, assumption) - done - -lemma (in group) inj_on_const_mult: "a \ carrier G \ inj_on (\x. a \ x) (carrier G)" - unfolding inj_on_def by auto - -lemma (in group) surj_const_mult: "a \ carrier G \ (\x. a \ x) ` carrier G = carrier G" - apply (auto simp add: image_def) - apply (rule_tac x = "(m_inv G a) \ x" in bexI) - apply auto -(* auto should get this. I suppose we need "comm_monoid_simprules" - for ac_simps rewriting. *) - apply (subst m_assoc [symmetric]) - apply auto - done - -lemma (in group) l_cancel_one [simp]: "x \ carrier G \ a \ carrier G \ x \ a = x \ a = one G" - by (metis Units_eq Units_l_cancel monoid.r_one monoid_axioms one_closed) - -lemma (in group) r_cancel_one [simp]: "x \ carrier G \ a \ carrier G \ a \ x = x \ a = one G" - by (metis monoid.l_one monoid_axioms one_closed right_cancel) - -lemma (in group) l_cancel_one' [simp]: "x \ carrier G \ a \ carrier G \ x = x \ a \ a = one G" - using l_cancel_one by fastforce - -lemma (in group) r_cancel_one' [simp]: "x \ carrier G \ a \ carrier G \ x = a \ x \ a = one G" - using r_cancel_one by fastforce - -(* This should be generalized to arbitrary groups, not just commutative - ones, using Lagrange's theorem. *) - -lemma (in comm_group) power_order_eq_one: - assumes fin [simp]: "finite (carrier G)" - and a [simp]: "a \ carrier G" - shows "a [^] card(carrier G) = one G" -proof - - have "(\x\carrier G. x) = (\x\carrier G. a \ x)" - by (subst (2) finprod_reindex [symmetric], - auto simp add: Pi_def inj_on_const_mult surj_const_mult) - also have "\ = (\x\carrier G. a) \ (\x\carrier G. x)" - by (auto simp add: finprod_multf Pi_def) - also have "(\x\carrier G. a) = a [^] card(carrier G)" - by (auto simp add: finprod_const) - finally show ?thesis -(* uses the preceeding lemma *) - by auto -qed - -end diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/More_Ring.thy --- a/src/HOL/Algebra/More_Ring.thy Tue Jun 12 16:09:12 2018 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -(* Title: HOL/Algebra/More_Ring.thy - Author: Jeremy Avigad -*) - -section \More on rings etc.\ - -theory More_Ring - imports Ring -begin - -lemma (in cring) field_intro2: "\\<^bsub>R\<^esub> \ \\<^bsub>R\<^esub> \ \x \ carrier R - {\\<^bsub>R\<^esub>}. x \ Units R \ field R" - apply (unfold_locales) - apply (use cring_axioms in auto) - apply (rule trans) - apply (subgoal_tac "a = (a \ b) \ inv b") - apply assumption - apply (subst m_assoc) - apply auto - apply (unfold Units_def) - apply auto - done - -lemma (in monoid) inv_char: - "x \ carrier G \ y \ carrier G \ x \ y = \ \ y \ x = \ \ inv x = y" - apply (subgoal_tac "x \ Units G") - apply (subgoal_tac "y = inv x \ \") - apply simp - apply (erule subst) - apply (subst m_assoc [symmetric]) - apply auto - apply (unfold Units_def) - apply auto - done - -lemma (in comm_monoid) comm_inv_char: "x \ carrier G \ y \ carrier G \ x \ y = \ \ inv x = y" - apply (rule inv_char) - apply auto - apply (subst m_comm, auto) - done - -lemma (in ring) inv_neg_one [simp]: "inv (\ \) = \ \" - apply (rule inv_char) - apply (auto simp add: l_minus r_minus) - done - -lemma (in monoid) inv_eq_imp_eq: "x \ Units G \ y \ Units G \ inv x = inv y \ x = y" - apply (subgoal_tac "inv (inv x) = inv (inv y)") - apply (subst (asm) Units_inv_inv)+ - apply auto - done - -lemma (in ring) Units_minus_one_closed [intro]: "\ \ \ Units R" - apply (unfold Units_def) - apply auto - apply (rule_tac x = "\ \" in bexI) - apply auto - apply (simp add: l_minus r_minus) - done - -lemma (in monoid) inv_one [simp]: "inv \ = \" - apply (rule inv_char) - apply auto - done - -lemma (in ring) inv_eq_neg_one_eq: "x \ Units R \ inv x = \ \ \ x = \ \" - apply auto - apply (subst Units_inv_inv [symmetric]) - apply auto - done - -lemma (in monoid) inv_eq_one_eq: "x \ Units G \ inv x = \ \ x = \" - by (metis Units_inv_inv inv_one) - -end diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/Multiplicative_Group.thy --- a/src/HOL/Algebra/Multiplicative_Group.thy Tue Jun 12 16:09:12 2018 +0100 +++ b/src/HOL/Algebra/Multiplicative_Group.thy Thu Jun 14 14:23:38 2018 +0100 @@ -7,8 +7,6 @@ imports Complex_Main Group - More_Group - More_Finite_Product Coset UnivPoly begin diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/Ring.thy --- a/src/HOL/Algebra/Ring.thy Tue Jun 12 16:09:12 2018 +0100 +++ b/src/HOL/Algebra/Ring.thy Thu Jun 14 14:23:38 2018 +0100 @@ -25,10 +25,9 @@ a_inv :: "[('a, 'm) ring_scheme, 'a ] \ 'a" ("\\ _" [81] 80) where "a_inv R = m_inv (add_monoid R)" - definition a_minus :: "[('a, 'm) ring_scheme, 'a, 'a] => 'a" ("(_ \\ _)" [65,66] 65) - where "\ x \ carrier R; y \ carrier R \ \ x \\<^bsub>R\<^esub> y = x \\<^bsub>R\<^esub> (\\<^bsub>R\<^esub> y)" + where "x \\<^bsub>R\<^esub> y = x \\<^bsub>R\<^esub> (\\<^bsub>R\<^esub> y)" definition add_pow :: "[_, ('b :: semiring_1), 'a] \ 'a" ("[_] \\ _" [81, 81] 80) @@ -212,7 +211,6 @@ lemmas l_neg = add.l_inv [simp del] lemmas r_neg = add.r_inv [simp del] -lemmas minus_zero = add.inv_one lemmas minus_minus = add.inv_inv lemmas a_inv_inj = add.inv_inj lemmas minus_equality = add.inv_equality @@ -344,6 +342,8 @@ lemma (in cring) is_cring: "cring R" by (rule cring_axioms) +lemma (in ring) minus_zero [simp]: "\ \ = \" + by (simp add: a_inv_def) subsubsection \Normaliser for Rings\ @@ -416,9 +416,8 @@ end -lemma (in abelian_group) minus_eq: - "\ x \ carrier G; y \ carrier G \ \ x \ y = x \ (\ y)" - by (simp only: a_minus_def) +lemma (in abelian_group) minus_eq: "x \ y = x \ (\ y)" + by (rule a_minus_def) text \Setup algebra method: compute distributive normal form in locale contexts\ @@ -602,7 +601,6 @@ using add_pow_int_lt[of k R b] add_pow_int_lt[of k R "a \ b"] add_pow_rdistr[OF assms, of "nat (- k)"] assms r_minus by auto qed -(* ************************************************************************** *) subsection \Integral Domains\ @@ -631,7 +629,7 @@ with R have "a \ (b \ c) = \" by algebra with R have "a = \ \ (b \ c) = \" by (simp add: integral_iff) with prem and R have "b \ c = \" by auto - with R have "b = b \ (b \ c)" by algebra + with R have "b = b \ (b \ c)" by algebra also from R have "b \ (b \ c) = c" by algebra finally show "b = c" . next @@ -805,4 +803,111 @@ "\ f \ ring_hom R S; g \ ring_hom S T \ \ g \ f \ ring_hom R T" by (rule ring_hom_memI) (auto simp add: ring_hom_closed ring_hom_mult ring_hom_add ring_hom_one) +subsection\Jeremy Avigad's @{text"More_Finite_Product"} material\ + +(* need better simplification rules for rings *) +(* the next one holds more generally for abelian groups *) + +lemma (in cring) sum_zero_eq_neg: "x \ carrier R \ y \ carrier R \ x \ y = \ \ x = \ y" + by (metis minus_equality) + +lemma (in domain) square_eq_one: + fixes x + assumes [simp]: "x \ carrier R" + and "x \ x = \" + shows "x = \ \ x = \\" +proof - + have "(x \ \) \ (x \ \ \) = x \ x \ \ \" + by (simp add: ring_simprules) + also from \x \ x = \\ have "\ = \" + by (simp add: ring_simprules) + finally have "(x \ \) \ (x \ \ \) = \" . + then have "(x \ \) = \ \ (x \ \ \) = \" + by (intro integral) auto + then show ?thesis + by (metis add.inv_closed add.inv_solve_right assms(1) l_zero one_closed zero_closed) +qed + +lemma (in domain) inv_eq_self: "x \ Units R \ x = inv x \ x = \ \ x = \\" + by (metis Units_closed Units_l_inv square_eq_one) + + +text \ + The following translates theorems about groups to the facts about + the units of a ring. (The list should be expanded as more things are + needed.) +\ + +lemma (in ring) finite_ring_finite_units [intro]: "finite (carrier R) \ finite (Units R)" + by (rule finite_subset) auto + +lemma (in monoid) units_of_pow: + fixes n :: nat + shows "x \ Units G \ x [^]\<^bsub>units_of G\<^esub> n = x [^]\<^bsub>G\<^esub> n" + apply (induct n) + apply (auto simp add: units_group group.is_monoid + monoid.nat_pow_0 monoid.nat_pow_Suc units_of_one units_of_mult) + done + +lemma (in cring) units_power_order_eq_one: + "finite (Units R) \ a \ Units R \ a [^] card(Units R) = \" + by (metis comm_group.power_order_eq_one units_comm_group units_of_carrier units_of_one units_of_pow) + +subsection\Jeremy Avigad's @{text"More_Ring"} material\ + +lemma (in cring) field_intro2: "\\<^bsub>R\<^esub> \ \\<^bsub>R\<^esub> \ \x \ carrier R - {\\<^bsub>R\<^esub>}. x \ Units R \ field R" + apply (unfold_locales) + apply (use cring_axioms in auto) + apply (rule trans) + apply (subgoal_tac "a = (a \ b) \ inv b") + apply assumption + apply (subst m_assoc) + apply auto + apply (unfold Units_def) + apply auto + done + +lemma (in monoid) inv_char: + "x \ carrier G \ y \ carrier G \ x \ y = \ \ y \ x = \ \ inv x = y" + apply (subgoal_tac "x \ Units G") + apply (subgoal_tac "y = inv x \ \") + apply simp + apply (erule subst) + apply (subst m_assoc [symmetric]) + apply auto + apply (unfold Units_def) + apply auto + done + +lemma (in comm_monoid) comm_inv_char: "x \ carrier G \ y \ carrier G \ x \ y = \ \ inv x = y" + by (simp add: inv_char m_comm) + +lemma (in ring) inv_neg_one [simp]: "inv (\ \) = \ \" + apply (rule inv_char) + apply (auto simp add: l_minus r_minus) + done + +lemma (in monoid) inv_eq_imp_eq: "x \ Units G \ y \ Units G \ inv x = inv y \ x = y" + apply (subgoal_tac "inv (inv x) = inv (inv y)") + apply (subst (asm) Units_inv_inv)+ + apply auto + done + +lemma (in ring) Units_minus_one_closed [intro]: "\ \ \ Units R" + apply (unfold Units_def) + apply auto + apply (rule_tac x = "\ \" in bexI) + apply auto + apply (simp add: l_minus r_minus) + done + +lemma (in ring) inv_eq_neg_one_eq: "x \ Units R \ inv x = \ \ \ x = \ \" + apply auto + apply (subst Units_inv_inv [symmetric]) + apply auto + done + +lemma (in monoid) inv_eq_one_eq: "x \ Units G \ inv x = \ \ x = \" + by (metis Units_inv_inv inv_one) + end diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/Sylow.thy --- a/src/HOL/Algebra/Sylow.thy Tue Jun 12 16:09:12 2018 +0100 +++ b/src/HOL/Algebra/Sylow.thy Thu Jun 14 14:23:38 2018 +0100 @@ -223,7 +223,7 @@ lemma M_funcset_rcosets_H: "(\x\M. H #> (SOME g. g \ carrier G \ M1 #> g = x)) \ M \ rcosets H" - by (metis (lifting) H_is_subgroup M_elem_map_carrier rcosetsI restrictI subgroup_imp_subset) + by (metis (lifting) H_is_subgroup M_elem_map_carrier rcosetsI restrictI subgroup.subset) lemma inj_M_GmodH: "\f \ M \ rcosets H. inj_on f M" apply (rule bexI) diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/UnivPoly.thy --- a/src/HOL/Algebra/UnivPoly.thy Tue Jun 12 16:09:12 2018 +0100 +++ b/src/HOL/Algebra/UnivPoly.thy Thu Jun 14 14:23:38 2018 +0100 @@ -116,14 +116,15 @@ proof assume R: "p \ up R" then obtain n where "bound \ n p" by auto - then have "bound \ n (\i. \ p i)" by auto + then have "bound \ n (\i. \ p i)" + by (simp add: bound_def minus_equality) then show "\n. bound \ n (\i. \ p i)" by auto qed auto lemma up_minus_closed: "[| p \ up R; q \ up R |] ==> (\i. p i \ q i) \ up R" - using mem_upD [of p R] mem_upD [of q R] up_add_closed up_a_inv_closed a_minus_def [of _ R] - by auto + unfolding a_minus_def + using mem_upD [of p R] mem_upD [of q R] up_add_closed up_a_inv_closed by auto lemma up_mult_closed: "[| p \ up R; q \ up R |] ==> @@ -695,7 +696,7 @@ lemma monom_a_inv [simp]: "a \ carrier R ==> monom P (\ a) n = \\<^bsub>P\<^esub> monom P a n" - by (rule up_eqI) simp_all + by (rule up_eqI) auto lemma monom_inj: "inj_on (\a. monom P a n) (carrier R)" @@ -1462,9 +1463,9 @@ subsection\The long division algorithm: some previous facts.\ lemma coeff_minus [simp]: - assumes p: "p \ carrier P" and q: "q \ carrier P" shows "coeff P (p \\<^bsub>P\<^esub> q) n = coeff P p n \ coeff P q n" - unfolding a_minus_def [OF p q] unfolding coeff_add [OF p a_inv_closed [OF q]] unfolding coeff_a_inv [OF q] - using coeff_closed [OF p, of n] using coeff_closed [OF q, of n] by algebra + assumes p: "p \ carrier P" and q: "q \ carrier P" + shows "coeff P (p \\<^bsub>P\<^esub> q) n = coeff P p n \ coeff P q n" + by (simp add: a_minus_def p q) lemma lcoeff_closed [simp]: assumes p: "p \ carrier P" shows "lcoeff p \ carrier R" using coeff_closed [OF p, of "deg R p"] by simp @@ -1719,10 +1720,7 @@ and min_mon0_closed: "\\<^bsub>P\<^esub> monom P a 0 \ carrier P" using a R.a_inv_closed by auto have "eval R R id a ?g = eval R R id a (monom P \ 1) \ eval R R id a (monom P a 0)" - unfolding P.minus_eq [OF mon1_closed mon0_closed] - unfolding hom_add [OF mon1_closed min_mon0_closed] - unfolding hom_a_inv [OF mon0_closed] - using R.minus_eq [symmetric] mon1_closed mon0_closed by auto + by (simp add: a_minus_def mon0_closed) also have "\ = a \ a" using eval_monom [OF R.one_closed a, of 1] using eval_monom [OF a a, of 0] using a by simp also have "\ = \" diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/Algebra/Zassenhaus.thy --- a/src/HOL/Algebra/Zassenhaus.thy Tue Jun 12 16:09:12 2018 +0100 +++ b/src/HOL/Algebra/Zassenhaus.thy Thu Jun 14 14:23:38 2018 +0100 @@ -2,220 +2,8 @@ imports Coset Group_Action begin -subsection "fundamental lemmas" - -text "Lemmas about subgroups" - - -(*A subgroup included in another subgroup is a subgroup of the subgroup*) -lemma (in group) subgroup_incl : - assumes "subgroup I G" - and "subgroup J G" - and "I\J" - shows "subgroup I (G\carrier:=J\)"using assms subgroup_inv_equality - by (auto simp add: subgroup_def) - -(*A subgroup of a subgroup is a subgroup of the group*) -lemma (in group) incl_subgroup : - assumes "subgroup J G" - and "subgroup I (G\carrier:=J\)" - shows "subgroup I G" unfolding subgroup_def -proof - have H1: "I \ carrier (G\carrier:=J\)" using assms(2) subgroup_imp_subset by blast - also have H2: "...\J" by simp - also have "...\(carrier G)" by (simp add: assms(1) subgroup_imp_subset) - finally have H: "I \ carrier G" by simp - have "(\x y. \x \ I ; y \ I\ \ x \ y \ I)" using assms(2) by (auto simp add: subgroup_def) - thus "I \ carrier G \ (\x y. x \ I \ y \ I \ x \ y \ I)" using H by blast - have K: "\ \ I" using assms(2) by (auto simp add: subgroup_def) - have "(\x. x \ I \ inv x \ I)" using assms subgroup.m_inv_closed H - by (metis H1 H2 subgroup_inv_equality subsetCE) - thus "\ \ I \ (\x. x \ I \ inv x \ I)" using K by blast -qed - - -text "Lemmas about set_mult" - - -lemma (in group) set_mult_same_law : - assumes "subgroup H G" -and "K1 \ H" -and "K2 \ H" -shows "K1<#>\<^bsub>(G\carrier:=H\)\<^esub>K2 = K1<#>K2" -proof - show "K1 <#>\<^bsub>G\carrier := H\\<^esub> K2 \ K1 <#> K2" - proof - fix h assume Hyph : "h\K1<#>\<^bsub>G\carrier := H\\<^esub>K2" - then obtain k1 k2 where Hyp : "k1\K1 \ k2\K2 \ k1\\<^bsub>G\carrier := H\\<^esub>k2 = h" - unfolding set_mult_def by blast - hence "k1\H" using assms by blast - moreover have "k2\H" using Hyp assms by blast - ultimately have EGAL : "k1 \\<^bsub>G\carrier := H\\<^esub> k2 = k1 \\<^bsub>G\<^esub> k2" by simp - have "k1 \\<^bsub>G\<^esub> k2 \ K1<#>K2" unfolding set_mult_def using Hyp by blast - hence "k1 \\<^bsub>G\carrier := H\\<^esub> k2 \ K1<#>K2" using EGAL by auto - thus "h \ K1<#>K2 " using Hyp by blast - qed - show "K1 <#> K2 \ K1 <#>\<^bsub>G\carrier := H\\<^esub> K2" - proof - fix h assume Hyph : "h\K1<#>K2" - then obtain k1 k2 where Hyp : "k1\K1 \ k2\K2 \ k1\k2 = h" unfolding set_mult_def by blast - hence k1H: "k1\H" using assms by blast - have k2H: "k2\H" using Hyp assms by blast - have EGAL : "k1 \\<^bsub>G\carrier := H\\<^esub> k2 = k1 \\<^bsub>G\<^esub> k2" using k1H k2H by simp - have "k1 \\<^bsub>G\carrier := H\\<^esub> k2 \ K1<#>\<^bsub>G\carrier := H\\<^esub>K2" unfolding set_mult_def using Hyp by blast - hence "k1 \ k2 \ K1<#>\<^bsub>G\carrier := H\\<^esub>K2" using EGAL by auto - thus "h \ K1<#>\<^bsub>G\carrier := H\\<^esub>K2 " using Hyp by blast - qed -qed - - -(*A group multiplied by a subgroup stays the same*) -lemma (in group) set_mult_carrier_idem : - assumes "subgroup H G" - shows "(carrier G)<#>H = carrier G" -proof - show "(carrier G)<#>H \ carrier G" unfolding set_mult_def using subgroup_imp_subset assms by blast -next - have " (carrier G) #> \ = carrier G" unfolding set_mult_def r_coset_def group_axioms by simp - moreover have "(carrier G) #> \ \ (carrier G) <#> H" unfolding set_mult_def r_coset_def - using assms subgroup.one_closed[OF assms] by blast - ultimately show "carrier G \ (carrier G) <#> H" by simp -qed - -(*Same lemma as above, but everything is included in a subgroup*) -lemma (in group) set_mult_subgroup_idem : - assumes "subgroup H G" - and "subgroup N (G\carrier:=H\)" - shows "H<#>N = H" - using group.set_mult_carrier_idem[OF subgroup_imp_group] subgroup_imp_subset assms - by (metis monoid.cases_scheme order_refl partial_object.simps(1) - partial_object.update_convs(1) set_mult_same_law) - -(*A normal subgroup is commutative with set_mult*) -lemma (in group) commut_normal : - assumes "subgroup H G" - and "N\G" - shows "H<#>N = N<#>H" -proof- - have aux1 : "{H <#> N} = {\h\H. h <# N }" unfolding set_mult_def l_coset_def by auto - also have "... = {\h\H. N #> h }" using assms normal.coset_eq subgroup.mem_carrier by fastforce - moreover have aux2 : "{N <#> H} = {\h\H. N #> h }"unfolding set_mult_def r_coset_def by auto - ultimately show "H<#>N = N<#>H" by simp -qed - -(*Same lemma as above, but everything is included in a subgroup*) -lemma (in group) commut_normal_subgroup : - assumes "subgroup H G" - and "N\(G\carrier:=H\)" - and "subgroup K (G\carrier:=H\)" - shows "K<#>N = N<#>K" -proof- - have "N \ carrier (G\carrier := H\)" using assms normal_imp_subgroup subgroup_imp_subset by blast - hence NH : "N \ H" by simp - have "K \ carrier(G\carrier := H\)" using subgroup_imp_subset assms by blast - hence KH : "K \ H" by simp - have Egal : "K <#>\<^bsub>G\carrier := H\\<^esub> N = N <#>\<^bsub>G\carrier := H\\<^esub> K" - using group.commut_normal[where ?G = "G\carrier :=H\", of K N,OF subgroup_imp_group[OF assms(1)] - assms(3) assms(2)] by auto - also have "... = N <#> K" using set_mult_same_law[of H N K, OF assms(1) NH KH] by auto - moreover have "K <#>\<^bsub>G\carrier := H\\<^esub> N = K <#> N" - using set_mult_same_law[of H K N, OF assms(1) KH NH] by auto - ultimately show "K<#>N = N<#>K" by auto -qed - - - -text "Lemmas about intersection and normal subgroups" - - - -lemma (in group) normal_inter: - assumes "subgroup H G" - and "subgroup K G" - and "H1\G\carrier := H\" - shows " (H1\K)\(G\carrier:= (H\K)\)" -proof- - define HK and H1K and GH and GHK - where "HK = H\K" and "H1K=H1\K" and "GH =G\carrier := H\" and "GHK = (G\carrier:= (H\K)\)" - show "H1K\GHK" - proof (intro group.normal_invI[of GHK H1K]) - show "Group.group GHK" - using GHK_def subgroups_Inter_pair subgroup_imp_group assms by blast - - next - have H1K_incl:"subgroup H1K (G\carrier:= (H\K)\)" - proof(intro subgroup_incl) - show "subgroup H1K G" - using assms normal_imp_subgroup subgroups_Inter_pair incl_subgroup H1K_def by blast - next - show "subgroup (H\K) G" using HK_def subgroups_Inter_pair assms by auto - next - have "H1 \ (carrier (G\carrier:=H\))" - using assms(3) normal_imp_subgroup subgroup_imp_subset by blast - also have "... \ H" by simp - thus "H1K \H\K" - using H1K_def calculation by auto - qed - thus "subgroup H1K GHK" using GHK_def by simp - - next - show "\ x h. x\carrier GHK \ h\H1K \ x \\<^bsub>GHK\<^esub> h \\<^bsub>GHK\<^esub> inv\<^bsub>GHK\<^esub> x\ H1K" - proof- - have invHK: "\y\HK\ \ inv\<^bsub>GHK\<^esub> y = inv\<^bsub>GH\<^esub> y" - using subgroup_inv_equality assms HK_def GH_def GHK_def subgroups_Inter_pair by simp - have multHK : "\x\HK;y\HK\ \ x \\<^bsub>(G\carrier:=HK\)\<^esub> y = x \ y" - using HK_def by simp - fix x assume p: "x\carrier GHK" - fix h assume p2 : "h:H1K" - have "carrier(GHK)\HK" - using GHK_def HK_def by simp - hence xHK:"x\HK" using p by auto - hence invx:"inv\<^bsub>GHK\<^esub> x = inv\<^bsub>GH\<^esub> x" - using invHK assms GHK_def HK_def GH_def subgroup_inv_equality subgroups_Inter_pair by simp - have "H1\carrier(GH)" - using assms GH_def normal_imp_subgroup subgroup_imp_subset by blast - hence hHK:"h\HK" - using p2 H1K_def HK_def GH_def by auto - hence xhx_egal : "x \\<^bsub>GHK\<^esub> h \\<^bsub>GHK\<^esub> inv\<^bsub>GHK\<^esub>x = x \\<^bsub>GH\<^esub> h \\<^bsub>GH\<^esub> inv\<^bsub>GH\<^esub> x" - using invx invHK multHK GHK_def GH_def by auto - have xH:"x\carrier(GH)" - using xHK HK_def GH_def by auto - have hH:"h\carrier(GH)" - using hHK HK_def GH_def by auto - have "(\x\carrier (GH). \h\H1. x \\<^bsub>GH\<^esub> h \\<^bsub>GH\<^esub> inv\<^bsub>GH\<^esub> x \ H1)" - using assms normal_invE GH_def normal.inv_op_closed2 by fastforce - hence INCL_1 : "x \\<^bsub>GH\<^esub> h \\<^bsub>GH\<^esub> inv\<^bsub>GH\<^esub> x \ H1" - using xH H1K_def p2 by blast - have " x \\<^bsub>GH\<^esub> h \\<^bsub>GH\<^esub> inv\<^bsub>GH\<^esub> x \ HK" - using assms HK_def subgroups_Inter_pair hHK xHK - by (metis GH_def inf.cobounded1 subgroup_def subgroup_incl) - hence " x \\<^bsub>GH\<^esub> h \\<^bsub>GH\<^esub> inv\<^bsub>GH\<^esub> x \ K" using HK_def by simp - hence " x \\<^bsub>GH\<^esub> h \\<^bsub>GH\<^esub> inv\<^bsub>GH\<^esub> x \ H1K" using INCL_1 H1K_def by auto - thus "x \\<^bsub>GHK\<^esub> h \\<^bsub>GHK\<^esub> inv\<^bsub>GHK\<^esub> x \ H1K" using xhx_egal by simp - qed - qed -qed - - -lemma (in group) normal_inter_subgroup : - assumes "subgroup H G" - and "N \ G" - shows "(N\H) \ (G\carrier := H\)" -proof - - define K where "K = carrier G" - have "G\carrier := K\ = G" using K_def by auto - moreover have "subgroup K G" using K_def subgroup_self by blast - moreover have "normal N (G \carrier :=K\)" using assms K_def by simp - ultimately have "N \ H \ G\carrier := K \ H\" - using normal_inter[of K H N] assms(1) by blast - moreover have "K \ H = H" using K_def assms subgroup_imp_subset by blast - ultimately show "normal (N\H) (G\carrier := H\)" by auto -qed - - - -text \Lemmas about normalizer\ +subsubsection \Lemmas about normalizer\ lemma (in group) subgroup_in_normalizer: @@ -267,39 +55,38 @@ qed -lemma (in group) normal_imp_subgroup_normalizer : +lemma (in group) normal_imp_subgroup_normalizer: assumes "subgroup H G" -and "N \ (G\carrier := H\)" -shows "subgroup H (G\carrier := normalizer G N\)" + and "N \ (G\carrier := H\)" + shows "subgroup H (G\carrier := normalizer G N\)" proof- have N_carrierG : "N \ carrier(G)" using assms normal_imp_subgroup subgroup_imp_subset by (smt monoid.cases_scheme order_trans partial_object.simps(1) partial_object.update_convs(1)) {have "H \ normalizer G N" unfolding normalizer_def stabilizer_def proof - fix x assume xH : "x \ H" - hence xcarrierG : "x \ carrier(G)" using assms subgroup_imp_subset by auto - have " N #> x = x <# N" using assms xH - unfolding r_coset_def l_coset_def normal_def normal_axioms_def subgroup_imp_group by auto - hence "x <# N #> inv x =(N #> x) #> inv x" - by simp - also have "... = N #> \" - using assms r_inv xcarrierG coset_mult_assoc[OF N_carrierG] by simp - finally have "x <# N #> inv x = N" by (simp add: N_carrierG) - thus "x \ {g \ carrier G. (\H\{H. H \ carrier G}. g <# H #> inv g) N = N}" - using xcarrierG by (simp add : N_carrierG) - qed} + fix x assume xH : "x \ H" + hence xcarrierG : "x \ carrier(G)" using assms subgroup_imp_subset by auto + have " N #> x = x <# N" using assms xH + unfolding r_coset_def l_coset_def normal_def normal_axioms_def subgroup_imp_group by auto + hence "x <# N #> inv x =(N #> x) #> inv x" + by simp + also have "... = N #> \" + using assms r_inv xcarrierG coset_mult_assoc[OF N_carrierG] by simp + finally have "x <# N #> inv x = N" by (simp add: N_carrierG) + thus "x \ {g \ carrier G. (\H\{H. H \ carrier G}. g <# H #> inv g) N = N}" + using xcarrierG by (simp add : N_carrierG) + qed} thus "subgroup H (G\carrier := normalizer G N\)" using subgroup_incl[OF assms(1) normalizer_imp_subgroup] - assms normal_imp_subgroup subgroup_imp_subset + assms normal_imp_subgroup subgroup_imp_subset by (metis group.incl_subgroup is_group) qed subsection \Second Isomorphism Theorem\ - -lemma (in group) mult_norm_subgroup : +lemma (in group) mult_norm_subgroup: assumes "normal N G" and "subgroup H G" shows "subgroup (N<#>H) G" unfolding subgroup_def @@ -364,7 +151,7 @@ qed -lemma (in group) mult_norm_sub_in_sub : +lemma (in group) mult_norm_sub_in_sub: assumes "normal N (G\carrier:=K\)" assumes "subgroup H (G\carrier:=K\)" assumes "subgroup K G" @@ -379,12 +166,12 @@ also have "... \ K" by simp finally have Incl2:"N \ K" by simp have "(N <#>\<^bsub>G\carrier := K\\<^esub> H) = (N <#> H)" - using set_mult_same_law[of K] assms Incl1 Incl2 by simp + using subgroup_set_mult_equality[of K] assms Incl1 Incl2 by simp thus "subgroup (N<#>H) (G\carrier:=K\)" using Hyp by auto qed -lemma (in group) subgroup_of_normal_set_mult : +lemma (in group) subgroup_of_normal_set_mult: assumes "normal N G" and "subgroup H G" shows "subgroup H (G\carrier := N <#> H\)" @@ -398,7 +185,7 @@ qed -lemma (in group) normal_in_normal_set_mult : +lemma (in group) normal_in_normal_set_mult: assumes "normal N G" and "subgroup H G" shows "normal N (G\carrier := N <#> H\)" @@ -413,7 +200,7 @@ qed -proposition (in group) weak_snd_iso_thme : +proposition (in group) weak_snd_iso_thme: assumes "subgroup H G" and "N\G" shows "(G\carrier := N<#>H\ Mod N \ G\carrier:=H\ Mod (N\H))" @@ -518,7 +305,7 @@ qed -theorem (in group) snd_iso_thme : +theorem (in group) snd_iso_thme: assumes "subgroup H G" and "subgroup N G" and "subgroup H (G\carrier:= (normalizer G N)\)" @@ -539,7 +326,7 @@ G\carrier := normalizer G N, carrier := H\ Mod N \ H = (G\carrier:= N<#>H\ Mod N) \ G\carrier := normalizer G N, carrier := H\ Mod N \ H" - using set_mult_same_law[OF normalizer_imp_subgroup[OF subgroup_imp_subset[OF assms(2)]], of N H] + using subgroup_set_mult_equality[OF normalizer_imp_subgroup[OF subgroup_imp_subset[OF assms(2)]], of N H] subgroup_imp_subset[OF assms(3)] subgroup_imp_subset[OF normal_imp_subgroup[OF subgroup_in_normalizer[OF assms(2)]]] by simp @@ -570,7 +357,7 @@ subsection\The Zassenhaus Lemma\ -lemma (in group) distinc : +lemma (in group) distinc: assumes "subgroup H G" and "H1\G\carrier := H\" and "subgroup K G" @@ -623,7 +410,7 @@ qed qed -lemma (in group) preliminary1 : +lemma (in group) preliminary1: assumes "subgroup H G" and "H1\G\carrier := H\" and "subgroup K G" @@ -664,7 +451,7 @@ qed qed -lemma (in group) preliminary2 : +lemma (in group) preliminary2: assumes "subgroup H G" and "H1\G\carrier := H\" and "subgroup K G" @@ -700,7 +487,7 @@ hence allG : "h1 \ carrier G" "hk \ carrier G" "x \ carrier G" using assms subgroup_imp_subset h1hk_def normal_imp_subgroup incl_subgroup apply blast+. hence "x <#\<^bsub>G\carrier := H1 <#> H\K\\<^esub> (H1 <#> H\K1) =h1 \ hk <# (H1 <#> H\K1)" - using set_mult_same_law subgroup_imp_subset xH h1hk_def by (simp add: l_coset_def) + using subgroup_set_mult_equality subgroup_imp_subset xH h1hk_def by (simp add: l_coset_def) also have "... = h1 <# (hk <# (H1 <#> H\K1))" using lcos_m_assoc[OF subgroup_imp_subset[OF incl_subgroup[OF assms(1) subH1]]allG(1)allG(2)] by (metis allG(1) allG(2) assms(1) incl_subgroup lcos_m_assoc subH2 subgroup_imp_subset) @@ -742,7 +529,7 @@ finally have eq1 : "x <#\<^bsub>G\carrier := H1 <#> H \ K\\<^esub> (H1 <#> H \ K1) = H1 <#> (H \ K1) #> hk" by (simp add: allG(2) all_inclG inf.coboundedI2 setmult_rcos_assoc) have "H1 <#> H \ K1 #>\<^bsub>G\carrier := H1 <#> H \ K\\<^esub> x = H1 <#> H \ K1 #> (h1 \ hk)" - using set_mult_same_law subgroup_imp_subset xH h1hk_def by (simp add: r_coset_def) + using subgroup_set_mult_equality subgroup_imp_subset xH h1hk_def by (simp add: r_coset_def) also have "... = H1 <#> H \ K1 #> h1 #> hk" using coset_mult_assoc by (simp add: allG all_inclG inf.coboundedI2 setmult_subset_G) also have"... = H \ K1 <#> H1 #> h1 #> hk" @@ -762,7 +549,7 @@ qed -proposition (in group) Zassenhaus_1 : +proposition (in group) Zassenhaus_1: assumes "subgroup H G" and "H1\G\carrier := H\" and "subgroup K G" @@ -811,7 +598,7 @@ qed -theorem (in group) Zassenhaus : +theorem (in group) Zassenhaus: assumes "subgroup H G" and "H1\G\carrier := H\" and "subgroup K G" diff -r ff61cbfb3f2d -r c183a6a69f2d src/HOL/ROOT --- a/src/HOL/ROOT Tue Jun 12 16:09:12 2018 +0100 +++ b/src/HOL/ROOT Thu Jun 14 14:23:38 2018 +0100 @@ -294,22 +294,16 @@ theories (* Orders and Lattices *) Galois_Connection (* Knaster-Tarski theorem and Galois connections *) - (* Groups *) FiniteProduct (* Product operator for commutative groups *) Sylow (* Sylow's theorem *) Bij (* Automorphism Groups *) - More_Group - More_Finite_Product Multiplicative_Group Zassenhaus (* The Zassenhaus lemma *) - - (* Rings *) Divisibility (* Rings *) IntRing (* Ideals and residue classes *) UnivPoly (* Polynomials *) - More_Ring document_files "root.bib" "root.tex" session "HOL-Auth" (timing) in Auth = "HOL-Library" +