Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalsaleh committed Nov 22, 2024
1 parent 1e78848 commit 19219dd
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 15 deletions.
6 changes: 3 additions & 3 deletions ComplexesCategories/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "ComplexesCategories",
Subtitle := "Category of (co)chain complexes of an additive category",
Version := "2023.12-02",
Version := "2024.11-15",
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
License := "GPL-2.0-or-later",

Expand Down Expand Up @@ -74,9 +74,9 @@ PackageDoc := rec(
Dependencies := rec(
GAP := ">= 4.12.1",
NeededOtherPackages := [ [ "AutoDoc", ">= 2019.09.04" ],
[ "CAP", ">= 2023.12-09" ],
[ "CAP", ">= 2024.10-06" ],
[ "ToolsForHigherHomologicalAlgebra", ">= 2022.12-05" ],
[ "PreSheaves", ">= 2023.12-04" ],
[ "PreSheaves", ">= 2024.11-06" ],
],

SuggestedOtherPackages := [ [ "Locales", ">= 2023.05-05" ],
Expand Down
135 changes: 129 additions & 6 deletions ComplexesCategories/gap/HomStructure.gi
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ BindGlobal( "_complexes_DistinguishedObjectOfHomomorphismStructure",

end ) );

##
BindGlobal( "_complexes_DistinguishedObjectOfHomomorphismStructure_Weight",
function ( ch_cat )
local cat;

cat := UnderlyingCategory( ch_cat );

return OperationWeight( cat, "DistinguishedObjectOfHomomorphismStructure" );

end );

BindGlobal( "_complexes_HomomorphismStructureOnObjects",
function ( ch_cat, B, C )
local cat, range_cat, ch_range_cat, l_B, l_C, u_B, u_C, diagrams, objs, diffs;
Expand Down Expand Up @@ -83,7 +94,23 @@ BindGlobal( "_complexes_HomomorphismStructureOnObjects",
return CreateComplex( ch_range_cat, objs, diffs, l_C - u_B, u_C - l_B );

end );

##
BindGlobal( "_complexes_HomomorphismStructureOnObjects_Weight",
function ( ch_cat )
local cat, range_cat;

cat := UnderlyingCategory( ch_cat );
range_cat := RangeCategoryOfHomomorphismStructure( ch_cat );

return
4 * OperationWeight( cat, "HomomorphismStructureOnObjects" ) +
8 * OperationWeight( cat, "HomomorphismStructureOnMorphismsWithGivenObjects" ) +
8 * OperationWeight( range_cat, "ZeroMorphism" ) +
2 * OperationWeight( range_cat, "MorphismBetweenDirectSumsWithGivenDirectSums" ) +
1;
end );

# phi
# A -------> B
#
Expand Down Expand Up @@ -163,6 +190,23 @@ BindGlobal( "_complexes_HomomorphismStructureOnMorphismsWithGivenObjects",

end );

##
BindGlobal( "_complexes_HomomorphismStructureOnMorphismsWithGivenObjects_Weight",
function ( ch_cat )
local cat, range_cat;

cat := UnderlyingCategory( ch_cat );
range_cat := RangeCategoryOfHomomorphismStructure( ch_cat );

return
8 * OperationWeight( cat, "HomomorphismStructureOnObjects" ) +
8 * OperationWeight( cat, "HomomorphismStructureOnMorphismsWithGivenObjects" ) +
8 * OperationWeight( range_cat, "ZeroMorphism" ) +
2 * OperationWeight( range_cat, "MorphismBetweenDirectSumsWithGivenDirectSums" ) +
1;
end );

##
BindGlobal( "_complexes_HomomorphismStructureOnMorphisms",

function ( ch_cat, phi, psi )
Expand All @@ -176,6 +220,17 @@ BindGlobal( "_complexes_HomomorphismStructureOnMorphisms",

end );

##
BindGlobal( "_complexes_HomomorphismStructureOnMorphisms_Weight",
function ( ch_cat )

return
2 * _complexes_HomomorphismStructureOnObjects_Weight( ch_cat ) +
_complexes_HomomorphismStructureOnMorphismsWithGivenObjects_Weight( ch_cat ) +
1;

end );

##
BindGlobal( "_complexes_InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructureWithGivenObjects",

Expand Down Expand Up @@ -210,6 +265,22 @@ BindGlobal( "_complexes_InterpretMorphismAsMorphismFromDistinguishedObjectToHomo

end );

##
BindGlobal( "_complexes_InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructureWithGivenObjects_Weight",
function( ch_cat )
local cat, range_cat;

cat := UnderlyingCategory( ch_cat );
range_cat := RangeCategoryOfHomomorphismStructure( ch_cat );

return
OperationWeight( cat, "HomomorphismStructureOnObjects" ) +
2 * OperationWeight( cat, "InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructureWithGivenObjects" ) +
OperationWeight( range_cat, "MorphismBetweenDirectSumsWithGivenDirectSums" ) +
1;

end );

##
BindGlobal( "_complexes_InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructure",

Expand All @@ -224,6 +295,18 @@ BindGlobal( "_complexes_InterpretMorphismAsMorphismFromDistinguishedObjectToHomo

end );

##
BindGlobal( "_complexes_InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructure_Weight",
function( ch_cat )

return
_complexes_DistinguishedObjectOfHomomorphismStructure_Weight( ch_cat ) +
_complexes_HomomorphismStructureOnObjects_Weight( ch_cat ) +
_complexes_InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructureWithGivenObjects_Weight( ch_cat ) +
1;

Check warning on line 306 in ComplexesCategories/gap/HomStructure.gi

View check run for this annotation

Codecov / codecov/patch

ComplexesCategories/gap/HomStructure.gi#L302-L306

Added lines #L302 - L306 were not covered by tests

end );

##
BindGlobal( "_complexes_InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism",

Expand Down Expand Up @@ -255,6 +338,23 @@ BindGlobal( "_complexes_InterpretMorphismFromDistinguishedObjectToHomomorphismSt

end );

##
BindGlobal( "_complexes_InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism_Weight",
function ( ch_cat )
local cat, range_cat;

cat := UnderlyingCategory( ch_cat );
range_cat := RangeCategoryOfHomomorphismStructure( ch_cat );

return
2 * OperationWeight( cat, "HomomorphismStructureOnObjects" ) +
2 * OperationWeight( cat, "InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism" ) +
2 * OperationWeight( range_cat, "PreCompose" ) +
2 * OperationWeight( range_cat, "ProjectionInFactorOfDirectSumWithGivenDirectSum" ) +
1;

end );

##
InstallGlobalFunction( ADD_FUNCTIONS_OF_HOMOMORPHISM_STRUCTURE_TO_COCHAIN_COMPLEX_CATEGORY,
function ( ch_cat )
Expand Down Expand Up @@ -307,7 +407,9 @@ InstallGlobalFunction( ADD_FUNCTIONS_OF_HOMOMORPHISM_STRUCTURE_TO_COCHAIN_COMPLE

AddDistinguishedObjectOfHomomorphismStructure( ch_cat,

ch_cat -> as_object_in_abelian_category( _complexes_DistinguishedObjectOfHomomorphismStructure( ch_cat )[0] )
ch_cat -> as_object_in_abelian_category( _complexes_DistinguishedObjectOfHomomorphismStructure( ch_cat )[0] ),
_complexes_DistinguishedObjectOfHomomorphismStructure_Weight( ch_cat )
+ 1
);

AddHomomorphismStructureOnObjects( ch_cat,
Expand All @@ -316,7 +418,10 @@ InstallGlobalFunction( ADD_FUNCTIONS_OF_HOMOMORPHISM_STRUCTURE_TO_COCHAIN_COMPLE

return KernelObject( range_cat, as_morphism_in_abelian_category( _complexes_HomomorphismStructureOnObjects( ch_cat, B, C )^0 ) );

end );
end,
_complexes_HomomorphismStructureOnObjects_Weight( ch_cat ) +
OperationWeight( range_cat, "KernelObject" ) +
1 );

AddHomomorphismStructureOnMorphismsWithGivenObjects( ch_cat,

Expand All @@ -333,7 +438,10 @@ InstallGlobalFunction( ADD_FUNCTIONS_OF_HOMOMORPHISM_STRUCTURE_TO_COCHAIN_COMPLE
as_morphism_in_abelian_category( Range( hom_phi_psi )^0 ),
hom_AD );

end );
end,
_complexes_HomomorphismStructureOnMorphisms_Weight( ch_cat ) +
OperationWeight( range_cat, "KernelObjectFunctorialWithGivenKernelObjects" ) +
1 );

AddHomomorphismStructureOnMorphisms( ch_cat,

Expand All @@ -348,7 +456,10 @@ InstallGlobalFunction( ADD_FUNCTIONS_OF_HOMOMORPHISM_STRUCTURE_TO_COCHAIN_COMPLE
as_morphism_in_abelian_category( hom_phi_psi[0] ),
as_morphism_in_abelian_category( Range( hom_phi_psi )^0 ) );

end );
end,
_complexes_HomomorphismStructureOnMorphisms_Weight( ch_cat ) +
OperationWeight( range_cat, "KernelObjectFunctorial" ) +
1 );

AddInterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructure( ch_cat,

Expand All @@ -366,7 +477,13 @@ InstallGlobalFunction( ADD_FUNCTIONS_OF_HOMOMORPHISM_STRUCTURE_TO_COCHAIN_COMPLE
KernelEmbedding( range_cat, as_morphism_in_abelian_category( hom_BC^0 ) ),
as_morphism_in_abelian_category( ell[0] ) );

end );
end,
_complexes_DistinguishedObjectOfHomomorphismStructure_Weight( ch_cat ) +
_complexes_HomomorphismStructureOnObjects_Weight( ch_cat ) +
_complexes_InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructureWithGivenObjects_Weight( ch_cat ) +
OperationWeight( range_cat, "LiftAlongMonomorphism" ) +
OperationWeight( range_cat, "KernelEmbedding" ) +
1 );

AddInterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism( ch_cat,
function ( ch_cat, B, C, ell )
Expand All @@ -382,7 +499,13 @@ InstallGlobalFunction( ADD_FUNCTIONS_OF_HOMOMORPHISM_STRUCTURE_TO_COCHAIN_COMPLE

return _complexes_InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism( ch_cat, B, C, ell );

end );
end,
_complexes_DistinguishedObjectOfHomomorphismStructure_Weight( ch_cat ) +
_complexes_HomomorphismStructureOnObjects_Weight( ch_cat ) +
OperationWeight( range_cat, "PreCompose" ) +
OperationWeight( range_cat, "KernelEmbedding" ) +
_complexes_InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism_Weight( ch_cat ) +
1 );

else

Expand Down
8 changes: 6 additions & 2 deletions ComplexesCategories/gap/Objects.gi
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,13 @@ InstallMethod( AsComplexOverOppositeCategory,
[ IsCochainComplex ],

function( C )
local coch_cat_op, o, diff, B;
local cat, cat_op, coch_cat_op, o, diff, B;

coch_cat_op := ComplexesCategoryByCochains( Opposite( UnderlyingCategory( CapCategory( C ) ) ) );
cat := UnderlyingCategory( CapCategory( C ) );

cat_op := Opposite( cat : only_primitive_operations_and_hom_structure := true );

coch_cat_op := ComplexesCategoryByCochains( cat_op );

o := i -> Opposite( Objects( C )[-i] );

Expand Down
20 changes: 16 additions & 4 deletions ComplexesCategories/gap/Resolutions.gi
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,14 @@ end );
InstallOtherMethod( InjectiveResolution,
[ IsCapCategoryObject, IsBool ],

{ o, bool } -> AsComplexOverOppositeCategory( ProjectiveResolution( Opposite( o ), bool ) )
);
function( o, bool )
local cat_op;

cat_op := Opposite( CapCategory( o ) : only_primitive_operations_and_hom_structure );

Check warning on line 313 in ComplexesCategories/gap/Resolutions.gi

View check run for this annotation

Codecov / codecov/patch

ComplexesCategories/gap/Resolutions.gi#L313

Added line #L313 was not covered by tests

return AsComplexOverOppositeCategory( ProjectiveResolution( Opposite( o ), bool ) );

Check warning on line 315 in ComplexesCategories/gap/Resolutions.gi

View check run for this annotation

Codecov / codecov/patch

ComplexesCategories/gap/Resolutions.gi#L315

Added line #L315 was not covered by tests

end );

##
InstallOtherMethod( MorphismBetweenProjectiveResolutions,
Expand Down Expand Up @@ -375,6 +381,12 @@ end );
InstallOtherMethod( MorphismBetweenInjectiveResolutions,
[ IsCapCategoryMorphism, IsBool ],

{ phi, bool } -> AsComplexMorphismOverOppositeCategory( MorphismBetweenProjectiveResolutions( Opposite( phi ), bool ) )
);
function( phi, bool )
local cat_op;

cat_op := Opposite( CapCategory( phi ) : only_primitive_operations_and_hom_structure := true );

return AsComplexMorphismOverOppositeCategory( MorphismBetweenProjectiveResolutions( Opposite( phi ), bool ) );

end );

0 comments on commit 19219dd

Please sign in to comment.