<!-- ------------------------------------------------------------------- -->
<!--                                                                     -->
<!--  gp2map.xml            XMod documentation            Chris Wensley  -->
<!--                                                        & Murat Alp  -->
<!--  Copyright (C) 1996-2020, Chris Wensley et al,                      --> 
<!--  School of Computer Science, Bangor University, U.K.                --> 
<!--                                                                     -->
<!-- ------------------------------------------------------------------- -->

<?xml version="1.0" encoding="UTF-8"?>

<Chapter Label="chap-gpmap2">
<Heading>2d-mappings</Heading>
<Index>2d-mapping</Index>

<Section><Heading>Morphisms of 2-dimensional groups</Heading>

<Index>morphism of 2d-group</Index>
<Index>crossed module morphism</Index>
This chapter describes morphisms of (pre-)crossed modules
and (pre-)cat1-groups.

<ManSection>
   <Attr Name="Source"
         Arg="map" Label="for 2d-group mappings" />
   <Attr Name="Range"
         Arg="map" Label="for 2d-group mappings" />
   <Attr Name="SourceHom"
         Arg="map" />
   <Attr Name="RangeHom"
         Arg="map" />
<Description>
Morphisms of <E>2-dimensional groups</E> are implemented as 
<E>2-dimensional mappings</E>.
These have a pair of 2-dimensional groups as source and range, 
together with two group homomorphisms mapping between corresponding 
source and range groups.
These functions return <C>fail</C> when invalid data is supplied.
</Description>
</ManSection>
</Section>


<Section><Heading>Morphisms of pre-crossed modules</Heading>

<Index>morphism</Index>
<ManSection>
   <Prop Name="IsXModMorphism"
         Arg="map" />
   <Prop Name="IsPreXModMorphism"
         Arg="map" />
<Description>
A morphism between two pre-crossed modules 
<M>\calX_{1} = (\partial_1 : S_1 \to R_1)</M> and  
<M>\calX_{2} = (\partial_2 : S_2 \to R_2)</M> 
is a pair  <M>(\sigma, \rho)</M>, where 
<M>\sigma : S_1 \to S_2</M> and <M>\rho : R_1 \to R_2</M> 
commute with the two boundary maps
and are morphisms for the two actions:
<Display>
\partial_2 \circ \sigma ~=~ \rho \circ \partial_1, \qquad
\sigma(s^r) ~=~ (\sigma s)^{\rho r}.
</Display>

Here  <M>\sigma</M> is the <Ref Attr="SourceHom"/>  
and  <M>\rho</M>  is the <Ref Attr="RangeHom"/>  of the morphism. 
When <M>\calX_{1} = \calX_{2}</M>
and <M>\sigma, \rho</M> are automorphisms then 
<M>(\sigma, \rho)</M>  is an automorphism of <M>\calX_1</M>. 
The group of automorphisms is denoted 
by <M>{\rm Aut}(\calX_1 )</M>. 
</Description>
</ManSection>


<ManSection>
   <Meth Name="IsInjective"
         Arg="map" Label="for pre-xmod morphisms" />
   <Meth Name="IsSurjective"
         Arg="map" Label="for pre-xmod morphisms" />
   <Meth Name="IsSingleValued"
         Arg="map" Label="for pre-xmod morphisms" />
   <Meth Name="IsTotal"
         Arg="map" Label="for pre-xmod morphisms" />
   <Meth Name="IsBijective"
         Arg="map" Label="for pre-xmod morphisms" />
   <Prop Name="IsEndo2DimensionalMapping"
         Arg="map" />
<Description>
The usual properties of mappings are easily checked.
It is usually sufficient to verify that both the <Ref Attr="SourceHom"/> 
and the <Ref Attr="RangeHom"/> have the required property.
</Description>
</ManSection>

