  
  [1X7 Crossed squares and their morphisms[0X
  
  Crossed  squares  were  introduced  by  Guin-Wal\'ery  and  Loday  (see, for
  example,  [BL87])  as  fundamental crossed squares of commutative squares of
  spaces,  but are also of purely algebraic interest. We denote by [n] the set
  {1,2,...,n}.  We  use the n=2 version of the definition of crossed n-cube as
  given by Ellis and Steiner [ES87].
  
  A [13Xcrossed square[0m mathcalR consists of the following:
  
  --    Groups R_J for each of the four subsets J subseteq [2];
  
  --    a commutative diagram of group homomorphisms:
  
  
             \ddot{\partial}_1 : R_{[2]} \to R_{\{2\}}, \quad
             \ddot{\partial}_2 : R_{[2]} \to R_{\{1\}}, \quad
             \dot{\partial}_1 : R_{\{1\}} \to R_{\emptyset}, \quad
             \dot{\partial}_2 : R_{\{2\}} \to R_{\emptyset};
  
  
  --    actions  of  R_emptyset  on  R_{1},  R_{2}  and  R_[2] which determine
        actions  of  R_{1}  on R_{2} and R_[2] via dotpartial_1 and actions of
        R_{2} on R_{1} and R_[2] via dotpartial_2~;
  
  --    a function ~ boxtimes : R_{1} x R_{2} -> R_[2]~.
  
  The  following  axioms  must  be  satisfied for all l in R_[2], m,m_1,m_2 in
  R_{1}, n,n_1,n_2 in R_{2}, p in R_emptyset~:
  
  --    the  homomorphisms ddotpartial_1, ddotpartial_2 preserve the action of
        R_emptyset~;
  
  --    each of
  
  
             \ddot{\mathcal{R}}_1 = (\ddot{\partial}_1 : R_{[2]} \to
             R_{\{2\}}),~ \ddot{\mathcal{R}}_2 = (\ddot{\partial}_2 :
             R_{[2]} \to R_{\{1\}}), ~ \dot{\mathcal{R}}_1 =
             (\dot{\partial}_1 : R_{\{1\}} \to R_{\emptyset}),~
             \dot{\mathcal{R}}_2 = (\dot{\partial}_2 : R_{\{2\}} \to
             R_{\emptyset}),
  
  
        and the diagonal
  
  
             \mathcal{R}_{12} = (\partial_{12} :=
             \dot{\partial}_1\ddot{\partial}_2 =
             \dot{\partial}_2\ddot{\partial}_1 : R_{[2]} \to
             R_{\emptyset})
  
  
        are crossed modules (with actions via R_emptyset);
  
  --    boxtimes is a \emph{crossed pairing}:
  
  --          (m_1m_2 boxtimes n) = (m_1 boxtimes n)^m_2 (m_2 boxtimes n)~,
  
  --          (m boxtimes n_1n_2) = (m boxtimes n_2) (m boxtimes n_1)^n_2~,
  
  --          (m boxtimes n)^p = (m^p boxtimes n^p)~;
  
  --    ddotpartial_1  (m  boxtimes  n)  =  (n^-1)^m  n \quad \mbox{and} \quad
        ddotpartial_2 (m boxtimes n) = m^-1 m^n~,
  
  --    (m  boxtimes  ddotpartial_1  l)  =  (l^-1)^m  l \quad \mbox{and} \quad
        (ddotpartial_2 l boxtimes n) = l^-1 l^n~.
  
  Note  that  the  actions of R_{1} on R_{2} and R_{2} on R_{1} via R_emptyset
  are compatible since
  
  
       {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~.
  
  
  
  [1X7.1 Constructions for crossed squares[0X
  
  Analogously  to the data structure used for crossed modules, crossed squares
  are  implemented  as [10X3d-objects[0m. When times allows, cat2-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 do.
  
  [1X7.1-1 XSq[0m
  
  [2X> XSq( [0X[3Xargs[0X[2X ) ______________________________________________________[0Xfunction
  [2X> XSqByNormalSubgroups( [0X[3XP, N, M, L[0X[2X ) ______________________________[0Xoperation
  [2X> ActorXSq( [0X[3XX0[0X[2X ) __________________________________________________[0Xoperation
  [2X> Transpose3dObject( [0X[3XS0[0X[2X ) _________________________________________[0Xattribute
  [2X> Name( [0X[3XS0[0X[2X ) ______________________________________________________[0Xattribute
  
  Here are some standard examples of crossed squares.
  
  --    If  M,  N are normal subgroups of a group P, and L = M cap N, then the
        four  inclusions, L -> N,~ L -> M,~ M -> P,~ N -> P, together with the
        actions  of  P  on  M,  N  and L given by conjugation, and the crossed
        pairing
  
  
             \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
  
  
        is   a   crossed   square.   This   construction   is  implemented  as
        [10XXSqByNormalSubgroups(P,N,M,L);[0m.
  
  --    The actor mathcalA(mathcalX_0) of a crossed module mathcalX_0 has been
        described in Chapter 5. The crossed pairing is given by
  
  
             \boxtimes \;:\; R \times W \,\to\, S, \quad (r,\chi)
             \,\mapsto\, \chi r~.
  
  
        This is implemented as [10XActorXSq( X0 );[0m.
  
  --    The  [13Xtranspose[0m  of  mathcalR  is  the  crossed  square  tildemathcalR}
        obtained   by  interchanging  R_{1}  with  R_{2},  ddotpartial_1  with
        ddotpartial_2, and dotpartial_1 with dotpartial_2. The crossed pairing
        is given by
  
  
             \tilde{\boxtimes} \;:\; R_{\{2\}} \times R_{\{1\}} \to
             R_{[2]}, \quad (n,m) \;\mapsto\; n\,\tilde{\boxtimes}\,m :=
             (m \boxtimes n)^{-1}~.
  
  
  The following constructions will be implemented in the next release.
  
  --    If  M, N are ordinary P-modules and A is an arbitrary abelian group on
        which P acts trivially, then there is a crossed square with sides
  
  
             0 : A \to N,\quad 0 : A \to M,\quad 0 : M \to P,\quad 0 : N
             \to P.
  
  
  --    For  a  group  L, the automorphism crossed module Act L = (iota : L ->
        Aut  L)  splits  to  form the square with (iota_1 : L -> Inn L) on two
        sides,  and  (iota_2  :  Inn L -> Aut L) on the other two sides, where
        iota_1  maps  l in L to the inner automorphism beta_l : L -> L, l^' ->
        l^-1l^'l,  and  $\iota_2$  is  the  inclusion  of  Inn L in Aut L. The
        actions are standard, and the crossed pairing is
  
  
             \boxtimes \;:\; {\rm Inn}\ L \times {\rm Inn}\ L \to L,
             \quad (\beta_l, \beta_{l^{\prime}}) \;\mapsto\; [l,
             l^{\prime}]~.
  
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X[0X
    [4Xgap> c := (11,12,13,14,15,16);;[0X
    [4Xgap> d := (12,16)(13,15);;[0X
    [4Xgap> cd := c*d;;[0X
    [4Xgap> d12 := Group( [ c, d ] );;[0X
    [4Xgap> s3a := Subgroup( d12, [ c^2, d ] );;[0X
    [4Xgap> s3b := Subgroup( d12, [ c^2, cd ] );;[0X
    [4Xgap> c3 := Subgroup( d12, [ c^2 ] );;[0X
    [4Xgap> SetName( d12, "d12");  SetName( s3a, "s3a" );[0X
    [4Xgap> SetName( s3b, "s3b" );  SetName( c3, "c3" );[0X
    [4Xgap> XSconj := XSqByNormalSubgroups( d12, s3b, s3a, c3 );[0X
    [4X[  c3 -> s3b ][0X
    [4X[  |      |  ][0X
    [4X[ s3a -> d12 ][0X
    [4Xgap> Name( XSconj );[0X
    [4X"[c3->s3b,s3a->d12]"[0X
    [4Xgap> XStrans := Transpose3dObject( XSconj );[0X
    [4X[  c3 -> s3a ][0X
    [4X[  |      |  ][0X
    [4X[ s3b -> d12 ][0X
    [4Xgap> X12 := XModByNormalSubgroup( d12, s3a );[0X
    [4X[s3a->d12][0X
    [4Xgap> XSact := ActorXSq( X12 );[0X
    [4Xcrossed square with:[0X
    [4X      up = Whitehead[s3a->d12][0X
    [4X    left = [s3a->d12][0X
    [4X   right = Actor[s3a->d12][0X
    [4X    down = Norrie[s3a->d12][0X
    [4X[0X
  [4X------------------------------------------------------------------[0X
  
  [1X7.1-2 IsXSq[0m
  
  [2X> IsXSq( [0X[3Xobj[0X[2X ) _____________________________________________________[0Xproperty
  [2X> Is3dObject( [0X[3Xobj[0X[2X ) ________________________________________________[0Xproperty
  [2X> IsPerm3dObject( [0X[3Xobj[0X[2X ) ____________________________________________[0Xproperty
  [2X> IsPc3dObject( [0X[3Xobj[0X[2X ) ______________________________________________[0Xproperty
  [2X> IsFp3dObject( [0X[3Xobj[0X[2X ) ______________________________________________[0Xproperty
  [2X> IsPreXSq( [0X[3Xobj[0X[2X ) __________________________________________________[0Xproperty
  
  These  are  the  basic  properties  for  3dobjects,  and  crossed squares in
  particular.
  
  [1X7.1-3 Up2dObject[0m
  
  [2X> Up2dObject( [0X[3XXS[0X[2X ) ________________________________________________[0Xattribute
  [2X> Left2dObject( [0X[3XXS[0X[2X ) ______________________________________________[0Xattribute
  [2X> Down2dObject( [0X[3XXS[0X[2X ) ______________________________________________[0Xattribute
  [2X> Right2dObject( [0X[3XXS[0X[2X ) _____________________________________________[0Xattribute
  [2X> DiagonalAction( [0X[3XXS[0X[2X ) ____________________________________________[0Xattribute
  [2X> XPair( [0X[3XXS[0X[2X ) _____________________________________________________[0Xattribute
  [2X> ImageElmXPair( [0X[3XXS, pair[0X[2X ) _______________________________________[0Xoperation
  
  In  this implementation the attributes used in the construction of a crossed
  square  [10XXS[0m  are  the  four  crossed modules (2d-objects) on the sides of the
  square; the diagonal action of P on L, and the crossed pairing.
  
  The  [5XGAP[0m  development  team  have  suggested that crossed pairings should be
  implemented  as  a  special case of [10XBinaryMappings[0m -- a structure which does
  not  yet  exist  in  [5XGAP[0m. As a temporary measure, crossed pairings have been
  implemented using [10XMapping2ArgumentsByFunction[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X[0X
    [4Xgap> Up2dObject( XSconj );[0X
    [4X[c3->s3b][0X
    [4Xgap> Right2dObject( XSact );[0X
    [4XActor[s3a->d12][0X
    [4Xgap> xpconj := XPair( XSconj );;[0X
    [4Xgap> ImageElmXPair( xpconj, [ (1,6)(2,5)(3,4), (2,6)(3,5) ] );[0X
    [4X(1,3,5)(2,4,6)[0X
    [4Xgap> diag := DiagonalAction( XSact );[0X
    [4X[ (2,3)(6,8)(7,9), (1,2)(4,6)(5,7) ] ->[0X
    [4X[ [ (11,13,15)(12,14,16), (12,16)(13,15) ] ->[0X
    [4X    [ (11,15,13)(12,16,14), (12,16)(13,15) ],[0X
    [4X  [ (11,13,15)(12,14,16), (12,16)(13,15) ] ->[0X
    [4X    [ (11,15,13)(12,16,14), (11,13)(14,16) ] ][0X
    [4X[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X7.2 Morphisms of crossed squares[0X
  
  This   section   describes   an   initial  implementation  of  morphisms  of
  (pre-)crossed squares.
  
  [1X7.2-1 Source[0m
  
  [2X> Source( [0X[3Xmap[0X[2X ) ___________________________________________________[0Xattribute
  [2X> Range( [0X[3Xmap[0X[2X ) ____________________________________________________[0Xattribute
  [2X> Up2dMorphism( [0X[3Xmap[0X[2X ) _____________________________________________[0Xattribute
  [2X> Left2dMorphism( [0X[3Xmap[0X[2X ) ___________________________________________[0Xattribute
  [2X> Down2dMorphism( [0X[3Xmap[0X[2X ) ___________________________________________[0Xattribute
  [2X> Right2dMorphism( [0X[3Xmap[0X[2X ) __________________________________________[0Xattribute
  
  Morphisms  of  [10X3dObjects[0m are implemented as [10X3dMappings[0m. These have a pair of
  3d-objects  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 [10Xfail[0m when invalid data is supplied.
  
  [1X7.2-2 IsXSqMorphism[0m
  
  [2X> IsXSqMorphism( [0X[3Xmap[0X[2X ) _____________________________________________[0Xproperty
  [2X> IsPreXSqMorphism( [0X[3Xmap[0X[2X ) __________________________________________[0Xproperty
  [2X> IsBijective( [0X[3Xmor[0X[2X ) _______________________________________________[0Xproperty
  [2X> IsAutomorphism3dObject( [0X[3Xmor[0X[2X ) ____________________________________[0Xproperty
  
  A  morphism  [10Xmor[0m  between  two pre-crossed squares mathcalR_1 and mathcalR_2
  consists  of  four crossed module morphisms [10XUp2dMorphism( mor )[0m, mapping the
  [10XUp2dObject[0m  of  mathcalR_1  to  that  of  mathcalR_2, [10XLeft2dMorphism( mor )[0m,
  [10XDown2dMorphism(  mor  )[0m and [10XRight2dMorphism( mor )[0m. These four morphisms are
  required  to commute with the four boundary maps and to preserve the rest of
  the structure. The current version of [10XIsXSqMorphism[0m does not perform all the
  required checks.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X[0X
    [4Xgap> ad12 := GroupHomomorphismByImages( d12, d12, [c,d], [c,d^c] );;[0X
    [4Xgap> as3a := GroupHomomorphismByImages( s3a, s3a, [c^2,d], [c^2,d^c] );;[0X
    [4Xgap> as3b := GroupHomomorphismByImages( s3b, s3b, [c^2,cd], [c^2,cd^c] );;[0X
    [4Xgap> idc3 := IdentityMapping( c3 );;[0X
    [4Xgap> upconj := Up2dObject( XSconj );;[0X
    [4Xgap> leftconj := Left2dObject( XSconj );; [0X
    [4Xgap> downconj := Down2dObject( XSconj );; [0X
    [4Xgap> rightconj := Right2dObject( XSconj );; [0X
    [4Xgap> up := XModMorphismByHoms( upconj, upconj, idc3, as3b );[0X
    [4X[[c3->s3b] => [c3->s3b]][0X
    [4Xgap> left := XModMorphismByHoms( leftconj, leftconj, idc3, as3a );[0X
    [4X[[c3->s3a] => [c3->s3a]][0X
    [4Xgap> down := XModMorphismByHoms( downconj, downconj, as3a, ad12 );[0X
    [4X[[s3a->d12] => [s3a->d12]][0X
    [4Xgap> right := XModMorphismByHoms( rightconj, rightconj, as3b, ad12 );[0X
    [4X[[s3b->d12] => [s3b->d12]][0X
    [4Xgap> autoconj := XSqMorphism( XSconj, XSconj, up, left, down, right );; [0X
    [4Xgap> ord := Order( autoconj );;[0X
    [4Xgap> Display( autoconj );[0X
    [4XMorphism of crossed squares :-[0X
    [4X:    Source = [c3->s3b,s3a->d12][0X
    [4X:     Range = [c3->s3b,s3a->d12][0X
    [4X:     order = 3[0X
    [4X:    up-left: [ [ (11,13,15)(12,14,16) ], [ (11,13,15)(12,14,16) ] ][0X
    [4X:   up-right: [ [ (11,13,15)(12,14,16), (11,16)(12,15)(13,14) ],[0X
    [4X  [ (11,13,15)(12,14,16), (11,12)(13,16)(14,15) ] ][0X
    [4X:  down-left: [ [ (11,13,15)(12,14,16), (12,16)(13,15) ],[0X
    [4X  [ (11,13,15)(12,14,16), (11,13)(14,16) ] ][0X
    [4X: down-right: [ [ (11,12,13,14,15,16), (12,16)(13,15) ],[0X
    [4X  [ (11,12,13,14,15,16), (11,13)(14,16) ] ][0X
    [4Xgap> KnownPropertiesOfObject( autoconj );[0X
    [4X[ "IsTotal", "IsSingleValued", "IsInjective", "IsSurjective", "Is3dMapping",[0X
    [4X  "IsPreXSqMorphism", "IsXSqMorphism", "IsEndomorphism3dObject" ][0X
    [4Xgap> IsAutomorphism3dObject( autoconj );[0X
    [4Xtrue[0X
    [4X[0X
  [4X------------------------------------------------------------------[0X
  
