From 34f5dcda7608001b770d9d194877c8d9a6be6fa4 Mon Sep 17 00:00:00 2001 From: cdwensley Date: Thu, 13 Jun 2024 12:17:47 +0100 Subject: [PATCH 1/7] added operations for a module as an algebra --- doc/algebra.xml | 12 ++- examples/module.g | 63 ++++++++++++++ init.g | 1 + lib/algebra.gd | 1 - lib/algebra.gi | 27 +----- lib/module.gd | 205 ++++++++++++++++++++++++++++++++++++++++++++++ lib/module.gi | 97 ++++++++++++++++++++++ read.g | 1 + tst/algebra.tst | 2 +- tst/module.tst | 96 ++++++++++++++++++++++ 10 files changed, 475 insertions(+), 30 deletions(-) create mode 100644 examples/module.g create mode 100644 lib/module.gd create mode 100644 lib/module.gi create mode 100644 tst/module.tst diff --git a/doc/algebra.xml b/doc/algebra.xml index 1241cdd..1136ab0 100644 --- a/doc/algebra.xml +++ b/doc/algebra.xml @@ -2,7 +2,7 @@ - + @@ -305,7 +305,15 @@ gap> [ Image(b2,m)=m^3, b2=b1^2 ]; - +<#Include Label="AlgebraModules"> + +<#Include Label="ModuleAsAlgebra"> + +<#Include Label="IsModuleAsAlgebra"> + +<#Include Label="ModuleToAlgebraIsomorphism"> + +<#Include Label="AlgebraActionByModule"> diff --git a/examples/module.g b/examples/module.g new file mode 100644 index 0000000..e786c23 --- /dev/null +++ b/examples/module.g @@ -0,0 +1,63 @@ +############################################################################ +## +#W module.g XModAlg example files Chris Wensley +## + +LoadPackage( "xmodalg" ); + +## Chapter 2, Section 2.2.3 +A := Rationals^[3,3];; +SetName( A, "Q[3,3]" );; +V := Rationals^3;; +M := LeftAlgebraModule( A, \*, V ); +SetName( M, "M" ); +famM := ElementsFamily( FamilyObj( M ) );; +v := [3,4,5];; +v2 := ObjByExtRep( famM, v ); +Print( "v = ", v, ", v2 = ", v2, "\n" ); +m := [ [0,1,0], [0,0,1], [1,0,0] ];; +Print( "m = ", m, "\n" ); +Print( "m*v2 = ", m*v2, "\n" ); +genM := GeneratorsOfLeftModule( M );; +u2 := 6*genM[1] + 7*genM[2] + 8*genM[3]; +u := ExtRepOfObj( u2 ); +Print( "u2 = ", u2, ", u = ", u, "\n" ); + +## Chapter 2, Section 2.2.4 +D := LeftActingDomain( M );; +T := EmptySCTable( Dimension(M), Zero(D), "symmetric" );; +B1 := AlgebraByStructureConstants( D, T ); +Print( "B1 = ", B1, "\n" ); +Print( "B1 has generators: ", GeneratorsOfAlgebra( B1 ), "\n" ); +B := ModuleAsAlgebra( M ); +Print( "B has name: ", B, "\n" ); +Print( "B has generators: ", GeneratorsOfAlgebra( B ), "\n" ); + +## Chapter 2, Section 2.2.5 +Print( "IsModuleAsAlgebra( B )? ", IsModuleAsAlgebra( B ), "\n" ); +Print( "IsModuleAsAlgebra( A )? ", IsModuleAsAlgebra( A ), "\n" ); + +## Chapter 2, Section 2.2.6 +Print( "the known attributes of B are:\n" ); +Print( KnownAttributesOfObject( B ), "\n" ); +M2B := ModuleToAlgebraIsomorphism( B ); +Print( "M2B = ", M2B, "\n" ); +Print( "Source( M2B ) = M? ", Source( M2B ) = M, "\n" ); +Print( "Source( M2B ) = V? ", Source( M2B ) = V, "\n" ); +B2M := AlgebraToModuleIsomorphism( B ); +Print( "B2M = ", B2M, "\n" ); +Print( "Range( B2M ) = M? ", Range( B2M ) = M, "\n" ); +Print( "Range( B2M ) = V? ", Range( B2M ) = V, "\n" ); + +## Chapter 2, Section 2.2.7 +act := AlgebraActionByModule( A, M ); +Print( "the action act of A on B is:\n", act, "\n" ); +genA := GeneratorsOfAlgebra(A);; +m := 5*genA[1] - 4*genA[2] + 3*genA[3]; +Print( "m = ", m, ":\n" ); +Print( "the image of m under act is: ", Image( act, m ), "\n" ); +Print( "the image of the action act is:\n", Image(act ), "\n" ); + +############################################################################ +## +#E module.g . . . . . . . . . . . . . . . . . . . . . . . . . . ends here \ No newline at end of file diff --git a/init.g b/init.g index 977043d..e06b78b 100644 --- a/init.g +++ b/init.g @@ -11,6 +11,7 @@ fi; ## read the function declarations ReadPackage( "xmodalg", "lib/algebra.gd" ); +ReadPackage( "xmodalg", "lib/module.gd" ); ReadPackage( "xmodalg", "lib/alg2obj.gd" ); ReadPackage( "xmodalg", "lib/alg2map.gd" ); diff --git a/lib/algebra.gd b/lib/algebra.gd index f481b25..c6a78b6 100644 --- a/lib/algebra.gd +++ b/lib/algebra.gd @@ -50,7 +50,6 @@ DeclareOperation( "AlgebraActionByMultipliers", [ IsAlgebra, IsAlgebra, IsAlgebra ] ); DeclareOperation( "AlgebraAction2", [ IsAlgebra ] ); DeclareOperation( "AlgebraActionBySurjection", [ IsAlgebraHomomorphism ] ); -DeclareOperation( "AlgebraActionByModule", [ IsAlgebra, IsRing ] ); DeclareOperation ( "SemidirectProductOfAlgebras", [ IsAlgebra, IsAlgebraAction, IsAlgebra ] ); diff --git a/lib/algebra.gi b/lib/algebra.gi index 71ca6d1..1223700 100644 --- a/lib/algebra.gi +++ b/lib/algebra.gi @@ -575,7 +575,7 @@ function( arg ) return AlgebraActionBySurjection( arg[1] ); # module and zero map elif ( ( nargs = 2 ) and IsAlgebra( arg[1] ) - and IsRing( arg[2] ) ) then + and IsLeftModule( arg[2] ) ) then return AlgebraActionByModule( arg[1],arg[2] ); fi; # alternatives not allowed @@ -678,31 +678,6 @@ function ( hom ) return act; end ); -############################################################################# -## -#F AlgebraActionByModule( , , ) -## -InstallMethod( AlgebraActionByModule, "for an algebra and a module", true, - [ IsAlgebra, IsRing ], 0, -function( M, R ) - local act,RM; # mapping , result - RM := Cartesian(R,M); - act := rec( fun:= x->x[1]*x[2]); - ObjectifyWithAttributes( act, - NewType( GeneralMappingsFamily( ElementsFamily(FamilyObj(RM) ), - ElementsFamily( FamilyObj(M) ) ), - IsSPMappingByFunctionRep and IsSingleValued - and IsTotal and IsGroupHomomorphism ), - LeftElementOfCartesianProduct, R, - AlgebraActionType, "module", - Source, RM, - Range, M, - HasZeroModuleProduct, true, - IsAlgebraAction, true ); - # return the mapping - return act; -end ); - ############################################################################# ## #M SemidirectProductOfAlgebras( , , ) diff --git a/lib/module.gd b/lib/module.gd new file mode 100644 index 0000000..09b520a --- /dev/null +++ b/lib/module.gd @@ -0,0 +1,205 @@ +############################################################################ +## +#W module.gd The XMODALG package Chris Wensley +#W +#Y Copyright (C) 2014-2024, Zekeriya Arvasi & Alper Odabas, +## + +############################ module operations ################### + +############################################################################ +## +## <#GAPDoc Label="AlgebraModules"> +## Algebra modules +## Recall that a module can be made into an algebra +## by defining every product to be zero. +## When we apply this construction to a (left) algebra module, +## we obtain an algebra action on an algebra. +##

+## Recall the construction of algebra modules +## from Chapter 62 of the &GAP; reference manual. +## In the example, the vector space V becomes an algebra module +## M with a left action by A. +## Conversion between vectors in V and those in M is achieved +## using the operations ObjByExtRep and ExtRepOfObj. +## These vectors are indistinguishable when printed. +## +## +## A := Rationals^[3,3];; +## gap> SetName( A, "Q[3,3]" );; +## gap> V := Rationals^3;; +## gap> M := LeftAlgebraModule( A, \*, V ); +## +## gap> SetName( M, "M" ); +## gap> famM := ElementsFamily( FamilyObj( M ) );; +## gap> v := [3,4,5];; +## gap> v2 := ObjByExtRep( famM, v ); +## gap> m := [ [0,1,0], [0,0,1], [1,0,0] ];; +## gap> m*v2; +## [ 4, 5, 3 ] +## gap> genM := GeneratorsOfLeftModule( M );; +## gap> u2 := 6*genM[1] + 7*genM[2] + 8*genM[3]; +## [ 6, 7, 8 ] +## gap> u := ExtRepOfObj( u2 ); +## [ 6, 7, 8 ] +## ]]> +## +## +## <#/GAPDoc> +## + +############################################################################ +## +## ModuleAsAlgebra( ) +## +## <#GAPDoc Label="ModuleAsAlgebra"> +## +## +## +## +## To form an algebra B from M with zero products +## we may construct an algebra with the correct dimension using an empty +## structure constants table, as shown below. +## In doing so, the remaining information about M is lost, +## so it is essential to form isomorphisms between the corresponding +## underlying vector spaces. +##

