The family containing elements in the magma ring RM in fact contains all elements with coefficients in the family of elements of R and magma elements in the family of elements of M. So arithmetic operations with coefficients outside R or with magma elements outside M might create elements outside RM.
It should be mentioned that each call of FreeMagmaRing creates
a new family of elements,
so for example the elements of two group rings of permutation groups
over the same ring lie in different families and therefore are regarded
as different.
gap> g:= SymmetricGroup( 3 );; gap> h:= AlternatingGroup( 3 );; gap> IsSubset( g, h ); true gap> f:= GF(2);; gap> fg:= GroupRing( f, g ); <algebra-with-one over GF(2), with 2 generators> gap> fh:= GroupRing( f, h ); <algebra-with-one over GF(2), with 1 generators> gap> IsSubset( fg, fh ); false gap> o1:= One( fh ); o2:= One( fg ); o1 = o2; (Z(2)^0)*() (Z(2)^0)*() false gap> emb:= Embedding( g, fg );; gap> im:= Image( emb, h ); <group of size 3 with 1 generators> gap> IsSubset( fg, im ); true
There is no generic external representation for elements in an arbitrary free magma ring. For example, polynomials are elements of a free magma ring, and they have an external representation relying on the special form of the underlying monomials. On the other hand, elements in a group ring of a permutation group do not admit such an external representation.
For convenience, magma rings constructed with FreeAlgebra,
FreeAssociativeAlgebra, FreeAlgebraWithOne, and
FreeAssociativeAlgebraWithOne support an external representation of
their elements, which is defined as a list of length 2,
the first entry being the zero coefficient, the second being a list with
the external representations of the magma elements at the odd positions
and the corresponding coefficients at the even positions.
As the above examples show, there are several possible representations
of magma ring elements, the representations used for polynomials
(see Polynomials and Rational Functions)
as well as the default representation IsMagmaRingObjDefaultRep
of magma ring elements.
The latter simply stores the zero coefficient and a list containing
the coefficients of the element at the even positions
and the corresponding magma elements at the odd positions,
where the succession is compatible with the ordering of magma elements
via /.
GAP 4 manual