Skip to content

Commit

Permalink
Merge pull request #608 from mohamed-barakat/OperationWeight
Browse files Browse the repository at this point in the history
equip Add-methods for CategoryConstructor with operation weight
  • Loading branch information
mohamed-barakat authored Nov 17, 2024
2 parents 160bf26 + cb040d1 commit 24d8d8f
Show file tree
Hide file tree
Showing 30 changed files with 365 additions and 272 deletions.
4 changes: 2 additions & 2 deletions CatReps/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "CatReps",
Subtitle := "Representations and cohomology of finite categories",
Version := "2024.11-02",
Version := "2024.11-03",

Date := ~.Version{[ 1 .. 10 ]},
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)( ),
Expand Down Expand Up @@ -109,7 +109,7 @@ Dependencies := rec(
[ "MatricesForHomalg", ">= 2020.02.02" ],
[ "Toposes", ">= 2022.05-07" ],
[ "Algebroids", ">= 2024.02-02" ],
[ "FunctorCategories", ">= 2024.11-03" ],
[ "FunctorCategories", ">= 2024.11-04" ],
],
SuggestedOtherPackages := [ ],
ExternalConditions := [ ],
Expand Down
2 changes: 1 addition & 1 deletion CatReps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The supported categorical doctrine of the category of representations is

