# 7.100 SemidirectProduct

`SemidirectProduct( G, a, H )`

`SemidirectProduct` returns the semidirect product of G with H. a must be a homomorphism that from G onto a group A that operates on H via the caret (`^`) operator. A may either be a subgroup of the parent group of H that normalizes H, or a subgroup of the Group Homomorphisms).

The semidirect product of G and H is a the group of pairs (g,h) with g in G and h in H, where the product of (g_1,h_1) (g_2,h_2) is defined as (g_1 g_2, h_1^{g_2^a} h_2). Note that the elements (1_G,h) form a normal subgroup in the semidirect product.

`Embedding( U, S, 1 )`

Let U be a subgroup of G. `Embedding` returns the homomorphism of U into the semidirect product S where u is mapped to `(u,1)`.

`Embedding( U, S, 2 )`

Let U be a subgroup of H. `Embedding` returns the homomorphism of U into the semidirect product S where u is mapped to `(1,u)`.

`Projection( S, G, 1 )`

`Projection` returns the homomorphism of S onto G, where `(g,h)` is mapped to g.

`Projection( S, H, 2 )`

`Projection` returns the homomorphism of S onto H, where `(g,h)` is mapped to h.

It is not specified how the elements of the semidirect product are represented. Thus `Embedding` and `Projection` are the only general possibility to relate G and H with the semidirect product.

```    gap> s4 := Group( (1,2), (1,2,3,4) );;  s4.name := "s4";;
gap> s3 := Subgroup( s4, [ (1,2), (1,2,3) ] );; s3.name := "s3";;
gap> a4 := Subgroup( s4, [ (1,2,3), (2,3,4) ] );;  a4.name := "a4";;
gap> a := IdentityMapping( s3 );;
gap> s := SemidirectProduct( s3, a, a4 );
Group( SemidirectProductElement( (1,2),
(1,2), () ), SemidirectProductElement( (1,2,3),
(1,2,3), () ), SemidirectProductElement( (), (),
(1,2,3) ), SemidirectProductElement( (), (), (2,3,4) ) )
gap> Size( s );
72 ```

Note that the three arguments of `SemidirectProductElement` are the element g, its image under a, and the element h.

`SemidirectProduct` calls the function `G.operations.SemidirectProduct` with the arguments G, a, and H, and returns the result.

The default function called this way is `GroupOps.SemidirectProduct`. This function constructs the semidirect product as a group of semidirect product elements (see SemidirectProduct for Groups). Look in the index under SemidirectProduct to see for which groups this function is overlaid.

GAP 3.4.4
April 1997