From 475f6909b77687c6547906668d6b3a8bcc02af8c Mon Sep 17 00:00:00 2001 From: Tom Kuhmichel Date: Wed, 31 Aug 2022 15:01:16 +0200 Subject: [PATCH] Remove code in ModulePresenationsForCAP and adjust examples --- .../ModulePresentationsMonoidalCategory.g | 20 +- .../examples/MonoidalStructure.g | 8 +- .../gap/ModulePresentationsForCAP.gd | 40 -- .../gap/ModulePresentationsForCAP.gi | 620 ------------------ 4 files changed, 14 insertions(+), 674 deletions(-) diff --git a/CAP/examples/ModulePresentationsMonoidalCategory.g b/CAP/examples/ModulePresentationsMonoidalCategory.g index da4fb01cce..a0f7f42635 100644 --- a/CAP/examples/ModulePresentationsMonoidalCategory.g +++ b/CAP/examples/ModulePresentationsMonoidalCategory.g @@ -13,8 +13,8 @@ Nl := AsLeftPresentation( HomalgMatrix( [ [ 3 ] ], 1, 1, ZZ ) ); Tl := TensorProductOnObjects( Ml, Nl ); #! Display( UnderlyingMatrix( Tl ) ); -#! [ [ 3 ], -#! [ 2 ] ] +#! [ [ 2 ], +#! [ 3 ] ] IsZeroForObjects( Tl ); #! true Bl := Braiding( DirectSum( Ml, Nl ), DirectSum( Ml, Ml ) ); @@ -38,15 +38,15 @@ generator_l1 := StandardGeneratorMorphism( IntHoml, 1 ); morphism_l1 := LambdaElimination( DirectSum( Ml, Ul ), Nl, generator_l1 ); #! Display( UnderlyingMatrix( morphism_l1 ) ); -#! [ [ -3 ], -#! [ 2 ] ] +#! [ [ -84 ], +#! [ -196 ] ] generator_l2 := StandardGeneratorMorphism( IntHoml, 2 ); #! morphism_l2 := LambdaElimination( DirectSum( Ml, Ul ), Nl, generator_l2 ); #! Display( UnderlyingMatrix( morphism_l2 ) ); -#! [ [ 0 ], -#! [ -1 ] ] +#! [ [ -39 ], +#! [ -91 ] ] IsEqualForMorphisms( LambdaIntroduction( morphism_l1 ), generator_l1 ); #! false IsCongruentForMorphisms( LambdaIntroduction( morphism_l1 ), generator_l1 ); @@ -62,7 +62,7 @@ Nr := AsRightPresentation( HomalgMatrix( [ [ 3 ] ], 1, 1, ZZ ) ); Tr := TensorProductOnObjects( Mr, Nr ); #! Display( UnderlyingMatrix( Tr ) ); -#! [ [ 3, 2 ] ] +#! [ [ 2, 3 ] ] IsZeroForObjects( Tr ); #! true Br := Braiding( DirectSum( Mr, Nr ), DirectSum( Mr, Mr ) ); @@ -86,14 +86,14 @@ generator_r1 := StandardGeneratorMorphism( IntHomr, 1 ); morphism_r1 := LambdaElimination( DirectSum( Mr, Ur ), Nr, generator_r1 ); #! Display( UnderlyingMatrix( morphism_r1 ) ); -#! [ [ -3, 2 ] ] +#! [ [ -84, -196 ] ] generator_r2 := StandardGeneratorMorphism( IntHoml, 2 ); #! morphism_r2 := LambdaElimination( DirectSum( Ml, Ul ), Nl, generator_r2 ); #! Display( UnderlyingMatrix( morphism_r2 ) ); -#! [ [ 0 ], -#! [ -1 ] ] +#! [ [ -39 ], +#! [ -91 ] ] IsEqualForMorphisms( LambdaIntroduction( morphism_r1 ), generator_r1 ); #! false IsCongruentForMorphisms( LambdaIntroduction( morphism_r1 ), generator_r1 ); diff --git a/ModulePresentationsForCAP/examples/MonoidalStructure.g b/ModulePresentationsForCAP/examples/MonoidalStructure.g index 0544f86a85..6a1aef1b4d 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 ] ] +#! [ [ 236554, 0 ], +#! [ 78415, 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 7a5a7f9a45..9efe66ed59 100644 --- a/ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gi +++ b/ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gi @@ -237,27 +237,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 ); @@ -279,26 +258,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 ); @@ -568,585 +527,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 )