Skip to content

Commit 56b0ee4

Browse files
Tom Kuhmichelzickgraf
Tom Kuhmichel
authored andcommitted
Move operations to compile
and compile IsEqualForObjects and PreCompose
1 parent 9283a17 commit 56b0ee4

8 files changed

+203
-56
lines changed

CompilerForCAP/examples/PrecompileModulePresentationsAsFreydCategoryOfCategoryOfRowsOrColumns.g

+23-23
Original file line numberDiff line numberDiff line change
@@ -19,52 +19,52 @@ EEE := KoszulDualRing( QQxy * "a,b" );;
1919
operations_for_arbitrary_ring := [
2020
"AdditionForMorphisms",
2121
"AdditiveInverseForMorphisms",
22-
#"AssociatorLeftToRightWithGivenTensorProducts",
23-
#"AssociatorRightToLeftWithGivenTensorProducts",
24-
#"BraidingWithGivenTensorProducts",
25-
#"CoevaluationMorphismWithGivenRange",
2622
"CokernelColiftWithGivenCokernelObject",
2723
"CokernelProjection",
28-
#"Colift",
29-
#"ColiftOrFail",
3024
"DirectSum",
3125
"EpimorphismFromSomeProjectiveObject",
32-
#"EvaluationMorphismWithGivenSource",
3326
"IdentityMorphism",
3427
"InjectionOfCofactorOfDirectSumWithGivenDirectSum",
35-
#"InternalHomOnMorphismsWithGivenInternalHoms",
36-
#"InternalHomOnObjects",
37-
#"IsColiftable",
3828
"IsCongruentForMorphisms",
3929
"IsEqualForMorphisms",
40-
#"IsEqualForObjects",
41-
#"IsLiftable",
30+
"IsEqualForObjects",
4231
#"IsWellDefinedForMorphisms",
4332
#"IsWellDefinedForObjects",
4433
"IsZeroForMorphisms",
4534
#"KernelEmbedding",
46-
#"LeftUnitorWithGivenTensorProduct",
47-
#"Lift",
4835
#"LiftAlongMonomorphism",
49-
#"LiftOrFail",
50-
#"MultiplyWithElementOfCommutativeRingForMorphisms",
51-
#"PreCompose",
36+
"PreCompose",
5237
"ProjectionInFactorOfDirectSumWithGivenDirectSum",
53-
#"RightUnitorWithGivenTensorProduct",
54-
#"TensorProductOnMorphismsWithGivenTensorProducts",
55-
#"TensorProductOnObjects",
56-
#"TensorUnit",
5738
"UniversalMorphismFromDirectSumWithGivenDirectSum",
5839
"UniversalMorphismFromZeroObjectWithGivenZeroObject",
5940
"UniversalMorphismIntoDirectSumWithGivenDirectSum",
6041
"UniversalMorphismIntoZeroObjectWithGivenZeroObject",
6142
"ZeroMorphism",
62-
"ZeroObject"
43+
"ZeroObject",
6344
];;
6445

6546
operations_for_commutative_ring := Concatenation(
6647
operations_for_arbitrary_ring,
67-
[ "MultiplyWithElementOfCommutativeRingForMorphisms" ]
48+
[ #"AssociatorLeftToRightWithGivenTensorProducts",
49+
#"AssociatorRightToLeftWithGivenTensorProducts",
50+
#"BraidingWithGivenTensorProducts",
51+
#"CoevaluationMorphismWithGivenRange",
52+
#"Colift",
53+
#"ColiftOrFail",
54+
#"EvaluationMorphismWithGivenSource",
55+
#"InternalHomOnMorphismsWithGivenInternalHoms",
56+
#"InternalHomOnObjects",
57+
#"IsColiftable",
58+
#"IsLiftable",
59+
#"LeftUnitorWithGivenTensorProduct",
60+
#"Lift",
61+
#"LiftOrFail",
62+
"MultiplyWithElementOfCommutativeRingForMorphisms",
63+
#"RightUnitorWithGivenTensorProduct",
64+
#"TensorProductOnMorphismsWithGivenTensorProducts",
65+
#"TensorProductOnObjects",
66+
#"TensorUnit",
67+
]
6868
);;
6969

7070
precompile_LeftPresentations := function( ring, name, operations )

ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gi