+## If the module M has been given a name, then the operation +## ModuleAsAlgebra assigns a name to the resulting algebra. +## The operation AlgebraByStyructureConstants assigns names +## v_i to the basis vectors unless a list of names is provided. +## The operation ModuleAsAlgebra converts the basis elements of +## M into strings, with additional brackets added, and uses these +## as the names for the basis vectors. +## Note that these [[i,j,k]] are just strings, and not vectors. +## +## +## +## D := LeftActingDomain( M );; +## gap> T := EmptySCTable( Dimension(M), Zero(D), "symmetric" );; +## gap> B := AlgebraByStructureConstants( D, T ); +## +## gap> GeneratorsOfAlgebra( B ); +## [ v.1, v.2, v.3 ] +## gap> B := ModuleAsAlgebra( M ); +## A(M) +## gap> GeneratorsOfAlgebra( B ); +## [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] +## ]]> +## +## <#/GAPDoc> +## +DeclareAttribute( "ModuleAsAlgebra", IsLeftModule ); + + +############################################################################ +## +## IsModuleAsAlgebra( ) +## +## <#GAPDoc Label="IsModuleAsAlgebra"> +## +## +## +## +## This is the property acquired when a module is converted into an algebra. +## +## +## +## IsModuleAsAlgebra( B ); +## true +## gap> IsModuleAsAlgebra(A); +## false +## ]]> +## +## <#/GAPDoc> +## +DeclareProperty( "IsModuleAsAlgebra", IsAlgebra ); + +############################################################################ +## +## ModuleToAlgebraIsomorphism( ) +## AlgebraToModuleIsomorphism( ) +## +## <#GAPDoc Label="ModuleToAlgebraIsomorphism"> +## +## +## +## +## +## These two algebra mappings are attributes of a module converted into +## an algebra. They are required for the process of converting +## the action of A on M into an action on B. +## Note that these left module homomorphisms have as source +## or range the underlying module V, not M. +## +## +## +## KnownAttributesOfObject(B); +## [ "Name", "ZeroImmutable", "LeftActingDomain", "Dimension", +## "GeneratorsOfLeftOperatorAdditiveGroup", "GeneratorsOfLeftOperatorRing", +## "ModuleToAlgebraIsomorphism", "AlgebraToModuleIsomorphism" ] +## gap> M2B := ModuleToAlgebraIsomorphism( B ); +## [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] -> [ [[ 1, 0, 0 ]], [[ 0, 1, ## 0 ]], +## [[ 0, 0, 1 ]] ] +## gap> Source( M2B ) = M; +## false +## gap> Source( M2B ) = V; +## true +## gap> B2M := AlgebraToModuleIsomorphism( B ); +## [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> +## [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] +## gap> Range( B2M ) = M; +## false +## gap> Range( B2M ) = V; +## true +## ]]> +## +## <#/GAPDoc> +## +DeclareAttribute( "ModuleToAlgebraIsomorphism", IsAlgebra ); +DeclareAttribute( "AlgebraToModuleIsomorphism", IsAlgebra ); + + +############################################################################ +## +## AlgebraActionByModule( ) +## +## <#GAPDoc Label="AlgebraActionByModule"> +## +## +## +## +## This operation converts the action of A on M +## into an action of A on B. +## +## +## +## act := AlgebraActionByModule( A, M ); +## [ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], +## [ [ 1, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ], +## [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ] ] -> +## [ [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> +## [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ], +## [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> +## [ [[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]] ], +## [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> +## [ [[ 0, 1, 0 ]], [[ 0, 0, 1 ]], [[ 1, 0, 0 ]] ] ] +## gap> genA := GeneratorsOfAlgebra(A);; +## gap> m := 5*genA[1] -4*genA[2]+3*genA[3]; +## [ [ 1, 0, 3 ], [ 3, 5, 0 ], [ 0, 3, 5 ] ] +## gap> Image( act, m ); +## Basis( A(M), [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] ) -> +## [ [[ 1, 0, 0 ]]+(3)*[[ 0, 1, 0 ]], (5)*[[ 0, 1, 0 ]]+(3)*[[ 0, 0, 1 ]], +## (3)*[[ 1, 0, 0 ]]+(5)*[[ 0, 0, 1 ]] ] +## gap> Image( act ); +## +## ]]> +## +## <#/GAPDoc> +## +DeclareOperation( "AlgebraActionByModule", [ IsAlgebra, IsLeftModule ] ); diff --git a/lib/module.gi b/lib/module.gi new file mode 100644 index 0000000..795295d --- /dev/null +++ b/lib/module.gi @@ -0,0 +1,97 @@ +############################################################################# +## +#W module.gi The XMODALG package Chris Wensley +#W +#Y Copyright (C) 2014-2024, Zekeriya Arvasi & Alper Odabas, +## + +############################ algebra operations ########################### + +############################################################################# +## +#M ModuleAsAlgebra +## +InstallMethod( ModuleAsAlgebra, "generic method for a module", true, + [ IsLeftModule ], 0, +function( M ) + local D, z, genM, num, L, T, B, genB, V, genV, MtoB, BtoM; + D := LeftActingDomain( M ); + z := Zero( D ); + genM := List( GeneratorsOfLeftModule( M ), g -> ExtRepOfObj(g) ); +## Print( "genM = ", genM, "\n" ); + num := Length( genM ); + if HasIsAlgebraModule( M ) and IsAlgebraModule( M ) then + V := UnderlyingLeftModule( M ); + genV := GeneratorsOfLeftModule( V ); + L := List( genV, v -> Concatenation( "[", String(v), "]" ) ); + else + L := List( genM, v -> Concatenation( "[", String(v), "]" ) ); + fi; +## Print( "L = ", L, "\n" ); + T := EmptySCTable( num, z, "symmetric" ); + B := AlgebraByStructureConstants( D, T, L ); + SetIsModuleAsAlgebra( B, true ); + genB := GeneratorsOfAlgebra( B ); + if HasIsAlgebraModule( M ) and IsAlgebraModule( M ) then +## Print( "first option - IsAlgebraModule\n" ); + MtoB := LeftModuleHomomorphismByImages( V, B, genV, genB ); + BtoM := LeftModuleHomomorphismByImages( B, V, genB, genV ); + else +## Print( "second option - IsLeftModule\n" ); + MtoB := LeftModuleHomomorphismByImages( M, B, genM, genB ); + BtoM := LeftModuleHomomorphismByImages( B, M, genB, genM ); + fi; + SetModuleToAlgebraIsomorphism( B, MtoB ); + SetAlgebraToModuleIsomorphism( B, BtoM ); + if HasName( M ) then + SetName( B, Concatenation( "A(", Name(M), ")" ) ); + fi; + return B; +end ); + +############################################################################# +## +#F IsModuleAsAlgebra( ) +## +InstallMethod( IsModuleAsAlgebra, "for an algebra", true, [ IsAlgebra ], 0, +function( A ) + return HasModuleToAlgebraIsomorphism( A ); +end ); + +############################################################################# +## +#F AlgebraActionByModule( , ) +## +InstallMethod( AlgebraActionByModule, + "for an algebra and an algebra module", true, + [ IsAlgebra, IsLeftModule ], 0, +function( A, M ) + local genA, dimA, famM, B, genB, dimB, M2B, B2M, imact, i, a, imi, + j, v, m, C, act; + genA := GeneratorsOfAlgebra( A ); + dimA := Length( genA ); + famM := ElementsFamily( FamilyObj( M ) ); + B := ModuleAsAlgebra( M ); + genB := GeneratorsOfAlgebra( B ); + dimB := Length( genB ); + M2B := ModuleToAlgebraIsomorphism( B ); + B2M := AlgebraToModuleIsomorphism( B ); + imact := ListWithIdenticalEntries( dimA, 0 ); + for i in [1..dimA] do + a := genA[i]; + imi := ListWithIdenticalEntries( dimB, 0 ); + for j in [1..dimB] do + v := Image( B2M, genB[j] ); + m := ObjByExtRep( famM, v ); + imi[j] := Image( M2B, ExtRepOfObj( a^m ) ); + od; + imact[i] := AlgebraGeneralMappingByImages( B, B, genB, imi ); + od; + C := AlgebraByGenerators( Rationals, imact ); + if HasName( B ) then + SetName( C, Concatenation( "Act(", Name(B), ")" ) ); + fi; + act := AlgebraGeneralMappingByImages( A, C, genA, imact ); + return act; +end ); + diff --git a/read.g b/read.g index 10a6c8d..bf20e34 100644 --- a/read.g +++ b/read.g @@ -9,6 +9,7 @@ ## read the actual code ReadPackage( "xmodalg", "lib/algebra.gi" ); +ReadPackage( "xmodalg", "lib/module.gi" ); ReadPackage( "xmodalg", "lib/alg2obj.gi" ); ReadPackage( "xmodalg", "lib/alg2map.gi" ); diff --git a/tst/algebra.tst b/tst/algebra.tst index 12ec634..ef2d078 100644 --- a/tst/algebra.tst +++ b/tst/algebra.tst @@ -117,7 +117,7 @@ gap> [ Image(b1,m)=m^2, Image(b1,m^2)=m^3, Image(b1,m^3)=Zero(A1) ]; gap> [ Image(b2,m)=m^3, b2=b1^2 ]; [true, true ] -## Section 2.2.3 +## Section 2.2.8 gap> P := SemidirectProductOfAlgebras( A5c6, actm, I5c6 ); gap> Embedding( P, 1 ); diff --git a/tst/module.tst b/tst/module.tst new file mode 100644 index 0000000..9e2a7a5 --- /dev/null +++ b/tst/module.tst @@ -0,0 +1,96 @@ +############################################################################ +## +#W module.tst XModAlg test files Chris Wensley +## +## +#@local level,A,V,M,famM,v,v2,m,genM,u2,u,D,T,B,M2B,B2M,act,genA +gap> START_TEST( "XModAlg package: module.tst" ); +gap> level := InfoLevel( InfoXModAlg );; +gap> SetInfoLevel( InfoXModAlg, 0 ); + +## Chapter 2, Section 2.2.3 +gap> A := Rationals^[3,3];; +gap> SetName( A, "Q[3,3]" );; +gap> V := Rationals^3;; +gap> M := LeftAlgebraModule( A, \*, V ); + +gap> SetName( M, "M" ); +gap> famM := ElementsFamily( FamilyObj( M ) );; +gap> v := [3,4,5];; +gap> v2 := ObjByExtRep( famM, v ); +[ 3, 4, 5 ] +gap> m := [ [0,1,0], [0,0,1], [1,0,0] ];; +gap> m*v2; +[ 4, 5, 3 ] +gap> genM := GeneratorsOfLeftModule( M );; +gap> u2 := 6*genM[1] + 7*genM[2] + 8*genM[3]; +[ 6, 7, 8 ] +gap> u := ExtRepOfObj( u2 ); +[ 6, 7, 8 ] + +## Chapter 2, Section 2.2.4 +gap> D := LeftActingDomain( M );; +gap> T := EmptySCTable( Dimension(M), Zero(D), "symmetric" );; +gap> B := AlgebraByStructureConstants( D, T ); + +gap> GeneratorsOfAlgebra( B ); +[ v.1, v.2, v.3 ] +gap> B := ModuleAsAlgebra( M ); +A(M) +gap> GeneratorsOfAlgebra( B ); +[ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] + +## Chapter 2, Section 2.2.5 +gap> IsModuleAsAlgebra( B ); +true +gap> IsModuleAsAlgebra(A); +false + +## Chapter 2, Section 2.2.6 +gap> KnownAttributesOfObject(B); +[ "Name", "ZeroImmutable", "LeftActingDomain", "Dimension", + "GeneratorsOfLeftOperatorAdditiveGroup", "GeneratorsOfLeftOperatorRing", + "ModuleToAlgebraIsomorphism", "AlgebraToModuleIsomorphism" ] +gap> M2B := ModuleToAlgebraIsomorphism( B ); +[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] -> [ [[ 1, 0, 0 ]], [[ 0, \ +1, 0 ]], + [[ 0, 0, 1 ]] ] +gap> Source( M2B ) = M; +false +gap> Source( M2B ) = V; +true +gap> B2M := AlgebraToModuleIsomorphism( B ); +[ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> +[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] +gap> Range( B2M ) = M; +false +gap> Range( B2M ) = V; +true + +## Chapter 2, Section 2.2.7 +gap> act := AlgebraActionByModule( A, M ); +[ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], + [ [ 1, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ], + [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ] ] -> +[ [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> + [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ], + [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> + [ [[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]] ], + [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> + [ [[ 0, 1, 0 ]], [[ 0, 0, 1 ]], [[ 1, 0, 0 ]] ] ] +gap> genA := GeneratorsOfAlgebra(A);; +gap> m := 5*genA[1] -4*genA[2]+3*genA[3]; +[ [ 1, 0, 3 ], [ 3, 5, 0 ], [ 0, 3, 5 ] ] +gap> Image( act, m ); +Basis( A(M), [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] ) -> +[ [[ 1, 0, 0 ]]+(3)*[[ 0, 1, 0 ]], (5)*[[ 0, 1, 0 ]]+(3)*[[ 0, 0, 1 ]], + (3)*[[ 1, 0, 0 ]]+(5)*[[ 0, 0, 1 ]] ] +gap> Image( act ); + + +gap> SetInfoLevel( InfoXModAlg, level );; +gap> STOP_TEST( "module.tst", 10000 ); + +############################################################################ +## +#E module.tst . . . . . . . . . . . . . . . . . . . . . . . . . ends here From 11c521b8ccf63544197d2ea63763176d1192d5f5 Mon Sep 17 00:00:00 2001 From: cdwensley Date: Fri, 14 Jun 2024 20:19:38 +0100 Subject: [PATCH 2/7] used action act3 to form a crossed module X3 --- PackageInfo.g | 4 +- doc/xmod.xml | 21 +---- examples/module.g | 63 -------------- examples/module3.g | 70 +++++++++++++++ lib/alg2obj.gd | 2 - lib/alg2obj.gi | 211 +++++++++++++++++++++------------------------ lib/algebra.gi | 74 +++++++--------- lib/module.gd | 128 ++++++++++++++++++--------- lib/module.gi | 24 ++++++ tst/module.tst | 96 --------------------- tst/module3.tst | 112 ++++++++++++++++++++++++ 11 files changed, 424 insertions(+), 381 deletions(-) delete mode 100644 examples/module.g create mode 100644 examples/module3.g delete mode 100644 tst/module.tst create mode 100644 tst/module3.tst diff --git a/PackageInfo.g b/PackageInfo.g index 47cb4ee..cc79352 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -8,8 +8,8 @@ SetPackageInfo( rec( PackageName := "XModAlg", Subtitle := "Crossed Modules and Cat1-Algebras", -Version := "1.25", -Date := "17/05/2024", # dd/mm/yyyy format +Version := "1.25dev", +Date := "14/06/2024", # dd/mm/yyyy format License := "GPL-2.0-or-later", Persons := [ diff --git a/doc/xmod.xml b/doc/xmod.xml index 40e7746..0377c2e 100644 --- a/doc/xmod.xml +++ b/doc/xmod.xml @@ -2,7 +2,7 @@ - + @@ -238,24 +238,7 @@ Crossed module [->GF(2^2)[k4]] :- ]]> - - - -Let M be a R-module. -Then \mathcal{X} = (0:M\rightarrow R) is a crossed module. -Conversely, given a crossed module -\mathcal{X} = (\partial :M\rightarrow R), -one can get that \ker\partial is a (R/\partial M)-module. -

- - - - - ## example needed -]]> - +<#Include Label="XModAlgebraByModule"> , ) . . . . . . . . . . make pre-crossed module +#M XModAlgebraObj( , ) . . . . . . . make a pre-crossed module ## InstallMethod( XModAlgebraObj, "for homomorphism and action", true, [ IsAlgebraHomomorphism, IsAlgebraAction ], 0, @@ -140,9 +140,9 @@ function( bdy, act ) return PM; end ); -############################################################################## +############################################################################ ## -#M \=(

, ) . . . . . . . . test if two pre-crossed modules are equal +#M \=(

