diff --git a/FreydCategoriesForCAP/examples/FreydCategoryOfGradedRowsAndColumns.g b/FreydCategoriesForCAP/examples/FreydCategoryOfGradedRowsAndColumns.g index 03e31b75c8..775cfd66d5 100644 --- a/FreydCategoriesForCAP/examples/FreydCategoryOfGradedRowsAndColumns.g +++ b/FreydCategoriesForCAP/examples/FreydCategoryOfGradedRowsAndColumns.g @@ -386,6 +386,186 @@ IsMonomorphism( coeval ); #! @EndExample +################################################################# +#! @Section Tools for Freyd category of graded rows +################################################################# + +#! We have introduced functionality, to easily compute tensor products. +#! Namely, * surves as tensor product among objects and morphisms in Freyd. +#! In case the n-th tensor product of an object with itself is desired, we can just use ^n. + +#! @Example +power_obj2 := axKbxcK * axKbxcK; +#! +power_obj3 := axKbxcK^3; +#! +power_mor2 := coeval * coeval; +#! +power_mor3 := coeval^3; +#! +#! @EndExample + +#! Also, we can compute Frobenius powers of objects. + +#! @Example +frob0 := FrobeniusPowerOfFPGradedModule( axKbxcK, 0 ); +#! +frob1 := FrobeniusPowerOfFPGradedModule( axKbxcK, 1 ); +#! +frob2 := FrobeniusPowerOfFPGradedModule( axKbxcK, 2 ); +#! +#! @EndExample + + +################################################################# +#! @Section Functors for Freyd category of graded rows +################################################################# + +#! A f.p. graded module admits many presentations. For computational efficiency, those +#! presentations, which are easiest/quickest to perform computations by, are of particular interest. +#! For example we have + +#! @Log +Display( power_obj2 ); +#! An object in Category of f.p. graded left modules over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! +#! Relation morphism: +#! A morphism in Category of graded rows over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! +#! Source: +#! A graded row over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! of rank 64 and degrees: [ [ ( 8, 8 ), 64 ]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,1,1, +#! 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0, +#! 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1 +#! (over a graded ring) +#! +#! Range: +#! A graded row over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! of rank 16 and degrees: [ [ ( 8, 8 ), 16 ] ] +#! @EndLog + +#! But we can find a better presentation. Namely, +#! @Example +reduced_power_obj2 := ByASmallerPresentation( power_obj2 ); +#! +#! @EndExample + +#! Namely, this module is now presented as follows: + +#! @BeginLog +Display( reduced_power_obj2 ); +#! An object in Category of f.p. graded left modules over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! +#! Relation morphism: +#! A morphism in Category of graded rows over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! +#! Source: +#! A graded row over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! of rank 0 and degrees: [ ] +#! +#! Matrix: +#! (an empty 1 x 0 matrix) +#! +#! Range: +#! A graded row over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! of rank 1 and degrees: [ [ ( 8, 8 ), 1 ] ] +#! @EndLog + +#! This functionality is available as a functor, along with other functors: + +#! @Example +FunctorLessGradedGeneratorsLeft( S ); +#! Less generators for Category of f.p. graded left modules +#! over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +FunctorGradedStandardModuleLeft( S ); +#! Graded standard module for Category of f.p. graded left modules +#! over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +FunctorByASmallerPresentationLeft( S ); +#! ByASmallerPresentation for Category of f.p. graded +#! left modules over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! @EndExample + +#! We also provide the natural isomorphism between +#! the identity functor and the standard module functor, namely + +#! @BeginExample +NaturalIsomorphismFromIdentityToGradedStandardModuleLeft( S ); +#! Natural isomorphism from Id to Graded standard module for +#! Category of f.p. graded left modules over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! @EndExample + +#! There are also some functors which we provide for all Freyd categories. +#! Examples include the embedding functor of the additive category in its +#! Freyd category and the best projective approximation functor. + +#! @BeginExample +EmbeddingIntoFreydCategory( cat ); +#! Embedding functor of Category of graded rows over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! into its Freyd category +BestProjectiveApproximationFunctor( cat ); +#! Best projective approximation functor of the Freyd category +#! of Category of graded rows over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +BestEmbeddedProjectiveApproximationFunctor( cat ); +#! Best embedded projective approximation functor of the Freyd category +#! of Category of graded rows over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! @EndExample + + ################################################################# #! @Section Freyd category of graded columns ################################################################# @@ -762,3 +942,185 @@ IsEpimorphism( coeval ); IsMonomorphism( coeval ); #! true #! @EndExample + + +################################################################# +#! @Section Tools for Freyd category of graded columns +################################################################# + +#! Note that we have introduced some neat functionality, to easily compute tensor products. +#! Namely, * surves as tensor product among objects and morphisms in Freyd. +#! In case the n-th tensor product of an object with itself is desired, we can just use ^n. + +#! @Example +power_obj2 := axKbxcK * axKbxcK; +#! +power_obj3 := axKbxcK^3; +#! +power_mor2 := coeval * coeval; +#! +power_mor3 := coeval^3; +#! +#! @EndExample + +#! Also, we can compute Frobenius powers of objects. + +#! @Example +frob0 := FrobeniusPowerOfFPGradedModule( axKbxcK, 0 ); +#! +frob1 := FrobeniusPowerOfFPGradedModule( axKbxcK, 1 ); +#! +frob2 := FrobeniusPowerOfFPGradedModule( axKbxcK, 2 ); +#! +#! @EndExample + + +################################################################# +#! @Section Functors for Freyd category of graded columns +################################################################# + +#! A f.p. graded module admits many presentations. For computational efficiency, those +#! presentations, which are easiest/quickest to perform computations by, are of particular interest. +#! For example we have + +#! @Log +Display( power_obj2 ); +#! An object in Category of f.p. graded right modules over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! +#! Relation morphism: +#! A morphism in Category of graded columns over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! +#! Source: +#! A graded column over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! of rank 64 and degrees: [ [ ( 8, 8 ), 64 ] ] +#! +#! Matrix: +#! 1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,0,0, +#! 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +#! 0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0, +#! 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +#! 0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find a better presentation. Namely, + +#! @Example +reduced_power_obj2 := ByASmallerPresentation( power_obj2 ); +#! +#! @EndExample + +#! Now, this module is presented as follows: + +#! @BeginLog +Display( reduced_power_obj2 ); +#! An object in Category of f.p. graded right modules over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! +#! Relation morphism: +#! A morphism in Category of graded columns over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! +#! Source: +#! A graded column over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! of rank 0 and degrees: [ ] +#! +#! Matrix: +#! (an empty 1 x 0 matrix) +#! +#! Range: +#! A graded column over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! of rank 1 and degrees: [ [ ( 8, 8 ), 1 ] ] +#! @EndLog + +#! This functionality is available as a functor. Of course, more functors are +#! available: + +#! @Example +FunctorLessGradedGeneratorsRight( S ); +#! Less generators for Category of f.p. graded right modules +#! over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +FunctorGradedStandardModuleRight( S ); +#! Graded standard module for Category of f.p. graded right modules +#! over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +FunctorByASmallerPresentationRight( S ); +#! ByASmallerPresentation for Category of f.p. graded +#! right modules over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! @EndExample + +#! We also provide the natural isomorphism between +#! the identity functor and the standard module functor, namely + +#! @BeginExample +NaturalIsomorphismFromIdentityToGradedStandardModuleRight( S ); +#! Natural isomorphism from Id to Graded standard module for +#! Category of f.p. graded right modules over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! @EndExample + +#! There are also some functors which we provide for all Freyd categories. +#! Examples include the embedding functor of the additive category in its +#! Freyd category and the best projective approximation functor. + +#! @BeginExample +EmbeddingIntoFreydCategory( cat ); +#! Embedding functor of Category of graded columns over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! into its Freyd category +BestProjectiveApproximationFunctor( cat ); +#! Best projective approximation functor of the Freyd category +#! of Category of graded columns over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +BestEmbeddedProjectiveApproximationFunctor( cat ); +#! Best embedded projective approximation functor of the Freyd category +#! of Category of graded columns over Q[x_1,x_2,x_3,x_4] +#! (with weights [ [ 1, 0 ], [ 1, 0 ], [ 0, 1 ], [ 0, 1 ] ]) +#! @EndExample diff --git a/FreydCategoriesForCAP/gap/FreydCategory.gd b/FreydCategoriesForCAP/gap/FreydCategory.gd index 60f93a51b9..62494f19db 100644 --- a/FreydCategoriesForCAP/gap/FreydCategory.gd +++ b/FreydCategoriesForCAP/gap/FreydCategory.gd @@ -54,6 +54,7 @@ DeclareAttribute( "AsFreydCategoryObject", DeclareAttribute( "AsFreydCategoryMorphism", IsCapCategoryMorphism ); + #################################### ## #! @Section Attributes @@ -98,3 +99,94 @@ DeclareGlobalFunction( "IsValidInputForFreydCategory" ); #! @Arguments objects a, b DeclareOperationWithCache( "INTERNAL_HOM_EMBEDDING", [ IsFreydCategoryObject, IsFreydCategoryObject ] ); + + +#################################################################################### +## +#! @Section Convenient methods for tensor products of freyd objects and morphisms +## +#################################################################################### + +#! +DeclareOperation( "\*", + [ IsFreydCategoryObject, IsFreydCategoryObject ] ); + +#! +DeclareOperation( "\^", + [ IsFreydCategoryObject, IsInt ] ); + +#! +DeclareOperation( "\*", + [ IsFreydCategoryMorphism, IsFreydCategoryMorphism ] ); + +#! +DeclareOperation( "\^", + [ IsFreydCategoryMorphism, IsInt ] ); + + +#################################################### +## +#! @Section Embedding functor for additive categories +## +#################################################### + +#! @Description +#! The argument is a CapCategory $C$. Provided that $C$ admits a Freyd category, this +#! attribute will be set to be the embedding functor into this Freyd category. +#! @Returns a functor +#! @Arguments C +DeclareAttribute( "EmbeddingIntoFreydCategory", + IsCapCategory ); + + +#################################################### +## +#! @Section Functor BestProjectiveApproximation +## +#################################################### + +#! @Description +#! The argument is an object $A$ in a Freyd category. The output will be +#! the object in the underlying additive category, which serves as the best +#! approximation of the given object $A$. +#! @Returns an object in the underlying additive category +#! @Arguments A +DeclareAttribute( "BestProjectiveApproximation", + IsFreydCategoryObject ); + +#! @Description +#! The argument is an object $A$ in a Freyd category. The output will be the +#! canonical morphism from the object $A$ into this best projective +#! approximation, the latter canonically understood as object in the Freyd category. +#! @Returns a morphism in the Freyd category +#! @Arguments A +DeclareAttribute( "MorphismIntoBestProjectiveApproximation", + IsCapCategoryObject ); + +#! @Description +#! The argument is a morphism $\alpha$ in a Freyd category. The output is the +#! morphism in the underlying additive category, which best approximates $\alpha$. +#! @Returns a morphism in the underlying additive category +#! @Arguments $\alpha$ +DeclareAttribute( "BestProjectiveApproximation", + IsCapCategoryMorphism ); + +#! @Description +#! The argument is a CapCategory $C$. Provided that $C$ admits a Freyd category, this +#! attribute will be set to be the functor that maps objects and morphisms in the Freyd +#! category to their best projective approximations in the underlying additive category. +#! @Returns a functor +#! @Arguments C +DeclareAttribute( "BestProjectiveApproximationFunctor", + IsCapCategory ); + +#! @Description +#! The argument is a CapCategory $C$. Provided that $C$ admits a Freyd category, this +#! attribute will be set to be the functor that maps objects and morphisms in the Freyd +#! category to their best projective approximations in the underlying additive category. +#! In contrast to BestProjectiveApproximationFunctor, we canonically embed these projective +#! objects into the Freyd category. So this returns an autofunctor of the Freyd category. +#! @Returns a functor +#! @Arguments C +DeclareAttribute( "BestEmbeddedProjectiveApproximationFunctor", + IsCapCategory ); diff --git a/FreydCategoriesForCAP/gap/FreydCategory.gi b/FreydCategoriesForCAP/gap/FreydCategory.gi index dcd283cbbb..cfb9ecf95d 100644 --- a/FreydCategoriesForCAP/gap/FreydCategory.gi +++ b/FreydCategoriesForCAP/gap/FreydCategory.gi @@ -211,6 +211,7 @@ InstallMethod( FreydCategoryMorphism, FREYD_CATEGORY_MORPHISM ); + #################################### ## ## Attributes @@ -1639,3 +1640,284 @@ InstallGlobalFunction( IsValidInputForFreydCategory, return result; end ); + + +#################################################################################### +## +## Section Powers of objects and morphisms +## +#################################################################################### + +# for convenience allow "*" to indicate the tensor product on objects +InstallMethod( \*, + "powers of presentations", + [ IsFreydCategoryObject, IsFreydCategoryObject ], + function( freyd_object1, freyd_object2 ) + + return TensorProductOnObjects( freyd_object1, freyd_object2 ); + +end ); + +# for convenience allow "*" to indicate the tensor product on morphisms +InstallMethod( \*, + "powers of presentations", + [ IsFreydCategoryMorphism, IsFreydCategoryMorphism ], + function( freyd_morphism1, freyd_morphism2 ) + + return TensorProductOnMorphisms( freyd_morphism1, freyd_morphism2 ); + +end ); + +# allow "^p" to indicate the p-th power, i.e. p-times tensor product of an object with itself +InstallMethod( \^, + "powers of presentations", + [ IsFreydCategoryObject, IsInt ], + function( freyd_object, power ) + local res, i; + + if power < 0 then + + return Error( "The power must be non-negative! \n" ); + + elif power = 0 then + + return TensorUnit( CapCategory( freyd_object ) ); + + elif power = 1 then + + return freyd_object; + + else + + res := freyd_object; + + for i in [ 1 .. power ] do + res := res * freyd_object; + od; + + return res; + + fi; + +end ); + +# allow "^p" to indicate the p-th power, i.e. p-times tensor product of a morphism with itself +InstallMethod( \^, + "powers of presentations", + [ IsFreydCategoryMorphism, IsInt ], + function( freyd_morphism, power ) + local res, i; + + if power < 0 then + + return Error( "The power must be non-negative! \n" ); + + elif power = 0 then + + return IdentityMorphism( TensorUnit( CapCategory( freyd_morphism ) ) ); + + elif power = 1 then + + return freyd_morphism; + + else + + res := freyd_morphism; + + for i in [ 1 .. power ] do + res := res * freyd_morphism; + od; + + return res; + + fi; + + +############################################################################# +## +## Embedding of additive category into its Freyd category +## +############################################################################# + +InstallMethod( EmbeddingIntoFreydCategory, + [ IsCapCategory ], + function( additive_category ) + local freyd_category, functor; + + # check for valid input + if not IsValidInputForFreydCategory( additive_category ) then + + Error( "The input category does not admit a Freyd category" ); + return 0; + + fi; + + # define the Freyd category + freyd_category := FreydCategory( additive_category ); + + # and set up the basics of this functor + functor := CapFunctor( Concatenation( "Embedding functor of ", Name( additive_category ), + " into its Freyd category" ), + additive_category, + freyd_category + ); + + # now define the operation on the objects + AddObjectFunction( functor, + + function( object ) + + return AsFreydCategoryObject( object ); + + end ); + + # and the operation on the morphisms + AddMorphismFunction( functor, + + function( new_source, morphism, new_range ) + + return AsFreydCategoryMorphism( morphism ); + + end ); + + # and return this functor + return functor; + +end ); + + +#################################################### +## +## Section Functor BestProjectiveApproximation +## +#################################################### + +## Morhpism into best projective approximation +InstallMethod( MorphismIntoBestProjectiveApproximation, + [ IsFreydCategoryObject ], + + function( freyd_object ) + local mor; + + mor := WeakCokernelProjection( RelationMorphism( freyd_object ) ); + + return FreydCategoryMorphism( freyd_object, mor, AsFreydCategoryObject( Range( mor ) ) ); + +end ); + +## Best projective approximation of a Freyd_object +InstallMethod( BestProjectiveApproximation, + [ IsFreydCategoryObject ], + + function( freyd_object ) + + return WeakCokernelObject( RelationMorphism( freyd_object ) ); + +end ); + +## Best projective approximation of a Freyd_morphism +InstallMethod( BestProjectiveApproximation, + [ IsFreydCategoryMorphism ], + + function( freyd_mor ) + local mor1, mor2, new_mor_datum; + + mor1 := MorphismIntoBestProjectiveApproximation( Source( freyd_mor ) ); + mor2 := PreCompose( MorphismDatum( freyd_mor ), MorphismIntoBestProjectiveApproximation( Range( freyd_mor ) ) ); + + return WeakColiftAlongEpimorphism( mor1, mor2 ); + +end ); + +InstallMethod( BestProjectiveApproximationFunctor, + [ IsCapCategory ], + function( additive_category ) + local freyd_category, functor; + + # check for valid input + if not IsValidInputForFreydCategory( additive_category ) then + + Error( "The input category does not admit a Freyd category" ); + return 0; + + fi; + + # define the Freyd category + freyd_category := FreydCategory( additive_category ); + + # and set up the basics of this functor + functor := CapFunctor( Concatenation( "Best projective approximation functor of the Freyd category of ", + Name( additive_category ) ), + freyd_category, + additive_category + ); + + # now define the operation on the objects + AddObjectFunction( functor, + + function( object ) + + return BestProjectiveApproximation( object ); + + end ); + + # and the operation on the morphisms + AddMorphismFunction( functor, + + function( new_source, morphism, new_range ) + + return BestProjectiveApproximation( morphism ); + + end ); + + # and return this functor + return functor; + +end ); + + +InstallMethod( BestEmbeddedProjectiveApproximationFunctor, + [ IsCapCategory ], + function( additive_category ) + local freyd_category, functor; + + # check for valid input + if not IsValidInputForFreydCategory( additive_category ) then + + Error( "The input category does not admit a Freyd category" ); + return 0; + + fi; + + # define the Freyd category + freyd_category := FreydCategory( additive_category ); + + # and set up the basics of this functor + functor := CapFunctor( Concatenation( "Best embedded projective approximation functor of the Freyd category of ", + Name( additive_category ) ), + freyd_category, + additive_category + ); + + # now define the operation on the objects + AddObjectFunction( functor, + + function( object ) + + return AsFreydCategoryObject( BestProjectiveApproximation( object ) ); + + end ); + + # and the operation on the morphisms + AddMorphismFunction( functor, + + function( new_source, morphism, new_range ) + + return AsFreydCategoryMorphism( BestProjectiveApproximation( morphism ) ); + + end ); + + # and return this functor + return functor; + +end ); diff --git a/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydFunctors.gd b/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydFunctors.gd new file mode 100644 index 0000000000..adcabc0a2b --- /dev/null +++ b/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydFunctors.gd @@ -0,0 +1,147 @@ +############################################################################# +## +## GradedModulePresentationsbyFreyd +## +## Copyright 2019, Martin Bies, ULB Brussels +## +#! @Chapter Functors in the CAP category of graded module presentations by use of Freyd categories +## +############################################################################# + + +# an attribute for homalg_matrices, that allows to represent that matrix 'smaller' +DeclareAttribute( "LessGradedGeneratorsTransformationTripleLeft", + IsHomalgMatrix ); +DeclareAttribute( "LessGradedGeneratorsTransformationTripleRight", + IsHomalgMatrix ); + + +####################################################### +## +#! @Section Functor less_generators for FpGradedModules +## +####################################################### + +#! @Description +#! The argument is a graded left or right module presentation $M$. We then return a presentation of this +#! module which uses less generators. +#! @Returns a graded left or right module presentation +#! @Arguments M +DeclareOperation( "LessGradedGenerators", + [ IsFpGradedLeftOrRightModulesObject ] ); + +#! @Description +#! The argument is a graded left or right module presentation morphism $a$. We then return a presentation of this +#! morphism which uses less generators. +#! @Returns a graded left or right module presentation morphism +#! @Arguments a +DeclareOperation( "LessGradedGenerators", + [ IsFpGradedLeftOrRightModulesMorphism ] ); + +# a function that computes the functor 'LessGenerators' for both left and right presentations +DeclareGlobalFunction( "FunctorLessGradedGenerators" ); + +#! @Description +#! The argument is a homalg graded ring $R$. The output is functor which takes a left +#! presentation in FpGradedLeftModules as input and computes a presentation having less generators. +#! @Returns a functor +#! @Arguments R +DeclareAttribute( "FunctorLessGradedGeneratorsLeft", + IsHomalgGradedRing ); + +#! @Description +#! The argument is a homalg graded ring $R$. The output is functor which takes a right +#! presentation in FpGradedRightModules as input and computes a presentation having less generators. +#! @Returns a functor +#! @Arguments R +DeclareAttribute( "FunctorLessGradedGeneratorsRight", + IsHomalgGradedRing ); + + + + +###################################################### +## +#! @Section Functor StandardModule for FpGradedModules +## +###################################################### + +#! @Description +#! The argument is a graded left or right module presentation $M$. We then try to reduce the relations and +#! thereby return a new presentation - the Standard module. +#! @Returns a graded left or right module presentation +#! @Arguments M +DeclareOperation( "GradedStandardModule", + [ IsFpGradedLeftOrRightModulesObject ] ); + +#! @Description +#! The argument is a graded left or right module presentation morphism $a$. We then try to reduce the relations +#! and thereby return a new presentation, which we term the Standard module morphism. +#! @Returns a graded left or right module presentation morphism +#! @Arguments a +DeclareOperation( "GradedStandardModule", + [ IsFpGradedLeftOrRightModulesMorphism ] ); + +# a function that computes the functor 'StandardModule' for both left and right presentations +DeclareGlobalFunction( "FunctorGradedStandardModule" ); + +#! @Description +#! The argument is a homalg graded ring $R$. The output is functor which takes a left +#! presentation in FpGradedLeftModules as input and computes its standard presentation. +#! @Returns a functor +#! @Arguments R +DeclareAttribute( "FunctorGradedStandardModuleLeft", + IsHomalgGradedRing ); + +#! @Description +#! The argument is a homalg graded ring $R$. The output is functor which takes a right +#! presentation in FpGradedRightModules as input and computes its standard presentation. +#! @Returns a functor +#! @Arguments R +DeclareAttribute( "FunctorGradedStandardModuleRight", + IsHomalgGradedRing ); + + + +############################################################## +## +#! @Section Functor ByASmallerPresentation for FpGradedModules +## +############################################################## + +#! @Description +#! The argument is a graded left or right module presentation $M$. We then return a smaller presentation of this +#! module. This is obtained by first applying 'LessGenerators' and then 'StandardModule'. +#! @Returns a graded left or right module presentation +#! @Arguments M +DeclareOperation( "ByASmallerPresentation", + [ IsFpGradedLeftOrRightModulesObject ] ); + +#! @Description +#! The argument is a graded left or right module presentation morphism $a$. We then return a smaller presentation of this +#! morphism. This is obtained by first applying 'LessGenerators' and then 'StandardModule'. +#! @Returns a graded left or right module presentation morphism +#! @Arguments a +DeclareOperation( "ByASmallerPresentation", + [ IsFpGradedLeftOrRightModulesMorphism ] ); + +# a function that computes the functor 'LessGenerators' for both left and right presentations +DeclareGlobalFunction( "FunctorByASmallerPresentation" ); + +#! @Description +#! The argument is a homalg graded ring $R$. The output is functor which takes a left +#! presentation in FpGradedLeftModules as input and computes a smaller presentation. The latter is achieved by +#! first applying 'LessGenerators' and then acting with 'StandardModule'. +#! @Returns a functor +#! @Arguments R +DeclareAttribute( "FunctorByASmallerPresentationLeft", + IsHomalgGradedRing ); + +#! @Description +#! The argument is a homalg graded ring $R$. The output is functor which takes a right +#! presentation in FpGradedRightModules as input and computes a smaller presentation. The latter is achieved by +#! first applying 'LessGenerators' and then acting with 'StandardModule'. +#! @Returns a functor +#! @Arguments R +DeclareAttribute( "FunctorByASmallerPresentationRight", + IsHomalgGradedRing ); diff --git a/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydFunctors.gi b/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydFunctors.gi new file mode 100644 index 0000000000..adf3b685a3 --- /dev/null +++ b/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydFunctors.gi @@ -0,0 +1,447 @@ +############################################################################# +## +## GradedModulePresentationsbyFreyd +## +## Copyright 2019, Martin Bies, ULB Brussels +## +## Functors in the CAP category of graded module presentations for CAP by use of Freyd categories +## +############################################################################# + + + +################################################ +## +## Section Functor LessGenerators +## +################################################ + +# Here we make use of the function 'SimplerEquivalentMatrix' from MatricesForHomalg, Basic.gi +# This function accepts a matrix M and produces a simpler matrix M2 from it. Optionally it can compute matrices +# U, UI, V and VI such that the following holds true: +# M * V = UI * M2 and U * M = M2 * VI +# For left-modules (R -M-> G and R2 -M2-> G2) this corresponds to having the following commutative diagrams: + +# R --- UI ---> R2 R <--- U ---- R2 +# | | | | +# M M2 M M2 +# | | | | +# v v v v +# G --- V ----> G2 G <--- VI --- G2 + +# and for right-modules to the diagram + +# R --- VI ---> R2 R <--- V ---- R2 +# | | | | +# M M2 M M2 +# | | | | +# v v v v +# G --- U ----> G2 G <--- UI --- G2 + +# So if we want to describe the transformation from the origional module into a simpler module we wish to compute +# left-modules: V (and VI) +# right-modules: U ( and UI) + +# This is achieved from the following code (initialise V, VI, U and UI as HomalgVoidMatrices first) +# left-modules: SimplerEquivalentMatrix( M, V, VI, "", "" ); +# right-modules: SimplerEquivalentMatrix( M, U, UI, "", "", "" ); +# Note the different number of empty strings in this function - this is crucial! + +# That said, we have the following methods + +# FIXME: WHY ARE U, UI, V, VI HOMOGENEOUS? + +## +InstallMethod( LessGradedGeneratorsTransformationTripleLeft, + [ IsHomalgMatrix ], + function( matrix ) + local V, VI, smaller_matrix; + + # initialise the transformation matrices + V := HomalgVoidMatrix( HomalgRing( matrix ) ); + VI := HomalgVoidMatrix( HomalgRing( matrix ) ); + + # compute M' and thereby set values for T and T^{-1} + smaller_matrix := SimplerEquivalentMatrix( matrix, V, VI, "", "" ); + + # return the triple of desired information + return [ smaller_matrix, V, VI ]; + +end ); + +## +InstallMethod( LessGradedGeneratorsTransformationTripleRight, + [ IsHomalgMatrix ], + function( matrix ) + local U, UI, smaller_matrix; + + # initialise the transformation matrices + U := HomalgVoidMatrix( HomalgRing( matrix ) ); + UI := HomalgVoidMatrix( HomalgRing( matrix ) ); + + # compute M' and thereby set values for T and T^{-1} + smaller_matrix := SimplerEquivalentMatrix( matrix, U, UI, "", "", "" ); + + # return the triple of desired information + return [ smaller_matrix, U, UI ]; + +end ); + + +## +InstallMethod( LessGradedGenerators, + [ IsFpGradedLeftOrRightModulesObject ], + function( module_presentation ) + local TI, range_prime, Mprime; + + # recall that we look at the following diagram + # Source( object) --- MappingMatrix M ---> Range( object ) + # | | + # ? T + # | | + # v v + # Source( object' ) -- MappingMatrix M' ---> Range( object' ) + + # now deduce the bottom line + if IsFpGradedLeftModulesObject( module_presentation ) then + + TI := LessGradedGeneratorsTransformationTripleLeft( + UnderlyingHomalgMatrix( RelationMorphism( module_presentation ) ) )[ 3 ]; + range_prime := Source( DeduceMapFromMatrixAndRangeForGradedRows( + TI, Range( RelationMorphism( module_presentation ) ) ) ); + Mprime := ReducedSyzygiesOfRows( TI, UnderlyingHomalgMatrix( RelationMorphism( module_presentation ) ) ); + return FreydCategoryObject( DeduceMapFromMatrixAndRangeForGradedRows( Mprime, range_prime ) ); + + else + + TI := LessGradedGeneratorsTransformationTripleRight( + UnderlyingHomalgMatrix( RelationMorphism( module_presentation ) ) )[ 3 ]; + range_prime := Source( DeduceMapFromMatrixAndRangeForGradedCols( + TI, Range( RelationMorphism( module_presentation ) ) ) ); + Mprime := ReducedSyzygiesOfColumns( TI, UnderlyingHomalgMatrix( RelationMorphism( module_presentation ) ) ); + return FreydCategoryObject( DeduceMapFromMatrixAndRangeForGradedCols( Mprime, range_prime ) ); + + fi; + +end ); + + +## +InstallMethod( LessGradedGenerators, + [ IsFpGradedLeftOrRightModulesMorphism ], + function( morphism ) + local source_transformation_triple, range_transformation_triple, TI, range_prime, Mprime, new_source, new_range, + morphism_matrix, new_morphism_matrix, new_morphism; + + # compute the transformation of source and range + if IsFpGradedLeftModulesMorphism( morphism ) then + source_transformation_triple := LessGradedGeneratorsTransformationTripleLeft( + UnderlyingHomalgMatrix( RelationMorphism( Source( morphism ) ) ) ); + range_transformation_triple := LessGradedGeneratorsTransformationTripleLeft( + UnderlyingHomalgMatrix( RelationMorphism( Range( morphism ) ) ) ); + else + source_transformation_triple := LessGradedGeneratorsTransformationTripleRight( + UnderlyingHomalgMatrix( RelationMorphism( Source( morphism ) ) ) ); + range_transformation_triple := LessGradedGeneratorsTransformationTripleRight( + UnderlyingHomalgMatrix( RelationMorphism( Range( morphism ) ) ) ); + fi; + + # and extract the underlying homalg matrix of the morphism + morphism_matrix := UnderlyingHomalgMatrix( RelationMorphism( morphism ) ); + + # and compute the new mapping matrix + if IsFpGradedLeftModulesMorphism( morphism ) then + + # compute the new source + TI := source_transformation_triple[ 3 ]; + range_prime := Source( DeduceMapFromMatrixAndRangeForGradedRows( TI, Range( RelationMorphism( Source( morphism ) ) ) ) ); + Mprime := ReducedSyzygiesOfRows( TI, UnderlyingHomalgMatrix( RelationMorphism( Source( morphism ) ) ) ); + new_source := FreydCategoryObject( DeduceMapFromMatrixAndRangeForGradedRows( Mprime, range_prime ) ); + + # and the new range + TI := range_transformation_triple[ 3 ]; + range_prime := Source( DeduceMapFromMatrixAndRangeForGradedRows( TI, Range( RelationMorphism( Range( morphism ) ) ) ) ); + Mprime := ReducedSyzygiesOfRows( TI, UnderlyingHomalgMatrix( RelationMorphism( Range( morphism ) ) ) ); + new_range := FreydCategoryObject( DeduceMapFromMatrixAndRangeForGradedRows( Mprime, range_prime ) ); + + # compute the new mapping matrix + new_morphism_matrix := source_transformation_triple[ 3 ] * morphism_matrix * range_transformation_triple[ 2 ]; + + else + + # compute the new source + TI := source_transformation_triple[ 2 ]; + range_prime := Source( DeduceMapFromMatrixAndRangeForGradedCols( TI, Range( RelationMorphism( Source( morphism ) ) ) ) ); + Mprime := ReducedSyzygiesOfColumns( TI, UnderlyingHomalgMatrix( RelationMorphism( Source( morphism ) ) ) ); + new_range := FreydCategoryObject( DeduceMapFromMatrixAndRangeForGradedCols( Mprime, range_prime ) ); + + # and the new range + TI := range_transformation_triple[ 2 ]; + range_prime := Source( DeduceMapFromMatrixAndRangeForGradedCols( TI, Range( RelationMorphism( Range( morphism ) ) ) ) ); + Mprime := ReducedSyzygiesOfColumns( TI, UnderlyingHomalgMatrix( RelationMorphism( Range( morphism ) ) ) ); + new_range := FreydCategoryObject( DeduceMapFromMatrixAndRangeForGradedCols( Mprime, range_prime ) ); + + # compute the new mapping matrix + new_morphism_matrix := range_transformation_triple[ 3 ] * morphism_matrix * source_transformation_triple[ 2 ]; + + fi; + + # wrap this information to form morphism datum of the corresponding morphism in the Freyd category + new_morphism := FreydCategoryMorphism( Range( RelationMorphism( new_source ) ), + new_morphism_matrix, + Range( RelationMorphism( new_range ) ) ); + + # and return the Freyd morphism + return FreydCategoryMorphism( new_source, new_morphism, new_range ); + +end ); + + +## +InstallGlobalFunction( FunctorLessGradedGenerators, + function( graded_ring, left ) + local category, functor; + + # first compute the category under consideration + if left = true then + category := FpGradedLeftModules( graded_ring ); + else + category := FpGradedRightModules( graded_ring ); + fi; + + # then initialise the functor + functor := CapFunctor( Concatenation( "Less generators for ", Name( category ) ), category, category ); + + # and add the functor operation on objects + AddObjectFunction( functor, + function( object ) + + return LessGradedGenerators( object ); + + end ); + + # and on morphisms + AddMorphismFunction( functor, + function( new_source, morphism, new_range ) + + return LessGradedGenerators( morphism ); + + end ); + + # then return the functor + return functor; + +end ); + +## +InstallMethod( FunctorLessGradedGeneratorsLeft, + [ IsHomalgGradedRing ], + function( graded_ring ) + + return FunctorLessGradedGenerators( graded_ring, true ); + +end ); + +## +InstallMethod( FunctorLessGradedGeneratorsRight, + [ IsHomalgGradedRing ], + function( graded_ring ) + + return FunctorLessGradedGenerators( graded_ring, false ); + +end ); + + + +################################################# +## +## Section Functor StandardModule for S-fpgrmod +## +################################################# + +## +InstallMethod( GradedStandardModule, + [ IsFpGradedLeftOrRightModulesObject ], + function( module_presentation ) + local matrix, new_underlying_morphism; + + # compute a new presentation matrix + if IsFpGradedLeftModulesObject( module_presentation ) then + + matrix := ReducedBasisOfRowModule( UnderlyingHomalgMatrix( RelationMorphism( module_presentation ) ) ); + new_underlying_morphism := DeduceMapFromMatrixAndRangeForGradedRows( matrix, Range( RelationMorphism( module_presentation ) ) ); + + else + + matrix := ReducedBasisOfColumnModule( UnderlyingHomalgMatrix( RelationMorphism( module_presentation ) ) ); + new_underlying_morphism := DeduceMapFromMatrixAndRangeForGradedCols( matrix, Range( RelationMorphism( module_presentation ) ) ); + + fi; + + # and return the new object + return FreydCategoryObject( new_underlying_morphism ); + +end ); + +## +InstallMethod( GradedStandardModule, + [ IsFpGradedLeftOrRightModulesMorphism ], + function( morphism ) + local new_source, new_range, new_underlying_morphism; + + # compute the new underlying morphism + new_source := GradedStandardModule( Source( morphism ) ); + new_range := GradedStandardModule( Range( morphism ) ); + new_underlying_morphism := FreydCategoryMorphism( + Range( RelationMorphism( new_source ) ), + UnderlyingHomalgMatrix( RelationMorphism( morphism ) ), + Range( RelationMorphism( new_range ) ) + ); + + # and return the corresponding morphism + return FreydCategoryMorphism( new_source, new_underlying_morphism, new_range ); + +end ); + +## +InstallGlobalFunction( FunctorGradedStandardModule, + function( graded_ring, left ) + local category, functor; + + # first compute the category under consideration + if left = true then + category := FpGradedLeftModules( graded_ring ); + else + category := FpGradedRightModules( graded_ring ); + fi; + + # then initialise the functor + functor := CapFunctor( Concatenation( "Graded standard module for ", Name( category ) ), category, category ); + + # now define the functor operation on the objects + AddObjectFunction( functor, + function( object ) + + return GradedStandardModule( object ); + + end ); + + # now define the functor operation on the morphisms + AddMorphismFunction( functor, + function( new_source, morphism, new_range ) + local new_underlying_morphism; + + # compute the new underlying morphism + new_underlying_morphism := FreydCategoryMorphism( + Range( RelationMorphism( new_source ) ), + UnderlyingHomalgMatrix( RelationMorphism( morphism ) ), + Range( RelationMorphism( new_range ) ) + ); + + # and return the corresponding morphism + return FreydCategoryMorphism( new_source, new_underlying_morphism, new_range ); + + end ); + + # finally return the functor + return functor; + +end ); + +## +InstallMethod( FunctorGradedStandardModuleLeft, + [ IsHomalgGradedRing ], + function( graded_ring ) + + return FunctorGradedStandardModule( graded_ring, true ); + +end ); + +## +InstallMethod( FunctorGradedStandardModuleRight, + [ IsHomalgGradedRing ], + function( graded_ring ) + + return FunctorGradedStandardModule( graded_ring, false ); + +end ); + + + +############################################################# +## +## Section Functor ByASmallerPresentation for FpGradedModules +## +############################################################# + +## +InstallMethod( ByASmallerPresentation, + [ IsFpGradedLeftOrRightModulesObject ], + function( module_presentation ) + + return GradedStandardModule( LessGradedGenerators( module_presentation ) ); + +end ); + +## +InstallMethod( ByASmallerPresentation, + [ IsFpGradedLeftOrRightModulesMorphism ], + function( morphism ) + + return GradedStandardModule( LessGradedGenerators( morphism ) ); + +end ); + +## +InstallGlobalFunction( FunctorByASmallerPresentation, + function( graded_ring, left ) + local category, functor; + + # first compute the category under consideration + if left = true then + category := FpGradedLeftModules( graded_ring ); + else + category := FpGradedRightModules( graded_ring ); + fi; + + # then initialise the functor + functor := CapFunctor( Concatenation( "ByASmallerPresentation for ", Name( category ) ), category, category ); + + # and add the functor operation on objects + AddObjectFunction( functor, + function( object ) + + return ByASmallerPresentation( object ); + + end ); + + AddMorphismFunction( functor, + function( new_source, morphism, new_range ) + + return ByASmallerPresentation( morphism ); + + end ); + + # then return the functor + return functor; + +end ); + +## +InstallMethod( FunctorByASmallerPresentationLeft, + [ IsHomalgGradedRing ], + function( graded_ring ) + + return FunctorByASmallerPresentation( graded_ring, true ); + +end ); + + +## +InstallMethod( FunctorByASmallerPresentationRight, + [ IsHomalgGradedRing ], + function( graded_ring ) + + return FunctorByASmallerPresentation( graded_ring, false ); + +end ); diff --git a/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydNaturalTransformations.gd b/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydNaturalTransformations.gd new file mode 100644 index 0000000000..ba08574643 --- /dev/null +++ b/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydNaturalTransformations.gd @@ -0,0 +1,36 @@ +############################################################################# +## +## GradedModulePresentationsbyFreyd +## +## Copyright 2019, Martin Bies, ULB Brussels +## +#! @Chapter Natural transformations for FPGradedModules +## +############################################################################# + + +#################################################################################### +## +#! @Section Natural isomorphism from identity functor to the standard module functor +## +#################################################################################### + +# a function that computes the natural isomorphism $1 \Rightarrow \mathrm{StandardModule}$ for both +# left and right presentations +DeclareGlobalFunction( "NaturalIsomorphismFromIdentityToGradedStandardModule" ); + +#! @Description +#! The argument is a homalg graded ring $S$. The output is the natural morphism from the identity functor +#! to the left standard module functor. +#! @Returns a natural transformation $\mathrm{Id} \Rightarrow \mathrm{StandardModuleLeft}$ +#! @Arguments S +DeclareAttribute( "NaturalIsomorphismFromIdentityToGradedStandardModuleLeft", + IsHomalgGradedRing ); + +#! @Description +#! The argument is a homalg ring $S$. The output is the natural morphism from the identity functor +#! to the right standard module functor. +#! @Returns a natural transformation $\mathrm{Id} \Rightarrow \mathrm{StandardModuleRight}$ +#! @Arguments S +DeclareAttribute( "NaturalIsomorphismFromIdentityToGradedStandardModuleRight", + IsHomalgGradedRing ); diff --git a/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydNaturalTransformations.gi b/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydNaturalTransformations.gi new file mode 100644 index 0000000000..db84dbfe06 --- /dev/null +++ b/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydNaturalTransformations.gi @@ -0,0 +1,80 @@ +############################################################################# +## +## GradedModulePresentationsbyFreyd +## +## Copyright 2019, Martin Bies, ULB Brussels +## +## Chapter Natural transformations for FP Graded Modules +## +############################################################################# + + +#################################################################################### +## +## Section Natural isomorphism from identity functor to the standard module functor +## +#################################################################################### + +# a function that computes the natural isomorphism 1 => StandardModule for both +# left and right presentations +InstallGlobalFunction( NaturalIsomorphismFromIdentityToGradedStandardModule, + function( graded_ring, left ) + local category, standard_module_functor, natural_transformation; + + if left = true then + category := FpGradedLeftModules( graded_ring ); + standard_module_functor := FunctorGradedStandardModuleLeft( graded_ring ); + else + category := FpGradedRightModules( graded_ring ); + standard_module_functor := FunctorGradedStandardModuleRight( graded_ring ); + fi; + + # initialise the natural_transformation + natural_transformation := NaturalTransformation( Concatenation( "Natural isomorphism from Id to ", + Name( standard_module_functor ) ), + IdentityMorphism( AsCatObject( category ) ), + standard_module_functor + ); + + # add component of natural_transformation over object + AddNaturalTransformationFunction( natural_transformation, + function( id_object, object, standard_object ) + local matrix, underlying_morphism; + + matrix := HomalgIdentityMatrix( Rank( Range( RelationMorphism( id_object ) ) ), graded_ring ); + + underlying_morphism := GradedRowOrColumnMorphism( + Range( UnderlyingMorphism( id_object ) ), + matrix, + Range( UnderlyingMorphism( standard_object ) ) + ); + + return FreydCategoryMorphism( id_object, underlying_morphism, standard_object ); + + end ); + + # inform CAP that this is a natural isomorphism + SetIsIsomorphism( natural_transformation, true ); + + # and finally return this transformation + return natural_transformation; + +end ); + +# natural isomorphism 1 => Standard module for left presentations +InstallMethod( NaturalIsomorphismFromIdentityToGradedStandardModuleLeft, + [ IsHomalgGradedRing ], + function( graded_ring ) + + return NaturalIsomorphismFromIdentityToGradedStandardModule( graded_ring, true ); + +end ); + +# natural isomorphism 1 => Standard module for right presentations +InstallMethod( NaturalIsomorphismFromIdentityToGradedStandardModuleRight, + [ IsHomalgGradedRing ], + function( graded_ring ) + + return NaturalIsomorphismFromIdentityToGradedStandardModule( graded_ring, false ); + +end ); diff --git a/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/Tools.gd b/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/Tools.gd new file mode 100644 index 0000000000..953f4dcd41 --- /dev/null +++ b/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/Tools.gd @@ -0,0 +1,27 @@ +############################################################################# +## +## GradedModulePresentationsbyFreyd +## +## Copyright 2019, Martin Bies, ULB Brussels +## +#! @Chapter Tools for the category of graded module presentations by use of Freyd categories +## +############################################################################# + + +############################################### +## +#! @Section The Frobenius-power +## +############################################### + +# Frobenius power of matrix +DeclareGlobalFunction( "FROBENIUS_POEWR_OF_MATRIX" ); + +#! @Description +#! The arguments are a CAPPresentationCategoryObject $M$ and a non-negative integer $p$. This method +#! then computes the $p$-th Frobenius power of $M$. +#! @Returns a presentation category object +#! @Arguments M, p +DeclareOperation( "FrobeniusPowerOfFPGradedModule", + [ IsFpGradedLeftOrRightModulesObject, IsInt ] ); diff --git a/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/Tools.gi b/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/Tools.gi new file mode 100644 index 0000000000..f552afd79c --- /dev/null +++ b/FreydCategoriesForCAP/gap/GradedModulePresentationsByFreyd/Tools.gi @@ -0,0 +1,99 @@ +############################################################################# +## +## GradedModulePresentationsbyFreyd +## +## Copyright 2019, Martin Bies, ULB Brussels +## +## Tools for the category of graded module presentations by use of Freyd categories +## +############################################################################# + + +############################################### +## +#! @Section The Frobenius-power +## +############################################### + +## +InstallGlobalFunction( FROBENIUS_POEWR_OF_MATRIX, + function( matrix, power ) + local new_mapping_matrix, i, j; + + # check the input + if not IsHomalgMatrix( matrix ) then + + Error( "The first argument must be a homalg matrix" ); + return; + + elif not IsInt( power ) then + + Error( "The power must be a non-negative integer" ); + return; + + elif power < 0 then + + Error( "The power must be a non-negative integer" ); + return; + + fi; + + # now compute the Frobenius power + new_mapping_matrix := EntriesOfHomalgMatrixAsListList( matrix ); + for i in [ 1 .. Length( new_mapping_matrix ) ] do + for j in [ 1 .. Length( new_mapping_matrix[ i ] ) ] do + new_mapping_matrix[ i ][ j ] := new_mapping_matrix[ i ][ j ]^power; + od; + od; + + # and return the result + return HomalgMatrix( new_mapping_matrix, HomalgRing( matrix ) ); + +end ); + +## +InstallMethod( FrobeniusPowerOfFPGradedModule, + "Frobenius powers of graded module presentations", + [ IsFpGradedLeftOrRightModulesObject, IsInt ], + function( module_presentation, power ) + local left, mor, range, matrix, new_mapping_matrix, i, j, alpha; + + if power < 0 then + + Error( "The power must be non-negative" ); + return; + + elif power = 1 then + + return module_presentation; + + else + + # determine if we are dealing with left or right modules + left := IsGradedRowMorphism( RelationMorphism( module_presentation ) ); + + # compute map into best projctive approximation + mor := MorphismIntoBestProjectiveApproximation( module_presentation ); + + # compute Frobenius power of the matrix which presents this morphism + matrix := UnderlyingHomalgMatrix( MorphismDatum( mor ) ); + new_mapping_matrix := FROBENIUS_POEWR_OF_MATRIX( matrix, power ); + + # Compute the kernel embedding of the morphism induced by new_mapping matrix + # and interpret this kernel embedding as object in the Freyd category + # Finally, return exactly this object. + + # compute morphism datum alpha of this object + range := Range( MorphismDatum( mor ) ); + if left then + alpha := WeakKernelEmbedding( DeduceMapFromMatrixAndRangeForGradedRows( new_mapping_matrix, range ) ); + else + alpha := WeakKernelEmbedding( DeduceMapFromMatrixAndRangeForGradedCols( new_mapping_matrix, range ) ); + fi; + + # return the corresponding object + return FreydCategoryObject( alpha ); + + fi; + +end ); diff --git a/FreydCategoriesForCAP/init.g b/FreydCategoriesForCAP/init.g index df3bee4a80..5f43deff3c 100644 --- a/FreydCategoriesForCAP/init.g +++ b/FreydCategoriesForCAP/init.g @@ -30,3 +30,9 @@ ReadPackage( "FreydCategoriesForCAP", "gap/AdelmanCategory.gd" ); ReadPackage( "FreydCategoriesForCAP", "gap/QuiverRows.gd" ); ReadPackage( "FreydCategoriesForCAP", "gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreyd.gd" ); + +ReadPackage( "FreydCategoriesForCAP", "gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydFunctors.gd" ); + +ReadPackage( "FreydCategoriesForCAP", "gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydNaturalTransformations.gd" ); + +ReadPackage( "FreydCategoriesForCAP", "gap/GradedModulePresentationsByFreyd/Tools.gd" ); diff --git a/FreydCategoriesForCAP/read.g b/FreydCategoriesForCAP/read.g index ef2089f2c2..a5b78cf91a 100644 --- a/FreydCategoriesForCAP/read.g +++ b/FreydCategoriesForCAP/read.g @@ -31,3 +31,9 @@ ReadPackage( "FreydCategoriesForCAP", "gap/AdelmanCategory.gi" ); ReadPackage( "FreydCategoriesForCAP", "gap/QuiverRows.gi" ); ReadPackage( "FreydCategoriesForCAP", "gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreyd.gi" ); + +ReadPackage( "FreydCategoriesForCAP", "gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydFunctors.gi" ); + +ReadPackage( "FreydCategoriesForCAP", "gap/GradedModulePresentationsByFreyd/GradedModulePresentationsByFreydNaturalTransformations.gi" ); + +ReadPackage( "FreydCategoriesForCAP", "gap/GradedModulePresentationsByFreyd/Tools.gi" );