% This file was created automatically from grpprod.msk.
% DO NOT EDIT!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%A  grpprod.msk                 GAP documentation            Alexander Hulpke
%%
%A  @(#)$Id: grpprod.msk,v 1.29 2002/10/23 08:59:30 gap Exp $
%%
%Y  (C) 1998 School Math and Comp. Sci., University of St.  Andrews, Scotland
%Y  Copyright (C) 2002 The GAP Group
%%
\Chapter{Group Products}

This chapter describes the various group product constructions that are
possible in {\GAP}.

At the moment for some of the products methods are available only if both
factors are given in the same representation or only for certain types of
groups such as  permutation groups and pc groups when the product can be
naturally represented as a group of the same kind.

{\GAP} does not guarantee that a product of two groups will be in a
particular representation.  (Exceptions are `WreathProductImprimitiveAction'
and `WreathProductProductAction' which are construction that makes sense
only for permutation groups, see~"WreathProduct").

{\GAP} however will try to choose an efficient representation, so products
of permutation groups or pc groups often will be represented as a group of
the same kind again.

Therefore the only guaranteed way to relate a product to its factors is via
the embedding and projection homomorphisms (see~"Embeddings and
Projections for Group Products");

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Direct Products}

The direct product of  groups is the cartesian product of the groups
(considered as element sets) with component-wise multiplication.

\>DirectProduct( <G>{, <H>} ) F
\>DirectProductOp( <list>, <expl> ) O

These functions construct the direct product of the groups given as
arguments.
`DirectProduct' takes an arbitrary positive number of arguments
and calls the operation `DirectProductOp', which takes exactly two
arguments, namely a nonempty list of groups and one of these groups.
(This somewhat strange syntax allows the method selection to choose
a reasonable method for special cases, e.g., if all groups are
permutation groups or pc groups.)



{\GAP} will try to choose an efficient representation for the direct
product. For example the direct product of permutation groups will be a
permutation group again and the direct product of pc groups will be a pc
group.

\atindex{Embedding!example for direct products}%
{@\noexpand`Embedding'!example for direct products}
\atindex{Projection!example for direct products}%
{@\noexpand`Projection'!example for direct products}
For a product <P> the operation `Embedding(<P>,<nr>)' returns the
homomorphism embedding the <nr>-th factor into <P>. The operation 
`Projection(<P>,<nr>)' gives the projection of <P> onto the <nr>-th factor
(see~"Embeddings and Projections for Group Products").

\beginexample
gap> g:=Group((1,2,3),(1,2));;
gap> d:=DirectProduct(g,g,g);
Group([ (1,2,3), (1,2), (4,5,6), (4,5), (7,8,9), (7,8) ])
gap> Size(d);
216
gap> e:=Embedding(d,2);
2nd embedding into Group([ (1,2,3), (1,2), (4,5,6), (4,5), (7,8,9), (7,8) ])
gap> Image(e,(1,2));
(4,5)
gap> Image(Projection(d,2),(1,2,3)(4,5)(8,9));
(1,2)
\endexample

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Semidirect Products}

The semidirect product of a group <N> with a group <G> acting on <N> via a
homomorphism $\alpha$ from <G> into the automorphism group of <N> is the
cartesian product $<G>\times<N>$ with the multiplication
$(g,n)\cdot(h,m)=(gh,n^{(h\alpha)}m)$.

\>SemidirectProduct( <G>, <alpha>, <N> ) O
\>SemidirectProduct( <autgp>, <N> ) O

constructs the semidirect product of <N> with <G> acting via <alpha>.
<alpha> must be a homomorphism from <G> into a group of automorphisms of
<N>.

If <N> is a group, <alpha> must be a homomorphism from <G> into a group
of automorphisms of <N>.

If <N> is a full row space over a field <F>, <alpha> must be a
homomorphism from <G> into a matrix group of the right dimension over a
subfield of <F>, or into a permutation group (in this case permutation
matrices are taken).

In the second variant, <autgp> must be a group of automorphism of <N>,
it is a shorthand for
`SemidirectProduct(<autgp>,IdentityMapping(<autgp>),<N>)'. Note that
(unless <autgrp> has been obtained by the operation `AutomorphismGroup')
you have to test `IsGroupOfAutomorphisms(<autgrp>)' to ensure that {\GAP}
knows that <autgrp> consists of group automorphisms.


\beginexample
gap> n:=AbelianGroup(IsPcGroup,[5,5]);
<pc group of size 25 with 2 generators>
gap> au:=DerivedSubgroup(AutomorphismGroup(n));;
gap> Size(au);
120
gap> p:=SemidirectProduct(au,n);
<permutation group with 4 generators>
gap> Size(p);
3000
\endexample

\beginexample
gap> n:=Group((1,2),(3,4));;
gap> au:=AutomorphismGroup(n);;
gap> au:=First(Elements(au),i->Order(i)=3);;
gap> au:=Group(au);
<group with 1 generators>
gap> SemidirectProduct(au,n);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 2nd choice method found for `IsomorphismPcGroup' on 1 arguments
gap> IsGroupOfAutomorphisms(au);
true
gap> SemidirectProduct(au,n);
<pc group with 3 generators>
\endexample

\beginexample
gap> n:=AbelianGroup(IsPcGroup,[2,2]);
<pc group of size 4 with 2 generators>
gap> au:=AutomorphismGroup(n);
<group with 4 generators>
gap> apc:=IsomorphismPcGroup(au);
CompositionMapping( Pcgs([ (2,3), (1,3,2) ]) -> 
[ f1, f2 ], <action isomorphism> )
gap> g:=Image(apc);
Group([ f1, f2 ])
gap> apci:=InverseGeneralMapping(apc);
[ f1*f2^2, f1*f2^2, f1*f2, <identity> of ... ] -> 
[ [ f1, f2 ] -> [ f2, f1 ], [ f1, f2 ] -> [ f2, f1 ], 
  [ f1, f2 ] -> [ f1*f2, f2 ], [ f1, f2 ] -> [ f1, f2 ] ]
gap> IsGroupHomomorphism(apci);
true
gap> p:=SemidirectProduct(g,apci,n);
<pc group of size 24 with 4 generators>
gap> IsomorphismGroups(p,Group((1,2,3,4),(1,2)));
[ f1, f2, f3, f4 ] -> [ (1,2), (1,2,4), (1,2)(3,4), (1,4)(2,3) ]
\endexample

\beginexample
gap> SemidirectProduct(SU(3,3),GF(9)^3);
<matrix group of size 4408992 with 3 generators>
gap> SemidirectProduct(Group((1,2,3),(2,3,4)),GF(5)^4);
<matrix group of size 7500 with 3 generators>
\endexample

\beginexample
gap> g:=Group((3,4,5),(1,2,3));;
gap> mats:=[[[Z(2^2),0*Z(2)],[0*Z(2),Z(2^2)^2]],
>          [[Z(2)^0,Z(2)^0], [Z(2)^0,0*Z(2)]]];;
gap> hom:=GroupHomomorphismByImages(g,Group(mats),[g.1,g.2],mats);;
gap> SemidirectProduct(g,hom,GF(4)^2);
<matrix group of size 960 with 3 generators>
gap> SemidirectProduct(g,hom,GF(16)^2);
<matrix group of size 15360 with 4 generators>
\endexample

\atindex{Embedding!example for semidirect products}%
{@\noexpand`Embedding'!example for semidirect products}
\atindex{Projection!example for semidirect products}%
{@\noexpand`Projection'!example for semidirect products}
For the semidirect product <P> of <G> with <N>, `Embedding(<P>,1)' embeds
<G>, `Embedding(<P>,2)' embeds <N>. The operation `Projection(<P>)' returns
the projection of <P> onto <G>
(see~"Embeddings and Projections for Group Products").
\beginexample
gap> Size(Image(Embedding(p,1)));
6
gap> Embedding(p,2);
[ f1, f2 ] -> [ f3, f4 ]
gap> Projection(p);
[ f1, f2, f3, f4 ] -> [ f1, f2, <identity> of ..., <identity> of ... ]
\endexample

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Subdirect Products}

The subdirect product of the groups $G$ and $H$ with respect to the
epimorphisms $\varphi\colon G\to A$ and $\psi\colon H\to A$ (for a common
group $A$) is the subgroup of the direct product $G\times H$ consisting of
the elements $(g,h)$ for which $g\varphi=h\psi$. It is the pull-back of the
diagram:
%display{tex}
$$
\matrix{
&&G&\cr
&&\Big\downarrow&\varphi\cr
H&\mathop{\longrightarrow}\limits^{\psi}&A&\cr
}
$$
%display{html}
%<PRE>
%                   G
%                   | phi
%             psi   V
%          H  --->  A
%</PRE>
%display{text}
%                   G
%                   | phi
%             psi   V
%          H  --->  A
%enddisplay

\>SubdirectProduct( <G> , <H>, <Ghom>, <Hhom> ) O

constructs the subdirect product of <G> and <H> with respect to the
epimorphisms <Ghom> from <G> onto a group <A> and <Hhom> from <H> onto
the same group <A>.


\atindex{Projection!example for subdirect products}%
{@\noexpand`Projection'!example for subdirect products}
For a subdirect product <P>, the operation `Projection(<P>,<nr>' returns
the projections on the <nr>-th factor. (In general the factors do not embed
in a subdirect product.)
\beginexample
gap> g:=Group((1,2,3),(1,2));
Group([ (1,2,3), (1,2) ])
gap> hom:=GroupHomomorphismByImagesNC(g,g,[(1,2,3),(1,2)],[(),(1,2)]);
[ (1,2,3), (1,2) ] -> [ (), (1,2) ]
gap> s:=SubdirectProduct(g,g,hom,hom);
Group([ (1,2,3), (1,2)(4,5), (4,5,6) ])
gap> Size(s);
18
gap> p:=Projection(s,2);
2nd projection of Group([ (1,2,3), (1,2)(4,5), (4,5,6) ])
gap> Image(p,(1,3,2)(4,5,6));
(1,2,3)
\endexample

\>SubdirectProducts( <G>, <H> ) F

this function computes all subdirect products of <G> and <H> up to 
conjugacy in Parent(<G>) x Parent(<H>). The subdirect products are
returned as subgroups of this direct product.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Wreath Products}

The wreath product of a group <G> with a permutation group <P> acting on <n>
points is the semidirect product of the normal subgroup $<G>^n$ with the
group <P> which acts on $<G>^n$ by permuting the components.

\>WreathProduct( <G>, <P> ) O
\>WreathProduct( <G>, <H> [, <hom>] ) O

constructs the wreath product of the group <G> with the permutation
group <P> (acting on its `MovedPoints').

The second usage constructs the
wreath product of the group <G> with the image of the group <H> under
<hom> where <hom> must be a homomorphism from <H> into a permutation
group. (If <hom> is not given, and <P> is not a permutation group the
result of `IsomorphismPermGroup(P)'  -- whose degree may be dependent on
the method and thus is not well-defined! -- is taken for <hom>).


\atindex{Embedding!example for wreath products}%
{@\noexpand`Embedding'!example for wreath products}
\atindex{Projection!example for wreath products}%
{@\noexpand`Projection'!example for wreath products}
For a wreath product <W> of <G> with a permutation group <P> of degree <n>
and $1\le <nr>\le <n>$ the operation `Embedding(<W>,<nr>)' provides the
embedding of <G> in the <nr>-th component of the direct product of the base
group $<G>^n$ of <W>.
`Embedding(<W>,<n>+1)' is the embedding of <P> into <W>. The operation
`Projection(<W>)' provides the projection onto the acting group <P>
(see~"Embeddings and Projections for Group Products").
\beginexample
gap> g:=Group((1,2,3),(1,2));
Group([ (1,2,3), (1,2) ])
gap> p:=Group((1,2,3));
Group([ (1,2,3) ])
gap> w:=WreathProduct(g,p);
Group([ (1,2,3), (1,2), (4,5,6), (4,5), (7,8,9), (7,8), (1,4,7)(2,5,8)(3,6,9) 
 ])
gap> Size(w);
648
gap> Embedding(w,1);
1st embedding into Group( [ (1,2,3), (1,2), (4,5,6), (4,5), (7,8,9), (7,8), 
  (1,4,7)(2,5,8)(3,6,9) ] )
gap> Image(Embedding(w,3));
Group([ (7,8,9), (7,8) ])
gap> Image(Embedding(w,4));
Group([ (1,4,7)(2,5,8)(3,6,9) ])
gap> Image(Projection(w),(1,4,8,2,6,7,3,5,9));
(1,2,3)
\endexample

\>WreathProductImprimitiveAction( <G>, <H> ) F

for two permutation groups <G> and <H> this function constructs the
wreath product of <G> and <H> in the imprimitive action. If <G> acts on
$l$ points and <H> on $m$ points this action will be on $l\cdot m$
points, it will be imprimitive with $m$ blocks of size $l$ each.

The operations `Embedding' and `Projection' operate on this product as
described for general wreath products.

\beginexample
gap> w:=WreathProductImprimitiveAction(g,p);;
gap> LargestMovedPoint(w);
9
\endexample

\>WreathProductProductAction( <G>, <H> ) F

for two permutation groups <G> and <H> this function constructs the
wreath product in product action.  If <G> acts on $l$ points and <H> on
$m$ points this action will be on $l^m$ points.

The operations `Embedding' and `Projection' operate on this product as
described for general wreath products.

\beginexample
gap> w:=WreathProductProductAction(g,p);
<permutation group of size 648 with 7 generators>
gap> LargestMovedPoint(w);
27
\endexample

\>KuKGenerators( <G>, <beta>, <alpha> ) F

\atindex{Krasner-Kaloujnine theorem}{@Krasner-Kaloujnine theorem}
\index{Wreath product embedding}
If <beta> is a homomorphism from <G> in a transitive permutation group,
<U> the full preimage of the point stabilizer and
and <alpha> a homomorphism defined on (a superset) of <U>, this function
returns images of the generators of <G> when mapping to the wreath
product $(<U>alpha)\wr(<G>beta)$. (This is the Krasner-Kaloujnine
embedding theorem.)

\beginexample
gap> g:=Group((1,2,3,4),(1,2));;
gap> hom:=GroupHomomorphismByImages(g,Group((1,2)),
> GeneratorsOfGroup(g),[(1,2),(1,2)]);;
gap> u:=PreImage(hom,Stabilizer(Image(hom),1));
Group([ (2,3,4), (1,2,4) ])
gap> hom2:=GroupHomomorphismByImages(u,Group((1,2,3)),
> GeneratorsOfGroup(u),[ (1,2,3), (1,2,3) ]);;
gap> KuKGenerators(g,hom,hom2);
[ (1,4)(2,5)(3,6), (1,6)(2,4)(3,5) ]
\endexample

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Embeddings and Projections for Group Products}

The relation between a group product and its factors is provided via
homomorphisms, the embeddings in the product and the projections from the
product. Depending on the kind of product only some of these are defined.

\>Embedding(<P>,<nr>)!{for group products} O

returns the <nr>-th embedding in the group product <P>. The actual meaning
of this embedding is described in the section for the appropriate product.

\>Projection(<P>[,<nr>])!{for group products} O

returns the (<nr>-th) projection of the group product <P>. The actual meaning
of the projection returned is described in the section for the appropriate
product.

