Skip to content

Commit

Permalink
Merge pull request #178 from kamalsaleh/presheaves
Browse files Browse the repository at this point in the history
Use `PreSheavesWithBounds` in ComplexesCategories
  • Loading branch information
kamalsaleh authored Nov 27, 2023
2 parents edd51ea + c53213d commit f475601
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 237 deletions.
4 changes: 2 additions & 2 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.11-01",
Version := "2023.11-02",
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 @@ -76,7 +76,7 @@ Dependencies := rec(
NeededOtherPackages := [ [ "AutoDoc", ">= 2019.09.04" ],
[ "CAP", ">= 2023.08-09" ],
[ "ToolsForHigherHomologicalAlgebra", ">= 2022.12-05" ],
[ "PreSheaves", ">= 2023.05-03" ],
[ "PreSheaves", ">= 2023.11-02" ],
],

SuggestedOtherPackages := [ [ "Locales", ">= 2023.05-05" ],
Expand Down
2 changes: 0 additions & 2 deletions ComplexesCategories/gap/Categories.gd
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ DeclareCategory( "IsComplexesCategoryByCochains", IsComplexesCategory );
#
###################################################

DeclareGlobalFunction( "COMPLEXES_CATEGORY_BY_COCHAINS_AS_TOWER" );

#! @Description
#! Creates the complexes category by cochains $\mathcal{C}^b(A)$ of an additive category $A$.
#! @Arguments A
Expand Down
202 changes: 3 additions & 199 deletions ComplexesCategories/gap/Categories.gi
Original file line number Diff line number Diff line change
Expand Up @@ -48,202 +48,6 @@ BindGlobal( "INTEGERS_CAT_MORS",
AsZFunction( i -> MorphismConstructor( INTEGERS_CAT, INTEGERS_CAT_OBJS[i+1], true, INTEGERS_CAT_OBJS[i] ) )
);

##
InstallGlobalFunction( COMPLEXES_CATEGORY_BY_COCHAINS_AS_TOWER,

function ( cat )
local presh_cat, category_filter, category_object_filter, category_morphism_filter, commutative_ring, properties, object_constructor,
object_datum, morphism_constructor, morphism_datum, union_of_supports, list_of_operations_to_install, create_func_bool,
create_func_object, create_func_morphism, supports_empty_limits, name, modeling_cat;

presh_cat := PreSheaves( INTEGERS_CAT, cat : overhead := false );

name := Concatenation( "Bounded ", Name( presh_cat ) );

category_filter := IsCapCategory;
category_object_filter := IsCapCategoryObject;
category_morphism_filter := IsCapCategoryMorphism;

if HasCommutativeRingOfLinearCategory( presh_cat ) then
commutative_ring := CommutativeRingOfLinearCategory( presh_cat );
else
commutative_ring := fail;
fi;

properties := ListKnownCategoricalProperties( presh_cat );

# e.g., datum = Pair( presheaf, Pair( lower_bound, upper_bound ) )
object_constructor :=
{ coch_cat, datum } -> CreateCapCategoryObjectWithAttributes( coch_cat, ObjectDatum, datum );

object_datum := { coch_cat, o } -> ObjectDatum( o );

# e.g., datum = presheaf_morphism
morphism_constructor :=
{ coch_cat, S, datum, R } -> CreateCapCategoryMorphismWithAttributes( coch_cat, S, R, MorphismDatum, datum );

morphism_datum := { coch_cat, m } -> MorphismDatum( m );

union_of_supports :=
function ( supports )

if supports = [ ] then
return Pair( 0, 0 );
else
return Pair( Minimum( List( supports, s -> s[1] ) ), Maximum( List( supports, s -> s[2] ) ) );
fi;

end;

list_of_operations_to_install := Filtered( ListPrimitivelyInstalledOperationsOfCategory( presh_cat ), name -> CAP_INTERNAL_METHOD_NAME_RECORD.(name).return_type <> "bool" );

create_func_bool := "default"; # this function will never be used

create_func_object :=
function ( name, coch_cat )
local info;

info := CAP_INTERNAL_METHOD_NAME_RECORD.(name);

return
ReplacedStringViaRecord(
"""
function( input_arguments... )
local presh_cat, i_arg;
presh_cat := UnderlyingCategory( cat );
i_arg := NTuple( number_of_arguments, input_arguments... );
return ObjectConstructor( cat, Pair( operation_name( sequence_of_arguments... ), bounds ) );
end
""",
rec( sequence_of_arguments :=
List( [ 1 .. Length( info.filter_list ) ],
function ( j )
local type;

type := info.filter_list[j];

if j = 1 and type = "category" then
return "presh_cat";
elif type = "object" then
return Concatenation( "ObjectDatum( i_arg[", String( j ), "] )[1]" );
elif type = "morphism" then
return Concatenation( "MorphismDatum( i_arg[", String( j ), "] )" );
elif type = "list_of_objects" then
return Concatenation( "List( i_arg[", String( j ), "], o -> ObjectDatum( cat, o )[1] )" );
elif type = "list_of_morphisms" then
return Concatenation( "List( i_arg[", String( j ), "], m -> MorphismDatum( cat, m ) )" );
else
Error( "can only deal with 'object', 'morphism', 'list_of_objects', 'list_of_morphisms'" );
fi;

end ),
bounds :=
(function()
local types;

types := info.filter_list;

if types = [ "category" ] then # e.g., ZeroObject, InitialObject, TerminalObject, ...
return "Pair( 0, 0 )";
elif types[2] = "object" then # e.g., (Co)Equalizer, ...
return "ObjectDatum( cat, i_arg[2] )[2]";
elif types[2] = "morphism" then # e.g., (Co)KernelObject, (Co)ImageObject, ...
return Concatenation( String( union_of_supports ), "( List( [ Source( i_arg[2] ), Range( i_arg[2] ) ], c -> ObjectDatum( cat, c )[2] ) )" );
elif types[2] = "list_of_objects" then # e.g., Coproduct, DirectProduct, DirectSum, ...
return Concatenation( String( union_of_supports ), "( List( i_arg[2], c -> ObjectDatum( cat, c )[2] ) )" );
elif types[2] = "list_of_morphisms" then # Pushout, FiberProduct, ...
return Concatenation( String( union_of_supports ), "( List( Concatenation( List( i_arg[2], m -> Source( m ) ), List( i_arg[2], m -> Range( m ) ) ), c -> ObjectDatum( cat, c )[2] ) )" );
else
Error( "can only deal with 'object', 'morphism', 'list_of_objects', 'list_of_morphisms'" );
fi;

end)( ) ) );

end;

create_func_morphism :=
function ( name, cat )
local info;

info := CAP_INTERNAL_METHOD_NAME_RECORD.(name);

return
ReplacedStringViaRecord(
"""
function ( input_arguments... )
local presh_cat, i_arg;
presh_cat := UnderlyingCategory( cat );
i_arg := NTuple( number_of_arguments, input_arguments... );
return MorphismConstructor( cat, top_source, operation_name( sequence_of_arguments... ), top_range );
end
""",
rec( sequence_of_arguments :=
List( [ 1 .. Length( info.filter_list ) ],
function( j )
local type;

type := info.filter_list[j];

if j = 1 and type = "category" then
return "presh_cat";
elif type in [ "integer", "element_of_commutative_ring_of_linear_structure" ] then
return Concatenation( "i_arg[", String( j ), "]" );
elif type = "object" then
return Concatenation( "ObjectDatum( cat, i_arg[", String( j ), "] )[1]" );
elif type = "morphism" then
return Concatenation( "MorphismDatum( i_arg[", String( j ), "] )" );
elif type = "list_of_objects" then
return Concatenation( "List( i_arg[", String( j ), "], o -> ObjectDatum( cat, o )[1] )" );
elif type = "list_of_morphisms" then
return Concatenation( "List( i_arg[", String( j ), "], m -> MorphismDatum( cat, m ) )" );
elif type = "pair_of_morphisms" then
return Concatenation( "Pair( ", "MorphismDatum( cat, i_arg[", String( j ), "][1] )", ", MorphismDatum( cat, i_arg[", String( j ), "][2] )", " )" );
elif type = "list_of_lists_of_morphisms" then
return Concatenation( "List( i_arg[", String( j ), "], x -> List( x, y -> MorphismDatum( cat, y ) ) )" );
else
Error( "can only deal with 'integer', 'object', 'morphism', 'list_of_objects', 'list_of_morphisms', 'pair_of_morphisms'" );
fi;

end ) ) );

end;

supports_empty_limits := true;

modeling_cat := CategoryConstructor(
rec( name := name,
category_filter := category_filter,
category_object_filter := category_object_filter,
category_morphism_filter := category_morphism_filter,
commutative_ring_of_linear_category := commutative_ring,
properties := properties,
is_computable := false,
object_constructor := object_constructor,
object_datum := object_datum,
morphism_constructor := morphism_constructor,
morphism_datum := morphism_datum,
underlying_category_getter_string := "UnderlyingCategory",
list_of_operations_to_install := list_of_operations_to_install,
supports_empty_limits := supports_empty_limits,
create_func_bool := create_func_bool,
create_func_object := create_func_object,
create_func_morphism := create_func_morphism ) : overhead := false );

SetUnderlyingCategory( modeling_cat, presh_cat );

return modeling_cat;

end );

##
##
InstallMethod( ComplexesCategoryByCochains,
"for a CAP category",
Expand All @@ -255,7 +59,7 @@ InstallMethod( ComplexesCategoryByCochains,

## building the categorical tower

modeling_cat := COMPLEXES_CATEGORY_BY_COCHAINS_AS_TOWER( cat );
modeling_cat := PreSheavesWithBounds( INTEGERS_CAT, cat, "both" : overhead := false );

##
object_constructor := { coch_cat, datum } -> CreateCapCategoryObjectWithAttributes( coch_cat,
Expand All @@ -282,7 +86,7 @@ InstallMethod( ComplexesCategoryByCochains,
local modeling_cat, presh_cat, presheaf_on_objects, presheaf_on_morphisms, presheaf;

modeling_cat := ModelingCategory( coch_cat );
presh_cat := UnderlyingCategory( modeling_cat );
presh_cat := AmbientCategory( modeling_cat );

presheaf_on_objects := i -> datum[1][ObjectDatum( i )];
presheaf_on_morphisms := {s, i, r} -> datum[2][ObjectDatum( Range( i ) )];
Expand Down Expand Up @@ -313,7 +117,7 @@ InstallMethod( ComplexesCategoryByCochains,
local modeling_cat, presh_cat, nat_trans_on_objs, presheaf_morphism;

modeling_cat := ModelingCategory( coch_cat );
presh_cat := UnderlyingCategory( modeling_cat );
presh_cat := AmbientCategory( modeling_cat );

nat_trans_on_objs := {s, i, r} -> datum[ObjectDatum( i )];
presheaf_morphism := MorphismConstructor( presh_cat, ObjectDatum( source )[1], nat_trans_on_objs, ObjectDatum( range )[1] );
Expand Down
4 changes: 2 additions & 2 deletions DerivedCategories/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "DerivedCategories",
Subtitle := "Derived categories of Abelian categories",
Version := "2023.11-01",
Version := "2023.11-02",
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 @@ -73,7 +73,7 @@ Dependencies := rec(
NeededOtherPackages := [
[ "CAP", ">= 2022.09-17" ],
[ "SubcategoriesForCAP", ">= 2020.10-02" ],
[ "HomotopyCategories", ">= 2021.07-02" ],
[ "HomotopyCategories", ">= 2021.11-02" ],
[ "ToolsForHigherHomologicalAlgebra", ">= 2020.10-02" ],
#[ "PreSheaves", ">= 2022.11-04"],
],
Expand Down
34 changes: 4 additions & 30 deletions DerivedCategories/examples/notebooks/TiltingEquivalence.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,7 @@
{
"data": {
"text/plain": [
"GAP: <A morphism in Homotopy category by cochains( AdditiveClosure( Algebroid( Q, FreeCategory( RightQuiver( \"q_𝓞(𝓞₀,𝓞₁,𝓞₂)[x₀:𝓞₀->𝓞₁,x₁:𝓞₀->𝓞₁,x₂:𝓞₀->𝓞₁,y₀:𝓞₁->𝓞₂,y₁:𝓞₁->𝓞₂,y₂:𝓞₁->𝓞₂]\" ) ) ) / relations ) ) supported on the interval [ -2 .. 1 ]>"
"GAP: <A morphism in Homotopy category by cochains( AdditiveClosure( Algebroid( Q, FreeCategory( RightQuiver( \"q_𝓞(𝓞₀,𝓞₁,𝓞₂)[x₀:𝓞₀->𝓞₁,x₁:𝓞₀->𝓞₁,x₂:𝓞₀->𝓞₁,y₀:𝓞₁->𝓞₂,y₁:𝓞₁->𝓞₂,y₂:𝓞₁->𝓞₂]\" ) ) ) / relations ) ) supported on the interval [ -2 .. 0 ]>"
]
},
"execution_count": 93,
Expand All @@ -2306,15 +2306,6 @@
"data": {
"text/latex": [
"$$\\begin{array}{ccc}\n",
" 0&-\\phantom{-}{\\begin{pmatrix}\\\\\\end{pmatrix}}\\phantom{-}\\rightarrow&0\n",
" \\\\ \n",
" \\uparrow_{\\phantom{0}}&& \n",
" \\uparrow_{\\phantom{0}}\n",
" \\\\ \n",
" \\begin{pmatrix}\\\\\\end{pmatrix}&&\\begin{pmatrix}\\\\\\end{pmatrix}\n",
" \\\\ \n",
" \\vert_{0} &&\\vert_{0} \n",
" \\\\ \n",
" {\\mathcal{O}_{2}}\\oplus{\\mathcal{O}_{1}}^{\\oplus 3}\\oplus{\\mathcal{O}_{0}}^{\\oplus 6}&-\\phantom{-}{\\begin{pmatrix}{\\mathcal{O}_{2}}\\\\ \n",
"-{y_0}\\\\ \n",
"-{y_1}\\\\ \n",
Expand All @@ -2326,7 +2317,7 @@
"{x_1y_2}\\\\ \n",
"{x_2y_2}\\end{pmatrix}}\\phantom{-}\\rightarrow&{\\mathcal{O}_{2}}\n",
" \\\\ \n",
" \\uparrow_{\\phantom{-1}}&& \n",
" \\uparrow_{\\phantom{-1}}&& \n",
" \\uparrow_{\\phantom{-1}}\n",
" \\\\ \n",
" \\begin{pmatrix}{y_0}&{\\mathcal{O}_{1}}&0&0&0&0&0&0&0&0\\\\ \n",
Expand Down Expand Up @@ -2398,7 +2389,7 @@
{
"data": {
"text/plain": [
"GAP: <A morphism in Homotopy category by cochains( AdditiveClosure( Algebroid( Q, FreeCategory( RightQuiver( \"q_𝓞(𝓞₀,𝓞₁,𝓞₂)[x₀:𝓞₀->𝓞₁,x₁:𝓞₀->𝓞₁,x₂:𝓞₀->𝓞₁,y₀:𝓞₁->𝓞₂,y₁:𝓞₁->𝓞₂,y₂:𝓞₁->𝓞₂]\" ) ) ) / relations ) ) supported on the interval [ -2 .. 1 ]>"
"GAP: <A morphism in Homotopy category by cochains( AdditiveClosure( Algebroid( Q, FreeCategory( RightQuiver( \"q_𝓞(𝓞₀,𝓞₁,𝓞₂)[x₀:𝓞₀->𝓞₁,x₁:𝓞₀->𝓞₁,x₂:𝓞₀->𝓞₁,y₀:𝓞₁->𝓞₂,y₁:𝓞₁->𝓞₂,y₂:𝓞₁->𝓞₂]\" ) ) ) / relations ) ) supported on the interval [ -2 .. 0 ]>"
]
},
"execution_count": 96,
Expand All @@ -2420,18 +2411,9 @@
"data": {
"text/latex": [
"$$\\begin{array}{ccc}\n",
" 0&-\\phantom{-}{\\begin{pmatrix}\\\\\\end{pmatrix}}\\phantom{-}\\rightarrow&0\n",
" \\\\ \n",
" \\uparrow_{\\phantom{0}}&& \n",
" \\uparrow_{\\phantom{0}}\n",
" \\\\ \n",
" \\begin{pmatrix}\\\\\\end{pmatrix}&&\\begin{pmatrix}\\\\\\end{pmatrix}\n",
" \\\\ \n",
" \\vert_{0} &&\\vert_{0} \n",
" \\\\ \n",
" {\\mathcal{O}_{2}}&-\\phantom{-}{\\begin{pmatrix}{\\mathcal{O}_{2}}&0&0&0&0&0&0&0&0&0\\end{pmatrix}}\\phantom{-}\\rightarrow&{\\mathcal{O}_{2}}\\oplus{\\mathcal{O}_{1}}^{\\oplus 3}\\oplus{\\mathcal{O}_{0}}^{\\oplus 6}\n",
" \\\\ \n",
" \\uparrow_{\\phantom{-1}}&& \n",
" \\uparrow_{\\phantom{-1}}&& \n",
" \\uparrow_{\\phantom{-1}}\n",
" \\\\ \n",
" \\begin{pmatrix}\\\\\\end{pmatrix}&&\\begin{pmatrix}{y_0}&{\\mathcal{O}_{1}}&0&0&0&0&0&0&0&0\\\\ \n",
Expand Down Expand Up @@ -3207,14 +3189,6 @@
"source": [
"That is, indeed $\\mathbf{A}_{\\mathcal{S}} \\cong \\mathbf{A}_{\\mathcal{O}}$."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8c7f5745",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions HomotopyCategories/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "HomotopyCategories",
Subtitle := "Homotopy categories of additive categories",
Version := "2023.11-01",
Version := "2023.11-02",
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 @@ -72,7 +72,7 @@ Dependencies := rec(
GAP := ">= 4.12.1",
NeededOtherPackages := [
[ "GAPDoc", ">= 1.5" ],
[ "ComplexesCategories", ">= 2022.12-04" ],
[ "ComplexesCategories", ">= 2023.11-02" ],
[ "TriangulatedCategories", ">= 2022.10-01" ],
[ "QuotientCategories", ">= 2021.11-03" ],
[ "SubcategoriesForCAP", ">= 2022.10-02" ],
Expand Down

0 comments on commit f475601

Please sign in to comment.