Skip to content

Commit

Permalink
Move operations to compile
Browse files Browse the repository at this point in the history
and compile IsEqualForObjects and PreCompose
  • Loading branch information
Tom Kuhmichel authored and zickgraf committed Feb 27, 2023
1 parent 9283a17 commit 56b0ee4
Show file tree
Hide file tree
Showing 8 changed files with 203 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,52 +19,52 @@ EEE := KoszulDualRing( QQxy * "a,b" );;
operations_for_arbitrary_ring := [
"AdditionForMorphisms",
"AdditiveInverseForMorphisms",
#"AssociatorLeftToRightWithGivenTensorProducts",
#"AssociatorRightToLeftWithGivenTensorProducts",
#"BraidingWithGivenTensorProducts",
#"CoevaluationMorphismWithGivenRange",
"CokernelColiftWithGivenCokernelObject",
"CokernelProjection",
#"Colift",
#"ColiftOrFail",
"DirectSum",
"EpimorphismFromSomeProjectiveObject",
#"EvaluationMorphismWithGivenSource",
"IdentityMorphism",
"InjectionOfCofactorOfDirectSumWithGivenDirectSum",
#"InternalHomOnMorphismsWithGivenInternalHoms",
#"InternalHomOnObjects",
#"IsColiftable",
"IsCongruentForMorphisms",
"IsEqualForMorphisms",
#"IsEqualForObjects",
#"IsLiftable",
"IsEqualForObjects",
#"IsWellDefinedForMorphisms",
#"IsWellDefinedForObjects",
"IsZeroForMorphisms",
#"KernelEmbedding",
#"LeftUnitorWithGivenTensorProduct",
#"Lift",
#"LiftAlongMonomorphism",
#"LiftOrFail",
#"MultiplyWithElementOfCommutativeRingForMorphisms",
#"PreCompose",
"PreCompose",
"ProjectionInFactorOfDirectSumWithGivenDirectSum",
#"RightUnitorWithGivenTensorProduct",
#"TensorProductOnMorphismsWithGivenTensorProducts",
#"TensorProductOnObjects",
#"TensorUnit",
"UniversalMorphismFromDirectSumWithGivenDirectSum",
"UniversalMorphismFromZeroObjectWithGivenZeroObject",
"UniversalMorphismIntoDirectSumWithGivenDirectSum",
"UniversalMorphismIntoZeroObjectWithGivenZeroObject",
"ZeroMorphism",
"ZeroObject"
"ZeroObject",
];;

operations_for_commutative_ring := Concatenation(
operations_for_arbitrary_ring,
[ "MultiplyWithElementOfCommutativeRingForMorphisms" ]
[ #"AssociatorLeftToRightWithGivenTensorProducts",
#"AssociatorRightToLeftWithGivenTensorProducts",
#"BraidingWithGivenTensorProducts",
#"CoevaluationMorphismWithGivenRange",
#"Colift",
#"ColiftOrFail",
#"EvaluationMorphismWithGivenSource",
#"InternalHomOnMorphismsWithGivenInternalHoms",
#"InternalHomOnObjects",
#"IsColiftable",
#"IsLiftable",
#"LeftUnitorWithGivenTensorProduct",
#"Lift",
#"LiftOrFail",
"MultiplyWithElementOfCommutativeRingForMorphisms",
#"RightUnitorWithGivenTensorProduct",
#"TensorProductOnMorphismsWithGivenTensorProducts",
#"TensorProductOnObjects",
#"TensorUnit",
]
);;