, ) . . . . . . . test if two pre-crossed modules are equal ## InstallMethod( \=, "generic method for two pre-crossed modules of algebras", IsIdenticalObj, [ IsPreXModAlgebra, IsPreXModAlgebra ], 0, @@ -187,9 +187,9 @@ function ( P, Q ) return true; end ); -############################################################################# +############################################################################ ## -#M ViewObj( ) . . . . . . . . . . . . . . . view a (pre-)crossed module +#M ViewObj( ) . . . . . . . . . . . . . . view a (pre-)crossed module ## InstallMethod( ViewObj, "method for a pre-crossed module of algebras", true, [ IsPreXModAlgebra ], 0, @@ -232,9 +232,9 @@ InstallMethod( ViewObj, "method for a pre-crossed module of algebras", true, fi; end ); -############################################################################# +############################################################################ ## -#M PrintObj( ) . . . . . . . . . . . . . . view a (pre-)crossed module +#M PrintObj( ) . . . . . . . . . . . . . . view a (pre-)crossed module ## InstallMethod( PrintObj, "method for a pre-crossed algebra module", true, [ IsPreXModAlgebra ], 0, @@ -246,9 +246,9 @@ InstallMethod( PrintObj, "method for a pre-crossed algebra module", true, fi; end ); -############################################################################# +############################################################################ ## -#F Display( ) . . . . . . . . . print details of a (pre-)crossed module +#F Display( ) . . . . . . . . print details of a (pre-)crossed module ## InstallOtherMethod( Display, "display a pre-crossed module of algebras", true, [IsPreXModAlgebra], 0, @@ -304,9 +304,9 @@ function( PM ) fi; end ); -############################################################################# +############################################################################ ## -#M Name for a pre-XModAlgebra +#M Name for a pre-XModAlgebra ## InstallMethod( Name, "method for a pre-crossed module", true, [ IsPreXModAlgebra ], 0, @@ -329,7 +329,7 @@ function( PM ) return name; end ); -############################################################################# +############################################################################ ## #M Dimension( ) . . . . . . . . . dimension of a (pre-)crossed module ## @@ -339,9 +339,9 @@ InstallMethod( Dimension, "method for a pre-crossed algebra module", true, return [ Dimension( Source( PM ) ), Dimension( Range( PM ) ) ]; end ); -############################################################################# +############################################################################ ## -#M IsXModAlgebra check that the second crossed module axiom holds +#M IsXModAlgebra check that the second crossed module axiom holds ## InstallMethod( IsXModAlgebra, "generic method for pre-crossed modules", true, [ Is2dAlgebra ], 0, @@ -371,7 +371,7 @@ InstallMethod( IsXModAlgebra, "generic method for pre-crossed modules", return true; end ); -############################################################################# +############################################################################ ## #M PreXModAlgebraByBoundaryAndAction ## @@ -400,7 +400,7 @@ function( bdy, act ) return obj; end ); -############################################################################# +############################################################################ ## #M XModAlgebraByBoundaryAndAction ## @@ -418,7 +418,7 @@ function( bdy, act ) return PM; end ); -############################################################################# +############################################################################ ## #M XModAlgebraByMultiplierAlgebra ## @@ -439,7 +439,7 @@ function( A ) return PM; end ); -############################################################################# +############################################################################ ## #M XModAlgebraBySurjection ## @@ -458,27 +458,7 @@ function( hom ) return PM; end ); -############################################################################# -## -#M XModAlgebraByModule -## -InstallMethod( XModAlgebraByModule, "crossed module from module", true, - [ IsAlgebra, IsRing ], 0, -function( M,R ) - local PM,act,bdy; - #M := GroupRing(R,G); - act := AlgebraAction(M,R); - bdy := ModuleHomomorphism(M,R); - SetIsAlgebraAction( act, true ); - IsAlgebraHomomorphism(bdy); - PM := PreXModAlgebraByBoundaryAndAction( bdy, act ); - if not IsXModAlgebra( PM ) then - Error( "this boundary and action only defines a pre-crossed module" ); - fi; - return PM; -end ); - -############################################################################# +############################################################################ ## #M XModAlgebraByIdeal ## @@ -501,7 +481,7 @@ function( A, I ) return PM; end ); -############################################################################# +############################################################################ ## #M AugmentationXMod ## @@ -513,7 +493,7 @@ function( A ) return XModAlgebraByIdeal( A, AI ); end ); -############################################################################# +############################################################################ ## #F XModAlgebra( , ) crossed module from given boundary & action ## @@ -526,9 +506,9 @@ InstallGlobalFunction( XModAlgebra, function( arg ) and IsAlgebraAction( arg[2] ) ) then return XModAlgebraByBoundaryAndAction( arg[1], arg[2] ); # module - elif ( ( nargs = 2 ) and IsRing( arg[1] ) - and IsGroup( arg[2] ) ) then - return XModAlgebraByModule( GroupRing( arg[1],arg[2] ),arg[1] ); + elif ( ( nargs = 2 ) and IsAlgebra( arg[1] ) + and IsLeftModule( arg[2] ) ) then + return XModAlgebraByModule( arg[1], arg[2] ); # ideal elif ( ( nargs = 2 ) and IsAlgebra( arg[1] ) and IsAlgebra( arg[2] ) and IsIdeal(arg[1],arg[2]) ) then @@ -548,7 +528,7 @@ InstallGlobalFunction( XModAlgebra, function( arg ) Error( "usage: XModAlgebra( bdy, act ); " ); end ); -############################################################################## +############################################################################ ## #M IsSubPreXModAlgebra ## @@ -658,7 +638,7 @@ function( PM, SM ) return true; end ); -############################################################################## +########################################################################### ## #M IsSubXModAlgebra( , ) ## @@ -672,7 +652,7 @@ function( XM, SM ) return IsSubPreXModAlgebra( XM, SM ); end ); -############################################################################## +########################################################################### ## #M SubPreXModAlgebra creates SubPreXMod Of Algebra from Ssrc<=Psrc ## @@ -733,7 +713,7 @@ function( PM, Ssrc, Srng ) return SM; end ); -############################################################################## +########################################################################### ## #M SubXModAlgebra . . . . creates SubXModAlgebra from Ssrc<=Psrc & Srng<=Prng ## @@ -754,11 +734,11 @@ end ); -############################# cat1-algebras ############################### +############################# cat1-algebras ############################## -############################################################################# +############################################################################ ## -#M IsPreCat1Algebra check that the first pre-cat1-algebra axiom holds +#M IsPreCat1Algebra check that the first pre-cat1-algebra axiom holds ## InstallMethod( IsPreCat1Algebra, "generic method for pre-cat1-algebra", true, [ Is2dAlgebra ], 0, @@ -788,7 +768,7 @@ function( C1A ) return true; end ); -############################################################################## +############################################################################ ## #M IsSubPreCat1Algebra ## @@ -843,7 +823,7 @@ function( C0, S0 ) return true; end ); -############################################################################## +############################################################################ ## #M IsSubCat1Algebra( , ) ## @@ -857,9 +837,9 @@ function( C1, S1 ) return IsSubPreCat1Algebra( C1, S1 ); end ); -############################################################################### +############################################################################ ## -#M SubPreCat1 . . creates SubPreCat1 from PreCat1 and a subgroup of the source +#M SubPreCat1 creates SubPreCat1 from PreCat1 and a subgroup of the source ## InstallMethod( SubPreCat1Algebra, "generic method for (pre-)cat1-algebras", true, [ IsPreCat1Algebra, IsAlgebra, IsAlgebra ], 0, @@ -888,7 +868,7 @@ function( C, R, S ) return CC; end ); -############################################################################## +############################################################################ ## #M SubCat1Algebra . . . . . . creates SubCat1Algebra from Cat1Algebra ## and a subalgebra of the source @@ -904,9 +884,9 @@ function( C, R, S ) return CC; end ); -############################################################################## +############################################################################ ## -#M \=( , ) . . . . . . . . . test if two pre-cat1-algebras are equal +#M \=( , ) . . . . . . . . . . . test if two pre-cat1-algebras are equal ## InstallMethod( \=, "generic method for pre-cat1-algebras", IsIdenticalObj, [ IsPreCat1Algebra, IsPreCat1Algebra ], 0, @@ -916,9 +896,9 @@ InstallMethod( \=, "generic method for pre-cat1-algebras", and ( RangeEmbedding( C1 ) = RangeEmbedding( C2 ) ) ); end ); -############################################################################## +############################################################################ ## -#M PreCat1AlgebraObj . . . . . . . . . . . . . . . . make a pre-cat1-algebra +#M PreCat1AlgebraObj . . . . . . . . . . . . . . . make a pre-cat1-algebra ## InstallMethod( PreCat1AlgebraObj, "for tail, head, embedding", true, [ IsAlgebraHomomorphism, IsAlgebraHomomorphism, IsAlgebraHomomorphism ], 0, @@ -954,9 +934,9 @@ InstallMethod( PreCat1AlgebraObj, "for tail, head, embedding", true, return C1A; end ); -############################################################################## +############################################################################ ## -#M ViewObj( ) . . . . . . . . . . . . . . . . . view a pre-cat1-algebra +#M ViewObj( ) . . . . . . . . . . . . . . . . view a pre-cat1-algebra ## InstallMethod( ViewObj, "method for a pre-cat1-algebra", true, [ IsPreCat1Algebra ], 0, @@ -1002,9 +982,9 @@ function( C1A ) fi; end ); -############################################################################## +############################################################################ ## -#M PrintObj( ) . . . . . . . . . . . . . . view a (pre-)crossed module +#M PrintObj( ) . . . . . . . . . . . . . view a (pre-)crossed module ## InstallMethod( PrintObj, "method for a pre-cat1-algebra", true, [ IsPreCat1Algebra ], 0, @@ -1016,7 +996,7 @@ function( C1A ) fi; end ); -############################################################################# +############################################################################ ## #M Display( ) . . . . . . . . . . print details of a pre-cat1-algebra ## @@ -1100,9 +1080,9 @@ function( C1A ) Print( "\n" ); end ); -############################################################################# +############################################################################ ## -#M Name for a pre-cat1-alegbra +#M Name for a pre-cat1-alegbra ## InstallMethod( Name, "method for a pre-cat1-algebra", true, [ IsPreCat1Algebra ], 0, @@ -1125,10 +1105,10 @@ function( C1A ) return name; end ); -############################################################################# +############################################################################ ## -#F PreCat1Algebra( , , ) pre-cat1-algebra from tail, head, embed -#F PreCat1Algebra( , ) pre-cat1-algebra from tail, head endos +#F PreCat1Algebra( , , ) pre-cat1-algebra from tail, head, embed +#F PreCat1Algebra( , ) pre-cat1-algebra from tail, head, endos ## InstallGlobalFunction( PreCat1Algebra, function( arg ) @@ -1148,9 +1128,9 @@ InstallGlobalFunction( PreCat1Algebra, function( arg ) Error( "standard usage: PreCat1Algebra( tail, head [,embedding] );" ); end ); -############################################################################# +############################################################################ ## -#M IsCat1Algebra check that the second cat1-algebra axiom holds +#M IsCat1Algebra check that the second cat1-algebra axiom holds ## InstallMethod( IsCat1Algebra, "generic method for crossed modules", true, [ Is2dAlgebra ], 0, @@ -1199,7 +1179,7 @@ function( C1A ) return true; end ); -############################################################################# +############################################################################ ## #M IsIdentityCat1Algebra ## @@ -1210,12 +1190,12 @@ function( C1A ) ( TailMap( C1A ) = IdentityMapping( Source( C1A ) ) ) ); end ); -############################################################################# +############################################################################ ## #F Cat1Algebra( ,, , ) -## cat1-algebra from data in CAT1_ALG_LIST -#F Cat1Algebra( , , ) cat1-algebra from tail, head, embed -#F Cat1Algebra( , ) cat1-algebra from tail, head endos +## cat1-algebra from data in CAT1_ALG_LIST +#F Cat1Algebra( , , ) cat1-algebra from tail, head, embed +#F Cat1Algebra( , ) cat1-algebra from tail, head endos ## InstallGlobalFunction( Cat1Algebra, function( arg ) @@ -1254,10 +1234,10 @@ function( arg ) fi; end ); -############################################################################# +############################################################################ ## #F Cat1AlgebraSelect( , , ) -## cat1-algebra from data in CAT1_LIST +## cat1-algebra from data in CAT1_LIST ## InstallOtherMethod( Cat1AlgebraSelect, "construct a cat1-algebra using data in file", true, [ IsInt ], 0, @@ -1429,13 +1409,14 @@ function( gf, size, gpnum, num ) return PreCat1AlgebraByEndomorphisms( t, h ); end ); -############################################################################# +############################################################################ ## #M PreCat1AlgebraByTailHeadEmbedding ## InstallMethod( PreCat1AlgebraByTailHeadEmbedding, "cat1-algebra from tail, head and embedding", true, - [ IsAlgebraHomomorphism, IsAlgebraHomomorphism, IsAlgebraHomomorphism ], 0, + [ IsAlgebraHomomorphism, IsAlgebraHomomorphism, IsAlgebraHomomorphism ], + 0, function( t, h, e ) local genG, R, genR, imh, imt, ime, eR, hres, tres, eres, @@ -1472,7 +1453,7 @@ function( t, h, e ) return PC; end ); -############################################################################# +############################################################################ ## #M PreCat1AlgebraByEndomorphisms( , ) ## @@ -1510,47 +1491,47 @@ function( et, eh ) return A; end ); -############################################################################# +############################################################################ ## -#M Source( C1A ) . . . . . . . . . . . . . . . . . . . . for a cat1-algebra +#M Source( C1A ) . . . . . . . . . . . . . . . . . . . . for a cat1-algebra ## InstallOtherMethod( Source, "method for a pre-cat1-algebra", true, [ IsPreCat1Algebra ], 0, C1A -> Source( TailMap( C1A ) ) ); -############################################################################## +############################################################################ ## -#M Range( C1A ) . . . . . . . . . . . . . . . . . . . . . for a cat1-algebra +#M Range( C1A ) . . . . . . . . . . . . . . . . . . . . for a cat1-algebra ## InstallOtherMethod( Range, "method for a pre-cat1-algebra", true, [ IsPreCat1Algebra ], 0, C1A -> Range( TailMap( C1A ) ) ); -############################################################################## +############################################################################ ## -#M Kernel( C1A ) . . . . . . . . . . . . . . . . . . . for a pre-cat1-algebra +#M Kernel( C1A ) . . . . . . . . . . . . . . . . . . for a pre-cat1-algebra ## InstallOtherMethod( Kernel, "method for a pre-cat1-algebra", true, [ IsPreCat1Algebra ], 0, C1A -> Kernel( TailMap( C1A ) ) ); -############################################################################# +############################################################################ ## -#M Boundary( C1A ) . . . . . . . . . . . . . . . . . . . for a cat1-algebra +#M Boundary( C1A ) . . . . . . . . . . . . . . . . . . . for a cat1-algebra ## InstallOtherMethod( Boundary, "method for a pre-cat1-algebra", true, [ IsPreCat1Algebra ], 0, C1A -> RestrictionMappingAlgebra( HeadMap( C1A ), Kernel( C1A ) ) ); -############################################################################# +############################################################################ ## -#M KernelEmbedding( C1A ) . . . . . . . . . . . . . . . . for a cat1-algebra +#M KernelEmbedding( C1A ) . . . . . . . . . . . . . . . for a cat1-algebra ## InstallMethod( KernelEmbedding, "method for a pre-cat1-algebra", true, [ IsPreCat1Algebra ], 0, C1A -> InclusionMappingAlgebra( Source( C1A ), Kernel( C1A ) ) ); -############################################################################## +############################################################################ ## #M AllCat1Algebras ## @@ -1578,7 +1559,7 @@ function( F, G ) return Cat1_ler; end ); -############################################################################## +############################################################################ ## #M IsIsomorphicCat1Algebra ## @@ -1637,7 +1618,7 @@ function( C1A1, C1A2 ) return sonuc; end ); -############################################################################## +############################################################################ ## #M IsomorphicCat1AlgebraFamily ## @@ -1660,7 +1641,7 @@ function( C1A1, C1A1_ler ) return sonuc; end ); -############################################################################## +############################################################################ ## #M AllCat1AlgebrasUpToIsomorphism ## @@ -1688,7 +1669,7 @@ end ); ########################## conversion functions ########################## -############################################################################# +############################################################################ ## #M PreXModAlgebraOfPreCat1Algebra ## @@ -1721,7 +1702,7 @@ function( C1A ) return PM; end ); -############################################################################## +############################################################################ ## #M XModAlgebraOfCat1Algebra ## @@ -1740,17 +1721,17 @@ function( C1 ) return X1; end ); -############################################################################## +############################################################################ ## -#M PreCat1AlgebraOfPreXModAlgebra . . . pre-xmod-algebra -> pre-cat1-algebra +#M PreCat1AlgebraOfPreXModAlgebra . . pre-xmod-algebra -> pre-cat1-algebra ## InstallMethod( PreCat1AlgebraOfPreXModAlgebra, "convert a pre-xmod-algebra to a pre-cat1-algebra record", true, [ IsPreXModAlgebra ], 0, function( XM ) - local S, R, act, bdy, P, info, vecP, dimP, dimR, vecR, zR, dimS, vecS, zS, - j, imgs, t, h, e, C; + local S, R, act, bdy, P, info, vecP, dimP, dimR, vecR, zR, dimS, vecS, + zS, j, imgs, t, h, e, C; S := Source( XM ); R := Range( XM ); @@ -1780,12 +1761,12 @@ function( XM ) return C; end ); -############################################################################## +############################################################################ ## #M Cat1AlgebraOfXModAlgebra ## -InstallMethod( Cat1AlgebraOfXModAlgebra, "generic method for crossed modules", - true, [ IsXModAlgebra ], 0, +InstallMethod( Cat1AlgebraOfXModAlgebra, + "generic method for crossed modules", true, [ IsXModAlgebra ], 0, function( X1 ) local C1; diff --git a/lib/algebra.gi b/lib/algebra.gi index 1223700..f21bdb3 100644 --- a/lib/algebra.gi +++ b/lib/algebra.gi @@ -705,6 +705,11 @@ InstallMethod( SemidirectProductOfAlgebras, # result will have the same property. P; # the answer is the semidirect product algebra + ## we are assuming commutative algebras so T will be symmetric + ## and we only need to calculate the upper triangle + if not IsCommutative( A1 ) and IsCommutative( A2 ) then + Error( "commutative algebras required" ); + fi; F := LeftActingDomain( A1 ); z := Zero( F ); if ( F <> LeftActingDomain( A2 ) ) then @@ -733,9 +738,8 @@ InstallMethod( SemidirectProductOfAlgebras, # Initialize the s.c. table. T := EmptySCTable( n, Zero(F), "symmetric" ); for i in [1..n1] do - r := vec1[i]; - imr := ImageElm( act, r ); - for j in [1..n1] do + r := vec1[i]; + for j in [i..n1] do u := vec1[j]; ru := Coefficients( bas1, r*u ); L := [ ]; @@ -743,9 +747,13 @@ InstallMethod( SemidirectProductOfAlgebras, if ( ru[k] <> z ) then Append( L, [ ru[k], k ] ); fi; - od; + od; SetEntrySCTable( T, i, j, L ); - od; + od; + od; + for i in [1..n1] do + r := vec1[i]; + imr := ImageElm( act, r ); for j in [1..n2] do v := vec2[j]; rv := Coefficients( bas2, ImageElm( imr, v ) ); @@ -760,19 +768,7 @@ InstallMethod( SemidirectProductOfAlgebras, od; for i in [1..n2] do s := vec2[i]; - for j in [1..n1] do - u := vec1[j]; - imu := ImageElm( act, u ); - su := Coefficients( bas2, ImageElm( imu, s ) ); - L := [ ]; - for k in [1..n2] do - if ( su[k] <> z ) then - Append( L, [ su[k], k+n1 ] ); - fi; - od; - SetEntrySCTable( T, i+n1, j, L ); - od; - for j in [1..n2] do + for j in [i..n2] do v := vec2[j]; sv := Coefficients( bas2, s*v ); L := [ ]; @@ -783,7 +779,7 @@ InstallMethod( SemidirectProductOfAlgebras, od; SetEntrySCTable( T, i+n1, j+n1, L ); od; - od; + od; P := AlgebraByStructureConstants( F, T ); SetSemidirectProductOfAlgebrasInfo( P, rec( algebras := [ A1, A2 ], action := act, @@ -835,38 +831,30 @@ end ); InstallMethod( Projection, "semidirect product of algebras and integer", [ IsAlgebra and HasSemidirectProductOfAlgebrasInfo, IsPosInt ], function( P, i ) - local info, vecP, dimP, A1, dim1, z1, A2, dim2, z2, vec1, vec2, - imgs, j, hom; + local info, vecP, dimP, A1, dim1, z1, vec1, imgs, j, hom; + if ( i <> 1 ) then + Error( "only the first projection is available" ); + fi; # check info := SemidirectProductOfAlgebrasInfo( P ); - if IsBound( info.projections[i] ) then - return info.projections[i]; + if IsBound( info.projections[1] ) then + return info.projections[1]; fi; vecP := BasisVectors( Basis( P ) ); dimP := Length( vecP ); A1 := info.algebras[1]; dim1 := Dimension( A1 ); z1 := Zero( A1 ); - A2 := info.algebras[2]; - dim2 := Dimension( A2 ); - z2 := Zero( A2 ); - vec1 := BasisVectors( Basis( A1 ) ); - vec2 := BasisVectors( Basis( A2 ) ); - imgs := ListWithIdenticalEntries( dimP, 0 ); - if ( i = 1 ) then - for j in [1..dim1] do - imgs[j] := vec1[j]; - od; - for j in [dim1+1..dimP] do - imgs[j] := z1; - od; - hom := AlgebraHomomorphismByImages( P, A1, vecP, imgs ); - elif ( i = 2 ) then - return fail; - else - Error( "only the first projection is available" ); - fi; + vec1 := BasisVectors( Basis( A1 ) ); + imgs := ListWithIdenticalEntries( dimP, 0 ); + for j in [1..dim1] do + imgs[j] := vec1[j]; + od; + for j in [dim1+1..dimP] do + imgs[j] := z1; + od; + hom := AlgebraHomomorphismByImages( P, A1, vecP, imgs ); ## SetIsSurjective( hom, true ); - info.projections[i] := hom; + info.projections[1] := hom; return hom; end ); diff --git a/lib/module.gd b/lib/module.gd index 09b520a..406a0e6 100644 --- a/lib/module.gd +++ b/lib/module.gd @@ -26,23 +26,23 @@ ## ## ## A := Rationals^[3,3];; -## gap> SetName( A, "Q[3,3]" );; -## gap> V := Rationals^3;; -## gap> M := LeftAlgebraModule( A, \*, V ); -## -## gap> SetName( M, "M" ); -## gap> famM := ElementsFamily( FamilyObj( M ) );; -## gap> v := [3,4,5];; -## gap> v2 := ObjByExtRep( famM, v ); ## gap> m := [ [0,1,0], [0,0,1], [1,0,0] ];; +## gap> A3 := Rationals^[3,3];; +## gap> SetName( A3, "A3" );; +## gap> V3 := Rationals^3;; +## gap> M3 := LeftAlgebraModule( A3, \*, V3 );; +## gap> SetName( M3, "M3" ); +## gap> famM3 := ElementsFamily( FamilyObj( M3 ) );; +## gap> v := [3,4,5];; +## gap> v2 := ObjByExtRep( famM3, v ); +## [ 3, 4, 5 ] ## gap> m*v2; ## [ 4, 5, 3 ] -## gap> genM := GeneratorsOfLeftModule( M );; -## gap> u2 := 6*genM[1] + 7*genM[2] + 8*genM[3]; -## [ 6, 7, 8 ] -## gap> u := ExtRepOfObj( u2 ); -## [ 6, 7, 8 ] +gap> genM3 := GeneratorsOfLeftModule( M3 );; +gap> u2 := 6*genM3[1] + 7*genM3[2] + 8*genM3[3]; +[ 6, 7, 8 ] +gap> u := ExtRepOfObj( u2 ); +[ 6, 7, 8 ] ## ]]> ## ## @@ -77,15 +77,15 @@ ## ## ## D := LeftActingDomain( M );; -## gap> T := EmptySCTable( Dimension(M), Zero(D), "symmetric" );; -## gap> B := AlgebraByStructureConstants( D, T ); +## gap> D3 := LeftActingDomain( M3 );; +## gap> T3 := EmptySCTable( Dimension(M3), Zero(D3), "symmetric" );; +## gap> B3a := AlgebraByStructureConstants( D3, T3 ); ## -## gap> GeneratorsOfAlgebra( B ); +## gap> GeneratorsOfAlgebra( B3a ); ## [ v.1, v.2, v.3 ] -## gap> B := ModuleAsAlgebra( M ); -## A(M) -## gap> GeneratorsOfAlgebra( B ); +## gap> B3 := ModuleAsAlgebra( M3 ); +## A(M3) +## gap> GeneratorsOfAlgebra( B3 ); ## [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] ## ]]> ## @@ -108,9 +108,9 @@ DeclareAttribute( "ModuleAsAlgebra", IsLeftModule ); ## ## ## IsModuleAsAlgebra( B ); +## gap> IsModuleAsAlgebra( B3 ); ## true -## gap> IsModuleAsAlgebra(A); +## gap> IsModuleAsAlgebra( A3 ); ## false ## ]]> ## @@ -138,23 +138,24 @@ DeclareProperty( "IsModuleAsAlgebra", IsAlgebra ); ## ## ## KnownAttributesOfObject(B); +## gap> KnownAttributesOfObject( B3 ); ## [ "Name", "ZeroImmutable", "LeftActingDomain", "Dimension", ## "GeneratorsOfLeftOperatorAdditiveGroup", "GeneratorsOfLeftOperatorRing", ## "ModuleToAlgebraIsomorphism", "AlgebraToModuleIsomorphism" ] -## gap> M2B := ModuleToAlgebraIsomorphism( B ); -## [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] -> [ [[ 1, 0, 0 ]], [[ 0, 1, ## 0 ]], +## gap> M2B3 := ModuleToAlgebraIsomorphism( B3 ); +## [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] -> [ [[ 1, 0, 0 ]], [[ 0, \ +## 1, 0 ]], ## [[ 0, 0, 1 ]] ] -## gap> Source( M2B ) = M; +## gap> Source( M2B3 ) = M3; ## false -## gap> Source( M2B ) = V; +## gap> Source( M2B3 ) = V3; ## true -## gap> B2M := AlgebraToModuleIsomorphism( B ); -## [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> +## gap> B2M3 := AlgebraToModuleIsomorphism( B3 ); +## [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> ## [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] -## gap> Range( B2M ) = M; +## gap> Range( B2M3 ) = M3; ## false -## gap> Range( B2M ) = V; +## gap> Range( B2M3 ) = V3; ## true ## ]]> ## @@ -179,7 +180,7 @@ DeclareAttribute( "AlgebraToModuleIsomorphism", IsAlgebra ); ## ## ## act := AlgebraActionByModule( A, M ); +## gap> act3 := AlgebraActionByModule( A3, M3 ); ## [ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], ## [ [ 1, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ], ## [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ] ] -> @@ -189,17 +190,62 @@ DeclareAttribute( "AlgebraToModuleIsomorphism", IsAlgebra ); ## [ [[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]] ], ## [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> ## [ [[ 0, 1, 0 ]], [[ 0, 0, 1 ]], [[ 1, 0, 0 ]] ] ] -## gap> genA := GeneratorsOfAlgebra(A);; -## gap> m := 5*genA[1] -4*genA[2]+3*genA[3]; -## [ [ 1, 0, 3 ], [ 3, 5, 0 ], [ 0, 3, 5 ] ] -## gap> Image( act, m ); -## Basis( A(M), [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] ) -> -## [ [[ 1, 0, 0 ]]+(3)*[[ 0, 1, 0 ]], (5)*[[ 0, 1, 0 ]]+(3)*[[ 0, 0, 1 ]], -## (3)*[[ 1, 0, 0 ]]+(5)*[[ 0, 0, 1 ]] ] -## gap> Image( act ); +## gap> genA3 := GeneratorsOfAlgebra( A3 );; +## gap> a := 2*m + 3*m^2; +## [ [ 0, 2, 3 ], [ 3, 0, 2 ], [ 2, 3, 0 ] ] +## gap> Image( act3, a ); +## Basis( A(M3), [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] ) -> +## [ (3)*[[ 0, 1, 0 ]]+(2)*[[ 0, 0, 1 ]], (2)*[[ 1, 0, 0 ]]+(3)*[[ 0, 0, 1 ]], +## (3)*[[ 1, 0, 0 ]]+(2)*[[ 0, 1, 0 ]] ] +## gap> Image( act3 ); ## ## ]]> ## ## <#/GAPDoc> ## DeclareOperation( "AlgebraActionByModule", [ IsAlgebra, IsLeftModule ] ); + + +############################################################################ +## +## XModAlgebraByModule( ) +## +## <#GAPDoc Label="XModAlgebraByModule"> +## +## +## +## +## Let M be an A-module. +## Then \mathcal{X} = (0 : A(M) \rightarrow A) is a crossed module, +## where A(M) is M considered as an algebra with zero products +## (see section ). +## The example uses the action act3 constructed in section +## . +##