-33
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,6 @@ InstallGlobalFunction( ADD_FUNCTIONS_FOR_LEFT_PRESENTATION,
227227
# has special cases
228228
ADD_PRECOMPOSE_LEFT( category );
229229

230-
# simpler than the compiled version
231-
ADD_EQUAL_FOR_OBJECTS( category );
232-
233230
# IsWellDefined* should not be compiled
234231
ADD_IS_WELL_DEFINED_FOR_OBJECTS( category );
235232

@@ -274,8 +271,6 @@ InstallGlobalFunction( ADD_FUNCTIONS_FOR_RIGHT_PRESENTATION,
274271

275272
ADD_PRECOMPOSE_RIGHT( category );
276273

277-
ADD_EQUAL_FOR_OBJECTS( category );
278-
279274
ADD_IS_WELL_DEFINED_FOR_OBJECTS( category );
280275

281276
ADD_IS_WELL_DEFINED_FOR_MORPHISM_RIGHT( category );
@@ -394,21 +389,6 @@ InstallGlobalFunction( ADD_IS_WELL_DEFINED_FOR_MORPHISM_RIGHT,
394389

395390
end );
396391

397-
##
398-
InstallGlobalFunction( ADD_EQUAL_FOR_OBJECTS,
399-
400-
function( category )
401-
402-
AddIsEqualForObjects( category,
403-
404-
function( cat, object1, object2 )
405-
406-
return UnderlyingMatrix( object1 ) = UnderlyingMatrix( object2 );
407-
408-
end );
409-
410-
end );
411-
412392
##
413393
InstallGlobalFunction( ADD_KERNEL_LEFT,
414394

@@ -510,12 +490,6 @@ InstallGlobalFunction( ADD_PRECOMPOSE_LEFT,
510490
AddPreCompose( category,
511491

512492
[
513-
[ function( cat, left_morphism, right_morphism )
514-
515-
return PresentationMorphism( Source( left_morphism ), UnderlyingMatrix( left_morphism ) * UnderlyingMatrix( right_morphism ), Range( right_morphism ) );
516-
517-
end, [ ] ],
518-
519493
[ function( cat, left_morphism, identity_morphism )
520494

521495
return left_morphism;
@@ -560,13 +534,6 @@ InstallGlobalFunction( ADD_PRECOMPOSE_RIGHT,
560534
AddPreCompose( category,
561535

562536
[
563-
564-
[ function( cat, left_morphism, right_morphism )
565-
566-
return PresentationMorphism( Source( left_morphism ), UnderlyingMatrix( right_morphism ) * UnderlyingMatrix( left_morphism ), Range( right_morphism ) );
567-
568-
end, [ ] ],
569-
570537
[ function( cat, left_morphism, identity_morphism )
571538

572539
return left_morphism;

ModulePresentationsForCAP/gap/precompiled_categories/LeftPresentationsAsFreydCategoryOfCategoryOfRowsOfArbitraryRingPrecompiled.gi

+30
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,25 @@ end
129129

130130
, 100 );
131131

132+
##
133+
AddIsEqualForObjects( cat,
134+
135+
########
136+
function ( cat_1, arg2_1, arg3_1 )
137+
local deduped_1_1, deduped_2_1;
138+
deduped_2_1 := UnderlyingMatrix( arg3_1 );
139+
deduped_1_1 := UnderlyingMatrix( arg2_1 );
140+
if NumberRows( deduped_1_1 ) = NumberRows( deduped_2_1 ) and NumberColumns( deduped_1_1 ) = NumberColumns( deduped_2_1 ) then
141+
return deduped_1_1 = deduped_2_1;
142+
else
143+
return false;
144+
fi;
145+
return;
146+
end
147+
########
148+
149+
, 100 );
150+
132151
##
133152
AddIsZeroForMorphisms( cat,
134153

@@ -140,6 +159,17 @@ end
140159

141160
, 100 );
142161

162+
##
163+
AddPreCompose( cat,
164+
165+
########
166+
function ( cat_1, alpha_1, beta_1 )
167+
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( alpha_1 ), Range( beta_1 ), UnderlyingMatrix, UnderlyingMatrix( alpha_1 ) * UnderlyingMatrix( beta_1 ) );
168+
end
169+
########
170+
171+
, 100 );
172+
143173
##
144174
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat,
145175

ModulePresentationsForCAP/gap/precompiled_categories/LeftPresentationsAsFreydCategoryOfCategoryOfRowsOfCommutativeRingPrecompiled.gi

+30
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,25 @@ end
129129

130130
, 100 );
131131

132+
##
133+
AddIsEqualForObjects( cat,
134+
135+
########
136+
function ( cat_1, arg2_1, arg3_1 )
137+
local deduped_1_1, deduped_2_1;
138+
deduped_2_1 := UnderlyingMatrix( arg3_1 );
139+
deduped_1_1 := UnderlyingMatrix( arg2_1 );
140+
if NumberRows( deduped_1_1 ) = NumberRows( deduped_2_1 ) and NumberColumns( deduped_1_1 ) = NumberColumns( deduped_2_1 ) then
141+
return deduped_1_1 = deduped_2_1;
142+
else
143+
return false;
144+
fi;
145+
return;
146+
end
147+
########
148+
149+
, 100 );
150+
132151
##
133152
AddIsZeroForMorphisms( cat,
134153

@@ -140,6 +159,17 @@ end
140159

141160
, 100 );
142161

162+
##
163+
AddPreCompose( cat,
164+
165+
########
166+
function ( cat_1, alpha_1, beta_1 )
167+
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( alpha_1 ), Range( beta_1 ), UnderlyingMatrix, UnderlyingMatrix( alpha_1 ) * UnderlyingMatrix( beta_1 ) );
168+
end
169+
########
170+
171+
, 100 );
172+
143173
##
144174
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat,
145175

ModulePresentationsForCAP/gap/precompiled_categories/LeftPresentationsAsFreydCategoryOfCategoryOfRowsOfFieldPrecompiled.gi

+30
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,25 @@ end
129129

130130
, 100 );
131131

132+
##
133+
AddIsEqualForObjects( cat,
134+
135+
########
136+
function ( cat_1, arg2_1, arg3_1 )
137+
local deduped_1_1, deduped_2_1;
138+
deduped_2_1 := UnderlyingMatrix( arg3_1 );
139+
deduped_1_1 := UnderlyingMatrix( arg2_1 );
140+
if NumberRows( deduped_1_1 ) = NumberRows( deduped_2_1 ) and NumberColumns( deduped_1_1 ) = NumberColumns( deduped_2_1 ) then
141+
return deduped_1_1 = deduped_2_1;
142+
else
143+
return false;
144+
fi;
145+
return;
146+
end
147+
########
148+
149+
, 100 );
150+
132151
##
133152
AddIsZeroForMorphisms( cat,
134153

@@ -140,6 +159,17 @@ end
140159

141160
, 100 );
142161

162+
##
163+
AddPreCompose( cat,
164+
165+
########
166+
function ( cat_1, alpha_1, beta_1 )
167+
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( alpha_1 ), Range( beta_1 ), UnderlyingMatrix, UnderlyingMatrix( alpha_1 ) * UnderlyingMatrix( beta_1 ) );
168+
end
169+
########
170+
171+
, 100 );
172+
143173
##
144174
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat,
145175

ModulePresentationsForCAP/gap/precompiled_categories/RightPresentationsAsFreydCategoryOfCategoryOfColumnsOfArbitraryRingPrecompiled.gi

+30
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,25 @@ end
129129

130130
, 100 );
131131

132+
##
133+
AddIsEqualForObjects( cat,
134+
135+
########
136+
function ( cat_1, arg2_1, arg3_1 )
137+
local deduped_1_1, deduped_2_1;
138+
deduped_2_1 := UnderlyingMatrix( arg3_1 );
139+
deduped_1_1 := UnderlyingMatrix( arg2_1 );
140+
if NumberColumns( deduped_1_1 ) = NumberColumns( deduped_2_1 ) and NumberRows( deduped_1_1 ) = NumberRows( deduped_2_1 ) then
141+
return deduped_1_1 = deduped_2_1;
142+
else
143+
return false;
144+
fi;
145+
return;
146+
end
147+
########
148+
149+
, 100 );
150+
132151
##
133152
AddIsZeroForMorphisms( cat,
134153

@@ -140,6 +159,17 @@ end
140159

141160
, 100 );
142161

162+
##
163+
AddPreCompose( cat,
164+
165+
########
166+
function ( cat_1, alpha_1, beta_1 )
167+
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( alpha_1 ), Range( beta_1 ), UnderlyingMatrix, UnderlyingMatrix( beta_1 ) * UnderlyingMatrix( alpha_1 ) );
168+
end
169+
########
170+
171+
, 100 );
172+
143173
##
144174
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat,
145175

ModulePresentationsForCAP/gap/precompiled_categories/RightPresentationsAsFreydCategoryOfCategoryOfColumnsOfCommutativeRingPrecompiled.gi

+30
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,25 @@ end
129129

130130
, 100 );
131131

132+
##
133+
AddIsEqualForObjects( cat,
134+
135+
########
136+
function ( cat_1, arg2_1, arg3_1 )
137+
local deduped_1_1, deduped_2_1;
138+
deduped_2_1 := UnderlyingMatrix( arg3_1 );
139+
deduped_1_1 := UnderlyingMatrix( arg2_1 );
140+
if NumberColumns( deduped_1_1 ) = NumberColumns( deduped_2_1 ) and NumberRows( deduped_1_1 ) = NumberRows( deduped_2_1 ) then
141+
return deduped_1_1 = deduped_2_1;
142+
else
143+
return false;
144+
fi;
145+
return;
146+
end
147+
########
148+
149+
, 100 );
150+
132151
##
133152
AddIsZeroForMorphisms( cat,
134153

@@ -140,6 +159,17 @@ end
140159

141160
, 100 );
142161

162+
##
163+
AddPreCompose( cat,
164+
165+
########
166+
function ( cat_1, alpha_1, beta_1 )
167+
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( alpha_1 ), Range( beta_1 ), UnderlyingMatrix, UnderlyingMatrix( beta_1 ) * UnderlyingMatrix( alpha_1 ) );
168+
end
169+
########
170+
171+
, 100 );
172+
143173
##
144174
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat,
145175

0 commit comments

Comments
 (0)