Skip to content

Commit 2df53e2

Browse files
Merge pull request #1768 from mohamed-barakat/MonoidalTest
improved monoidal tests
2 parents 8db233c + fbba5a5 commit 2df53e2

31 files changed

Lines changed: 982 additions & 382 deletions

AdditiveClosuresForCAP/PackageInfo.g

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

1111
PackageName := "AdditiveClosuresForCAP",
1212
Subtitle := "Additive closures for pre-abelian categories",
13-
Version := "2025.07-03",
13+
Version := "2025.07-04",
1414
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)( ),
1515
License := "GPL-2.0-or-later",
1616

@@ -133,7 +133,7 @@ Dependencies := rec(
133133
GAP := ">= 4.13.0",
134134
NeededOtherPackages := [ [ "CAP", ">= 2025.06-05" ],
135135
[ "GradedRingForHomalg", ">=2019.08.07" ],
136-
[ "MonoidalCategories", ">= 2024.09-02" ],
136+
[ "MonoidalCategories", ">= 2025.07-02" ],
137137
],
138138
SuggestedOtherPackages := [ ],
139139
ExternalConditions := [ ],

AdditiveClosuresForCAP/tst/ClosedAndCoclosedRows.tst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,11 @@ false
404404
gap> braiding_c_d = braiding_inverse_c_d;
405405
false
406406

407-
gap> CheckBraiding( a, b, c );
407+
gap> TestBraidingCompatability( rows, a, b, c );
408408
true
409-
gap> CheckBraiding( c, b, a );
409+
gap> TestBraidingCompatability( rows, c, b, a );
410410
true
411-
gap> CheckBraiding( b, a, c );
411+
gap> TestBraidingCompatability( rows, b, a, c );
412412
true
413413

414414
######################################################

CartesianCategories/PackageInfo.g

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

1111
PackageName := "CartesianCategories",
1212
Subtitle := "Cartesian and cocartesian categories and various subdoctrines",
13-
Version := "2025.07-01",
13+
Version := "2025.07-02",
1414
Date := ~.Version{[ 1 .. 10 ]},
1515
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)( ),
1616
License := "GPL-2.0-or-later",
@@ -99,7 +99,7 @@ Dependencies := rec(
9999
GAP := ">= 4.13.0",
100100
NeededOtherPackages := [
101101
[ "CAP", ">= 2025.03-04" ],
102-
[ "MonoidalCategories", ">= 2025.07-01" ],
102+
[ "MonoidalCategories", ">= 2025.07-02" ],
103103
],
104104
SuggestedOtherPackages := [ ],
105105
ExternalConditions := [ ],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
The files of this package which include the line `THIS FILE WAS AUTOMATICALLY GENERATED` in their header have been autogenerated
22

3-
* from MonoidalCategories v2025.07-01
3+
* from MonoidalCategories v2025.07-02

CartesianCategories/gap/BraidedCartesianCategories.gd

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,3 @@ DeclareOperation( "CartesianBraidingInverse",
5252
#! @Arguments s,a,b,r
5353
DeclareOperation( "CartesianBraidingInverseWithGivenDirectProducts",
5454
[ IsCapCategoryObject, IsCapCategoryObject, IsCapCategoryObject, IsCapCategoryObject ] );
55-
56-
DeclareOperation( "CheckCartesianBraiding",
57-
[ IsCapCategoryObject, IsCapCategoryObject, IsCapCategoryObject ] );

CartesianCategories/gap/BraidedCartesianCategories.gi

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,3 @@ AddDerivationToCAP( CartesianBraidingInverse,
3636
return CartesianBraidingInverseWithGivenDirectProducts( cat, source_and_range, object_1, object_2, source_and_range );
3737

3838
end : CategoryFilter := IsSkeletalCategory );
39-
40-
##
41-
InstallMethod( CheckCartesianBraiding,
42-
[ IsCapCategoryObject, IsCapCategoryObject, IsCapCategoryObject ],
43-
44-
function( A, B, C )
45-
local AB, mor1, mor2, BC;
46-
47-
AB := DirectProduct( A, B );
48-
49-
mor1 := PreCompose( [
50-
CartesianBraiding( AB, C ),
51-
CartesianAssociatorRightToLeft( C, A, B ),
52-
DirectProductOnMorphisms( CartesianBraiding( C, A ), IdentityMorphism( B ) ) ] );
53-
54-
mor2 := PreCompose( [
55-
CartesianAssociatorLeftToRight( A, B, C ),
56-
DirectProductOnMorphisms( IdentityMorphism( A ), CartesianBraiding( B, C ) ),
57-
CartesianAssociatorRightToLeft( A, C, B ) ] );
58-
59-
if not IsCongruentForMorphisms( mor1, mor2 ) then
60-
return false;
61-
fi;
62-
63-
BC := DirectProduct( B, C );
64-
65-
mor1 := PreCompose( [
66-
CartesianBraiding( A, BC ),
67-
CartesianAssociatorLeftToRight( B, C, A ),
68-
DirectProductOnMorphisms( IdentityMorphism( B ), CartesianBraiding( C, A ) ) ] );
69-
70-
mor2 := PreCompose( [
71-
CartesianAssociatorRightToLeft( A, B, C ),
72-
DirectProductOnMorphisms( CartesianBraiding( A, B ), IdentityMorphism( C ) ),
73-
CartesianAssociatorLeftToRight( B, A, C ) ] );
74-
75-
return IsCongruentForMorphisms( mor1, mor2 );
76-
77-
end );

CartesianCategories/gap/BraidedCartesianCategoriesTest.gd

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,23 @@
1313

1414
#! @Description
1515
#! This is a debug operation.
16-
#! The arguments are 3
17-
#! objects $v_1, v_2, v_3$
18-
#! in a braided cartesian category.
16+
#! The arguments are three objects $obj_1, obj_2, obj_3$
17+
#! in a braided cartesian category $cat$.
1918
#! The output is true if the braiding compatabilities with the associator hold,
2019
#! false otherwise.
2120
#! @Returns a boolean
22-
#! @Arguments v_1, v_2, v_3
21+
#! @Arguments cat, obj_1, obj_2, obj_3
2322
DeclareOperation( "TestCartesianBraidingCompatability",
24-
[ IsCapCategoryObject, IsCapCategoryObject, IsCapCategoryObject ] );
23+
[ IsCapCategory, IsCapCategoryObject, IsCapCategoryObject, IsCapCategoryObject ] );
2524

2625
#! @Description
2726
#! This is a debug operation.
28-
#! The argument is a list $L$
29-
#! consisting of triples of objects
30-
#! in a braided cartesian category.
27+
#! The argument is a list $L$ of objects in a braided cartesian category $cat$.
3128
#! The output is true if the braiding compatabilities with the associator hold
32-
#! for all those triples
33-
#! false otherwise.
29+
#! for all triples of objects in $L$, otherwise false.
3430
#! @Returns a boolean
35-
#! @Arguments L
36-
DeclareOperation( "TestCartesianBraidingCompatabilityForAllTriplesInList", [ IsList ] );
31+
#! @Arguments cat, L
32+
DeclareOperation( "TestCartesianBraidingCompatabilityForAllTriplesInList", [ IsCapCategory, IsList ] );
3733

3834
#! @Description
3935
#! The arguments are

CartesianCategories/gap/BraidedCartesianCategoriesTest.gi

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,57 +9,62 @@
99

1010
##
1111
InstallMethod( TestCartesianBraidingCompatability,
12-
[ IsCapCategoryObject, IsCapCategoryObject, IsCapCategoryObject ],
12+
[ IsCapCategory, IsCapCategoryObject, IsCapCategoryObject, IsCapCategoryObject ],
1313

14-
function( object_a, object_b, object_c )
15-
local morphism_1, morphism_2;
14+
function( cat, object_1, object_2, object_3 )
15+
local morphism_left, morphism_right;
1616

17-
morphism_1 := CartesianBraiding( DirectProduct( object_a, object_b ), object_c );
17+
Assert( 0, HasIsCartesianCategory( cat ) and IsCartesianCategory( cat ) );
18+
Assert( 0, IsIdenticalObj( cat, CapCategory( object_1 ) ) );
19+
Assert( 0, IsIdenticalObj( cat, CapCategory( object_2 ) ) );
20+
Assert( 0, IsIdenticalObj( cat, CapCategory( object_3 ) ) );
1821

19-
morphism_1 := PreCompose( morphism_1, CartesianAssociatorRightToLeft( object_c, object_a, object_b ) );
22+
morphism_left := CartesianBraiding( BinaryDirectProduct( cat, object_1, object_2 ), object_3 );
2023

21-
morphism_1 := PreCompose( morphism_1,
22-
DirectProductOnMorphisms( CartesianBraiding( object_c, object_a ), IdentityMorphism( object_b ) ) );
24+
morphism_left := PreCompose( morphism_left, CartesianAssociatorRightToLeft( object_3, object_1, object_2 ) );
2325

24-
morphism_2 := CartesianAssociatorLeftToRight( object_a, object_b, object_c );
26+
morphism_left := PreCompose( morphism_left,
27+
DirectProductOnMorphisms( CartesianBraiding( object_3, object_1 ), IdentityMorphism( object_2 ) ) );
2528

26-
morphism_2 := PreCompose( morphism_2,
27-
DirectProductOnMorphisms( IdentityMorphism( object_a ), CartesianBraiding( object_b, object_c ) ) );
29+
morphism_right := CartesianAssociatorLeftToRight( object_1, object_2, object_3 );
2830

29-
morphism_2 := PreCompose( morphism_2, CartesianAssociatorRightToLeft( object_a, object_c, object_b ) );
31+
morphism_right := PreCompose( morphism_right,
32+
DirectProductOnMorphisms( IdentityMorphism( object_1 ), CartesianBraiding( object_2, object_3 ) ) );
3033

31-
if not ( morphism_1 = morphism_2 ) then
34+
morphism_right := PreCompose( morphism_right, CartesianAssociatorRightToLeft( object_1, object_3, object_2 ) );
35+
36+
if not ( morphism_left = morphism_right ) then
3237

3338
return false;
3439

3540
fi;
3641

37-
morphism_1 := CartesianBraiding( object_a, DirectProduct( object_b, object_c ) );
42+
morphism_left := CartesianBraiding( object_1, BinaryDirectProduct( cat, object_2, object_3 ) );
3843

39-
morphism_1 := PreCompose( morphism_1, CartesianAssociatorLeftToRight( object_b, object_c, object_a ) );
44+
morphism_left := PreCompose( morphism_left, CartesianAssociatorLeftToRight( object_2, object_3, object_1 ) );
4045

41-
morphism_1 := PreCompose( morphism_1,
42-
DirectProductOnMorphisms( IdentityMorphism( object_b ), CartesianBraiding( object_c, object_a ) ) );
46+
morphism_left := PreCompose( morphism_left,
47+
DirectProductOnMorphisms( IdentityMorphism( object_2 ), CartesianBraiding( object_3, object_1 ) ) );
4348

44-
morphism_2 := CartesianAssociatorRightToLeft( object_a, object_b, object_c );
49+
morphism_right := CartesianAssociatorRightToLeft( object_1, object_2, object_3 );
4550

46-
morphism_2 := PreCompose( morphism_2,
47-
DirectProductOnMorphisms( CartesianBraiding( object_a, object_b ), IdentityMorphism( object_c ) ) );
51+
morphism_right := PreCompose( morphism_right,
52+
DirectProductOnMorphisms( CartesianBraiding( object_1, object_2 ), IdentityMorphism( object_3 ) ) );
4853

49-
morphism_2 := PreCompose( morphism_2, CartesianAssociatorLeftToRight( object_b, object_a, object_c ) );
54+
morphism_right := PreCompose( morphism_right, CartesianAssociatorLeftToRight( object_2, object_1, object_3 ) );
5055

51-
return morphism_1 = morphism_2;
56+
return morphism_left = morphism_right;
5257

5358
end );
5459

5560
##
5661
InstallMethod( TestCartesianBraidingCompatabilityForAllTriplesInList,
57-
[ IsList ],
62+
[ IsCapCategory, IsList ],
5863

59-
function( object_list )
64+
function( cat, object_list )
6065
local a, b, c, size, list, test;
6166

62-
size := Size( object_list );
67+
size := Length( object_list );
6368

6469
list := [ 1 .. size ];
6570

@@ -69,7 +74,7 @@ InstallMethod( TestCartesianBraidingCompatabilityForAllTriplesInList,
6974

7075
for c in list do
7176

72-
test := TestCartesianBraidingCompatability( object_list[a], object_list[b], object_list[c] );
77+
test := TestCartesianBraidingCompatability( cat, object_list[a], object_list[b], object_list[c] );
7378

7479
if not test then
7580

@@ -89,9 +94,7 @@ end );
8994

9095
##
9196
InstallGlobalFunction( "BraidedCartesianCategoriesTest",
92-
9397
function( cat, opposite, a, b )
94-
9598
local verbose,
9699

97100
a_op, braiding_a_b, braiding_a_b_op, braiding_inverse_a_b, braiding_inverse_a_b_op,
@@ -102,6 +105,18 @@ InstallGlobalFunction( "BraidedCartesianCategoriesTest",
102105

103106
verbose := ValueOption( "verbose" ) = true;
104107

108+
if IsEmpty( MissingOperationsForConstructivenessOfCategory( cat, "IsCartesianCategory" ) ) then
109+
110+
Assert( 0, TestCartesianBraidingCompatability( cat, a, b, a ) );
111+
112+
fi;
113+
114+
if IsEmpty( MissingOperationsForConstructivenessOfCategory( opposite, "IsCartesianCategory" ) ) then
115+
116+
Assert( 0, TestCartesianBraidingCompatability( opposite, a_op, b_op, a_op ) );
117+
118+
fi;
119+
105120
if CanCompute( cat, "CartesianBraiding" ) then
106121

107122
if verbose then

CartesianCategories/gap/BraidedCocartesianCategories.gd

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,3 @@ DeclareOperation( "CocartesianBraidingInverse",
5252
#! @Arguments s,a,b,r
5353
DeclareOperation( "CocartesianBraidingInverseWithGivenCoproducts",
5454
[ IsCapCategoryObject, IsCapCategoryObject, IsCapCategoryObject, IsCapCategoryObject ] );
55-
56-
DeclareOperation( "CheckCocartesianBraiding",
57-
[ IsCapCategoryObject, IsCapCategoryObject, IsCapCategoryObject ] );

CartesianCategories/gap/BraidedCocartesianCategories.gi

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,3 @@ AddDerivationToCAP( CocartesianBraidingInverse,
3636
return CocartesianBraidingInverseWithGivenCoproducts( cat, source_and_range, object_1, object_2, source_and_range );
3737

3838
end : CategoryFilter := IsSkeletalCategory );
39-
40-
##
41-
InstallMethod( CheckCocartesianBraiding,
42-
[ IsCapCategoryObject, IsCapCategoryObject, IsCapCategoryObject ],
43-
44-
function( A, B, C )
45-
local AB, mor1, mor2, BC;
46-
47-
AB := Coproduct( A, B );
48-
49-
mor1 := PreCompose( [
50-
CocartesianBraiding( AB, C ),
51-
CocartesianAssociatorRightToLeft( C, A, B ),
52-
CoproductOnMorphisms( CocartesianBraiding( C, A ), IdentityMorphism( B ) ) ] );
53-
54-
mor2 := PreCompose( [
55-
CocartesianAssociatorLeftToRight( A, B, C ),
56-
CoproductOnMorphisms( IdentityMorphism( A ), CocartesianBraiding( B, C ) ),
57-
CocartesianAssociatorRightToLeft( A, C, B ) ] );
58-
59-
if not IsCongruentForMorphisms( mor1, mor2 ) then
60-
return false;
61-
fi;
62-
63-
BC := Coproduct( B, C );
64-
65-
mor1 := PreCompose( [
66-
CocartesianBraiding( A, BC ),
67-
CocartesianAssociatorLeftToRight( B, C, A ),
68-
CoproductOnMorphisms( IdentityMorphism( B ), CocartesianBraiding( C, A ) ) ] );
69-
70-
mor2 := PreCompose( [
71-
CocartesianAssociatorRightToLeft( A, B, C ),
72-
CoproductOnMorphisms( CocartesianBraiding( A, B ), IdentityMorphism( C ) ),
73-
CocartesianAssociatorLeftToRight( B, A, C ) ] );
74-
75-
return IsCongruentForMorphisms( mor1, mor2 );
76-
77-
end );

0 commit comments

Comments
 (0)