<!-- ------------------------------------------------------------------- -->
<!--                                                                     -->
<!--  gp3objmap.xml         XMod documentation            Chris Wensley  -->
<!--                                                                     -->
<!--  Copyright (C) 2001-2017, Chris Wensley et al,                      --> 
<!--  School of Computer Science, Bangor University, U.K.                --> 
<!--                                                                     -->
<!-- ------------------------------------------------------------------- -->

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

<Chapter Label="chap-obj3">

<Heading>3d-groups and 3d-mappings : crossed squares and cat<M>^2</M>-groups</Heading>

<Index>3d-group</Index>
<Index>3d-domain</Index>
The term <E>3d-group</E> refers to a set of equivalent categories 
of which the most common are the categories of 
<E>crossed squares</E> and <E>cat<M>^2</M>-groups</E>. 

<Section Label="sect-xsq-definition">
<Heading>Definition of a crossed square 
and a crossed <M>n</M>-cube of groups</Heading>

<Index>crossed square</Index>
Crossed squares were introduced by Guin-Wal&#xE9;ry and Loday 
(see, for example, <Cite Key="brow:lod"/>)
as fundamental crossed squares of commutative squares of spaces,
but are also of purely algebraic interest.
We denote by <M>[n]</M> the set <M>\{1,2,\ldots,n\}</M>.
We use the <M>n=2</M> version of the definition of crossed <M>n</M>-cube
as given by Ellis and Steiner <Cite Key="ell:st"/>.
<P/>
A <E>crossed square</E> <M>\mathcal{S}</M> consists of the following:
<List>
<Item>
groups <M>S_J</M> for each of the four subsets <M>J \subseteq [2]</M>;
</Item>
<Item>
a commutative diagram of group homomorphisms:
  <Display>
  \ddot{\partial}_1 : S_{[2]} \to S_{\{2\}}, \quad 
  \ddot{\partial}_2 : S_{[2]} \to S_{\{1\}}, \quad 
  \dot{\partial}_1 : S_{\{1\}} \to S_{\emptyset}, \quad 
  \dot{\partial}_2 : S_{\{2\}} \to S_{\emptyset}; 
  </Display>
</Item>
<Item>
actions of <M>S_{\emptyset}</M> on <M>S_{\{1\}}, S_{\{2\}}</M> 
and <M>S_{[2]}</M> which determine actions of 
<M>S_{\{1\}}</M> on <M>S_{\{2\}}</M> and <M>S_{[2]}</M> 
via <M>\dot{\partial}_1</M> 
and actions of 
<M>S_{\{2\}}</M> on <M>S_{\{1\}}</M> and <M>S_{[2]}</M> 
via <M>\dot{\partial}_2\;</M>;
</Item>
<Item>
a function <M>\boxtimes : S_{\{1\}} \times S_{\{2\}} \to S_{[2]}</M>.
</Item>
</List>

Here is a picture of the situation:
<Display>
<![CDATA[
\vcenter{\xymatrix{
       &   &  S_{[2]} \ar[rr]^{\ddot{\partial}_1} \ar[dd]_{\ddot{\partial}_2} 
              && S_{\{2\}} \ar[dd]^{\dot{\partial}_2} &   \\
\mathcal{S}  & = &  &&  \\
       &   &  S_{\{1\}} \ar[rr]_{\dot{\partial}_1}  
              && S_{\emptyset} 
}} 
}}
]]></Display>

The following axioms must be satisfied for all 
<M>l \in S_{[2]},\; m,m_1,m_2 \in S_{\{1\}},\; 
n,n_1,n_2 \in S_{\{2\}},\; p \in S_{\emptyset}</M>:
<List>
<Item>
the homomorphisms <M>\ddot{\partial}_1, \ddot{\partial}_2</M> 
preserve the action of <M>S_{\emptyset}\;</M>;
</Item>
<Item>
each of the upper, left-hand, lower, and right-hand sides of the square, 
<Display>
 \ddot{\mathcal{S}}_1 = (\ddot{\partial}_1 : S_{[2]} \to S_{\{2\}}), 
 \ddot{\mathcal{S}}_2 = (\ddot{\partial}_2 : S_{[2]} \to S_{\{1\}}), 
  \dot{\mathcal{S}}_1  = (\dot{\partial}_1 : S_{\{1\}} \to S_{\emptyset}), 
  \dot{\mathcal{S}}_2  = (\dot{\partial}_2 : S_{\{2\}} \to S_{\emptyset}),
</Display>
and the diagonal  
<Display>
\mathcal{S}_{12} = (\partial_{12} := \dot{\partial}_1\ddot{\partial}_2 
                  = \dot{\partial}_2\ddot{\partial}_1 
                  : S_{[2]} \to S_{\emptyset})
