# SPDX-License-Identifier: GPL-2.0-or-later # GradedModules: A homalg based package for the Abelian category of finitely presented graded modules over computable graded rings # # Implementations #
DeclareRepresentation( "IsGradedSubmoduleRep",
IsGradedModuleOrGradedSubmoduleRep and
IsStaticFinitelyPresentedSubobjectRep,
[ "map_having_subobject_as_its_image" ] );
#################################### # # families and types: # ####################################
# two new types:
BindGlobal( "TheTypeHomalgLeftGradedSubmodule",
NewType( TheFamilyOfHomalgModules,
IsGradedSubmoduleRep and IsHomalgLeftObjectOrMorphismOfLeftObjects ) );
BindGlobal( "TheTypeHomalgRightGradedSubmodule",
NewType( TheFamilyOfHomalgModules,
IsGradedSubmoduleRep and IsHomalgRightObjectOrMorphismOfRightObjects ) );
#################################### # # methods for operations: # ####################################
##
InstallMethod( MatchPropertiesAndAttributesOfSubobjectAndUnderlyingObject, "for a graded submodule and its underlying graded module",
[ IsGradedSubmoduleRep, IsGradedModuleRep ],
function( I, M )
## we don't check if M is the underlying object of I ## to avoid infinite loops as EmbeddingInSuperObject ## will be invoked if ConstructedAsAnIdeal( I ) then
MatchPropertiesAndAttributes( I, M,
LIGrMOD.intrinsic_properties_shared_with_subobjects_and_ideals,
LIGrMOD.intrinsic_attributes_shared_with_subobjects_and_ideals );
else
MatchPropertiesAndAttributes( I, M,
LIGrMOD.intrinsic_properties_shared_with_subobjects_which_are_not_ideals,
LIGrMOD.intrinsic_attributes_shared_with_subobjects_which_are_not_ideals );
fi;
end );
##
InstallMethod( MorphismHavingSubobjectAsItsImage, "for a graded submodule",
[ IsGradedSubmoduleRep ], function( M )
local psi, uM, uphi, phi, upsi;
if HasEmbeddingInSuperObject( M ) then
return EmbeddingInSuperObject( M ); fi;
psi := M!.map_having_subobject_as_its_image;
uM := UnderlyingModule( M );
if HasEmbeddingInSuperObject( uM ) then
uphi := EmbeddingInSuperObject( uM );
phi := GradedMap( uphi, "create", Range( psi ) );
SetEmbeddingInSuperObject( M, phi );
return phi; fi;
# this is mohamed's fault
upsi := uM!.map_having_subobject_as_its_image; if not IsIdenticalObj( UnderlyingMorphismMutable( psi ), upsi ) then
psi := GradedMap( upsi, "create", Range( psi ) );
M!.map_having_subobject_as_its_image := psi; fi;
if IsIdenticalObj( HomalgRing( gen ), HomalgRing( UnderlyingModule( M ) ) ) then
gen2 := gen; elif IsIdenticalObj( HomalgRing( gen ), HomalgRing( M ) ) then
gen2 := UnderlyingMatrixOverNonGradedRing( gen ); else
Error( "the matrix and the module are not defined over identically the same ring\n" ); fi;
if IsHomalgLeftObjectOrMorphismOfLeftObjects( M ) then if NumberColumns( gen ) <> NrGenerators( M ) then
Error( "the first argument is matrix with ", NumberColumns( gen )," columns while the second argument is a module on ", NrGenerators( M ), " generators\n" ); fi; else if NumberRows( gen ) <> NrGenerators( M ) then
Error( "the first argument is matrix with ", NumberRows( gen )," rows while the second argument is a module on ", NrGenerators( M ), " generators\n" ); fi; fi;
N := rec(
ring := S,
map_having_subobject_as_its_image := phi
);
if IsHomalgLeftObjectOrMorphismOfLeftObjects( phi ) then ## Objectify:
ObjectifyWithAttributes(
N, TheTypeHomalgLeftGradedSubmodule,
UnderlyingModule, img,
ConstructedAsAnIdeal, ConstructedAsAnIdeal( img ),
LeftActingDomain, S ); else ## Objectify:
ObjectifyWithAttributes(
N, TheTypeHomalgRightGradedSubmodule,
UnderlyingModule, img,
ConstructedAsAnIdeal, ConstructedAsAnIdeal( img ),
RightActingDomain, S ); fi;
## immediate methods will check if they can set ## SetIsTorsionFree( N, true ); and SetIsTorsion( N, true ); ## by checking if the corresponding property for T is true
if ConstructedAsAnIdeal( img ) then
entry := ToDoListEntryToMaintainEqualAttributes( [ [ N, "EmbeddingInSuperObject" ] ],
[ N, [ UnderlyingObject, N ] ],
Concatenation( LIGrMOD.intrinsic_properties_shared_with_subobjects_and_ideals,
LIGrMOD.intrinsic_attributes_shared_with_subobjects_and_ideals ) );
AddToToDoList( entry );
entry := ToDoListEntryToMaintainEqualAttributes( [ [ N, "FactorObject" ] ],
[ N, [ FactorObject, N ] ],
Concatenation( LIGrMOD.intrinsic_properties_shared_with_factors_modulo_ideals,
LIGrMOD.intrinsic_attributes_shared_with_factors_modulo_ideals ) );
AddToToDoList( entry );
else
entry := ToDoListEntryToMaintainEqualAttributes( [ [ N, "EmbeddingInSuperObject" ] ],
[ N, [ UnderlyingObject, N ] ],
Concatenation( LIGrMOD.intrinsic_properties_shared_with_subobjects_which_are_not_ideals,
LIGrMOD.intrinsic_attributes_shared_with_subobjects_which_are_not_ideals ) );
AddToToDoList( entry );
fi;
return N;
end );
InstallMethod( GradedLeftSubmodule, "constructor for homalg graded submodules",
[ IsHomalgMatrix ],
function( gen )
local S;
S := HomalgRing( gen );
return Subobject( gen, ( NumberColumns( gen ) * S )^0 );
return GradedLeftSubmodule( HomalgIdentityMatrix( 1, S ) );
end );
##
InstallMethod( GradedLeftSubmodule, "constructor for homalg ideals",
[ IsList ],
function( gen )
local S;
if gen = [ ] then
Error( "an empty list of ring elements\n" ); elif not ForAll( gen, IsRingElement ) then
Error( "a list of ring elements is expected\n" ); fi;
S := HomalgRing( gen[1] );
return GradedLeftSubmodule( HomalgMatrix( gen, Length( gen ), 1, S ) );
end );
##
InstallMethod( GradedLeftSubmodule, "constructor for homalg ideals",
[ IsHomalgGradedRingElementRep ],
function( f )
## WARNING: we do not check that f is homogeneous
if not IsBound( f!.GradedLeftSubmodule ) then
f!.GradedLeftSubmodule := GradedLeftSubmodule( [ f ] ); fi;
if gen = [ ] then
return ZeroLeftSubmodule( S ); fi;
Gen := List( gen, function( r ) if IsString( r ) then
return HomalgRingElement( r, S ); elif IsRingElement( r ) then
return r; else
Error( r, " is neither a string nor a ring element\n" ); fi; end );
return GradedLeftSubmodule( HomalgMatrix( Gen, Length( Gen ), 1, S ) );
return GradedRightSubmodule( HomalgIdentityMatrix( 1, S ) );
end );
##
InstallMethod( GradedRightSubmodule, "constructor for homalg ideals",
[ IsList ],
function( gen )
local S;
if gen = [ ] then
Error( "an empty list of ring elements\n" ); elif not ForAll( gen, IsRingElement ) then
Error( "a list of ring elements is expected\n" ); fi;
S := HomalgRing( gen[1] );
return GradedRightSubmodule( HomalgMatrix( gen, 1, Length( gen ), S ) );
end );
##
InstallMethod( GradedRightSubmodule, "constructor for homalg ideals",
[ IsHomalgGradedRingElementRep ],
function( f )
## WARNING: we do not check that f is homogeneous
if not IsBound( f!.GradedRightSubmodule ) then
f!.GradedRightSubmodule := GradedRightSubmodule( [ f ] ); fi;
if gen = [ ] then
return ZeroRightSubmodule( S ); fi;
Gen := List( gen, function( r ) if IsString( r ) then
return HomalgRingElement( r, S ); elif IsRingElement( r ) then
return r; else
Error( r, " is neither a string nor a ring element\n" ); fi; end );
return GradedRightSubmodule( HomalgMatrix( Gen, 1, Length( Gen ), S ) );
##
InstallMethod( GradedRightIdealOfMaximalMinors, "constructor for homalg ideals",
[ IsHomalgMatrix ],
function( M )
return GradedRightSubmodule( MaximalMinors( M ) );
end );
##
InstallMethod( MaximalGradedLeftIdeal, "constructor for the maximal homogeneous ideal",
[ IsHomalgGradedRing ],
function( S )
return ImageSubobject( MaximalIdealAsLeftMorphism( S ) );
end );
##
InstallMethod( MaximalGradedRightIdeal, "constructor for the maximal homogeneous ideal",
[ IsHomalgGradedRing ],
function( S )
return ImageSubobject( MaximalIdealAsRightMorphism( S ) );
end );
##
InstallMethod( ResidueClassRingAsGradedLeftModule, "constructor for the residue class ring modulo the maximal graded ideal",
[ IsHomalgGradedRing ],
function( S )
return FactorObject( MaximalGradedLeftIdeal( S ) );
end );
##
InstallMethod( ResidueClassRingAsGradedRightModule, "constructor for the residue class ring modulo the maximal graded ideal",
[ IsHomalgGradedRing ],
function( S )
return FactorObject( MaximalGradedRightIdeal( S ) );
if not IsIdenticalObj( super, SuperObject( J ) ) then
Error( "the super objects must coincide\n" ); elif not ( ConstructedAsAnIdeal( I ) and ConstructedAsAnIdeal( J ) ) then
Error( "can only multiply ideals in a common ring\n" ); fi;
sub := UnderlyingModule( I ) * UnderlyingModule( J );
sub := GradedMap( sub!.map_having_subobject_as_its_image, "create", super );
if IsHomalgLeftObjectOrMorphismOfLeftObjects( I ) then
return GradedLeftIdealOfMaximalMinors( jac ); else
return GradedRightIdealOfMaximalMinors( jac ); fi;
end );
##
InstallMethod( JacobianIdeal, "for homalg ring elements",
[ IsHomalgRingElement ],
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.