+## Conversely, given a crossed module +## \mathcal{X} = (\partial :M\rightarrow R), +## one can get that \ker\partial is a (R/\partial M)-module. +##

+## +## +## +## X0 := XModAlgebraByModule( A, M ); +## [ A(M) -> Q[3,3] ] +## gap> Display( X3 ); +## Crossed module [A(M3)->A3] :- +## : Source algebra A(M3) has generators: +## [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] +## : Range algebra A3 has generators: +## [ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], +## [ [ 1, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ], +## [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ] ] +## : Boundary homomorphism maps source generators to: +## [ [ [ 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 ] ] ] +## ]]> +## +## <#/GAPDoc> +## +DeclareOperation( "XModAlgebraByModule", [ IsAlgebra, IsLeftModule ] ); diff --git a/lib/module.gi b/lib/module.gi index 795295d..99afe63 100644 --- a/lib/module.gi +++ b/lib/module.gi @@ -92,6 +92,30 @@ function( A, M ) SetName( C, Concatenation( "Act(", Name(B), ")" ) ); fi; act := AlgebraGeneralMappingByImages( A, C, genA, imact ); + SetIsAlgebraAction( act, true ); + SetAlgebraActionType( act, "module" ); return act; end ); +############################################################################# +## +#M XModAlgebraByModule +## +InstallMethod( XModAlgebraByModule, "crossed module from module", true, + [ IsAlgebra, IsLeftModule ], 0, +function( A, M ) + local genM, zA, B, genB, dimB, imbdy, bdy, PM, act; + genM := GeneratorsOfLeftModule( M ); + zA := Zero( A ); + B := ModuleAsAlgebra( M ); + genB := GeneratorsOfAlgebra( B ); + dimB := Length( genB ); + imbdy := ListWithIdenticalEntries( dimB, zA ); + bdy := AlgebraHomomorphismByImages( B, A, genB, imbdy ); + act := AlgebraActionByModule( A, M ); + PM := PreXModAlgebraByBoundaryAndAction( bdy, act ); + if not IsXModAlgebra( PM ) then + Error( "this boundary and action only defines a pre-crossed module" ); + fi; + return PM; +end ); diff --git a/tst/module.tst b/tst/module.tst deleted file mode 100644 index 9e2a7a5..0000000 --- a/tst/module.tst +++ /dev/null @@ -1,96 +0,0 @@ -############################################################################ -## -#W module.tst XModAlg test files Chris Wensley -## -## -#@local level,A,V,M,famM,v,v2,m,genM,u2,u,D,T,B,M2B,B2M,act,genA -gap> START_TEST( "XModAlg package: module.tst" ); -gap> level := InfoLevel( InfoXModAlg );; -gap> SetInfoLevel( InfoXModAlg, 0 ); - -## Chapter 2, Section 2.2.3 -gap> A := Rationals^[3,3];; -gap> SetName( A, "Q[3,3]" );; -gap> V := Rationals^3;; -gap> M := LeftAlgebraModule( A, \*, V ); - -gap> SetName( M, "M" ); -gap> famM := ElementsFamily( FamilyObj( M ) );; -gap> v := [3,4,5];; -gap> v2 := ObjByExtRep( famM, v ); -[ 3, 4, 5 ] -gap> m := [ [0,1,0], [0,0,1], [1,0,0] ];; -gap> m*v2; -[ 4, 5, 3 ] -gap> genM := GeneratorsOfLeftModule( M );; -gap> u2 := 6*genM[1] + 7*genM[2] + 8*genM[3]; -[ 6, 7, 8 ] -gap> u := ExtRepOfObj( u2 ); -[ 6, 7, 8 ] - -## Chapter 2, Section 2.2.4 -gap> D := LeftActingDomain( M );; -gap> T := EmptySCTable( Dimension(M), Zero(D), "symmetric" );; -gap> B := AlgebraByStructureConstants( D, T ); - -gap> GeneratorsOfAlgebra( B ); -[ v.1, v.2, v.3 ] -gap> B := ModuleAsAlgebra( M ); -A(M) -gap> GeneratorsOfAlgebra( B ); -[ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] - -## Chapter 2, Section 2.2.5 -gap> IsModuleAsAlgebra( B ); -true -gap> IsModuleAsAlgebra(A); -false - -## Chapter 2, Section 2.2.6 -gap> KnownAttributesOfObject(B); -[ "Name", "ZeroImmutable", "LeftActingDomain", "Dimension", - "GeneratorsOfLeftOperatorAdditiveGroup", "GeneratorsOfLeftOperatorRing", - "ModuleToAlgebraIsomorphism", "AlgebraToModuleIsomorphism" ] -gap> M2B := ModuleToAlgebraIsomorphism( B ); -[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] -> [ [[ 1, 0, 0 ]], [[ 0, \ -1, 0 ]], - [[ 0, 0, 1 ]] ] -gap> Source( M2B ) = M; -false -gap> Source( M2B ) = V; -true -gap> B2M := AlgebraToModuleIsomorphism( B ); -[ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> -[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] -gap> Range( B2M ) = M; -false -gap> Range( B2M ) = V; -true - -## Chapter 2, Section 2.2.7 -gap> act := AlgebraActionByModule( A, M ); -[ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], - [ [ 1, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ], - [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ] ] -> -[ [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> - [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ], - [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> - [ [[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]] ], - [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> - [ [[ 0, 1, 0 ]], [[ 0, 0, 1 ]], [[ 1, 0, 0 ]] ] ] -gap> genA := GeneratorsOfAlgebra(A);; -gap> m := 5*genA[1] -4*genA[2]+3*genA[3]; -[ [ 1, 0, 3 ], [ 3, 5, 0 ], [ 0, 3, 5 ] ] -gap> Image( act, m ); -Basis( A(M), [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] ) -> -[ [[ 1, 0, 0 ]]+(3)*[[ 0, 1, 0 ]], (5)*[[ 0, 1, 0 ]]+(3)*[[ 0, 0, 1 ]], - (3)*[[ 1, 0, 0 ]]+(5)*[[ 0, 0, 1 ]] ] -gap> Image( act ); - - -gap> SetInfoLevel( InfoXModAlg, level );; -gap> STOP_TEST( "module.tst", 10000 ); - -############################################################################ -## -#E module.tst . . . . . . . . . . . . . . . . . . . . . . . . . ends here diff --git a/tst/module3.tst b/tst/module3.tst new file mode 100644 index 0000000..cdfecea --- /dev/null +++ b/tst/module3.tst @@ -0,0 +1,112 @@ +############################################################################ +## +#W module3.tst XModAlg test files Chris Wensley +## +## +#@local level,m,A3,V3,M3,famM3,v,v2,genM3,u2,u,D3,T3,B3a,B3,M2B3,B2M3,act3,genA3,a +gap> START_TEST( "XModAlg package: module.tst" ); +gap> level := InfoLevel( InfoXModAlg );; +gap> SetInfoLevel( InfoXModAlg, 0 ); + +## Chapter 2, Section 2.2.3 +gap> m := [ [0,1,0], [0,0,1], [1,0,0] ];; +gap> A3 := Rationals^[3,3];; +gap> SetName( A3, "A3" );; +gap> V3 := Rationals^3;; +gap> M3 := LeftAlgebraModule( A3, \*, V3 );; +gap> SetName( M3, "M3" ); +gap> famM3 := ElementsFamily( FamilyObj( M3 ) );; +gap> v := [3,4,5];; +gap> v2 := ObjByExtRep( famM3, v ); +[ 3, 4, 5 ] +gap> m*v2; +[ 4, 5, 3 ] +gap> genM3 := GeneratorsOfLeftModule( M3 );; +gap> u2 := 6*genM3[1] + 7*genM3[2] + 8*genM3[3]; +[ 6, 7, 8 ] +gap> u := ExtRepOfObj( u2 ); +[ 6, 7, 8 ] + +## Chapter 2, Section 2.2.4 +gap> D3 := LeftActingDomain( M3 );; +gap> T3 := EmptySCTable( Dimension(M3), Zero(D3), "symmetric" );; +gap> B3a := AlgebraByStructureConstants( D3, T3 ); + +gap> GeneratorsOfAlgebra( B3a ); +[ v.1, v.2, v.3 ] +gap> B3 := ModuleAsAlgebra( M3 ); +A(M3) +gap> GeneratorsOfAlgebra( B3 ); +[ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] + +## Chapter 2, Section 2.2.5 +gap> IsModuleAsAlgebra( B3 ); +true +gap> IsModuleAsAlgebra( A3 ); +false + +## Chapter 2, Section 2.2.6 +gap> KnownAttributesOfObject( B3 ); +[ "Name", "ZeroImmutable", "LeftActingDomain", "Dimension", + "GeneratorsOfLeftOperatorAdditiveGroup", "GeneratorsOfLeftOperatorRing", + "ModuleToAlgebraIsomorphism", "AlgebraToModuleIsomorphism" ] +gap> M2B3 := ModuleToAlgebraIsomorphism( B3 ); +[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] -> [ [[ 1, 0, 0 ]], [[ 0, \ +1, 0 ]], + [[ 0, 0, 1 ]] ] +gap> Source( M2B3 ) = M3; +false +gap> Source( M2B3 ) = V3; +true +gap> B2M3 := AlgebraToModuleIsomorphism( B3 ); +[ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> +[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] +gap> Range( B2M3 ) = M3; +false +gap> Range( B2M3 ) = V3; +true + +## Chapter 2, Section 2.2.7 +gap> act3 := AlgebraActionByModule( A3, M3 ); +[ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], + [ [ 1, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ], + [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ] ] -> +[ [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> + [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ], + [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> + [ [[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]] ], + [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> + [ [[ 0, 1, 0 ]], [[ 0, 0, 1 ]], [[ 1, 0, 0 ]] ] ] +gap> genA3 := GeneratorsOfAlgebra( A3 );; +gap> a := 2*m + 3*m^2; +[ [ 0, 2, 3 ], [ 3, 0, 2 ], [ 2, 3, 0 ] ] +gap> Image( act3, a ); +Basis( A(M3), [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] ) -> +[ (3)*[[ 0, 1, 0 ]]+(2)*[[ 0, 0, 1 ]], (2)*[[ 1, 0, 0 ]]+(3)*[[ 0, 0, 1 ]], + (3)*[[ 1, 0, 0 ]]+(2)*[[ 0, 1, 0 ]] ] +gap> Image( act3 ); + + +## Chapter 4, Section 4.1.7 +gap> X3 := XModAlgebraByModule( A3, M3 ); +[A(M3)->A3] +gap> Display( X3 ); + +Crossed module [A(M3)->A3] :- +: Source algebra A(M3) has generators: + [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] +: Range algebra A3 has generators: + [ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], + [ [ 1, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ], + [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ] ] +: Boundary homomorphism maps source generators to: + [ [ [ 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 ] ] ] + +gap> SetInfoLevel( InfoXModAlg, level );; +gap> STOP_TEST( "module.tst", 10000 ); + +############################################################################ +## +#E module3.tst . . . . . . . . . . . . . . . . . . . . . . . . . ends here From 11ccf0bd756f16af7a0b83ab019674a3a640fdb6 Mon Sep 17 00:00:00 2001 From: cdwensley Date: Sat, 15 Jun 2024 16:02:32 +0100 Subject: [PATCH 3/7] added second example of Cat1AlgebraOfXModAlgebra to Ch.5 --- doc/convert.xml | 39 +++++++++++++++++++++++++++------- init.g | 7 +++---- lib/alg2obj.gi | 56 +++++++++++++++++++++++++++---------------------- lib/algebra.gi | 5 ++++- lib/module.gd | 49 ++++++++++++++++++++++++++++++++++++------- read.g | 8 +++---- tst/algebra.tst | 2 +- tst/convert.tst | 33 ++++++++++++++++++++++++----- tst/module3.tst | 20 ++++++++++++++++++ 9 files changed, 164 insertions(+), 55 deletions(-) diff --git a/doc/convert.xml b/doc/convert.xml index 86cff77..19615c0 100644 --- a/doc/convert.xml +++ b/doc/convert.xml @@ -2,7 +2,7 @@ - + @@ -65,18 +65,16 @@ instead of the operation . These operations are used for constructing a cat^{1}-algebra from a given crossed module of algebras. As an example we use the crossed module XAB constructed in - -(The output from Display needs to be improved.) +. CAB := Cat1AlgebraOfXModAlgebra( XAB ); -[Algebra( GF(5), [ v.1, v.2, v.3, v.4, v.5 ] ) -> A(l,m)] +[A(l,m) |X A(m)=>A(l,m)] gap> Display( CAB ); - -Cat1-algebra [..=>A(l,m)] :- +Cat1-algebra [A(l,m) |X A(m)=>A(l,m)] :- : range algebra has generators: [ @@ -85,13 +83,40 @@ Cat1-algebra [..=>A(l,m)] :- [ [ 0*Z(5), Z(5)^0, Z(5)^3 ], [ 0*Z(5), 0*Z(5), Z(5)^0 ], [ 0*Z(5), 0*Z(5), 0*Z(5) ] ] ] : tail homomorphism maps source generators to: + +[ + [ [ Z(5)^0, 0*Z(5), 0*Z(5) ], [ 0*Z(5), Z(5)^0, 0*Z(5) ], + [ 0*Z(5), 0*Z(5), Z(5)^0 ] ], + [ [ 0*Z(5), Z(5)^0, Z(5)^3 ], [ 0*Z(5), 0*Z(5), Z(5)^0 ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ], + [ [ 0*Z(5), 0*Z(5), Z(5)^0 ], [ 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ], + [ [ 0*Z(5), 0*Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ], + [ [ 0*Z(5), 0*Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ] ] +: head homomorphism maps source generators to: + +[ + [ [ Z(5)^0, 0*Z(5), 0*Z(5) ], [ 0*Z(5), Z(5)^0, 0*Z(5) ], + [ 0*Z(5), 0*Z(5), Z(5)^0 ] ], + [ [ 0*Z(5), Z(5)^0, Z(5)^3 ], [ 0*Z(5), 0*Z(5), Z(5)^0 ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ], + [ [ 0*Z(5), 0*Z(5), Z(5)^0 ], [ 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ], + [ [ 0*Z(5), Z(5)^0, Z(5)^3 ], [ 0*Z(5), 0*Z(5), Z(5)^0 ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ], + [ [ 0*Z(5), 0*Z(5), Z(5)^0 ], [ 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ] ] : range embedding maps range generators to: [ v.1, v.2 ] : kernel has generators: - Algebra( GF(5), [ v.4, v.5 ] ) + [ v.4, v.5 ] ]]> +<#Include Label="Cat1AlgebraOfXModAlgebra"> + diff --git a/init.g b/init.g index e06b78b..e5cfcf5 100644 --- a/init.g +++ b/init.g @@ -1,8 +1,8 @@ -############################################################################# +############################################################################ ## #W init.g The XMODALG package Zekeriya Arvasi -#W & Alper Odabas -#Y Copyright (C) 2014-2022, Zekeriya Arvasi & Alper Odabas, +#W & Alper Odabas +#Y Copyright (C) 2014-2024, Zekeriya Arvasi & Alper Odabas, ## if not IsBound( PreImagesRepresentativeNC ) then @@ -14,4 +14,3 @@ ReadPackage( "xmodalg", "lib/algebra.gd" ); ReadPackage( "xmodalg", "lib/module.gd" ); ReadPackage( "xmodalg", "lib/alg2obj.gd" ); ReadPackage( "xmodalg", "lib/alg2map.gd" ); - diff --git a/lib/alg2obj.gi b/lib/alg2obj.gi index c61fde8..39b070b 100644 --- a/lib/alg2obj.gi +++ b/lib/alg2obj.gi @@ -505,10 +505,6 @@ InstallGlobalFunction( XModAlgebra, function( arg ) if ( ( nargs = 2 ) and IsAlgebraHomomorphism( arg[1] ) and IsAlgebraAction( arg[2] ) ) then return XModAlgebraByBoundaryAndAction( arg[1], arg[2] ); - # module - elif ( ( nargs = 2 ) and IsAlgebra( arg[1] ) - and IsLeftModule( arg[2] ) ) then - return XModAlgebraByModule( arg[1], arg[2] ); # ideal elif ( ( nargs = 2 ) and IsAlgebra( arg[1] ) and IsAlgebra( arg[2] ) and IsIdeal(arg[1],arg[2]) ) then @@ -523,9 +519,14 @@ InstallGlobalFunction( XModAlgebra, function( arg ) # Multiplier algebra elif ( ( nargs = 1 ) and IsAlgebra( arg[1] )) then return XModAlgebraByMultiplierAlgebra( arg[1] ); + # module + elif ( ( nargs = 2 ) and IsAlgebra( arg[1] ) + and IsLeftModule( arg[2] ) ) then + return XModAlgebraByModule( arg[1], arg[2] ); + else + # alternatives not allowed + Error( "usage: XModAlgebra( bdy, act ); " ); fi; - # alternatives not allowed - Error( "usage: XModAlgebra( bdy, act ); " ); end ); ############################################################################ @@ -1005,29 +1006,40 @@ InstallOtherMethod( Display, "display a pre-cat1-algebra", function( C1A ) local Csrc, Crng, Cker, gensrc, genrng, genker, name, - t, h, e, b, k, imt, imh, ime, imb, imk; + t, h, e, b, k, imt, imh, ime, imb, imk, eqth; name := Name( C1A ); Csrc := Source( C1A ); + gensrc := GeneratorsOfAlgebra( Csrc ); Crng := Range( C1A ); - Cker := Kernel( C1A ); genrng := GeneratorsOfAlgebra( Crng ); + Cker := Kernel( C1A ); + genker := GeneratorsOfAlgebra( Cker ); t := TailMap( C1A ); h := HeadMap( C1A ); - e := RangeEmbedding( C1A ); + e := RangeEmbedding( C1A ); + imt := List( gensrc, x -> Image( t, x ) ); + imh := List( gensrc, x -> Image( h, x ) ); + eqth := imt = imh; + ime := List( genrng, x -> Image( e, x ) ); if HasXModAlgebraOfCat1Algebra(C1A) then - gensrc := Csrc; - genker := Cker; if IsCat1Algebra( C1A ) then - Print( "\nCat1-algebra ", name, " :- \n" ); + Print( "Cat1-algebra ", name, " :- \n" ); else - Print( "\nPre-cat1-algebra ", name, " :- \n" ); + Print( "Pre-cat1-algebra ", name, " :- \n" ); fi; - ime := List( genrng, x -> Image( e, x ) ); - Print( ": range algebra has generators:\n" ); Print( " ", genrng, "\n" ); - Print( ": tail homomorphism maps source generators to:\n" ); + if eqth then + Print( ": tail homomorphism = head homomorphism\n" ); + Print( " they map the source generators to:\n" ); + Print( " ", imt, "\n" ); + else + Print( ": tail homomorphism maps source generators to:\n" ); + Print( " ", imt, "\n" ); + Print( ": head homomorphism maps source generators to:\n" ); + Print( " ", imh, "\n" ); + fi; Print( ": range embedding maps range generators to:\n" ); Print( " ", ime, "\n" ); if ( Size( Cker ) = 1 ) then @@ -1038,19 +1050,14 @@ function( C1A ) fi; else b := Boundary( C1A ); - gensrc := GeneratorsOfAlgebra( Csrc ); - genker := GeneratorsOfAlgebra( Cker ); k := KernelEmbedding( C1A ); - imt := List( gensrc, x -> Image( t, x ) ); - imh := List( gensrc, x -> Image( h, x ) ); - ime := List( genrng, x -> Image( e, x ) ); imb := List( genker, x -> Image( b, x ) ); imk := List( genker, x -> Image( k, x ) ); if IsCat1Algebra( C1A ) then - Print( "\nCat1-algebra ", name, " :- \n" ); + Print( "Cat1-algebra ", name, " :- \n" ); else - Print( "\nPre-cat1-algebra ", name, " :- \n" ); + Print( "Pre-cat1-algebra ", name, " :- \n" ); fi; Print( ": source algebra has generators:\n" ); Print( " ", gensrc, "\n" ); @@ -1077,7 +1084,6 @@ function( C1A ) # Print( ": associated crossed module is ", # XModAlgebraOfCat1Algebra( C1A ), "\n" ); # fi; - Print( "\n" ); end ); ############################################################################ @@ -1757,7 +1763,7 @@ function( XM ) h := AlgebraHomomorphismByImages( P, R, vecP, imgs ); t := Projection( P, 1 ); e := Embedding( P, 1 ); - C := PreCat1AlgebraObj( t, h, e ); + C := PreCat1AlgebraObj( t, h, e ); return C; end ); diff --git a/lib/algebra.gi b/lib/algebra.gi index f21bdb3..25149bb 100644 --- a/lib/algebra.gi +++ b/lib/algebra.gi @@ -780,7 +780,10 @@ InstallMethod( SemidirectProductOfAlgebras, SetEntrySCTable( T, i+n1, j+n1, L ); od; od; - P := AlgebraByStructureConstants( F, T ); + P := AlgebraByStructureConstants( F, T ); + if HasName( A1 ) and HasName( A2 ) then + SetName( P, Concatenation( Name( A1 ), " |X ", Name( A2 ) ) ); + fi; SetSemidirectProductOfAlgebrasInfo( P, rec( algebras := [ A1, A2 ], action := act, embeddings := [ ], diff --git a/lib/module.gd b/lib/module.gd index 406a0e6..9054110 100644 --- a/lib/module.gd +++ b/lib/module.gd @@ -38,11 +38,11 @@ ## [ 3, 4, 5 ] ## gap> m*v2; ## [ 4, 5, 3 ] -gap> genM3 := GeneratorsOfLeftModule( M3 );; -gap> u2 := 6*genM3[1] + 7*genM3[2] + 8*genM3[3]; -[ 6, 7, 8 ] -gap> u := ExtRepOfObj( u2 ); -[ 6, 7, 8 ] +## gap> genM3 := GeneratorsOfLeftModule( M3 );; +## gap> u2 := 6*genM3[1] + 7*genM3[2] + 8*genM3[3]; +## [ 6, 7, 8 ] +## gap> u := ExtRepOfObj( u2 ); +## [ 6, 7, 8 ] ## ]]> ## ## @@ -230,8 +230,8 @@ DeclareOperation( "AlgebraActionByModule", [ IsAlgebra, IsLeftModule ] ); ## ## ## X0 := XModAlgebraByModule( A, M ); -## [ A(M) -> Q[3,3] ] +## gap> X3 := XModAlgebraByModule( A3, M3 ); +## [ A(M3) -> A3 ] ## gap> Display( X3 ); ## Crossed module [A(M3)->A3] :- ## : Source algebra A(M3) has generators: @@ -249,3 +249,38 @@ DeclareOperation( "AlgebraActionByModule", [ IsAlgebra, IsLeftModule ] ); ## <#/GAPDoc> ## DeclareOperation( "XModAlgebraByModule", [ IsAlgebra, IsLeftModule ] ); + +############################################################################ +## +## addition to Cat1AlgebraOfXModAlgebra +## +## <#GAPDoc Label="Cat1AlgebraOfXModAlgebra"> +##