</Display>
are crossed modules (with actions via <M>S_{\emptyset}</M>);
</Item>
<Item>
<Index>crossed pairing</Index>
<M>\boxtimes</M> is a <E>crossed pairing</E>:
  <List>
  <Item>
  <M>(m_1m_2 \boxtimes n)\;=\;
     {(m_1 \boxtimes n)}^{m_2}\;(m_2 \boxtimes n)</M>,
  </Item>
  <Item>
  <M>(m \boxtimes n_1n_2) \;=\; 
     (m \boxtimes n_2)\;{(m \boxtimes n_1)}^{n_2}</M>,
  </Item>
  <Item> 
  <M>(m \boxtimes n)^{p} \;=\; (m^p \boxtimes n^p)</M>;
  </Item>
  </List>
</Item>
<Item>
<M>\ddot{\partial}_1 (m \boxtimes n) \;=\; (n^{-1})^{m}\;n
\quad \mbox{and} \quad
\ddot{\partial}_2 (m \boxtimes n) \;=\; m^{-1}\;m^{n}</M>,
</Item>
<Item>
<M>(m \boxtimes \ddot{\partial}_1 l) \;=\; (l^{-1})^{m}\;l
\quad \mbox{and} \quad
(\ddot{\partial}_2 l \boxtimes n) \;=\; l^{-1}\;l^n</M>.
</Item>
</List>
Note that the actions of  <M>S_{\{1\}}</M>  on  <M>S_{\{2\}}</M>  
and  <M>S_{\{2\}}</M>  on  <M>S_{\{1\}}</M>  via  <M>S_{\emptyset}</M>
are compatible since
<Display>
{m_1}^{(n^m)} \;=\; {m_1}^{\dot{\partial}_2(n^m)} 
              \;=\; {m_1}^{m^{-1}(\dot{\partial}_2 n)m}
\;=\; (({m_1}^{m^{-1}})^n)^m.
</Display>
<P/>
(A <E>precrossed square</E> is a similar structure which satisfies 
some subset of these axioms.  [More needed here.]) 
<P/>
In what follows we shall generally use the following notation for the 
<M>S_J</M>, namely <M>L = S_{[2]};~ M = S_{\{1\}};~ N = S_{\{2\}}</M> 
and <M>P = S_{\emptyset}</M>.  
<P/> 
Crossed squares are the <M>n=2</M> case of a 
crossed <M>n</M>-cube of groups, defined as follows. 
(This is an attempt to translate Definition 2.1 in Ronnie's 
<E>Computing homotopy types using crossed n-cubes of groups</E> 
into right actions -- but this definition is not yet completely understood!) 
<P/>
A <E>crossed</E> <M>n</M><E>-cube of groups</E> consists of the following: 
<List>
<Item> 
groups <M>S_A</M> for every subset <M>A \subseteq [n]</M>; 
</Item>
<Item>
a commutative diagram of group homomorphisms 
<M>\partial_i : S_A \to S_{A \setminus \{i\}},\; i \in [n]</M>; 
with composites 
<M>\partial_B : S_A \to S_{A \setminus B},\; B \subseteq [n]</M>;
</Item>
<Item>
actions of <M>S_{\emptyset}</M> on each <M>S_A</M>; 
and hence actions of <M>S_B</M> on <M>S_A</M> via <M>\partial_B</M>
for each <M>B \subseteq [n]</M>; 
</Item>
<Item> 
functions <M>\boxtimes_{A,B} : S_A \times S_B \to S_{A \cup B}, 
(A,B \subseteq [n])</M>. 
</Item> 
</List>
The following axioms must be satisfied (long list to be added). 

</Section> 


<Section Label="sect-xsq-constructions">
<Heading>Constructions for crossed squares</Heading>

Analogously to the data structure used for crossed modules, 
crossed squares are implemented as <C>3d-groups</C>. 
When times allows, cat<M>^2</M>-groups will also be implemented, 
with conversion between the two types of structure.

Some standard constructions of crossed squares are listed below. 
At present, a limited number of constructions are implemented.
Morphisms of crossed squares have also been implemented, 
though there is a lot still to be done.

