Skip to content

Commit a60d4d8

Browse files
fixed SetRangeCategoryOfHomomorphismStructure for the opposite category
SetRangeCategoryOfHomomorphismStructure only if the operations of the homomorphism structure can be installed resolves #1249
1 parent df78779 commit a60d4d8

File tree

3 files changed

+33
-7
lines changed

3 files changed

+33
-7
lines changed

CAP/PackageInfo.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SetPackageInfo( rec(
1010

1111
PackageName := "CAP",
1212
Subtitle := "Categories, Algorithms, Programming",
13-
Version := "2023.02-06",
13+
Version := "2023.02-07",
1414
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
1515
License := "GPL-2.0-or-later",
1616

CAP/examples/OppositeCategory.g

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ ListKnownCategoricalProperties( op );
1212
#! "IsAbelianCategoryWithEnoughProjectives", "IsAdditiveCategory",
1313
#! "IsBraidedMonoidalCategory", "IsClosedMonoidalCategory",
1414
#! "IsCoclosedMonoidalCategory", "IsEnrichedOverCommutativeRegularSemigroup",
15-
#! "IsLinearCategoryOverCommutativeRing", "IsMonoidalCategory",
16-
#! "IsPreAbelianCategory", "IsRigidSymmetricClosedMonoidalCategory",
15+
#! "IsEquippedWithHomomorphismStructure", "IsLinearCategoryOverCommutativeRing",
16+
#! "IsMonoidalCategory", "IsPreAbelianCategory",
17+
#! "IsRigidSymmetricClosedMonoidalCategory",
1718
#! "IsRigidSymmetricCoclosedMonoidalCategory", "IsSkeletalCategory",
1819
#! "IsStrictMonoidalCategory", "IsSymmetricClosedMonoidalCategory",
1920
#! "IsSymmetricCoclosedMonoidalCategory", "IsSymmetricMonoidalCategory" ]

CAP/gap/OppositeCategory.gi

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ end );
5959
BindGlobal( "CAP_INTERNAL_INSTALL_OPPOSITE_ADDS_FROM_CATEGORY",
6060

6161
function( opposite_category, category )
62-
local only_primitive_operations, recnames, current_recname, current_entry, dual_operation_name,
63-
filter_list, input_arguments_names, return_type, func_string,
62+
local only_primitive_operations, recnames, list_of_installed_operations,
63+
operations_of_homomorphism_structure, operations_of_external_hom,
64+
current_recname, current_entry, dual_operation_name, filter_list, input_arguments_names, return_type, func_string,
6465
dual_preprocessor_func_string, preprocessor_string, dual_arguments, tmp,
6566
dual_postprocessor_func_string, postprocessor_string, output_source_getter_string, output_range_getter_string, return_statement,
6667
func, weight, current_add, list_of_attributes, attr, tester, setter, getter;
@@ -69,7 +70,7 @@ BindGlobal( "CAP_INTERNAL_INSTALL_OPPOSITE_ADDS_FROM_CATEGORY",
6970

7071
## Take care of attributes
7172
## TODO: if there are more instances, set markers in the MethodRecord
72-
list_of_attributes := [ "RangeCategoryOfHomomorphismStructure", "CommutativeRingOfLinearCategory" ];
73+
list_of_attributes := [ "CommutativeRingOfLinearCategory" ];
7374

7475
for attr in list_of_attributes do
7576

@@ -97,6 +98,30 @@ BindGlobal( "CAP_INTERNAL_INSTALL_OPPOSITE_ADDS_FROM_CATEGORY",
9798
"VerticalPostCompose",
9899
"IdenticalTwoCell" ] );
99100

101+
if only_primitive_operations then
102+
list_of_installed_operations := ListPrimitivelyInstalledOperationsOfCategory( category );
103+
else
104+
list_of_installed_operations := ListInstalledOperationsOfCategory( category );
105+
fi;
106+
107+
operations_of_homomorphism_structure :=
108+
[ "DistinguishedObjectOfHomomorphismStructure",
109+
"HomomorphismStructureOnObjects",
110+
"HomomorphismStructureOnMorphisms",
111+
"HomomorphismStructureOnMorphismsWithGivenObjects",
112+
"InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructure",
113+
"InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructureWithGivenObjects",
114+
"InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism",
115+
];
116+
117+
if HasRangeCategoryOfHomomorphismStructure( category ) and
118+
not IsEmpty( Intersection( list_of_installed_operations, operations_of_homomorphism_structure ) ) then
119+
120+
SetRangeCategoryOfHomomorphismStructure( opposite_category, RangeCategoryOfHomomorphismStructure( category ) );
121+
SetIsEquippedWithHomomorphismStructure( opposite_category, true );
122+
123+
fi;
124+
100125
for current_recname in recnames do
101126

102127
current_entry := CAP_INTERNAL_METHOD_NAME_RECORD.( current_recname );
@@ -116,7 +141,7 @@ BindGlobal( "CAP_INTERNAL_INSTALL_OPPOSITE_ADDS_FROM_CATEGORY",
116141
continue;
117142
fi;
118143

119-
if only_primitive_operations and not dual_operation_name in ListPrimitivelyInstalledOperationsOfCategory( category ) then
144+
if not dual_operation_name in list_of_installed_operations then
120145
continue;
121146
fi;
122147

0 commit comments

Comments
 (0)