<ManSection>
   <Func Name="XModMorphism"
         Arg="args" />
   <Oper Name="XModMorphismByGroupHomomorphisms"
         Arg="X1 X2 sigma rho" />
   <Func Name="PreXModMorphism"
         Arg="args" />
   <Oper Name="PreXModMorphismByGroupHomomorphisms"
         Arg="P1 P2 sigma rho" />
   <Oper Name="InclusionMorphism2DimensionalDomains"
         Arg="X1 S1" Label="for crossed modules" />
   <Oper Name="InnerAutomorphismXMod"
         Arg="X1 r" />
   <Attr Name="IdentityMapping"
         Arg="X1" Label="for pre-xmods" />
<Description>
These are the constructors for morphisms of pre-crossed and crossed modules.
<P/>
In the following example we construct a simple automorphism of 
the crossed module  <C>X5</C>  constructed in the previous chapter.
</Description>
</ManSection>
<P/>
<Index>display a 2d-mapping</Index>
<Index>order of a 2d-automorphism</Index>
<Example>
<![CDATA[
gap> sigma5 := GroupHomomorphismByImages( c5, c5, [ (5,6,7,8,9) ]
        [ (5,9,8,7,6) ] );;
gap> rho5 := IdentityMapping( Range( X1 ) );
IdentityMapping( PAut(c5) )
gap> mor5 := XModMorphism( X5, X5, sigma5, rho5 );
[[c5->Aut(c5))] => [c5->Aut(c5))]] 
gap> Display( mor5 );
Morphism of crossed modules :- 
: Source = [c5->Aut(c5)] with generating sets:
  [ (5,6,7,8,9) ]
  [ GroupHomomorphismByImages( c5, c5, [ (5,6,7,8,9) ], [ (5,7,9,6,8) ] ) ]
: Range = Source
: Source Homomorphism maps source generators to:
  [ (5,9,8,7,6) ]
: Range Homomorphism maps range generators to:
  [ GroupHomomorphismByImages( c5, c5, [ (5,6,7,8,9) ], [ (5,7,9,6,8) ] ) ]
gap> IsAutomorphism2DimensionalDomain( mor5 );
true 
gap> Order( mor5 );
2
gap> RepresentationsOfObject( mor5 );
[ "IsComponentObjectRep", "IsAttributeStoringRep", "Is2DimensionalMappingRep" ]
gap> KnownPropertiesOfObject( mor5 );
[ "CanEasilyCompareElements", "CanEasilySortElements", "IsTotal", 
  "IsSingleValued", "IsInjective", "IsSurjective", "RespectsMultiplication", 
  "IsPreXModMorphism", "IsXModMorphism", "IsEndomorphism2DimensionalDomain", 
  "IsAutomorphism2DimensionalDomain" ]
gap> KnownAttributesOfObject( mor5 );
[ "Name", "Order", "Range", "Source", "SourceHom", "RangeHom" ]
]]>
</Example>

<ManSection>
   <Attr Name="IsomorphismPerm2DimensionalGroup"
         Arg="obj" Label="for pre-xmod morphisms" />
   <Attr Name="IsomorphismPc2DimensionalGroup"
         Arg="obj" Label="for pre-xmod morphisms" />
   <Oper Name="IsomorphismByIsomorphisms"
         Arg="D list" />
<Description>
When <M>\calD</M> is a <M>2</M>-dimensional domain 
with source <M>S</M> and range <M>R</M> 
and <M>\sigma : S \to S',~ \rho : R \to R'</M> are isomorphisms, 
then <C>IsomorphismByIsomorphisms(D,[sigma,rho])</C> returns an isomorphism 
<M>(\sigma,\rho) : \calD \to \calD'</M> 
where <M>\calD'</M> has source <M>S'</M> and range <M>R'</M>.  
Be sure to test <C>IsBijective</C> for the two functions 
<M>\sigma,\rho</M> before applying this operation.  
<P/> 
Using <Ref Oper="IsomorphismByIsomorphisms"/> with a pair of isomorphisms 
obtained using <C>IsomorphismPermGroup</C> or <C>IsomorphismPcGroup</C>, 
we may construct a crossed module or a cat1-group of permutation groups 
or pc-groups.  
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> q8 := SmallGroup(8,4);;   ## quaternion group 
gap> Xq8 := XModByAutomorphismGroup( q8 );
[Group( [ f1, f2, f3 ] )->Group( [ Pcgs([ f1, f2, f3 ]) -> [ f1*f2, f2, f3 ], 
  Pcgs([ f1, f2, f3 ]) -> [ f2, f1*f2, f3 ], 
  Pcgs([ f1, f2, f3 ]) -> [ f1*f3, f2, f3 ], 
  Pcgs([ f1, f2, f3 ]) -> [ f1, f2*f3, f3 ] ] )]
