## <#GAPDoc Label="IsRingRelationsRep"> ## <ManSection> ## <Filt Type="Representation" Arg="rel" Name="IsRingRelationsRep"/> ## <Returns><C>true</C> or <C>false</C></Returns> ## <Description> ## The &GAP; representation of a finite set of relations of a &homalg; ring. <P/> ## (It is a representation of the &GAP; category <Ref Filt="IsHomalgRingRelations"/>) ## </Description> ## </ManSection> ## <#/GAPDoc> ##
DeclareRepresentation( "IsRingRelationsRep",
IsHomalgRingRelations,
[ ] );
#################################### # # families and types: # ####################################
# a new family:
BindGlobal( "TheFamilyOfHomalgRingRelations",
NewFamily( "TheFamilyOfHomalgRingRelations" ) );
# two new types:
BindGlobal( "TheTypeHomalgRingRelationsAsGeneratorsOfLeftIdeal",
NewType( TheFamilyOfHomalgRingRelations,
IsRingRelationsRep and IsHomalgRingRelationsAsGeneratorsOfLeftIdeal ) );
BindGlobal( "TheTypeHomalgRingRelationsAsGeneratorsOfRightIdeal",
NewType( TheFamilyOfHomalgRingRelations,
IsRingRelationsRep and IsHomalgRingRelationsAsGeneratorsOfRightIdeal ) );
#################################### # # methods for operations: # ####################################
##
InstallMethod( DegreesOfGenerators, "for sets of ring relations",
[ IsHomalgRingRelations ],
function( rel )
if IsBound(rel!.DegreesOfGenerators) then
return rel!.DegreesOfGenerators; fi;
return fail;
end );
##
InstallMethod( EvaluatedMatrixOfRingRelations, "for sets of ring relations",
[ IsHomalgRingRelations and HasEvalMatrixOfRingRelations ],
##
InstallMethod( BasisOfModule, "for sets of ring relations",
[ IsHomalgRingRelationsAsGeneratorsOfRightIdeal ],
function( rel )
local mat, bas, inj, M, rk;
if not IsBound( rel!.BasisOfModule ) then
mat := MatrixOfRelations( rel );
bas := BasisOfColumns( mat );
inj := HasIsRightRegular( bas ) and IsRightRegular( bas );
if bas = mat then
SetCanBeUsedToDecideZero( rel, true );
rel!.EvaluatedMatrixOfRingRelations := bas; ## when computing over finite fields in Maple taking a basis normalizes the entries if inj then
SetIsInjectivePresentation( rel, true ); fi;
return rel; else
rel!.BasisOfModule := bas;
SetCanBeUsedToDecideZero( rel, false ); fi; else
bas := rel!.BasisOfModule;
inj := HasIsRightRegular( bas ) and IsRightRegular( bas ); fi;
bas := HomalgRingRelationsAsGeneratorsOfRightIdeal( bas );
if inj then
SetIsInjectivePresentation( bas, true ); fi;
SetCanBeUsedToDecideZero( bas, true );
return bas; end );
##
InstallMethod( BasisOfModule, "for sets of ring relations",
[ IsHomalgRingRelationsAsGeneratorsOfLeftIdeal ],
function( rel )
local mat, bas, inj, M, rk;
if not IsBound( rel!.BasisOfModule ) then
mat := MatrixOfRelations( rel );
bas := BasisOfRows( mat );
inj := HasIsLeftRegular( bas ) and IsLeftRegular( bas );
if bas = mat then
SetCanBeUsedToDecideZero( rel, true );
rel!.EvaluatedMatrixOfRingRelations := bas; ## when computing over finite fields in Maple taking a basis normalizes the entries if inj then
SetIsInjectivePresentation( rel, true ); fi;
return rel; else
rel!.BasisOfModule := bas;
SetCanBeUsedToDecideZero( rel, false ); fi; else
bas := rel!.BasisOfModule;
inj := HasIsLeftRegular( bas ) and IsLeftRegular( bas ); fi;
bas := HomalgRingRelationsAsGeneratorsOfLeftIdeal( bas );
if inj then
SetIsInjectivePresentation( bas, true ); fi;
SetCanBeUsedToDecideZero( bas, true );
return bas; end );
##
InstallMethod( BasisOfModule, "for sets of ring relations",
[ IsHomalgRingRelations and CanBeUsedToDecideZero ],
##
InstallMethod( GetRidOfObsoleteRelations, ### defines: GetRidOfObsoleteRelations (BetterBasis) "for sets of ring relations",
[ IsHomalgRingRelationsAsGeneratorsOfRightIdeal ],
function( M )
return HomalgRingRelationsAsGeneratorsOfRightIdeal( GetRidOfObsoleteColumns( MatrixOfRelations( M ) ) );
end );
##
InstallMethod( GetRidOfObsoleteRelations, ### defines: GetRidOfObsoleteRelations (BetterBasis) "for sets of ring relations",
[ IsHomalgRingRelationsAsGeneratorsOfLeftIdeal ],
function( M )
return HomalgRingRelationsAsGeneratorsOfLeftIdeal( GetRidOfObsoleteRows( MatrixOfRelations( M ) ) );
end );
##
InstallMethod( \^, "for sets of ring relations",
[ IsHomalgRingRelations, IsHomalgMatrix ],
function( rel, mat )
local relations;
relations := MatrixOfRelations( rel );
if IsHomalgRingRelationsAsGeneratorsOfLeftIdeal( rel ) then
return relations * mat; else
return mat * relations; fi;
end );
#################################### # # constructor functions and methods: # ####################################
##
InstallGlobalFunction( HomalgRingRelationsAsGeneratorsOfLeftIdeal, function( arg )
local l, relations, mat, M;
l := Length( arg );
relations := rec( );
if IsHomalgMatrix( arg[1] ) then
mat := arg[1];
ResetFilterObj( mat, IsMutable ); elif IsFunction( arg[1] ) then
if not ( l > 1 and IsList( arg[2] ) ) then
Error( "if the first argument is a function then the second argument must be the list of arguments\n" ); fi;
return relations; else
mat := CallFuncList( HomalgMatrix, arg ); fi;
## Objectify:
ObjectifyWithAttributes(
relations, TheTypeHomalgRingRelationsAsGeneratorsOfLeftIdeal,
EvaluatedMatrixOfRingRelations, mat );
return relations;
end );
##
InstallGlobalFunction( HomalgRingRelationsAsGeneratorsOfRightIdeal, function( arg )
local l, relations, mat, M;
l := Length( arg );
relations := rec( );
if IsHomalgMatrix( arg[1] ) then
mat := arg[1];
ResetFilterObj( mat, IsMutable ); elif IsFunction( arg[1] ) then
if not ( l > 1 and IsList( arg[2] ) ) then
Error( "if the first argument is a function then the second argument must be the list of arguments\n" ); fi;
if HasEvaluatedMatrixOfRingRelations( rel ) then if IsHomalgRingRelationsAsGeneratorsOfLeftIdeal( rel ) then
rel_new := HomalgRingRelationsAsGeneratorsOfLeftIdeal( EvaluatedMatrixOfRingRelations( rel ) ); else
rel_new := HomalgRingRelationsAsGeneratorsOfRightIdeal( EvaluatedMatrixOfRingRelations( rel ) ); fi; elif HasEvalMatrixOfRingRelations( rel ) then if IsHomalgRingRelationsAsGeneratorsOfLeftIdeal( rel ) then
rel_new := CallFuncList( HomalgRingRelationsAsGeneratorsOfLeftIdeal, EvalMatrixOfRingRelations( rel ) ); else
rel_new := CallFuncList( HomalgRingRelationsAsGeneratorsOfRightIdeal, EvalMatrixOfRingRelations( rel ) ); fi; fi;
for c in [ "DegreesOfGenerators", "BasisOfModule", "MaximumNumberOfResolutionSteps" ] do if IsBound( rel!.( c ) ) then
rel_new!.( c ) := rel!.( c ); fi;
od;
return rel_new;
end );
##
InstallMethod( \*, "for a ring and ring relations",
[ IsHomalgRing, IsHomalgRingRelations ],
function( R, rel )
local Rrel;
Rrel := R * MatrixOfRelations( rel );
if IsHomalgRingRelationsAsGeneratorsOfLeftIdeal( rel ) then
return HomalgRingRelationsAsGeneratorsOfLeftIdeal( Rrel ); else
return HomalgRingRelationsAsGeneratorsOfRightIdeal( Rrel ); fi;
end );
##
InstallMethod( \*, "for ring relations and a ring",
[ IsHomalgRingRelations, IsHomalgRing ],
function( rel, R )
return R * rel;
end );
#################################### # # View, Print, and Display methods: # ####################################
if HasNrRelations( o ) then
m := NrRelations( o ); else
m := "unknown number"; fi;
if IsString( m ) then
Print( "<A set of ring relations " ); elif m = 0then
Print( "<An empty set of ring relations " ); elif m = 1then
Print( "<A set containing a single ring relation " ); else
Print( "<A set of ", m, " ring relations " ); fi;
Print( "as generators of a " );
if IsHomalgRingRelationsAsGeneratorsOfLeftIdeal( o ) then
Print( "left " ); else
Print( "right " ); fi;
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.