+## As a second example, we convert the crossed module X3 +## constructed in + + +## +## C3 := Cat1AlgebraOfXModAlgebra( X3 ); +## [A3 |X A(M3)=>A3] +## gap> Display( C3 ); +## Cat1-algebra [A3 |X A(M3)=>A3] :- +## : range algebra has generators: +## [ [ [ 0, 1, 0 ], [ 0, 0, 1 ], [ 1, 0, 0 ] ] ] +## : tail homomorphism = head homomorphism +## they map the source generators to: +## [ [ [ 0, 1, 0 ], [ 0, 0, 1 ], [ 1, 0, 0 ] ], +## [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ], +## [ [ 1, 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, 0, 0 ] ] ] +## : range embedding maps range generators to: +## [ v.1 ] +## : kernel has generators: +## [ v.4, v.5, v.6 ] +## ]]> +## +## <#/GAPDoc> +## diff --git a/read.g b/read.g index bf20e34..f12abe2 100644 --- a/read.g +++ b/read.g @@ -1,10 +1,8 @@ -############################################################################# +############################################################################ ## #W read.g The XMODALG package Zekeriya Arvasi -#W & Alper Odabas -## version 1.19, 16/05/2021 -## -#Y Copyright (C) 2014-2021, Zekeriya Arvasi & Alper Odabas, +#W & Alper Odabas +#Y Copyright (C) 2014-2024, Zekeriya Arvasi & Alper Odabas, ## ## read the actual code diff --git a/tst/algebra.tst b/tst/algebra.tst index ef2d078..90f78c4 100644 --- a/tst/algebra.tst +++ b/tst/algebra.tst @@ -134,7 +134,7 @@ gap> Projection( P, 1 ); (Z(5)^0)*(1,4)(2,5)(3,6), (Z(5)^0)*(1,5,3)(2,6,4), (Z(5)^0)*(1,6,5,4,3,2), of ..., of ... ] gap> P3 := SemidirectProductOfAlgebras( Q13, act3, A1 ); - +Q13 |X A1 gap> Embedding( P3, 1 ); [ v.1, v.2 ] -> [ v.1, v.2 ] gap> Embedding( P3, 2 ); diff --git a/tst/convert.tst b/tst/convert.tst index b2ddaa0..91d708d 100644 --- a/tst/convert.tst +++ b/tst/convert.tst @@ -48,10 +48,9 @@ gap> C3 := Cat1AlgebraSelect( 2, 6, 2, 4 );; gap> ############################ gap> ## Chapter 5, Section 5.1.1 gap> CAB := Cat1AlgebraOfXModAlgebra( XAB ); -[Algebra( GF(5), [ v.1, v.2, v.3, v.4, v.5 ] ) -> A(l,m)] +[A(l,m) |X A(m) -> A(l,m)] gap> Display( CAB ); - -Cat1-algebra [..=>A(l,m)] :- +Cat1-algebra [A(l,m) |X A(m)=>A(l,m)] :- : range algebra has generators: [ @@ -60,11 +59,35 @@ Cat1-algebra [..=>A(l,m)] :- [ [ 0*Z(5), Z(5)^0, Z(5)^3 ], [ 0*Z(5), 0*Z(5), Z(5)^0 ], [ 0*Z(5), 0*Z(5), 0*Z(5) ] ] ] : tail homomorphism maps source generators to: + +[ + [ [ Z(5)^0, 0*Z(5), 0*Z(5) ], [ 0*Z(5), Z(5)^0, 0*Z(5) ], + [ 0*Z(5), 0*Z(5), Z(5)^0 ] ], + [ [ 0*Z(5), Z(5)^0, Z(5)^3 ], [ 0*Z(5), 0*Z(5), Z(5)^0 ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ], + [ [ 0*Z(5), 0*Z(5), Z(5)^0 ], [ 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ], + [ [ 0*Z(5), 0*Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ], + [ [ 0*Z(5), 0*Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ] ] +: head homomorphism maps source generators to: + +[ + [ [ Z(5)^0, 0*Z(5), 0*Z(5) ], [ 0*Z(5), Z(5)^0, 0*Z(5) ], + [ 0*Z(5), 0*Z(5), Z(5)^0 ] ], + [ [ 0*Z(5), Z(5)^0, Z(5)^3 ], [ 0*Z(5), 0*Z(5), Z(5)^0 ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ], + [ [ 0*Z(5), 0*Z(5), Z(5)^0 ], [ 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ], + [ [ 0*Z(5), Z(5)^0, Z(5)^3 ], [ 0*Z(5), 0*Z(5), Z(5)^0 ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ], + [ [ 0*Z(5), 0*Z(5), Z(5)^0 ], [ 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5) ] ] ] : range embedding maps range generators to: [ v.1, v.2 ] : kernel has generators: - Algebra( GF(5), [ v.4, v.5 ] ) - + [ v.4, v.5 ] gap> X3 := XModAlgebraOfCat1Algebra( C3 ); [ -> ] gap> Display( X3 ); diff --git a/tst/module3.tst b/tst/module3.tst index cdfecea..6c73339 100644 --- a/tst/module3.tst +++ b/tst/module3.tst @@ -104,6 +104,26 @@ Crossed module [A(M3)->A3] :- [ [ 0, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ], [ [ 0, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ] ] +## Chapter 5, Section 5.1.1 +gap> C3 := Cat1AlgebraOfXModAlgebra( X3 ); +[A3 |X A(M3)=>A3] +gap> Display( C3 ); +Cat1-algebra [A3 |X A(M3)=>A3] :- +: range algebra has generators: + [ [ [ 0, 1, 0 ], [ 0, 0, 1 ], [ 1, 0, 0 ] ] ] +: tail homomorphism = head homomorphism + they map the source generators to: + [ [ [ 0, 1, 0 ], [ 0, 0, 1 ], [ 1, 0, 0 ] ], + [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ], + [ [ 1, 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, 0, 0 ] ] ] +: range embedding maps range generators to: + [ v.1 ] +: kernel has generators: + [ v.4, v.5, v.6 ] + gap> SetInfoLevel( InfoXModAlg, level );; gap> STOP_TEST( "module.tst", 10000 ); From c3e5734412d6ccaee115b861e6d3253ddd2c8b24 Mon Sep 17 00:00:00 2001 From: cdwensley Date: Sat, 15 Jun 2024 18:50:32 +0100 Subject: [PATCH 4/7] fixed some minor details --- examples/module3.g | 5 ++++- lib/alg2obj.gi | 16 ++++++++-------- tst/module3.tst | 33 ++++++++++++--------------------- 3 files changed, 24 insertions(+), 30 deletions(-) diff --git a/examples/module3.g b/examples/module3.g index c40554a..a252522 100644 --- a/examples/module3.g +++ b/examples/module3.g @@ -52,7 +52,6 @@ Print( "Range( B2M3 ) = V3? ", Range( B2M3 ) = V3, "\n" ); ## Chapter 2, Section 2.2.7 act3 := AlgebraActionByModule( A3, M3 ); Print( "the action act3 of A3 on B3 is:\n", act3, "\n" ); -genA3 := GeneratorsOfAlgebra( A3 );; a := 2*m + 3*m^2; Print( "a = ", a, ":\n" ); Print( "the image of a under act3 is:\n", Image( act3, a ), "\n" ); @@ -64,6 +63,10 @@ X3 := XModAlgebraByModule( A3, M3 ); Print( "Name( X3 ) = ", Name( X3 ), "\n" ); Display( X3 ); +## Chapter 5, Section 5.1.1 +C3 := Cat1AlgebraOfXModAlgebra( X3 ); +Print( "Name( C3 ) = ", Name( C3 ), "\n" ); +Display( C3 ); ############################################################################ ## diff --git a/lib/alg2obj.gi b/lib/alg2obj.gi index 39b070b..a98fb1f 100644 --- a/lib/alg2obj.gi +++ b/lib/alg2obj.gi @@ -203,7 +203,7 @@ InstallMethod( ViewObj, "method for a pre-crossed module of algebras", true, Pact := XModAlgebraAction( PM ); if IsLeftModuleGeneralMapping( Pact ) then ## temporary fix (20/03/18) -## Print( "[", Source( PM ), "->", Range( PM ), "]" ); +## Print( "[", Source( PM ), " -> ", Range( PM ), "]" ); Print( "[ " ); ViewObj( Source( PM ) ); Print( " -> " ); @@ -213,20 +213,20 @@ InstallMethod( ViewObj, "method for a pre-crossed module of algebras", true, type := AlgebraActionType( Pact ); # Type 1 if (type = "multiplier") then - Print( "[", Source( PM ), "->", Range( PM ), "]" ); + Print( "[", Source( PM ), " -> ", Range( PM ), "]" ); fi; # Type 2 if (type = "Type2") then Print( "[", Source( PM ), - "-> MultiplierAlgebra(", Source( PM ), ")]" ); + " -> MultiplierAlgebra(", Source( PM ), ")]" ); fi; # Type 3 if (type = "surjection") then - Print( "[", Source( PM ), "->", Range( PM ), "]" ); + Print( "[", Source( PM ), " -> ", Range( PM ), "]" ); fi; # Type 4 if (type = "module") then - Print( "[", Source( PM ), "->", Range( PM ), "]" ); + Print( "[", Source( PM ), " -> ", Range( PM ), "]" ); fi; fi; fi; @@ -324,7 +324,7 @@ function( PM ) else nrng := ".."; fi; - name := Concatenation( "[", nsrc, "->", nrng, "]" ); + name := Concatenation( "[", nsrc, " -> ", nrng, "]" ); SetName( PM, name ); return name; end ); @@ -993,7 +993,7 @@ function( C1A ) if HasName( C1A ) then Print( Name( C1A ), "\n" ); else - Print( "[", Source( C1A ), "=>", Range( C1A ), "]" ); + Print( "[", Source( C1A ), " => ", Range( C1A ), "]" ); fi; end ); @@ -1106,7 +1106,7 @@ function( C1A ) else nrng := ".."; fi; - name := Concatenation( "[", nsrc, "=>", nrng, "]" ); + name := Concatenation( "[", nsrc, " => ", nrng, "]" ); SetName( C1A, name ); return name; end ); diff --git a/tst/module3.tst b/tst/module3.tst index 6c73339..ea7fd2d 100644 --- a/tst/module3.tst +++ b/tst/module3.tst @@ -1,16 +1,16 @@ ############################################################################ ## -#W module3.tst XModAlg test files Chris Wensley -## +#W module3.tst XModAlg test files Chris Wensley ## -#@local level,m,A3,V3,M3,famM3,v,v2,genM3,u2,u,D3,T3,B3a,B3,M2B3,B2M3,act3,genA3,a -gap> START_TEST( "XModAlg package: module.tst" ); +#@local level,m,A3,V3,M3,famM3,v,v2,genM3,u2,u,D3,T3,B3a,B3,M2B3,B2M3,act3,a,X3,C3 + +gap> START_TEST( "XModAlg package: module3.tst" ); gap> level := InfoLevel( InfoXModAlg );; gap> SetInfoLevel( InfoXModAlg, 0 ); ## Chapter 2, Section 2.2.3 gap> m := [ [0,1,0], [0,0,1], [1,0,0] ];; -gap> A3 := Rationals^[3,3];; +gap> A3 := Algebra( Rationals, [m] );; gap> SetName( A3, "A3" );; gap> V3 := Rationals^3;; gap> M3 := LeftAlgebraModule( A3, \*, V3 );; @@ -68,16 +68,9 @@ true ## Chapter 2, Section 2.2.7 gap> act3 := AlgebraActionByModule( A3, M3 ); -[ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], - [ [ 1, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ], - [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ] ] -> -[ [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> - [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ], - [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> - [ [[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]] ], - [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> - [ [[ 0, 1, 0 ]], [[ 0, 0, 1 ]], [[ 1, 0, 0 ]] ] ] -gap> genA3 := GeneratorsOfAlgebra( A3 );; +[ [ [ 0, 1, 0 ], [ 0, 0, 1 ], [ 1, 0, 0 ] ] ] -> +[ [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] -> + [ [[ 0, 0, 1 ]], [[ 1, 0, 0 ]], [[ 0, 1, 0 ]] ] ] gap> a := 2*m + 3*m^2; [ [ 0, 2, 3 ], [ 3, 0, 2 ], [ 2, 3, 0 ] ] gap> Image( act3, a ); @@ -85,7 +78,7 @@ Basis( A(M3), [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] ) -> [ (3)*[[ 0, 1, 0 ]]+(2)*[[ 0, 0, 1 ]], (2)*[[ 1, 0, 0 ]]+(3)*[[ 0, 0, 1 ]], (3)*[[ 1, 0, 0 ]]+(2)*[[ 0, 1, 0 ]] ] gap> Image( act3 ); - + ## Chapter 4, Section 4.1.7 gap> X3 := XModAlgebraByModule( A3, M3 ); @@ -96,9 +89,7 @@ Crossed module [A(M3)->A3] :- : Source algebra A(M3) has generators: [ [[ 1, 0, 0 ]], [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ] : Range algebra A3 has generators: - [ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], - [ [ 1, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ], - [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ] ] + [ [ [ 0, 1, 0 ], [ 0, 0, 1 ], [ 1, 0, 0 ] ] ] : Boundary homomorphism maps source generators to: [ [ [ 0, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ], [ [ 0, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ], @@ -106,7 +97,7 @@ Crossed module [A(M3)->A3] :- ## Chapter 5, Section 5.1.1 gap> C3 := Cat1AlgebraOfXModAlgebra( X3 ); -[A3 |X A(M3)=>A3] +[A3 |X A(M3) -> A3] gap> Display( C3 ); Cat1-algebra [A3 |X A(M3)=>A3] :- : range algebra has generators: @@ -125,7 +116,7 @@ Cat1-algebra [A3 |X A(M3)=>A3] :- [ v.4, v.5, v.6 ] gap> SetInfoLevel( InfoXModAlg, level );; -gap> STOP_TEST( "module.tst", 10000 ); +gap> STOP_TEST( "module3.tst", 10000 ); ############################################################################ ## From bf6d5e3a60875224a21f3ccfdd797fe45517d967 Mon Sep 17 00:00:00 2001 From: cdwensley Date: Sat, 15 Jun 2024 20:59:36 +0100 Subject: [PATCH 5/7] remove use of AlgebraHomomorphismByFunction --- doc/xmod.xml | 5 ++++- lib/alg2obj.gi | 5 +++-- lib/algebra.gd | 5 +---- lib/algebra.gi | 53 -------------------------------------------------- tst/xmod.tst | 5 ++++- 5 files changed, 12 insertions(+), 61 deletions(-) diff --git a/doc/xmod.xml b/doc/xmod.xml index 0377c2e..3f804fd 100644 --- a/doc/xmod.xml +++ b/doc/xmod.xml @@ -292,7 +292,10 @@ We also show usage of the attributes listed above. f := Boundary( XIAk4 ); -MappingByFunction( I(GF5[k4]), GF5[k4], function( i ) ... end ) +[ (Z(5)^2)* of ...+(Z(5)^0)*f1, (Z(5)^2)* of ...\ ++(Z(5)^ + 0)*f2 ] -> [ (Z(5)^2)* of ...+(Z(5)^0)*f1, + (Z(5)^2)* of ...+(Z(5)^0)*f2 ] gap> Print( RepresentationsOfObject(XIAk4), "\n" ); [ "IsComponentObjectRep", "IsAttributeStoringRep", "IsPreXModAlgebraObj" ] gap> props := [ "CanEasilyCompareElements", "CanEasilySortElements", diff --git a/lib/alg2obj.gi b/lib/alg2obj.gi index a98fb1f..ea9ea7e 100644 --- a/lib/alg2obj.gi +++ b/lib/alg2obj.gi @@ -466,12 +466,13 @@ InstallMethod( XModAlgebraByIdeal, "crossed module from module", true, [ IsAlgebra, IsAlgebra ], 0, function( A, I ) - local PM, act, bdy, AI; + local PM, act, genI, bdy, AI; if not IsIdeal( A,I ) then Error( "I not a ideal" ); fi; + genI := GeneratorsOfAlgebra( I ); act := AlgebraActionByMultipliers( A, I, A ); - bdy := AlgebraHomomorphismByFunction( I, A, i->i ); + bdy := AlgebraHomomorphismByImages( I, A, genI, genI ); IsAlgebraAction( act ); IsAlgebraHomomorphism( bdy ); PM := PreXModAlgebraByBoundaryAndAction( bdy, act ); diff --git a/lib/algebra.gd b/lib/algebra.gd index c6a78b6..22daa05 100644 --- a/lib/algebra.gd +++ b/lib/algebra.gd @@ -2,7 +2,7 @@ ## #W algebra.gd The XMODALG package Zekeriya Arvasi #W & Alper Odabas -#Y Copyright (C) 2014-2022, Zekeriya Arvasi & Alper Odabas, +#Y Copyright (C) 2014-2024, Zekeriya Arvasi & Alper Odabas, ## DeclareInfoClass( "InfoXModAlg" ); @@ -28,9 +28,6 @@ DeclareOperation( "InclusionMappingAlgebra", [ IsAlgebra, IsAlgebra ] ); DeclareOperation( "RestrictionMappingAlgebra", [ IsAlgebraHomomorphism, IsAlgebra, IsAlgebra ] ); -DeclareOperation( "ModuleHomomorphism", - [ IsAlgebra, IsRing ] ); - DeclareOperation( "AllAlgebraHomomorphisms", [ IsAlgebra, IsAlgebra ] ); DeclareOperation( "AllBijectiveAlgebraHomomorphisms", diff --git a/lib/algebra.gi b/lib/algebra.gi index 25149bb..18d3a1d 100644 --- a/lib/algebra.gi +++ b/lib/algebra.gi @@ -470,59 +470,6 @@ function( hom, U ) return rest; end); -############################################################################# -## -#O AlgebraHomomorphismByFunction( , , ) -## -InstallMethod( AlgebraHomomorphismByFunction, - "(XModAlg) for two algebras and a function", - [ IsAlgebra, IsAlgebra, IsFunction ], -function( S, R, f ) - return Objectify( TypeOfDefaultGeneralMapping( S, R, - IsSPMappingByFunctionRep and IsAlgebraHomomorphism), - rec( fun := f ) ); -end); - - -## no implementation of MultiplierHomomorphism is required -## because this attribute is set by MultiplierAlgebra constructions -############################################################################# -## -#F MultiplierHomomorphism( ) -## -##InstallMethod( MultiplierHomomorphism, "generic method for an algebra", -## true, [ IsAlgebra ], 0, -##function ( A ) -## -## local mu, bvA, imgs, B; -## bvA := BasisVectors( Basis( A ) ); -## imgs := List( bvA, a -> RegularAlgebraMultiplier( A, A, a ) ); -## B := MultiplierAlgebra(A); -## mu := AlgebraHomomorphismByImages( A, B, bvA, imgs ); -## r -> AlgebraHomomorphismByFunction(A,A,x->r*x) ); -## SetSource(mu,A); -## SetRange(mu,B); -#### SetMultiplierHomomorphism(A,mu); -## # return the mapping -## return mu; -##end ); - -############################################################################# -## -#F ModuleHomomorphism( , ) -## -InstallMethod( ModuleHomomorphism, "for an algebra and a module", - true, [IsAlgebra, IsRing], 0, -function ( M, R ) - - local mu, B; # mapping , result - mu := AlgebraHomomorphismByFunction(M,R,r->Zero(R)); - SetSource(mu,M); - SetRange(mu,R); - # return the mapping - return mu; -end ); - ############################## algebra actions ############################ ############################################################################# diff --git a/tst/xmod.tst b/tst/xmod.tst index 00b801c..138229e 100644 --- a/tst/xmod.tst +++ b/tst/xmod.tst @@ -122,7 +122,10 @@ Crossed module [->GF(2^2)[k4]] :- gap> ############################ gap> ## Section 4.1.8 gap> f := Boundary( XIAk4 ); -MappingByFunction( I(GF5[k4]), GF5[k4], function( i ) ... end ) +[ (Z(5)^2)* of ...+(Z(5)^0)*f1, (Z(5)^2)* of ...\ ++(Z(5)^ + 0)*f2 ] -> [ (Z(5)^2)* of ...+(Z(5)^0)*f1, + (Z(5)^2)* of ...+(Z(5)^0)*f2 ] gap> reps := RepresentationsOfObject( XIAk4 );; gap> Set( reps ); [ "IsAttributeStoringRep", "IsComponentObjectRep", "IsPreXModAlgebraObj" ] From b56c9e416159a6fd761d65968d979c634b18a61f Mon Sep 17 00:00:00 2001 From: cdwensley Date: Sun, 16 Jun 2024 09:02:07 +0100 Subject: [PATCH 6/7] ... and removed same from test, examples, manual --- doc/xmod.xml | 5 +++-- examples/cat1.g | 2 +- examples/xmod.g | 2 +- tst/cat1.tst | 2 +- tst/convert.tst | 2 +- tst/xmod.tst | 5 +++-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/doc/xmod.xml b/doc/xmod.xml index 3f804fd..e8f0d3c 100644 --- a/doc/xmod.xml +++ b/doc/xmod.xml @@ -215,8 +215,9 @@ gap> SetName( S, "" ); gap> RS := Cartesian( R, S );; gap> SetName( RS, "GF(2^2)[k4] x " ); gap> act := AlgebraAction( R, RS, S );; -gap> bdy := AlgebraHomomorphismByFunction( S, R, r->r ); -MappingByFunction( , GF(2^2)[k4], function( r ) ... end ) +gap> bdy := AlgebraHomomorphismByImages( S, R, [e5], [e5] ); +[ (Z(2)^0)* of ...+(Z(2)^0)*f1+(Z(2)^0)*f2+(Z(2)^0)*f1*f2 ] -> +[ (Z(2)^0)* of ...+(Z(2)^0)*f1+(Z(2)^0)*f2+(Z(2)^0)*f1*f2 ] gap> IsAlgebraAction( act ); true gap> IsAlgebraHomomorphism( bdy ); diff --git a/examples/cat1.g b/examples/cat1.g index a49f794..f354683 100644 --- a/examples/cat1.g +++ b/examples/cat1.g @@ -50,7 +50,7 @@ SetName( S, "" ); RS := Cartesian( R, S );; SetName( RS, "GF(2^2)[k4] x " ); act := AlgebraAction( R, RS, S );; -bdy := AlgebraHomomorphismByFunction( S, R, r->r ); +bdy := AlgebraHomomorphismByImages( S, R, [e5], [e5] ); IsAlgebraAction( act ); IsAlgebraHomomorphism( bdy ); XM := PreXModAlgebraByBoundaryAndAction( bdy, act ); diff --git a/examples/xmod.g b/examples/xmod.g index d5931f1..d496101 100644 --- a/examples/xmod.g +++ b/examples/xmod.g @@ -47,7 +47,7 @@ SetName( S, "" ); RS := Cartesian( R, S );; SetName( RS, "GF(2^2)[k4] x " ); act := AlgebraAction( R, RS, S );; -bdy := AlgebraHomomorphismByFunction( S, R, r->r ); +bdy := AlgebraHomomorphismByImages( S, R, [e5], [e5] ); IsAlgebraAction( act ); IsAlgebraHomomorphism( bdy ); XM := PreXModAlgebraByBoundaryAndAction( bdy, act ); diff --git a/tst/cat1.tst b/tst/cat1.tst index cebe9b7..4d9e4f3 100644 --- a/tst/cat1.tst +++ b/tst/cat1.tst @@ -27,7 +27,7 @@ gap> e5 := Elements(R)[5];; gap> S := Subalgebra( R, [e5] );; gap> SetName( S, "" ); gap> act := AlgebraActionByMultipliers( R, S, R );; -gap> bdy := AlgebraHomomorphismByFunction( S, R, s->s );; +gap> bdy := AlgebraHomomorphismByImages( S, R, [e5], [e5] );; gap> IsAlgebraAction( act );; gap> IsAlgebraHomomorphism( bdy );; gap> XM := PreXModAlgebraByBoundaryAndAction( bdy, act );; diff --git a/tst/convert.tst b/tst/convert.tst index 91d708d..18aed73 100644 --- a/tst/convert.tst +++ b/tst/convert.tst @@ -21,7 +21,7 @@ gap> e5 := Elements(R)[5];; gap> S := Subalgebra( R, [e5] );; gap> SetName( S, "" ); gap> act := AlgebraActionByMultipliers( R, S, R );; -gap> bdy := AlgebraHomomorphismByFunction( S, R, s->s );; +gap> bdy := AlgebraHomomorphismByImages( S, R, [e5], [e5] );; gap> IsAlgebraAction( act );; gap> IsAlgebraHomomorphism( bdy );; gap> XM := PreXModAlgebraByBoundaryAndAction( bdy, act );; diff --git a/tst/xmod.tst b/tst/xmod.tst index 138229e..1c4082e 100644 --- a/tst/xmod.tst +++ b/tst/xmod.tst @@ -99,8 +99,9 @@ gap> e5 := Elements( R )[5]; gap> S := Subalgebra( R, [e5] );; gap> SetName( S, "" ); gap> act := AlgebraActionByMultipliers( R, S, R );; -gap> bdy := AlgebraHomomorphismByFunction( S, R, s->s ); -MappingByFunction( , GF(2^2)[k4], function( s ) ... end ) +gap> bdy := AlgebraHomomorphismByImages( S, R, [e5], [e5] ); +[ (Z(2)^0)* of ...+(Z(2)^0)*f1+(Z(2)^0)*f2+(Z(2)^0)*f1*f2 ] -> +[ (Z(2)^0)* of ...+(Z(2)^0)*f1+(Z(2)^0)*f2+(Z(2)^0)*f1*f2 ] gap> IsAlgebraAction( act ); true gap> IsAlgebraHomomorphism( bdy ); From c751e2e43b8add3019484398f5204a548fd1b784 Mon Sep 17 00:00:00 2001 From: cdwensley Date: Mon, 17 Jun 2024 10:02:05 +0100 Subject: [PATCH 7/7] revised examples and Dimension method --- PackageInfo.g | 6 +-- doc/cat1.xml | 8 +++- doc/xmod.xml | 10 +++-- examples/cat1.g | 58 ++++++++++++++----------- examples/xmod.g | 110 +++++++++++++++++++++++++----------------------- lib/alg2map.gi | 92 ++++++++++++++++++++-------------------- lib/alg2obj.gi | 30 +++++++------ lib/algebra.gi | 7 +-- tst/cat1.tst | 2 + 9 files changed, 177 insertions(+), 146 deletions(-) diff --git a/PackageInfo.g b/PackageInfo.g index cc79352..f8e3417 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -9,7 +9,7 @@ SetPackageInfo( rec( PackageName := "XModAlg", Subtitle := "Crossed Modules and Cat1-Algebras", Version := "1.25dev", -Date := "14/06/2024", # dd/mm/yyyy format +Date := "17/06/2024", # dd/mm/yyyy format License := "GPL-2.0-or-later", Persons := [ @@ -81,7 +81,7 @@ PackageDoc := rec( ), Dependencies := rec( - GAP := ">=4.11.0", + GAP := ">=4.12.0", NeededOtherPackages := [ ["XMod", ">=2.87"], ["LAGUNA", ">=3.9.3"] ], SuggestedOtherPackages := [ ], @@ -107,7 +107,7 @@ Keywords := ["crossed module of algebras", "cat1-algebra"], AutoDoc := rec( TitlePage := rec( Copyright := Concatenation( - "©right; 2014-2022, Zekeriya Arvasi and Alper Odabas.

