############################################################################# ## #W gpdaut.gi GAP4 package `groupoids' Chris Wensley #W & Emma Moore
############################################################################# ## #M GroupoidAutomorphismByObjectPermNC #M GroupoidAutomorphismByObjectPerm ##
InstallMethod( GroupoidAutomorphismByObjectPermNC , "for a single piece groupoid and a permutation of objects", true,
[ IsGroupoid and IsDirectProductWithCompleteDigraphDomain,
IsHomogeneousList ], 0, function( gpd, oims )
local obs, gens, ngens, images, i, a, pt, ph, mor, L;
obs := gpd!.objects;
gens := GeneratorsOfGroupoid( gpd );
ngens := Length( gens );
images := [1..ngens]; for i in [1..ngens] do
a := gens[i];
pt := Position( obs, a![3] );
ph := Position( obs, a![4] );
images[i] := Arrow( gpd, a![2], oims[pt], oims[ph] );
od; if ( fail in images ) then
Error( "the set of images contains 'fail'" ); fi;
mor := GroupoidHomomorphismFromSinglePiece( gpd, gpd, gens, images );
SetIsInjectiveOnObjects( mor, true );
SetIsSurjectiveOnObjects( mor, true );
L := [1..Length(obs)];
SortParallel( ShallowCopy( oims ), L );
SetOrder( mor, Order( PermList( L ) ) );
SetIsGroupoidAutomorphismByObjectPerm( mor, true );
SetAutomorphismDomain( mor, gpd );
return mor; end );
InstallMethod( GroupoidAutomorphismByObjectPermNC , "for a single piece groupoid with rays rep", true,
[ IsGroupoid and IsSinglePieceRaysRep, IsHomogeneousList ], 0, function( gpd, oims )
local iso, inv, sgpd, aut;
iso := IsomorphismStandardGroupoid( gpd, ObjectList( gpd ) );
inv := InverseGeneralMapping( iso );
sgpd := Image( iso );
aut := GroupoidAutomorphismByObjectPermNC( sgpd, oims );
return iso * aut * inv; end );
InstallMethod( GroupoidAutomorphismByObjectPermNC, "for a hom discrete groupoid and a permutation of objects", true,
[ IsHomogeneousDiscreteGroupoid, IsHomogeneousList ], 0, function( gpd, oims )
local gpd1, gp, id, homs, mor, L;
gpd1 := Pieces( gpd )[1];
gp := gpd1!.magma;
id := IdentityMapping( gp );
homs := List( oims, o -> id );
mor := GroupoidHomomorphismFromHomogeneousDiscreteNC
( gpd, gpd, homs, oims );
SetIsInjectiveOnObjects( mor, true );
SetIsSurjectiveOnObjects( mor, true );
L := [1..Length(oims)];
SortParallel( ShallowCopy( oims ), L );
SetOrder( mor, Order( PermList( L ) ) );
SetIsGroupoidAutomorphismByObjectPerm( mor, true );
SetAutomorphismDomain( mor, gpd );
return mor; end );
InstallMethod( GroupoidAutomorphismByObjectPerm, "for a groupoid and a permutation of objects", true,
[ IsGroupoid, IsHomogeneousList ], 0, function( gpd, oims )
local obs, pos;
obs := ObjectList( gpd );
pos := PermList( List( oims, o -> Position( obs, o ) ) ); if ( pos = fail ) then
Error( "object images not a permutation of the objects" ); fi;
return GroupoidAutomorphismByObjectPermNC( gpd, oims ); end );
############################################################################# ## #M GroupoidAutomorphismByGroupAutoNC #M GroupoidAutomorphismByGroupAuto ##
InstallMethod( GroupoidAutomorphismByGroupAutoNC , "for a groupoid and an automorphism of the root group", true,
[ IsGroupoid and IsSinglePiece, IsGroupHomomorphism and IsBijective ], 0, function( gpd, hom )
local gens, images, i, a, mor;
gens := GeneratorsOfGroupoid( gpd );
images := ShallowCopy( gens ); for i in [1..Length(gens) - Length(ObjectList(gpd)) + 1] do
a := gens[i];
images[i] := Arrow( gpd, ImageElm(hom,a![2]), a![3], a![4] );
od;
mor := GroupoidHomomorphismFromSinglePiece( gpd, gpd, gens, images );
SetIsInjectiveOnObjects( mor, true );
SetIsSurjectiveOnObjects( mor, true );
SetOrder( mor, Order( hom ) );
SetIsGroupoidAutomorphismByGroupAuto( mor, true );
SetAutomorphismDomain( mor, gpd );
return mor; end );
InstallMethod( GroupoidAutomorphismByGroupAuto, "for a groupoid and an automorphism of the root group", true,
[ IsGroupoid and IsSinglePiece, IsGroupHomomorphism ], 0, function( gpd, hom )
local rgp;
rgp := gpd!.magma; if not ( (Source(hom) = rgp) and (Range(hom) = rgp) ) then
Error( "hom not an endomorphism of the root group" ); fi; if not IsBijective( hom ) then
Error( "hom is not an automorphism" ); fi;
return GroupoidAutomorphismByGroupAutoNC( gpd, hom ); end );
obs := ObjectList( gpd );
m := GroupoidHomomorphismFromHomogeneousDiscreteNC( gpd, gpd, homs, obs );
SetIsEndoGeneralMapping( m, true );
SetIsInjectiveOnObjects( m, true );
SetIsSurjectiveOnObjects( m, true );
orders := List( homs, Order );
SetOrder( m, Lcm( orders ) );
SetAutomorphismDomain( m, gpd );
return m; end );
pieces := Pieces( gpd );
len := Length( pieces ); if not ( len = Length( homs ) ) then
Error( "length of <homs> not equal to number of objects on <gpd>," ); fi; for i in [1..len] do
p := pieces[i];
g := p!.magma;
h := homs[i]; if not ( (Source(h) = g) and (Range(h) = g) ) then
Error( "<h> not an endomorphism of group <g> at object <i>," ); fi; if not IsBijective( h ) then
Error( "<h> not an automorphism of group <g> at object <i>," ); fi;
od;
return GroupoidAutomorphismByGroupAutosNC( gpd, homs ); end );
############################################################################# ## #M GroupoidAutomorphismByNtupleNC #M GroupoidAutomorphismByNtuple ##
InstallMethod( GroupoidAutomorphismByNtupleNC , "for a groupoid and a list of elements of the root group", true,
[ IsGroupoid and IsSinglePiece, IsHomogeneousList ], 0, function( gpd, shifts )
local gens, ngens, obs, images, i, p, q, a, mor;
gens := GeneratorsOfGroupoid( gpd );
ngens := Length( gens );
obs := gpd!.objects;
images := ShallowCopy( gens ); for i in [1..ngens] do
a := gens[i];
p := Position( obs, a![3] );
q := Position( obs, a![4] );
images[i] := Arrow( gpd, (shifts[p])^-1*a![2]*shifts[q], a![3], a![4] );
od;
mor := GroupoidHomomorphismFromSinglePiece( gpd, gpd, gens, images );
SetOrder( mor, Lcm( List( shifts, Order ) ) );
SetIsInjectiveOnObjects( mor, true );
SetIsSurjectiveOnObjects( mor, true );
SetIsGroupoidAutomorphismByRayShifts( mor, true );
return mor; end );
InstallMethod( GroupoidAutomorphismByNtuple, "for a groupoid and a list of elements of the root group", true,
[ IsGroupoid and IsSinglePiece, IsHomogeneousList ], 0, function( gpd, shifts )
local rgp, rays, nobs, conj;
rgp := gpd!.magma;
rays := gpd!.rays;
nobs := Length( gpd!.objects ); if not ForAll( shifts, s -> s in rgp ) then
Error( "ray shifts not all in the root group" ); fi;
return GroupoidAutomorphismByNtupleNC( gpd, shifts ); end );
############################################################################# ## #M GroupoidAutomorphismByRayShiftsNC #M GroupoidAutomorphismByRayShifts ##
InstallMethod( GroupoidAutomorphismByRayShiftsNC , "for a groupoid and a list of elements of the root group", true,
[ IsGroupoid and IsSinglePiece, IsHomogeneousList ], 0, function( gpd, shifts ) if not ( shifts[1] = One( gpd!.magma ) ) then
Error( "the first ray shift is not the identity" ); fi;
return GroupoidAutomorphismByNtupleNC( gpd, shifts ); end );
InstallMethod( GroupoidAutomorphismByRayShifts, "for a groupoid and a list of elements of the root group", true,
[ IsGroupoid and IsSinglePiece, IsHomogeneousList ], 0, function( gpd, shifts ) if not ( shifts[1] = One( gpd!.magma ) ) then
Error( "the first ray shift is not the identity" ); fi;
return GroupoidAutomorphismByNtuple( gpd, shifts ); end );
############################################################################# ## #M GroupoidInnerAutomorphism #M GroupoidInnerAutomorphismNormalSubgroupoid ##
InstallMethod( GroupoidInnerAutomorphism, "for a groupoid and an element", true,
[ IsGroupoid, IsGroupoidElement ], 0, function( gpd, e )
Error( "not yet implemented for unions of groupoids" ); end );
InstallMethod( GroupoidInnerAutomorphism, "for a groupoid and an element", true,
[ IsGroupoid and IsSinglePieceDomain, IsGroupoidElement ], 0, function( gpd, e )
local gens, images;
Info( InfoGroupoids, 3, "GroupoidInnerAutomorphism from single piece" );
gens := GeneratorsOfGroupoid( gpd );
images := List( gens, g -> g^e );
return GroupoidHomomorphism( gpd, gpd, gens, images ); end );
InstallMethod( GroupoidInnerAutomorphism, "for a groupoid and an element", true,
[ IsGroupoid and IsDiscreteDomainWithObjects, IsGroupoidElement ], 0, function( gpd, e )
local obs, nobs, pos, id, auts;
Info( InfoGroupoids, 3, "GroupoidInnerAutomorphism from discrete domain" );
obs := gpd!.objects;
nobs := Length( obs );
pos := Position( obs, e![3] );
id := IdentityMapping( gpd!.magma );
auts := List( [1..nobs], i -> id );
auts[pos] := InnerAutomorphism( gpd!.magma, e![2] );
return GroupoidAutomorphismByGroupAutosNC( gpd, auts ); end );
InstallMethod( GroupoidInnerAutomorphismNormalSubgroupoid, "for a groupoid, a subgroupoid, and an element", true,
[ IsGroupoid and IsSinglePieceDomain, IsGroupoid, IsGroupoidElement ], 0, function( gpd, sub, e )
local obs, gens, images, pieces, n, homs, oims, i, p, o, q, h;
Info( InfoGroupoids, 3, "GroupoidInnerAutomorphismNormalSubgroupoid" ); if not IsWideSubgroupoid( gpd, sub ) then
Error( "sub is not a subgroupoid of gpd" ); fi; if IsSinglePiece( sub ) then if not ( e![2] in RootGroup( sub ) ) then
Error( "element e![2] in not in the root group of sub" ); fi; elif IsHomogeneousDomainWithObjects( sub ) then if not ( e![2] in RootGroup( Pieces(sub)[1] ) ) then
Error( "element e![2] in not in the root groups of sub" ); fi; else
Error( "invalid subgroupoid sub" ); fi;
obs := gpd!.objects; if IsSinglePiece( sub ) then
gens := GeneratorsOfGroupoid( sub );
images := List( gens, g -> g^e );
return GroupoidHomomorphism( sub, sub, gens, images ); elif IsHomogeneousDomainWithObjects( sub ) then
pieces := Pieces( sub );
n := Length( pieces );
homs := ListWithIdenticalEntries( n, 0 );
oims := ListWithIdenticalEntries( n, 0 ); for i in [1..n] do
p := pieces[i];
gens := GeneratorsOfGroupoid( p );
images := List( gens, g -> g^e );
o := images[1]![3];
oims[i] := o;
q := pieces[ Position( obs, o ) ];
h := GroupoidHomomorphism( p, q, gens, images );
homs[i] := RootGroupHomomorphism( h );
od;
return GroupoidHomomorphismFromHomogeneousDiscrete( sub, sub, homs, oims ); else
return fail; fi; end );
gpd := AutomorphismDomain( agpd );
gp := gpd!.magma; if IsSinglePieceDomain( gpd ) then
n := Length( ObjectList( gpd ) );
aut := AutomorphismGroup( gpd!.magma );
return Factorial( n ) * Size( aut ) * Size( gp )^(n-1); elif IsDiscreteDomainWithObjects( gpd )
and IsHomogeneousDomainWithObjects( gpd ) then
n := Length( ObjectList( gpd ) );
aut := AutomorphismGroup( gpd!.magma );
return Factorial( n ) * Size( aut )^n; fi;
return fail; end );
############################################################################## ## #M NiceObjectAutoGroupGroupoid( <gpd>, <aut> ) . . create a nice monomorphism ##
InstallMethod( NiceObjectAutoGroupGroupoid, "for a single piece groupoid", true,
[ IsGroupoid and IsSinglePieceDomain, IsAutomorphismGroupOfGroupoid ], 0, function( gpd, aut )
InstallMethod( AutomorphismGroupOfGroupoid, "for an arbitrary groupoid",
true, [ IsGroupoid ], 0, function( gpd )
Info( InfoGroupoids, 1, "use AutomorphismGroupoidOfGroupoid for a union of pieces" );
return fail; end );
InstallMethod( \in, "method for an automorphism of a single object groupoid", true,
[ IsGroupWithObjectsHomomorphism, IsGroup ], 0, function( a0, agp )
local gens, src, obs, rng, mgi, rgp, argp;
gens := GeneratorsOfGroup( agp ); if not ForAll( gens, g -> IsGroupoidHomomorphism(g)
and IsAutomorphismWithObjects(g) ) then
return false; fi;
src := Source( a0 );
obs := ObjectList( src ); if ( Length( obs ) = 1 ) then
rng := Range( a0 ); if not ( src = rng ) then
return false; fi;
mgi := MappingGeneratorsImages( a0 );
rgp := RootGroup( src );
argp := AutomorphismGroup( rgp );
return ForAll( mgi, g -> g in argp ); else
Error( "method not yet implemented" ); fi; end );
InstallMethod( \in, "method for an automorphism of a single piece groupoid", true,
[ IsGroupWithObjectsHomomorphism, IsAutomorphismGroupOfGroupoid ], 0, function( a, aut )
local gpd, gp, data;
gpd := AutomorphismDomain( aut );
gp := gpd!.magma;
data := MappingToSinglePieceData( a )[1]; if not ( data[1] in AutomorphismGroup( gp ) ) then
return false; fi; if not ForAll( data[2], o -> o in ObjectList( gpd ) ) then
return false; fi; if not ForAll( data[3], e -> e in gp ) then
return false; fi;
return true; end );
InstallMethod( \in, "for groupoid hom and automorphism group : discrete", true,
[ IsGroupoidHomomorphismFromHomogeneousDiscrete and IsGroupoidHomomorphism,
IsAutomorphismGroupOfGroupoid ], 0, function( a, aut )
local gens, g1, gpd, obs, imobs, G, AG;
gens := GeneratorsOfGroup( aut );
gpd := AutomorphismDomain( aut ); if not ( ( Source(a) = gpd ) and ( Range(a) = gpd ) ) then
Info( InfoGroupoids, 2, "require Source(a) = Range(a) = gpd" );
return false; fi;
obs := ObjectList( gpd );
imobs := ShallowCopy( ImagesOfObjects( a ) );
Sort( imobs ); if not ( obs = imobs ) then
Info( InfoGroupoids, 2, "incorrect images of objects" );
return false; fi;
G := Source(a)!.magma;
AG := AutomorphismGroup( G ); if not ForAll( ObjectHomomorphisms(a), h -> h in AG ) then
Info( InfoGroupoids, 2, "object homomorphisms incorrect" );
return false; fi; #? is there anything else to test?
return true; end );
############################################################################## ## methods added 11/09/18 for automorphisms of homogeneous groupoids
InstallMethod( GroupoidAutomorphismByPiecesPermNC, "for a homogeneous groupoid and a permutation of the pieces", true,
[ IsGroupoid and IsHomogeneousDomainWithObjects, IsPerm ], 0, function( gpd, p )
local pieces, n, isos, mor;
pieces := Pieces( gpd );
n := Length( pieces );
isos := List( [1..n],
i -> IsomorphismNewObjects( pieces[i], pieces[i^p]!.objects ) );
mor := HomomorphismByUnion( gpd, gpd, isos );
SetOrder( mor, Order( p ) );
SetIsGroupoidAutomorphismByPiecesPerm( mor, true );
return mor; end );
InstallMethod( GroupoidAutomorphismByPiecesPerm, "for a homogeneous groupoid and a permutation of pieces", true,
[ IsGroupoid and IsHomogeneousDomainWithObjects, IsPerm ], 0, function( gpd, p )
local pieces, n, obs, pos;
pieces := Pieces( gpd );
n := Length( pieces ); if ( LargestMovedPoint( p ) > n ) then
Error( "degree of permutation too large" ); fi;
return GroupoidAutomorphismByPiecesPermNC( gpd, p ); end );
############################################################################# ## #M IsomorphismClassPositionsOfGroupoid ##
InstallMethod( IsomorphismClassPositionsOfGroupoid, "for a gpd with pieces",
true, [ IsGroupoid ], 0, function( gpd )
local P, lenP, found, i, classes, L, j, iso;
P := Pieces( gpd );
lenP := Length( P );
found := ListWithIdenticalEntries( lenP, false );
i := 0;
classes := [ ]; while ( i < lenP ) do
i := i+1; while ( ( i <= lenP ) and found[i] ) do
i := i + 1;
od; if ( i <= lenP ) then
L := [ i ];
found[i] := true; for j in [i+1..lenP] do if not found[j] then
iso := IsomorphismGroupoids( P[i], P[j] ); if not ( iso = fail ) then
Add( L, j );
found[j] := true; fi; fi;
od;
Add( classes, L ); fi;
od;
return classes; end );
############################################################################# ## #M AutomorphismGroupoidOfGroupoid ##
InstallMethod( AutomorphismGroupoidOfGroupoid, "for a single piece groupoid",
true, [ IsGroupoid and IsSinglePieceDomain ], 0, function( gpd )
local obs, A;
A := AutomorphismGroupOfGroupoid( gpd );
obs := ObjectList( gpd );
return MagmaWithSingleObject( A, obs ); end );
InstallMethod( AutomorphismGroupoidOfGroupoid, "for a homogeneous groupoid",
true, [ IsGroupoid and IsHomogeneousDomainWithObjects ], 0, function( gpd )
local pieces, obs, n, p1, ap1, rays, aut, niceob, nicemap;
InstallOtherMethod( GroupoidActionByConjugation, "method for a groupoid and a normal subgroupoid", true,
[ IsGroupoid and IsSinglePieceDomain, IsGroupoid ], 0, function( gpd, sub )
local issing, ishomd, aut, map, act;
issing := false;
ishomd := false; if not IsWideSubgroupoid( gpd, sub ) then
Error( "sub is not a subgroupoid of gpd" ); fi; if IsSinglePiece( sub ) then
issing := true; elif IsHomogeneousDomainWithObjects( sub ) then
ishomd := true; else
Error( "invalid subgroupoid sub" ); fi;
aut := AutomorphismGroupOfGroupoid( sub );
map := function(a)
return GroupoidInnerAutomorphismNormalSubgroupoid(gpd,sub,a); end;
act := rec();
ObjectifyWithAttributes( act, GroupoidActionType,
Source, gpd,
Range, aut,
ActionMap, map,
IsGroupoidAction, true );
return act; end );
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.