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

d&i IsClosedPreSheafWRTCoproductCocones #500

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions FiniteCocompletions/gap/CategoryOfColimitQuivers.gd
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ CapJitAddTypeSignature( "FiniteColimitCompletionWithStrictCoproductsOfUnderlying

end );

#! @Description
#! The inputs are a colimit quiver <A>colim_quiver</A> in the category $C$
#! and a list <A>vertices</A> of objects in $C$.
#! The output is the full colimit subquiver on these objects.
#! @Returns a monomorphism of colimit quivers
#! @Arguments colim_quiver, vertices
DeclareOperation( "EmbeddingOfFullColimitSubquiver",
[ IsObjectInCategoryOfColimitQuivers, IsList ] );

####################################
#
#! @Section Constructors
Expand Down
59 changes: 59 additions & 0 deletions FiniteCocompletions/gap/CategoryOfColimitQuivers.gi
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,65 @@ InstallMethod( CategoryOfPreSheavesOfUnderlyingCategory,

end );

##
InstallMethod( CategoryOfPreSheavesOfUnderlyingCategory,
[ IsCategoryOfColimitQuivers ],

function( ColimitQuiversC )

return PreSheaves( UnderlyingCategory( ColimitQuiversC ) );

end );

##
InstallOtherMethodForCompilerForCAP( EmbeddingOfFullColimitSubquiver,
[ IsCategoryOfColimitQuivers, IsObjectInCategoryOfColimitQuivers, IsList ],

function( ColimitQuiversC, colim_quiver, list_of_objects )
local C, vertices_arrows, vertices, arrows, positions, V, id, A, colim_subquiver, embedding;

C := UnderlyingCategory( ColimitQuiversC );

vertices_arrows := ObjectDatum( ColimitQuiversC, colim_quiver );

vertices := vertices_arrows[1];
arrows := vertices_arrows[2];

positions := List( vertices, vertex ->
PositionProperty( list_of_objects, obj -> IsEqualForObjects( C, obj, vertex ) ) );

V := Filtered( [ 0 .. Length( vertices ) - 1 ], i -> IsInt( positions[1 + i] ) );

id := List( list_of_objects, obj -> IdentityMorphism( C, obj ) );

A := Filtered( [ 0 .. Length( arrows ) - 1 ], j ->
( arrows[1 + j][1] in V ) and ( arrows[1 + j][3] in V ) );

colim_subquiver := CreateColimitQuiver( ColimitQuiversC,
Pair( vertices{1 + V}, arrows{1 + A} ) );

embedding := CreateMorphismOfColimitQuivers( ColimitQuiversC,
colim_subquiver,
Pair( Pair( V, id{positions{1 + V}} ),
A ),
colim_quiver );
#% CAP_JIT_DROP_NEXT_STATEMENT
SetIsMonomorphism( embedding, true );

return embedding;

end );

##
InstallMethod( EmbeddingOfFullColimitSubquiver,
[ IsObjectInCategoryOfColimitQuivers, IsList ],

function( colim_quiver, list_of_objects )

return EmbeddingOfFullColimitSubquiver( CapCategory( colim_quiver ), colim_quiver, list_of_objects );

end );

####################################
#
# View, Print, Display and LaTeX methods:
Expand Down
2 changes: 1 addition & 1 deletion FpCategories/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "FpCategories",
Subtitle := "Finitely presented categories by generating quivers and relations",
Version := "2024.03-03",
Version := "2024.03-04",
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
6 changes: 6 additions & 0 deletions FpCategories/gap/PathCategories.gd
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,11 @@ DeclareAttribute( "ExternalHoms", IsPathCategory );
#
####################################

DeclareAttribute( "DecompositionIndicesOfMorphism",
IsPathCategoryMorphism );

DeclareAttribute( "DecompositionOfMorphismInCategory",
IsPathCategoryMorphism );

DeclareOperation( "ExtendFunctorToFpCategoryData",
[ IsPathCategory, IsList, IsCapCategory ] );
36 changes: 36 additions & 0 deletions FpCategories/gap/PathCategories.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,42 @@ InstallOtherMethod( ExternalHoms,

end );

##
InstallOtherMethodForCompilerForCAP( DecompositionIndicesOfMorphism,
"for a path category and a morphism therein",
[ IsPathCategory, IsPathCategoryMorphism ],

function( C, mor )

return List( MorphismIndices( mor ), i -> -1 + i );

end );

##
InstallMethod( DecompositionIndicesOfMorphism,
"for a morphism in a path category",
[ IsPathCategoryMorphism ],

function( mor )

return DecompositionIndicesOfMorphism( CapCategory( mor ), mor );

end );