\n", + "©right; 2014-2024, Zekeriya Arvasi and Alper Odabas.

\n", "The &XModAlg; package is free software; you can redistribute it ", "and/or modify it under the terms of the GNU General ", "Public License as published by the Free Software Foundation; ", diff --git a/doc/cat1.xml b/doc/cat1.xml index fb4996a..d8de0b1 100644 --- a/doc/cat1.xml +++ b/doc/cat1.xml @@ -108,10 +108,12 @@ are used with particular choices of algebra homomorphisms. Arg="C" /> - + -These are the eight main attributes of a pre-cat^{1}-algebra. +These are the nine main attributes of a pre-cat^{1}-algebra.

In the example we use homomorphisms between A2c6 and I2c6 constructed in section . @@ -131,6 +133,8 @@ gap> IsCat1Algebra( C4 ); true gap> Size2d( C4 ); [ 64, 8 ] +gap> Dimension( C4 ); +[ 6, 3 ] gap> Display( C4 ); Cat1-algebra [..=>..] :- diff --git a/doc/xmod.xml b/doc/xmod.xml index e8f0d3c..b93ecc3 100644 --- a/doc/xmod.xml +++ b/doc/xmod.xml @@ -274,9 +274,13 @@ The following standard &GAP; operations have special &XModAlg; implementations: Display(X) is used to list the components of \mathcal{X}; -Size2d(X) is used for calculating the order of the -crossed module \mathcal{X}; - +Size2d(X) for a crossed module \mathcal{X} +returns a 2-element list, the sizes of the source and range, + + +Dimension(X) for a crossed module \mathcal{X} +returns a 2-element list, the dimensions of the source and range, + Name(X) is used for giving a name to the crossed module \mathcal{X} by associating the names of source and range algebras. diff --git a/examples/cat1.g b/examples/cat1.g index f354683..299b355 100644 --- a/examples/cat1.g +++ b/examples/cat1.g @@ -1,24 +1,30 @@ -############################################################################# +############################################################################ ## -#W cat1.g XMODALG example files Zekeriya Arvasi -#W & Alper Odabas -#Y Copyright (C) 2014-2018, Zekeriya Arvasi & Alper Odabas, +#W cat1.g XMODALG example files Zekeriya Arvasi +#W & Alper Odabas +#Y Copyright (C) 2014-2024, Zekeriya Arvasi & Alper Odabas, ## -Print("\nXModAlg test file cat1.g (version 10/11/15) :-"); +Print("\nXModAlg test file cat1.g :-"); Print("\ntesting constructions of cat1-algebras\n\n"); -A := GroupRing(GF(2),Group((1,2,3)(4,5))); -R := GroupRing(GF(2),Group((1,2,3))); -f := AllHomsOfAlgebras(A,R); -g := AllHomsOfAlgebras(R,A); -C4 := PreCat1Obj(f[6],f[6],g[8]); -IsCat1Algebra(C4); -Size(C4); -Display(C4); +LoadPackage( "xmodalg" ); + +A := GroupRing( GF(2), Group((1,2,3)(4,5)) ); +SetName( A, "GF(2)[c6]" ); +R := GroupRing( GF(2), Group( (1,2,3) ) ); +SetName( R, "GF(2)[c3]" ); +f := AllAlgebraHomomorphisms( A, R ); +g := AllAlgebraHomomorphisms( R, A ); +C4 := PreCat1AlgebraObj( f[6], f[6], g[8] ); +IsCat1Algebra( C4 ); +Size2d( C4 ); +Dimension( C4 ); +Display( C4 ); C2 := Cat1AlgebraSelect( 4, 6, 2, 2 ); -Size( C2 ); +Size2d( C2 ); +Dimension(C2); Display( C2 ); C := Cat1AlgebraSelect(11); C := Cat1AlgebraSelect(4,12); @@ -47,17 +53,19 @@ SetName( R, "GF(2^2)[k4]" ); e5 := Elements(R)[5]; S := Subalgebra( R, [e5] ); SetName( S, "" ); -RS := Cartesian( R, S );; -SetName( RS, "GF(2^2)[k4] x " ); -act := AlgebraAction( R, RS, S );; -bdy := AlgebraHomomorphismByImages( S, R, [e5], [e5] ); -IsAlgebraAction( act ); -IsAlgebraHomomorphism( bdy ); -XM := PreXModAlgebraByBoundaryAndAction( bdy, act ); -CXM := Cat1AlgebraByXModAlgebra( XM ); -Display(CXM); -X3 := XModAlgebraByCat1Algebra( C3 ); -Display( X3 ); + +## the following may be included once AlgebraAction2 has been fixed +## RS := Cartesian( R, S );; +## SetName( RS, "GF(2^2)[k4] x " ); +## act := AlgebraAction( R, RS, S );; +## bdy := AlgebraHomomorphismByImages( S, R, [e5], [e5] ); +## IsAlgebraAction( act ); +## IsAlgebraHomomorphism( bdy ); +## XM := PreXModAlgebraByBoundaryAndAction( bdy, act ); +## CXM := Cat1AlgebraByXModAlgebra( XM ); +## Display(CXM); +## X3 := XModAlgebraByCat1Algebra( C3 ); +## Display( X3 ); ############################################################################# ## diff --git a/examples/xmod.g b/examples/xmod.g index d496101..0b52c73 100644 --- a/examples/xmod.g +++ b/examples/xmod.g @@ -1,78 +1,84 @@ -############################################################################# -## -#W xmod.g XMODALG example files Zekeriya Arvasi -#W & Alper Odabas -## version 1.12, 14/11/2015 +############################################################################ ## -#Y Copyright (C) 2014-2015, Zekeriya Arvasi & Alper Odabas, +#W xmod.g XMODALG example files Zekeriya Arvasi +#W & Alper Odabas +#Y Copyright (C) 2014-2024, Zekeriya Arvasi & Alper Odabas, ## -Print("\nXModAlg test file xmod.g (version 10/11/15) :-"); +LoadPackage( "xmodalg" ); + +Print("\nXModAlg test file xmod.g (version 16/06/24) :-"); Print("\ntesting constructions of crossed modules of algebras\n\n"); -A := GroupRing(GF(5),DihedralGroup(4)); -Size(A); -SetName(A,"GF5[D4]"); -I := AugmentationIdeal(A); -Size(I); -SetName(I,"Aug"); -CM := XModAlgebraByIdeal(A,I); -Display(CM); -Size(CM); -f := Boundary(CM); -Print( RepresentationsOfObject(CM), "\n" ); +A := GroupRing( GF(5), DihedralGroup(4) ); +SetName( A, "GF5[d4]" ); +I := AugmentationIdeal( A ); +SetName( I, "I(GF(5)[d4])" ); +CM := XModAlgebraByIdeal( A, I ); +Display( CM ); +Print( "CM has size ", Size2d( CM ), "\n" ); +Print( "CM has dimension ", Dimension( CM ), "\n" ); +f := Boundary( CM ); +Print( "CM has boundary ", f, "\n" ); +Print( "CM has representations ", RepresentationsOfObject( CM ), "\n" ); props := [ "CanEasilyCompareElements", "CanEasilySortElements", "IsDuplicateFree", "IsLeftActedOnByDivisionRing", "IsAdditivelyCommutative", "IsPreXModAlgebra", "IsXModAlgebra" ];; -known := KnownPropertiesOfObject(CM);; +known := KnownPropertiesOfObject( CM );; ForAll( props, p -> (p in known) ); -Print( KnownAttributesOfObject(CM), "\n" ); +Print( KnownAttributesOfObject( CM ), "\n" ); e4 := Elements(I)[4]; J := Ideal( I, [e4] ); -Size(J); SetName( J, "" ); +Print( "PM is an XModAlgebraByIdeal with ideal generated by ", e4, "\n" ); PM := XModAlgebraByIdeal( A, J ); -Display( PM ); -IsSubXModAlgebra( CM, PM ); +Display( PM ); +ok := IsSubXModAlgebra( CM, PM ); -G := SmallGroup(4,2); -F := GaloisField(4); +G := SmallGroup( 4, 2 ); +F := GaloisField( 4 ); R := GroupRing( F, G ); -Size(R); -SetName( R, "GF(2^2)[k4]" ); +SetName( R, "GF(4)[k4]" ); +Print( "R is the algebra ", R, "\n" ); e5 := Elements(R)[5]; S := Subalgebra( R, [e5] ); SetName( S, "" ); +Print( "S is the subalgebra of R generated by ", e5, "\n" ); RS := Cartesian( R, S );; -SetName( RS, "GF(2^2)[k4] x " ); -act := AlgebraAction( R, RS, S );; -bdy := AlgebraHomomorphismByImages( S, R, [e5], [e5] ); -IsAlgebraAction( act ); -IsAlgebraHomomorphism( bdy ); -XM := PreXModAlgebraByBoundaryAndAction( bdy, act ); -IsXModAlgebra( XM ); -Display( XM ); +SetName( RS, "GF(2^2)[k4] x " ); +## make the following available when AlgebraSAction2 has been fixed +## act := AlgebraAction( R, RS, S );; +## bdy := AlgebraHomomorphismByImages( S, R, [e5], [e5] ); +## IsAlgebraAction( act ); +## IsAlgebraHomomorphism( bdy ); +## XM := PreXModAlgebraByBoundaryAndAction( bdy, act ); +## IsXModAlgebra( XM ); +## Display( XM ); -A:=GroupRing(GF(2),CyclicGroup(4)); -B:=AugmentationIdeal(A); -X1:=XModAlgebra(A,B); -C:=GroupRing(GF(2),SmallGroup(4,2)); -D:=AugmentationIdeal(C); -X2:=XModAlgebra(C,D); +A := GroupRing( GF(2), CyclicGroup(4) ); +SetName( A, "GF(2)[c4]" ); +B := AugmentationIdeal( A ); +SetName( B, "I(GF(2)[c4])" ); +X1 := XModAlgebra( A, B ); +C := GroupRing( GF(2), SmallGroup(4,2) ); +SetName( C, "GF(2)[k4]" ); +D := AugmentationIdeal( C ); +SetName( D, "I(GF(2)[k4])" ); +X2 := XModAlgebra( C, D ); B = D; -all_f := AllHomsOfAlgebras(A,C);; -all_g := AllHomsOfAlgebras(B,D);; -mor := XModAlgebraMorphism(X1,X2,all_g[1],all_f[2]); -Display(mor); -X3 := Kernel(mor); -IsTotal(mor); -IsSingleValued(mor); -IsXModAlgebra(X3); -Size(X3); -IsSubXModAlgebra(X1,X3); +all_f := AllAlgebraHomomorphisms(A,C);; +all_g := AllAlgebraHomomorphisms(B,D);; +mor := XModAlgebraMorphism( X1, X2, all_g[1], all_f[2] ); +Display( mor ); +X3 := Kernel( mor) ; +IsTotal( mor ); +IsSingleValued( mor ); +IsXModAlgebra( X3 ); +Size2d( X3 ); +IsSubXModAlgebra( X1, X3 ); ############################################################################# ## -#E alg2obj.g . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here +#E xmod.g . . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here diff --git a/lib/alg2map.gi b/lib/alg2map.gi index 1e7fdd8..7d9abcb 100644 --- a/lib/alg2map.gi +++ b/lib/alg2map.gi @@ -1,13 +1,13 @@ -############################################################################# +############################################################################ ## -#W alg2map.gi The XMODALG package Zekeriya Arvasi -#W & Alper Odabas -#Y Copyright (C) 2014-2021, Zekeriya Arvasi & Alper Odabas, +#W alg2map.gi The XMODALG package Zekeriya Arvasi +#W & Alper Odabas +#Y Copyright (C) 2014-2024, Zekeriya Arvasi & Alper Odabas, ## -############################################################################## +############################################################################ ## -#M Make2dAlgebraMorphism( , , , ) . . . 2d-object map +#M Make2dAlgebraMorphism( , , , ) . . 2d-object map ## InstallMethod( Make2dAlgebraMorphism, "for 2d-object, 2d-object, homomorphism, homomorphism", true, @@ -37,9 +37,9 @@ function( src, rng, shom, rhom ) return mor; end ); -############################################################################# +############################################################################ ## -#M IsPreXModAlgebraMorphism check diagram of algebra homs commutes +#M IsPreXModAlgebraMorphism check diagram of algebra homs commutes ## InstallMethod( IsPreXModAlgebraMorphism, "generic method for pre-crossed module homomorphisms", @@ -140,9 +140,9 @@ function( mor ) return true; end ); -############################################################################# +############################################################################ ## -#F Display( ) . . . . print details of a (pre-)crossed module morphism +#F Display( ) . . . print details of a (pre-)crossed module morphism ## InstallMethod( Display, "display a morphism of pre-crossed modules", true, [ IsPreXModAlgebraMorphism ], 0, @@ -187,7 +187,7 @@ InstallMethod( Display, "display a morphism of pre-crossed modules", true, Print( "\n" ); end ); -############################################################################# +############################################################################ ## #M IsXModAlgebraMorphism ## @@ -210,7 +210,7 @@ function( mor ) fi; end ); -############################################################################## +############################################################################ ## #M IdentityMapping( ) ## @@ -233,7 +233,7 @@ function( obj ) fi; end ); -############################################################################## +############################################################################ ## #F PreXModAlgebraMorphism( ,,, ) pre-crossed mod morphism ## @@ -255,7 +255,7 @@ InstallGlobalFunction( PreXModAlgebraMorphism, function( arg ) return fail; end ); -############################################################################### +############################################################################## ## #F XModAlgebraMorphism( , , , ) crossed module morphism ## @@ -277,9 +277,9 @@ InstallGlobalFunction( XModAlgebraMorphism, function( arg ) return fail; end ); -############################################################################## +############################################################################ ## -#M XModMorphismByHoms( , , , ) . . . make xmod morphism +#M XModMorphismByHoms( , , , ) . . make xmod morphism ## InstallMethod( XModAlgebraMorphismByHoms, "for 2 xmods and 2 homomorphisms", true, [ IsXModAlgebra, IsXModAlgebra, IsAlgebraHomomorphism, IsAlgebraHomomorphism ], 0, @@ -290,14 +290,14 @@ function( src, rng, srchom, rnghom ) if ( mor = fail ) then return fail; fi; - ok := IsXModAlgebraMorphism( mor ); + ok := IsXModAlgebraMorphism( mor ) and Is2DimensionalMapping( mor ); if not ok then return fail; fi; return mor; end ); -############################################################################### +############################################################################ ## #M PreXModAlgebraMorphismByHoms(

