Skip to content

Commit

Permalink
added operation DirectSumAlgebraActions
Browse files Browse the repository at this point in the history
  • Loading branch information
cdwensley committed Jul 8, 2024
1 parent 35200f3 commit cfdf1d2
Show file tree
Hide file tree
Showing 7 changed files with 214 additions and 57 deletions.
5 changes: 3 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# CHANGES to the 'XModAlg' package

## 1.25 -> 1.25dev (01/07/24)
* (01/07/24) renamed the actions and algebras in the tests/examples as
act1, act, ,,, and added AlgebraActionOnDirectSum
* (08/07/24) renamed the actions and algebras in the tests/examples as
act1, act2, ,,, act6 and added direct sum operations
AlgebraActionOnDirectSum and DirectSumAlgebraActions
* (17/05/24) added operations for a module as an algebra,
revised XModAlgebraByModule
* (26/06/24) added AlgebraActionByHomomorphism,
Expand Down
2 changes: 1 addition & 1 deletion PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SetPackageInfo( rec(
PackageName := "XModAlg",
Subtitle := "Crossed Modules and Cat1-Algebras",
Version := "1.25dev",
Date := "01/07/2024", # dd/mm/yyyy format
Date := "08/07/2024", # dd/mm/yyyy format
License := "GPL-2.0-or-later",

Persons := [
Expand Down
26 changes: 15 additions & 11 deletions doc/algebra.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,21 +260,25 @@ gap> Image( act12, v );
<Oper Name="AlgebraActionBySurjection"
Arg="hom" />
<Description>
Let <M>\theta : A \to B</M> be a surjective algebra homomorphism
such that <M>\ker\theta</M> is contained in the annihilator of <M>A</M>.
Then <M>B</M> acts on <M>A</M> by <M>b \cdot a = pa</M>
where <M>p \in (\theta^{-1}b)</M>.
Let <M>\theta : B \to A</M> be a surjective algebra homomorphism
such that <M>\ker\theta</M> is contained in the annihilator of <M>B</M>.
Then <M>A</M> acts on <M>B</M> by <M>a \cdot b = pb</M>
where <M>p \in (\theta^{-1}a)</M>.
Note that this action is well defined since
<M>\theta^{-1}b = \{ p+k ~|~ k \in \ker\theta \}</M>
and <M>(p+k)a = pa+ka = pa+0</M>.
<M>\theta^{-1}a = \{ p+k ~|~ k \in \ker\theta \}</M>
and <M>(p+k)b = pb+kb = pb+0</M>.
<P/>
Continuing with the previous example,
we construct the quotient algebra <M>Q3 = A3/I3</M>,
and the natural homomorphism <M>\theta : A3 \to Q3</M>.
The kernel of <M>\theta</M> is not contained in
the annihilator of <M>A3</M>, so an attempt to form the action fails.
we construct the quotient algebra <M>Q1 = A1/I1</M>,
and the natural homomorphism <M>\theta_1 : A1 \to Q1</M>.
The kernel of <M>\theta</M> is not contained in the annihilator of <M>A1</M>,
so an attempt to form the action fails.
<P/>
An alternative example involves a single-generator matrix algebra.
An alternative example involves a matrix algebra <M>A_2</M>
with generator <M>m_2</M>, basis <M>\{m_2,m_2^2,m_2^3\}</M>,
and where <M>m_2^4=0</M>.
The ideal <M>I_2</M> is generated by <M>m_2^3</M>
and the quotient <M>Q_2</M> has basis <M>\{[m_2],[m_2^2]\}</M>.
</Description>
</ManSection>

Expand Down
32 changes: 22 additions & 10 deletions examples/module.g
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
############################################################################
##
#W module3.g XModAlg example files Chris Wensley
#W module.g XModAlg example files Chris Wensley
##

LoadPackage( "xmodalg" );
Expand All @@ -16,9 +16,9 @@ SetName( B3, "GR(G)" );
g3 := GeneratorsOfAlgebra( B3 )[2];;
mg3 := RegularAlgebraMultiplier( B3, B3, g3 );;
MB3 := AlgebraByGenerators( Rationals, [ mg3 ] );;
homB3 := AlgebraHomomorphismByImages( A3, MB3, [ m3 ], [ mg3 ] );;
actB3 := AlgebraActionByHomomorphism( homB3, B3 );
Print ( "action actB3 of A3 on B3:\n", actB3, "\n" );
hom3 := AlgebraHomomorphismByImages( A3, MB3, [ m3 ], [ mg3 ] );;
act3 := AlgebraActionByHomomorphism( hom3, B3 );
Print ( "action act3 of A3 on B3:\n", act3, "\n" );

## Section 2.3
m3 := [ [0,1,0], [0,0,1], [1,0,0] ];;
Expand Down Expand Up @@ -86,21 +86,33 @@ Display( C4 );

## Section 2.4.1
A3B3 := DirectSumOfAlgebras( A3, B3 );;
SetName( A3B3, Concatenation( Name(A3), "(+)", Name(B3) ) );
SetDirectSumOfAlgebrasInfo( A3B3,
rec( algebras := [A3,B3], first := [1,Dimension(A3)+1],
embeddings := [ ], projections := [ ] ) );;

## Section 2.4.2
Print( "\n first embedding into A3B3:\n", Embedding( A3B3, 1 ), "\n" );
Print( "second embedding into A3B3:\n", Embedding( A3B3, 2 ), "\n" );
Print( "second projection from A3B3:\n", Projection( A3B3, 2 ), "\n" );

## Section 2.4.3
actA3 := AlgebraActionByMultipliers( A3, A3, A3 );;
MA3 := AlgebraActedOn( actA3 );;
SetName( MA3, "MA3" );
SetName( Image( actA3 ), "imactA3" );
SetName( Image( actB3 ), "imactB3" );
actMA3 := AlgebraActionByMultipliers( A3, A3, A3 );;
act5 := AlgebraActionOnDirectSum( actMA3, act3 );;
Print( "\naction of A on the direct sum of A3 and B3\n", act5, "\n" );

## Section 2.4.4
act6 := DirectSumAlgebraActions( act3, act4 );;
A6 := Source( act6 );
B6 := AlgebraActedOn( act6 );
Print( "\nact6 is the direct sum action of ", A6, " on ", B6, "\n" );
em3 := ImageElm( Embedding( A6, 1 ), m3 );
Print( "matrix m3 embeds in A6 as: ", em3, "\n" );
iem3 := ImageElm( act6, em3 );
Print( "the action act6 maps em3 to:\n", iem3, "\n" );
ea4 := ImageElm( Embedding( A6, 2 ), a4 );
Print( "matrix m4 embeds in A6 as: ", ea4, "\n" );
iea4 := ImageElm( act6, ea4 );
Print( "the action act6 maps ea4 to:\n", iea4, "\n" );

############################################################################
##
Expand Down
55 changes: 37 additions & 18 deletions lib/module.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
## <Oper Name="AlgebraActionByHomomorphism" Arg="hom alg" />
##
## <Description>
## If <M>\alpha : B \to C</M> is an algebra homomorphism
## If <M>\alpha : A \to C</M> is an algebra homomorphism
## where <M>C</M> is an algebra of left module isomorphisms
## of an algebra <M>A</M>, then
## <C>AlgebraActionByHomomorphism( alpha, A )</C>
## attempts to return an action of <M>B</M> on <M>A</M>.
## of an algebra <M>B</M>, then
## <C>AlgebraActionByHomomorphism( alpha, B )</C>
## attempts to return an action of <M>A</M> on <M>B</M>.
## <P/>
## In the example the matrix algebra <C>A3</C>
## and the group algebra <C>B3</C> are isomorphic algebras,
Expand All @@ -38,8 +38,8 @@
## gap> g3 := GeneratorsOfAlgebra( B3 )[2];;
## gap> mg3 := RegularAlgebraMultiplier( B3, B3, g3 );;
## gap> MB3 := AlgebraByGenerators( Rationals, [ mg3 ] );;
## gap> homB3 := AlgebraHomomorphismByImages( A3, MB3, [ m3 ], [ mg3 ] );;
## gap> actB3 := AlgebraActionByHomomorphism( homB3, B3 );
## gap> hom3 := AlgebraHomomorphismByImages( A3, MB3, [ m3 ], [ mg3 ] );;
## gap> act3 := AlgebraActionByHomomorphism( hom3, B3 );
## [ [ [ 0, 1, 0 ], [ 0, 0, 1 ], [ 1, 0, 0 ] ] ] ->
## [ [ (1)*(), (1)*(1,2,3), (1)*(1,3,2) ] -> [ (1)*(1,2,3), (1)*(1,3,2), (1)*()
## ] ]
Expand Down Expand Up @@ -69,15 +69,15 @@ DeclareOperation( "AlgebraActionByHomomorphism",
## </ManSection>
## <Example>
## <![CDATA[
## gap> bdyB3 := AlgebraHomomorphismByImages( A3, MB3, [ m3 ], [ mg3 ] );
## gap> bdy3 := AlgebraHomomorphismByImages( A3, MB3, [ m3 ], [ mg3 ] );
## [ [ [ 0, 1, 0 ], [ 0, 0, 1 ], [ 1, 0, 0 ] ] ] ->
## [ [ (1)*(), (1)*(1,2,3), (1)*(1,3,2) ] -> [ (1)*(1,2,3), (1)*(1,3,2), (1)*()
## ] ]
## gap> bdyB3 := AlgebraHomomorphismByImages( B3, A3, [ g3 ], [ m3 ] );
## gap> bdy3 := AlgebraHomomorphismByImages( B3, A3, [ g3 ], [ m3 ] );
## [ (1)*(1,2,3) ] -> [ [ [ 0, 1, 0 ], [ 0, 0, 1 ], [ 1, 0, 0 ] ] ]
## gap> XB3 := XModAlgebraByBoundaryAndAction( bdy5, act3 );
## gap> X3 := XModAlgebraByBoundaryAndAction( bdy3, act3 );
## [ GR(G) -> A3 ]
## gap> Display( XB3 );
## gap> Display( X3 );
## Crossed module [GR(G) -> A3] :-
## : Source algebra GR(G) has generators:
## [ (1)*(), (1)*(1,2,3) ]
Expand Down Expand Up @@ -117,7 +117,7 @@ DeclareOperation( "PreXModAlgebraByBoundaryAndAction",
## <Example>
## <![CDATA[
## gap> m3 := [ [0,1,0], [0,0,1], [1,0,0] ];;
## gap> A4 := Rationals^[3,3];;
## gap> A4 := Algebra( Rationals, [m3] );;
## gap> SetName( A4, "A4" );;
## gap> V4 := Rationals^3;;
## gap> M4 := LeftAlgebraModule( A4, \*, V4 );;
Expand Down Expand Up @@ -386,6 +386,7 @@ DeclareOperation( "XModAlgebraByModule", [ IsAlgebra, IsLeftModule ] );
## <Example>
## <![CDATA[
## gap> A3B3 := DirectSumOfAlgebras( A3, B3 );;
## gap> SetName( A3B3, Concatenation( Name(A3), "(+)", Name(B3) ) );
## gap> SetDirectSumOfAlgebrasInfo( A3B3,
## > rec( algebras := [A3,B3], first := [1,Dimension(A3)+1],
## > embeddings := [ ], projections := [ ] ) );
Expand Down Expand Up @@ -419,9 +420,8 @@ DeclareAttribute( "DirectSumOfAlgebrasInfo", IsAlgebra, "mutable" );
## [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ],
## [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] ] ) -> [ v.1, v.2, v.3 ]
## gap> Projection( A3B3, 2 );
## CanonicalBasis( <algebra of dimension 6 over Rationals> ) ->
## [ 0*[[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]], 0*[[ 1, 0, 0 ]], [[ 1, 0, 0 ]],
## [[ 0, 1, 0 ]], [[ 0, 0, 1 ]] ]
## CanonicalBasis( A3(+)GR(G) ) -> [ <zero> of ..., <zero> of ...,
## <zero> of ..., (1)*(), (1)*(1,2,3), (1)*(1,3,2) ]
## ]]>
## </Example>
## <#/GAPDoc>
Expand Down Expand Up @@ -451,8 +451,8 @@ DeclareAttribute( "DirectSumOfAlgebrasInfo", IsAlgebra, "mutable" );
## </ManSection>
## <Example>
## <![CDATA[
## gap> actA3 := AlgebraActionByMultipliers( A3, A3, A3 );;
## gap> actAB := AlgebraActionOnDirectSum( actA3, actB3 );
## gap> actMA3 := AlgebraActionByMultipliers( A3, A3, A3 );;
## gap> act5 := AlgebraActionOnDirectSum( actMA3, act3 );
## [ [ [ 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 ] ] ] ->
Expand All @@ -476,16 +476,35 @@ DeclareOperation( "AlgebraActionOnDirectSum",
##
## <Description>
## Let
## If <M>\alpha_1 : A_1 \to C_1</M> is an action on algebra <M>B_1</M>
## If <M>\alpha_1 : A_1 \to C_1</M> is an action on algebra <M>B_1</M>,
## and <M>\alpha_2 : A_2 \to C_2</M> is an action on algebra <M>B_2</M>,
## then <M>A_1 \oplus A_2</M> acts on the direct sum <M>B_1 \oplus B_2</M>
## by <M>(a_1,a_2) \cdot (b_1,b_2) = (a_1 \cdot b_1, a_2 \cdot b_2)</M>.
## The example forms the direct sum of the actions constructed in
## sections <Ref Sect="AlgebraActionBySurjection" />
## and <Ref Sect="AlgebraActionByHomomorphism" />
## <P/>
## </Description>
## </ManSection>
## <Example>
## <![CDATA[
## gap>
## gap> act6 := DirectSumAlgebraActions( act3, act4 );;
## gap> A6 := Source( act6 );
## A3(+)A4
## gap> B6 := AlgebraActedOn( act6 );
## GR(G)(+)A(M4)
## gap> em3 := ImageElm( Embedding( A6, 1 ), m3 );
## [ [ 0, 1, 0, 0, 0, 0 ], [ 0, 0, 1, 0, 0, 0 ], [ 1, 0, 0, 0, 0, 0 ],
## [ 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0 ] ]
## gap> ImageElm( act6, em3 );
## Basis( GR(G)(+)A(M4), [ v.1, v.2, v.3, v.4, v.5, v.6 ] ) ->
## [ v.2, v.3, v.1, 0*v.1, 0*v.1, 0*v.1 ]
## gap> ea4 := ImageElm( Embedding( A6, 2 ), a4 );
## [ [ 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0 ],
## [ 0, 0, 0, 0, 2, 3 ], [ 0, 0, 0, 3, 0, 2 ], [ 0, 0, 0, 2, 3, 0 ] ]
## gap> ImageElm( act6, ea4 );
## Basis( GR(G)(+)A(M4), [ v.1, v.2, v.3, v.4, v.5, v.6 ] ) ->
## [ 0*v.1, 0*v.1, 0*v.1, (3)*v.5+(2)*v.6, (2)*v.4+(3)*v.6, (3)*v.4+(2)*v.5 ]
## ]]>
## </Example>
## <#/GAPDoc>
Expand Down
108 changes: 104 additions & 4 deletions lib/module.gi
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
InstallMethod( AlgebraActionByHomomorphism,
"for an algebra homomorphism and an algebra", true,
[ IsAlgebraHomomorphism, IsAlgebra ], 0,
function ( hom, A )
function ( hom, B )
local C, genC;
if not IsAlgebraAction( hom ) then
Info( InfoXModAlg, 1, "hom is not an algebra action" );
return fail;

Check warning on line 21 in lib/module.gi

View check run for this annotation

Codecov / codecov/patch

lib/module.gi#L20-L21

Added lines #L20 - L21 were not covered by tests
fi;
C := Range( hom );
genC := GeneratorsOfAlgebra( C );
if not ( A = Source( genC[1] ) ) then
Info( InfoXModAlg, 1, "Range(hom) not isomorphisms of A" );
if not ( B = Source( genC[1] ) ) then
Info( InfoXModAlg, 1, "Range(hom) not isomorphisms of B" );
return fail;

Check warning on line 27 in lib/module.gi

View check run for this annotation

Codecov / codecov/patch

lib/module.gi#L26-L27

Added lines #L26 - L27 were not covered by tests
fi;
SetAlgebraActionType( hom, "homomorphism" );
SetAlgebraActedOn( hom, A );
SetAlgebraActedOn( hom, B );
return hom;
end );

Expand Down Expand Up @@ -116,6 +116,7 @@ function( A, M )
fi;
act := AlgebraGeneralMappingByImages( A, C, genA, imact );
SetIsAlgebraAction( act, true );
SetAlgebraActedOn( act, B );
SetAlgebraActionType( act, "module" );
return act;
end );
Expand Down Expand Up @@ -249,8 +250,107 @@ function( act1, act2 )
C := AlgebraByGenerators( domA, genC );
act := AlgebraHomomorphismByImages( A, C, genA, genC );
SetIsAlgebraAction( act, true );
SetAlgebraActedOn( act, B );
SetAlgebraActionType( act, "on direct sum 1" );
return act;
end );

#############################################################################
##
#M DirectSumAlgebraActions
##
InstallMethod( DirectSumAlgebraActions, "for two algebra actions", true,
[ IsAlgebraAction, IsAlgebraAction ], 0,
function( act1, act2 )
local domA, A1, basA1, nA1, A2, basA2, nA2, A, basA, firstA,
B1, basB1, nB1, B2, basB2, nB2, B, basB, firstB, zB, zB1, zB2,
C1, basC1, nC1, C2, basC2, nC2, C, basC, c, imc, hom,
eA1, imA1, eA2, imA2, eB1, imB1, eB2, imB2, i, act;
A1 := Source( act1 );
domA := LeftActingDomain( A1 );
basA1 := BasisVectors( Basis( A1 ) );
nA1 := Length( basA1 );
B1 := AlgebraActedOn( act1 );
basB1 := BasisVectors( Basis( B1 ) );
nB1 := Length( basB1 );
C1 := Range( act1 );
basC1 := BasisVectors( Basis( C1 ) );
nC1 := Length( basC1 );
A2 := Source( act2 );
if not ( domA = LeftActingDomain( A2 ) ) then
Error( "act1 and act2 have different left acting domains" );

Check warning on line 281 in lib/module.gi

View check run for this annotation

Codecov / codecov/patch

lib/module.gi#L281

Added line #L281 was not covered by tests
fi;
basA2 := BasisVectors( Basis( A2 ) );
nA2 := Length( basA2 );
B2 := AlgebraActedOn( act2 );
basB2 := BasisVectors( Basis( B2 ) );
nB2 := Length( basB2 );
C2 := Range( act2 );
basC2 := BasisVectors( Basis( C2 ) );
nC2 := Length( basC2 );
A := DirectSumOfAlgebras( A1, A2 );
if HasName( A1 ) and HasName( A2 ) then
SetName( A, Concatenation( Name(A1), "(+)", Name(A2) ) );
fi;
firstA := [ 1, 1 + Dimension( A1 ) ];
SetDirectSumOfAlgebrasInfo( A,
rec( algebras := [ A1, A2 ],
first := firstA,
embeddings := [ ],
projections := [ ] ) );
eA1 := Embedding( A, 1 );
imA1 := List( [1..nA1], i -> ImageElm( eA1, basA1[i] ) );
eA2 := Embedding( A, 2 );
imA2 := List( [1..nA2], j -> ImageElm( eA2, basA2[j] ) );
basA := Concatenation( imA1, imA2 );
B := DirectSumOfAlgebras( B1, B2 );
if HasName( B1 ) and HasName( B2 ) then
SetName( B, Concatenation( Name(B1), "(+)", Name(B2) ) );
fi;
firstB := [ 1, 1 + Dimension( B1 ) ];
SetDirectSumOfAlgebrasInfo( B,
rec( algebras := [ B1, B2 ],
first := firstB,
embeddings := [ ],
projections := [ ] ) );
eB1 := Embedding( B, 1 );
imB1 := List( [1..nB1], i -> ImageElm( eB1, basB1[i] ) );
eB2 := Embedding( B, 2 );
imB2 := List( [1..nB2], j -> ImageElm( eB2, basB2[j] ) );
basB := Concatenation( imB1, imB2 );
basC := ListWithIdenticalEntries( nC1+nC2, 0 );
zB := Zero( B );
zB1 := List( [1..nB1], i -> zB );
zB2 := List( [1..nB2], i -> zB );
for i in [1..nC1] do
## c := ImageElm( act1, basA1[i] );
c := basC1[i];
imc := List( basB1, b -> ImageElm( eB1, ImageElm( c, b ) ) );
imc := Concatenation( imc, zB2 );
hom := LeftModuleHomomorphismByImages( B, B, basB, imc );
if ( hom = fail ) then
Print( "!!! hom = fail !!!\n" );

Check warning on line 332 in lib/module.gi

View check run for this annotation

Codecov / codecov/patch

lib/module.gi#L332

Added line #L332 was not covered by tests
fi;
basC[i] := hom;
od;
for i in [1..nC2] do
## c := ImageElm( act2, basA2[i] );
c := basC2[i];
imc := List( basB2, b -> ImageElm( eB2, ImageElm( c, b ) ) );
imc := Concatenation( zB1, imc );
hom := LeftModuleHomomorphismByImages( B, B, basB, imc );
basC[nC1+i] := hom;
od;

C := AlgebraByGenerators( domA, basC );
act := AlgebraGeneralMappingByImages( A, C, basA, basC );
SetIsAlgebraAction( act, true );
SetAlgebraActedOn( act, B );
SetAlgebraActionType( act, "direct sum" );
return act;
end );





Loading

0 comments on commit cfdf1d2

Please sign in to comment.