<ManSection>
   <Func Name="CrossedSquare"
         Arg="args" />
   <Oper Name="CrossedSquareByNormalSubgroups"
         Arg="P N M L" />
   <Oper Name="ActorCrossedSquare" 
         Arg="X0" />
   <Attr Name="Transpose3dGroup" 
         Arg="S0" />
   <Attr Name="Name" 
         Arg="S0" />
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<!--   <Oper Name="CrossedSquareByXMods"                   -->
<!--         Arg="X1 X2 X3 X4 action pairing" /> -->
<!--   <Oper Name="AsCrossedSquare"                        -->
<!--         Arg="obj" />                        -->
<Description>
Here are some standard examples of crossed squares.
<List>
<Item>
If <M>M, N</M> are normal subgroups of a group <M>P</M>, 
and <M>L = M \cap N</M>, then the four inclusions, 
<M>L \to N,~ L \to M,~ M \to P,~ N \to P</M>, 
together with the actions of <M>P</M> on <M>M, N</M> 
and <M>L</M> given by conjugation, 
form a crossed square with crossed pairing  
<Display>
\boxtimes \;:\; M \times N \to M\cap N, \quad 
(m,n) \mapsto [m,n] \,=\, m^{-1}n^{-1}mn \,=\,(n^{-1})^mn \,=\, m^{-1}m^n\,. 
</Display>  
This construction is implemented as <C>CrossedSquareByNormalSubgroups(P,N,M,L);</C>.
</Item>
<Item>
The actor <M>\mathcal{A}(\mathcal{X}_0)</M> of a crossed module 
<M>\mathcal{X}_0</M> has been described in Chapter 5.
The crossed pairing is given by 
<Display>
\boxtimes \;:\;  R \times W \,\to\, S, \quad (r,\chi) \,\mapsto\, \chi r~.
</Display>
This is implemented as <C>ActorCrossedSquare( X0 );</C>.
</Item>
<Item>
The <E>transpose</E> of <M>\mathcal{S}</M> is the crossed square  
<M>\tilde{\mathcal{S}}</M> obtained by interchanging 
<M>S_{\{1\}}</M> with <M>S_{\{2\}}</M>, 
<M>\ddot{\partial}_1</M> with <M>\ddot{\partial}_2</M>, and 
<M>\dot{\partial}_1</M> with <M>\dot{\partial}_2</M>.  
The crossed pairing is given by 
<Display>
\tilde{\boxtimes} \;:\; S_{\{2\}} \times S_{\{1\}} \to S_{[2]}, \quad 
(n,m) \;\mapsto\; n\,\tilde{\boxtimes}\,m := (m \boxtimes n)^{-1}~.
</Display>
</Item>
</List>
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> d20 := DihedralGroup( IsPermGroup, 20 );;
gap> gend20 := GeneratorsOfGroup( d20 ); 
[ (1,2,3,4,5,6,7,8,9,10), (2,10)(3,9)(4,8)(5,7) ]
gap> p1 := gend20[1];;  p2 := gend20[2];;  p12 := p1*p2; 
(1,10)(2,9)(3,8)(4,7)(5,6)
gap> d10a := Subgroup( d20, [ p1^2, p2 ] );;
gap> d10b := Subgroup( d20, [ p1^2, p12 ] );;
gap> c5d := Subgroup( d20, [ p1^2 ] );;
gap> SetName( d20, "d20" );  SetName( d10a, "d10a" ); 
gap> SetName( d10b, "d10b" );  SetName( c5d, "c5d" ); 
gap> XSconj := CrossedSquareByNormalSubgroups( d20, d10b, d10a, c5d );
[  c5d -> d10b ]
[   |      |   ]
[ d10a -> d20  ]

gap> Name( XSconj );
"[c5d->d10b,d10a->d20]"
gap> XStrans := Transpose3dGroup( XSconj ); 
[  c5d -> d10a ]
[   |      |   ]
[ d10b -> d20  ]

gap> X20 := XModByNormalSubgroup( d20, d10a );
[d10a->d20]
gap> XSact := ActorCrossedSquare( X20 );
crossed square with:
      up = Whitehead[d10a->d20]
    left = [d10a->d20]
    down = Norrie[d10a->d20]
   right = Actor[d10a->d20]
]]>
</Example>


<ManSection Label="CentralQuotientXMod">
    <Attr Name="CentralQuotient"
          Arg="X0" />