gap> iso := IsomorphismPerm2DimensionalGroup( Xq8 );;
gap> Yq8 := Image( iso );
[Group( [ (1,2,4,6)(3,8,7,5), (1,3,4,7)(2,5,6,8), (1,4)(2,6)(3,7)(5,8) 
 ] )->Group( [ (1,3,4,6), (1,2,3)(4,5,6), (1,4)(3,6), (2,5)(3,6) ] )]
gap> s4 := SymmetricGroup(4);; 
gap> isos4 := IsomorphismGroups( Range(Yq8), s4 );;
gap> id := IdentityMapping( Source( Yq8 ) );; 
gap> IsBijective( id );;  IsBijective( isos4 );;
gap> mor := IsomorphismByIsomorphisms( Yq8, [id,isos4] );;
gap> Zq8 := Image( mor );
[Group( [ (1,2,4,6)(3,8,7,5), (1,3,4,7)(2,5,6,8), (1,4)(2,6)(3,7)(5,8) 
 ] )->SymmetricGroup( [ 1 .. 4 ] )]
]]>
</Example>

<ManSection>
   <Attr Name="MorphismOfPullback"
         Arg="xmod" Label="for a crossed module by pullback" />
<Description>
Let <M>\calX_1 = (\lambda : L \to N)</M> be the pullback crossed module 
obtained from a crossed module <M>\calX_0 = (\mu : M \to P)</M> 
and a group homomorphism <M>\nu : N \to P</M>. 
Then the associated crossed module morphism is 
<M>(\kappa,\nu) : \calX_1 \to \calX_0</M> 
where <M>\kappa</M> is the projection from <M>L</M> to <M>M</M>. 
</Description> 
</ManSection> 

</Section>


<Section Label="sect-mor-pre-cat1">
<Heading>Morphisms of pre-cat1-groups</Heading>

A morphism of pre-cat1-groups from 
<M>\calC_1 = (e_1;t_1,h_1 : G_1 \to R_1)</M>
to  <M>\calC_2 = (e_2;t_2,h_2 : G_2 \to R_2)</M>  
is a pair  <M>(\gamma, \rho)</M>  where
<M>\gamma : G_1 \to G_2</M>  and  <M>\rho : R_1 \to R_2</M>  
are homomorphisms satisfying
<Display>
h_2 \circ \gamma ~=~ \rho \circ h_1, \qquad 
t_2 \circ \gamma ~=~ \rho \circ t_1, \qquad 
e_2 \circ \rho ~=~ \gamma \circ e_1. 
</Display>

<ManSection>
   <Prop Name="IsCat1GroupMorphism"
         Arg="map" />
   <Prop Name="IsPreCat1GroupMorphism"
         Arg="map" />
   <Func Name="Cat1GroupMorphism"
         Arg="args" />
   <Oper Name="Cat1GroupMorphismByGroupHomomorphisms"
         Arg="C1 C2 gamma rho" />
   <Func Name="PreCat1GroupMorphism"
         Arg="args" />
   <Oper Name="PreCat1GroupMorphismByGroupHomomorphisms"
         Arg="P1 P2 gamma rho" />
   <Oper Name="InclusionMorphism2DimensionalDomains"
         Arg="C1 S1" Label="for cat1-groups" />
   <Oper Name="InnerAutomorphismCat1"
         Arg="C1 r" />
   <Attr Name="IdentityMapping"
         Arg="C1" Label="for precat1-morphisms" />