precompile_LeftPresentations := function( ring, name, operations )
Expand Down
33 changes: 0 additions & 33 deletions ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gi
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ InstallGlobalFunction( ADD_FUNCTIONS_FOR_LEFT_PRESENTATION,
# has special cases
ADD_PRECOMPOSE_LEFT( category );

# simpler than the compiled version
ADD_EQUAL_FOR_OBJECTS( category );

# IsWellDefined* should not be compiled
ADD_IS_WELL_DEFINED_FOR_OBJECTS( category );

Expand Down Expand Up @@ -274,8 +271,6 @@ InstallGlobalFunction( ADD_FUNCTIONS_FOR_RIGHT_PRESENTATION,

ADD_PRECOMPOSE_RIGHT( category );

ADD_EQUAL_FOR_OBJECTS( category );

ADD_IS_WELL_DEFINED_FOR_OBJECTS( category );

ADD_IS_WELL_DEFINED_FOR_MORPHISM_RIGHT( category );
Expand Down Expand Up @@ -394,21 +389,6 @@ InstallGlobalFunction( ADD_IS_WELL_DEFINED_FOR_MORPHISM_RIGHT,

end );

##
InstallGlobalFunction( ADD_EQUAL_FOR_OBJECTS,

function( category )

AddIsEqualForObjects( category,

function( cat, object1, object2 )

return UnderlyingMatrix( object1 ) = UnderlyingMatrix( object2 );

end );

end );

##
InstallGlobalFunction( ADD_KERNEL_LEFT,

Expand Down Expand Up @@ -510,12 +490,6 @@ InstallGlobalFunction( ADD_PRECOMPOSE_LEFT,
AddPreCompose( category,

[
[ function( cat, left_morphism, right_morphism )

return PresentationMorphism( Source( left_morphism ), UnderlyingMatrix( left_morphism ) * UnderlyingMatrix( right_morphism ), Range( right_morphism ) );

end, [ ] ],

[ function( cat, left_morphism, identity_morphism )

return left_morphism;
Expand Down Expand Up @@ -560,13 +534,6 @@ InstallGlobalFunction( ADD_PRECOMPOSE_RIGHT,
AddPreCompose( category,

[

[ function( cat, left_morphism, right_morphism )

return PresentationMorphism( Source( left_morphism ), UnderlyingMatrix( right_morphism ) * UnderlyingMatrix( left_morphism ), Range( right_morphism ) );

end, [ ] ],

[ function( cat, left_morphism, identity_morphism )

return left_morphism;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,25 @@ end

, 100 );

##
AddIsEqualForObjects( cat,

########
function ( cat_1, arg2_1, arg3_1 )
local deduped_1_1, deduped_2_1;
deduped_2_1 := UnderlyingMatrix( arg3_1 );
deduped_1_1 := UnderlyingMatrix( arg2_1 );
if NumberRows( deduped_1_1 ) = NumberRows( deduped_2_1 ) and NumberColumns( deduped_1_1 ) = NumberColumns( deduped_2_1 ) then
return deduped_1_1 = deduped_2_1;
else
return false;
fi;
return;
end
########

, 100 );

##
AddIsZeroForMorphisms( cat,

Expand All @@ -140,6 +159,17 @@ end

, 100 );

##
AddPreCompose( cat,

########
function ( cat_1, alpha_1, beta_1 )
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( alpha_1 ), Range( beta_1 ), UnderlyingMatrix, UnderlyingMatrix( alpha_1 ) * UnderlyingMatrix( beta_1 ) );
end
########

, 100 );

##
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,25 @@ end

, 100 );

##
AddIsEqualForObjects( cat,

########
function ( cat_1, arg2_1, arg3_1 )
local deduped_1_1, deduped_2_1;
deduped_2_1 := UnderlyingMatrix( arg3_1 );
deduped_1_1 := UnderlyingMatrix( arg2_1 );
if NumberRows( deduped_1_1 ) = NumberRows( deduped_2_1 ) and NumberColumns( deduped_1_1 ) = NumberColumns( deduped_2_1 ) then
return deduped_1_1 = deduped_2_1;
else
return false;
fi;
return;
end
########

, 100 );

##
AddIsZeroForMorphisms( cat,

Expand All @@ -140,6 +159,17 @@ end

, 100 );

##
AddPreCompose( cat,

########
function ( cat_1, alpha_1, beta_1 )
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( alpha_1 ), Range( beta_1 ), UnderlyingMatrix, UnderlyingMatrix( alpha_1 ) * UnderlyingMatrix( beta_1 ) );
end
########

, 100 );

##
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,25 @@ end

, 100 );

##
AddIsEqualForObjects( cat,

########
function ( cat_1, arg2_1, arg3_1 )
local deduped_1_1, deduped_2_1;
deduped_2_1 := UnderlyingMatrix( arg3_1 );
deduped_1_1 := UnderlyingMatrix( arg2_1 );
if NumberRows( deduped_1_1 ) = NumberRows( deduped_2_1 ) and NumberColumns( deduped_1_1 ) = NumberColumns( deduped_2_1 ) then
return deduped_1_1 = deduped_2_1;
else
return false;
fi;
return;
end
########

, 100 );

##
AddIsZeroForMorphisms( cat,

Expand All @@ -140,6 +159,17 @@ end

, 100 );

##
AddPreCompose( cat,

########
function ( cat_1, alpha_1, beta_1 )
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( alpha_1 ), Range( beta_1 ), UnderlyingMatrix, UnderlyingMatrix( alpha_1 ) * UnderlyingMatrix( beta_1 ) );
end
########

, 100 );

##
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,25 @@ end

, 100 );

##
AddIsEqualForObjects( cat,

########
function ( cat_1, arg2_1, arg3_1 )
local deduped_1_1, deduped_2_1;
deduped_2_1 := UnderlyingMatrix( arg3_1 );
deduped_1_1 := UnderlyingMatrix( arg2_1 );
if NumberColumns( deduped_1_1 ) = NumberColumns( deduped_2_1 ) and NumberRows( deduped_1_1 ) = NumberRows( deduped_2_1 ) then
return deduped_1_1 = deduped_2_1;
else
return false;
fi;
return;
end
########

, 100 );

##
AddIsZeroForMorphisms( cat,

Expand All @@ -140,6 +159,17 @@ end

, 100 );

##
AddPreCompose( cat,

########
function ( cat_1, alpha_1, beta_1 )
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( alpha_1 ), Range( beta_1 ), UnderlyingMatrix, UnderlyingMatrix( beta_1 ) * UnderlyingMatrix( alpha_1 ) );
end
########

, 100 );

##
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,25 @@ end

, 100 );

##
AddIsEqualForObjects( cat,

########
function ( cat_1, arg2_1, arg3_1 )
local deduped_1_1, deduped_2_1;
deduped_2_1 := UnderlyingMatrix( arg3_1 );
deduped_1_1 := UnderlyingMatrix( arg2_1 );
if NumberColumns( deduped_1_1 ) = NumberColumns( deduped_2_1 ) and NumberRows( deduped_1_1 ) = NumberRows( deduped_2_1 ) then
return deduped_1_1 = deduped_2_1;
else
return false;
fi;
return;
end
########

, 100 );

##
AddIsZeroForMorphisms( cat,

Expand All @@ -140,6 +159,17 @@ end

, 100 );

##
AddPreCompose( cat,

########
function ( cat_1, alpha_1, beta_1 )
return CreateCapCategoryMorphismWithAttributes( cat_1, Source( alpha_1 ), Range( beta_1 ), UnderlyingMatrix, UnderlyingMatrix( beta_1 ) * UnderlyingMatrix( alpha_1 ) );
end
########

, 100 );

##
AddProjectionInFactorOfDirectSumWithGivenDirectSum( cat,

Expand Down
Loading

0 comments on commit 56b0ee4

Please sign in to comment.