<Description>
The central quotient of a crossed module 
<M>\mathcal{X} = (\partial : S \to R)</M> is the crossed square where: 
<List>
<Item>
the left crossed module is <M>\mathcal{X}</M>; 
</Item>
<Item>
the right crossed module is the quotient <M>\mathcal{X}/Z(\mathcal{X})</M> 
(see <Ref Func="CentreXMod"/>); 
</Item>
<Item>
the top and bottom homomorphisms are the natural homomorphisms 
onto the quotient groups; 
</Item>
<Item>
the crossed pairing <M>\boxtimes : (R \times F) \to S</M>, 
where <M>F = &Fix;(\mathcal{X},S,R)</M>, is the displacement element 
<M>\boxtimes(r,Fs) = \langle r,s \rangle = (s^{-1})^rs\quad</M> 
(see <Ref Func="Displacement"/> and section
<Ref Sect="sect-isoclinic-xmods"/>). 
</Item>
</List>
This is the special case of an intended function 
<C>CrossedSquareByCentralExtension</C> which has not yet been implemented. 
In the example <C>Xn7</C> <M>\unlhd</M> <C>X24</C>, 
constructed in section <Ref Sect="sect-more-xmod-ops" />. 
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> pos7 := Position( ids, [ [12,2], [24,5] ] );;
gap> Xn7 := nsx[pos7]; 
[Group( [ f2, f3, f4 ] )->Group( [ f1, f2, f4, f5 ] )]
gap> IdGroup( CentreXMod(Xn7) );  
[ [ 4, 1 ], [ 4, 1 ] ]
gap> CQXn7 := CentralQuotient( Xn7 );
crossed square with:
      up = [Group( [ f2, f3, f4 ] )->Group( [ f1 ] )]
    left = [Group( [ f2, f3, f4 ] )->Group( [ f1, f2, f4, f5 ] )]
    down = [Group( [ f1, f2, f4, f5 ] )->Group( [ f1, f2 ] )]
   right = [Group( [ f1 ] )->Group( [ f1, f2 ] )]

gap> IdGroup( CQXn7 );
[ [ [ 12, 2 ], [ 3, 1 ] ], [ [ 24, 5 ], [ 6, 1 ] ] ]
]]>
</Example>

<ManSection>
   <Prop Name="IsCrossedSquare"
         Arg="obj" />
<!--   <Prop Name="Iscat<M>^2</M>"   -->
<!--         Arg="obj" />    -->
   <Prop Name="Is3dObject"
         Arg="obj" />
   <Prop Name="IsPerm3dObject"
         Arg="obj" />
   <Prop Name="IsPc3dObject"
         Arg="obj" />
   <Prop Name="IsFp3dObject"
         Arg="obj" />
   <Prop Name="IsPreCrossedSquare"
         Arg="obj" />
<Description>
These are the basic properties for 3d-groups, 
and crossed squares in particular.
</Description>
</ManSection>

<ManSection>
   <Attr Name="Up2DimensionalGroup"
         Arg="XS" />
   <Attr Name="Left2DimensionalGroup"
         Arg="XS" />
   <Attr Name="Down2DimensionalGroup"
         Arg="XS" />
   <Attr Name="Right2DimensionalGroup"
         Arg="XS" />
   <Attr Name="DiagonalAction"
         Arg="XS" />
   <Attr Name="CrossedPairing"
         Arg="XS" />
   <Oper Name="ImageElmCrossedPairing"
         Arg="XS pair" />
<Description>
In this implementation the attributes used in the construction of
a crossed square <C>XS</C> are the four crossed modules (2d-groups) 
on the sides of the square (up; down, left; and right); 
the diagonal action of <M>P</M> on <M>L</M>; 
and the crossed pairing.
<P/>
The &GAP; development team have suggested that crossed pairings should be 
implemented as a special case of <C>BinaryMappings</C> -- a structure 
which does not yet exist in &GAP;.
As a temporary measure, crossed pairings have been implemented using 
<C>Mapping2ArgumentsByFunction</C>.
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> Up2DimensionalGroup( XSconj );
[c5d->d10b]
gap> Right2DimensionalGroup( XSact );
Actor[d10a->d20]
gap> xpconj := CrossedPairing( XSconj );;
gap> ImageElmCrossedPairing( xpconj, [ p2, p12 ] );
(1,9,7,5,3)(2,10,8,6,4)
gap> diag := DiagonalAction( XSact );
[ (1,3,5,2,4)(6,10,14,8,12)(7,11,15,9,13), (1,2,5,4)(6,8,14,12)(7,11,13,9) 
 ] -> 
[ (1,3,5,2,4)(6,10,14,8,12)(7,11,15,9,13), (1,2,5,4)(6,8,14,12)(7,11,13,9) 
 ] -> [ ^(1,3,5,7,9)(2,4,6,8,10), ^(1,2,5,4)(3,8)(6,7,10,9) ]
]]>
</Example>

</Section>



<Section><Heading>Morphisms of crossed squares</Heading>

<Index>morphism of 3d-group</Index>
<Index>crossed square morphism</Index>
<Index>3d-mapping</Index>
This section describes an initial implementation of morphisms of 
(pre-)crossed squares.

<ManSection>
   <Attr Name="Source"
         Arg="map" />
   <Attr Name="Range"
         Arg="map" />
   <Attr Name="Up2DimensionalMorphism"
         Arg="map" />
   <Attr Name="Left2DimensionalMorphism"
         Arg="map" />
   <Attr Name="Down2DimensionalMorphism"
         Arg="map" />
   <Attr Name="Right2DimensionalMorphism"
         Arg="map" />
