Homomorphisms of many-object structures

A homomorphism f from a magma with objects M to a magma with objects N consists of a map f_O from the objects of M to those of N together with a map f_A from the arrows of M to those of N which is compatible with tail and head and which preserves multiplication: f_A((a : u \to v)*f(b : v \to w)) ~=~ f_A(a*b : u \to w) with tail f_O(u) and head f_O(v).

Homomorphisms of magmas with objects
As usual, there are a variety of homomorphism constructors. The basic construction is a homomorphism M \to N with both M and N connected, which is implemented as IsHomomorphismToSinglePieceRep with attributes Source, Range and PieceImages. We require the following information: a magma homomorphism f from the underlying of M to the underlying magma of N. a list imobs of the images of the objects of M; In the example we construct endomappings of m and M78.

gap> tup1 := [ Tuple([m1,m2]), Tuple([m2,m1]), Tuple([m3,m4]), Tuple([m4,m3]) ]; gap> f1 := GeneralMappingByElements( m, m, tup1 ); f1 = <general mapping: m -> m > gap> IsMagmaHomomorphism( f1 ); true gap> tup2 := [ Tuple([m1,m1]), Tuple([m2,m1]), Tuple([m3,m1]), Tuple([m4,m1]) ];; gap> f2 := GeneralMappingByElements( m, m, tup2 );; gap> IsMagmaHomomorphism( f2 ); true gap> map1 := HomomorphismFromSinglePiece( M78, M78, [-8,-7], f1 ); magma with objects homomorphism : M78 -> M78 gap> Display( map1 ); Mapping to single piece magma: [ M78 ] -> [ M78 ] magma mapping: <mapping: m -> m > object map: [ -8, -7 ] -> [ -8, -7 ] Homomorphism to connected magma: [ M78 ] -> [ M78 ] object map = [ [ -8, -7 ], [ -8, -7 ] ] homomorphism = <homomorphism: m -> m > gap> idm := f1*f1;; gap> idmap := HomomorphismFromSinglePiece( M78, M78, idm, [-7,-8] ); gap> map2 := HomomorphismFromSinglePiece( M78, M78, f2, [-7,-8] );