  
  [1X16 Functors[0X
  
  Functors  and  their  natural  transformations  form the heart of the [5Xhomalg[0m
  package.  Usually,  a  functor  is realized in computer algebra systems as a
  procedure  which  can  be applied to a certain type of objects. In [BR08] it
  was  explained how to implement a functor of abelian categories -- by itself
  --  as  an object which can be further manipulated (composed, derived, ...).
  So in addition to the constructor [2XCreateHomalgFunctor[0m ([14X16.2-1[0m) which is used
  to  create  functors  from  scratch,  [5Xhomalg[0m  provides  further  easy-to-use
  constructors to create new functors out of existing ones:
  
  --    [2XInsertObjectInMultiFunctor[0m ([14X16.2-2[0m)
  
  --    [2XRightSatelliteOfCofunctor[0m ([14X16.2-3[0m)
  
  --    [2XLeftSatelliteOfFunctor[0m ([14X16.2-4[0m)
  
  --    [2XRightDerivedCofunctor[0m ([14X16.2-5[0m)
  
  --    [2XLeftDerivedFunctor[0m ([14X16.2-6[0m)
  
  --    [2XComposeFunctors[0m ([14X16.2-7[0m)
  
  In [5Xhomalg[0m each functor is implemented as a [5XGAP4[0m object.
  
  So-called  installers  (-->  [2XInstallFunctor[0m ([14X16.7-2[0m) and [2XInstallDeltaFunctor[0m
  ([14X16.7-3[0m)) take such a functor object and create operations in order to apply
  the  functor  on  objects,  morphisms,  complexes  (of  objects  or again of
  complexes),  and  chain  maps.  The  installer  [2XInstallDeltaFunctor[0m ([14X16.7-3[0m)
  creates  additional  operations  for  delta-functors  in  order  to  compute
  connecting   homomorphisms,  exact  triangles,  and  associated  long  exact
  sequences by starting with a short exact sequence.
  
  In  [5Xhomalg[0m  special emphasis is laid on the action of functors on [13Xmorphisms[0m,
  as  an  essential  part  of the very definition of a functor. This is for no
  obvious  reason often neglected in computer algebra systems. Starting from a
  functor  where  the  action  on  morphisms  is  also  defined, all the above
  constructors  again  create  functors  with  actions  both on objects and on
  morphisms (and hence on chain complexes and chain maps).
  
  It  turned  out  that  in  a  variety  of situations a caching mechanism for
  functors  is  not  only  extremely  useful (e.g. to avoid repeated expensive
  computations)  but  also  an  absolute  necessity for the coherence of data.
  Functors in [5Xhomalg[0m are therefore endowed with a caching mechanism.
  
  If  R  is  a [5Xhomalg[0m ring in which the component R!.[10XByASmallerPresentation[0m is
  set to true
  [10XR!.ByASmallerPresentation := true[0m;
  any   functor   which   returns   an   object   over   R  will  first  apply
  [2XByASmallerPresentation[0m ([14X9.5-2[0m) to its result before returning it.
  
  One  of  the  highlights  in  [5Xhomalg[0m  is  the  computation of Grothendieck's
  spectral  sequences  connecting  the  composition  of the derivations of two
  functors with the derived functor of their composite.
  
  
  [1X16.1 Functors: Category and Representations[0X
  
  [1X16.1-1 IsHomalgFunctor[0m
  
  [2X> IsHomalgFunctor( [0X[3XF[0X[2X ) _____________________________________________[0XCategory
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  The [5XGAP[0m category of [5Xhomalg[0m (multi-)functors.
  
  [1X16.1-2 IsHomalgFunctorRep[0m
  
  [2X> IsHomalgFunctorRep( [0X[3XE[0X[2X ) ____________________________________[0XRepresentation
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  The [5XGAP[0m representation of [5Xhomalg[0m (multi-)functors.
  
  (It is a representation of the [5XGAP[0m category [2XIsHomalgFunctor[0m ([14X16.1-1[0m).)
  
  
  [1X16.2 Functors: Constructors[0X
  
  [1X16.2-1 CreateHomalgFunctor[0m
  
  [2X> CreateHomalgFunctor( [0X[3Xlist1, list2, ...[0X[2X ) _________________________[0Xfunction
  [6XReturns:[0X  a [5Xhomalg[0m functor
  
  This  constructor  is used to create functors for [5Xhomalg[0m from scratch. [3XlistN[0m
  is  of  the  form [3XlistN = [ stringN, valueN ][0m. [3XstringN[0m will be the name of a
  component  of  the  created  functor  and  [3XvalueN[0m  will  be  its value. This
  constructor  is  listed here for the sake of completeness. Its documentation
  is  rather  better  placed  in  a  [5Xhomalg[0m  programmers  guide. The remaining
  constructors  create new functors out of existing ones and are probably more
  interesting for end users.
  
  The constructor does [13Xnot[0m invoke [2XInstallFunctor[0m ([14X16.7-2[0m). This has to be done
  manually!
  
  [1X16.2-2 InsertObjectInMultiFunctor[0m
  
  [2X> InsertObjectInMultiFunctor( [0X[3XF, p, obj, H[0X[2X ) ______________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m functor
  
  Given a [5Xhomalg[0m multi-functor [3XF[0m with multiplicity m and a string [3XH[0m return the
  functor  [10XFunctor_[0m[3XH[0m  :=  [3XF[0m(...,[3Xobj[0m,...),  where  [3Xobj[0m  is inserted at the [3Xp[0m-th
  position.  Of course [3Xobj[0m must be an object (e.g. ring, module, ...) that can
  be  inserted  at  this particular position. The string [3XH[0m becomes the name of
  the  returned  functor  (--> [2XNameOfFunctor[0m ([14X16.7-1[0m)). The variable [10XFunctor_[0m[3XH[0m
  will automatically be assigned if free, otherwise a warning is issued.
  
  The constructor automatically invokes [2XInstallFunctor[0m ([14X16.7-2[0m) which installs
  several necessary operations under the name [3XH[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> ZZ * 1;[0X
    [4X<The free right module of rank 1 on a free generator>[0X
    [4Xgap> InsertObjectInMultiFunctor( Functor_Hom, 2, ZZ * 1, "Hom_ZZ" );[0X
    [4X<The functor Hom_ZZ>[0X
    [4Xgap> Functor_Hom_ZZ;	## got automatically defined[0X
    [4X<The functor Hom_ZZ>[0X
    [4Xgap> Hom_ZZ;		## got automatically defined[0X
    [4X<Operation "Hom_ZZ">[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.2-3 RightSatelliteOfCofunctor[0m
  
  [2X> RightSatelliteOfCofunctor( [0X[3XF[, p][, H][0X[2X ) ________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m functor
  
  Given  a  [5Xhomalg[0m (multi-)functor [3XF[0m and a string [3XH[0m return the right satellite
  of  [3XF[0m  with  respect to its [3Xp[0m-th argument. [3XF[0m is assumed contravariant in its
  [3Xp[0m-th  argument.  The  string [3XH[0m becomes the name of the returned functor (-->
  [2XNameOfFunctor[0m  ([14X16.7-1[0m)).  The  variable  [10XFunctor_[0m[3XH[0m  will  automatically  be
  assigned if free, otherwise a warning is issued.
  
  If  [3Xp[0m is not specified it is assumed 1. If the string [3XH[0m is not specified the
  letter  'S'  is  added  to  the  left  of  the  name of [3XF[0m (--> [2XNameOfFunctor[0m
  ([14X16.7-1[0m)).
  
  The constructor automatically invokes [2XInstallFunctor[0m ([14X16.7-2[0m) which installs
  several necessary operations under the name [3XH[0m.
  
  Below  is  the only [13Xspecific[0m line of code used to define [10XFunctor_Ext[0m and all
  the different operations [10XExt[0m in [5Xhomalg[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XRightSatelliteOfCofunctor( Functor_Hom, "Ext" );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.2-4 LeftSatelliteOfFunctor[0m
  
  [2X> LeftSatelliteOfFunctor( [0X[3XF[, p][, H][0X[2X ) ___________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m functor
  
  Given a [5Xhomalg[0m (multi-)functor [3XF[0m and a string [3XH[0m return the left satellite of
  [3XF[0m  with  respect  to  its  [3Xp[0m-th argument. [3XF[0m is assumed covariant in its [3Xp[0m-th
  argument.  The  string  [3XH[0m  becomes  the  name  of  the returned functor (-->
  [2XNameOfFunctor[0m  ([14X16.7-1[0m)).  The  variable  [10XFunctor_[0m[3XH[0m  will  automatically  be
  assigned if free, otherwise a warning is issued.
  
  If  [3Xp[0m is not specified it is assumed 1. If the string [3XH[0m is not specified the
  string  "S_"  is  added  to  the  left  of  the name of [3XF[0m (--> [2XNameOfFunctor[0m
  ([14X16.7-1[0m)).
  
  The constructor automatically invokes [2XInstallFunctor[0m ([14X16.7-2[0m) which installs
  several necessary operations under the name [3XH[0m.
  
  Below  is  the only [13Xspecific[0m line of code used to define [10XFunctor_Tor[0m and all
  the different operations [10XTor[0m in [5Xhomalg[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XLeftSatelliteOfFunctor( Functor_TensorProduct, "Tor" );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.2-5 RightDerivedCofunctor[0m
  
  [2X> RightDerivedCofunctor( [0X[3XF[, p][, H][0X[2X ) ____________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m functor
  
  Given  a  [5Xhomalg[0m  (multi-)functor  [3XF[0m and a string [3XH[0m return the right derived
  functor  of  [3XF[0m with respect to its [3Xp[0m-th argument. [3XF[0m is assumed contravariant
  in  its [3Xp[0m-th argument. The string [3XH[0m becomes the name of the returned functor
  (-->  [2XNameOfFunctor[0m  ([14X16.7-1[0m)). The variable [10XFunctor_[0m[3XH[0m will automatically be
  assigned if free, otherwise a warning is issued.
  
  If  [3Xp[0m is not specified it is assumed 1. If the string [3XH[0m is not specified the
  letter  'R'  is  added  to  the  left  of  the  name of [3XF[0m (--> [2XNameOfFunctor[0m
  ([14X16.7-1[0m)).
  
  The   constructor   automatically   invokes   [2XInstallFunctor[0m   ([14X16.7-2[0m)  and
  [2XInstallDeltaFunctor[0m  ([14X16.7-3[0m)  which  install  several  necessary operations
  under the name [3XH[0m.
  
  Below  is the only [13Xspecific[0m line of code used to define [10XFunctor_RHom[0m and all
  the different operations [10XRHom[0m in [5Xhomalg[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XRightDerivedCofunctor( Functor_Hom );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.2-6 LeftDerivedFunctor[0m
  
  [2X> LeftDerivedFunctor( [0X[3XF[, p][, H][0X[2X ) _______________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m functor
  
  Given  a  [5Xhomalg[0m  (multi-)functor  [3XF[0m  and a string [3XH[0m return the left derived
  functor  of  [3XF[0m  with respect to its [3Xp[0m-th argument. [3XF[0m is assumed covariant in
  its  [3Xp[0m-th  argument.  The  string [3XH[0m becomes the name of the returned functor
  (-->  [2XNameOfFunctor[0m  ([14X16.7-1[0m)). The variable [10XFunctor_[0m[3XH[0m will automatically be
  assigned if free, otherwise a warning is issued.
  
  If  [3Xp[0m is not specified it is assumed 1. If the string [3XH[0m is not specified the
  letter  "S_"  is  added  to  the  left  of  the name of [3XF[0m (--> [2XNameOfFunctor[0m
  ([14X16.7-1[0m)).
  
  The   constructor   automatically   invokes   [2XInstallFunctor[0m   ([14X16.7-2[0m)  and
  [2XInstallDeltaFunctor[0m  ([14X16.7-3[0m)  which  install  several  necessary operations
  under the name [3XH[0m.
  
  Below    is    the   only   [13Xspecific[0m   line   of   code   used   to   define
  [10XFunctor_LTensorProduct[0m  and  all  the different operations [10XLTensorProduct[0m in
  [5Xhomalg[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XLeftDerivedFunctor( Functor_TensorProduct );[0X
  [4X------------------------------------------------------------------[0X
  
  Below  is  the only [13Xspecific[0m line of code used to define [10XFunctor_LHomHom[0m and
  all the different operations [10XLHomHom[0m in [5Xhomalg[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XLeftDerivedFunctor( Functor_HomHom );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.2-7 ComposeFunctors[0m
  
  [2X> ComposeFunctors( [0X[3XF[, p], G[, H][0X[2X ) _______________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m functor
  
  Given two [5Xhomalg[0m (multi-)functors [3XF[0m and [3XG[0m and a string [3XH[0m return the composed
  functor  [10XFunctor_[0m[3XH[0m  :=  [3XF[0m(...,[3XG[0m(...),...),  where  [3XG[0m is inserted at the [3Xp[0m-th
  position.  Of  course  [3XG[0m  must  be  a  functor  that can be inserted at this
  particular  position.  The string [3XH[0m becomes the name of the returned functor
  (-->  [2XNameOfFunctor[0m  ([14X16.7-1[0m)). The variable [10XFunctor_[0m[3XH[0m will automatically be
  assigned if free, otherwise a warning is issued.
  
  If  [3Xp[0m is not specified it is assumed 1. If the string [3XH[0m is not specified the
  names  of  [3XF[0m  and  [3XG[0m  are  concatenated  in  this  order  (--> [2XNameOfFunctor[0m
  ([14X16.7-1[0m)).
  
  [3XF[0m * [3XG[0m is a shortcut for [10XComposeFunctors[0m([3XF[0m,1,[3XG[0m).
  
  The constructor automatically invokes [2XInstallFunctor[0m ([14X16.7-2[0m) which installs
  several necessary operations under the name [3XH[0m.
  
  Below  is  the  only [13Xspecific[0m line of code used to define [10XFunctor_HomHom[0m and
  all the different operations [10XHomHom[0m in [5Xhomalg[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XFunctor_Hom * Functor_Hom;[0X
  [4X------------------------------------------------------------------[0X
  
  Check this:
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> Functor_Hom * Functor_TensorProduct;[0X
    [4X<The functor HomTensorProduct>[0X
    [4Xgap> Functor_HomTensorProduct;	## got automatically defined[0X
    [4X<The functor HomTensorProduct>[0X
    [4Xgap> HomTensorProduct;		## got automatically defined[0X
    [4X<Operation "HomTensorProduct">[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X16.3 Functors: Attributes[0X
  
  [1X16.3-1 Genesis[0m
  
  [2X> Genesis( [0X[3XF[0X[2X ) ____________________________________________________[0Xattribute
  [6XReturns:[0X  a list
  
  The  first entry of the returned list is the name of the constructor used to
  create  the  functor  [3XF[0m.  The reset of the list contains arguments that were
  passed to this constructor for creating [3XF[0m.
  
  These  are  examples  of  different  functors  created  using  the different
  constructors:
  
  --    [10XCreateHomalgFunctor[0m:
  
        [4X------------------------  Example  ------------------------[0X
          [4Xgap> Functor_Hom;[0X
          [4X<The functor Hom>[0X
          [4Xgap> Genesis( Functor_Hom );[0X
          [4X[ "CreateHomalgFunctor", [ "name", "Hom" ], [ "number_of_arguments", 2 ],[0X
          [4X  [ "1", [ [ "contravariant", "right adjoint", "distinguished" ] ] ],[0X
          [4X  [ "2", [ [ "covariant", "left exact" ] ] ],[0X
          [4X  [ "OnObjects", function( M, N ) ... end ],[0X
          [4X  [ "OnMorphisms", function( M_or_mor, N_or_mor ) ... end ] ][0X
        [4X------------------------------------------------------------[0X
  
  --    [10XInsertObjectInMultiFunctor[0m:
  
        [4X------------------------  Example  ------------------------[0X
          [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
          [4Xgap> LeftDualizingFunctor( ZZ, "ZZ_Hom" );[0X
          [4X<The functor ZZ_Hom>[0X
          [4Xgap> Functor_ZZ_Hom;	## got automatically defined[0X
          [4X<The functor ZZ_Hom>[0X
          [4Xgap> ZZ_Hom;		## got automatically defined[0X
          [4X<Operation "ZZ_Hom">[0X
          [4Xgap> Genesis( Functor_ZZ_Hom );[0X
          [4X[ "InsertObjectInMultiFunctor", <The functor Hom>, 2,[0X
          [4X  <The free left module of rank 1 on a free generator> ][0X
          [4Xgap> 1 * ZZ;[0X
          [4X<The free left module of rank 1 on a free generator>[0X
        [4X------------------------------------------------------------[0X
  
  --    [10XLeftDerivedFunctor[0m:
  
        [4X------------------------  Example  ------------------------[0X
          [4Xgap> Functor_TensorProduct;[0X
          [4X<The functor TensorProduct>[0X
          [4Xgap> Genesis( Functor_LTensorProduct );[0X
          [4X[ "LeftDerivedFunctor", <The functor TensorProduct>, 1 ][0X
        [4X------------------------------------------------------------[0X
  
  --    [10XRightDerivedCofunctor[0m:
  
        [4X------------------------  Example  ------------------------[0X
          [4Xgap> Genesis( Functor_RHom );[0X
          [4X[ "RightDerivedCofunctor", <The functor Hom>, 1 ][0X
        [4X------------------------------------------------------------[0X
  
  --    [10XLeftSatelliteOfFunctor[0m:
  
        [4X------------------------  Example  ------------------------[0X
          [4Xgap> Genesis( Functor_Tor );[0X
          [4X[ "LeftSatelliteOfFunctor", <The functor TensorProduct>, 1 ][0X
        [4X------------------------------------------------------------[0X
  
  --    [10XRightSatelliteOfCofunctor[0m:
  
        [4X------------------------  Example  ------------------------[0X
          [4Xgap> Genesis( Functor_Ext );[0X
          [4X[ "RightSatelliteOfCofunctor", <The functor Hom>, 1 ][0X
        [4X------------------------------------------------------------[0X
  
  --    [10XComposeFunctors[0m:
  
        [4X------------------------  Example  ------------------------[0X
          [4Xgap> Genesis( Functor_HomHom );[0X
          [4X[ "ComposeFunctors", [ <The functor Hom>, <The functor Hom> ], 1 ][0X
          [4Xgap> ValueGlobal( "ComposeFunctors" );[0X
          [4X<Operation "ComposeFunctors">[0X
        [4X------------------------------------------------------------[0X
  
  
  [1X16.4 Basic Functors[0X
  
  [1X16.4-1 functor_Cokernel[0m
  
  [2X> functor_Cokernel___________________________________________[0Xglobal variable
  
  The functor that associates to a map its cokernel.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XInstallValue( functor_Cokernel,[0X
    [4X        CreateHomalgFunctor([0X
    [4X                [ "name", "Cokernel" ],[0X
    [4X                [ "natural_transformation", "CokernelEpi" ],[0X
    [4X                [ "special", true ],[0X
    [4X                [ "number_of_arguments", 1 ],[0X
    [4X                [ "1", [ [ "covariant" ],[0X
    [4X                        [ IsMapOfFinitelyGeneratedModulesRep,[0X
    [4X                          [ IsHomalgChainMap, IsImageSquare ] ] ] ],[0X
    [4X                [ "OnObjects", _Functor_Cokernel_OnObjects ][0X
    [4X                )[0X
    [4X        );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-2 Cokernel[0m
  
  [2X> Cokernel( [0X[3Xphi[0X[2X ) _________________________________________________[0Xoperation
  
  The   following  example  also  makes  use  of  the  natural  transformation
  [10XCokernelEpi[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> M := HomalgMatrix( "[ 2, 3, 4,   5, 6, 7 ]", 2, 3, ZZ );;[0X
    [4Xgap> M := LeftPresentation( M );[0X
    [4X<A non-torsion left module presented by 2 relations for 3 generators>[0X
    [4Xgap> N := HomalgMatrix( "[ 2, 3, 4, 5,   6, 7, 8, 9 ]", 2, 4, ZZ );;[0X
    [4Xgap> N := LeftPresentation( N );[0X
    [4X<A non-torsion left module presented by 2 relations for 4 generators>[0X
    [4Xgap> mat := HomalgMatrix( "[ \[0X
    [4X> 1, 0, -3, -6, \[0X
    [4X> 0, 1,  6, 11, \[0X
    [4X> 1, 0, -3, -6  \[0X
    [4X> ]", 3, 4, ZZ );;[0X
    [4Xgap> phi := HomalgMap( mat, M, N );;[0X
    [4Xgap> IsMorphism( phi );[0X
    [4Xtrue[0X
    [4Xgap> phi;[0X
    [4X<A homomorphism of left modules>[0X
    [4Xgap> coker := Cokernel( phi );[0X
    [4X<A left module presented by 5 relations for 4 generators>[0X
    [4Xgap> ByASmallerPresentation( coker );[0X
    [4X<A rank 1 left module presented by 1 relation for 2 generators>[0X
    [4Xgap> Display( coker );[0X
    [4XZ/< 8 > + Z^(1 x 1)[0X
    [4Xgap> nu := CokernelEpi( phi );[0X
    [4X<An epimorphism of left modules>[0X
    [4Xgap> Display( nu );[0X
    [4X[ [  -5,   0 ],[0X
    [4X  [  -6,   1 ],[0X
    [4X  [   1,  -2 ],[0X
    [4X  [   0,   1 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 4 x 2 matrix[0X
    [4Xgap> DefectOfExactness( phi, nu );[0X
    [4X<A zero left module>[0X
    [4Xgap> ByASmallerPresentation( nu );[0X
    [4X<An epimorphism of left modules>[0X
    [4Xgap> Display( nu );[0X
    [4X[ [   2,   0 ],[0X
    [4X  [   1,  -2 ],[0X
    [4X  [   0,   1 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 3 x 2 matrix[0X
    [4Xgap> PreInverse( nu );[0X
    [4Xfalse[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-3 functor_ImageModule[0m
  
  [2X> functor_ImageModule________________________________________[0Xglobal variable
  
  The functor that associates to a map its image.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XInstallValue( functor_ImageModule,[0X
    [4X        CreateHomalgFunctor([0X
    [4X                [ "name", "ImageModule" ],[0X
    [4X                [ "natural_transformation", "ImageModuleEmb" ],[0X
    [4X                [ "number_of_arguments", 1 ],[0X
    [4X                [ "1", [ [ "covariant" ],[0X
    [4X                        [ IsMapOfFinitelyGeneratedModulesRep ] ] ],[0X
    [4X                [ "OnObjects", _Functor_ImageModule_OnObjects ][0X
    [4X                )[0X
    [4X        );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-4 ImageModule[0m
  
  [2X> ImageModule( [0X[3Xphi[0X[2X ) ______________________________________________[0Xoperation
  
  The  following  example  also  makes  use  of  the  natural  transformations
  [10XImageModuleEpi[0m and [10XImageModuleEmb[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> M := HomalgMatrix( "[ 2, 3, 4,   5, 6, 7 ]", 2, 3, ZZ );;[0X
    [4Xgap> M := LeftPresentation( M );[0X
    [4X<A non-torsion left module presented by 2 relations for 3 generators>[0X
    [4Xgap> N := HomalgMatrix( "[ 2, 3, 4, 5,   6, 7, 8, 9 ]", 2, 4, ZZ );;[0X
    [4Xgap> N := LeftPresentation( N );[0X
    [4X<A non-torsion left module presented by 2 relations for 4 generators>[0X
    [4Xgap> mat := HomalgMatrix( "[ \[0X
    [4X> 1, 0, -3, -6, \[0X
    [4X> 0, 1,  6, 11, \[0X
    [4X> 1, 0, -3, -6  \[0X
    [4X> ]", 3, 4, ZZ );;[0X
    [4Xgap> phi := HomalgMap( mat, M, N );;[0X
    [4Xgap> IsMorphism( phi );[0X
    [4Xtrue[0X
    [4Xgap> phi;[0X
    [4X<A homomorphism of left modules>[0X
    [4Xgap> im := ImageModule( phi );[0X
    [4X<A left module presented by yet unknown relations for 3 generators>[0X
    [4Xgap> ByASmallerPresentation( im );[0X
    [4X<A free left module of rank 1 on a free generator>[0X
    [4Xgap> pi := ImageModuleEpi( phi );[0X
    [4X<A split epimorphism of left modules>[0X
    [4Xgap> epsilon := ImageModuleEmb( phi );[0X
    [4X<A monomorphism of left modules>[0X
    [4Xgap> phi = pi * epsilon;[0X
    [4Xtrue[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-5 functor_Kernel[0m
  
  [2X> functor_Kernel_____________________________________________[0Xglobal variable
  
  The functor that associates to a map its kernel.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XInstallValue( functor_Kernel,[0X
    [4X        CreateHomalgFunctor([0X
    [4X                [ "name", "Kernel" ],[0X
    [4X                [ "natural_transformation", "KernelEmb" ],[0X
    [4X                [ "special", true ],[0X
    [4X                [ "number_of_arguments", 1 ],[0X
    [4X                [ "1", [ [ "covariant" ],[0X
    [4X                        [ IsMapOfFinitelyGeneratedModulesRep,[0X
    [4X                          [ IsHomalgChainMap, IsKernelSquare ] ] ] ],[0X
    [4X                [ "OnObjects", _Functor_Kernel_OnObjects ][0X
    [4X                )[0X
    [4X        );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-6 Kernel[0m
  
  [2X> Kernel( [0X[3Xphi[0X[2X ) ___________________________________________________[0Xoperation
  
  The   following  example  also  makes  use  of  the  natural  transformation
  [10XKernelEmb[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> M := HomalgMatrix( "[ 2, 3, 4,   5, 6, 7 ]", 2, 3, ZZ );;[0X
    [4Xgap> M := LeftPresentation( M );[0X
    [4X<A non-torsion left module presented by 2 relations for 3 generators>[0X
    [4Xgap> N := HomalgMatrix( "[ 2, 3, 4, 5,   6, 7, 8, 9 ]", 2, 4, ZZ );;[0X
    [4Xgap> N := LeftPresentation( N );[0X
    [4X<A non-torsion left module presented by 2 relations for 4 generators>[0X
    [4Xgap> mat := HomalgMatrix( "[ \[0X
    [4X> 1, 0, -3, -6, \[0X
    [4X> 0, 1,  6, 11, \[0X
    [4X> 1, 0, -3, -6  \[0X
    [4X> ]", 3, 4, ZZ );;[0X
    [4Xgap> phi := HomalgMap( mat, M, N );;[0X
    [4Xgap> IsMorphism( phi );[0X
    [4Xtrue[0X
    [4Xgap> phi;[0X
    [4X<A homomorphism of left modules>[0X
    [4Xgap> ker := Kernel( phi );[0X
    [4X<A cyclic left module presented by yet unknown relations for a cyclic generato\[0X
    [4Xr>[0X
    [4Xgap> Display( ker );[0X
    [4XZ/< -3 >[0X
    [4Xgap> ByASmallerPresentation( last );[0X
    [4X<A cyclic torsion left module presented by 1 relation for a cyclic generator>[0X
    [4Xgap> Display( ker );[0X
    [4XZ/< 3 >[0X
    [4Xgap> iota := KernelEmb( phi );[0X
    [4X<A monomorphism of left modules>[0X
    [4Xgap> Display( iota );[0X
    [4X[ [  0,  2,  4 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 3 matrix[0X
    [4Xgap> DefectOfExactness( iota, phi );[0X
    [4X<A zero left module>[0X
    [4Xgap> ByASmallerPresentation( iota );[0X
    [4X<A monomorphism of left modules>[0X
    [4Xgap> Display( iota );[0X
    [4X[ [  2,  0 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 2 matrix[0X
    [4Xgap> PostInverse( iota );[0X
    [4Xfalse[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-7 functor_DefectOfExactness[0m
  
  [2X> functor_DefectOfExactness__________________________________[0Xglobal variable
  
  The  functor  that  associates  to  a  pair  of  composable maps with a zero
  compositum  the defect of exactness, i.e. the kernel of the outer map modulo
  the image of the inner map.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XInstallValue( functor_DefectOfExactness,[0X
    [4X        CreateHomalgFunctor([0X
    [4X                [ "name", "DefectOfExactness" ],[0X
    [4X                [ "special", true ],[0X
    [4X                [ "number_of_arguments", 1 ],[0X
    [4X                [ "1", [ [ "covariant" ],[0X
    [4X                        [ IsHomalgComplex and IsATwoSequence,[0X
    [4X                          [ IsHomalgChainMap, IsLambekPairOfSquares ] ] ] ],[0X
    [4X                [ "OnObjects", _Functor_DefectOfExactness_OnObjects ][0X
    [4X                )[0X
    [4X        );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-8 DefectOfExactness[0m
  
  [2X> DefectOfExactness( [0X[3Xphi, psi[0X[2X ) ___________________________________[0Xoperation
  
  We follow the associative convention for applying maps. For left modules [3Xphi[0m
  is  applied first and from the right. For right modules [3Xpsi[0m is applied first
  and from the left.
  
  The   following  example  also  makes  use  of  the  natural  transformation
  [10XKernelEmb[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> M := HomalgMatrix( "[ 2, 3, 4, 0,   5, 6, 7, 0 ]", 2, 4, ZZ );;[0X
    [4Xgap> M := LeftPresentation( M );[0X
    [4X<A non-torsion left module presented by 2 relations for 4 generators>[0X
    [4Xgap> N := HomalgMatrix( "[ 2, 3, 4, 5,   6, 7, 8, 9 ]", 2, 4, ZZ );;[0X
    [4Xgap> N := LeftPresentation( N );[0X
    [4X<A non-torsion left module presented by 2 relations for 4 generators>[0X
    [4Xgap> mat := HomalgMatrix( "[ \[0X
    [4X> 1, 3,  3,  3, \[0X
    [4X> 0, 3, 10, 17, \[0X
    [4X> 1, 3,  3,  3, \[0X
    [4X> 0, 0,  0,  0  \[0X
    [4X> ]", 4, 4, ZZ );;[0X
    [4Xgap> phi := HomalgMap( mat, M, N );;[0X
    [4Xgap> IsMorphism( phi );[0X
    [4Xtrue[0X
    [4Xgap> phi;[0X
    [4X<A homomorphism of left modules>[0X
    [4Xgap> iota := KernelEmb( phi );[0X
    [4X<A monomorphism of left modules>[0X
    [4Xgap> DefectOfExactness( iota, phi );[0X
    [4X<A zero left module>[0X
    [4Xgap> hom_iota := Hom( iota );	## a shorthand for Hom( iota, ZZ );[0X
    [4X<A homomorphism of right modules>[0X
    [4Xgap> hom_phi := Hom( phi );	## a shorthand for Hom( phi, ZZ );[0X
    [4X<A homomorphism of right modules>[0X
    [4Xgap> DefectOfExactness( hom_iota, hom_phi );[0X
    [4X<A cyclic right module on a cyclic generator satisfying yet unknown relations>[0X
    [4Xgap> ByASmallerPresentation( last );[0X
    [4X<A cyclic torsion right module on a cyclic generator satisfying 1 relation>[0X
    [4Xgap> Display( last );[0X
    [4XZ/< 2 >[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-9 Functor_Hom[0m
  
  [2X> Functor_Hom________________________________________________[0Xglobal variable
  
  The bifunctor [10XHom[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XInstallValue( Functor_Hom,[0X
    [4X        CreateHomalgFunctor([0X
    [4X                [ "name", "Hom" ],[0X
    [4X                [ "number_of_arguments", 2 ],[0X
    [4X                [ "1", [ [ "contravariant", "right adjoint", "distinguished" ] ] ],[0X
    [4X                [ "2", [ [ "covariant", "left exact" ] ] ],[0X
    [4X                [ "OnObjects", _Functor_Hom_OnObjects ],[0X
    [4X                [ "OnMorphisms", _Functor_Hom_OnMorphisms ][0X
    [4X                )[0X
    [4X        );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-10 Hom[0m
  
  [2X> Hom( [0X[3Xo1, o2[0X[2X ) ___________________________________________________[0Xoperation
  
  [3Xo1[0m  resp.  [3Xo2[0m could be a module, a map, a complex (of modules or of again of
  complexes), or a chain map.
  
  Each  generator  of  a  module  of homomorphisms is displayed as a matrix of
  appropriate dimensions.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> M := HomalgMatrix( "[ 2, 3, 4,   5, 6, 7 ]", 2, 3, ZZ );;[0X
    [4Xgap> M := LeftPresentation( M );[0X
    [4X<A non-torsion left module presented by 2 relations for 3 generators>[0X
    [4Xgap> N := HomalgMatrix( "[ 2, 3, 4, 5,   6, 7, 8, 9 ]", 2, 4, ZZ );;[0X
    [4Xgap> N := LeftPresentation( N );[0X
    [4X<A non-torsion left module presented by 2 relations for 4 generators>[0X
    [4Xgap> mat := HomalgMatrix( "[ \[0X
    [4X> 1, 0, -3, -6, \[0X
    [4X> 0, 1,  6, 11, \[0X
    [4X> 1, 0, -3, -6  \[0X
    [4X> ]", 3, 4, ZZ );;[0X
    [4Xgap> phi := HomalgMap( mat, M, N );;[0X
    [4Xgap> IsMorphism( phi );[0X
    [4Xtrue[0X
    [4Xgap> phi;[0X
    [4X<A homomorphism of left modules>[0X
    [4Xgap> psi := Hom( phi, M );[0X
    [4X<A homomorphism of right modules>[0X
    [4Xgap> ByASmallerPresentation( psi );[0X
    [4X<A homomorphism of right modules>[0X
    [4Xgap> Display( psi );[0X
    [4X[ [   1,   1,   0,   1 ],[0X
    [4X  [   2,   2,   0,   0 ],[0X
    [4X  [   0,   0,   6,  10 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 3 x 4 matrix[0X
    [4Xgap> homNM := Source( psi );[0X
    [4X<A non-torsion right module on 4 generators satisfying 2 relations>[0X
    [4Xgap> IsIdenticalObj( homNM, Hom( N, M ) );	## the caching at work[0X
    [4Xtrue[0X
    [4Xgap> homMM := Range( psi );[0X
    [4X<A non-torsion right module on 3 generators satisfying 2 relations>[0X
    [4Xgap> IsIdenticalObj( homMM, Hom( M, M ) );	## the caching at work[0X
    [4Xtrue[0X
    [4Xgap> Display( homNM );[0X
    [4XZ/< 3 > + Z/< 3 > + Z^(2 x 1)[0X
    [4Xgap> Display( homMM );[0X
    [4XZ/< 3 > + Z/< 3 > + Z^(1 x 1)[0X
    [4Xgap> IsMonomorphism( psi );[0X
    [4Xfalse[0X
    [4Xgap> IsEpimorphism( psi );[0X
    [4Xfalse[0X
    [4Xgap> GeneratorsOfModule( homMM );[0X
    [4X<A set of 3 generators of a homalg right module>[0X
    [4Xgap> Display( last );[0X
    [4X[ [  0,  0,  0 ],[0X
    [4X  [  0,  1,  2 ],[0X
    [4X  [  0,  0,  0 ] ][0X
    [4X[0X
    [4X[ [  0,  2,  4 ],[0X
    [4X  [  0,  0,  0 ],[0X
    [4X  [  0,  2,  4 ] ][0X
    [4X[0X
    [4X[ [   0,   1,   3 ],[0X
    [4X  [   0,   0,  -2 ],[0X
    [4X  [   0,   1,   3 ] ][0X
    [4X[0X
    [4Xgap> GeneratorsOfModule( homNM );[0X
    [4X<A set of 4 generators of a homalg right module>[0X
    [4Xgap> Display( last );[0X
    [4X[ [  0,  1,  2 ],[0X
    [4X  [  0,  1,  2 ],[0X
    [4X  [  0,  1,  2 ],[0X
    [4X  [  0,  0,  0 ] ][0X
    [4X[0X
    [4X[ [  0,  1,  2 ],[0X
    [4X  [  0,  0,  0 ],[0X
    [4X  [  0,  0,  0 ],[0X
    [4X  [  0,  2,  4 ] ][0X
    [4X[0X
    [4X[ [   0,   0,  -3 ],[0X
    [4X  [   0,   0,   7 ],[0X
    [4X  [   0,   0,  -5 ],[0X
    [4X  [   0,   0,   1 ] ][0X
    [4X[0X
    [4X[ [   0,   1,  -3 ],[0X
    [4X  [   0,   0,  12 ],[0X
    [4X  [   0,   0,  -9 ],[0X
    [4X  [   0,   2,   6 ] ][0X
    [4X[0X
  [4X------------------------------------------------------------------[0X
  
  If for example the source N gets a new presentation, you will see the effect
  on the generators:
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ByASmallerPresentation( N );[0X
    [4X<A rank 2 left module presented by 1 relation for 3 generators>[0X
    [4Xgap> GeneratorsOfModule( homNM );[0X
    [4X<A set of 4 generators of a homalg right module>[0X
    [4Xgap> Display( last );[0X
    [4X[ [  0,  3,  6 ],[0X
    [4X  [  0,  1,  2 ],[0X
    [4X  [  0,  0,  0 ] ][0X
    [4X[0X
    [4X[ [   0,   9,  18 ],[0X
    [4X  [   0,   0,   0 ],[0X
    [4X  [   0,   2,   4 ] ][0X
    [4X[0X
    [4X[ [   0,   0,   0 ],[0X
    [4X  [   0,   0,  -5 ],[0X
    [4X  [   0,   0,   1 ] ][0X
    [4X[0X
    [4X[ [   0,   9,  18 ],[0X
    [4X  [   0,   0,  -9 ],[0X
    [4X  [   0,   2,   6 ] ][0X
    [4X[0X
  [4X------------------------------------------------------------------[0X
  
  Now we compute a certain natural filtration on [10XHom[0m(M,M):
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> dM := Resolution( M );[0X
    [4X<A non-zero right acyclic complex containing a single morphism of left modules\[0X
    [4X at degrees [ 0 .. 1 ]>[0X
    [4Xgap> hMM := Hom( dM, dM );[0X
    [4X<An acyclic cocomplex containing a single morphism of right complexes at degre\[0X
    [4Xes [ 0 .. 1 ]>[0X
    [4Xgap> BMM := HomalgBicomplex( hMM );[0X
    [4X<A bicocomplex containing right modules at bidegrees [ 0 .. 1 ]x[ -1 .. 0 ]>[0X
    [4Xgap> II_E := SecondSpectralSequenceWithFiltration( BMM );[0X
    [4X<A stable cohomological spectral sequence with sheets at levels [0X
    [4X[ 0 .. 2 ] each consisting of right modules at bidegrees [ -1 .. 0 ]x[0X
    [4X[ 0 .. 1 ]>[0X
    [4Xgap> Display( II_E );[0X
    [4XThe associated transposed spectral sequence:[0X
    [4X[0X
    [4Xa cohomological spectral sequence at bidegrees[0X
    [4X[ [ 0 .. 1 ], [ -1 .. 0 ] ][0X
    [4X---------[0X
    [4XLevel 0:[0X
    [4X[0X
    [4X * *[0X
    [4X * *[0X
    [4X---------[0X
    [4XLevel 1:[0X
    [4X[0X
    [4X * *[0X
    [4X . .[0X
    [4X---------[0X
    [4XLevel 2:[0X
    [4X[0X
    [4X s s[0X
    [4X . .[0X
    [4X[0X
    [4XNow the spectral sequence of the bicomplex:[0X
    [4X[0X
    [4Xa cohomological spectral sequence at bidegrees[0X
    [4X[ [ -1 .. 0 ], [ 0 .. 1 ] ][0X
    [4X---------[0X
    [4XLevel 0:[0X
    [4X[0X
    [4X * *[0X
    [4X * *[0X
    [4X---------[0X
    [4XLevel 1:[0X
    [4X[0X
    [4X * *[0X
    [4X * *[0X
    [4X---------[0X
    [4XLevel 2:[0X
    [4X[0X
    [4X s s[0X
    [4X . s[0X
    [4Xgap> filt := FiltrationBySpectralSequence( II_E );[0X
    [4X<A descending filtration with degrees [ -1 .. 0 ] and graded parts:[0X
    [4X  [0X
    [4X-1:	<A non-zero cyclic torsion right module on a cyclic generator satisfying [0X
    [4X1 relation>[0X
    [4X   0:	<A rank 1 right module on 3 generators satisfying 2 relations>[0X
    [4Xof[0X
    [4X<A right module on 4 generators satisfying yet unknown relations>>[0X
    [4Xgap> ByASmallerPresentation( filt );[0X
    [4X<A descending filtration with degrees [ -1 .. 0 ] and graded parts:[0X
    [4X  [0X
    [4X-1:	<A non-zero cyclic torsion right module on a cyclic generator satisfying [0X
    [4X1 relation>[0X
    [4X   0:	<A rank 1 right module on 2 generators satisfying 1 relation>[0X
    [4Xof[0X
    [4X<A non-torsion right module on 3 generators satisfying 2 relations>>[0X
    [4Xgap> Display( filt );[0X
    [4XDegree -1:[0X
    [4X[0X
    [4XZ/< 3 >[0X
    [4X----------[0X
    [4XDegree 0:[0X
    [4X[0X
    [4XZ/< 3 > + Z^(1 x 1)[0X
    [4Xgap> Display( homMM );[0X
    [4XZ/< 3 > + Z/< 3 > + Z^(1 x 1)[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-11 Functor_TensorProduct[0m
  
  [2X> Functor_TensorProduct______________________________________[0Xglobal variable
  
  The tensor product bifunctor.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XInstallValue( Functor_TensorProduct,[0X
    [4X        CreateHomalgFunctor([0X
    [4X                [ "name", "TensorProduct" ],[0X
    [4X                [ "number_of_arguments", 2 ],[0X
    [4X                [ "1", [ [ "covariant", "left adjoint", "distinguished" ] ] ],[0X
    [4X                [ "2", [ [ "covariant", "left adjoint" ] ] ],[0X
    [4X                [ "OnObjects", _Functor_TensorProduct_OnObjects ],[0X
    [4X                [ "OnMorphisms", _Functor_TensorProduct_OnMorphisms ][0X
    [4X                )[0X
    [4X        );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-12 TensorProduct[0m
  
  [2X> TensorProduct( [0X[3Xo1, o2[0X[2X ) _________________________________________[0Xoperation
  [2X> \*( [0X[3Xo1, o2[0X[2X ) ____________________________________________________[0Xoperation
  
  [3Xo1[0m  resp.  [3Xo2[0m could be a module, a map, a complex (of modules or of again of
  complexes), or a chain map.
  
  The  symbol  [10X*[0m  is  a  shorthand  for several operations associated with the
  functor [10XFunctor_TensorProduct[0m installed under the name [10XTensorProduct[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> M := HomalgMatrix( "[ 2, 3, 4,   5, 6, 7 ]", 2, 3, ZZ );;[0X
    [4Xgap> M := LeftPresentation( M );[0X
    [4X<A non-torsion left module presented by 2 relations for 3 generators>[0X
    [4Xgap> N := HomalgMatrix( "[ 2, 3, 4, 5,   6, 7, 8, 9 ]", 2, 4, ZZ );;[0X
    [4Xgap> N := LeftPresentation( N );[0X
    [4X<A non-torsion left module presented by 2 relations for 4 generators>[0X
    [4Xgap> mat := HomalgMatrix( "[ \[0X
    [4X> 1, 0, -3, -6, \[0X
    [4X> 0, 1,  6, 11, \[0X
    [4X> 1, 0, -3, -6  \[0X
    [4X> ]", 3, 4, ZZ );;[0X
    [4Xgap> phi := HomalgMap( mat, M, N );;[0X
    [4Xgap> IsMorphism( phi );[0X
    [4Xtrue[0X
    [4Xgap> phi;[0X
    [4X<A homomorphism of left modules>[0X
    [4Xgap> L := Hom( ZZ, M );[0X
    [4X<A right module on 3 generators satisfying yet unknown relations>[0X
    [4Xgap> ByASmallerPresentation( L );[0X
    [4X<A rank 1 right module on 2 generators satisfying 1 relation>[0X
    [4Xgap> Display( L );[0X
    [4XZ/< 3 > + Z^(1 x 1)[0X
    [4Xgap> L;	## the display method found out further information about the module L[0X
    [4X<A rank 1 right module on 2 generators satisfying 1 relation>[0X
    [4Xgap> psi := phi * L;[0X
    [4X<A homomorphism of right modules>[0X
    [4Xgap> ByASmallerPresentation( psi );[0X
    [4X<A homomorphism of right modules>[0X
    [4Xgap> Display( psi );[0X
    [4X[ [   0,   0,   1,   1 ],[0X
    [4X  [   0,   0,   8,   1 ],[0X
    [4X  [   0,   0,   0,  -2 ],[0X
    [4X  [   0,   0,   0,   2 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 4 x 4 matrix[0X
    [4X[0X
    [4Xgap> ML := Source( psi );[0X
    [4X<A non-torsion right module on 4 generators satisfying 3 relations>[0X
    [4Xgap> IsIdenticalObj( ML, M * L );	## the caching at work[0X
    [4Xtrue[0X
    [4Xgap> NL := Range( psi );[0X
    [4X<A non-torsion right module on 4 generators satisfying 2 relations>[0X
    [4Xgap> IsIdenticalObj( NL, N * L );	## the caching at work[0X
    [4Xtrue[0X
    [4Xgap> Display( ML );[0X
    [4XZ/< 3 > + Z/< 3 > + Z/< 3 > + Z^(1 x 1)[0X
    [4Xgap> Display( NL );[0X
    [4XZ/< 3 > + Z/< 12 > + Z^(2 x 1)[0X
  [4X------------------------------------------------------------------[0X
  
  Now we compute a certain natural filtration on the tensor product M[10X*[0mL:
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> P := Resolution( M );[0X
    [4X<A non-zero right acyclic complex containing a single morphism of left modules\[0X
    [4X at degrees [ 0 .. 1 ]>[0X
    [4Xgap> GP := Hom( P );[0X
    [4X<An acyclic cocomplex containing a single morphism of right modules at degrees\[0X
    [4X [ 0 .. 1 ]>[0X
    [4Xgap> CE := Resolution( GP );[0X
    [4X<An acyclic cocomplex containing a single morphism of right complexes at degre\[0X
    [4Xes [ 0 .. 1 ]>[0X
    [4Xgap> FCE := Hom( CE, L );[0X
    [4X<An acyclic complex containing a single morphism of left cocomplexes at degree\[0X
    [4Xs [ 0 .. 1 ]>[0X
    [4Xgap> BC := HomalgBicomplex( FCE );[0X
    [4X<A bicomplex containing left modules at bidegrees [ 0 .. 1 ]x[ -1 .. 0 ]>[0X
    [4Xgap> II_E := SecondSpectralSequenceWithFiltration( BC );[0X
    [4X<A stable homological spectral sequence with sheets at levels [0X
    [4X[ 0 .. 2 ] each consisting of left modules at bidegrees [ -1 .. 0 ]x[0X
    [4X[ 0 .. 1 ]>[0X
    [4Xgap> Display( II_E );[0X
    [4XThe associated transposed spectral sequence:[0X
    [4X[0X
    [4Xa homological spectral sequence at bidegrees[0X
    [4X[ [ 0 .. 1 ], [ -1 .. 0 ] ][0X
    [4X---------[0X
    [4XLevel 0:[0X
    [4X[0X
    [4X * *[0X
    [4X * *[0X
    [4X---------[0X
    [4XLevel 1:[0X
    [4X[0X
    [4X * *[0X
    [4X . .[0X
    [4X---------[0X
    [4XLevel 2:[0X
    [4X[0X
    [4X s s[0X
    [4X . .[0X
    [4X[0X
    [4XNow the spectral sequence of the bicomplex:[0X
    [4X[0X
    [4Xa homological spectral sequence at bidegrees[0X
    [4X[ [ -1 .. 0 ], [ 0 .. 1 ] ][0X
    [4X---------[0X
    [4XLevel 0:[0X
    [4X[0X
    [4X * *[0X
    [4X * *[0X
    [4X---------[0X
    [4XLevel 1:[0X
    [4X[0X
    [4X * *[0X
    [4X . s[0X
    [4X---------[0X
    [4XLevel 2:[0X
    [4X[0X
    [4X s s[0X
    [4X . s[0X
    [4Xgap> filt := FiltrationBySpectralSequence( II_E );[0X
    [4X<An ascending filtration with degrees [ -1 .. 0 ] and graded parts:[0X
    [4X   0:	<A non-torsion left module presented by 1 relation for 2 generators>[0X
    [4X  -1:	<A non-zero left module presented by 2 relations for 2 generators>[0X
    [4Xof[0X
    [4X<A non-zero left module presented by 10 relations for 6 generators>>[0X
    [4Xgap> ByASmallerPresentation( filt );[0X
    [4X<An ascending filtration with degrees [ -1 .. 0 ] and graded parts:[0X
    [4X   0:	<A rank 1 left module presented by 1 relation for 2 generators>[0X
    [4X  -1:	<A non-zero left module presented by 2 relations for 2 generators>[0X
    [4Xof[0X
    [4X<A non-torsion left module presented by 3 relations for 4 generators>>[0X
    [4Xgap> Display( filt );[0X
    [4XDegree 0:[0X
    [4X[0X
    [4XZ/< 3 > + Z^(1 x 1)[0X
    [4X----------[0X
    [4XDegree -1:[0X
    [4X[0X
    [4XZ/< 3 > + Z/< 3 >[0X
    [4Xgap> Display( ML );[0X
    [4XZ/< 3 > + Z/< 3 > + Z/< 3 > + Z^(1 x 1)[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-13 Functor_Ext[0m
  
  [2X> Functor_Ext________________________________________________[0Xglobal variable
  
  The bifunctor [10XExt[0m.
  
  Below  is  the only [13Xspecific[0m line of code used to define [10XFunctor_Ext[0m and all
  the different operations [10XExt[0m in [5Xhomalg[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XRightSatelliteOfCofunctor( Functor_Hom, "Ext" );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-14 Ext[0m
  
  [2X> Ext( [0X[3X[c, ]o1, o2[, str][0X[2X ) _______________________________________[0Xoperation
  
  Compute  the  [3Xc[0m-th  extension  object of [3Xo1[0m with [3Xo2[0m where [3Xc[0m is a nonnegative
  integer  and  [3Xo1[0m resp. [3Xo2[0m could be a module, a map, a complex (of modules or
  of   again   of   complexes),   or   a   chain  map.  If  [3Xstr[0m="a"  then  the
  (cohomologically)  graded object Ext^i([3Xo1[0m,[3Xo2[0m) for 0 <= i <=[3Xc[0m is computed. If
  neither  [3Xc[0m  nor  [3Xstr[0m  is  specified  then  the cohomologically graded object
  Ext^i([3Xo1[0m,[3Xo2[0m)  for  0  <=  i  <=  d is computed, where d is the length of the
  internally computed free resolution of [3Xo1[0m.
  
  Each  generator  of  a  module  of  extensions  is  displayed as a matrix of
  appropriate dimensions.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> M := HomalgMatrix( "[ 2, 3, 4,   5, 6, 7 ]", 2, 3, ZZ );;[0X
    [4Xgap> M := LeftPresentation( M );[0X
    [4X<A non-torsion left module presented by 2 relations for 3 generators>[0X
    [4Xgap> N := TorsionSubmodule( M );[0X
    [4X<A cyclic torsion left module presented by yet unknown relations for a cyclic \[0X
    [4Xgenerator>[0X
    [4Xgap> iota := TorsionSubmoduleEmb( M );[0X
    [4X<A monomorphism of left modules>[0X
    [4Xgap> psi := Ext( 1, iota, N );[0X
    [4X<A homomorphism of right modules>[0X
    [4Xgap> ByASmallerPresentation( psi );[0X
    [4X<A homomorphism of right modules>[0X
    [4Xgap> Display( psi );[0X
    [4X[ [  2 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 1 matrix[0X
    [4Xgap> extNN := Range( psi );[0X
    [4X<A cyclic right module on a cyclic generator satisfying 1 relation>[0X
    [4Xgap> IsIdenticalObj( extNN, Ext( 1, N, N ) );	## the caching at work[0X
    [4Xtrue[0X
    [4Xgap> extMN := Source( psi );[0X
    [4X<A cyclic torsion right module on a cyclic generator satisfying 1 relation>[0X
    [4Xgap> IsIdenticalObj( extMN, Ext( 1, M, N ) );	## the caching at work[0X
    [4Xtrue[0X
    [4Xgap> Display( extNN );[0X
    [4XZ/< 3 >[0X
    [4Xgap> Display( extMN );[0X
    [4XZ/< 3 >[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-15 Functor_Tor[0m
  
  [2X> Functor_Tor________________________________________________[0Xglobal variable
  
  The bifunctor [10XTor[0m.
  
  Below  is  the only [13Xspecific[0m line of code used to define [10XFunctor_Tor[0m and all
  the different operations [10XTor[0m in [5Xhomalg[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XLeftSatelliteOfFunctor( Functor_TensorProduct, "Tor" );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-16 Tor[0m
  
  [2X> Tor( [0X[3X[c, ]o1, o2[, str][0X[2X ) _______________________________________[0Xoperation
  
  Compute  the  [3Xc[0m-th  torsion  object  of  [3Xo1[0m with [3Xo2[0m where [3Xc[0m is a nonnegative
  integer  and  [3Xo1[0m resp. [3Xo2[0m could be a module, a map, a complex (of modules or
  of   again   of   complexes),   or   a   chain  map.  If  [3Xstr[0m="a"  then  the
  (cohomologically)  graded object Tor_i([3Xo1[0m,[3Xo2[0m) for 0 <= i <=[3Xc[0m is computed. If
  neither  [3Xc[0m  nor  [3Xstr[0m  is  specified  then  the cohomologically graded object
  Tor_i([3Xo1[0m,[3Xo2[0m)  for  0  <=  i  <=  d is computed, where d is the length of the
  internally computed free resolution of [3Xo1[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> M := HomalgMatrix( "[ 2, 3, 4,   5, 6, 7 ]", 2, 3, ZZ );;[0X
    [4Xgap> M := LeftPresentation( M );[0X
    [4X<A non-torsion left module presented by 2 relations for 3 generators>[0X
    [4Xgap> N := TorsionSubmodule( M );[0X
    [4X<A cyclic torsion left module presented by yet unknown relations for a cyclic \[0X
    [4Xgenerator>[0X
    [4Xgap> iota := TorsionSubmoduleEmb( M );[0X
    [4X<A monomorphism of left modules>[0X
    [4Xgap> psi := Tor( 1, iota, N );[0X
    [4X<A homomorphism of left modules>[0X
    [4Xgap> ByASmallerPresentation( psi );[0X
    [4X<A homomorphism of left modules>[0X
    [4Xgap> Display( psi );[0X
    [4X[ [  1 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 1 matrix[0X
    [4Xgap> torNN := Source( psi );[0X
    [4X<A cyclic torsion left module presented by 1 relation for a cyclic generator>[0X
    [4Xgap> IsIdenticalObj( torNN, Tor( 1, N, N ) );	## the caching at work[0X
    [4Xtrue[0X
    [4Xgap> torMN := Range( psi );[0X
    [4X<A cyclic torsion left module presented by 1 relation for a cyclic generator>[0X
    [4Xgap> IsIdenticalObj( torMN, Tor( 1, M, N ) );	## the caching at work[0X
    [4Xtrue[0X
    [4Xgap> Display( torNN );[0X
    [4XZ/< 3 >[0X
    [4Xgap> Display( torMN );[0X
    [4XZ/< 3 >[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-17 Functor_RHom[0m
  
  [2X> Functor_RHom_______________________________________________[0Xglobal variable
  
  The bifunctor [10XRHom[0m.
  
  Below  is the only [13Xspecific[0m line of code used to define [10XFunctor_RHom[0m and all
  the different operations [10XRHom[0m in [5Xhomalg[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XRightDerivedCofunctor( Functor_Hom );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-18 RHom[0m
  
  [2X> RHom( [0X[3X[c, ]o1, o2[, str][0X[2X ) ______________________________________[0Xoperation
  
  Compute  the  [3Xc[0m-th  extension  object of [3Xo1[0m with [3Xo2[0m where [3Xc[0m is a nonnegative
  integer  and  [3Xo1[0m resp. [3Xo2[0m could be a module, a map, a complex (of modules or
  of  again  of  complexes), or a chain map. The string [3Xstr[0m may take different
  values:
  
  --    If [3Xstr[0m="a" then R^i Hom([3Xo1[0m,[3Xo2[0m) for 0 <= i <=[3Xc[0m is computed.
  
  --    If  [3Xstr[0m="c"  then the [3Xc[0m-th connecting homomorphism with respect to the
        short exact sequence [3Xo1[0m is computed.
  
  --    If  [3Xstr[0m="t"  then  the exact triangle upto cohomological degree [3Xc[0m with
        respect to the short exact sequence [3Xo1[0m is computed.
  
  If neither [3Xc[0m nor [3Xstr[0m is specified then the cohomologically graded object R^i
  Hom([3Xo1[0m,[3Xo2[0m)  for  0  <=  i  <=  d  is  computed, where d is the length of the
  internally computed free resolution of [3Xo1[0m.
  
  Each generator of a module of derived homomorphisms is displayed as a matrix
  of appropriate dimensions.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> m := HomalgMatrix( [ [ 8, 0 ], [ 0, 2 ] ], ZZ );;[0X
    [4Xgap> M := LeftPresentation( m );[0X
    [4X<A left module presented by 2 relations for 2 generators>[0X
    [4Xgap> Display( M );[0X
    [4XZ/< 8 > + Z/< 2 >[0X
    [4Xgap> a := HomalgMatrix( [ [ 2, 0 ] ], ZZ );;[0X
    [4Xgap> alpha := HomalgMap( a, "free", M );[0X
    [4X<A homomorphism of left modules>[0X
    [4Xgap> pi := CokernelEpi( alpha );[0X
    [4X<An epimorphism of left modules>[0X
    [4Xgap> Display( pi );[0X
    [4X[ [  1,  0 ],[0X
    [4X  [  0,  1 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 2 x 2 matrix[0X
    [4Xgap> iota := KernelEmb( pi );[0X
    [4X<A monomorphism of left modules>[0X
    [4Xgap> Display( iota );[0X
    [4X[ [  2,  0 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 2 matrix[0X
    [4Xgap> N := Kernel( pi );[0X
    [4X<A cyclic left module presented by yet unknown relations for a cyclic generato\[0X
    [4Xr>[0X
    [4Xgap> Display( N );[0X
    [4XZ/< 4 >[0X
    [4Xgap> C := HomalgComplex( pi );[0X
    [4X<A left acyclic complex containing a single morphism of left modules at degree\[0X
    [4Xs [ 0 .. 1 ]>[0X
    [4Xgap> Add( C, iota );[0X
    [4Xgap> ByASmallerPresentation( C );[0X
    [4X<A non-zero short exact sequence containing[0X
    [4X2 morphisms of left modules at degrees [ 0 .. 2 ]>[0X
    [4Xgap> Display( C );[0X
    [4X-------------------------[0X
    [4Xat homology degree: 2[0X
    [4XZ/< 4 >[0X
    [4X-------------------------[0X
    [4X[ [  0,  6 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 2 matrix[0X
    [4X------------v------------[0X
    [4Xat homology degree: 1[0X
    [4XZ/< 2 > + Z/< 8 >[0X
    [4X-------------------------[0X
    [4X[ [  0,  1 ],[0X
    [4X  [  1,  1 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 2 x 2 matrix[0X
    [4X------------v------------[0X
    [4Xat homology degree: 0[0X
    [4XZ/< 2 > + Z/< 2 >[0X
    [4X-------------------------[0X
    [4Xgap> T := RHom( C, N );[0X
    [4X<An exact cotriangle containing 3 morphisms of right cocomplexes at degrees[0X
    [4X[ 0, 1, 2, 0 ]>[0X
    [4Xgap> ByASmallerPresentation( T );[0X
    [4X<A non-zero exact cotriangle containing[0X
    [4X3 morphisms of right cocomplexes at degrees [ 0, 1, 2, 0 ]>[0X
    [4Xgap> L := LongSequence( T );[0X
    [4X<A cosequence containing 5 morphisms of right modules at degrees [ 0 .. 5 ]>[0X
    [4Xgap> Display( L );[0X
    [4X-------------------------[0X
    [4Xat cohomology degree: 5[0X
    [4XZ/< 4 >[0X
    [4X------------^------------[0X
    [4X[ [  0,  3 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 2 matrix[0X
    [4X-------------------------[0X
    [4Xat cohomology degree: 4[0X
    [4XZ/< 2 > + Z/< 4 >[0X
    [4X------------^------------[0X
    [4X[ [  0,  1 ],[0X
    [4X  [  0,  0 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 2 x 2 matrix[0X
    [4X-------------------------[0X
    [4Xat cohomology degree: 3[0X
    [4XZ/< 2 > + Z/< 2 >[0X
    [4X------------^------------[0X
    [4X[ [  1 ],[0X
    [4X  [  0 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 2 x 1 matrix[0X
    [4X-------------------------[0X
    [4Xat cohomology degree: 2[0X
    [4XZ/< 4 >[0X
    [4X------------^------------[0X
    [4X[ [  0,  2 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 2 matrix[0X
    [4X-------------------------[0X
    [4Xat cohomology degree: 1[0X
    [4XZ/< 2 > + Z/< 4 >[0X
    [4X------------^------------[0X
    [4X[ [  0,  1 ],[0X
    [4X  [  2,  0 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 2 x 2 matrix[0X
    [4X-------------------------[0X
    [4Xat cohomology degree: 0[0X
    [4XZ/< 2 > + Z/< 2 >[0X
    [4X-------------------------[0X
    [4Xgap> IsExactSequence( L );[0X
    [4Xtrue[0X
    [4Xgap> L;[0X
    [4X<An exact cosequence containing 5 morphisms of right modules at degrees[0X
    [4X[ 0 .. 5 ]>[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-19 Functor_LTensorProduct[0m
  
  [2X> Functor_LTensorProduct_____________________________________[0Xglobal variable
  
  The bifunctor [10XLTensorProduct[0m.
  
  Below    is    the   only   [13Xspecific[0m   line   of   code   used   to   define
  [10XFunctor_LTensorProduct[0m  and  all  the different operations [10XLTensorProduct[0m in
  [5Xhomalg[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XLeftDerivedFunctor( Functor_TensorProduct );[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-20 LTensorProduct[0m
  
  [2X> LTensorProduct( [0X[3X[c, ]o1, o2[, str][0X[2X ) ____________________________[0Xoperation
  
  Compute  the  [3Xc[0m-th  torsion  object  of  [3Xo1[0m with [3Xo2[0m where [3Xc[0m is a nonnegative
  integer  and  [3Xo1[0m resp. [3Xo2[0m could be a module, a map, a complex (of modules or
  of  again  of  complexes), or a chain map. The string [3Xstr[0m may take different
  values:
  
  --    If [3Xstr[0m="a" then L_i TensorProduct([3Xo1[0m,[3Xo2[0m) for 0 <= i <=[3Xc[0m is computed.
  
  --    If  [3Xstr[0m="c"  then the [3Xc[0m-th connecting homomorphism with respect to the
        short exact sequence [3Xo1[0m is computed.
  
  --    If  [3Xstr[0m="t"  then  the exact triangle upto cohomological degree [3Xc[0m with
        respect to the short exact sequence [3Xo1[0m is computed.
  
  If neither [3Xc[0m nor [3Xstr[0m is specified then the cohomologically graded object L_i
  TensorProduct([3Xo1[0m,[3Xo2[0m)  for  0 <= i <= d is computed, where d is the length of
  the internally computed free resolution of [3Xo1[0m.
  
  Each generator of a module of derived homomorphisms is displayed as a matrix
  of appropriate dimensions.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> m := HomalgMatrix( [ [ 8, 0 ], [ 0, 2 ] ], ZZ );;[0X
    [4Xgap> M := LeftPresentation( m );[0X
    [4X<A left module presented by 2 relations for 2 generators>[0X
    [4Xgap> Display( M );[0X
    [4XZ/< 8 > + Z/< 2 >[0X
    [4Xgap> a := HomalgMatrix( [ [ 2, 0 ] ], ZZ );;[0X
    [4Xgap> alpha := HomalgMap( a, "free", M );[0X
    [4X<A homomorphism of left modules>[0X
    [4Xgap> pi := CokernelEpi( alpha );[0X
    [4X<An epimorphism of left modules>[0X
    [4Xgap> Display( pi );[0X
    [4X[ [  1,  0 ],[0X
    [4X  [  0,  1 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 2 x 2 matrix[0X
    [4Xgap> iota := KernelEmb( pi );[0X
    [4X<A monomorphism of left modules>[0X
    [4Xgap> Display( iota );[0X
    [4X[ [  2,  0 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 2 matrix[0X
    [4Xgap> N := Kernel( pi );[0X
    [4X<A cyclic left module presented by yet unknown relations for a cyclic generato\[0X
    [4Xr>[0X
    [4Xgap> Display( N );[0X
    [4XZ/< 4 >[0X
    [4Xgap> C := HomalgComplex( pi );[0X
    [4X<A left acyclic complex containing a single morphism of left modules at degree\[0X
    [4Xs [ 0 .. 1 ]>[0X
    [4Xgap> Add( C, iota );[0X
    [4Xgap> ByASmallerPresentation( C );[0X
    [4X<A non-zero short exact sequence containing[0X
    [4X2 morphisms of left modules at degrees [ 0 .. 2 ]>[0X
    [4Xgap> Display( C );[0X
    [4X-------------------------[0X
    [4Xat homology degree: 2[0X
    [4XZ/< 4 >[0X
    [4X-------------------------[0X
    [4X[ [  0,  6 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 2 matrix[0X
    [4X------------v------------[0X
    [4Xat homology degree: 1[0X
    [4XZ/< 2 > + Z/< 8 >[0X
    [4X-------------------------[0X
    [4X[ [  0,  1 ],[0X
    [4X  [  1,  1 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 2 x 2 matrix[0X
    [4X------------v------------[0X
    [4Xat homology degree: 0[0X
    [4XZ/< 2 > + Z/< 2 >[0X
    [4X-------------------------[0X
    [4Xgap> T := LTensorProduct( C, N );[0X
    [4X<An exact triangle containing 3 morphisms of left complexes at degrees[0X
    [4X[ 1, 2, 3, 1 ]>[0X
    [4Xgap> ByASmallerPresentation( T );[0X
    [4X<A non-zero exact triangle containing[0X
    [4X3 morphisms of left complexes at degrees [ 1, 2, 3, 1 ]>[0X
    [4Xgap> L := LongSequence( T );[0X
    [4X<A sequence containing 5 morphisms of left modules at degrees [ 0 .. 5 ]>[0X
    [4Xgap> Display( L );[0X
    [4X-------------------------[0X
    [4Xat homology degree: 5[0X
    [4XZ/< 4 >[0X
    [4X-------------------------[0X
    [4X[ [  1,  3 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 2 matrix[0X
    [4X------------v------------[0X
    [4Xat homology degree: 4[0X
    [4XZ/< 2 > + Z/< 4 >[0X
    [4X-------------------------[0X
    [4X[ [  0,  1 ],[0X
    [4X  [  0,  1 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 2 x 2 matrix[0X
    [4X------------v------------[0X
    [4Xat homology degree: 3[0X
    [4XZ/< 2 > + Z/< 2 >[0X
    [4X-------------------------[0X
    [4X[ [  2 ],[0X
    [4X  [  0 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 2 x 1 matrix[0X
    [4X------------v------------[0X
    [4Xat homology degree: 2[0X
    [4XZ/< 4 >[0X
    [4X-------------------------[0X
    [4X[ [  0,  2 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 2 matrix[0X
    [4X------------v------------[0X
    [4Xat homology degree: 1[0X
    [4XZ/< 2 > + Z/< 4 >[0X
    [4X-------------------------[0X
    [4X[ [  0,  1 ],[0X
    [4X  [  1,  1 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 2 x 2 matrix[0X
    [4X------------v------------[0X
    [4Xat homology degree: 0[0X
    [4XZ/< 2 > + Z/< 2 >[0X
    [4X-------------------------[0X
    [4Xgap> IsExactSequence( L );[0X
    [4Xtrue[0X
    [4Xgap> L;[0X
    [4X<An exact sequence containing 5 morphisms of left modules at degrees[0X
    [4X[ 0 .. 5 ]>[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-21 Functor_HomHom[0m
  
  [2X> Functor_HomHom_____________________________________________[0Xglobal variable
  
  The bifunctor [10XHomHom[0m.
  
  Below  is  the  only [13Xspecific[0m line of code used to define [10XFunctor_HomHom[0m and
  all the different operations [10XHomHom[0m in [5Xhomalg[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XFunctor_Hom * Functor_Hom;[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.4-22 Functor_LHomHom[0m
  
  [2X> Functor_LHomHom____________________________________________[0Xglobal variable
  
  The bifunctor [10XLHomHom[0m.
  
  Below  is  the only [13Xspecific[0m line of code used to define [10XFunctor_LHomHom[0m and
  all the different operations [10XLHomHom[0m in [5Xhomalg[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XLeftDerivedFunctor( Functor_HomHom );[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X16.5 Tool Functors[0X
  
  
  [1X16.6 Other Functors[0X
  
  
  [1X16.7 Functors: Operations and Functions[0X
  
  [1X16.7-1 NameOfFunctor[0m
  
  [2X> NameOfFunctor( [0X[3XF[0X[2X ) ______________________________________________[0Xoperation
  [6XReturns:[0X  a string
  
  The name of the [5Xhomalg[0m functor [3XF[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> NameOfFunctor( Functor_Ext );[0X
    [4X"Ext"[0X
    [4Xgap> Display( Functor_Ext );[0X
    [4XExt[0X
  [4X------------------------------------------------------------------[0X
  
  [1X16.7-2 InstallFunctor[0m
  
  [2X> InstallFunctor( [0X[3XF[0X[2X ) _____________________________________________[0Xoperation
  
  Install  several methods for [5XGAP[0m operations that get declared under the name
  of  the [5Xhomalg[0m (multi-)functor [3XF[0m (--> [2XNameOfFunctor[0m ([14X16.7-1[0m)). These methods
  are  used  to  apply  the  functor  to  objects, morphisms, (co)complexes of
  objects, and (co)chain maps. The objects in the (co)complexes might again be
  (co)complexes.
  
  (For  purely technical reasons the multiplicity of the functor might at most
  be three. This restriction should disappear in future versions.)
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XInstallMethod( InstallFunctor,[0X
    [4X        "for homalg functors",[0X
    [4X        [ IsHomalgFunctorRep ],[0X
    [4X        [0X
    [4X  function( Functor )[0X
    [4X    [0X
    [4X    InstallFunctorOnObjects( Functor );[0X
    [4X    [0X
    [4X    if IsSpecialFunctor( Functor ) then[0X
    [4X        [0X
    [4X        InstallSpecialFunctorOnMorphisms( Functor );[0X
    [4X        [0X
    [4X    else[0X
    [4X        [0X
    [4X        InstallFunctorOnMorphisms( Functor );[0X
    [4X        [0X
    [4X        InstallFunctorOnComplexes( Functor );[0X
    [4X        [0X
    [4X        InstallFunctorOnChainMaps( Functor );[0X
    [4X        [0X
    [4X    fi;[0X
    [4X    [0X
    [4Xend );[0X
  [4X------------------------------------------------------------------[0X
  
  The method does not return anything.
  
  [1X16.7-3 InstallDeltaFunctor[0m
  
  [2X> InstallDeltaFunctor( [0X[3XF[0X[2X ) ________________________________________[0Xoperation
  
  In  case  [3XF[0m  is  a  delta-functor in the sense of Grothendieck the procedure
  installs  several  operations under the name of the [5Xhomalg[0m (multi-)functor [3XF[0m
  (-->   [2XNameOfFunctor[0m   ([14X16.7-1[0m))   allowing   one   to   compute  connecting
  homomorphisms,  exact  triangles,  and  associated long exact sequences. The
  input of these operations is a short exact sequence.
  
  (For  purely technical reasons the multiplicity of the functor might at most
  be three. This restriction should disappear in future versions.)
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XInstallMethod( InstallDeltaFunctor,[0X
    [4X        "for homalg functors",[0X
    [4X        [ IsHomalgFunctorRep ],[0X
    [4X        [0X
    [4X  function( Functor )[0X
    [4X    local number_of_arguments;[0X
    [4X    [0X
    [4X    number_of_arguments := MultiplicityOfFunctor( Functor );[0X
    [4X    [0X
    [4X    if number_of_arguments = 1 then[0X
    [4X        [0X
    [4X        HelperToInstallUnivariateDeltaFunctor( Functor );[0X
    [4X        [0X
    [4X    elif number_of_arguments = 2 then[0X
    [4X        [0X
    [4X        HelperToInstallFirstArgumentOfBivariateDeltaFunctor( Functor );[0X
    [4X        HelperToInstallSecondArgumentOfBivariateDeltaFunctor( Functor );[0X
    [4X        [0X
    [4X    elif number_of_arguments = 3 then[0X
    [4X        [0X
    [4X        HelperToInstallFirstArgumentOfTrivariateDeltaFunctor( Functor );[0X
    [4X        HelperToInstallSecondArgumentOfTrivariateDeltaFunctor( Functor );[0X
    [4X        HelperToInstallThirdArgumentOfTrivariateDeltaFunctor( Functor );[0X
    [4X        [0X
    [4X    fi;[0X
    [4X    [0X
    [4Xend );[0X
  [4X------------------------------------------------------------------[0X
  
  The method does not return anything.
  