<Description>
Morphisms of <C>3dObjects</C> are implemented as <C>3dMappings</C>.
These have a pair of 3d-groups as source and range, together with four 
2d-morphisms mapping between the four pairs of crossed modules  
on the four sides of the squares.
These functions return <C>fail</C> when invalid data is supplied.
</Description>
</ManSection>


<ManSection>
   <Prop Name="IsCrossedSquareMorphism"
         Arg="map" />
<!--   <Prop Name="Iscat<M>^2</M>Morphism"    -->
<!--         Arg="map" />             -->
   <Prop Name="IsPreCrossedSquareMorphism"
         Arg="map" />
<!--   <Prop Name="IsPrecat<M>^2</M>Morphism" -->
<!--         Arg="map" />             -->
   <Prop Name="IsBijective"
         Arg="mor" />
   <Prop Name="IsEndomorphism3dObject"
         Arg="mor" />
   <Prop Name="IsAutomorphism3dObject"
         Arg="mor" />
<Description>
A morphism <C>mor</C> between two pre-crossed squares 
<M>\mathcal{S}_{1}</M> and  <M>\mathcal{S}_{2}</M> 
consists of four crossed module morphisms  
<C>Up2DimensionalMorphism(mor)</C>, 
mapping the <C>Up2DimensionalGroup</C> of <M>\mathcal{S}_1</M> 
to that of <M>\mathcal{S}_2</M>, 
<C>Left2DimensionalMorphism(mor)</C>, <C>Down2DimensionalMorphism(mor)</C> 
and <C>Right2DimensionalMorphism(mor)</C>. 
These four morphisms are required to commute with the four boundary maps
and to preserve the rest of the structure. 
The current version of <C>IsCrossedSquareMorphism</C> does not perform all the 
required checks.
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> ad20 := GroupHomomorphismByImages( d20, d20, [p1,p2], [p1,p2^p1] );;
gap> ad10a := GroupHomomorphismByImages( d10a, d10a, [p1^2,p2], [p1^2,p2^p1] );;
gap> ad10b := GroupHomomorphismByImages( d10b, d10b, [p1^2,p12], [p1^2,p12^p1] );;
gap> idc5d := IdentityMapping( c5d );;
gap> upconj := Up2DimensionalGroup( XSconj );;
gap> leftconj := Left2DimensionalGroup( XSconj );; 
gap> downconj := Down2DimensionalGroup( XSconj );; 
gap> rightconj := Right2DimensionalGroup( XSconj );; 
gap> up := XModMorphismByHoms( upconj, upconj, idc5d, ad10b );
[[c5d->d10b] => [c5d->d10b]]
gap> left := XModMorphismByHoms( leftconj, leftconj, idc5d, ad10a );
[[c5d->d10a] => [c5d->d10a]]
gap> down := XModMorphismByHoms( downconj, downconj, ad10a, ad20 );
[[d10a->d20] => [d10a->d20]]
gap> right := XModMorphismByHoms( rightconj, rightconj, ad10b, ad20 );
[[d10b->d20] => [d10b->d20]]
gap> autoconj := CrossedSquareMorphism( XSconj, XSconj, up, left, right, down );; 
gap> ord := Order( autoconj );;
gap> Display( autoconj );
Morphism of crossed squares :- 
:    Source = [c5d->d10b,d10a->d20]
:     Range = [c5d->d10b,d10a->d20]
:     order = 5
:    up-left: [ [ ( 1, 3, 5, 7, 9)( 2, 4, 6, 8,10) ], 
  [ ( 1, 3, 5, 7, 9)( 2, 4, 6, 8,10) ] ]
:   up-right: 
[ [ ( 1, 3, 5, 7, 9)( 2, 4, 6, 8,10), ( 1,10)( 2, 9)( 3, 8)( 4, 7)( 5, 6) ], 
  [ ( 1, 3, 5, 7, 9)( 2, 4, 6, 8,10), ( 1, 2)( 3,10)( 4, 9)( 5, 8)( 6, 7) ] ]
:  down-left: 
[ [ ( 1, 3, 5, 7, 9)( 2, 4, 6, 8,10), ( 2,10)( 3, 9)( 4, 8)( 5, 7) ], 
  [ ( 1, 3, 5, 7, 9)( 2, 4, 6, 8,10), ( 1, 3)( 4,10)( 5, 9)( 6, 8) ] ]
: down-right: 
[ [ ( 1, 2, 3, 4, 5, 6, 7, 8, 9,10), ( 2,10)( 3, 9)( 4, 8)( 5, 7) ], 
  [ ( 1, 2, 3, 4, 5, 6, 7, 8, 9,10), ( 1, 3)( 4,10)( 5, 9)( 6, 8) ] ]
