  
  [1X9 Modules[0X
  
  A  [5Xhomalg[0m  module  is  a  data  structure for a finitely presented module. A
  presentation  is  given  by a set of generators and a set of relations among
  these  generators.  The  data  structure for modules in [5Xhomalg[0m has two novel
  features:
  
  --    The  data structure allows several presentations linked with so-called
        transition matrices. One of the presentations is marked as the default
        presentation,  which is usually the last added one. A new presentation
        can  always be added provided it is linked to the default presentation
        by  a  transition  matrix.  If  needed, the user can reset the default
        presentation  by  choosing one of the other presentations saved in the
        data  structure  of  the  [5Xhomalg[0m module. Effectively, a module is then
        given  by  "all"  its  presentations  (as "coordinates") together with
        isomorphisms  between  them  (as  "coordinate changes"). Being able to
        "change  coordinates"  makes  the  realization  of  a module in [5Xhomalg[0m
        [13Xintrinsic[0m (or "coordinate free").
  
  --    To  present  a  left/right  module  it suffices to take a matrix [3XM[0m and
        interpret  its  rows/columns as relations among n [13Xabstract[0m generators,
        where  n  is the number of columns/rows of [3XM[0m. Only that these abstract
        generators  are useless when it comes to specific modules like modules
        of  homomorphisms, where one expects the generators to be maps between
        modules.  For  this reason a presentation of a module in [5Xhomalg[0m is not
        merely a matrix of relations, but together with a set of generators.
  
  
  [1X9.1 Modules: Category and Representations[0X
  
  [1X9.1-1 IsHomalgModule[0m
  
  [2X> IsHomalgModule( [0X[3XM[0X[2X ) ______________________________________________[0XCategory
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  The [5XGAP[0m category of [5Xhomalg[0m modules.
  
  (It  is  a  subcategory  of  the  [5XGAP[0m  categories  [10XIsHomalgRingOrModule[0m  and
  [10XIsHomalgObject[0m.)
  
  [1X9.1-2 IsFinitelyPresentedModuleOrSubmoduleRep[0m
  
  [2X> IsFinitelyPresentedModuleOrSubmoduleRep( [0X[3XM[0X[2X ) _______________[0XRepresentation
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  The [5XGAP[0m representation of finitley presented [5Xhomalg[0m modules.
  
  (It is a representation of the [5XGAP[0m category [2XIsHomalgModule[0m ([14X9.1-1[0m).)
  
  [1X9.1-3 IsFinitelyPresentedModuleRep[0m
  
  [2X> IsFinitelyPresentedModuleRep( [0X[3XM[0X[2X ) __________________________[0XRepresentation
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  The [5XGAP[0m representation of finitley presented [5Xhomalg[0m modules.
  
  (It is a representation of the [5XGAP[0m category [2XIsHomalgModule[0m ([14X9.1-1[0m), which is
  a       subrepresentation       of       the       [5XGAP[0m       representations
  [10XIsFinitelyPresentedModuleOrSubmoduleRep[0m,  [10XIsFinitelyPresentedObjectRep[0m,  and
  [10XIsHomalgRingOrFinitelyPresentedModuleRep[0m.)
  
  [1X9.1-4 IsFinitelyPresentedSubmoduleRep[0m
  
  [2X> IsFinitelyPresentedSubmoduleRep( [0X[3XM[0X[2X ) _______________________[0XRepresentation
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  The [5XGAP[0m representation of finitley generated [5Xhomalg[0m submodules.
  
  (It  is  a  representation  of  the  [5XGAP[0m  category  [2XIsHomalgModule[0m  ([14X9.1-1[0m),
  [10XIsFinitelyPresentedModuleOrSubmoduleRep[0m,    [10XIsFinitelyPresentedSubobjectRep[0m,
  and [10XIsHomalgRingOrFinitelyPresentedModuleRep[0m.)
  
  
  [1X9.2 Modules: Constructors[0X
  
  [1X9.2-1 LeftPresentation[0m
  
  [2X> LeftPresentation( [0X[3Xmat[0X[2X ) _________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m module
  
  This  constructor  returns the finitely presented left module with relations
  given by the rows of the [5Xhomalg[0m matrix [3Xmat[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> M := HomalgMatrix( "[ \[0X
    [4X> 2, 3, 4, \[0X
    [4X> 5, 6, 7  \[0X
    [4X> ]", 2, 3, ZZ );[0X
    [4X<A homalg internal 2 by 3 matrix>[0X
    [4Xgap> M := LeftPresentation( M );[0X
    [4X<A non-torsion left module presented by 2 relations for 3 generators>[0X
    [4Xgap> Display( M );[0X
    [4X[ [  2,  3,  4 ],[0X
    [4X  [  5,  6,  7 ] ][0X
    [4X[0X
    [4XCokernel of the map[0X
    [4X[0X
    [4XZ^(1x2) --> Z^(1x3),[0X
    [4X[0X
    [4Xcurrently represented by the above matrix[0X
    [4Xgap> ByASmallerPresentation( M );[0X
    [4X<A rank 1 left module presented by 1 relation for 2 generators>[0X
    [4Xgap> Display( last );[0X
    [4XZ/< 3 > + Z^(1 x 1)[0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-2 RightPresentation[0m
  
  [2X> RightPresentation( [0X[3Xmat[0X[2X ) ________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m module
  
  This  constructor returns the finitely presented right module with relations
  given by the columns of the [5Xhomalg[0m matrix [3Xmat[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> M := HomalgMatrix( "[ \[0X
    [4X> 2, 3, 4, \[0X
    [4X> 5, 6, 7  \[0X
    [4X> ]", 2, 3, ZZ );[0X
    [4X<A homalg internal 2 by 3 matrix>[0X
    [4Xgap> M := RightPresentation( M );[0X
    [4X<A right module on 2 generators satisfying 3 relations>[0X
    [4Xgap> ByASmallerPresentation( M );[0X
    [4X<A cyclic torsion right module on a cyclic generator satisfying 1 relation>[0X
    [4Xgap> Display( last );[0X
    [4XZ/< 3 >[0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-3 HomalgFreeLeftModule[0m
  
  [2X> HomalgFreeLeftModule( [0X[3Xr, R[0X[2X ) ____________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m module
  
  This  constructor  returns a free left module of rank [3Xr[0m over the [5Xhomalg[0m ring
  [3XR[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> F := HomalgFreeLeftModule( 1, ZZ );[0X
    [4X<A 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
    [4Xgap> F := HomalgFreeLeftModule( 2, ZZ );[0X
    [4X<A free left module of rank 2 on free generators>[0X
    [4Xgap> 2 * ZZ;[0X
    [4X<A free left module of rank 2 on free generators>[0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-4 HomalgFreeRightModule[0m
  
  [2X> HomalgFreeRightModule( [0X[3Xr, R[0X[2X ) ___________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m module
  
  This  constructor returns a free right module of rank [3Xr[0m over the [5Xhomalg[0m ring
  [3XR[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> F := HomalgFreeRightModule( 1, ZZ );[0X
    [4X<A free right module of rank 1 on a free generator>[0X
    [4Xgap> ZZ * 1;[0X
    [4X<The free right module of rank 1 on a free generator>[0X
    [4Xgap> F := HomalgFreeRightModule( 2, ZZ );[0X
    [4X<A free right module of rank 2 on free generators>[0X
    [4Xgap> ZZ * 2;[0X
    [4X<A free right module of rank 2 on free generators>[0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-5 HomalgZeroLeftModule[0m
  
  [2X> HomalgZeroLeftModule( [0X[3Xr, R[0X[2X ) ____________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m module
  
  This  constructor  returns a zero left module of rank [3Xr[0m over the [5Xhomalg[0m ring
  [3XR[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> F := HomalgZeroLeftModule( ZZ );[0X
    [4X<A zero left module>[0X
    [4Xgap> 0 * ZZ;[0X
    [4X<The zero left module>[0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-6 HomalgZeroRightModule[0m
  
  [2X> HomalgZeroRightModule( [0X[3Xr, R[0X[2X ) ___________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m module
  
  This  constructor returns a zero right module of rank [3Xr[0m over the [5Xhomalg[0m ring
  [3XR[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> F := HomalgZeroRightModule( ZZ );[0X
    [4X<A zero right module>[0X
    [4Xgap> ZZ * 0;[0X
    [4X<The zero right module>[0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-7 \*[0m
  
  [2X> \*( [0X[3XR, M[0X[2X ) ______________________________________________________[0Xoperation
  [2X> \*( [0X[3XM, R[0X[2X ) ______________________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m module
  
  Transfers  the  S-module  [3XM[0m over the [5Xhomalg[0m ring [3XR[0m. This works only in three
  cases:
  
  (1)   S is a subring of [3XR[0m.
  
  (2)   [3XR[0m is a residue class ring of S constructed using [10X/[0m (--> [2X\/[0m ([14X4.2-3[0m)).
  
  (3)   [3XR[0m  is  a  subring  of  S  and  the  entries  of  the current matrix of
        S-relations of [3XM[0m lie in [3XR[0m.
  
  CAUTION: So it is not suited for general base change.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );[0X
    [4X<A homalg internal ring>[0X
    [4Xgap> Z4 := ZZ / 4;[0X
    [4X<A homalg residue class ring>[0X
    [4Xgap> Display( Z4 );[0X
    [4XZ/( 4 )[0X
    [4Xgap> M := HomalgDiagonalMatrix( [ 2 .. 4 ], ZZ );[0X
    [4X<An unevaluated diagonal homalg internal 3 by 3 matrix>[0X
    [4Xgap> M := LeftPresentation( M );[0X
    [4X<A left module presented by 3 relations for 3 generators>[0X
    [4Xgap> Display( M );[0X
    [4XZ/< 2 > + Z/< 3 > + Z/< 4 >[0X
    [4Xgap> M;[0X
    [4X<A torsion left module presented by 3 relations for 3 generators>[0X
    [4Xgap> N := Z4 * M; ## or N := M * Z4;[0X
    [4X<A non-torsion left module presented by 2 relations for 3 generators>[0X
    [4Xgap> ByASmallerPresentation( N );[0X
    [4X<A non-torsion left module presented by 1 relation for 2 generators>[0X
    [4Xgap> Display( N );[0X
    [4XZ/( 4 )/< |[ 2 ]| > + Z/( 4 )^(1 x 1)[0X
    [4Xgap> N;[0X
    [4X<A non-torsion left module presented by 1 relation for 2 generators>[0X
  [4X------------------------------------------------------------------[0X
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> M := HomalgMatrix( "[ \[0X
    [4X> 2, 3, 4, \[0X
    [4X> 5, 6, 7  \[0X
    [4X> ]", 2, 3, ZZ );[0X
    [4X<A homalg internal 2 by 3 matrix>[0X
    [4Xgap> M := LeftPresentation( M );[0X
    [4X<A non-torsion left module presented by 2 relations for 3 generators>[0X
    [4Xgap> Z4 := ZZ / 4;;[0X
    [4Xgap> Display( Z4 );[0X
    [4XZ/( 4 )[0X
    [4Xgap> M4 := Z4 * M;[0X
    [4X<A non-torsion left module presented by 2 relations for 3 generators>[0X
    [4Xgap> Display( M4 );[0X
    [4X[ [  2,  3,  4 ],[0X
    [4X  [  5,  6,  7 ] ][0X
    [4X[0X
    [4Xmodulo [ 4 ][0X
    [4X[0X
    [4XCokernel of the map[0X
    [4X[0X
    [4XZ/( 4 )^(1x2) --> Z/( 4 )^(1x3),[0X
    [4X[0X
    [4Xcurrently represented by the above matrix[0X
    [4Xgap> d := Resolution( 2, M4 );[0X
    [4X<A right acyclic complex containing 2 morphisms of left modules at degrees [0X
    [4X[ 0 .. 2 ]>[0X
    [4Xgap> Hom( d, Z4 );[0X
    [4X<A cocomplex containing 2 morphisms of right modules at degrees [ 0 .. 2 ]>[0X
    [4Xgap> dd := Hom( d, Z4 );[0X
    [4X<A cocomplex containing 2 morphisms of right modules at degrees [ 0 .. 2 ]>[0X
    [4Xgap> DD := Resolution( 2, dd );[0X
    [4X<A cocomplex containing 2 morphisms of right complexes at degrees [ 0 .. 2 ]>[0X
    [4Xgap> D := Hom( DD, Z4 );[0X
    [4X<A complex containing 2 morphisms of left cocomplexes at degrees [ 0 .. 2 ]>[0X
    [4Xgap> C := ZZ * D;[0X
    [4X<A "complex" containing 2 morphisms of left cocomplexes at degrees [ 0 .. 2 ]>[0X
    [4Xgap> LowestDegreeObject( C );[0X
    [4X<A "cocomplex" containing 2 morphisms of left modules at degrees [ 0 .. 2 ]>[0X
    [4Xgap> Display( last );[0X
    [4X-------------------------[0X
    [4Xat cohomology degree: 2[0X
    [4X0[0X
    [4X------------^------------[0X
    [4X(an empty 1 x 0 matrix)[0X
    [4X[0X
    [4Xthe map is currently represented by the above 1 x 0 matrix[0X
    [4X-------------------------[0X
    [4Xat cohomology degree: 1[0X
    [4XZ/< 4 > [0X
    [4X------------^------------[0X
    [4X[ [  0 ],[0X
    [4X  [  1 ],[0X
    [4X  [  2 ],[0X
    [4X  [  1 ] ][0X
    [4X[0X
    [4Xthe map is currently represented by the above 4 x 1 matrix[0X
    [4X-------------------------[0X
    [4Xat cohomology degree: 0[0X
    [4XZ/< 4 > + Z/< 4 > + Z/< 4 > + Z/< 4 > [0X
    [4X-------------------------[0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-8 Subobject[0m
  
  [2X> Subobject( [0X[3Xphi[0X[2X ) ________________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m submodule
  
  A synonym of [2XImageSubmodule[0m ([14X10.4-8[0m).
  
  [1X9.2-9 Subobject[0m
  
  [2X> Subobject( [0X[3Xmat, M[0X[2X ) _____________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m submodule
  
  This  constructor returns the finitely generated left/right submodule of the
  [5Xhomalg[0m  module  [3XM[0m  with  generators  given by the rows/columns of the [5Xhomalg[0m
  matrix [3Xmat[0m.
  
  [1X9.2-10 Subobject[0m
  
  [2X> Subobject( [0X[3Xgens, M[0X[2X ) ____________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m submodule
  
  This  constructor returns the finitely generated left/right submodule of the
  [5Xhomalg[0m  cyclic  left/right  module [3XM[0m with generators given by the entries of
  the list [3Xgens[0m.
  
  [1X9.2-11 LeftSubmodule[0m
  
  [2X> LeftSubmodule( [0X[3Xmat[0X[2X ) ____________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m submodule
  
  This   constructor  returns  the  finitely  generated  left  submodule  with
  generators given by the rows of the [5Xhomalg[0m matrix [3Xmat[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XInstallMethod( LeftSubmodule,[0X
    [4X        "constructor for homalg submodules",[0X
    [4X        [ IsHomalgMatrix ],[0X
    [4X        [0X
    [4X  function( gen )[0X
    [4X    local R;[0X
    [4X    [0X
    [4X    R := HomalgRing( gen );[0X
    [4X    [0X
    [4X    return Subobject( gen, NrColumns( gen ) * R );[0X
    [4X    [0X
    [4Xend );[0X
  [4X------------------------------------------------------------------[0X
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> Z4 := HomalgRingOfIntegers( ) / 4;[0X
    [4X<A homalg residue class ring>[0X
    [4Xgap> J := HomalgMatrix( "[ 2 ]", 1, 1, Z4 );[0X
    [4X<A homalg residue class 1 by 1 matrix>[0X
    [4Xgap> J := LeftSubmodule( J );[0X
    [4X<A principal (left) ideal given by a cyclic generator>[0X
    [4Xgap> IsFree( J );[0X
    [4Xfalse[0X
    [4Xgap> J;[0X
    [4X<A principal reflexive non-projective (left) ideal given by a cyclic generator\[0X
    [4X>[0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-12 RightSubmodule[0m
  
  [2X> RightSubmodule( [0X[3Xmat[0X[2X ) ___________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m submodule
  
  This  constructor  returns  the  finitely  generated  right  submodule  with
  generators given by the columns of the [5Xhomalg[0m matrix [3Xmat[0m.
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XInstallMethod( RightSubmodule,[0X
    [4X        "constructor for homalg submodules",[0X
    [4X        [ IsHomalgMatrix ],[0X
    [4X        [0X
    [4X  function( gen )[0X
    [4X    local R;[0X
    [4X    [0X
    [4X    R := HomalgRing( gen );[0X
    [4X    [0X
    [4X    return Subobject( gen, R * NrRows( gen ) );[0X
    [4X    [0X
    [4Xend );[0X
  [4X------------------------------------------------------------------[0X
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> Z4 := HomalgRingOfIntegers( ) / 4;[0X
    [4X<A homalg residue class ring>[0X
    [4Xgap> J := HomalgMatrix( "[ 2 ]", 1, 1, Z4 );[0X
    [4X<A homalg residue class 1 by 1 matrix>[0X
    [4Xgap> J := RightSubmodule( J );[0X
    [4X<A principal (right) ideal given by a cyclic generator>[0X
    [4Xgap> IsFree( J );[0X
    [4Xfalse[0X
    [4Xgap> J;[0X
    [4X<A principal reflexive non-projective (right) ideal given by a cyclic generato\[0X
    [4Xr>[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X9.3 Modules: Properties[0X
  
  [1X9.3-1 IsFree[0m
  
  [2X> IsFree( [0X[3XM[0X[2X ) ______________________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m module [3XM[0m is free.
  
  [1X9.3-2 IsStablyFree[0m
  
  [2X> IsStablyFree( [0X[3XM[0X[2X ) ________________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m module [3XM[0m is stably free.
  
  [1X9.3-3 IsProjective[0m
  
  [2X> IsProjective( [0X[3XM[0X[2X ) ________________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m module [3XM[0m is projective.
  
  [1X9.3-4 FiniteFreeResolutionExists[0m
  
  [2X> FiniteFreeResolutionExists( [0X[3XM[0X[2X ) __________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m module [3XM[0m allows a finite free resolution.
  (no method installed)
  
  [1X9.3-5 IsReflexive[0m
  
  [2X> IsReflexive( [0X[3XM[0X[2X ) _________________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m module [3XM[0m is reflexive.
  
  [1X9.3-6 IsTorsionFree[0m
  
  [2X> IsTorsionFree( [0X[3XM[0X[2X ) _______________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m module [3XM[0m is torsion-free.
  
  [1X9.3-7 IsArtinian[0m
  
  [2X> IsArtinian( [0X[3XM[0X[2X ) __________________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m module [3XM[0m is artinian.
  
  [1X9.3-8 IsCyclic[0m
  
  [2X> IsCyclic( [0X[3XM[0X[2X ) ____________________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m module [3XM[0m is cyclic.
  
  [1X9.3-9 IsTorsion[0m
  
  [2X> IsTorsion( [0X[3XM[0X[2X ) ___________________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m module [3XM[0m is torsion.
  
  [1X9.3-10 IsHolonomic[0m
  
  [2X> IsHolonomic( [0X[3XM[0X[2X ) _________________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m module [3XM[0m is holonomic.
  
  [1X9.3-11 IsPure[0m
  
  [2X> IsPure( [0X[3XM[0X[2X ) ______________________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m module [3XM[0m is pure.
  
  [1X9.3-12 HasConstantRank[0m
  
  [2X> HasConstantRank( [0X[3XM[0X[2X ) _____________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m module [3XM[0m has constant rank.
  (no method installed)
  
  [1X9.3-13 ConstructedAsAnIdeal[0m
  
  [2X> ConstructedAsAnIdeal( [0X[3XJ[0X[2X ) ________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check if the [5Xhomalg[0m submodule [3XJ[0m was constructed as an ideal.
  (no method installed)
  
  [1X9.3-14 IsPrimeIdeal[0m
  
  [2X> IsPrimeIdeal( [0X[3XJ[0X[2X ) ________________________________________________[0Xproperty
  [6XReturns:[0X  [10Xtrue[0m or [10Xfalse[0m
  
  Check  if  the  [5Xhomalg[0m  submodule  [3XJ[0m  is  a  prime ideal. The ring has to be
  commutative.
  (no method installed)
  
  
  [1X9.4 Modules: Attributes[0X
  
  [1X9.4-1 TheZeroMorphism[0m
  
  [2X> TheZeroMorphism( [0X[3XM[0X[2X ) ____________________________________________[0Xattribute
  [6XReturns:[0X  a [5Xhomalg[0m map
  
  The zero endomorphism of the [5Xhomalg[0m module [3XM[0m.
  
  [1X9.4-2 TheIdentityMorphism[0m
  
  [2X> TheIdentityMorphism( [0X[3XM[0X[2X ) ________________________________________[0Xattribute
  [6XReturns:[0X  a [5Xhomalg[0m map
  
  The identity automorphism of the [5Xhomalg[0m module [3XM[0m.
  
  [1X9.4-3 FullSubmodule[0m
  
  [2X> FullSubmodule( [0X[3XM[0X[2X ) ______________________________________________[0Xattribute
  [6XReturns:[0X  a [5Xhomalg[0m submodule
  
  The [5Xhomalg[0m module [3XM[0m as a submodule of itself.
  
  [1X9.4-4 EmbeddingInSuperObject[0m
  
  [2X> EmbeddingInSuperObject( [0X[3XN[0X[2X ) _____________________________________[0Xattribute
  [6XReturns:[0X  a [5Xhomalg[0m map
  
  In  case [3XN[0m was defined as a submodule of some module L the embedding of [3XN[0m in
  L is returned.
  
  [1X9.4-5 FactorObject[0m
  
  [2X> FactorObject( [0X[3XN[0X[2X ) _______________________________________________[0Xattribute
  [6XReturns:[0X  a [5Xhomalg[0m module
  
  In  case [3XN[0m was defined as a submodule of some module L the factor module L/[3XN[0m
  is returned.
  
  [1X9.4-6 ResidueClassRing[0m
  
  [2X> ResidueClassRing( [0X[3XJ[0X[2X ) ___________________________________________[0Xattribute
  [6XReturns:[0X  a [5Xhomalg[0m ring
  
  In  case  [3XJ[0m  was  defined  as a (left/right) ideal of the ring R the residue
  class ring R/[3XJ[0m is returned.
  
  [1X9.4-7 UnderlyingSubobject[0m
  
  [2X> UnderlyingSubobject( [0X[3XM[0X[2X ) ________________________________________[0Xattribute
  [6XReturns:[0X  a [5Xhomalg[0m submodule
  
  In  case  [3XM[0m  was  defined  as  the module underlying a submodule L then L is
  returned.
  (no method installed)
  
  [1X9.4-8 NatTrIdToHomHom_R[0m
  
  [2X> NatTrIdToHomHom_R( [0X[3XM[0X[2X ) __________________________________________[0Xattribute
  [6XReturns:[0X  a [5Xhomalg[0m map
  
  The  natural  evaluation  map  from  the  [5Xhomalg[0m module [3XM[0m to its double dual
  [10XHomHom[0m([3XM[0m) (cf. [2XFunctor_HomHom[0m ([14X16.4-21[0m)).
  
  [1X9.4-9 PrimaryDecomposition[0m
  
  [2X> PrimaryDecomposition( [0X[3XJ[0X[2X ) _______________________________________[0Xattribute
  [6XReturns:[0X  a list
  
  The primary decomposition of the ideal [3XJ[0m. The ring has to be commutative..
  (no method installed)
  
  [1X9.4-10 ElementaryDivisors[0m
  
  [2X> ElementaryDivisors( [0X[3XM[0X[2X ) _________________________________________[0Xattribute
  [6XReturns:[0X  a list of ring elements
  
  The list of elementary divisors of the [5Xhomalg[0m module [3XM[0m, in case they exist.
  (no method installed)
  
  [1X9.4-11 RankOfModule[0m
  
  [2X> RankOfModule( [0X[3XM[0X[2X ) _______________________________________________[0Xattribute
  [6XReturns:[0X  a nonnegative integer
  
  The projective rank of the [5Xhomalg[0m module [3XM[0m.
  
  [1X9.4-12 ProjectiveDimension[0m
  
  [2X> ProjectiveDimension( [0X[3XM[0X[2X ) ________________________________________[0Xattribute
  [6XReturns:[0X  a nonnegative integer
  
  The projective dimension of the [5Xhomalg[0m module [3XM[0m.
  
  [1X9.4-13 DegreeOfTorsionFreeness[0m
  
  [2X> DegreeOfTorsionFreeness( [0X[3XM[0X[2X ) ____________________________________[0Xattribute
  [6XReturns:[0X  a nonnegative integer of infinity
  
  Auslander's  degree of torsion-freeness of the [5Xhomalg[0m module [3XM[0m. It is set to
  infinity only for [3XM[0m=0.
  
  [1X9.4-14 Codim[0m
  
  [2X> Codim( [0X[3XM[0X[2X ) ______________________________________________________[0Xattribute
  [6XReturns:[0X  a nonnegative integer of infinity
  
  The codimension of the [5Xhomalg[0m module [3XM[0m. It is set to infinity only for [3XM[0m=0.
  
  [1X9.4-15 PurityFiltration[0m
  
  [2X> PurityFiltration( [0X[3XM[0X[2X ) ___________________________________________[0Xattribute
  [6XReturns:[0X  a [5Xhomalg[0m filtration
  
  The purity filtration of the [5Xhomalg[0m module [3XM[0m.
  
  [1X9.4-16 CodegreeOfPurity[0m
  
  [2X> CodegreeOfPurity( [0X[3XM[0X[2X ) ___________________________________________[0Xattribute
  [6XReturns:[0X  a list of nonnegative integers
  
  The codegree of purity of the [5Xhomalg[0m module [3XM[0m.
  
  [1X9.4-17 BettiDiagram[0m
  
  [2X> BettiDiagram( [0X[3XM[0X[2X ) _______________________________________________[0Xattribute
  [6XReturns:[0X  a [5Xhomalg[0m diagram
  
  The Betti diagram of the [5Xhomalg[0m graded module [3XM[0m.
  
  [1X9.4-18 CastelnuovoMumfordRegularity[0m
  
  [2X> CastelnuovoMumfordRegularity( [0X[3XM[0X[2X ) _______________________________[0Xattribute
  [6XReturns:[0X  a non-negative integer
  
  The Castelnuovo-Mumford regularity of the [5Xhomalg[0m graded module [3XM[0m.
  
  
  [1X9.5 Modules: Operations and Functions[0X
  
  [1X9.5-1 HomalgRing[0m
  
  [2X> HomalgRing( [0X[3XM[0X[2X ) _________________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m ring
  
  The [5Xhomalg[0m ring of the [5Xhomalg[0m module [3XM[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );[0X
    [4X<A homalg internal ring>[0X
    [4Xgap> M := ZZ * 4;[0X
    [4X<A free right module of rank 4 on free generators>[0X
    [4Xgap> R := HomalgRing( M );[0X
    [4X<A homalg internal ring>[0X
    [4Xgap> IsIdenticalObj( R, ZZ );[0X
    [4Xtrue[0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.5-2 ByASmallerPresentation[0m
  
  [2X> ByASmallerPresentation( [0X[3XM[0X[2X ) ________________________________________[0Xmethod
  [6XReturns:[0X  a [5Xhomalg[0m module
  
  Use  different  strategies  to  reduce  the presentation of the given [5Xhomalg[0m
  module  [3XM[0m.  This  method performs side effects on its argument [3XM[0m and returns
  it.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );;[0X
    [4Xgap> M := HomalgMatrix( "[ \[0X
    [4X> 2, 3, 4, \[0X
    [4X> 5, 6, 7  \[0X
    [4X> ]", 2, 3, ZZ );[0X
    [4X<A homalg internal 2 by 3 matrix>[0X
    [4Xgap> M := LeftPresentation( M );[0X
    [4X<A non-torsion left module presented by 2 relations for 3 generators>[0X
    [4Xgap> Display( M );[0X
    [4X[ [  2,  3,  4 ],[0X
    [4X  [  5,  6,  7 ] ][0X
    [4X[0X
    [4XCokernel of the map[0X
    [4X[0X
    [4XZ^(1x2) --> Z^(1x3),[0X
    [4X[0X
    [4Xcurrently represented by the above matrix[0X
    [4Xgap> ByASmallerPresentation( M );[0X
    [4X<A rank 1 left module presented by 1 relation for 2 generators>[0X
    [4Xgap> Display( last );[0X
    [4XZ/< 3 > + Z^(1 x 1)[0X
    [4Xgap> SetsOfGenerators( M );[0X
    [4X<A set containing 3 sets of generators of a homalg module>[0X
    [4Xgap> SetsOfRelations( M );[0X
    [4X<A set containing 3 sets of relations of a homalg module>[0X
    [4Xgap> M;[0X
    [4X<A rank 1 left module presented by 1 relation for 2 generators>[0X
    [4Xgap> SetPositionOfTheDefaultSetOfRelations( M, 1 );[0X
    [4Xgap> M;[0X
    [4X<A rank 1 left module presented by 2 relations for 3 generators>[0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.5-3 UnderlyingObject[0m
  
  [2X> UnderlyingObject( [0X[3XM[0X[2X ) ___________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m module
  
  In  case [3XM[0m was defined as a submodule of some module L the module underlying
  the submodule M is returned.
  
  [1X9.5-4 SuperObject[0m
  
  [2X> SuperObject( [0X[3XM[0X[2X ) ________________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m module
  
  In  case [3XM[0m was defined as a submodule of some module L the super module L is
  returned.
  
  [1X9.5-5 \*[0m
  
  [2X> \*( [0X[3XJ, M[0X[2X ) ______________________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m submodule
  
  Compute the submodule [3XJ[0m[3XM[0m (resp. [3XM[0m[3XJ[0m) of the given left (resp. right) R-module
  [3XM[0m, where [3XJ[0m is a left (resp. right) ideal in R.
  
  [1X9.5-6 SubmoduleQuotient[0m
  
  [2X> SubmoduleQuotient( [0X[3XK, J[0X[2X ) _______________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m ideal
  
  Compute  the  submodule  quotient  ideal  [3XK[0m:[3XJ[0m of the submodules [3XK[0m and [3XJ[0m of a
  common R-module M.
  
  [1X9.5-7 Saturate[0m
  
  [2X> Saturate( [0X[3XK, J[0X[2X ) ________________________________________________[0Xoperation
  [6XReturns:[0X  a [5Xhomalg[0m ideal
  
  Compute the saturation ideal [3XK[0m:[3XJ[0m^infty of the ideals [3XK[0m and [3XJ[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> ZZ := HomalgRingOfIntegers( );[0X
    [4X<A homalg internal ring>[0X
    [4Xgap> Display( ZZ );[0X
    [4XZ[0X
    [4Xgap> m := LeftSubmodule( "2", ZZ );[0X
    [4X<A principal (left) ideal given by a cyclic generator>[0X
    [4Xgap> Display( m );[0X
    [4X[ [  2 ] ][0X
    [4X[0X
    [4XA (left) ideal generated by the entry of the above matrix[0X
    [4Xgap> K := LeftSubmodule( "3", ZZ );[0X
    [4X<A principal (left) ideal given by a cyclic generator>[0X
    [4Xgap> Display( K );[0X
    [4X[ [  3 ] ][0X
    [4X[0X
    [4XA (left) ideal generated by the entry of the above matrix[0X
    [4Xgap> J := Intersect( K, m^3 );[0X
    [4X<A principal (left) ideal given by a cyclic generator>[0X
    [4Xgap> Display( J );[0X
    [4X[ [  24 ] ][0X
    [4X[0X
    [4XA (left) ideal generated by the entry of the above matrix[0X
    [4Xgap> Jm := SubmoduleQuotient( J, m );[0X
    [4X<A principal (left) ideal given by a cyclic generator>[0X
    [4Xgap> Display( Jm );[0X
    [4X[ [  -12 ] ][0X
    [4X[0X
    [4XA (left) ideal generated by the entry of the above matrix[0X
    [4Xgap> J_m := Saturate( J, m );[0X
    [4X<A principal (left) ideal given by a cyclic generator>[0X
    [4Xgap> Display( J_m );[0X
    [4X[ [  -3 ] ][0X
    [4X[0X
    [4XA (left) ideal generated by the entry of the above matrix[0X
    [4Xgap> J_m = K;[0X
    [4Xtrue[0X
  [4X------------------------------------------------------------------[0X
  
  [4X-----------------------------  Code  -----------------------------[0X
    [4XInstallMethod( Saturate,[0X
    [4X        "for homalg submodules",[0X
    [4X        [ IsFinitelyPresentedSubmoduleRep, IsFinitelyPresentedSubmoduleRep ],[0X
    [4X        [0X
    [4X  function( K, J )[0X
    [4X    local quotient_last, quotient;[0X
    [4X    [0X
    [4X    quotient_last := SubmoduleQuotient( K, J );[0X
    [4X    [0X
    [4X    quotient := SubmoduleQuotient( quotient_last, J );[0X
    [4X    [0X
    [4X    while not IsSubset( quotient_last, quotient ) do[0X
    [4X        quotient_last := quotient;[0X
    [4X        quotient := SubmoduleQuotient( quotient_last, J );[0X
    [4X    od;[0X
    [4X    [0X
    [4X    return quotient_last;[0X
    [4X    [0X
    [4Xend );[0X
    [4X[0X
    [4X[0X
    [4XInstallMethod( \-,	## a geometrically motivated definition[0X
    [4X        "for homalg submodules",[0X
    [4X        [ IsFinitelyPresentedSubmoduleRep, IsFinitelyPresentedSubmoduleRep ],[0X
    [4X        [0X
    [4X  function( K, J )[0X
    [4X    [0X
    [4X    return Saturate( K, J );[0X
    [4X    [0X
    [4Xend );[0X
  [4X------------------------------------------------------------------[0X
  