, , , ) . . make prexmod morphism ## @@ -335,7 +335,7 @@ function( src, rng, srchom, rnghom ) return mor; end ); -############################################################################### +############################################################################ ## #F PreCat1AlgebraMorphism( ,,, ) pre-cat1-algebra morphism ## @@ -357,7 +357,7 @@ InstallGlobalFunction( PreCat1AlgebraMorphism, function( arg ) return fail; end ); -############################################################################### +############################################################################ ## #F Cat1AlgebraMorphism( , , , ) cat1-algebra morphism ## @@ -379,7 +379,7 @@ InstallGlobalFunction( Cat1AlgebraMorphism, function( arg ) return fail; end ); -############################################################################## +############################################################################ ## #M IsPreCat1AlgebraMorphism . . check that the diagram of group homs commutes ## @@ -441,7 +441,7 @@ function( mor ) return true; end ); -############################################################################# +############################################################################ ## #F Display( ) . . . . . . print details of a (pre-)cat1-algebra morphism ## @@ -483,9 +483,9 @@ function( mor ) Print( "\n" ); end ); -############################################################################# +############################################################################ ## -#M Name for a pre-xmod +#M Name for a pre-xmod ## InstallMethod( Name, "method for a 2d-mapping", true, [ Is2dAlgebraMorphism ], 0, function( mor ) @@ -507,7 +507,7 @@ function( mor ) return name; end ); -############################################################################# +############################################################# ############### ## #M IsCat1AlgebraMorphism ## @@ -529,7 +529,7 @@ function( mor ) fi; end ); -############################################################################## +############################################################################ ## #M PreCat1AlgebraMorphismByHoms(

