Skip to content

Commit 8d51687

Browse files
authored
Merge pull request #1251 from mohamed-barakat/FixedOppositeCategory
fixed SetRangeCategoryOfHomomorphismStructure for the opposite category
2 parents e859c00 + a60d4d8 commit 8d51687

File tree

3 files changed

+41
-16
lines changed

3 files changed

+41
-16
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: 37 additions & 13 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

@@ -89,6 +90,38 @@ BindGlobal( "CAP_INTERNAL_INSTALL_OPPOSITE_ADDS_FROM_CATEGORY",
8990

9091
recnames := AsSortedList( RecNames( CAP_INTERNAL_METHOD_NAME_RECORD ) );
9192

93+
## No support for twocells
94+
recnames := Difference( recnames,
95+
[ "HorizontalPreCompose",
96+
"HorizontalPostCompose",
97+
"VerticalPreCompose",
98+
"VerticalPostCompose",
99+
"IdenticalTwoCell" ] );
100+
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+
92125
for current_recname in recnames do
93126

94127
current_entry := CAP_INTERNAL_METHOD_NAME_RECORD.( current_recname );
@@ -97,15 +130,6 @@ BindGlobal( "CAP_INTERNAL_INSTALL_OPPOSITE_ADDS_FROM_CATEGORY",
97130
continue;
98131
fi;
99132

100-
## No support for twocells
101-
if current_recname in [ "HorizontalPreCompose",
102-
"HorizontalPostCompose",
103-
"VerticalPreCompose",
104-
"VerticalPostCompose",
105-
"IdenticalTwoCell" ] then
106-
continue;
107-
fi;
108-
109133
## Conservative
110134
if not IsBound( current_entry.dual_operation ) then
111135
continue;
@@ -117,7 +141,7 @@ BindGlobal( "CAP_INTERNAL_INSTALL_OPPOSITE_ADDS_FROM_CATEGORY",
117141
continue;
118142
fi;
119143

120-
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
121145
continue;
122146
fi;
123147

0 commit comments

Comments
 (0)