Skip to content

Commit 17711bd

Browse files
committed
Call CAP operations in MonoidalCategories with category as first argument
1 parent 1a920ad commit 17711bd

17 files changed

+580
-602
lines changed

MonoidalCategories/PackageInfo.g

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ SetPackageInfo( rec(
1010

1111
PackageName := "MonoidalCategories",
1212
Subtitle := "Monoidal and monoidal (co)closed categories",
13-
Version := "2021.08-01",
14-
13+
Version := "2021.08-02",
1514
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
1615
License := "GPL-2.0-or-later",
1716

@@ -120,7 +119,7 @@ Dependencies := rec(
120119
NeededOtherPackages := [
121120
[ "GAPDoc", ">= 1.5" ],
122121
[ "ToolsForHomalg", ">= 2018.05.22" ],
123-
[ "CAP", ">= 2021.08-03" ],
122+
[ "CAP", ">= 2021.08-04" ],
124123
],
125124
SuggestedOtherPackages := [ ],
126125
ExternalConditions := [ ],

MonoidalCategories/gap/AdditiveMonoidalCategories.gi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ AddDerivationToCAP( LeftDistributivityExpanding,
44
function( cat, object, summands_list )
55
local source_and_range;
66

7-
source_and_range := TensorProductOnObjects( object, DirectSum( summands_list ) );
7+
source_and_range := TensorProductOnObjects( cat, object, DirectSum( cat, summands_list ) );
88

9-
return LeftDistributivityExpandingWithGivenObjects(
9+
return LeftDistributivityExpandingWithGivenObjects( cat,
1010
source_and_range,
1111
object, summands_list,
1212
source_and_range
@@ -21,9 +21,9 @@ AddDerivationToCAP( LeftDistributivityFactoring,
2121
function( cat, object, summands_list )
2222
local source_and_range;
2323

24-
source_and_range := TensorProductOnObjects( object, DirectSum( summands_list ) );
24+
source_and_range := TensorProductOnObjects( cat, object, DirectSum( cat, summands_list ) );
2525

26-
return LeftDistributivityFactoringWithGivenObjects(
26+
return LeftDistributivityFactoringWithGivenObjects( cat,
2727
source_and_range,
2828
object, summands_list,
2929
source_and_range
@@ -38,9 +38,9 @@ AddDerivationToCAP( RightDistributivityExpanding,
3838
function( cat, summands_list, object )
3939
local source_and_range;
4040

41-
source_and_range := TensorProductOnObjects( DirectSum( summands_list ), object );
41+
source_and_range := TensorProductOnObjects( cat, DirectSum( cat, summands_list ), object );
4242

43-
return RightDistributivityExpandingWithGivenObjects(
43+
return RightDistributivityExpandingWithGivenObjects( cat,
4444
source_and_range,
4545
summands_list, object,
4646
source_and_range
@@ -55,9 +55,9 @@ AddDerivationToCAP( RightDistributivityFactoring,
5555
function( cat, summands_list, object )
5656
local source_and_range;
5757

58-
source_and_range := TensorProductOnObjects( DirectSum( summands_list ), object );
58+
source_and_range := TensorProductOnObjects( cat, DirectSum( cat, summands_list ), object );
5959

60-
return RightDistributivityFactoringWithGivenObjects(
60+
return RightDistributivityFactoringWithGivenObjects( cat,
6161
source_and_range,
6262
summands_list, object,
6363
source_and_range

MonoidalCategories/gap/AdditiveMonoidalCategoriesDerivedMethods.gi

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ AddDerivationToCAP( LeftDistributivityExpandingWithGivenObjects,
66

77
nr_summands := Size( summands );
88

9-
id := IdentityMorphism( object );
9+
id := IdentityMorphism( cat, object );
1010

11-
projection_list := List( [ 1 .. nr_summands ], i -> ProjectionInFactorOfDirectSum( summands, i ) );
11+
projection_list := List( [ 1 .. nr_summands ], i -> ProjectionInFactorOfDirectSum( cat, summands, i ) );
1212

13-
projection_list := List( projection_list, mor -> TensorProductOnMorphisms( id, mor ) );
13+
projection_list := List( projection_list, mor -> TensorProductOnMorphisms( cat, id, mor ) );
1414

15-
diagram := List( summands, summand -> TensorProductOnObjects( object, summand ) );
15+
diagram := List( summands, summand -> TensorProductOnObjects( cat, object, summand ) );
1616

17-
return UniversalMorphismIntoDirectSum( diagram, projection_list );
17+
return UniversalMorphismIntoDirectSum( cat, diagram, projection_list );
1818

1919
end : CategoryFilter := IsMonoidalCategory and IsAdditiveCategory,
2020
Description := "LeftDistributivityExpandingWithGivenObjects using the universal property of the direct sum" );
@@ -27,15 +27,15 @@ AddDerivationToCAP( LeftDistributivityFactoringWithGivenObjects,
2727

2828
nr_summands := Size( summands );
2929

30-
id := IdentityMorphism( object );
30+
id := IdentityMorphism( cat, object );
3131

32-
injection_list := List( [ 1 .. nr_summands ], i -> InjectionOfCofactorOfDirectSum( summands, i ) );
32+
injection_list := List( [ 1 .. nr_summands ], i -> InjectionOfCofactorOfDirectSum( cat, summands, i ) );
3333

34-
injection_list := List( injection_list, mor -> TensorProductOnMorphisms( id, mor ) );
34+
injection_list := List( injection_list, mor -> TensorProductOnMorphisms( cat, id, mor ) );
3535

36-
diagram := List( summands, summand -> TensorProductOnObjects( object, summand ) );
36+
diagram := List( summands, summand -> TensorProductOnObjects( cat, object, summand ) );
3737

38-
return UniversalMorphismFromDirectSum( diagram, injection_list );
38+
return UniversalMorphismFromDirectSum( cat, diagram, injection_list );
3939

4040
end : CategoryFilter := IsMonoidalCategory and IsAdditiveCategory,
4141
Description := "LeftDistributivityFactoringWithGivenObjects using the universal property of the direct sum" );
@@ -48,15 +48,15 @@ AddDerivationToCAP( RightDistributivityExpandingWithGivenObjects,
4848

4949
nr_summands := Size( summands );
5050

51-
id := IdentityMorphism( object );
51+
id := IdentityMorphism( cat, object );
5252

53-
projection_list := List( [ 1 .. nr_summands ], i -> ProjectionInFactorOfDirectSum( summands, i ) );
53+
projection_list := List( [ 1 .. nr_summands ], i -> ProjectionInFactorOfDirectSum( cat, summands, i ) );
5454

55-
projection_list := List( projection_list, mor -> TensorProductOnMorphisms( mor, id ) );
55+
projection_list := List( projection_list, mor -> TensorProductOnMorphisms( cat, mor, id ) );
5656

57-
diagram := List( summands, summand -> TensorProductOnObjects( summand, object ) );
57+
diagram := List( summands, summand -> TensorProductOnObjects( cat, summand, object ) );
5858

59-
return UniversalMorphismIntoDirectSum( diagram, projection_list );
59+
return UniversalMorphismIntoDirectSum( cat, diagram, projection_list );
6060

6161
end : CategoryFilter := IsMonoidalCategory and IsAdditiveCategory,
6262
Description := "RightDistributivityExpandingWithGivenObjects using the universal property of the direct sum" );
@@ -69,15 +69,15 @@ AddDerivationToCAP( RightDistributivityFactoringWithGivenObjects,
6969

7070
nr_summands := Size( summands );
7171

72-
id := IdentityMorphism( object );
72+
id := IdentityMorphism( cat, object );
7373

74-
injection_list := List( [ 1 .. nr_summands ], i -> InjectionOfCofactorOfDirectSum( summands, i ) );
74+
injection_list := List( [ 1 .. nr_summands ], i -> InjectionOfCofactorOfDirectSum( cat, summands, i ) );
7575

76-
injection_list := List( injection_list, mor -> TensorProductOnMorphisms( mor, id ) );
76+
injection_list := List( injection_list, mor -> TensorProductOnMorphisms( cat, mor, id ) );
7777

78-
diagram := List( summands, summand -> TensorProductOnObjects( summand, object ) );
78+
diagram := List( summands, summand -> TensorProductOnObjects( cat, summand, object ) );
7979

80-
return UniversalMorphismFromDirectSum( diagram, injection_list );
80+
return UniversalMorphismFromDirectSum( cat, diagram, injection_list );
8181

8282
end : CategoryFilter := IsMonoidalCategory and IsAdditiveCategory,
8383
Description := "RightDistributivityFactoringWithGivenObjects using the universal property of the direct sum" );

MonoidalCategories/gap/BraidedMonoidalCategories.gi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ AddDerivationToCAP( Braiding,
44
function( cat, object_1, object_2 )
55
local source_and_range;
66

7-
source_and_range := TensorProductOnObjects( object_1, object_2 );
7+
source_and_range := TensorProductOnObjects( cat, object_1, object_2 );
88

9-
return BraidingWithGivenTensorProducts( source_and_range, object_1, object_2, source_and_range );
9+
return BraidingWithGivenTensorProducts( cat, source_and_range, object_1, object_2, source_and_range );
1010

1111
end : CategoryFilter := IsSkeletalCategory,
1212
Description := "calling the WithGiven operation in a skeletal setting" );
@@ -17,9 +17,9 @@ AddDerivationToCAP( BraidingInverse,
1717
function( cat, object_1, object_2 )
1818
local source_and_range;
1919

20-
source_and_range := TensorProductOnObjects( object_1, object_2 );
20+
source_and_range := TensorProductOnObjects( cat, object_1, object_2 );
2121

22-
return BraidingInverseWithGivenTensorProducts( source_and_range, object_1, object_2, source_and_range );
22+
return BraidingInverseWithGivenTensorProducts( cat, source_and_range, object_1, object_2, source_and_range );
2323

2424
end : CategoryFilter := IsSkeletalCategory,
2525
Description := "calling the WithGiven operation in a skeletal setting" );

MonoidalCategories/gap/BraidedMonoidalCategoriesDerivedMethods.gi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AddDerivationToCAP( BraidingInverseWithGivenTensorProducts,
33

44
function( cat, object_2_tensored_object_1, object_1, object_2, object_1_tensored_object_2 )
55
##TODO: Use BraidingWithGiven
6-
return Inverse( Braiding( object_1, object_2 ) );
6+
return InverseForMorphisms( cat, Braiding( cat, object_1, object_2 ) );
77

88
end : CategoryFilter := IsBraidedMonoidalCategory,
99
Description := "BraidingInverseWithGivenTensorProducts as the inverse of the braiding" );
@@ -13,7 +13,7 @@ AddDerivationToCAP( BraidingWithGivenTensorProducts,
1313

1414
function( cat, object_1_tensored_object_2, object_1, object_2, object_2_tensored_object_1 )
1515
##TODO: Use BraidingInverseWithGiven
16-
return Inverse( BraidingInverse( object_1, object_2 ) );
16+
return InverseForMorphisms( cat, BraidingInverse( cat, object_1, object_2 ) );
1717

1818
end : CategoryFilter := IsBraidedMonoidalCategory,
1919
Description := "BraidingWithGivenTensorProducts as the inverse of BraidingInverse" );

MonoidalCategories/gap/BraidedMonoidalCategoriesMethodRecord.gi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ InstallValue( BRAIDED_MONOIDAL_CATEGORIES_METHOD_NAME_RECORD, rec(
33
Braiding := rec(
44
filter_list := [ "category", "object", "object" ],
55
io_type := [ [ "a", "b" ], [ "s", "r" ] ],
6-
output_source_getter_string := "TensorProductOnObjects( a, b )",
7-
output_range_getter_string := "TensorProductOnObjects( b, a )",
6+
output_source_getter_string := "TensorProductOnObjects( cat, a, b )",
7+
output_range_getter_string := "TensorProductOnObjects( cat, b, a )",
88
with_given_object_position := "both",
99
return_type := "morphism" ),
1010

@@ -16,8 +16,8 @@ BraidingWithGivenTensorProducts := rec(
1616
BraidingInverse := rec(
1717
filter_list := [ "category", "object", "object" ],
1818
io_type := [ [ "a", "b" ], [ "s", "r" ] ],
19-
output_source_getter_string := "TensorProductOnObjects( b, a )",
20-
output_range_getter_string := "TensorProductOnObjects( a, b )",
19+
output_source_getter_string := "TensorProductOnObjects( cat, b, a )",
20+
output_range_getter_string := "TensorProductOnObjects( cat, a, b )",
2121
with_given_object_position := "both",
2222
return_type := "morphism" ),
2323

MonoidalCategories/gap/ClosedMonoidalCategories.gi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AddDerivationToCAP( IsomorphismFromInternalHomToObject,
33

44
function( cat, object )
55

6-
return IsomorphismFromInternalHomToObjectWithGivenInternalHom( object, object );
6+
return IsomorphismFromInternalHomToObjectWithGivenInternalHom( cat, object, object );
77

88
end : CategoryFilter := IsSkeletalCategory,
99
Description := "calling the WithGiven operation in a skeletal setting" );
@@ -13,7 +13,7 @@ AddDerivationToCAP( IsomorphismFromObjectToInternalHom,
1313

1414
function( cat, object )
1515

16-
return IsomorphismFromObjectToInternalHomWithGivenInternalHom( object, object );
16+
return IsomorphismFromObjectToInternalHomWithGivenInternalHom( cat, object, object );
1717

1818
end : CategoryFilter := IsSkeletalCategory,
1919
Description := "calling the WithGiven operation in a skeletal setting" );

MonoidalCategories/gap/ClosedMonoidalCategoriesDerivedMethods.gi

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ AddFinalDerivation( IsomorphismFromDualToInternalHom,
1818
MorphismFromTensorProductToInternalHomWithGivenObjects ],
1919

2020
function( cat, object )
21-
local category;
2221

23-
category := CapCategory( object );
24-
25-
return IdentityMorphism( InternalHomOnObjects( object, TensorUnit( category ) ) );
22+
return IdentityMorphism( cat, InternalHomOnObjects( cat, object, TensorUnit( cat ) ) );
2623

2724
end : CategoryFilter := IsClosedMonoidalCategory,
2825
Description := "IsomorphismFromDualToInternalHom as the identity of Hom(a,1)" );
@@ -42,11 +39,8 @@ AddFinalDerivation( IsomorphismFromInternalHomToDual,
4239
MorphismFromTensorProductToInternalHomWithGivenObjects ],
4340

4441
function( cat, object )
45-
local category;
46-
47-
category := CapCategory( object );
4842

49-
return IdentityMorphism( InternalHomOnObjects( object, TensorUnit( category ) ) );
43+
return IdentityMorphism( cat, InternalHomOnObjects( cat, object, TensorUnit( cat ) ) );
5044

5145
end : CategoryFilter := IsClosedMonoidalCategory,
5246
Description := "IsomorphismFromInternalHomToDual as the identity of Hom(a,1)" );

MonoidalCategories/gap/CoclosedMonoidalCategories.gi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AddDerivationToCAP( IsomorphismFromInternalCoHomToObject,
33

44
function( cat, object )
55

6-
return IsomorphismFromInternalCoHomToObjectWithGivenInternalCoHom( object, object );
6+
return IsomorphismFromInternalCoHomToObjectWithGivenInternalCoHom( cat, object, object );
77

88
end : CategoryFilter := IsSkeletalCategory,
99
Description := "calling the WithGiven operation in a skeletal setting" );
@@ -13,7 +13,7 @@ AddDerivationToCAP( IsomorphismFromObjectToInternalCoHom,
1313

1414
function( cat, object )
1515

16-
return IsomorphismFromObjectToInternalCoHomWithGivenInternalCoHom( object, object );
16+
return IsomorphismFromObjectToInternalCoHomWithGivenInternalCoHom( cat, object, object );
1717

1818
end : CategoryFilter := IsSkeletalCategory,
1919
Description := "calling the WithGiven operation in a skeletal setting" );

MonoidalCategories/gap/CoclosedMonoidalCategoriesDerivedMethods.gi

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@ AddFinalDerivation( IsomorphismFromCoDualToInternalCoHom,
1818
MorphismFromInternalCoHomToTensorProductWithGivenObjects
1919
],
2020
function( cat, object )
21-
local category;
22-
23-
category := CapCategory( object );
24-
25-
return IdentityMorphism( InternalCoHomOnObjects( TensorUnit( category ), object ) );
26-
21+
22+
return IdentityMorphism( cat, InternalCoHomOnObjects( cat, TensorUnit( cat ), object ) );
23+
2724
end : CategoryFilter := IsCoclosedMonoidalCategory,
2825
Description := "IsomorphismFromCoDualToInternalCoHom as the identity of coHom(1,a)" );
2926

@@ -43,11 +40,8 @@ AddFinalDerivation( IsomorphismFromInternalCoHomToCoDual,
4340
],
4441

4542
function( cat, object )
46-
local category;
47-
48-
category := CapCategory( object );
49-
50-
return IdentityMorphism( InternalCoHomOnObjects( TensorUnit( category ), object ) );
51-
43+
44+
return IdentityMorphism( cat, InternalCoHomOnObjects( cat, TensorUnit( cat ), object ) );
45+
5246
end : CategoryFilter := IsCoclosedMonoidalCategory,
5347
Description := "IsomorphismFromInternalCoHomToCoDual as the identity of coHom(1,a)" );

MonoidalCategories/gap/MonoidalCategories.gi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ AddDerivationToCAP( AssociatorRightToLeft,
1616
function( cat, object_1, object_2, object_3 )
1717
local source_and_range;
1818

19-
source_and_range := TensorProductOnObjects( object_1, TensorProductOnObjects( object_2, object_3 ) );
19+
source_and_range := TensorProductOnObjects( cat, object_1, TensorProductOnObjects( cat, object_2, object_3 ) );
2020

21-
return AssociatorRightToLeftWithGivenTensorProducts(
21+
return AssociatorRightToLeftWithGivenTensorProducts( cat,
2222
source_and_range,
2323
object_1, object_2, object_3,
2424
source_and_range
@@ -33,9 +33,9 @@ AddDerivationToCAP( AssociatorLeftToRight,
3333
function( cat, object_1, object_2, object_3 )
3434
local source_and_range;
3535

36-
source_and_range := TensorProductOnObjects( object_1, TensorProductOnObjects( object_2, object_3 ) );
36+
source_and_range := TensorProductOnObjects( cat, object_1, TensorProductOnObjects( cat, object_2, object_3 ) );
3737

38-
return AssociatorLeftToRightWithGivenTensorProducts(
38+
return AssociatorLeftToRightWithGivenTensorProducts( cat,
3939
source_and_range,
4040
object_1, object_2, object_3,
4141
source_and_range
@@ -49,7 +49,7 @@ AddDerivationToCAP( LeftUnitor,
4949

5050
function( cat, object )
5151

52-
return LeftUnitorWithGivenTensorProduct( object, object );
52+
return LeftUnitorWithGivenTensorProduct( cat, object, object );
5353

5454
end : CategoryFilter := IsSkeletalCategory,
5555
Description := "calling the WithGiven operation in a skeletal setting" );
@@ -59,7 +59,7 @@ AddDerivationToCAP( LeftUnitorInverse,
5959

6060
function( cat, object )
6161

62-
return LeftUnitorInverseWithGivenTensorProduct( object, object );
62+
return LeftUnitorInverseWithGivenTensorProduct( cat, object, object );
6363

6464
end : CategoryFilter := IsSkeletalCategory,
6565
Description := "calling the WithGiven operation in a skeletal setting" );
@@ -69,7 +69,7 @@ AddDerivationToCAP( RightUnitor,
6969

7070
function( cat, object )
7171

72-
return RightUnitorWithGivenTensorProduct( object, object );
72+
return RightUnitorWithGivenTensorProduct( cat, object, object );
7373

7474
end : CategoryFilter := IsSkeletalCategory,
7575
Description := "calling the WithGiven operation in a skeletal setting" );
@@ -79,7 +79,7 @@ AddDerivationToCAP( RightUnitorInverse,
7979

8080
function( cat, object )
8181

82-
return RightUnitorInverseWithGivenTensorProduct( object, object );
82+
return RightUnitorInverseWithGivenTensorProduct( cat, object, object );
8383

8484
end : CategoryFilter := IsSkeletalCategory,
8585
Description := "calling the WithGiven operation in a skeletal setting" );

0 commit comments

Comments
 (0)