, , , ) . make pre-cat1-alg morphism ## @@ -566,7 +566,7 @@ function( src, rng, srchom, rnghom ) return mor; end ); -############################################################################# +############################################################################ ## #M Cat1AlgebraMorphismByHoms( , , , ) . . . make xmod morphism ## @@ -583,7 +583,7 @@ function( src, rng, srchom, rnghom ) return mor; end ); -############################################################################## +############################################################################ ## #M ViewObj( ) . . . . . . . . . . view a (pre-)crossed module morphism ## @@ -597,7 +597,7 @@ function( mor ) fi; end ); -############################################################################## +############################################################################ ## #M PrintObj( ) . . . . . . . . . print a (pre-)crossed module morphism ## @@ -611,9 +611,9 @@ function( mor ) fi; end ); -############################################################################# +############################################################################ ## -#M ViewObj( ) . . . . . . . . . . . . . . . . view a (pre-)cat1-algebras +#M ViewObj( ) . . . . . . . . . . . . . . . view a (pre-)cat1-algebra ## InstallMethod( ViewObj, "method for a morphism of pre-cat1 algebras", true, [ IsPreCat1AlgebraMorphism ], 0, @@ -625,9 +625,9 @@ function( mor ) fi; end ); -############################################################################## +############################################################################ ## -#M PrintObj( ) . . . . . . . . . . . . . . . . print a (pre-)cat1-algebras +#M PrintObj( ) . . . . . . . . . . . . . print a (pre-)cat1-algebra ## InstallMethod( PrintObj, "method for a morphism of pre-cat1 algebras", true, [ IsPreCat1AlgebraMorphism ], 0, @@ -639,7 +639,7 @@ function( mor ) fi; end ); -############################################################################## +############################################################################ ## #M Kernel . . . . . . of morphisms of pre-crossed modules of algebras #M . . . . . . and pre-cat1-groups of algebras @@ -659,54 +659,54 @@ function( map ) return K; end ); -############################################################################## +############################################################################ ## -#M IsInjective( map ) . . . . . . . . . . . . . . . . . . . for a 2dAlg-mapping +#M IsInjective( map ) . . . . . . . . . . . . . . . . for a 2dAlg-mapping ## InstallOtherMethod( IsInjective, "method for a 2dAlg-mapping", true, [ Is2dAlgebraMorphism ], 0, map -> ( IsInjective( SourceHom( map ) ) and IsInjective( RangeHom( map ) ) ) ); -############################################################################## +############################################################################ ## -#M IsSurjective( map ) . . . . . . . . . . . . . . . . . . . for a 2dAlg-mapping +#M IsSurjective( map ) . . . . . . . . . . . . . . . . for a 2dAlg-mapping ## InstallOtherMethod( IsSurjective, "method for a 2dAlg-mapping", true, [ Is2dAlgebraMorphism ], 0, map -> ( IsSurjective( SourceHom( map ) ) and IsSurjective( RangeHom( map ) ) ) ); -############################################################################## +############################################################################ ## -#M IsSingleValued( map ) . . . . . . . . . . . . . . . . . . for a 2dAlg-mapping +#M IsSingleValued( map ) . . . . . . . . . . . . . . . for a 2dAlg-mapping ## InstallOtherMethod( IsSingleValued, "method for a 2dAlg-mapping", true, [ Is2dAlgebraMorphism ], 0, map -> ( IsSingleValued( SourceHom( map ) ) and IsSingleValued( RangeHom( map ) ) ) ); -############################################################################## +############################################################################ ## -#M IsTotal( map ) . . . . . . . . . . . . . . . . . . . . . for a 2dAlg-mapping +#M IsTotal( map ) . . . . . . . . . . . . . . . . . . for a 2dAlg-mapping ## InstallOtherMethod( IsTotal, "method for a 2dAlg-mapping", true, [ Is2dAlgebraMorphism ], 0, map -> ( IsTotal( SourceHom( map ) ) and IsTotal( RangeHom( map ) ) ) ); -############################################################################## +############################################################################ ## -#M IsBijective( map ) . . . . . . . . . . . . . . . . . . . for a 2dAlg-mapping +#M IsBijective( map ) . . . . . . . . . . . . . . . . for a 2dAlg-mapping ## InstallOtherMethod( IsBijective, "method for a 2d-mapping", true, [ Is2dAlgebraMorphism ], 0, map -> ( IsBijective( SourceHom( map ) ) and IsBijective( RangeHom( map ) ) ) ); -############################################################################# +############################################################################ ## -#M ImagesSource2DimensionalMapping( ) . . for pre-xmod/cat1 alg morphs +#M ImagesSource2DimensionalMapping( ) . for pre-xmod/cat1 alg morphs ## InstallOtherMethod( ImagesSource2DimensionalMapping, "image of pre-xmod/cat1 algebra morphism", true, diff --git a/lib/alg2obj.gi b/lib/alg2obj.gi index ea9ea7e..5fac53d 100644 --- a/lib/alg2obj.gi +++ b/lib/alg2obj.gi @@ -331,12 +331,12 @@ end ); ############################################################################ ## -#M Dimension( ) . . . . . . . . . dimension of a (pre-)crossed module +#M Dimension( ) . . . . . . . . . dimension of a 2-dimensional algebra ## -InstallMethod( Dimension, "method for a pre-crossed algebra module", true, - [ IsPreXModAlgebra ], 0, - function( PM ) - return [ Dimension( Source( PM ) ), Dimension( Range( PM ) ) ]; +InstallOtherMethod( Dimension, "method for a 2-dimensional algebra", true, + [ Is2dAlgebraObject ], 20, + function( obj ) + return [ Dimension( Source( obj ) ), Dimension( Range( obj ) ) ]; end ); ############################################################################ @@ -910,6 +910,12 @@ InstallMethod( PreCat1AlgebraObj, "for tail, head, embedding", true, fam := Family2dAlgebra; filter := IsPreCat1AlgebraObj; + if not ( ( Source(h) = Source(t) ) and ( Range(h) = Range(t) ) ) then + Error( "tail & head must have same source and range" ); + fi; + if not ( ( Source(e) = Range(t) ) and ( Range(e) = Source(t) ) ) then + Error( "tail, embedding must have opposite source and range" ); + fi; C1A := rec(); ObjectifyWithAttributes( C1A, NewType( fam, filter ), Source, Source( t ), @@ -918,13 +924,7 @@ InstallMethod( PreCat1AlgebraObj, "for tail, head, embedding", true, HeadMap, h, RangeEmbedding, e, IsPreCat1Domain, true ); - if not ( ( Source(h) = Source(t) ) and ( Range(h) = Range(t) ) ) then - Error( "tail & head must have same source and range" ); - fi; SetHeadMap( C1A, h ); - if not ( ( Source(e) = Range(t) ) and ( Range(e) = Source(t) ) ) then - Error( "tail, embedding must have opposite source and range" ); - fi; SetRangeEmbedding( C1A, e ); SetIs2dAlgebraObject( C1A, true ); ok := IsPreCat1Algebra( C1A ); @@ -1528,7 +1528,13 @@ InstallOtherMethod( Kernel, "method for a pre-cat1-algebra", true, ## InstallOtherMethod( Boundary, "method for a pre-cat1-algebra", true, [ IsPreCat1Algebra ], 0, - C1A -> RestrictionMappingAlgebra( HeadMap( C1A ), Kernel( C1A ) ) ); +function( PC1A ) + local t, K, R; + t := HeadMap( PC1A ); + K := Kernel( PC1A ); + R := Range( PC1A ); + return RestrictionMappingAlgebra( t, K, R ); +end ); ############################################################################ ## diff --git a/lib/algebra.gi b/lib/algebra.gi index 18d3a1d..edce335 100644 --- a/lib/algebra.gi +++ b/lib/algebra.gi @@ -415,8 +415,9 @@ end ); ## #M RestrictionMappingAlgebra( , , ) ## -InstallMethod( RestrictionMappingAlgebra, "generic method for group hom", - true, [ IsAlgebraHomomorphism, IsAlgebra, IsAlgebra ], 0, +InstallMethod( RestrictionMappingAlgebra, + "generic method for an algebra homomorphism", true, + [ IsAlgebraHomomorphism, IsAlgebra, IsAlgebra ], 0, function( hom, src, rng ) local res, gens, ims, r; @@ -431,7 +432,7 @@ function( hom, src, rng ) gens := GeneratorsOfAlgebra( src ); ims := List( gens, g -> Image( res, g ) ); for r in ims do - if not (r in rng ) then + if not ( r in rng ) then return fail; fi; od; diff --git a/tst/cat1.tst b/tst/cat1.tst index 4d9e4f3..bcda9d9 100644 --- a/tst/cat1.tst +++ b/tst/cat1.tst @@ -51,6 +51,8 @@ gap> IsCat1Algebra( C4 ); true gap> Size2d( C4 ); [ 64, 8 ] +gap> Dimension( C4 ); +[ 6, 3 ] gap> Display( C4 ); Cat1-algebra [..=>..] :-