gap> IsAutomorphismHigherDimensionalDomain( autoconj );
true
gap> KnownPropertiesOfObject( autoconj );
[ "CanEasilyCompareElements", "CanEasilySortElements", "IsTotal", 
  "IsSingleValued", "IsInjective", "IsSurjective", 
  "IsPreCrossedSquareMorphism", "IsCrossedSquareMorphism", 
  "IsEndomorphismHigherDimensionalDomain", 
  "IsAutomorphismHigherDimensionalDomain" ]
]]>
</Example>

</Section>

<Section Label="sect-cat2-definitions">
<Heading>Definitions and constructions for cat<M>^2</M>-groups and their morphisms 
</Heading>

<Index>cat2-group</Index>

We shall give three definitions of cat<M>^2</M>-groups 
and show that they are equivalent. 
When we come to define cat<M>^n</M>-groups we shall give a similar set of 
three definitions. 
<P/>
Firstly, we take the definition of a cat<M>^2</M>-group from 
Section 5 of Brown and Loday <Cite Key="brow:lod"/>, suitably modified.
A cat<M>^2</M>-group  <M>\mathcal{C} = (C_{[2]},C_{\{2\}},C_{\{1\}},C_{\emptyset})</M>  
comprises four groups (one for each of the subsets of <M>[2]</M>) 
and <M>15</M> homomorphisms, as shown in the following diagram:
<Display>
<![CDATA[
\vcenter{\xymatrix{
 & C_{[2]} \ar[ddd] <-1.2ex>  \ar[ddd] <-2.0ex>_{\ddot{t}_2,\ddot{h}_2}
     \ar[rrr] <+1.2ex>  \ar[rrr] <+2.0ex>^{\ddot{t}_1,\ddot{h}_1}
     \ar[dddrrr] <-0.2ex>  \ar[dddrrr] <-1.0ex>_(0.55){t_{[2]},h_{[2]}}
    &&&  C_{\{2\}}  \ar[lll]^{\ddot{e}_1}
            \ar[ddd]<+1.2ex>  \ar[ddd] <+2.0ex>^{\dot{t}_2,\dot{h}_2}  \\
\mathcal{C} \quad = \quad
 &  &&&   \\
 &  &&&   \\
 & C_{\{1\}} \ar[uuu]_{\ddot{e}_2}
     \ar[rrr] <-1.2ex>  \ar[rrr] <-2.0ex>_{\dot{t}_1,\dot{h}_1} 
    &&&  C_{\emptyset} \ar[uuu]^{\dot{e}_2}   \ar[lll]_{\dot{e}_1} 
           \ar[uuulll] <-1.0ex>_{e_{[2]}}
 \\
}}
]]></Display>
The following axioms are satisfied by these homomorphisms: 
<List>
<Item>
the four sides of the square are cat<M>^1</M>-groups, denoted 
<M>\ddot{\mathcal{C}}_1, \ddot{\mathcal{C}}_2, 
\dot{\mathcal{C}}_1, \dot{\mathcal{C}}_2</M>,
</Item>
<Item>
<M>
 \dot{t}_1\circ\ddot{h}_2 = \dot{h}_2\circ\ddot{t}_1, ~
 \dot{t}_2\circ\ddot{h}_1 = \dot{h}_1\circ\ddot{t}_2, ~
 \dot{e}_1\circ\dot{t}_2 = \ddot{t}_2\circ\ddot{e}_1, ~
 \dot{e}_2\circ\dot{t}_1 = \ddot{t}_1\circ\ddot{e}_2, ~
 \dot{e}_1\circ\dot{h}_2 = \ddot{h}_2\circ\ddot{e}_1, ~
 \dot{e}_2\circ\dot{h}_1 = \ddot{h}_1\circ\ddot{e}_2,
 </M>
</Item>
<Item>
<M>
 \dot{t}_1\circ\ddot{t}_2 = \dot{t}_2\circ\ddot{t}_1 = t_{[2]}, ~ 
 \dot{h}_1\circ\ddot{h}_2 = \dot{h}_2\circ\ddot{h}_1 = h_{[2]}, ~
 \dot{e}_1\circ\ddot{e}_2 = \dot{e}_2\circ\ddot{e}_1 = e_{[2]},
</M>
making the diagonal a cat<M>^1</M>-group
<M>(e_{[2]}; t_{[2]}, h_{[2]} : C_{[2]} \to C_{\emptyset})</M>.
</Item>
</List>
It follows from these identities that 
<M>(\ddot{t}_1,\dot{t}_1),\,(\ddot{h}_1,\dot{h}_1)</M> 
and <M>(\ddot{e}_1,\dot{e}_1)</M> 
are morphisms of cat<M>^1</M>-groups.
<P/>
Secondly, we give the simplest of the three definitions, 
adapted from Ellis-Steiner <Cite Key="ell:st"/>. 
A cat<M>^2</M>-group  <M>\mathcal{C}</M> consists of groups <M>G, R_1,R_2</M> 
and six homomorphisms 
<M>t_1,h_1 : G \to R_2,~ e_1 : R_2 \to G,~
 t_2,h_2 : G \to R_1,~ e_2 : R_1 \to G</M>,  