```gap
gap> Display( CatReps );
70 primitive operations were used to derive 360 operations for this category
68 primitive operations were used to derive 360 operations for this category
which constructively
* IsCategoryWithDecidableColifts
* IsCategoryWithDecidableLifts
Expand Down
2 changes: 1 addition & 1 deletion CatReps/examples/CategoryOfRepresentations.g
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Display( CatReps );
#! RightQuiver( "q(2)[a:1->1,b:1->2,c:2->2]" ) ) ) / relations,
#! Category of matrices over GF(3) ):
#!
#! 70 primitive operations were used to derive 360 operations for this category
#! 68 primitive operations were used to derive 360 operations for this category
#! which algorithmically
#! * IsCategoryWithDecidableColifts
#! * IsCategoryWithDecidableLifts
Expand Down
2 changes: 1 addition & 1 deletion CatReps/examples/notebooks/CategoryOfRepresentations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@
"text": [
"A CAP category with name FunctorCategory( Algebroid( GF(3), FreeCategory( RightQuiver( \"q(2)[a:1->1,b:1->2,c:2->2]\" ) ) ) / relations, Category of matrices over GF(3) ):\n",
"\n",
"70 primitive operations were used to derive 360 operations for this category which algorithmically\n",
"68 primitive operations were used to derive 360 operations for this category which algorithmically\n",
"* IsCategoryWithDecidableColifts\n",
"* IsCategoryWithDecidableLifts\n",
"* IsEquippedWithHomomorphismStructure\n",
Expand Down
2 changes: 1 addition & 1 deletion FiniteCocompletions/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "FiniteCocompletions",
Subtitle := "Finite (co)product/(co)limit (co)completions",
Version := "2024.11-03",
Version := "2024.11-04",
Date := ~.Version{[ 1 .. 10 ]},
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ T := FiniteStrictCoproductCompletion( InitialCategory( ) );
Display( T );
#! A CAP category with name FiniteStrictCoproductCompletion( InitialCategory( ) ):
#!
#! 112 primitive operations were used to derive 669 operations for this category
#! 113 primitive operations were used to derive 669 operations for this category
#! which algorithmically
#! * IsCategoryWithDecidableColifts
#! * IsCategoryWithDecidableLifts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ T := FiniteStrictProductCompletion( InitialCategory( ) );
Display( T );
#! A CAP category with name FiniteStrictProductCompletion( InitialCategory( ) ):
#!
#! 117 primitive operations were used to derive 609 operations for this category
#! 118 primitive operations were used to derive 609 operations for this category
#! which algorithmically
#! * IsCategoryWithDecidableColifts
#! * IsCategoryWithDecidableLifts
Expand Down
6 changes: 3 additions & 3 deletions FunctorCategories/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "FunctorCategories",
Subtitle := "Categories of functors",
Version := "2024.11-03",
Version := "2024.11-04",

Date := ~.Version{[ 1 .. 10 ]},
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)( ),
Expand Down Expand Up @@ -89,14 +89,14 @@ Dependencies := rec(
NeededOtherPackages := [
[ "GAPDoc", ">= 1.5" ],
[ "ToolsForHomalg", ">= 2022.12-01" ],
[ "CAP", ">= 2024.09-12" ],
[ "CAP", ">= 2024.11-01" ],
[ "MonoidalCategories", ">= 2024.06-02" ],
[ "CartesianCategories", ">= 2024.06-03" ],
[ "ToolsForCategoricalTowers", ">= 2024.11-01" ],
[ "FpCategories", ">= 2024.09-06" ],
[ "Algebroids", ">= 2024.09-04" ],
[ "FiniteCocompletions", ">= 2024.03-12" ],
[ "PreSheaves", ">= 2024.11-02" ],
[ "PreSheaves", ">= 2024.11-03" ],
[ "RingsForHomalg", ">= 2020.02.04" ],
[ "LinearAlgebraForCAP", ">= 2024.08-07" ],
[ "FreydCategoriesForCAP", ">= 2024.08-07" ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ precompile_PreSheavesOfAlgebroidFromDataTablesInCategoryOfRows :=
: operations :=
Difference( Concatenation(
ListPrimitivelyInstalledOperationsOfCategory( category_constructor( A : no_precompiled_code := true ) ),
[ "InverseForMorphisms" ] ),
[ "InverseForMorphisms",
"CokernelColiftWithGivenCokernelObject",
"KernelLiftWithGivenKernelObject",
] ),
[ "IsZeroForObjects",
"IsZeroForMorphisms",
"IsEpimorphism",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ precompile_PreSheavesOfAlgebroidInCategoryOfRows :=
: operations :=
Difference( Concatenation(
ListPrimitivelyInstalledOperationsOfCategory( category_constructor( A : no_precompiled_code := true ) ),
[ "InverseForMorphisms" ] ),
[ "InverseForMorphisms",
"CokernelColiftWithGivenCokernelObject",
"KernelLiftWithGivenKernelObject",
] ),
[ "IsZeroForObjects",
"IsZeroForMorphisms",
"IsEpimorphism",
Expand Down
2 changes: 1 addition & 1 deletion FunctorCategories/examples/TerminalCategory.g
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ IsTerminalCategory( H );
Display( T );
#! A CAP category with name FiniteCompletion( InitialCategory( ) ):
#!
#! 119 primitive operations were used to derive 624 operations for this category
#! 120 primitive operations were used to derive 624 operations for this category
#! which algorithmically
#! * IsCategoryWithDecidableColifts
#! * IsCategoryWithDecidableLifts
Expand Down
36 changes: 18 additions & 18 deletions FunctorCategories/gap/PreSheaves.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2343,27 +2343,27 @@ InstallMethodWithCache( PreSheaves,
create_func_object :=
function( name, PSh_I_I )

return """
return Pair( """
function( input_arguments... )
return ObjectConstructor( cat, Pair( [ ], [ ] ) );
end
""";
""", 1 );

end;

## e.g., IdentityMorphism, PreCompose
create_func_morphism :=
function( name, PSh_I_I )

return """
return Pair( """
function( input_arguments... )
return MorphismConstructor( cat, top_source, [ ], top_range );
end
""";
""", 1 );

end;

Expand Down Expand Up @@ -2410,47 +2410,47 @@ InstallMethodWithCache( PreSheaves,

return [ InitialObject( PSh_I_I ) ];

end );
end, OperationWeight( PSh_I_I, "InitialObject" ) );

##
AddIsWellDefinedForObjects( PSh_I_I,
function( PSh_I_I, object )

return true;

end );
end, 1 );

##
AddIsWellDefinedForMorphisms( PSh_I_I,
function( PSh_I_I, morphism )

return true;

end );
end, 1 );

##
AddIsEqualForObjects( PSh_I_I,
function( PSh_I_I, object1, object2 )

return true;

end );
end, 1 );

##
AddIsEqualForMorphisms( PSh_I_I,
function( PSh_I_I, morphism1, morphism2 )

return true;

end );
end, 1 );

##
AddIsCongruentForMorphisms( PSh_I_I,
function( T, morphism1, morphism2 )

return true;

end );
end, 1 );

if not H = "self" then

Expand All @@ -2463,15 +2463,15 @@ InstallMethodWithCache( PreSheaves,

return InitialObject( H );

end );
end, OperationWeight( H, "InitialObject" ) );

##
AddHomomorphismStructureOnObjects( PSh_I_I,
function( PSh_I_I, S, T )

return DistinguishedObjectOfHomomorphismStructure( PSh_I_I );

end );
end, OperationWeight( PSh_I_I, "DistinguishedObjectOfHomomorphismStructure" ) );

##
AddHomomorphismStructureOnMorphismsWithGivenObjects( PSh_I_I,
Expand All @@ -2482,7 +2482,7 @@ InstallMethodWithCache( PreSheaves,

return MorphismConstructor( H, source, fail, target );

end );
end, 1 );

##
AddInterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructureWithGivenObjects( PSh_I_I,
Expand All @@ -2493,15 +2493,15 @@ InstallMethodWithCache( PreSheaves,

return MorphismConstructor( H, distinguished_object, fail, target );

end );
end, 1 );

##
AddInterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism( PSh_I_I,
function( PSh_I_I, S, T, morphism )

return MorphismConstructor( PSh_I_I, S, fail, T );

end );
end, 1 );

fi;

Expand All @@ -2511,23 +2511,23 @@ InstallMethodWithCache( PreSheaves,

return IdentityMorphism( PSh_I_I, object1 );

end );
end, OperationWeight( PSh_I_I, "IdentityMorphism" ) );

##
AddBasisOfExternalHom( PSh_I_I,
function( PSh_I_I, object1, object2 )

return [ ];

end );
end, 1 );

##
AddCoefficientsOfMorphism( PSh_I_I,
function( PSh_I_I, morphism )

return [ ];

end );
end, 1 );

Finalize( PSh_I_I );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,15 @@ function ( cat_1, alpha_1, T_1, tau_1, P_1 )
hoisted_1_1 := List( ValuesOnAllObjects( alpha_1 ), function ( logic_new_func_x_2 )
return SyzygiesOfColumns( UnderlyingMatrix( logic_new_func_x_2 ) );
end );
return CreateCapCategoryMorphismWithAttributes( cat_1, P_1, T_1, ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
return CreateCapCategoryMorphismWithAttributes( cat_1, P_1, Range( tau_1 ), ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
local morphism_attr_1_2;
morphism_attr_1_2 := UniqueLeftDivide( hoisted_1_1[o_2], hoisted_2_1[o_2] );
return CreateCapCategoryMorphismWithAttributes( deduped_3_1, CreateCapCategoryObjectWithAttributes( deduped_3_1, RankOfObject, NumberRows( morphism_attr_1_2 ) ), hoisted_4_1[o_2], UnderlyingMatrix, morphism_attr_1_2 );
end ) );
end
########

, 100 );
, 201 : IsPrecompiledDerivation := true );

##
cat!.cached_precompiled_functions.CokernelColiftWithGivenCokernelObject :=
Expand All @@ -392,7 +392,7 @@ function ( cat_1, alpha_1, T_1, tau_1, P_1 )
hoisted_1_1 := List( deduped_6_1, function ( logic_new_func_x_2 )
return NumberColumns( SyzygiesOfColumns( UnderlyingMatrix( logic_new_func_x_2 ) ) );
end );
return CreateCapCategoryMorphismWithAttributes( cat_1, P_1, T_1, ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
return CreateCapCategoryMorphismWithAttributes( cat_1, P_1, Range( tau_1 ), ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
return CreateCapCategoryMorphismWithAttributes( deduped_2_1, CreateCapCategoryObjectWithAttributes( deduped_2_1, RankOfObject, hoisted_1_1[o_2] ), hoisted_3_1[o_2], UnderlyingMatrix, UniqueLeftDivide( hoisted_4_1[o_2], hoisted_5_1[o_2] ) );
end ) );
end
Expand Down Expand Up @@ -1607,15 +1607,15 @@ function ( cat_1, alpha_1, T_1, tau_1, P_1 )
end );
hoisted_2_1 := List( deduped_5_1, UnderlyingMatrix );
hoisted_1_1 := List( deduped_5_1, Source );
return CreateCapCategoryMorphismWithAttributes( cat_1, T_1, P_1, ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( tau_1 ), P_1, ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
local morphism_attr_1_2;
morphism_attr_1_2 := UniqueRightDivide( hoisted_2_1[o_2], hoisted_3_1[o_2] );
return CreateCapCategoryMorphismWithAttributes( deduped_4_1, hoisted_1_1[o_2], CreateCapCategoryObjectWithAttributes( deduped_4_1, RankOfObject, NumberColumns( morphism_attr_1_2 ) ), UnderlyingMatrix, morphism_attr_1_2 );
end ) );
end
########

, 100 );
, 201 : IsPrecompiledDerivation := true );

##
cat!.cached_precompiled_functions.KernelLiftWithGivenKernelObject :=
Expand All @@ -1634,7 +1634,7 @@ function ( cat_1, alpha_1, T_1, tau_1, P_1 )
return NumberRows( SyzygiesOfRows( UnderlyingMatrix( logic_new_func_x_2 ) ) );
end );
hoisted_1_1 := List( deduped_6_1, Source );
return CreateCapCategoryMorphismWithAttributes( cat_1, T_1, P_1, ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( tau_1 ), P_1, ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
return CreateCapCategoryMorphismWithAttributes( deduped_3_1, hoisted_1_1[o_2], CreateCapCategoryObjectWithAttributes( deduped_3_1, RankOfObject, hoisted_2_1[o_2] ), UnderlyingMatrix, UniqueRightDivide( hoisted_4_1[o_2], hoisted_5_1[o_2] ) );
end ) );
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ function ( cat_1, alpha_1, T_1, tau_1, P_1 )
hoisted_1_1 := List( ValuesOnAllObjects( alpha_1 ), function ( logic_new_func_x_2 )
return SyzygiesOfColumns( UnderlyingMatrix( logic_new_func_x_2 ) );
end );
return CreateCapCategoryMorphismWithAttributes( cat_1, P_1, T_1, ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
return CreateCapCategoryMorphismWithAttributes( cat_1, P_1, Range( tau_1 ), ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
local morphism_attr_1_2;
morphism_attr_1_2 := UniqueLeftDivide( hoisted_1_1[o_2], hoisted_2_1[o_2] );
return CreateCapCategoryMorphismWithAttributes( deduped_3_1, CreateCapCategoryObjectWithAttributes( deduped_3_1, RankOfObject, NumberRows( morphism_attr_1_2 ) ), hoisted_4_1[o_2], UnderlyingMatrix, morphism_attr_1_2 );
end ) );
end
########

, 100 );
, 201 : IsPrecompiledDerivation := true );

##
cat!.cached_precompiled_functions.CokernelColiftWithGivenCokernelObject :=
Expand All @@ -257,7 +257,7 @@ function ( cat_1, alpha_1, T_1, tau_1, P_1 )
hoisted_1_1 := List( deduped_6_1, function ( logic_new_func_x_2 )
return NumberColumns( SyzygiesOfColumns( UnderlyingMatrix( logic_new_func_x_2 ) ) );
end );
return CreateCapCategoryMorphismWithAttributes( cat_1, P_1, T_1, ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
return CreateCapCategoryMorphismWithAttributes( cat_1, P_1, Range( tau_1 ), ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
return CreateCapCategoryMorphismWithAttributes( deduped_2_1, CreateCapCategoryObjectWithAttributes( deduped_2_1, RankOfObject, hoisted_1_1[o_2] ), hoisted_3_1[o_2], UnderlyingMatrix, UniqueLeftDivide( hoisted_4_1[o_2], hoisted_5_1[o_2] ) );
end ) );
end
Expand Down Expand Up @@ -1472,15 +1472,15 @@ function ( cat_1, alpha_1, T_1, tau_1, P_1 )
end );
hoisted_2_1 := List( deduped_5_1, UnderlyingMatrix );
hoisted_1_1 := List( deduped_5_1, Source );
return CreateCapCategoryMorphismWithAttributes( cat_1, T_1, P_1, ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( tau_1 ), P_1, ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
local morphism_attr_1_2;
morphism_attr_1_2 := UniqueRightDivide( hoisted_2_1[o_2], hoisted_3_1[o_2] );
return CreateCapCategoryMorphismWithAttributes( deduped_4_1, hoisted_1_1[o_2], CreateCapCategoryObjectWithAttributes( deduped_4_1, RankOfObject, NumberColumns( morphism_attr_1_2 ) ), UnderlyingMatrix, morphism_attr_1_2 );
end ) );
end
########

, 100 );
, 201 : IsPrecompiledDerivation := true );

##
cat!.cached_precompiled_functions.KernelLiftWithGivenKernelObject :=
Expand All @@ -1499,7 +1499,7 @@ function ( cat_1, alpha_1, T_1, tau_1, P_1 )
return NumberRows( SyzygiesOfRows( UnderlyingMatrix( logic_new_func_x_2 ) ) );
end );
hoisted_1_1 := List( deduped_6_1, Source );
return CreateCapCategoryMorphismWithAttributes( cat_1, T_1, P_1, ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( tau_1 ), P_1, ValuesOnAllObjects, LazyHList( [ 1 .. DefiningTripleOfUnderlyingQuiver( Source( cat_1 ) )[1] ], function ( o_2 )
return CreateCapCategoryMorphismWithAttributes( deduped_3_1, hoisted_1_1[o_2], CreateCapCategoryObjectWithAttributes( deduped_3_1, RankOfObject, hoisted_2_1[o_2] ), UnderlyingMatrix, UniqueRightDivide( hoisted_4_1[o_2], hoisted_5_1[o_2] ) );
end ) );
end
Expand Down
Loading

0 comments on commit 24d8d8f

Please sign in to comment.