##
InstallMethod( DecompositionOfMorphismInCategory,
"for a morphism in a path category",
[ IsPathCategoryMorphism ],

function( mor )
local C;

C := CapCategory( mor );

return SetOfGeneratingMorphisms( C ){1 + DecompositionIndicesOfMorphism( mor )};

end );

##
InstallMethod( DatumOfCellAsEvaluatableString,
[ IsPathCategoryMorphism, IsList ],
Expand Down
18 changes: 18 additions & 0 deletions FpCategories/gap/Tools.gd
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ CapJitAddTypeSignature( "DefiningTripleOfUnderlyingQuiver", [ IsCapCategory ],

end );

#! @Description
#! Return the list of decompositions of the morphism <A>mor</A>
#! in the finitely presented, Hom-finite category $C$,
#! where each decomposition is a list in the generators in <C>SetOfGeneratorsOfCategory</C>( $C$ ).
#! @Arguments mor
#! @Returns a list of lists of morphisms
DeclareAttribute( "AllDecompositionsOfMorphismInCategory",
IsCapCategoryMorphism );

CapJitAddTypeSignature( "AllDecompositionsOfMorphismInCategory", [ IsCapCategory, IsCapCategoryMorphism ],
function ( input_types )

return CapJitDataTypeOfListOf(
CapJitDataTypeOfListOf(
CapJitDataTypeOfMorphismOfCategory( input_types[1].category ) ) );

end );

#! @Description
#! The data tables of the category <A>C</A>.
#! @Arguments C
Expand Down
84 changes: 84 additions & 0 deletions FpCategories/gap/Tools.gi
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,90 @@ InstallMethodForCompilerForCAP( CoYonedaEmbeddingData,

end );

##
InstallOtherMethodForCompilerForCAP( AllDecompositionsOfMorphismInCategory,
"for a f.p. category with decidable colifts and a morphism therein",
[ IsCapCategory and IsFinitelyPresentedCategory and IsCategoryWithDecidableColifts, IsCapCategoryMorphism ],

function( P, mor )
local source, gen_mors, pos, predicate, decompose_one_step, func, add_non_identity_colift, initial_value;

if IsEqualToIdentityMorphism( P, mor ) then
return [ ];
fi;

source := Source( mor );

gen_mors := SetOfGeneratingMorphisms( P );

pos := PositionProperty( gen_mors, gen -> IsEqualForMorphismsOnMor( P, gen, mor ) );

if IsInt( pos ) then
return [ [ gen_mors[pos] ] ];
fi;

predicate :=
function( decompositions, decompositions_new )

return Length( decompositions ) = Length( decompositions_new );

end;

decompose_one_step :=
function( decomposition )
local head, decompositions_of_last;

decompositions_of_last := AllDecompositionsOfMorphismInCategory( P, Last( decomposition ) );

if Length( decompositions_of_last ) = 0 then
return [ decomposition ];
else
head := decomposition{[ 1 .. Length( decomposition ) - 1 ]};

return List( decompositions_of_last, decomps -> Concatenation( head, decomps ) );
fi;

end;

func :=
function( decompositions )

return Concatenation( List( decompositions, decompose_one_step ) );

end;

add_non_identity_colift :=
function( gen, mor )
local colift;

colift := Colift( P, gen, mor );

if IsEqualToIdentityMorphism( P, colift ) then
return [ gen ];
else
return [ gen, colift ];
fi;

end;

initial_value :=
List( Filtered( gen_mors, gen -> IsEqualForObjects( P, Source( gen ), source ) and IsColiftable( P, gen, mor ) ), gen -> add_non_identity_colift( gen, mor ) );

return CapFixpoint( predicate, func, initial_value );

end );

##
InstallMethod( AllDecompositionsOfMorphismInCategory,
"for a morphism in a f.p. category with decidable colifts",
[ IsCapCategoryMorphism ],

function( mor )

return AllDecompositionsOfMorphismInCategory( CapCategory( mor ), mor );

end );

if IsPackageMarkedForLoading( "Digraphs", ">= 1.3.1" ) then

##
Expand Down
2 changes: 1 addition & 1 deletion FunctorCategories/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Dependencies := rec(
NeededOtherPackages := [
[ "GAPDoc", ">= 1.5" ],
[ "ToolsForHomalg", ">= 2022.12-01" ],
[ "CAP", ">= 2024.02-01" ],
[ "CAP", ">= 2024.04-02" ],
[ "MonoidalCategories", ">= 2024.02-01" ],
[ "CartesianCategories", ">= 2024.02-05" ],
[ "ToolsForCategoricalTowers", ">= 2024.03-02" ],
Expand Down
35 changes: 35 additions & 0 deletions FunctorCategories/examples/ColimitingCocone.g
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#! @Chunk ColimitingCocone

#! @Example
LoadPackage( "FunctorCategories", false );
#! true
q := "q(a,l,m,r,i,i1,i2,c,b)[ac:a->c,lc:l->c,mi:m->i,ic:i->c,ri1:r->i1,i1i2:i1->i2,i2c:i2->c,cb:c->b]";;
q := RightQuiver( q );
#! RightQuiver( "" );
F := FreeCategory( q );
#F := PathCategory( q );
#! FreeCategory(
#! RightQuiver( "" ) );
Size( F );
#! 7
PSh := PreSheaves( F );
#! PreSheaves( FreeCategory(
#! RightQuiver( "" ) ) );
#! SkeletalFinSets )
Y := YonedaEmbeddingOfSourceCategory( PSh );
#! Yoneda embedding functor
coprd_cocone := [ F.c, [ F.lc, F.mi * F.ic, F.ri1 * F.i1i2 * F.i2c ] ];
#coprd_cocone := [ F.c, [ F.ac, F.lc ] ];
is_closed := G -> IsClosedPreSheafWRTCoproductCocones( PSh, G, [ coprd_cocone ] );
#! function( G ) ... end
G := Coproduct( [ PSh.a, PSh.a, PSh.l, PSh.m, PSh.r, PSh.r, PSh.c, PSh.b ] );
#G := Coproduct( [ PSh.a, PSh.l, PSh.l ] );
#! <An object in PreSheaves( FreeCategory(
#! RightQuiver( "" ) ),
#! SkeletalFinSets )>
emb := EmbeddingIntoClosureOfPreSheafWRTCoproductCocones( G, [ coprd_cocone ] );
Assert( 0, IsWellDefined( emb ) );
Assert( 0, IsMonomorphism( emb ) );
Assert( 0, Source( emb ) = G );
Assert( 0, is_closed( Target( emb ) ) );
#! @EndExample
40 changes: 40 additions & 0 deletions FunctorCategories/examples/JoinCocone.g
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#! @Chunk JoinCocone

#! @Example
LoadPackage( "FunctorCategories", false );
#! true
q := FinQuiver( "q(a,l,r,i,c,b)[ac:a->c,lc:l->c,ri:r->i,ic:i->c,cb:c->b]" );
#! FinQuiver( "q(a,l,r,i,c,b)[ac:a-≻c,lc:l-≻c,ri:r-≻i,ic:i-≻c,cb:c-≻b]" )
F := PathCategory( q );
#! PathCategory(
#! FinQuiver( "q(a,l,r,i,c,b)[ac:a-≻c,lc:l-≻c,ri:r-≻i,ic:i-≻c,cb:c-≻b]" ) )
Size( F );
#! 16
P := PosetOfCategory( F );
#! PosetOfCategory( PathCategory(
#! FinQuiver( "q(a,l,r,i,c,b)[ac:a-≻c,lc:l-≻c,ri:r-≻i,ic:i-≻c,cb:c-≻b]" ) ) )
Size( P );
#! 16
digraphF := DigraphOfPoset( P );;
digraphF!.vertexlabels := List( SetOfObjects( F ), String );
#Splash( DotVertexLabelledDigraph( digraphF ) );
#Splash( DotVertexLabelledDigraph( DigraphOfPoset( P ) ) );
PSh := PreSheaves( P );
#! PreSheaves( PosetOfCategory( PathCategory(
#! FinQuiver( "q(a,l,r,i,c,b)[ac:a-≻c,lc:l-≻c,ri:r-≻i,ic:i-≻c,cb:c-≻b]" ) ) ),
#! IntervalCategory )
Y := YonedaEmbeddingOfSourceCategory( PSh );
#! Yoneda embedding functor
coproducts := [ [ P.c, [ P.l, P.r ] ] ];;
#! [ [ An object in the poset given by: (c),
#! [ An object in the poset given by: (l),
#! An object in the poset given by: (r) ] ] ]
PSh_J := ClosedPreSheavesWRTCoproducts( P, coproducts );;
closed := SetOfObjects( PSh_J );;
Assert( 0, Length( closed ) = 10 );
psh_J := ModelingCategory( ModelingCategory( PSh_J ) );;
Assert( 0, Length( SetOfObjects( psh_J ) ) = Length( SetOfObjects( PSh_J ) ) );
is_closed := psh_J!.ObjectMembershipFunction;
Assert( 0, ForAll( closed, obj -> is_closed( ObjectDatum( ModelingObject( PSh_J, obj ) ) ) ) );
#Splash( DotVertexLabelledDigraph( PSh, [ Y, psh_J ], [ "grey", "blue", "red" ] : offset := 0 ) );
#! @EndExample
Loading
Loading