<Description>
For an example we form a second cat1-group <Code>C2=[g18=>s3a]</Code>, 
similar to <C>C1</C> in <Ref Sect="mansect-cat1"/>, 
then construct an isomorphism <M>(\gamma,\rho)</M> between them. 
</Description>
</ManSection> 
<P/>
<Example>
<![CDATA[
gap> t3 := GroupHomomorphismByImages(g18,s3a,g18gens,[(),(7,8,9),(8,9)]);;     
gap> e3 := GroupHomomorphismByImages(s3a,g18,s3agens,[(4,5,6),(2,3)(5,6)]);;   
gap> C3 := Cat1Group( t3, h1, e3 );; 
gap> imgamma := [ (4,5,6), (1,2,3), (2,3)(5,6) ];; 
gap> gamma := GroupHomomorphismByImages( g18, g18, g18gens, imgamma );;
gap> rho := IdentityMapping( s3a );; 
gap> phi3 := Cat1GroupMorphism( C18, C3, gamma, rho );;
gap> Display( phi3 );;
Morphism of cat1-groups :- 
: Source = [g18=>s3a] with generating sets:
  [ (1,2,3), (4,5,6), (2,3)(5,6) ]
  [ (7,8,9), (8,9) ]
:  Range = [g18=>s3a] with generating sets:
  [ (1,2,3), (4,5,6), (2,3)(5,6) ]
  [ (7,8,9), (8,9) ]
: Source Homomorphism maps source generators to:
  [ (4,5,6), (1,2,3), (2,3)(5,6) ]
: Range Homomorphism maps range generators to:
  [ (7,8,9), (8,9) ]
]]>
</Example>


<ManSection>
   <Attr Name="Cat1GroupMorphismOfXModMorphism"
         Arg="IsXModMorphism" />
   <Attr Name="XModMorphismOfCat1GroupMorphism"
         Arg="IsCat1GroupMorphism" />
<Description>
If <M>(\sigma,\rho) : \calX_1 \to \calX_2</M> and <M>\calC_1,\calC_2</M> 
are the cat<M>^1</M>-groups accociated to <M>\calX_1, \calX_2</M>, then
the associated morphism of cat<M>^1</M>-groups is <M>(\gamma,\rho)</M> 
where <M>\gamma(r_1,s_1) = (\rho r_1, \sigma s_1)</M>. 
<P/>
Similarly, given a morphism <M>(\gamma,\rho) : \calC_1 \to \calC_2</M> 
of cat1-groups, the associated morphism of crossed modules is 
<M>(\sigma,\rho) : \calX_1 \to \calX_2</M> 
where <M>\sigma s_1 = \gamma(1,s_1)</M>. .
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> phi5 := Cat1GroupMorphismOfXModMorphism( mor5 );
[[(Aut(c5) |X c5)=>Aut(c5)] => [(Aut(c5) |X c5)=>Aut(c5)]]
gap> mor3 := XModMorphismOfCat1GroupMorphism( phi3 );;
gap> Display( mor3 );
Morphism of crossed modules :- 
: Source = xmod([g18=>s3a]) with generating sets:
  [ (4,5,6) ]
  [ (7,8,9), (8,9) ]
:  Range = xmod([g18=>s3a]) with generating sets:
  [ (1,2,3) ]
  [ (7,8,9), (8,9) ]
: Source Homomorphism maps source generators to:
  [ (1,2,3) ]
: Range Homomorphism maps range generators to:
  [ (7,8,9), (8,9) ]
]]>
</Example>


<ManSection>
   <Func Name="IsomorphismPermObject" 
         Arg="obj" />
   <Attr Name="IsomorphismPerm2DimensionalGroup" 
         Arg="2DimensionalGroup" Label="for pre-cat1 morphisms" />
   <Attr Name="IsomorphismFp2DimensionalGroup"
         Arg="2DimensionalGroup" Label="for pre-cat1 morphisms" />
   <Attr Name="IsomorphismPc2DimensionalGroup"
         Arg="2DimensionalGroup" Label="for pre-cat1 morphisms" />
