diff --git a/ModulePresentationsForCAP/examples/MonoidalStructure.g b/ModulePresentationsForCAP/examples/MonoidalStructure.g index 0544f86a85..52f26d9c0d 100644 --- a/ModulePresentationsForCAP/examples/MonoidalStructure.g +++ b/ModulePresentationsForCAP/examples/MonoidalStructure.g @@ -15,8 +15,8 @@ N := AsLeftPresentation( HomalgMatrix( [ [ 3 ] ], 1, 1, R ) ); T := TensorProductOnObjects( M, N ); #! Display( T ); -#! [ [ 3 ], -#! [ 2 ] ] +#! [ [ 2 ], +#! [ 3 ] ] #! #! An object in Category of left presentations of Z IsZero( T ); @@ -37,8 +37,8 @@ l := LambdaElimination( DirectSum( M, M ), DirectSum( M, N ), alpha ); IsZero( l ); #! false Display( l ); -#! [ [ -2, 6 ], -#! [ -1, -3 ] ] +#! [ [ 2406, 0 ], +#! [ 171, 0 ] ] #! #! A morphism in Category of left presentations of Z #! @EndExample diff --git a/ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gd b/ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gd index 1a91bc08c4..7b260cffee 100644 --- a/ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gd +++ b/ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gd @@ -67,23 +67,6 @@ DeclareGlobalFunction( "ADD_PRECOMPOSE_LEFT" ); DeclareGlobalFunction( "ADD_IS_WELL_DEFINED_FOR_MORPHISM_LEFT" ); -DeclareGlobalFunction( "ADD_TENSOR_PRODUCT_ON_OBJECTS_LEFT" ); - -DeclareGlobalFunction( "ADD_TENSOR_UNIT_LEFT" ); - -DeclareGlobalFunction( "ADD_INTERNAL_HOM_ON_OBJECTS_LEFT" ); - -DeclareGlobalFunction( "ADD_INTERNAL_HOM_ON_MORPHISMS_LEFT" ); - -DeclareGlobalFunction( "ADD_BRAIDING_LEFT" ); - -DeclareGlobalFunction( "ADD_EVALUATION_MORPHISM_LEFT" ); - -DeclareGlobalFunction( "ADD_COEVALUATION_MORPHISM_LEFT" ); - -DeclareGlobalFunction( "ADD_ASSOCIATOR_LEFT" ); - - DeclareGlobalFunction( "ADD_FUNCTIONS_FOR_RIGHT_PRESENTATION" ); DeclareGlobalFunction( "ADD_KERNEL_RIGHT" ); @@ -92,31 +75,8 @@ DeclareGlobalFunction( "ADD_PRECOMPOSE_RIGHT" ); DeclareGlobalFunction( "ADD_IS_WELL_DEFINED_FOR_MORPHISM_RIGHT" ); -DeclareGlobalFunction( "ADD_TENSOR_PRODUCT_ON_OBJECTS_RIGHT" ); - -DeclareGlobalFunction( "ADD_TENSOR_UNIT_RIGHT" ); - -DeclareGlobalFunction( "ADD_INTERNAL_HOM_ON_OBJECTS_RIGHT" ); - -DeclareGlobalFunction( "ADD_INTERNAL_HOM_ON_MORPHISMS_RIGHT" ); - -DeclareGlobalFunction( "ADD_BRAIDING_RIGHT" ); - -DeclareGlobalFunction( "ADD_EVALUATION_MORPHISM_RIGHT" ); - -DeclareGlobalFunction( "ADD_COEVALUATION_MORPHISM_RIGHT" ); - -DeclareGlobalFunction( "ADD_ASSOCIATOR_RIGHT" ); - - -DeclareGlobalFunction( "ADD_UNITOR" ); - DeclareGlobalFunction( "ADD_IS_WELL_DEFINED_FOR_OBJECTS" ); -DeclareGlobalFunction( "ADD_EQUAL_FOR_OBJECTS" ); - -DeclareGlobalFunction( "ADD_TENSOR_PRODUCT_ON_MORPHISMS" ); - DeclareGlobalFunction( "ADD_LIFT_AND_COLIFT_LEFT" ); DeclareGlobalFunction( "ADD_LIFT_AND_COLIFT_RIGHT" ); diff --git a/ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gi b/ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gi index 4c2609b00c..78a6f01ba8 100644 --- a/ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gi +++ b/ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gi @@ -221,9 +221,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 ); @@ -234,27 +231,6 @@ InstallGlobalFunction( ADD_FUNCTIONS_FOR_LEFT_PRESENTATION, # differs from the compiled version ADD_LIFT_AND_COLIFT_LEFT( category ); - # this tensor structure slightly differs from the tensor structure of FreydCategory - ADD_ASSOCIATOR_LEFT( category ); - - ADD_UNITOR( category ); - - ADD_TENSOR_PRODUCT_ON_OBJECTS_LEFT( category ); - - ADD_TENSOR_PRODUCT_ON_MORPHISMS( category ); - - ADD_TENSOR_UNIT_LEFT( category ); - - ADD_INTERNAL_HOM_ON_OBJECTS_LEFT( category ); - - ADD_INTERNAL_HOM_ON_MORPHISMS_LEFT( category ); - - ADD_BRAIDING_LEFT( category ); - - ADD_EVALUATION_MORPHISM_LEFT( category ); - - ADD_COEVALUATION_MORPHISM_LEFT( category ); - fi; end ); @@ -268,8 +244,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 ); @@ -278,26 +252,6 @@ InstallGlobalFunction( ADD_FUNCTIONS_FOR_RIGHT_PRESENTATION, ADD_LIFT_AND_COLIFT_RIGHT( category ); - ADD_ASSOCIATOR_RIGHT( category ); - - ADD_UNITOR( category ); - - ADD_TENSOR_PRODUCT_ON_OBJECTS_RIGHT( category ); - - ADD_TENSOR_PRODUCT_ON_MORPHISMS( category ); - - ADD_TENSOR_UNIT_RIGHT( category ); - - ADD_INTERNAL_HOM_ON_OBJECTS_RIGHT( category ); - - ADD_INTERNAL_HOM_ON_MORPHISMS_RIGHT( category ); - - ADD_BRAIDING_RIGHT( category ); - - ADD_EVALUATION_MORPHISM_RIGHT( category ); - - ADD_COEVALUATION_MORPHISM_RIGHT( category ); - fi; end ); @@ -388,21 +342,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, @@ -503,12 +442,7 @@ 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 ) @@ -553,7 +487,7 @@ InstallGlobalFunction( ADD_PRECOMPOSE_RIGHT, AddPreCompose( category, - [ + [ [ function( cat, left_morphism, right_morphism ) @@ -595,585 +529,6 @@ InstallGlobalFunction( ADD_PRECOMPOSE_RIGHT, end ); -## -InstallGlobalFunction( ADD_ASSOCIATOR_LEFT, - - function( category ) - local homalg_ring, associator_func; - - homalg_ring := category!.ring_for_representation_category; - - associator_func := function( cat, source, A, B, C, range ) - - return PresentationMorphism( - source, - HomalgIdentityMatrix( NrColumns( UnderlyingMatrix( source ) ), NrColumns( UnderlyingMatrix( range ) ), homalg_ring ), - range - ); - - end; - - AddAssociatorLeftToRightWithGivenTensorProducts( category, - associator_func - ); - - AddAssociatorRightToLeftWithGivenTensorProducts( category, - associator_func - ); - -end ); - -## -InstallGlobalFunction( ADD_ASSOCIATOR_RIGHT, - - function( category ) - local homalg_ring, associator_func; - - homalg_ring := category!.ring_for_representation_category; - - associator_func := function( cat, source, A, B, C, range ) - - return PresentationMorphism( - source, - HomalgIdentityMatrix( NrRows( UnderlyingMatrix( source ) ), NrRows( UnderlyingMatrix( range ) ), homalg_ring ), - range - ); - - end; - - AddAssociatorLeftToRightWithGivenTensorProducts( category, - associator_func - ); - - AddAssociatorRightToLeftWithGivenTensorProducts( category, - associator_func - ); - -end ); - -## -InstallGlobalFunction( ADD_UNITOR, - - function( category ) - local unitor_func; - - unitor_func := function( cat, A, B ) - return IdentityMorphism( A ); - end; - - AddLeftUnitorWithGivenTensorProduct( category, unitor_func ); - - AddRightUnitorWithGivenTensorProduct( category, unitor_func ); - -end ); - -## -InstallGlobalFunction( ADD_TENSOR_PRODUCT_ON_OBJECTS_LEFT, - - function( category ) - local homalg_ring; - - homalg_ring := category!.ring_for_representation_category; - - AddTensorProductOnObjects( category, - - function( cat, object_1, object_2 ) - local identity_1, identity_2, presentation_matrix_1, presentation_matrix_2, presentation_matrix; - - presentation_matrix_1 := UnderlyingMatrix( object_1 ); - - presentation_matrix_2 := UnderlyingMatrix( object_2 ); - - identity_1 := - HomalgIdentityMatrix( NrColumns( presentation_matrix_1 ), homalg_ring ); - - identity_2 := - HomalgIdentityMatrix( NrColumns( presentation_matrix_2 ), homalg_ring ); - - presentation_matrix := UnionOfRows( - KroneckerMat( identity_1, presentation_matrix_2 ), - KroneckerMat( presentation_matrix_1, identity_2 ) - ); - - return AsLeftPresentation( presentation_matrix ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_TENSOR_PRODUCT_ON_OBJECTS_RIGHT, - - function( category ) - local homalg_ring; - - homalg_ring := category!.ring_for_representation_category; - - AddTensorProductOnObjects( category, - - function( cat, object_1, object_2 ) - local identity_1, identity_2, presentation_matrix_1, presentation_matrix_2, presentation_matrix; - - presentation_matrix_1 := UnderlyingMatrix( object_1 ); - - presentation_matrix_2 := UnderlyingMatrix( object_2 ); - - identity_1 := - HomalgIdentityMatrix( NrRows( presentation_matrix_1 ), homalg_ring ); - - identity_2 := - HomalgIdentityMatrix( NrRows( presentation_matrix_2 ), homalg_ring ); - - presentation_matrix := UnionOfColumns( - KroneckerMat( identity_1, presentation_matrix_2 ), - KroneckerMat( presentation_matrix_1, identity_2 ) - ); - - return AsRightPresentation( presentation_matrix ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_TENSOR_PRODUCT_ON_MORPHISMS, - - function( category ) - - AddTensorProductOnMorphismsWithGivenTensorProducts( category, - - function( cat, new_source, morphism_1, morphism_2, new_range ) - - return PresentationMorphism( new_source, - KroneckerMat( UnderlyingMatrix( morphism_1 ), UnderlyingMatrix( morphism_2 ) ), - new_range ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_TENSOR_UNIT_LEFT, - - function( category ) - local homalg_ring; - - homalg_ring := category!.ring_for_representation_category; - - AddTensorUnit( category, - - function( cat ) - - return AsLeftPresentation( HomalgZeroMatrix( 0, 1, homalg_ring ) ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_TENSOR_UNIT_RIGHT, - - function( category ) - local homalg_ring; - - homalg_ring := category!.ring_for_representation_category; - - AddTensorUnit( category, - - function( cat ) - - return AsRightPresentation( HomalgZeroMatrix( 1, 0, homalg_ring ) ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_INTERNAL_HOM_ON_OBJECTS_LEFT, - - function( category ) - - ## WARNING: The given function uses basic operations. - AddInternalHomOnObjects( category, - - function( cat, object_1, object_2 ) - - return Source( INTERNAL_HOM_EMBEDDING_IN_TENSOR_PRODUCT_LEFT( object_1, object_2 ) ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_INTERNAL_HOM_ON_OBJECTS_RIGHT, - - function( category ) - - ## WARNING: The given function uses basic operations. - AddInternalHomOnObjects( category, - - function( cat, object_1, object_2 ) - - return Source( INTERNAL_HOM_EMBEDDING_IN_TENSOR_PRODUCT_RIGHT( object_1, object_2 ) ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_INTERNAL_HOM_ON_MORPHISMS_LEFT, - - function( category ) - - ## WARNING: The given function uses basic operations. - AddInternalHomOnMorphismsWithGivenInternalHoms( category, - - function( cat, new_source, morphism_1, morphism_2, new_range ) - local internal_hom_embedding_source, internal_hom_embedding_range, morphism_between_tensor_products; - - internal_hom_embedding_source := - INTERNAL_HOM_EMBEDDING_IN_TENSOR_PRODUCT_LEFT( Range( morphism_1 ), Source( morphism_2 ) ); - - internal_hom_embedding_range := - INTERNAL_HOM_EMBEDDING_IN_TENSOR_PRODUCT_LEFT( Source( morphism_1 ), Range( morphism_2 ) ); - - morphism_between_tensor_products := - PresentationMorphism( - Range( internal_hom_embedding_source ), - KroneckerMat( TransposedMatrix( UnderlyingMatrix( morphism_1 ) ), UnderlyingMatrix( morphism_2 ) ), - Range( internal_hom_embedding_range ) - ); - - return LiftAlongMonomorphism( internal_hom_embedding_range, - PreCompose( internal_hom_embedding_source, morphism_between_tensor_products ) ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_INTERNAL_HOM_ON_MORPHISMS_RIGHT, - - function( category ) - - ## WARNING: The given function uses basic operations. - AddInternalHomOnMorphismsWithGivenInternalHoms( category, - - function( cat, new_source, morphism_1, morphism_2, new_range ) - local internal_hom_embedding_source, internal_hom_embedding_range, morphism_between_tensor_products; - - internal_hom_embedding_source := - INTERNAL_HOM_EMBEDDING_IN_TENSOR_PRODUCT_RIGHT( Range( morphism_1 ), Source( morphism_2 ) ); - - internal_hom_embedding_range := - INTERNAL_HOM_EMBEDDING_IN_TENSOR_PRODUCT_RIGHT( Source( morphism_1 ), Range( morphism_2 ) ); - - morphism_between_tensor_products := - PresentationMorphism( - Range( internal_hom_embedding_source ), - KroneckerMat( TransposedMatrix( UnderlyingMatrix( morphism_1 ) ), UnderlyingMatrix( morphism_2 ) ), - Range( internal_hom_embedding_range ) - ); - - return LiftAlongMonomorphism( internal_hom_embedding_range, - PreCompose( internal_hom_embedding_source, morphism_between_tensor_products ) ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_BRAIDING_LEFT, - - function( category ) - - AddBraidingWithGivenTensorProducts( category, - - function( cat, object_1_tensored_object_2, object_1, object_2, object_2_tensored_object_1 ) - local homalg_ring, permutation_matrix, rank_1, rank_2, rank; - - homalg_ring := UnderlyingHomalgRing( object_1 ); - - rank_1 := NrColumns( UnderlyingMatrix( object_1 ) ); - - rank_2 := NrColumns( UnderlyingMatrix( object_2 ) ); - - rank := NrColumns( UnderlyingMatrix( object_1_tensored_object_2 ) ); - - permutation_matrix := PermutationMat( - PermList( List( [ 1 .. rank ], i -> ( RemInt( i - 1, rank_2 ) * rank_1 + QuoInt( i - 1, rank_2 ) + 1 ) ) ), - rank - ); - - return PresentationMorphism( object_1_tensored_object_2, - HomalgMatrix( permutation_matrix, rank, rank, homalg_ring ), - object_2_tensored_object_1 ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_BRAIDING_RIGHT, - - function( category ) - - AddBraidingWithGivenTensorProducts( category, - - function( cat, object_1_tensored_object_2, object_1, object_2, object_2_tensored_object_1 ) - local homalg_ring, permutation_matrix, rank_1, rank_2, rank; - - homalg_ring := UnderlyingHomalgRing( object_1 ); - - rank_1 := NrRows( UnderlyingMatrix( object_1 ) ); - - rank_2 := NrRows( UnderlyingMatrix( object_2 ) ); - - rank := NrRows( UnderlyingMatrix( object_1_tensored_object_2 ) ); - - permutation_matrix := PermutationMat( - PermList( List( [ 1 .. rank ], i -> ( RemInt( i - 1, rank_2 ) * rank_1 + QuoInt( i - 1, rank_2 ) + 1 ) ) ), - rank - ); - - return PresentationMorphism( object_1_tensored_object_2, - TransposedMatrix( HomalgMatrix( permutation_matrix, rank, rank, homalg_ring ) ), ## transposed of the left case - object_2_tensored_object_1 ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_EVALUATION_MORPHISM_LEFT, - - function( category ) - local homalg_ring; - - homalg_ring := category!.ring_for_representation_category; - - AddEvaluationMorphismWithGivenSource( category, - - function( cat, object_1, object_2, internal_hom_tensored_object_1 ) - local internal_hom_embedding, rank_1, morphism, free_module, - column, zero_column, i, matrix, rank_2, lifted_evaluation; - - internal_hom_embedding := INTERNAL_HOM_EMBEDDING_IN_TENSOR_PRODUCT_LEFT( object_1, object_2 ); - - rank_1 := NrColumns( UnderlyingMatrix( object_1 ) ); - - free_module := FreeLeftPresentation( rank_1, homalg_ring ); - - morphism := PreCompose( internal_hom_embedding, Braiding( free_module, object_2 ) ); - - morphism := TensorProductOnMorphisms( morphism, IdentityMorphism( object_1 ) ); - - ## Computation of F^{\vee} \otimes F \rightarrow 1 - column := [ ]; - - zero_column := List( [ 1 .. rank_1 ], i -> 0 ); - - for i in [ 1 .. rank_1 - 1 ] do - - Add( column, 1 ); - - Append( column, zero_column ); - - od; - - if rank_1 > 0 then - - Add( column, 1 ); - - fi; - - matrix := HomalgMatrix( column, rank_1 * rank_1, 1, homalg_ring ); - - rank_2 := NrColumns( UnderlyingMatrix( object_2 ) ); - - matrix := KroneckerMat( HomalgIdentityMatrix( rank_2, homalg_ring ), matrix ); - - lifted_evaluation := PresentationMorphism( Range( morphism ), matrix, object_2 ); - - return PreCompose( morphism, lifted_evaluation ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_EVALUATION_MORPHISM_RIGHT, - - function( category ) - local homalg_ring; - - homalg_ring := category!.ring_for_representation_category; - - AddEvaluationMorphismWithGivenSource( category, - - function( cat, object_1, object_2, internal_hom_tensored_object_1 ) - local internal_hom_embedding, rank_1, morphism, free_module, - row, zero_row, i, matrix, rank_2, lifted_evaluation; - - internal_hom_embedding := INTERNAL_HOM_EMBEDDING_IN_TENSOR_PRODUCT_RIGHT( object_1, object_2 ); - - rank_1 := NrRows( UnderlyingMatrix( object_1 ) ); - - free_module := FreeRightPresentation( rank_1, homalg_ring ); - - morphism := PreCompose( internal_hom_embedding, Braiding( free_module, object_2 ) ); - - morphism := TensorProductOnMorphisms( morphism, IdentityMorphism( object_1 ) ); - - ## Construction of F^{\vee} \otimes F \rightarrow 1 - row := [ ]; - - zero_row := List( [ 1 .. rank_1 ], i -> 0 ); - - for i in [ 1 .. rank_1 - 1 ] do - - Add( row, 1 ); - - Append( row, zero_row ); - - od; - - if rank_1 > 0 then - - Add( row, 1 ); - - fi; - - matrix := HomalgMatrix( row, 1, rank_1 * rank_1, homalg_ring ); - - rank_2 := NrRows( UnderlyingMatrix( object_2 ) ); - - matrix := KroneckerMat( HomalgIdentityMatrix( rank_2, homalg_ring ), matrix ); - - lifted_evaluation := PresentationMorphism( Range( morphism ), matrix, object_2 ); - - return PreCompose( morphism, lifted_evaluation ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_COEVALUATION_MORPHISM_LEFT, - - function( category ) - local homalg_ring; - - homalg_ring := category!.ring_for_representation_category; - - AddCoevaluationMorphismWithGivenRange( category, - - function( cat, object_1, object_2, internal_hom ) - local object_1_tensored_object_2, internal_hom_embedding, rank_2, free_module, morphism, - row, zero_row, i, matrix, rank_1, lifted_coevaluation; - - object_1_tensored_object_2 := TensorProductOnObjects( object_1, object_2 ); - - internal_hom_embedding := INTERNAL_HOM_EMBEDDING_IN_TENSOR_PRODUCT_LEFT( object_2, object_1_tensored_object_2 ); - - rank_2 := NrColumns( UnderlyingMatrix( object_2 ) ); - - free_module := FreeLeftPresentation( rank_2, homalg_ring ); - - morphism := PreCompose( internal_hom_embedding, Braiding( free_module, object_1_tensored_object_2 ) ); - - ## Construction of 1 \rightarrow F \otimes F^{\vee} - - row := [ ]; - - zero_row := List( [ 1 .. rank_2 ], i -> 0 ); - - for i in [ 1 .. rank_2 - 1 ] do - - Add( row, 1 ); - - Append( row, zero_row ); - - od; - - if rank_2 > 0 then - - Add( row, 1 ); - - fi; - - matrix := HomalgMatrix( row, 1, rank_2 * rank_2, homalg_ring ); - - rank_1 := NrColumns( UnderlyingMatrix( object_1 ) ); - - matrix := KroneckerMat( HomalgIdentityMatrix( rank_1, homalg_ring ), matrix ); - - lifted_coevaluation := PresentationMorphism( object_1, matrix, Range( morphism ) ); - - return LiftAlongMonomorphism( morphism, lifted_coevaluation ); - - end ); - -end ); - -## -InstallGlobalFunction( ADD_COEVALUATION_MORPHISM_RIGHT, - - function( category ) - local homalg_ring; - - homalg_ring := category!.ring_for_representation_category; - - AddCoevaluationMorphismWithGivenRange( category, - - function( cat, object_1, object_2, internal_hom ) - local object_1_tensored_object_2, internal_hom_embedding, rank_2, free_module, morphism, - column, zero_column, i, matrix, rank_1, lifted_coevaluation; - - object_1_tensored_object_2 := TensorProductOnObjects( object_1, object_2 ); - - internal_hom_embedding := INTERNAL_HOM_EMBEDDING_IN_TENSOR_PRODUCT_RIGHT( object_2, object_1_tensored_object_2 ); - - rank_2 := NrRows( UnderlyingMatrix( object_2 ) ); - - free_module := FreeRightPresentation( rank_2, homalg_ring ); - - morphism := PreCompose( internal_hom_embedding, Braiding( free_module, object_1_tensored_object_2 ) ); - - ## Construction of 1 \rightarrow F \otimes F^{\vee} - - column := [ ]; - - zero_column := List( [ 1 .. rank_2 ], i -> 0 ); - - for i in [ 1 .. rank_2 - 1 ] do - - Add( column, 1 ); - - Append( column, zero_column ); - - od; - - if rank_2 > 0 then - - Add( column, 1 ); - - fi; - - matrix := HomalgMatrix( column, rank_2 * rank_2, 1, homalg_ring ); - - rank_1 := NrRows( UnderlyingMatrix( object_1 ) ); - - matrix := KroneckerMat( HomalgIdentityMatrix( rank_1, homalg_ring ), matrix ); - - lifted_coevaluation := PresentationMorphism( object_1, matrix, Range( morphism ) ); - - return LiftAlongMonomorphism( morphism, lifted_coevaluation ); - - end ); - -end ); - InstallGlobalFunction( ADD_LIFT_AND_COLIFT_LEFT, function( category )