Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the category as first the first argument to all Add* methods #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 20 additions & 20 deletions lib/module.gi
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,14 @@ side -> function( rep_cat )
A := algebras[ 1 ];
B := algebras[ 2 ];
cat := CreateCapCategory( Concatenation( "bimodules over ", String( A ), " and ", String( B ) ) );
cat!.category_as_first_argument := false;
cat!.category_as_first_argument := true;
SetFilterObj( cat, IsQuiverBimoduleCategory );
else
A := rep_algebra^side;
algebras := [ fail, fail ];
algebras[ Int( side ) ] := A;
cat := CreateCapCategory( Concatenation( String( side ), " modules over ", String( A ) ) );
cat!.category_as_first_argument := false;
cat!.category_as_first_argument := true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is now obsolete

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think keeping compatibility with old versions of CAP far outweighs the benefits of removing this line.

if side = LEFT then
SetFilterObj( cat, IsLeftQuiverModuleCategory );
else
Expand All @@ -437,54 +437,54 @@ side -> function( rep_cat )
SetIsAbelianCategoryWithEnoughInjectives( cat, true );

AddIsEqualForObjects( cat,
function( M1, M2 )
function( category, M1, M2 )
return IsEqualForObjects( _R( M1 ), _R( M2 ) );
end );

AddIsEqualForMorphisms( cat,
function( m1, m2 )
function( category, m1, m2 )
return IsEqualForMorphisms( _r( m1 ), _r( m2 ) );
end );

