<html><head><title>[ref] 63 Magma Rings</title></head> <body text="#000000" bgcolor="#ffffff"> [<a href="../index.htm">Top</a>] [<a href = "chapters.htm">Up</a>] [<a href ="CHAP062.htm">Previous</a>] [<a href ="CHAP064.htm">Next</a>] [<a href = "theindex.htm">Index</a>] <h1>63 Magma Rings</h1><p> <P> <H3>Sections</H3> <oL> <li> <A HREF="CHAP063.htm#SECT001">Free Magma Rings</a> <li> <A HREF="CHAP063.htm#SECT002">Elements of Free Magma Rings</a> <li> <A HREF="CHAP063.htm#SECT003">Natural Embeddings related to Magma Rings</a> <li> <A HREF="CHAP063.htm#SECT004">Magma Rings modulo Relations</a> <li> <A HREF="CHAP063.htm#SECT005">Magma Rings modulo the Span of a Zero Element</a> <li> <A HREF="CHAP063.htm#SECT006">Technical Details about the Implementation of Magma Rings</a> </ol><p> <p> <a name = "I0"></a> <a name = "I1"></a> Given a magma <i>M</i> then the <strong>free magma ring</strong> (or <strong>magma ring</strong> for short) <i>RM</i> of <i>M</i> over a ring-with-one <i>R</i> is the set of finite sums ∑<sub><i>i</i> ∈ <i>I</i></sub> <i>r</i><sub><i>i</i></sub> <i>m</i><sub><i>i</i></sub> with <i>r</i><sub><i>i</i></sub> ∈ <i>R</i>, and <i>m</i><sub><i>i</i></sub> ∈ <i>M</i>. With the obvious addition and <i>R</i>-action from the left, <i>RM</i> is a free <i>R</i>-module with <i>R</i>-basis <i>M</i>, and with the usual convolution product, <i>RM</i> is a ring. <p> Typical examples of free magma rings are <ul> <li> (multivariate) polynomial rings (see <a href="CHAP064.htm#SECT014">Polynomial Rings</a>), where the magma is a free abelian monoid generated by the indeterminates, <li> group rings (see <a href="CHAP063.htm#SSEC001.5">IsGroupRing</a>), where the magma is a group, <li> Laurent polynomial rings, which are group rings of the free abelian groups generated by the indeterminates, <li> free algebras and free associative algebras, with or without one, where the magma is a free magma or a free semigroup, or a free magma-with-one or a free monoid, respectively. </ul> Note that a free Lie algebra is <strong>not</strong> a magma ring, because of the additional relations given by the Jacobi identity; see <a href="CHAP063.htm#SECT004">Magma Rings modulo Relations</a> for a generalization of magma rings that covers such structures. <p> The coefficient ring <i>R</i> and the magma <i>M</i> cannot be regarded as subsets of <i>RM</i>, hence the natural <strong>embeddings</strong> of <i>R</i> and <i>M</i> into <i>RM</i> must be handled via explicit embedding maps (see <a href="CHAP063.htm#SECT003">Natural Embeddings related to Magma Rings</a>). Note that in a magma ring, the addition of elements is in general different from an addition that may be defined already for the elements of the magma; for example, the addition in the group ring of a matrix group does in general <strong>not</strong> coincide with the addition of matrices. Consider the following example. <pre> gap> a:= Algebra( GF(2), [ [ [ Z(2) ] ] ] );; Size( a ); 2 gap> rm:= FreeMagmaRing( GF(2), a );; gap> emb:= Embedding( a, rm );; gap> z:= Zero( a );; o:= One( a );; gap> imz:= z ^ emb; IsZero( imz ); (Z(2)^0)*[ [ 0*Z(2) ] ] false gap> im1:= ( z + o ) ^ emb; (Z(2)^0)*[ [ Z(2)^0 ] ] gap> im2:= z ^ emb + o ^ emb; (Z(2)^0)*[ [ 0*Z(2) ] ]+(Z(2)^0)*[ [ Z(2)^0 ] ] gap> im1 = im2; false </pre> <p> <p> <h2><a name="SECT001">63.1 Free Magma Rings</a></h2> <p><p> <a name = "SSEC001.1"></a> <li><code>FreeMagmaRing( </code><var>R</var><code>, </code><var>M</var><code> ) F</code> <p> is a free magma ring over the ring <var>R</var>, free on the magma <var>M</var>. <p> <a name = "SSEC001.2"></a> <li><code>GroupRing( </code><var>R</var><code>, </code><var>G</var><code> ) F</code> <p> is the group ring of the group <var>G</var>, over the ring <var>R</var>. <p> <a name = "SSEC001.3"></a> <li><code>IsFreeMagmaRing( </code><var>D</var><code> ) C</code> <p> A domain lies in the category <code>IsFreeMagmaRing</code> if it has been constructed as a free magma ring. In particular, if <var>D</var> lies in this category then the operations <code>LeftActingDomain</code> (see <a href="CHAP055.htm#SSEC001.11">LeftActingDomain</a>) and <code>UnderlyingMagma</code> (see <a href="CHAP063.htm#SSEC001.6">UnderlyingMagma</a>) are applicable to <var>D</var>, and yield the ring <i>R</i> and the magma <i>M</i> such that <var>D</var> is the magma ring <i>RM</i>. <p> So being a magma ring in <font face="Gill Sans,Helvetica,Arial">GAP</font> includes the knowledge of the ring and the magma. Note that a magma ring <i>RM</i> may abstractly be generated as a magma ring by a magma different from the underlying magma <i>M</i>. For example, the group ring of the dihedral group of order 8 over the field with 3 elements is also spanned by a quaternion group of order 8 over the same field. <pre> gap> d8:= DihedralGroup( 8 ); <pc group of size 8 with 3 generators> gap> rm:= FreeMagmaRing( GF(3), d8 ); <algebra-with-one over GF(3), with 3 generators> gap> emb:= Embedding( d8, rm );; gap> gens:= List( GeneratorsOfGroup( d8 ), x -> x^emb );; gap> x1:= gens[1] + gens[2];; gap> x2:= ( gens[1] - gens[2] ) * gens[3];; gap> x3:= gens[1] * gens[2] * ( One( rm ) - gens[3] );; gap> g1:= x1 - x2 + x3;; gap> g2:= x1 + x2;; gap> q8:= Group( g1, g2 );; gap> Size( q8 ); 8 gap> ForAny( [ d8, q8 ], IsAbelian ); false gap> List( [ d8, q8 ], g -> Number( AsList( g ), x -> Order( x ) = 2 ) ); [ 5, 1 ] gap> Dimension( Subspace( rm, q8 ) ); 8 </pre> <p> <a name = "SSEC001.4"></a> <li><code>IsFreeMagmaRingWithOne( </code><var>obj</var><code> ) C</code> <p> <a name = "SSEC001.5"></a> <li><code>IsGroupRing( </code><var>obj</var><code> ) P</code> <p> A <strong>group ring</strong> is a magma ring where the underlying magma is a group. <p> <a name = "SSEC001.6"></a> <li><code>UnderlyingMagma( </code><var>RM</var><code> ) A</code> <p> <a name = "SSEC001.7"></a> <li><code>AugmentationIdeal( </code><var>RG</var><code> ) A</code> <p> is the augmentation ideal of the group ring <var>RG</var>, i.e., the kernel of the trivial representation of <var>RG</var>. <p> <p> <h2><a name="SECT002">63.2 Elements of Free Magma Rings</a></h2> <p><p> <a name = "SSEC002.1"></a> <li><code>IsElementOfFreeMagmaRing( </code><var>obj</var><code> ) C</code> <a name = "SSEC002.1"></a> <li><code>IsElementOfFreeMagmaRingCollection( </code><var>obj</var><code> ) C</code> <p> <a name = "SSEC002.2"></a> <li><code>IsElementOfFreeMagmaRingFamily( </code><var>Fam</var><code> ) C</code> <p> Elements of families in this category have trivial normalisation, i.e., efficient methods for <code>\=</code> and <code>\<</code>. <p> In order to treat elements of free magma rings uniformly, also without an external representation, the attributes <code>CoefficientsAndMagmaElements</code> (see <a href="CHAP063.htm#SSEC002.3">CoefficientsAndMagmaElements</a>) and <code>ZeroCoefficient</code> (see <a href="CHAP063.htm#SSEC002.4">ZeroCoefficient</a>) were introduced that allow one to ``take an element of an arbitrary magma ring into pieces''. <p> Conversely, for constructing magma ring elements from coefficients and magma elements, <code>ElementOfMagmaRing</code> (see <a href="CHAP063.htm#SSEC002.5">ElementOfMagmaRing</a>) can be used. (Of course one can also embed each magma element into the magma ring, see <a href="CHAP063.htm#SECT003">Natural Embeddings related to Magma Rings</a>, and then form the linear combination, but many unnecessary intermediate elements are created this way.) <p> <a name = "SSEC002.3"></a> <li><code>CoefficientsAndMagmaElements( </code><var>elm</var><code> ) A</code> <p> is a list that contains at the odd positions the magma elements, and at the even positions their coefficients in the element <var>elm</var>. <p> <a name = "SSEC002.4"></a> <li><code>ZeroCoefficient( </code><var>elm</var><code> ) A</code> <p> For an element <var>elm</var> of a magma ring (modulo relations) <i>RM</i>, <code>ZeroCoefficient</code> returns the zero element of the coefficient ring <i>R</i>. <p> <a name = "SSEC002.5"></a> <li><code>ElementOfMagmaRing( </code><var>Fam</var><code>, </code><var>zerocoeff</var><code>, </code><var>coeffs</var><code>, </code><var>mgmelms</var><code> ) O</code> <p> <code>ElementOfMagmaRing</code> returns the element ∑<sub><i>i</i>=1</sub><sup><i>n</i></sup> <i>c</i><sub><i>i</i></sub> <i>m</i><sub><i>i</i></sub><sup>′</sup>, where <i>coeffs</i> = [ <i>c</i><sub>1</sub>, <i>c</i><sub>2</sub>, …, <i>c</i><sub><i>n</i></sub> ] is a list of coefficients, <i>mgmelms</i> = [ <i>m</i><sub>1</sub>, <i>m</i><sub>2</sub>, …, <i>m</i><sub><i>n</i></sub> ] is a list of magma elements, and <i>m</i><sub><i>i</i></sub><sup>′</sup> is the image of <i>m</i><sub><i>i</i></sub> under an embedding of a magma containing <i>m</i><sub><i>i</i></sub> into a magma ring whose elements lie in the family <var>Fam</var>. <var>zerocoeff</var> must be the zero of the coefficient ring containing the <i>c</i><sub><i>i</i></sub>. <p> <p> <h2><a name="SECT003">63.3 Natural Embeddings related to Magma Rings</a></h2> <p><p> <a name = "I2"></a> Neither the coefficient ring <i>R</i> nor the magma <i>M</i> are regarded as subsets of the magma ring <i>RM</i>, so one has to use <strong>embeddings</strong> (see <a href="CHAP031.htm#SSEC001.10">Embedding</a>) explicitly whenever one needs for example the magma ring element corresponding to a given magma element. Here is an example. <pre> gap> f:= Rationals;; g:= SymmetricGroup( 3 );; gap> fg:= FreeMagmaRing( f, g ); <algebra-with-one over Rationals, with 2 generators> gap> Dimension( fg ); 6 gap> gens:= GeneratorsOfAlgebraWithOne( fg ); [ (1)*(1,2,3), (1)*(1,2) ] gap> ( 3*gens[1] - 2*gens[2] ) * ( gens[1] + gens[2] ); (-2)*()+(3)*(2,3)+(3)*(1,3,2)+(-2)*(1,3) gap> One( fg ); (1)*() gap> emb:= Embedding( g, fg );; gap> elm:= (1,2,3)^emb; elm in fg; (1)*(1,2,3) true gap> new:= elm + One( fg ); (1)*()+(1)*(1,2,3) gap> new^2; (1)*()+(2)*(1,2,3)+(1)*(1,3,2) gap> emb2:= Embedding( f, fg );; gap> elm:= One( f )^emb2; elm in fg; (1)*() true </pre> <p> <p> <h2><a name="SECT004">63.4 Magma Rings modulo Relations</a></h2> <p><p> A more general construction than that of free magma rings allows one to create rings that are not free <i>R</i>-modules on a given magma <i>M</i> but arise from the magma ring <i>RM</i> by factoring out certain identities. Examples for such structures are finitely presented (associative) algebras and free Lie algebras (see <a href="CHAP061.htm#SSEC002.3">FreeLieAlgebra</a>). <p> In <font face="Gill Sans,Helvetica,Arial">GAP</font>, the use of magma rings modulo relations is limited to situations where a normal form of the elements is known and where one wants to guarantee that all elements actually constructed are in normal form. (In particular, the computation of the normal form must be cheap.) This is because the methods for comparing elements in magma rings modulo relations via <code>\=</code> and <code>\<</code> just compare the involved coefficients and magma elements, and also the vector space functions regard those monomials as linearly independent over the coefficients ring that actually occur in the representation of an element of a magma ring modulo relations. <p> Thus only very special finitely presented algebras will be represented as magma rings modulo relations, in general finitely presented algebras are dealt with via the mechanism described in Chapter <a href="CHAP062.htm">Finitely Presented Algebras</a>. <p> <a name = "SSEC004.1"></a> <li><code>IsElementOfMagmaRingModuloRelations( </code><var>obj</var><code> ) C</code> <a name = "SSEC004.1"></a> <li><code>IsElementOfMagmaRingModuloRelationsCollection( </code><var>obj</var><code> ) C</code> <p> This category is used, e. g., for elements of free Lie algebras. <p> <a name = "SSEC004.2"></a> <li><code>IsElementOfMagmaRingModuloRelationsFamily( </code><var>Fam</var><code> ) C</code> <p> <a name = "SSEC004.3"></a> <li><code>NormalizedElementOfMagmaRingModuloRelations( </code><var>F</var><code>, </code><var>descr</var><code> ) O</code> <p> Let <var>F</var> be a family of magma ring elements modulo relations, and <var>descr</var> the description of an element in a magma ring modulo relations. <code>NormalizedElementOfMagmaRingModuloRelations</code> returns a description of the same element, but normalized w.r.t. the relations. So two elements are equal if and only if the result of <code>NormalizedElementOfMagmaRingModuloRelations</code> is equal for their internal data, that is, <code>CoefficientsAndMagmaElements</code> will return the same for the corresponding two elements. <p> <code>NormalizedElementOfMagmaRingModuloRelations</code> is allowed to return <var>descr</var> itself, it need not make a copy. This is the case for example in the case of free magma rings. <p> <a name = "SSEC004.4"></a> <li><code>IsMagmaRingModuloRelations( </code><var>obj</var><code> ) C</code> <p> A <font face="Gill Sans,Helvetica,Arial">GAP</font> object lies in the category <code>IsMagmaRingModuloRelations</code> if it has been constructed as a magma ring modulo relations. Each element of such a ring has a unique normal form, so <code>CoefficientsAndMagmaElements</code> is well-defined for it. <p> This category is not inherited to factor structures, which are in general best described as finitely presented algebras, see Chapter <a href="CHAP062.htm">Finitely Presented Algebras</a>. <p> <p> <h2><a name="SECT005">63.5 Magma Rings modulo the Span of a Zero Element</a></h2> <p><p> <a name = "SSEC005.1"></a> <li><code>IsElementOfMagmaRingModuloSpanOfZeroFamily( </code><var>Fam</var><code> ) C</code> <p> We need this for the normalization method, which takes a family as first argument. <p> <a name = "SSEC005.2"></a> <li><code>IsMagmaRingModuloSpanOfZero( </code><var>RM</var><code> ) C</code> <p> <a name = "SSEC005.3"></a> <li><code>MagmaRingModuloSpanOfZero( </code><var>R</var><code>, </code><var>M</var><code>, </code><var>z</var><code> ) F</code> <p> Let <var>R</var> be a ring, <var>M</var> a magma, and <var>z</var> an element of <var>M</var> with the property that <i>z</i> * <i>m</i> = <i>z</i> for all <i>m</i> ∈ <i>M</i>. The element <var>z</var> could be called a ``zero element'' of <var>M</var>, but note that in general <var>z</var> cannot be obtained as <code>Zero( <i>m</i> )</code> for each <i>m</i> ∈ <i>M</i>, so this situation does not match the definition of <code>Zero</code> (see <a href="CHAP030.htm#SSEC010.3">Zero</a>). <p> <code>MagmaRingModuloSpanOfZero</code> returns the magma ring <i>R</i> <i>M</i> modulo the relation given by the identification of <var>z</var> with zero. This is an example of a magma ring modulo relations, see <a href="CHAP063.htm#SECT004">Magma Rings modulo Relations</a>. <p> <p> <h2><a name="SECT006">63.6 Technical Details about the Implementation of Magma Rings</a></h2> <p><p> The <strong>family</strong> containing elements in the magma ring <i>RM</i> in fact contains all elements with coefficients in the family of elements of <i>R</i> and magma elements in the family of elements of <i>M</i>. So arithmetic operations with coefficients outside <i>R</i> or with magma elements outside <i>M</i> might create elements outside <i>RM</i>. <p> It should be mentioned that each call of <code>FreeMagmaRing</code> 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. <pre> 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 </pre> <p> There is <strong>no</strong> generic <strong>external representation</strong> 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. <p> For convenience, magma rings constructed with <code>FreeAlgebra</code>, <code>FreeAssociativeAlgebra</code>, <code>FreeAlgebraWithOne</code>, and <code>FreeAssociativeAlgebraWithOne</code> 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. <p> As the above examples show, there are several possible representations of magma ring elements, the representations used for polynomials (see <a href="CHAP064.htm">Polynomials and Rational Functions</a>) as well as the default representation <code>IsMagmaRingObjDefaultRep</code> 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 <code>/</code>. <p> <p> [<a href="../index.htm">Top</a>] [<a href = "chapters.htm">Up</a>] [<a href ="CHAP062.htm">Previous</a>] [<a href ="CHAP064.htm">Next</a>] [<a href = "theindex.htm">Index</a>] <P> <font face="Gill Sans,Helvetica,Arial">GAP 4 manual<br>December 2008 </font></body></html>