<Description>
The global function <C>IsomorphismPermObject</C> 
calls <C>IsomorphismPerm2DimensionalGroup</C>, 
which constructs a morphism whose <Ref Attr="SourceHom"/> 
and <Ref Attr="RangeHom"/> are calculated using 
<C>IsomorphismPermGroup</C> on the source and range.  
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> iso8 := IsomorphismPerm2DimensionalGroup( C8 );
[[G8=>d12] => [..]]
]]>
</Example>

<ManSection>
   <Attr Name="SmallerDegreePermutationRepresentation2DimensionalGroup"
         Arg="Perm2DimensionalGroup" Label="for perm 2d-groups" />
<Description>
The attribute  
<C>SmallerDegreePermutationRepresentation2DimensionalGroup</C> 
is obtained by calling <C>SmallerDegreePermutationRepresentation</C>  
on the source and range to obtain the an isomorphism for the pre-xmod 
or pre-cat<M>^1</M>-group. 
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> G := Group( (1,2,3,4)(5,6,7,8) );; 
gap> H := Subgroup( G, [ (1,3)(2,4)(5,7)(6,8) ] );;
gap> XG := XModByNormalSubgroup( G, H );
[Group( [ (1,3)(2,4)(5,7)(6,8) ] )->Group( [ (1,2,3,4)(5,6,7,8) ] )]
gap> sdpr := SmallerDegreePermutationRepresentation2DimensionalGroup( XG );; 
gap> Range( sdpr );
[Group( [ (1,2) ] )->Group( [ (1,2,3,4) ] )]
]]>
</Example>

</Section>


<Section Label="sect-oper-mor">
<Heading>Operations on morphisms</Heading>
<Index>operations on morphisms</Index>

<ManSection>
   <Oper Name="CompositionMorphism"
         Arg="map2 map1" />
<Description>
Composition of morphisms (written <C>(&lt;map1&gt; * &lt;map2&gt;)</C> 
when maps act on the right) 
calls the <Ref Oper="CompositionMorphism"/> function for maps 
(acting on the left), applied to the appropriate type of 2d-mapping.
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> H8 := Subgroup(G8,[G8.3,G8.4,G8.6,G8.7]);  SetName( H8, "H8" );
Group([ f3, f4, f6, f7 ])
gap> c6 := Subgroup( d12, [b,c] );  SetName( c6, "c6" );
Group([ f2, f3 ])
gap> SC8 := Sub2DimensionalGroup( C8, H8, c6 );
[H8=>c6]
gap> IsCat1Group( SC8 );
true
gap> inc8 := InclusionMorphism2DimensionalDomains( C8, SC8 );
[[H8=>c6] => [G8=>d12]]
gap> CompositionMorphism( iso8, inc );                  
[[H8=>c6] => P[G8=>d12]]
]]>
</Example>

<ManSection>
   <Oper Name="Kernel"
         Arg="map" Label="for 2d-mappings" />
   <Attr Name="Kernel2DimensionalMapping"
         Arg="map" />
<Description>
The kernel of a morphism of crossed modules is a normal subcrossed module 
whose groups are the kernels of the source and target homomorphisms. 
The inclusion of the kernel is a standard example of a crossed square, 
but these have not yet been implemented.
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> c2 := Group( (19,20) );                                    
Group([ (19,20) ])
gap> X0 := XModByNormalSubgroup( c2, c2 );  SetName( X0, "X0" );
[Group( [ (19,20) ] )->Group( [ (19,20) ] )]
gap> SX8 := Source( X8 );;
gap> genSX8 := GeneratorsOfGroup( SX8 ); 
[ f1, f4, f5, f7 ]
gap> sigma0 := GroupHomomorphismByImages(SX8,c2,genSX8,[(19,20),(),(),()]);
[ f1, f4, f5, f7 ] -> [ (19,20), (), (), () ]
gap> rho0 := GroupHomomorphismByImages(d12,c2,[a1,a2,a3],[(19,20),(),()]);
[ f1, f2, f3 ] -> [ (19,20), (), () ]
gap> mor0 := XModMorphism( X8, X0, sigma0, rho0 );;           
gap> K0 := Kernel( mor0 );;
gap> StructureDescription( K0 );
[ "C12", "C6" ]
]]></Example>

</Section>

</Chapter>