AddZeroObject( cat, function()
AddZeroObject( cat, function( category )
return _M( ZeroObject( rep_cat ) );
end );
AddZeroMorphism( cat, function( M1, M2 )
AddZeroMorphism( cat, function( category, M1, M2 )
return _m( ZeroMorphism( _R( M1 ), _R( M2 ) ) );
end );
AddIdentityMorphism( cat, M -> _m( IdentityMorphism( _R( M ) ) ) );
AddPreCompose( cat, function( m1, m2 )
AddIdentityMorphism( cat, { category, M } -> _m( IdentityMorphism( _R( M ) ) ) );
AddPreCompose( cat, function( category, m1, m2 )
return _m( PreCompose( _r( m1 ), _r( m2 ) ) );
end );
AddAdditionForMorphisms( cat, function( m1, m2 )
AddAdditionForMorphisms( cat, function( category, m1, m2 )
return _m( AdditionForMorphisms( _r( m1 ), _r( m2 ) ) );
end );
AddAdditiveInverseForMorphisms( cat, m -> _m( AdditiveInverseForMorphisms( _r( m ) ) ) );
AddKernelEmbedding( cat, m -> _m( KernelEmbedding( _r( m ) ) ) );
AddCokernelProjection( cat, m -> _m( CokernelProjection( _r( m ) ) ) );
AddLiftAlongMonomorphism( cat, function( i, test )
AddAdditiveInverseForMorphisms( cat, { category, m } -> _m( AdditiveInverseForMorphisms( _r( m ) ) ) );
AddKernelEmbedding( cat, { category, m } -> _m( KernelEmbedding( _r( m ) ) ) );
AddCokernelProjection( cat, { category, m } -> _m( CokernelProjection( _r( m ) ) ) );
AddLiftAlongMonomorphism( cat, function( category, i, test )
return _m( LiftAlongMonomorphism( _r( i ), _r( test ) ) );
end );
AddColiftAlongEpimorphism( cat, function( e, test )
AddColiftAlongEpimorphism( cat, function( category, e, test )
return _m( ColiftAlongEpimorphism( _r( e ), _r( test ) ) );
end );
AddProjectiveLift( cat, function( pi, epsilon )
AddProjectiveLift( cat, function( category, pi, epsilon )
return _m( ProjectiveLift( _r( pi ), _r( epsilon ) ) );
end );
AddDirectSum( cat, function( summands )
AddDirectSum( cat, function( category, summands )
return _M( DirectSum( List( summands, _R ) ) );
end );
AddInjectionOfCofactorOfDirectSumWithGivenDirectSum( cat, function( summands, i, sum )
AddInjectionOfCofactorOfDirectSumWithGivenDirectSum( cat, function( category, summands, i, sum )
return _m( InjectionOfCofactorOfDirectSumWithGivenDirectSum
( List( summands, _R ), i, _R( sum ) ) );
end );
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat, function( summands, i, sum )
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat, function( category, summands, i, sum )
return _m( ProjectionInFactorOfDirectSumWithGivenDirectSum
( List( summands, _R ), i, _R( sum ) ) );
end );

AddEpimorphismFromSomeProjectiveObject( cat, ProjectiveCover );
AddMonomorphismIntoSomeInjectiveObject( cat, InjectiveEnvelope );
AddEpimorphismFromSomeProjectiveObject( cat, { category, m } -> ProjectiveCover( m ) );
AddMonomorphismIntoSomeInjectiveObject( cat, { category, m } -> InjectiveEnvelope( m ) );

Finalize( cat );

Expand Down
46 changes: 23 additions & 23 deletions lib/representation.gi
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ function( A, vecspace_cat )
Q := QuiverOfAlgebra( A );

cat := CreateCapCategory( Concatenation( "quiver representations over ", String( A ) ) );
cat!.category_as_first_argument := false;
cat!.category_as_first_argument := true;
SetFilterObj( cat, IsQuiverRepresentationCategory );
SetAlgebraOfCategory( cat, A );
SetVectorSpaceCategory( cat, vecspace_cat );
Expand All @@ -917,7 +917,7 @@ function( A, vecspace_cat )
SetIsAbelianCategoryWithEnoughProjectives( cat, true );
SetIsAbelianCategoryWithEnoughInjectives( cat, true );

equal_objects := function( R1, R2 )
equal_objects := function( category, R1, R2 )
return AlgebraOfRepresentation( R1 ) = AlgebraOfRepresentation( R2 ) and
DimensionVector( R1 ) = DimensionVector( R2 ) and
ForAll( ListN( VectorSpacesOfRepresentation( R1 ),
Expand All @@ -931,22 +931,22 @@ function( A, vecspace_cat )
end;
AddIsEqualForObjects( cat, equal_objects );

equal_morphisms := function( m1, m2 )
equal_morphisms := function( category, m1, m2 )
return ForAll( ListN( MapsOfRepresentationHomomorphism( m1 ),
MapsOfRepresentationHomomorphism( m2 ),
IsEqualForMorphisms),
IdFunc );
end;
AddIsEqualForMorphisms( cat, equal_morphisms );

zero_object := function()
zero_object := function( category )
local zero;
zero := ZeroObject( vecspace_cat );
return QuiverRepresentation( cat, List( Vertices( Q ), v -> zero ), [] );
end;
AddZeroObject( cat, zero_object );

zero_morphism := function( R1, R2 )
zero_morphism := function( category, R1, R2 )
return QuiverRepresentationHomomorphism
( R1, R2,
ListN( VectorSpacesOfRepresentation( R1 ),
Expand All @@ -957,15 +957,15 @@ function( A, vecspace_cat )

# TODO: need IsZeroForMorphisms?

identity_morphism := function( R )
identity_morphism := function( category, R )
return QuiverRepresentationHomomorphism
( R, R,
List( VectorSpacesOfRepresentation( R ),
IdentityMorphism ) );
end;
AddIdentityMorphism( cat, identity_morphism );

pre_compose := function( m1, m2 )
pre_compose := function( category, m1, m2 )
return QuiverRepresentationHomomorphism
( Source( m1 ), Range( m2 ),
ListN( MapsOfRepresentationHomomorphism( m1 ),
Expand All @@ -974,7 +974,7 @@ function( A, vecspace_cat )
end;
AddPreCompose( cat, pre_compose );

addition := function( m1, m2 )
addition := function( category, m1, m2 )
return QuiverRepresentationHomomorphism
( Source( m1 ), Range( m1 ),
ListN( MapsOfRepresentationHomomorphism( m1 ),
Expand All @@ -983,15 +983,15 @@ function( A, vecspace_cat )
end;
AddAdditionForMorphisms( cat, addition );

additive_inverse := function( m )
additive_inverse := function( category, m )
return QuiverRepresentationHomomorphism
( Source( m ), Range( m ),
List( MapsOfRepresentationHomomorphism( m ),
AdditiveInverse ) );
end;
AddAdditiveInverseForMorphisms( cat, additive_inverse );

kernel_emb := function( m )
kernel_emb := function( category, m )
local emb_maps, ker_objs, map_for_arrow, ker;
emb_maps := List( MapsOfRepresentationHomomorphism( m ),
KernelEmbedding );
Expand All @@ -1009,7 +1009,7 @@ function( A, vecspace_cat )
end;
AddKernelEmbedding( cat, kernel_emb );

coker := function( m )
coker := function( category, m )
local map_for_arrow;
map_for_arrow := function( a )
return CokernelObjectFunctorial
Expand All @@ -1024,15 +1024,15 @@ function( A, vecspace_cat )
List( Arrows( Q ),
map_for_arrow ) );
end;
coker_proj := function( m )
coker_proj := function( category, m )
return QuiverRepresentationHomomorphism
( Range( m ), coker( m ),
( Range( m ), coker( CapCategory( m ), m ),
List( MapsOfRepresentationHomomorphism( m ),
CokernelProjection ) );
end;
AddCokernelProjection( cat, coker_proj );

mono_lift := function( i, test )
mono_lift := function( category, i, test )
return QuiverRepresentationHomomorphism
( Source( test ), Source( i ),
ListN( MapsOfRepresentationHomomorphism( i ),
Expand All @@ -1041,7 +1041,7 @@ function( A, vecspace_cat )
end;
AddLiftAlongMonomorphism( cat, mono_lift );

epi_colift := function( e, test )
epi_colift := function( category, e, test )
return QuiverRepresentationHomomorphism
( Range( e ), Range( test ),
ListN( MapsOfRepresentationHomomorphism( e ),
Expand All @@ -1050,7 +1050,7 @@ function( A, vecspace_cat )
end;
AddColiftAlongEpimorphism( cat, epi_colift );

proj_lift := function( pi, epsilon )
proj_lift := function( category, pi, epsilon )
local P, A, B, top_basis, images;
P := Source( pi );
A := Range( pi );
Expand All @@ -1062,7 +1062,7 @@ function( A, vecspace_cat )
end;
AddProjectiveLift( cat, proj_lift );

direct_sum := function( summands )
direct_sum := function( category, summands )
return QuiverRepresentation
( cat,
List( Transpose( List( summands,
Expand All @@ -1074,7 +1074,7 @@ function( A, vecspace_cat )
end;
AddDirectSum( cat, direct_sum );

direct_sum_inj := function( summands, i, sum )
direct_sum_inj := function( category, summands, i, sum )
local map_for_vertex;
map_for_vertex := function( v )
return InjectionOfCofactorOfDirectSumWithGivenDirectSum
Expand All @@ -1088,7 +1088,7 @@ function( A, vecspace_cat )
end;
AddInjectionOfCofactorOfDirectSumWithGivenDirectSum( cat, direct_sum_inj );

direct_sum_proj := function( summands, i, sum )
direct_sum_proj := function( category, summands, i, sum )
local map_for_vertex;
map_for_vertex := function( v )
return ProjectionInFactorOfDirectSumWithGivenDirectSum
Expand All @@ -1102,12 +1102,12 @@ function( A, vecspace_cat )
end;
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat, direct_sum_proj );

AddEpimorphismFromSomeProjectiveObject( cat, ProjectiveCover );
AddMonomorphismIntoSomeInjectiveObject( cat, InjectiveEnvelope );
AddEpimorphismFromSomeProjectiveObject( cat, { category, m } -> ProjectiveCover( m ) );
AddMonomorphismIntoSomeInjectiveObject( cat, { category, m } -> InjectiveEnvelope( m ) );

##
AddIsWellDefinedForObjects( cat,
function( R )
function( category, R )
local A, relations;

A := AlgebraOfRepresentation( R );
Expand All @@ -1120,7 +1120,7 @@ function( A, vecspace_cat )

##
AddIsWellDefinedForMorphisms( cat,
function( alpha )
function( category, alpha )
local S, R, arrows;

S := Source( alpha );
Expand Down
24 changes: 12 additions & 12 deletions lib/stablecategory.gi
Original file line number Diff line number Diff line change
Expand Up @@ -74,50 +74,50 @@ function( C )
to_be_finalized;

cat := CreateCapCategory( Concatenation( Name( C ), " / proj" ) );
cat!.category_as_first_argument := false;
cat!.category_as_first_argument := true;
SetFilterObj( cat, IsStableCategoryModuloProjectives );
SetOriginalCategory( cat, C );
SetUnderlyingField( cat, UnderlyingField( C ) );

equal_objects := function( R1, R2 )
equal_objects := function( category, R1, R2 )
return OriginalObject( R1 ) = OriginalObject( R2 );
end;
AddIsEqualForObjects( cat, equal_objects );

equal_morphisms := function( m1, m2 )
equal_morphisms := function( category, m1, m2 )
local p;
p := StableHomProjection( Hom( Source( m1 ), Range( m2 ) ) );

return ImageElm( p, OriginalMorphism( m1 ) ) = ImageElm( p, OriginalMorphism( m2 ) );
end;
AddIsEqualForMorphisms( cat, equal_morphisms );

zero_object := function()
zero_object := function( category )
return AsStableCategoryObject( ZeroObject( C ), cat );
end;
AddZeroObject( cat, zero_object );

zero_morphism := function( R1, R2 )
zero_morphism := function( category, R1, R2 )
return AsStableCategoryMorphism( ZeroMorphism( OriginalObject( R1 ), OriginalObject( R2 ) ), cat );
end;
AddZeroMorphism( cat, zero_morphism );

identity_morphism := function( R )
identity_morphism := function( category, R )
return AsStableCategoryMorphism( IdentityMorphism( OriginalObject( R ) ), cat );
end;
AddIdentityMorphism( cat, identity_morphism );

pre_compose := function( m1, m2 )
pre_compose := function( category, m1, m2 )
return AsStableCategoryMorphism( PreCompose( OriginalMorphism( m1 ), OriginalMorphism( m2 ) ), cat );
end;
AddPreCompose( cat, pre_compose );

addition := function( m1, m2 )
addition := function( category, m1, m2 )
return AsStableCategoryMorphism( AdditionForMorphisms( OriginalMorphism( m1 ), OriginalMorphism( m2 ) ), cat );
end;
AddAdditionForMorphisms( cat, addition );

additive_inverse := function( m )
additive_inverse := function( category, m )
return AsStableCategoryMorphism( AdditiveInverseForMorphisms( OriginalMorphism( m ) ), cat );
end;
AddAdditiveInverseForMorphisms( cat, additive_inverse );
Expand All @@ -128,12 +128,12 @@ function( C )
# ColiftAlongEpimorphism.
#

direct_sum := function( summands )
direct_sum := function( category, summands )
return AsStableCategoryObject( DirectSum( List( summands, OriginalObject ) ), cat );
end;
AddDirectSum( cat, direct_sum );

direct_sum_inj := function( summands, i, sum )
direct_sum_inj := function( category, summands, i, sum )
local h;

h := InjectionOfCofactorOfDirectSumWithGivenDirectSum
Expand All @@ -143,7 +143,7 @@ function( C )
end;
AddInjectionOfCofactorOfDirectSumWithGivenDirectSum( cat, direct_sum_inj );

direct_sum_proj := function( summands, i, sum )
direct_sum_proj := function( category, summands, i, sum )
local h;

h := ProjectionInFactorOfDirectSumWithGivenDirectSum
Expand Down