src/HOL/Algebra/Group.thy
changeset 30729 461ee3e49ad3
parent 29240 bb81c3709fb6
child 31727 2621a957d417
equal deleted inserted replaced
30728:f0aeca99b5d9 30729:461ee3e49ad3
   486 
   486 
   487 lemma DirProd_monoid:
   487 lemma DirProd_monoid:
   488   assumes "monoid G" and "monoid H"
   488   assumes "monoid G" and "monoid H"
   489   shows "monoid (G \<times>\<times> H)"
   489   shows "monoid (G \<times>\<times> H)"
   490 proof -
   490 proof -
   491   interpret G!: monoid G by fact
   491   interpret G: monoid G by fact
   492   interpret H!: monoid H by fact
   492   interpret H: monoid H by fact
   493   from assms
   493   from assms
   494   show ?thesis by (unfold monoid_def DirProd_def, auto) 
   494   show ?thesis by (unfold monoid_def DirProd_def, auto) 
   495 qed
   495 qed
   496 
   496 
   497 
   497 
   498 text{*Does not use the previous result because it's easier just to use auto.*}
   498 text{*Does not use the previous result because it's easier just to use auto.*}
   499 lemma DirProd_group:
   499 lemma DirProd_group:
   500   assumes "group G" and "group H"
   500   assumes "group G" and "group H"
   501   shows "group (G \<times>\<times> H)"
   501   shows "group (G \<times>\<times> H)"
   502 proof -
   502 proof -
   503   interpret G!: group G by fact
   503   interpret G: group G by fact
   504   interpret H!: group H by fact
   504   interpret H: group H by fact
   505   show ?thesis by (rule groupI)
   505   show ?thesis by (rule groupI)
   506      (auto intro: G.m_assoc H.m_assoc G.l_inv H.l_inv
   506      (auto intro: G.m_assoc H.m_assoc G.l_inv H.l_inv
   507            simp add: DirProd_def)
   507            simp add: DirProd_def)
   508 qed
   508 qed
   509 
   509 
   523   assumes "group G" and "group H"
   523   assumes "group G" and "group H"
   524   assumes g: "g \<in> carrier G"
   524   assumes g: "g \<in> carrier G"
   525       and h: "h \<in> carrier H"
   525       and h: "h \<in> carrier H"
   526   shows "m_inv (G \<times>\<times> H) (g, h) = (inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h)"
   526   shows "m_inv (G \<times>\<times> H) (g, h) = (inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h)"
   527 proof -
   527 proof -
   528   interpret G!: group G by fact
   528   interpret G: group G by fact
   529   interpret H!: group H by fact
   529   interpret H: group H by fact
   530   interpret Prod!: group "G \<times>\<times> H"
   530   interpret Prod: group "G \<times>\<times> H"
   531     by (auto intro: DirProd_group group.intro group.axioms assms)
   531     by (auto intro: DirProd_group group.intro group.axioms assms)
   532   show ?thesis by (simp add: Prod.inv_equality g h)
   532   show ?thesis by (simp add: Prod.inv_equality g h)
   533 qed
   533 qed
   534 
   534 
   535 
   535