satisfying the following axioms for all <M>1 \leqslant i \leqslant 2</M>,
<List>
<Item>
<M>
(t_i \circ e_i)r = r,~ (h_i \circ e_i)r = r,~ 
\forall r \in R_{[2] \setminus \{i\}}, \quad 
[\ker t_i, \ker h_i] = 1, 
</M>
</Item>
<Item>
<M>
(e_1 \circ t_1) \circ (e_2 \circ t_2) = (e_2 \circ t_2) \circ (e_1 \circ t_1), \quad
(e_1 \circ h_1) \circ (e_2 \circ h_2) = (e_2 \circ h_2) \circ (e_1 \circ h_1), 
</M>
</Item>
<Item>
<M>
(e_1 \circ t_1) \circ (e_2 \circ h_2) = (e_2 \circ h_2) \circ (e_1 \circ t_1), \quad 
(e_2 \circ t_2) \circ (e_1 \circ h_1) = (e_1 \circ h_1) \circ (e_2 \circ t_2). 
</M>
</Item>
</List>
<P/>
Our third definition defines a cat<M>^2</M>-group as a 
"cat<M>^1</M>-group of cat<M>^1</M>-groups". 
A cat<M>^2</M>-group <M>\mathcal{C}</M> consists of two cat<M>^1</M>-groups 
<M>\mathcal{C}_1 = (e_1;t_1,h_1 : G_1 \to R_1)</M> and 
<M>\mathcal{C}_2 = (e_2;t_2,h_2 : G_2 \to R_2)</M> and cat<M>^1</M>-morphisms
<M>t = (\ddot{t},\dot{t}),\; h = (\ddot{h},\dot{h}) : 
\mathcal{C}_1 \to \mathcal{C}_2,\; 
e = (\ddot{e},\dot{e}) : \mathcal{C}_2 \to \mathcal{C}_1</M>,  
subject to the following conditions: 
<Display>
(t \circ e) ~\mbox{and}~ (h \circ e)
~\mbox{are the identity mapping on}~ \mathcal{C}_2, 
\qquad  
[\ker t, \ker h] = \{ 1_{\mathcal{C}_1} \},
</Display>
where <M>\ker t = (\ker \ddot{t},\ \ker \dot{t})</M>, 
and similarly for <M>\ker h</M>. 

<ManSection Label="cat2-group">
   <Func Name="Cat2Group"
         Arg="args" />
   <Func Name="PreCat2Group"
         Arg="args" />
   <Oper Name="PreCat2GroupByPreCat1Groups"
         Arg="L" />
<Description>
The global functions <C>Cat2Group</C> and <C>PreCat2Group</C> 
are normally called with a single argument, a list of cat1-groups. 
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> CC6 := Cat2Group( Cat1Group(6,2,2), Cat1Group(6,2,3) );
generating (pre-)cat1-groups:
1 : [C6=>Group( [ f1 ] )]
2 : [C6=>Group( [ f2 ] )]

gap> IsCat2Group( CC6 );
true
]]>
</Example>

<ManSection Label="cat2-xsq">
   <Attr Name="Cat2GroupOfCrossedSquare"
         Arg="xsq" />
   <Attr Name="CrossedSquareOfCat2Group"
         Arg="CC" />
<Description>
<E>These functions are very experimental, and should not be relied on!</E> 
<P/>
These functions provide the conversion from crossed square to cat2-group, 
and conversely.  (They are the 3-dimensional equivalents of 
<C>Cat1GroupOfXMod</C> and <C>XModOfCat1Group</C>.) 
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> xsCC6 := CrossedSquareOfCat2Group( CC6 );
crossed square with:
      up = [Group( () )->Group( [ (1,2) ] )]
    left = [Group( () )->Group( [ (), (3,4,5) ] )]
    down = [Group( [ (), (3,4,5) ] ) -> Group( () )]
   right = [Group( [ (1,2) ] ) -> Group( () )]
gap> Cat2GroupOfCrossedSquare( XSact );
Warning: these conversion functions are still under development
fail
]]>
</Example>

</Section>

<Section Label="sect-catn-definitions">
<Heading>
Definition and constructions for cat<M>^n</M>-groups and their morphisms 
</Heading>

<Index>catn-group</Index>
In this chapter we are interested in cat<M>^2</M>-groups, 
but it is convenient in this section to give the more general definition. 
There are three equivalent description of a cat<M>^n</M>-group. 
<P/>
A <E>cat<M>^n</M>-group</E> consists of the following. 
<List>
<Item>
<M>2^n</M> groups  <M>G_A</M>, one for each subset <M>A</M> of <M>[n]</M>, 
the <E>vertices</E> of an <M>n</M>-cube. 
</Item>
<Item>
Group homomorphisms forming <M>n2^{n-1}</M> commuting cat<M>^1</M>-groups, 
<Display>
\mathcal{C}_{A,i} ~=~ (e_{A,i};\; t_{A,i},\; h_{A,i} \ :\  
G_A \to G_{A \setminus \{i\}}), 
\quad\mbox{for all} \quad A \subseteq [n],~ i \in A,  
</Display>
the <E>edges</E> of the cube. 
</Item>
<Item> 
These cat<M>^1</M>-groups combine (in sets of <M>4</M>) 
to form <M>n(n-1)2^{n-3}</M> cat<M>^2</M>-groups <M>\mathcal{C}_{A,\{i,j\}}</M> 
for all <M>\{i,j\} \subseteq A \subseteq [n],~ i \neq j</M>, 
the <E>faces</E> of the cube. 
</Item>
</List>
Note that, since the <M>t_{A,i}, h_{A,i}</M> and <M>e_{A,i}</M> commute, 
composite homomorphisms
<M>t_{A,B}, h_{A,B} : G_A \to G_{A \setminus B}</M> and 
<M>e_{A,B} : G_{A \setminus B} \to G_A</M> 
are well defined for all <M>B \subseteq A \subseteq [n]</M>.  
<P/>
Secondly, we give the simplest of the three descriptions, 
again adapted from Ellis-Steiner <Cite Key="ell:st"/>. 
<P/>
A cat<M>^n</M>-group  <M>\mathcal{C}</M> consists of <M>2^n</M> groups 
<M>G_A</M>, one for each subset  <M>A</M>  of  <M>[n]</M>, 
and <M>3n</M> homomorphisms 
<Display>
t_{[n],i}, h_{[n],i} : G_{[n]} \to G_{[n] \setminus \{i\}},~ 
 e_{[n],i} : G_{[n] \setminus \{i\}} \to G_{[n]}, 
</Display>
satisfying the following axioms for all <M>1 \leqslant i \leqslant n</M>,}  
<List>
<Item>
the 
<M>\mathcal{C}_{[n],i} ~=~ (e_{[n],i};\; t_{[n],i},\; h_{[n],i} \ :\  
G_{[n]} \to G_{[n] \setminus \{i\}})~</M>
are <E>commuting</E> cat<M>^1</M>-groups, so that: 
</Item>
<Item> 
<M>
(e_1 \circ t_1) \circ (e_2 \circ t_2) = (e_2 \circ t_2) \circ (e_1 \circ t_1), \quad
(e_1 \circ h_1) \circ (e_2 \circ h_2) = (e_2 \circ h_2) \circ (e_1 \circ h_1), 
</M>
</Item>
<Item> 
<M>
(e_1 \circ t_1) \circ (e_2 \circ h_2) = (e_2 \circ h_2) \circ (e_1 \circ t_1), \quad 
(e_2 \circ t_2) \circ (e_1 \circ h_1) = (e_1 \circ h_1) \circ (e_2 \circ t_2). 
</M>
</Item>
</List>
Our third description defines a cat<M>^n</M>-group as a 
"cat<M>^1</M>-group of cat<M>^{(n-1)}</M>-groups". 
<P/>
A <E>cat<M>^n</M>-group</E> <M>\mathcal{C}</M> 
consists of two cat<M>^{(n-1)}</M>-groups: 
<List>
<Item>
<M>\mathcal{A}</M> with groups <M>G_A,\; A \subseteq [n-1]</M>, 
and homomorphisms <M>\ddot{t}_{A,i}, \ddot{h}_{A,i}, \ddot{e}_{A,i}</M>,  
</Item>
<Item> 
<M>\mathcal{B}</M> with groups <M>H_B,\; B \subseteq [n-1]</M>,
and homomorphisms <M>\dot{t}_{B,i}, \dot{h}_{B,i}, \dot{e}_{B,i}</M>, and 
</Item>
<Item> 
cat<M>^{(n-1)}</M>-morphisms <M>t,h : \mathcal{A} \to \mathcal{B}</M> 
and <M>e : \mathcal{B} \to \mathcal{A}</M>
subject to the following conditions: 
<Display>
(t \circ e) ~\mbox{and}~ (h \circ e)  
~\mbox{are the identity mapping on}~ \mathcal{B}, \qquad
[\ker t, \ker h] = \{ 1_{\mathcal{A}} \}.
</Display>
</Item>
</List> 

</Section> 

</Chapter>
