  
  [1X31 [33X[0;0YDomains and their Elements[133X[101X
  
  [33X[0;0Y[13XDomain[113X  is  [5XGAP[105X's  name  for  structured sets. The ring of Gaussian integers
  [22Xℤ[sqrt{-1}][122X  is  an  example  of a domain, the group [22XD_12[122X of symmetries of a
  regular hexahedron is another.[133X
  
  [33X[0;0YThe  [5XGAP[105X  library  predefines some domains. For example the ring of Gaussian
  integers is predefined as [2XGaussianIntegers[102X ([14X60.5-1[114X) (see [14X60.5[114X) and the field
  of  rationals is predefined as [2XRationals[102X ([14X17.1-1[114X) (see [14X17[114X). Most domains are
  constructed  by  functions, which are called [13Xdomain constructors[113X (see [14X31.3[114X).
  For  example  the  group  [22XD_12[122X  is  constructed  by  the construction [10XGroup(
  (1,2,3,4,5,6),  (2,6)(3,5)  )[110X (see [2XGroup[102X ([14X39.2-1[114X)) and the finite field with
  16 elements is constructed by [10XGaloisField( 16 )[110X (see [2XGaloisField[102X ([14X59.3-2[114X)).[133X
  
  [33X[0;0YThe  first place where you need domains in [5XGAP[105X is the obvious one. Sometimes
  you  simply  want  to deal with a domain. For example if you want to compute
  the  size  of the group [22XD_12[122X, you had better be able to represent this group
  in a way that the [2XSize[102X ([14X30.4-6[114X) function can understand.[133X
  
  [33X[0;0YThe  second  place where you need domains in [5XGAP[105X is when you want to be able
  to specify that an operation or computation takes place in a certain domain.
  For  example suppose you want to factor 10 in the ring of Gaussian integers.
  Saying [10XFactors( 10 )[110X will not do, because this will return the factorization
  [10X[  2,  5  ][110X in the ring of integers. To allow operations and computations to
  happen  in  a specific domain, [2XFactors[102X ([14X56.5-9[114X), and many other functions as
  well,   accept  this  domain  as  optional  first  argument.  Thus  [10XFactors(
  GaussianIntegers,  10  )[110X yields the desired result [10X[ 1+E(4), 1-E(4), 2+E(4),
  2-E(4)  ][110X.  (The  imaginary  unit  [22Xsqrt{-1}[122X is written as [10XE(4)[110X in [5XGAP[105X, see [2XE[102X
  ([14X18.1-1[114X).)[133X
  
  [33X[0;0YAn  introduction  to  the  most  important  facts  about domains is given in
  Chapter [14X'Tutorial: Domains'[114X.[133X
  
  [33X[0;0YThere  are only few [13Xoperations[113X especially for domains (see [14X31.9[114X), operations
  such  as  [2XIntersection[102X ([14X30.5-2[114X) and [2XRandom[102X ([14X30.7-1[114X) are defined for the more
  general situation of collections (see Chapter [14X30[114X).[133X
  
  
  [1X31.1 [33X[0;0YOperational Structure of Domains[133X[101X
  
  [33X[0;0YDomains  have  an [13Xoperational structure[113X, that is, a collection of operations
  under  which  the  domain  is  closed.  For example, a group is closed under
  multiplication,  taking the zeroth power of elements, and taking inverses of
  elements.  The  operational  structure  may  be  empty,  examples of domains
  without  additional  structure  are  the  underlying  relations  of  general
  mappings (see [14X32.3[114X).[133X
  
  [33X[0;0YThe operations under which a domain is closed are a subset of the operations
  that  the elements of a domain admit. It is possible that the elements admit
  more  operations.  For  example,  matrices  can be multiplied and added. But
  addition  plays  no role in a group of matrices, and multiplication plays no
  role  in  a  vector  space of matrices. In particular, a matrix group is not
  closed under addition.[133X
  
  [33X[0;0YNote  that  the  elements  of  a  domain exist independently of this domain,
  usually  they  existed  already  before  the domain was created. So it makes
  sense  to  say  that  a domain is [13Xgenerated[113X by some elements with respect to
  certain operations.[133X
  
  [33X[0;0YOf   course,  different  sets  of  operations  yield  different  notions  of
  generation.  For  example, the group generated by some matrices is different
  from  the ring generated by these matrices, and these two will in general be
  different  from  the  vector  space  generated  by the same matrices, over a
  suitable field.[133X
  
  [33X[0;0YThe  other way round, the same set of elements may be obtained by generation
  w.r.t. different  notions  of generation. For example, one can get the group
  generated  by  two  elements  [22Xg[122X  and  [22Xh[122X  also as the monoid generated by the
  elements  [22Xg[122X,  [22Xg^{-1}[122X,  [22Xh[122X,  [22Xh^{-1}[122X; if both [22Xg[122X and [22Xh[122X have finite order then of
  course the group generated by [22Xg[122X and [22Xh[122X coincides with the monoid generated by
  [22Xg[122X and [22Xh[122X.[133X
  
  [33X[0;0YAdditionally to the operational structure, a domain can have properties. For
  example,   the   multiplication   of   a   group  is  associative,  and  the
  multiplication in a field is commutative.[133X
  
  [33X[0;0YNote  that associativity and commutativity depend on the set of elements for
  which  one considers the multiplication, i.e., it depends on the domain. For
  example,  the  multiplication  in  a  full  matrix  ring over a field is not
  commutative,  whereas  its  restriction  to  the set of diagonal matrices is
  commutative.[133X
  
  [33X[0;0YOne   important   difference  between  the  operational  structure  and  the
  properties  of  a domain is that the operational structure is fixed when the
  domain  is  constructed,  whereas  properties  can  be discovered later. For
  example, take a domain whose operational structure is given by closure under
  multiplication.  If  it  is discovered that the inverses of all its elements
  also  do  (by chance) lie in this domain, being closed under taking inverses
  is  [13Xnot[113X  added  to  the operational structure. But a domain with operational
  structure  of  multiplication, taking the identity, and taking inverses will
  be  treated  as  a  group  as  soon as the multiplication is found out to be
  associative for this domain.[133X
  
  [33X[0;0YThe  operational  structures  available  in  [5XGAP[105X  form a hierarchy, which is
  explicitly formulated in terms of domain categories, see [14X31.6[114X.[133X
  
  
  [1X31.2 [33X[0;0YEquality and Comparison of Domains[133X[101X
  
  [33X[0;0Y[13XEquality[113X and [13Xcomparison[113X of domains are defined as follows.[133X
  
  [33X[0;0YTwo  domains  are considered [13Xequal[113X if and only if the sets of their elements
  as  computed  by  [2XAsSSortedList[102X  ([14X30.3-10[114X))  are  equal.  Thus, in general [10X=[110X
  behaves  as  if  each  domain  operand were replaced by its set of elements.
  Except  that  [10X=[110X  will  also  sometimes,  but  not  always, work for infinite
  domains,  for  which  of course [5XGAP[105X cannot compute the set of elements. Note
  that  this  implies that domains with different algebraic structure may well
  be  equal.  As  a  special  case  of this, either operand of [10X=[110X may also be a
  proper set (see [14X21.19[114X), i.e., a sorted list without holes or duplicates (see
  [2XAsSSortedList[102X  ([14X30.3-10[114X)), and [10X=[110X will return [9Xtrue[109X if and only if this proper
  set is equal to the set of elements of the argument that is a domain.[133X
  
  [33X[0;0Y[13XNo[113X  general [13Xordering[113X of arbitrary domains via [10X<[110X is defined in [5XGAP[105X 4. This is
  because  a  well-defined  [10X<[110X  for  domains or, more general, for collections,
  would  have  to  be  compatible  with  [10X=[110X and would need to be transitive and
  antisymmetric  in  order  to  be used to form ordered sets. In particular, [10X<[110X
  would  have  to  be  independent of the algebraic structure of its arguments
  because  this  holds for [10X=[110X, and thus there would be hardly a situation where
  one  could  implement an efficient comparison method. (Note that in the case
  that  two  domains  are  comparable  with  [10X<[110X,  the  result is in general [13Xnot[113X
  compatible  with  the  set theoretical subset relation, which can be decided
  with [2XIsSubset[102X ([14X30.5-1[114X).)[133X
  
  
  [1X31.3 [33X[0;0YConstructing Domains[133X[101X
  
  [33X[0;0YFor  several  operational  structures  (see [14X31.1[114X), [5XGAP[105X provides functions to
  construct domains with this structure (note that such functions do not exist
  for all operational structures). For example, [2XGroup[102X ([14X39.2-1[114X) returns groups,
  [2XVectorSpace[102X ([14X61.2-1[114X) returns vector spaces etc.:[133X
  
  [33X[0;0Y[10X[3XStruct[103X[10X( [3Xarg1[103X[10X, [3Xarg2[103X[10X, ... )[110X[133X
  
  [33X[0;0YThe  syntax  of  these  functions  may  vary,  dependent on the structure in
  question.  Usually  a  domain is constructed as the closure of some elements
  under  the given operations, that is, the domain is given by its [13Xgenerators[113X.
  For  example,  a  group  can  be  constructed  from  a  list  of  generating
  permutations  or matrices or whatever is admissible as group elements, and a
  vector  space  over  a given field [22XF[122X can be constructed from [22XF[122X and a list of
  appropriate vectors.[133X
  
  [33X[0;0YThe  idea of generation and generators in [5XGAP[105X is that the domain returned by
  a  function  such  as  [10XGroup[110X,  [10XAlgebra[110X, or [10XFreeLeftModule[110X [13Xcontains[113X the given
  generators.  This  implies that the generators of a group must know how they
  are  multiplied  and inverted, the generators of a module must know how they
  are  added  and  how scalar multiplication works, and so on. Thus one cannot
  use for example permutations as generators of a vector space.[133X
  
  [33X[0;0YThe   function   [3XStruct[103X   first  checks  whether  the  arguments  admit  the
  construction of a domain with the desired structure. This is done by calling
  the operation[133X
  
  [33X[0;0Y[10XIsGeneratorsOf[3XStruct[103X[10X( [[3Xinfo[103X[10X, ][3Xgens[103X[10X )[110X[133X
  
  [33X[0;0Ywhere  [3Xarglist[103X  is  the  list  of  given  generators and [3Xinfo[103X an argument of
  [3XStruct[103X,  for  example  the  field of scalars in the case that a vector space
  shall  be  constructed.  If  the  check  failed  then  [3XStruct[103X  returns [9Xfail[109X,
  otherwise  it  returns  the result of [10X[3XStruct[103X[10XByGenerators[110X (see below). (So if
  one  wants  to  omit  the  check  then  one  should  call [10X[3XStruct[103X[10XByGenerators[110X
  directly.)[133X
  
  [33X[0;0Y[10XGeneratorsOf[3XStruct[103X[10X( [3XD[103X[10X)[110X[133X
  
  [33X[0;0YFor  a  domain  [3XD[103X  with  operational  structure corresponding to [3XStruct[103X, the
  attribute  [10XGeneratorsOf[3XStruct[103X[10X[110X  returns a list of corresponding generators of
  [3XD[103X.  If  these  generators  were  not  yet  stored in [3XD[103X then [3XD[103X must know [13Xsome[113X
  generators  if [10XGeneratorsOf[3XStruct[103X[10X[110X shall have a chance to compute the desired
  result; for example, monoid generators of a group can be computed from known
  group  generators  (and vice versa). Note that several notions of generation
  may  be  meaningful  for a given domain, so it makes no sense to ask for [21Xthe
  generators of a domain[121X. Further note that the generators may depend on other
  information  about [3XD[103X. For example the generators of a vector space depend on
  the  underlying  field  of  scalars; the vector space generators of a vector
  space  over  the  field with four elements need not generate the same vector
  space when this is viewed as a space over the field with two elements.[133X
  
  [33X[0;0Y[10X[3XStruct[103X[10XByGenerators( [[3Xinfo[103X[10X, ][3Xgens[103X[10X )[110X[133X
  
  [33X[0;0YDomain  construction  from  generators  [3Xgens[103X  is  implemented  by operations
  [10X[3XStruct[103X[10XByGenerators[110X, which are called by the simple functions [3XStruct[103X; methods
  can  be  installed only for the operations. Note that additional information
  [3Xinfo[103X  may  be necessary to construct the domain; for example, a vector space
  needs  the  underlying  field  of  scalars in addition to the list of vector
  space  generators.  The [10XGeneratorsOf[3XStruct[103X[10X[110X value of the returned domain need
  [13Xnot[113X  be  equal  to [3Xgens[103X. But if a domain [3XD[103X is printed as [10X[3XStruct[103X[10X([[3Xa[103X[10X, [3Xb[103X[10X, ...])[110X
  and   if   there   is   an   attribute   [10XGeneratorsOf[3XStruct[103X[10X[110X  then  the  list
  [10XGeneratorsOf[3XStruct[103X[10X( [3XD[103X[10X )[110X is guaranteed to be equal to [10X[ [3Xa[103X[10X, [3Xb[103X[10X, ... ][110X.[133X
  
  [33X[0;0Y[10X[3XStruct[103X[10XWithGenerators( [[3Xinfo[103X[10X, ][3Xgens[103X[10X )[110X[133X
  
  [33X[0;0YThe  only  difference between [10X[3XStruct[103X[10XByGenerators[110X and [10X[3XStruct[103X[10XWithGenerators[110X is
  that  the  latter guarantees that the [10XGeneratorsOf[3XStruct[103X[10X[110X value of the result
  is equal to the given generators [3Xgens[103X.[133X
  
  [33X[0;0Y[10XClosure[3XStruct[103X[10X( [3XD[103X[10X, [3Xobj[103X[10X )[110X[133X
  
  [33X[0;0YFor  constructing  a domain as the closure of a given domain with an element
  or  another  domain, one can use the operation [10XClosure[3XStruct[103X[10X[110X. It returns the
  smallest  domain  with  operational  structure  corresponding to [3XStruct[103X that
  contains [3XD[103X as a subset and [3Xobj[103X as an element.[133X
  
  
  [1X31.4 [33X[0;0YChanging the Structure[133X[101X
  
  [33X[0;0YThe  same  set  of  elements  can have different operational structures. For
  example,  it may happen that a monoid [22XM[122X does in fact contain the inverses of
  all  of  its  elements;  if [22XM[122X has not been constructed as a group (see [14X31.6[114X)
  then it is reasonable to ask for the group that is equal to [22XM[122X.[133X
  
  [33X[0;0Y[10XAs[3XStruct[103X[10X( [[3Xinfo[103X[10X, ][3XD[103X[10X )[110X[133X
  
  [33X[0;0YIf  [3XD[103X  is  a  domain that is closed under the operational structure given by
  [3XStruct[103X  then  [10XAs[3XStruct[103X[10X[110X returns a domain [3XE[103X that consists of the same elements
  (that is, [10X[3XD[103X[10X = [3XE[103X[10X[110X) and that has this operational structure (that is, [10XIs[3XStruct[103X[10X(
  [3XE[103X[10X  )[110X  is  [9Xtrue[109X); if [3XD[103X is not closed under the structure given by [3XStruct[103X then
  [10XAs[3XStruct[103X[10X[110X returns [9Xfail[109X.[133X
  
  [33X[0;0YIf  additional information besides generators are necessary to define [3XD[103X then
  the  argument  [3Xinfo[103X  describes the value of this information for the desired
  domain.  For  example, if we want to view [3XD[103X as a vector space over the field
  with two elements then we may call [10XAsVectorSpace( GF(2), [3XD[103X[10X )[110X; this allows us
  to  change  the  underlying  field  of scalars, for example if [3XD[103X is a vector
  space  over  the  field  with  four  elements. Again, if [3XD[103X is not equal to a
  domain  with  the  desired structure and additional information then [9Xfail[109X is
  returned.[133X
  
  [33X[0;0YIn  the case that no additional information [3Xinfo[103X is related to the structure
  given by [3XStruct[103X, the operation [10XAs[3XStruct[103X[10X[110X is in fact an attribute (see [14X13.5[114X).[133X
  
  [33X[0;0YSee  the  index of the [5XGAP[105X Reference Manual for an overview of the available
  [10XAs[3XStruct[103X[10X[110X functions.[133X
  
  
  [1X31.5 [33X[0;0YChanging the Representation[133X[101X
  
  [33X[0;0YOften  it is useful to answer questions about a domain via computations in a
  different  but  isomorphic domain. In the sense that this approach keeps the
  structure  and changes the underlying set of elements, it can be viewed as a
  counterpart  of  keeping  the  set  of  elements  and changing its structure
  (see [14X31.4[114X).[133X
  
  [33X[0;0YOne  reason  for  doing so can be that computations with the elements in the
  given domain are not very efficient. For example, if one is given a solvable
  matrix  group  (see  Chapter [14X44[114X)  then  one  can compute an isomorphism to a
  polycyclicly  presented group [22XG[122X, say (see Chapter [14X45[114X); the multiplication of
  two  matrices  –which  is  essentially  determined  by  the dimension of the
  matrices–  is much more expensive than the multiplication of two elements in
  [22XG[122X –which is essentially determined by the composition length of [22XG[122X.[133X
  
  [33X[0;0Y[10XIsomorphism[3XRep[103X[10X[3XStruct[103X[10X( [3XD[103X[10X )[110X[133X
  
  [33X[0;0YIf  [3XD[103X  is  a  domain that is closed under the operational structure given by
  [3XStruct[103X  then [10XIsomorphism[3XRep[103X[10X[3XStruct[103X[10X[110X returns a mapping [3Xhom[103X from [3XD[103X to a domain [22XE[122X
  having  structure  given  by  [3XStruct[103X,  such  that [3Xhom[103X respects the structure
  [3XStruct[103X  and  [3XRep[103X  describes  the  representation of the elements in [22XE[122X. If no
  domain [22XE[122X with the required properties exists then [9Xfail[109X is returned.[133X
  
  [33X[0;0YFor example, [2XIsomorphismPermGroup[102X ([14X43.3-1[114X) takes a group as its argument and
  returns  a  group homomorphism (see [14X40[114X) onto an isomorphic permutation group
  (see Chapter [14X43[114X) provided the original group is finite; for infinite groups,
  [2XIsomorphismPermGroup[102X  ([14X43.3-1[114X)  returns  [9Xfail[109X. Similarly, [2XIsomorphismPcGroup[102X
  ([14X46.5-2[114X)  returns  a  group homomorphism from its argument to a polycyclicly
  presented group (see [14X46[114X) if the argument is polycyclic, and [9Xfail[109X otherwise.[133X
  
  [33X[0;0YSee  the  index of the [5XGAP[105X Reference Manual for an overview of the available
  [10XIsomorphism[3XRep[103X[10X[3XStruct[103X[10X[110X functions.[133X
  
  
  [1X31.6 [33X[0;0YDomain Categories[133X[101X
  
  [33X[0;0YAs  mentioned  in [14X31.1[114X,  the operational structure of a domain is fixed when
  the  domain  is  constructed.  For  example,  if [3XD[103X was constructed by [2XMonoid[102X
  ([14X51.2-2[114X)  then  [3XD[103X is in general not regarded as a group in [5XGAP[105X, even if [3XD[103X is
  in fact closed under taking inverses. In this case, [2XIsGroup[102X ([14X39.2-7[114X) returns
  [9Xfalse[109X  for  [3XD[103X.  The  operational  structure  determines which operations are
  applicable  for  a  domain,  so  for  example [2XSylowSubgroup[102X ([14X39.13-1[114X) is not
  defined for [3XD[103X and therefore will signal an error.[133X
  
  [33X[0;0Y[10XIs[3XStruct[103X[10X( [3XD[103X[10X )[110X[133X
  
  [33X[0;0YThe  functions  [10XIs[3XStruct[103X[10X[110X  implement  the  tests  whether  a domain [3XD[103X has the
  respective  operational  structure (upon construction). [10XIs[3XStruct[103X[10X[110X is a filter
  (see [14X13[114X)  that  involves  certain  categories  (see [14X13.3[114X)  and  usually also
  certain  properties  (see [14X13.7[114X). For example, [2XIsGroup[102X ([14X39.2-7[114X) is equivalent
  to [10XIsMagmaWithInverses and IsAssociative[110X, the first being a category and the
  second being a property.[133X
  
  [33X[0;0YImplications between domain categories describe the hierarchy of operational
  structures available in [5XGAP[105X. Here are some typical examples.[133X
  
  [30X    [33X[0;6Y[2XIsDomain[102X ([14X31.9-1[114X) is implied by each domain category,[133X
  
  [30X    [33X[0;6Y[2XIsMagma[102X  ([14X35.1-1[114X)  is  implied  by  each  category  that describes the
        closure under multiplication [10X*[110X,[133X
  
  [30X    [33X[0;6Y[2XIsAdditiveMagma[102X  ([14X55.1-4[114X)  is  implied by each category that describes
        the closure under addition [10X+[110X,[133X
  
  [30X    [33X[0;6Y[2XIsMagmaWithOne[102X  ([14X35.1-2[114X) implies [2XIsMagma[102X ([14X35.1-1[114X); a [13Xmagma-with-one[113X is
        a magma such that each element (and thus also the magma itself) can be
        asked for its zeroth power,[133X
  
  [30X    [33X[0;6Y[2XIsMagmaWithInverses[102X   ([14X35.1-4[114X)   implies  [2XIsMagmaWithOne[102X  ([14X35.1-2[114X);  a
        [13Xmagma-with-inverses[113X is a magma such that each element can be asked for
        its inverse; important special cases are [13Xgroups[113X, which in addition are
        associative,[133X
  
  [30X    [33X[0;6Ya [13Xring[113X is a magma that is also an additive group,[133X
  
  [30X    [33X[0;6Ya [13Xring-with-one[113X is a ring that is also a magma-with-one,[133X
  
  [30X    [33X[0;6Ya  [13Xdivision  ring[113X  is a ring-with-one that is also closed under taking
        inverses of nonzero elements,[133X
  
  [30X    [33X[0;6Ya [13Xfield[113X is a commutative division ring.[133X
  
  [33X[0;0YEach  operational  structure [3XStruct[103X has associated with it a domain category
  [10XIs[3XStruct[103X[10X[110X,  and  operations [10X[3XStruct[103X[10XByGenerators[110X for constructing a domain from
  generators,   [10XGeneratorsOf[3XStruct[103X[10X[110X   for   storing  and  accessing  generators
  w.r.t. this  structure,  [10XClosure[3XStruct[103X[10X[110X for forming the closure, and [10XAs[3XStruct[103X[10X[110X
  for  getting  a  domain  with  the  desired  structure  from one with weaker
  operational structure and for testing whether a given domain can be regarded
  as a domain with [3XStruct[103X.[133X
  
  [33X[0;0YThe  functions  applicable  to  domains  with  the  various  structures  are
  described  in  the  corresponding  chapters  of  the  Reference  Manual. For
  example,  functions  for  rings,  fields,  groups,  and  vector  spaces  are
  described  in  Chapters [14X56[114X,  [14X58[114X,  [14X39[114X,  and  [14X61[114X,  respectively.  More general
  functions for arbitrary collections can be found in Chapter [14X30[114X.[133X
  
  
  [1X31.7 [33X[0;0YParents[133X[101X
  
  [1X31.7-1 Parent[101X
  
  [33X[1;0Y[29X[2XParent[102X( [3XD[103X ) [32X function[133X
  [33X[1;0Y[29X[2XSetParent[102X( [3XD[103X, [3XP[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XHasParent[102X( [3XD[103X ) [32X filter[133X
  
  [33X[0;0YIt  is possible to assign to a domain [3XD[103X one other domain [3XP[103X containing [3XD[103X as a
  subset,  in order to exploit this subset relation between [3XD[103X and [3XP[103X. Note that
  [3XP[103X  need not have the same operational structure as [3XD[103X, for example [3XP[103X may be a
  magma and [3XD[103X a field.[133X
  
  [33X[0;0YThe  assignment  is done by calling [2XSetParent[102X, and [3XP[103X is called the [13Xparent[113X of
  [3XD[103X. If [3XD[103X has already a parent, calls to [2XSetParent[102X will be ignored.[133X
  
  [33X[0;0YIf  [3XD[103X has a parent [3XP[103X –this can be checked with [2XHasParent[102X– then [3XP[103X can be used
  to   gain   information  about  [3XD[103X.  First,  the  call  of  [2XSetParent[102X  causes
  [2XUseSubsetRelation[102X  ([14X31.13-1[114X)  to  be  called.  Second,  for  a domain [3XD[103X with
  parent,  information relative to the parent can be stored in [3XD[103X; for example,
  there  is  an attribute [10XNormalizerInParent[110X for storing [10XNormalizer( [3XP[103X[10X, [3XD[103X[10X )[110X in
  the case that [3XD[103X is a group. (More about such parent dependent attributes can
  be  found  in  [14X85.2[114X.)  Note  that  because of this relative information, one
  cannot  change  the  parent;  that  is,  one  can  set the parent only once,
  subsequent  calls  to  [2XSetParent[102X  for the same domain [3XD[103X are ignored. Further
  note  that contrary to [2XUseSubsetRelation[102X ([14X31.13-1[114X), also knowledge about the
  parent [3XP[103X might be used that is discovered after the [2XSetParent[102X call.[133X
  
  [33X[0;0YA stored parent can be accessed using [2XParent[102X. If [3XD[103X has no parent then [2XParent[102X
  returns  [3XD[103X  itself,  and  [2XHasParent[102X  will  return [9Xfalse[109X also after a call to
  [2XParent[102X. So [2XParent[102X is [13Xnot[113X an attribute, the underlying attribute to store the
  parent is [10XParentAttr[110X.[133X
  
  [33X[0;0YCertain  functions  that return domains with parent already set, for example
  [2XSubgroup[102X  ([14X39.3-1[114X),  are  described in Section [14X31.8[114X. Whenever a function has
  this  property,  the  [5XGAP[105X Reference Manual states this explicitly. Note that
  these   functions   [13Xdo   not   guarantee[113X   a  certain  parent,  for  example
  [2XDerivedSubgroup[102X  ([14X39.12-3[114X) for a perfect group [22XG[122X may return [22XG[122X itself, and if
  [22XG[122X  had  already a parent then this is not replaced by [22XG[122X. As a rule of thumb,
  [5XGAP[105X  avoids  to set a domain as its own parent, which is consistent with the
  behaviour  of  [2XParent[102X,  at  least  until  a  parent  is  set explicitly with
  [2XSetParent[102X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xg:= Group( (1,2,3), (1,2) );; h:= Group( (1,2) );;[127X[104X
    [4X[25Xgap>[125X [27XHasParent( g );  HasParent( h );[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XSetParent( h, g );[127X[104X
    [4X[25Xgap>[125X [27XParent( g );  Parent( h );[127X[104X
    [4X[28XGroup([ (1,2,3), (1,2) ])[128X[104X
    [4X[28XGroup([ (1,2,3), (1,2) ])[128X[104X
    [4X[25Xgap>[125X [27XHasParent( g );  HasParent( h );[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  
  [1X31.8 [33X[0;0YConstructing Subdomains[133X[101X
  
  [33X[0;0YFor  many domains [3XD[103X, there are functions that construct certain subsets [3XS[103X of
  [3XD[103X as domains with parent (see [14X31.7[114X) already set to [3XD[103X. For example, if [3XG[103X is a
  group  that  contains the elements in the list [3Xgens[103X then [10XSubgroup( [3XG[103X[10X, [3Xgens[103X[10X )[110X
  returns a group [3XS[103X that is generated by the elements in [3Xgens[103X and with [10XParent(
  [3XS[103X[10X ) = [3XG[103X[10X[110X.[133X
  
  [33X[0;0Y[10XSub[3Xstruct[103X[10X( [3XD[103X[10X, [3Xgens[103X[10X )[110X[133X
  
  [33X[0;0YMore  general,  if  [3XD[103X  is a domain whose algebraic structure is given by the
  function  [3XStruct[103X  (for  example  [10XGroup[110X,  [10XAlgebra[110X,  [10XField[110X)  then the function
  [10XSub[3Xstruct[103X[10X[110X  (for example [10XSubgroup[110X, [10XSubalgebra[110X, [10XSubfield[110X) returns domains with
  structure [3XStruct[103X and parent set to the first argument.[133X
  
  [33X[0;0Y[10XSub[3Xstruct[103X[10XNC( [3XD[103X[10X, [3Xgens[103X[10X )[110X[133X
  
  [33X[0;0YEach  function [10XSub[3Xstruct[103X[10X[110X checks that the [3XStruct[103X generated by [3Xgens[103X is in fact
  a subset of [3XD[103X. If one wants to omit this check then one can call [10XSub[3Xstruct[103X[10XNC[110X
  instead; the suffix [10XNC[110X stands for [21Xno check[121X.[133X
  
  [33X[0;0Y[10XAsSub[3Xstruct[103X[10X( [3XD[103X[10X, [3XS[103X[10X )[110X[133X
  
  [33X[0;0Yfirst  constructs  [10XAs[3XStruct[103X[10X( [[3Xinfo[103X[10X, ][3XS[103X[10X )[110X, where [3Xinfo[103X depends on [3XD[103X and [3XS[103X, and
  then sets the parent (see [14X31.7[114X) of this new domain to [3XD[103X.[133X
  
  [33X[0;0Y[10XIsSub[3Xstruct[103X[10X( [3XD[103X[10X, [3XS[103X[10X )[110X[133X
  
  [33X[0;0YThere  is  no  real  need  for  functions that check whether a domain [3XS[103X is a
  [10XSub[3Xstruct[103X[10X[110X of a domain [3XD[103X, since this is equivalent to the checks whether [3XS[103X is
  a  [3XStruct[103X  and  [3XS[103X is a subset of [3XD[103X. Note that in many cases, only the subset
  relation is what one really wants to check, and that appropriate methods for
  the  operation  [2XIsSubset[102X ([14X30.5-1[114X) are available for many special situations,
  such  as  the test whether a group is contained in another group, where only
  generators need to be checked.[133X
  
  [33X[0;0YIf  a  function  [10XIsSub[3Xstruct[103X[10X[110X  is  available in [5XGAP[105X then it is implemented as
  first a call to [10XIs[3XStruct[103X[10X[110X for the second argument and then a call to [2XIsSubset[102X
  ([14X30.5-1[114X) for the two arguments.[133X
  
  
  [1X31.9 [33X[0;0YOperations for Domains[133X[101X
  
  [33X[0;0YFor  the  meaning of the attributes [2XCharacteristic[102X ([14X31.10-1[114X), [2XOne[102X ([14X31.10-2[114X),
  [2XZero[102X ([14X31.10-3[114X) in the case of a domain argument, see [14X31.10[114X.[133X
  
  [1X31.9-1 IsGeneralizedDomain[101X
  
  [33X[1;0Y[29X[2XIsGeneralizedDomain[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsDomain[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YFor  some  purposes,  it  is useful to deal with objects that are similar to
  domains  but  that  are  not  collections  in the sense of [5XGAP[105X because their
  elements  may lie in different families; such objects are called [13Xgeneralized
  domains[113X.  An  instance  of  generalized  domains  are [21Xoperation domains[121X, for
  example  any  [22XG[122X-set  for  a  permutation group [22XG[122X consisting of some union of
  points,  sets  of  points,  sets  of  sets  of points etc., under a suitable
  action.[133X
  
  [33X[0;0Y[2XIsDomain[102X is a synonym for [10XIsGeneralizedDomain and IsCollection[110X.[133X
  
  [1X31.9-2 GeneratorsOfDomain[101X
  
  [33X[1;0Y[29X[2XGeneratorsOfDomain[102X( [3XD[103X ) [32X attribute[133X
  
  [33X[0;0YFor a domain [3XD[103X, [2XGeneratorsOfDomain[102X returns a list containing all elements of
  [3XD[103X, perhaps with repetitions. Note that if the domain [3XD[103X shall be generated by
  a  list  of some elements w.r.t. the empty operational structure (see [14X31.1[114X),
  the  only possible choice of elements is to take all elements of [3XD[103X. See [14X31.3[114X
  and [14X31.4[114X for concepts of other notions of generation.[133X
  
  [33X[0;0YFor  many domains that have [13Xnatural generators by construction[113X (for example,
  the  natural  generators  of a free group of rank two are the two generators
  stored as value of the attribute [2XGeneratorsOfGroup[102X ([14X39.2-4[114X), and the natural
  generators  of  a  free  associative  algebra are those generators stored as
  value of the attribute [2XGeneratorsOfAlgebra[102X ([14X62.9-1[114X)), each [13Xnatural[113X generator
  can  be  accessed using the [10X.[110X operator. For a domain [3XD[103X, [10X[3XD[103X[10X.i[110X returns the [22Xi[122X-th
  generator if [22Xi[122X is a positive integer, and if [10Xname[110X is the name of a generator
  of [3XD[103X then [10X[3XD[103X[10X.name[110X returns this generator.[133X
  
  [1X31.9-3 Domain[101X
  
  [33X[1;0Y[29X[2XDomain[102X( [[3XFam[103X, ][3Xgenerators[103X ) [32X function[133X
  [33X[1;0Y[29X[2XDomainByGenerators[102X( [3XFam[103X, [3Xgenerators[103X ) [32X operation[133X
  
  [33X[0;0Y[2XDomain[102X returns the domain consisting of the elements in the homogeneous list
  [3Xgenerators[103X.  If [3Xgenerators[103X is empty then a family [3XFam[103X must be entered as the
  first  argument,  and  the  returned  (empty) domain lies in the collections
  family of [3XFam[103X.[133X
  
  [33X[0;0Y[2XDomainByGenerators[102X is the operation called by [2XDomain[102X.[133X
  
  
  [1X31.10 [33X[0;0YAttributes and Properties of Elements[133X[101X
  
  [33X[0;0YThe  following attributes and properties for elements and domains correspond
  to the operational structure.[133X
  
  [1X31.10-1 Characteristic[101X
  
  [33X[1;0Y[29X[2XCharacteristic[102X( [3Xobj[103X ) [32X attribute[133X
  
  [33X[0;0Y[2XCharacteristic[102X returns the [13Xcharacteristic[113X of [3Xobj[103X.[133X
  
  [33X[0;0YIf  [3Xobj[103X  is a family, all of whose elements lie in [2XIsAdditiveElementWithZero[102X
  ([14X31.14-5[114X)  then  its characteristic is the least positive integer [22Xn[122X, if any,
  such  that  [10XIsZero(n*x)[110X is [9Xtrue[109X for all [10Xx[110X in the family [3Xobj[103X, otherwise it is
  [22X0[122X.[133X
  
  [33X[0;0YIf  [3Xobj[103X  is  a  collections family of a family [22Xg[122X which has a characteristic,
  then the characteristic of [3Xobj[103X is the same as the characteristic of [22Xg[122X.[133X
  
  [33X[0;0YFor  other  families  [3Xobj[103X the characteristic is not defined and [9Xfail[109X will be
  returned.[133X
  
  [33X[0;0YFor  any  object  [3Xobj[103X  which  is  in  the  filter  [2XIsAdditiveElementWithZero[102X
  ([14X31.14-5[114X)   or   in   the   filter   [2XIsAdditiveMagmaWithZero[102X   ([14X55.1-5[114X)  the
  characteristic  of  [3Xobj[103X  is  the same as the characteristic of its family if
  that is defined and undefined otherwise.[133X
  
  [33X[0;0YFor  all  other  objects  [3Xobj[103X the characteristic is undefined and may return
  [9Xfail[109X or a [21Xno method found[121X error.[133X
  
  [1X31.10-2 OneImmutable[101X
  
  [33X[1;0Y[29X[2XOneImmutable[102X( [3Xobj[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XOneAttr[102X( [3Xobj[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XOne[102X( [3Xobj[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XIdentity[102X( [3Xobj[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XOneMutable[102X( [3Xobj[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XOneOp[102X( [3Xobj[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XOneSameMutability[102X( [3Xobj[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XOneSM[102X( [3Xobj[103X ) [32X operation[133X
  
  [33X[0;0Y[2XOneImmutable[102X,  [2XOneMutable[102X,  and  [2XOneSameMutability[102X return the multiplicative
  neutral element of the multiplicative element [3Xobj[103X.[133X
  
  [33X[0;0YThey  differ  only  w.r.t.  the mutability of the result. [2XOneImmutable[102X is an
  attribute and hence returns an immutable result. [2XOneMutable[102X is guaranteed to
  return  a  new  [13Xmutable[113X  object  whenever  a mutable version of the required
  element exists in [5XGAP[105X (see [2XIsCopyable[102X ([14X12.6-1[114X)). [2XOneSameMutability[102X returns a
  result  that  is  mutable  if [3Xobj[103X is mutable and if a mutable version of the
  required  element  exists in [5XGAP[105X; for lists, it returns a result of the same
  immutability  level  as  the  argument.  For  instance, if the argument is a
  mutable matrix with immutable rows, it returns a similar object.[133X
  
  [33X[0;0YIf  [3Xobj[103X  is  a  multiplicative  element  then  [10XOneSameMutability(  [3Xobj[103X[10X  )[110X is
  equivalent to [10X[3Xobj[103X[10X^0[110X.[133X
  
  [33X[0;0Y[2XOneAttr[102X,  [2XOne[102X  and [2XIdentity[102X are synonyms of [10XOneImmutable[110X. [2XOneSM[102X is a synonym
  of [2XOneSameMutability[102X. [2XOneOp[102X is a synonym of [2XOneMutable[102X.[133X
  
  [33X[0;0YIf  [3Xobj[103X  is a domain or a family then [2XOne[102X is defined as the identity element
  of  all  elements  in  [3Xobj[103X,  provided  that all these elements have the same
  identity.  For  example,  the  family  of  all  cyclotomics has the identity
  element  [10X1[110X,  but  a  collections family (see [2XCollectionsFamily[102X ([14X30.2-1[114X)) may
  contain matrices of all dimensions and then it cannot have a unique identity
  element.  Note  that  [2XOne[102X  is  applicable  to  a  domain  only  if  it  is a
  magma-with-one          (see [2XIsMagmaWithOne[102X          ([14X35.1-2[114X));          use
  [2XMultiplicativeNeutralElement[102X ([14X35.4-10[114X) otherwise.[133X
  
  [33X[0;0YThe identity of an object need not be distinct from its zero, so for example
  a  ring  consisting  of  a single element can be regarded as a ring-with-one
  (see [14X56[114X).  This  is  particularly  useful  in the case of finitely presented
  algebras,   where  any  factor  of  a  free  algebra-with-one  is  again  an
  algebra-with-one, no matter whether or not it is a zero algebra.[133X
  
  [33X[0;0YThe default method of [2XOne[102X for multiplicative elements calls [2XOneMutable[102X (note
  that  methods  for [2XOneMutable[102X must [13Xnot[113X delegate to [2XOne[102X); so other methods to
  compute  identity  elements  need to be installed only for [2XOneOp[102X and (in the
  case of copyable objects) [2XOneSameMutability[102X.[133X
  
  [33X[0;0YFor  domains,  [2XOne[102X  may  call  [2XRepresentative[102X  ([14X30.4-7[114X),  but [2XRepresentative[102X
  ([14X30.4-7[114X)  is allowed to fetch the identity of a domain [3XD[103X only if [10XHasOne( [3XD[103X[10X )[110X
  is [9Xtrue[109X.[133X
  
  [1X31.10-3 ZeroImmutable[101X
  
  [33X[1;0Y[29X[2XZeroImmutable[102X( [3Xobj[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XZeroAttr[102X( [3Xobj[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XZero[102X( [3Xobj[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XZeroMutable[102X( [3Xobj[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XZeroOp[102X( [3Xobj[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XZeroSameMutability[102X( [3Xobj[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XZeroSM[102X( [3Xobj[103X ) [32X operation[133X
  
  [33X[0;0Y[2XZeroImmutable[102X,  [2XZeroMutable[102X,  and [2XZeroSameMutability[102X all return the additive
  neutral element of the additive element [3Xobj[103X.[133X
  
  [33X[0;0YThey  differ  only  w.r.t. the mutability of the result. [2XZeroImmutable[102X is an
  attribute  and  hence returns an immutable result. [2XZeroMutable[102X is guaranteed
  to  return  a  new [13Xmutable[113X object whenever a mutable version of the required
  element  exists in [5XGAP[105X (see [2XIsCopyable[102X ([14X12.6-1[114X)). [2XZeroSameMutability[102X returns
  a  result  that is mutable if [3Xobj[103X is mutable and if a mutable version of the
  required  element  exists in [5XGAP[105X; for lists, it returns a result of the same
  immutability  level  as  the  argument.  For  instance, if the argument is a
  mutable matrix with immutable rows, it returns a similar object.[133X
  
  [33X[0;0Y[10XZeroSameMutability( [3Xobj[103X[10X )[110X is equivalent to [10X0 * [3Xobj[103X[10X[110X.[133X
  
  [33X[0;0Y[2XZeroAttr[102X  and  [2XZero[102X  are  synonyms  of [2XZeroImmutable[102X. [2XZeroSM[102X is a synonym of
  [2XZeroSameMutability[102X. [2XZeroOp[102X is a synonym of [2XZeroMutable[102X.[133X
  
  [33X[0;0YIf  [3Xobj[103X  is a domain or a family then [2XZero[102X is defined as the zero element of
  all  elements  in  [3Xobj[103X, provided that all these elements have the same zero.
  For  example,  the  family  of all cyclotomics has the zero element [10X0[110X, but a
  collections  family (see [2XCollectionsFamily[102X ([14X30.2-1[114X)) may contain matrices of
  all dimensions and then it cannot have a unique zero element. Note that [2XZero[102X
  is  applicable  to  a  domain  only  if  it  is  an additive magma-with-zero
  (see [2XIsAdditiveMagmaWithZero[102X  ([14X55.1-5[114X)); use [2XAdditiveNeutralElement[102X ([14X55.3-5[114X)
  otherwise.[133X
  
  [33X[0;0YThe  default  method  of  [2XZero[102X for additive elements calls [2XZeroMutable[102X (note
  that methods for [2XZeroMutable[102X must [13Xnot[113X delegate to [2XZero[102X); so other methods to
  compute  zero elements need to be installed only for [2XZeroMutable[102X and (in the
  case of copyable objects) [2XZeroSameMutability[102X.[133X
  
  [33X[0;0YFor  domains,  [2XZero[102X  may  call  [2XRepresentative[102X  ([14X30.4-7[114X), but [2XRepresentative[102X
  ([14X30.4-7[114X)  is allowed to fetch the zero of a domain [3XD[103X only if [10XHasZero( [3XD[103X[10X )[110X is
  [9Xtrue[109X.[133X
  
  [1X31.10-4 MultiplicativeZeroOp[101X
  
  [33X[1;0Y[29X[2XMultiplicativeZeroOp[102X( [3Xelt[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA multiplicative zero element.[133X
  
  [33X[0;0Yfor   an   element   [3Xelt[103X  in  the  category  [2XIsMultiplicativeElementWithZero[102X
  ([14X31.14-12[114X),  [10XMultiplicativeZeroOp[110X  returns  the element [22Xz[122X in the family [22XF[122X of
  [3Xelt[103X with the property that [22Xz * m = z = m * z[122X holds for all [22Xm ∈ F[122X, if such an
  element can be determined.[133X
  
  [33X[0;0YFamilies   of   elements  in  the  category  [2XIsMultiplicativeElementWithZero[102X
  ([14X31.14-12[114X)  often  arise  from  adjoining  a  new zero to an existing magma.
  See [2XInjectionZeroMagma[102X  ([14X35.2-13[114X)  or  [2XMagmaWithZeroAdjoined[102X  ([14X35.2-13[114X)  for
  details.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XG:=AlternatingGroup(5);;[127X[104X
    [4X[25Xgap>[125X [27Xx:=Representative(MagmaWithZeroAdjoined(G));[127X[104X
    [4X[28X<group with 0 adjoined elt: ()>[128X[104X
    [4X[25Xgap>[125X [27XMultiplicativeZeroOp(x);[127X[104X
    [4X[28X<group with 0 adjoined elt: 0>[128X[104X
  [4X[32X[104X
  
  [1X31.10-5 IsOne[101X
  
  [33X[1;0Y[29X[2XIsOne[102X( [3Xelm[103X ) [32X property[133X
  
  [33X[0;0Yis [9Xtrue[109X if [10X[3Xelm[103X[10X = One( [3Xelm[103X[10X )[110X, and [9Xfalse[109X otherwise.[133X
  
  [1X31.10-6 IsZero[101X
  
  [33X[1;0Y[29X[2XIsZero[102X( [3Xelm[103X ) [32X property[133X
  
  [33X[0;0Yis [9Xtrue[109X if [10X[3Xelm[103X[10X = Zero( [3Xelm[103X[10X )[110X, and [9Xfalse[109X otherwise.[133X
  
  [1X31.10-7 IsIdempotent[101X
  
  [33X[1;0Y[29X[2XIsIdempotent[102X( [3Xelt[103X ) [32X property[133X
  
  [33X[0;0Yreturns  [9Xtrue[109X  iff  [3Xelt[103X is its own square. (Even if [2XIsZero[102X ([14X31.10-6[114X) returns
  [9Xtrue[109X for [3Xelt[103X.)[133X
  
  [1X31.10-8 InverseImmutable[101X
  
  [33X[1;0Y[29X[2XInverseImmutable[102X( [3Xelm[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XInverseAttr[102X( [3Xelm[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XInverse[102X( [3Xelm[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XInverseMutable[102X( [3Xelm[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XInverseOp[102X( [3Xelm[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XInverseSameMutability[102X( [3Xelm[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XInverseSM[102X( [3Xelm[103X ) [32X operation[133X
  
  [33X[0;0Y[2XInverseImmutable[102X,  [2XInverseMutable[102X,  and [2XInverseSameMutability[102X all return the
  multiplicative  inverse of an element [3Xelm[103X, that is, an element [3Xinv[103X such that
  [10X[3Xelm[103X[10X * [3Xinv[103X[10X = [3Xinv[103X[10X * [3Xelm[103X[10X = One( [3Xelm[103X[10X )[110X holds; if [3Xelm[103X is not invertible then [9Xfail[109X
  (see [14X20.2[114X) is returned.[133X
  
  [33X[0;0YNote  that  the  above  definition  implies  that  a  (general)  mapping  is
  invertible  in  the  sense  of  [2XInverse[102X  only if its source equals its range
  (see [14X32.14[114X).  For  a  bijective  mapping  [22Xf[122X  whose  source and range differ,
  [2XInverseGeneralMapping[102X ([14X32.2-3[114X) can be used to construct a mapping [22Xg[122X with the
  property  that [22Xf[122X [10X*[110X [22Xg[122X is the identity mapping on the source of [22Xf[122X and [22Xg[122X [10X*[110X [22Xf[122X is
  the identity mapping on the range of [22Xf[122X.[133X
  
  [33X[0;0YThe   operations   differ   only   w.r.t.  the  mutability  of  the  result.
  [2XInverseImmutable[102X  is  an  attribute  and  hence returns an immutable result.
  [2XInverseMutable[102X  is  guaranteed  to  return  a  new [13Xmutable[113X object whenever a
  mutable version of the required element exists in [5XGAP[105X. [2XInverseSameMutability[102X
  returns  a result that is mutable if [3Xelm[103X is mutable and if a mutable version
  of the required element exists in [5XGAP[105X; for lists, it returns a result of the
  same  immutability level as the argument. For instance, if the argument is a
  mutable matrix with immutable rows, it returns a similar object.[133X
  
  [33X[0;0Y[10XInverseSameMutability( [3Xelm[103X[10X )[110X is equivalent to [10X[3Xelm[103X[10X^-1[110X.[133X
  
  [33X[0;0Y[2XInverseAttr[102X  and  [2XInverse[102X  are  synonyms of [2XInverseImmutable[102X. [2XInverseSM[102X is a
  synonym of [2XInverseSameMutability[102X. [2XInverseOp[102X is a synonym of [2XInverseMutable[102X.[133X
  
  [33X[0;0YThe  default  method  of  [2XInverseImmutable[102X  calls  [2XInverseMutable[102X (note that
  methods  for  [2XInverseMutable[102X  must  [13Xnot[113X delegate to [2XInverseImmutable[102X); other
  methods to compute inverses need to be installed only for [2XInverseMutable[102X and
  (in the case of copyable objects) [2XInverseSameMutability[102X.[133X
  
  [1X31.10-9 AdditiveInverseImmutable[101X
  
  [33X[1;0Y[29X[2XAdditiveInverseImmutable[102X( [3Xelm[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XAdditiveInverseAttr[102X( [3Xelm[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XAdditiveInverse[102X( [3Xelm[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XAdditiveInverseMutable[102X( [3Xelm[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XAdditiveInverseOp[102X( [3Xelm[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XAdditiveInverseSameMutability[102X( [3Xelm[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XAdditiveInverseSM[102X( [3Xelm[103X ) [32X operation[133X
  
  [33X[0;0Y[2XAdditiveInverseImmutable[102X,             [2XAdditiveInverseMutable[102X,            and
  [2XAdditiveInverseSameMutability[102X all return the additive inverse of [3Xelm[103X.[133X
  
  [33X[0;0YThey    differ    only    w.r.t.    the    mutability    of    the   result.
  [2XAdditiveInverseImmutable[102X  is  an  attribute  and  hence returns an immutable
  result.  [2XAdditiveInverseMutable[102X is guaranteed to return a new [13Xmutable[113X object
  whenever   a   mutable  version  of  the  required  element  exists  in  [5XGAP[105X
  (see [2XIsCopyable[102X  ([14X12.6-1[114X)).  [2XAdditiveInverseSameMutability[102X  returns a result
  that  is  mutable if [3Xelm[103X is mutable and if a mutable version of the required
  element  exists  in  [5XGAP[105X;  for  lists,  it  returns  a  result  of  the same
  immutability  level  as  the  argument.  For  instance, if the argument is a
  mutable matrix with immutable rows, it returns a similar object.[133X
  
  [33X[0;0Y[10XAdditiveInverseSameMutability( [3Xelm[103X[10X )[110X is equivalent to [10X-[3Xelm[103X[10X[110X.[133X
  
  [33X[0;0Y[2XAdditiveInverseAttr[102X      and     [2XAdditiveInverse[102X     are     synonyms     of
  [2XAdditiveInverseImmutable[102X.     [2XAdditiveInverseSM[102X     is    a    synonym    of
  [2XAdditiveInverseSameMutability[102X.    [2XAdditiveInverseOp[102X    is   a   synonym   of
  [2XAdditiveInverseMutable[102X.[133X
  
  [33X[0;0YThe  default  method  of  [2XAdditiveInverse[102X calls [2XAdditiveInverseMutable[102X (note
  that    methods    for   [2XAdditiveInverseMutable[102X   must   [13Xnot[113X   delegate   to
  [2XAdditiveInverse[102X);  so  other methods to compute additive inverses need to be
  installed  only  for  [2XAdditiveInverseMutable[102X  and  (in  the case of copyable
  objects) [2XAdditiveInverseSameMutability[102X.[133X
  
  [1X31.10-10 Order[101X
  
  [33X[1;0Y[29X[2XOrder[102X( [3Xelm[103X ) [32X attribute[133X
  
  [33X[0;0Yis  the multiplicative order of [3Xelm[103X. This is the smallest positive integer [22Xn[122X
  such  that  [3Xelm[103X  [10X^[110X [22Xn[122X [10X= One( [3Xelm[103X[10X )[110X if such an integer exists. If the order is
  infinite,  [2XOrder[102X  may  return the value [2Xinfinity[102X ([14X18.2-1[114X), but it also might
  run into an infinite loop trying to test the order.[133X
  
  
  [1X31.11 [33X[0;0YComparison Operations for Elements[133X[101X
  
  [33X[0;0YBinary  comparison  operations  have  been  introduced  already in [14X4.12[114X. The
  underlying operations for which methods can be installed are the following.[133X
  
  
  [1X31.11-1 [33X[0;0Y\= and \<[133X[101X
  
  [33X[1;0Y[29X[2X\=[102X( [3Xleft-expr[103X, [3Xright-expr[103X ) [32X operation[133X
  [33X[1;0Y[29X[2X\<[102X( [3Xleft-expr[103X, [3Xright-expr[103X ) [32X operation[133X
  
  [33X[0;0YNote  that  the  comparisons  via  [10X<>[110X,  [10X<=[110X,  [10X>[110X,  and [10X>=[110X are delegated to the
  operations [2X\=[102X and [2X\<[102X.[133X
  
  [33X[0;0YIn  general,  objects  in [13Xdifferent[113X families cannot be compared with [2X\<[102X. For
  the reason and for exceptions from this rule, see [14X4.12[114X.[133X
  
  [1X31.11-2 CanEasilyCompareElements[101X
  
  [33X[1;0Y[29X[2XCanEasilyCompareElements[102X( [3Xobj[103X ) [32X property[133X
  [33X[1;0Y[29X[2XCanEasilyCompareElementsFamily[102X( [3Xfam[103X ) [32X function[133X
  [33X[1;0Y[29X[2XCanEasilySortElements[102X( [3Xobj[103X ) [32X property[133X
  [33X[1;0Y[29X[2XCanEasilySortElementsFamily[102X( [3Xfam[103X ) [32X function[133X
  
  [33X[0;0YFor  some  objects  a  [21Xnormal  form[121X  is hard to compute and thus equality of
  elements  of  a  domain might be expensive to test. Therefore [5XGAP[105X provides a
  (slightly  technical)  property  with which an algorithm can test whether an
  efficient equality test is available for elements of a certain kind.[133X
  
  [33X[0;0Y[2XCanEasilyCompareElements[102X indicates whether the elements in the family [3Xfam[103X of
  [3Xobj[103X can be easily compared with [2X\=[102X ([14X31.11-1[114X).[133X
  
  [33X[0;0YThe  default  method  for  this  property  is  to ask the family of [3Xobj[103X, the
  default method for the family is to return [9Xfalse[109X.[133X
  
  [33X[0;0YThe  ability to compare elements may depend on the successful computation of
  certain  information.  (For  example  for finitely presented groups it might
  depend  on  the  knowledge  of  a faithful permutation representation.) This
  information  might  change over time and thus it might not be a good idea to
  store   a   value  [9Xfalse[109X  too  early  in  a  family.  Instead  the  function
  [2XCanEasilyCompareElementsFamily[102X  should be called for the family of [3Xobj[103X which
  returns  [9Xfalse[109X if the value of [2XCanEasilyCompareElements[102X is not known for the
  family  without  computing  it.  (This  is  in fact what the above mentioned
  family dispatch does.)[133X
  
  [33X[0;0YIf  a  family  knows  ab  initio  that it can compare elements this property
  should  be  set as implied filter [13Xand[113X filter for the family (the 3rd and 4th
  argument  of  [2XNewFamily[102X  ([14X79.7-1[114X)  respectively).  This guarantees that code
  which directly asks the family gets a right answer.[133X
  
  [33X[0;0YThe      property      [2XCanEasilySortElements[102X      and      the      function
  [2XCanEasilySortElementsFamily[102X behave exactly in the same way, except that they
  indicate  that  objects  can  be  compared  via  [2X\<[102X ([14X31.11-1[114X). This property
  implies [2XCanEasilyCompareElements[102X, as the ordering must be total.[133X
  
  
  [1X31.12 [33X[0;0YArithmetic Operations for Elements[133X[101X
  
  [33X[0;0Y[13XBinary[113X  arithmetic  operations  have  been  introduced  already in [14X4.13[114X. The
  underlying operations for which methods can be installed are the following.[133X
  
  
  [1X31.12-1 [33X[0;0Y\+, \*, \/, \^, \mod[133X[101X
  
  [33X[1;0Y[29X[2X\+[102X( [3Xleft-expr[103X, [3Xright-expr[103X ) [32X operation[133X
  [33X[1;0Y[29X[2X\*[102X( [3Xleft-expr[103X, [3Xright-expr[103X ) [32X operation[133X
  [33X[1;0Y[29X[2X\/[102X( [3Xleft-expr[103X, [3Xright-expr[103X ) [32X operation[133X
  [33X[1;0Y[29X[2X\^[102X( [3Xleft-expr[103X, [3Xright-expr[103X ) [32X operation[133X
  [33X[1;0Y[29X[2X\mod[102X( [3Xleft-expr[103X, [3Xright-expr[103X ) [32X operation[133X
  
  [33X[0;0YFor  details  about  special  methods  for  [2X\*[102X, [2X\/[102X, [2X\^[102X and [2X\mod[102X, consult the
  appropriate index entries for them.[133X
  
  [1X31.12-2 LeftQuotient[101X
  
  [33X[1;0Y[29X[2XLeftQuotient[102X( [3Xelm1[103X, [3Xelm2[103X ) [32X operation[133X
  
  [33X[0;0Yreturns the product [10X[3Xelm1[103X[10X^(-1) * [3Xelm2[103X[10X[110X. For some types of objects (for example
  permutations)  this  product can be evaluated more efficiently than by first
  inverting [3Xelm1[103X and then forming the product with [3Xelm2[103X.[133X
  
  [1X31.12-3 Comm[101X
  
  [33X[1;0Y[29X[2XComm[102X( [3Xelm1[103X, [3Xelm2[103X ) [32X operation[133X
  
  [33X[0;0Yreturns  the  [13Xcommutator[113X  of [3Xelm1[103X and [3Xelm2[103X. The commutator is defined as the
  product [22X[3Xelm1[103X^{-1} * [3Xelm2[103X^{-1} * [3Xelm1[103X * [3Xelm2[103X[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xa:= (1,3)(4,6);; b:= (1,6,5,4,3,2);;[127X[104X
    [4X[25Xgap>[125X [27XComm( a, b );[127X[104X
    [4X[28X(1,5,3)(2,6,4)[128X[104X
    [4X[25Xgap>[125X [27XLeftQuotient( a, b );[127X[104X
    [4X[28X(1,2)(3,6)(4,5)[128X[104X
  [4X[32X[104X
  
  [1X31.12-4 LieBracket[101X
  
  [33X[1;0Y[29X[2XLieBracket[102X( [3Xelm1[103X, [3Xelm2[103X ) [32X operation[133X
  
  [33X[0;0Yreturns the element [10X[3Xelm1[103X[10X * [3Xelm2[103X[10X - [3Xelm2[103X[10X * [3Xelm1[103X[10X[110X.[133X
  
  [33X[0;0YThe addition [2X\+[102X ([14X31.12-1[114X) is assumed to be associative but [13Xnot[113X assumed to be
  commutative  (see [2XIsAdditivelyCommutative[102X  ([14X55.3-1[114X)).  The multiplication [2X\*[102X
  ([14X31.12-1[114X) is [13Xnot[113X assumed to be commutative or associative (see [2XIsCommutative[102X
  ([14X35.4-9[114X), [2XIsAssociative[102X ([14X35.4-7[114X)).[133X
  
  [1X31.12-5 Sqrt[101X
  
  [33X[1;0Y[29X[2XSqrt[102X( [3Xobj[103X ) [32X operation[133X
  
  [33X[0;0Y[2XSqrt[102X  returns  a  square root of [3Xobj[103X, that is, an object [22Xx[122X with the property
  that  [22Xx  ⋅  x  =  [3Xobj[103X[122X holds. If such an [22Xx[122X is not unique then the choice of [22Xx[122X
  depends  on the type of [3Xobj[103X. For example, [2XER[102X ([14X18.4-2[114X) is the [2XSqrt[102X method for
  rationals (see [2XIsRat[102X ([14X17.2-1[114X)).[133X
  
  
  [1X31.13 [33X[0;0YRelations Between Domains[133X[101X
  
  [33X[0;0YDomains  are  often constructed relative to other domains. The probably most
  usual  case  is  to  form a [13Xsubset[113X of a domain, for example the intersection
  (see [2XIntersection[102X  ([14X30.5-2[114X))  of two domains, or a Sylow subgroup of a given
  group (see [2XSylowSubgroup[102X ([14X39.13-1[114X)).[133X
  
  [33X[0;0YIn  such  a  situation, the new domain can gain knowledge by exploiting that
  several  attributes  are  maintained  under taking subsets. For example, the
  intersection  of an arbitrary domain with a finite domain is clearly finite,
  a Sylow subgroup of an abelian group is abelian, too, and so on.[133X
  
  [33X[0;0YSince  usually  the  new  domain  has  access  to  the  knowledge of the old
  domain(s)  only when it is created (see [14X31.8[114X for the exception), this is the
  right   moment   to   take   advantage   of   the   subset  relation,  using
  [2XUseSubsetRelation[102X ([14X31.13-1[114X).[133X
  
  [33X[0;0YAnalogous  relations  occur when a [13Xfactor structure[113X is created from a domain
  and a subset (see [2XUseFactorRelation[102X ([14X31.13-2[114X)), and when a domain [13Xisomorphic[113X
  to a given one is created (see [2XUseIsomorphismRelation[102X ([14X31.13-3[114X)).[133X
  
  [33X[0;0YThe          functions          [2XInstallSubsetMaintenance[102X          ([14X31.13-4[114X),
  [2XInstallIsomorphismMaintenance[102X    ([14X31.13-6[114X),   and   [2XInstallFactorMaintenance[102X
  ([14X31.13-5[114X)  are  used  to  tell  [5XGAP[105X  under  what  conditions an attribute is
  maintained  under taking subsets, or forming factor structures or isomorphic
  domains.  This  is  used only when a new attribute is created, see [14X79.3[114X. For
  the   attributes   already   available,   such   as  [2XIsFinite[102X  ([14X30.4-2[114X)  and
  [2XIsCommutative[102X ([14X35.4-9[114X), the maintenances are already notified.[133X
  
  [1X31.13-1 UseSubsetRelation[101X
  
  [33X[1;0Y[29X[2XUseSubsetRelation[102X( [3Xsuper[103X, [3Xsub[103X ) [32X operation[133X
  
  [33X[0;0YMethods  for  this  operation  transfer possibly useful information from the
  domain [3Xsuper[103X to its subset [3Xsub[103X, and vice versa.[133X
  
  [33X[0;0Y[2XUseSubsetRelation[102X   is   designed   to   be  called  automatically  whenever
  substructures  of domains are constructed. So the methods must be [13Xcheap[113X, and
  the requirements should be as sharp as possible![133X
  
  [33X[0;0YTo  achieve  that  [13Xall[113X applicable methods are executed, all methods for this
  operation  except  the  default  method  must end with [10XTryNextMethod()[110X. This
  default  method deals with the information that is available by the calls of
  [2XInstallSubsetMaintenance[102X ([14X31.13-4[114X) in the [5XGAP[105X library.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xg:= Group( (1,2), (3,4), (5,6) );; h:= Group( (1,2), (3,4) );;[127X[104X
    [4X[25Xgap>[125X [27XIsAbelian( g );  HasIsAbelian( h );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XUseSubsetRelation( g, h );;  HasIsAbelian( h );  IsAbelian( h );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X31.13-2 UseFactorRelation[101X
  
  [33X[1;0Y[29X[2XUseFactorRelation[102X( [3Xnumer[103X, [3Xdenom[103X, [3Xfactor[103X ) [32X operation[133X
  
  [33X[0;0YMethods  for  this  operation  transfer possibly useful information from the
  domain  [3Xnumer[103X or its subset [3Xdenom[103X to the domain [3Xfactor[103X that is isomorphic to
  the factor of [3Xnumer[103X by [3Xdenom[103X, and vice versa. [3Xdenom[103X may be [9Xfail[109X, for example
  if  [3Xfactor[103X  is just known to be a factor of [3Xnumer[103X but [3Xdenom[103X is not available
  as  a  [5XGAP[105X  object;  in  this  case those factor relations are used that are
  installed without special requirements for [3Xdenom[103X.[133X
  
  [33X[0;0Y[2XUseFactorRelation[102X  is  designed  to  be called automatically whenever factor
  structures of domains are constructed. So the methods must be [13Xcheap[113X, and the
  requirements should be as sharp as possible![133X
  
  [33X[0;0YTo  achieve  that  [13Xall[113X applicable methods are executed, all methods for this
  operation  except  the  default method must end with a call to [2XTryNextMethod[102X
  ([14X78.4-1[114X).  This  default method deals with the information that is available
  by the calls of [2XInstallFactorMaintenance[102X ([14X31.13-5[114X) in the [5XGAP[105X library.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xg:= Group( (1,2,3,4), (1,2) );; h:= Group( (1,2,3), (1,2) );;[127X[104X
    [4X[25Xgap>[125X [27XIsSolvableGroup( g );  HasIsSolvableGroup( h );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XUseFactorRelation(g, Subgroup( g, [ (1,2)(3,4), (1,3)(2,4) ] ), h);;[127X[104X
    [4X[25Xgap>[125X [27XHasIsSolvableGroup( h );  IsSolvableGroup( h );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X31.13-3 UseIsomorphismRelation[101X
  
  [33X[1;0Y[29X[2XUseIsomorphismRelation[102X( [3Xold[103X, [3Xnew[103X ) [32X operation[133X
  
  [33X[0;0YMethods  for  this  operation  transfer possibly useful information from the
  domain [3Xold[103X to the isomorphic domain [3Xnew[103X.[133X
  
  [33X[0;0Y[2XUseIsomorphismRelation[102X  is  designed  to  be  called  automatically whenever
  isomorphic  structures  of  domains  are constructed. So the methods must be
  [13Xcheap[113X, and the requirements should be as sharp as possible![133X
  
  [33X[0;0YTo  achieve  that  [13Xall[113X applicable methods are executed, all methods for this
  operation  except  the  default method must end with a call to [2XTryNextMethod[102X
  ([14X78.4-1[114X).  This  default method deals with the information that is available
  by the calls of [2XInstallIsomorphismMaintenance[102X ([14X31.13-6[114X) in the [5XGAP[105X library.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xg:= Group( (1,2) );;  h:= Group( [ [ -1 ] ] );;[127X[104X
    [4X[25Xgap>[125X [27XSize( g );  HasSize( h );[127X[104X
    [4X[28X2[128X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XUseIsomorphismRelation( g, h );;  HasSize( h );  Size( h );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28X2[128X[104X
  [4X[32X[104X
  
  [1X31.13-4 InstallSubsetMaintenance[101X
  
  [33X[1;0Y[29X[2XInstallSubsetMaintenance[102X( [3Xopr[103X, [3Xsuper_req[103X, [3Xsub_req[103X ) [32X function[133X
  
  [33X[0;0Y[3Xopr[103X must be a property or an attribute. The call of [2XInstallSubsetMaintenance[102X
  has  the  effect that for a domain [22XD[122X in the filter [3Xsuper_req[103X, and a domain [22XS[122X
  in    the   filter   [3Xsub_req[103X,   the   call   [10XUseSubsetRelation[110X[22X(   D,   S   )[122X
  (see [2XUseSubsetRelation[102X  ([14X31.13-1[114X))  sets a known value of [3Xopr[103X for [22XD[122X as value
  of  [3Xopr[103X  also for [22XS[122X. A typical example for which [2XInstallSubsetMaintenance[102X is
  applied  is  given by [3Xopr[103X [10X= IsFinite[110X, [3Xsuper_req[103X [10X= IsCollection and IsFinite[110X,
  and [3Xsub_req[103X [10X= IsCollection[110X.[133X
  
  [33X[0;0YIf [3Xopr[103X is a property and the filter [3Xsuper_req[103X lies in the filter [3Xopr[103X then we
  can  use also the following inverse implication. If [22XD[122X is in the filter whose
  intersection with [3Xopr[103X is [3Xsuper_req[103X and if [22XS[122X is in the filter [3Xsub_req[103X, [22XS[122X is a
  subset of [22XD[122X, and the value of [3Xopr[103X for [22XS[122X is [9Xfalse[109X then the value of [3Xopr[103X for [22XD[122X
  is also [9Xfalse[109X.[133X
  
  [1X31.13-5 InstallFactorMaintenance[101X
  
  [33X[1;0Y[29X[2XInstallFactorMaintenance[102X( [3Xopr[103X, [3Xnumer_req[103X, [3Xdenom_req[103X, [3Xfactor_req[103X ) [32X function[133X
  
  [33X[0;0Y[3Xopr[103X must be a property or an attribute. The call of [2XInstallFactorMaintenance[102X
  has  the  effect  that  for  collections  [22XN[122X,  [22XD[122X, [22XF[122X in the filters [3Xnumer_req[103X,
  [3Xdenom_req[103X, and [3Xfactor_req[103X, respectively, the call [10XUseFactorRelation[110X[22X( N, D, F
  )[122X (see [2XUseFactorRelation[102X ([14X31.13-2[114X)) sets a known value of [3Xopr[103X for [22XN[122X as value
  of  [3Xopr[103X  also for [22XF[122X. A typical example for which [2XInstallFactorMaintenance[102X is
  applied  is  given by [3Xopr[103X [10X= IsFinite[110X, [3Xnumer_req[103X [10X= IsCollection and IsFinite[110X,
  [3Xdenom_req[103X [10X= IsCollection[110X, and [3Xfactor_req[103X [10X= IsCollection[110X.[133X
  
  [33X[0;0YFor  the  other direction, if [3Xnumer_req[103X involves the filter [3Xopr[103X then a known
  [9Xfalse[109X value of [3Xopr[103X for [22XF[122X implies a [9Xfalse[109X value for [22XD[122X provided that [22XD[122X lies in
  the filter obtained from [3Xnumer_req[103X by removing [3Xopr[103X.[133X
  
  [33X[0;0YNote  that  an  implication of a factor relation holds in particular for the
  case  of  isomorphisms.  So  one  need [13Xnot[113X install an isomorphism maintained
  method  when  a  factor maintained method is already installed. For example,
  [2XUseIsomorphismRelation[102X  ([14X31.13-3[114X)  will  transfer  a known [2XIsFinite[102X ([14X30.4-2[114X)
  value because of the installed factor maintained method.[133X
  
  [1X31.13-6 InstallIsomorphismMaintenance[101X
  
  [33X[1;0Y[29X[2XInstallIsomorphismMaintenance[102X( [3Xopr[103X, [3Xold_req[103X, [3Xnew_req[103X ) [32X function[133X
  
  [33X[0;0Y[3Xopr[103X    must    be    a    property    or   an   attribute.   The   call   of
  [2XInstallIsomorphismMaintenance[102X  has  the  effect  that  for a domain [22XD[122X in the
  filter   [3Xold_req[103X,   and   a  domain  [22XE[122X  in  the  filter  [3Xnew_req[103X,  the  call
  [10XUseIsomorphismRelation[110X[22X( D, E )[122X (see [2XUseIsomorphismRelation[102X ([14X31.13-3[114X)) sets a
  known  value  of [3Xopr[103X for [22XD[122X as value of [3Xopr[103X also for [22XE[122X. A typical example for
  which  [2XInstallIsomorphismMaintenance[102X  is  applied  is  given  by [3Xopr[103X [10X= Size[110X,
  [3Xold_req[103X [10X= IsCollection[110X, and [3Xnew_req[103X [10X= IsCollection[110X.[133X
  
  
  [1X31.14 [33X[0;0YUseful Categories of Elements[133X[101X
  
  [33X[0;0YThis  section  and  the  following  one  are  rather  technical,  and may be
  interesting  only  for  those  [5XGAP[105X  users who want to implement new kinds of
  elements.[133X
  
  [33X[0;0YIt  deals with certain categories of elements that are useful mainly for the
  design  of  elements,  from  the  viewpoint  that  one wants to form certain
  domains of these elements. For example, a domain closed under multiplication
  [10X*[110X  (a  so-called magma, see Chapter [14X35[114X) makes sense only if its elements can
  be   multiplied,   and   the   latter   is   indicated   by   the   category
  [2XIsMultiplicativeElement[102X  ([14X31.14-10[114X)  for  each  element. Again note that the
  underlying idea is that a domain is regarded as [13Xgenerated[113X by given elements,
  and  that  these  elements  carry  information about the desired domain. For
  general information on categories and their hierarchies, see [14X13.3[114X.[133X
  
  [33X[0;0YMore  special  categories  of  this kind are described in the contexts where
  they    arise,   they   are   [2XIsRowVector[102X   ([14X23.1-1[114X),   [2XIsMatrix[102X   ([14X24.2-1[114X),
  [2XIsOrdinaryMatrix[102X ([14X24.2-2[114X), and [2XIsLieMatrix[102X ([14X24.2-3[114X).[133X
  
  [1X31.14-1 IsExtAElement[101X
  
  [33X[1;0Y[29X[2XIsExtAElement[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YAn [13Xexternal additive element[113X is an object that can be added via [10X+[110X with other
  elements (not necessarily in the same family, see [14X13.1[114X).[133X
  
  [1X31.14-2 IsNearAdditiveElement[101X
  
  [33X[1;0Y[29X[2XIsNearAdditiveElement[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YA  [13Xnear-additive  element[113X is an object that can be added via [10X+[110X with elements
  in its family (see [14X13.1[114X); this addition is not necessarily commutative.[133X
  
  [1X31.14-3 IsAdditiveElement[101X
  
  [33X[1;0Y[29X[2XIsAdditiveElement[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YAn  [13Xadditive  element[113X  is an object that can be added via [10X+[110X with elements in
  its family (see [14X13.1[114X); this addition is commutative.[133X
  
  [1X31.14-4 IsNearAdditiveElementWithZero[101X
  
  [33X[1;0Y[29X[2XIsNearAdditiveElementWithZero[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YA  [13Xnear-additive element-with-zero[113X is an object that can be added via [10X+[110X with
  elements  in  its  family (see [14X13.1[114X), and that is an admissible argument for
  the operation [2XZero[102X ([14X31.10-3[114X); this addition is not necessarily commutative.[133X
  
  [1X31.14-5 IsAdditiveElementWithZero[101X
  
  [33X[1;0Y[29X[2XIsAdditiveElementWithZero[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YAn  [13Xadditive  element-with-zero[113X  is  an  object that can be added via [10X+[110X with
  elements  in  its  family (see [14X13.1[114X), and that is an admissible argument for
  the operation [2XZero[102X ([14X31.10-3[114X); this addition is commutative.[133X
  
  [1X31.14-6 IsNearAdditiveElementWithInverse[101X
  
  [33X[1;0Y[29X[2XIsNearAdditiveElementWithInverse[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YA  [13Xnear-additive  element-with-inverse[113X  is an object that can be added via [10X+[110X
  with  elements  in its family (see [14X13.1[114X), and that is an admissible argument
  for  the  operations  [2XZero[102X  ([14X31.10-3[114X)  and  [2XAdditiveInverse[102X  ([14X31.10-9[114X); this
  addition is not necessarily commutative.[133X
  
  [1X31.14-7 IsAdditiveElementWithInverse[101X
  
  [33X[1;0Y[29X[2XIsAdditiveElementWithInverse[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YAn  [13Xadditive  element-with-inverse[113X is an object that can be added via [10X+[110X with
  elements  in  its  family (see [14X13.1[114X), and that is an admissible argument for
  the  operations  [2XZero[102X ([14X31.10-3[114X) and [2XAdditiveInverse[102X ([14X31.10-9[114X); this addition
  is commutative.[133X
  
  [1X31.14-8 IsExtLElement[101X
  
  [33X[1;0Y[29X[2XIsExtLElement[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YAn  [13Xexternal left element[113X is an object that can be multiplied from the left,
  via [10X*[110X, with other elements (not necessarily in the same family, see [14X13.1[114X).[133X
  
  [1X31.14-9 IsExtRElement[101X
  
  [33X[1;0Y[29X[2XIsExtRElement[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YAn  [13Xexternal  right  element[113X  is  an  object that can be multiplied from the
  right,  via  [10X*[110X,  with  other  elements  (not necessarily in the same family,
  see [14X13.1[114X).[133X
  
  [1X31.14-10 IsMultiplicativeElement[101X
  
  [33X[1;0Y[29X[2XIsMultiplicativeElement[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YA  [13Xmultiplicative  element[113X  is  an  object that can be multiplied via [10X*[110X with
  elements in its family (see [14X13.1[114X).[133X
  
  [1X31.14-11 IsMultiplicativeElementWithOne[101X
  
  [33X[1;0Y[29X[2XIsMultiplicativeElementWithOne[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YA  [13Xmultiplicative element-with-one[113X is an object that can be multiplied via [10X*[110X
  with  elements  in its family (see [14X13.1[114X), and that is an admissible argument
  for the operation [2XOne[102X ([14X31.10-2[114X).[133X
  
  [1X31.14-12 IsMultiplicativeElementWithZero[101X
  
  [33X[1;0Y[29X[2XIsMultiplicativeElementWithZero[102X( [3Xelt[103X ) [32X Category[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X.[133X
  
  [33X[0;0YThis  is the category of elements in a family which can be the operands of [10X*[110X
  (multiplication) and the operation [2XMultiplicativeZero[102X ([14X35.4-11[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XS:=Semigroup(Transformation( [ 1, 1, 1 ] ));;[127X[104X
    [4X[25Xgap>[125X [27XM:=MagmaWithZeroAdjoined(S);[127X[104X
    [4X[28X<<commutative transformation semigroup of degree 3 with 1 generator>[128X[104X
    [4X[28X  with 0 adjoined>[128X[104X
    [4X[25Xgap>[125X [27Xx:=Representative(M);[127X[104X
    [4X[28X<semigroup with 0 adjoined elt: Transformation( [ 1, 1, 1 ] )>[128X[104X
    [4X[25Xgap>[125X [27XIsMultiplicativeElementWithZero(x);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XMultiplicativeZeroOp(x);[127X[104X
    [4X[28X<semigroup with 0 adjoined elt: 0>[128X[104X
  [4X[32X[104X
  
  [1X31.14-13 IsMultiplicativeElementWithInverse[101X
  
  [33X[1;0Y[29X[2XIsMultiplicativeElementWithInverse[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YA  [13Xmultiplicative  element-with-inverse[113X  is an object that can be multiplied
  via  [10X*[110X  with  elements  in  its family (see [14X13.1[114X), and that is an admissible
  argument  for  the operations [2XOne[102X ([14X31.10-2[114X) and [2XInverse[102X ([14X31.10-8[114X). (Note the
  word  [21Xadmissible[121X:  an  object  in this category does not necessarily have an
  inverse, [2XInverse[102X ([14X31.10-8[114X) may return [9Xfail[109X.)[133X
  
  [1X31.14-14 IsVector[101X
  
  [33X[1;0Y[29X[2XIsVector[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YA [13Xvector[113X is an additive-element-with-inverse that can be multiplied from the
  left  and  right  with  other  objects  (not  necessarily of the same type).
  Examples  are  cyclotomics, finite field elements, and of course row vectors
  (see below).[133X
  
  [33X[0;0YNote  that  not  all  lists  of  ring  elements are regarded as vectors, for
  example  lists  of  matrices  are  not vectors. This is because although the
  category  [2XIsAdditiveElementWithInverse[102X  ([14X31.14-7[114X)  is implied by the meet of
  its collections category and [2XIsList[102X ([14X21.1-1[114X), the family of a list entry may
  not imply [2XIsAdditiveElementWithInverse[102X ([14X31.14-7[114X) for all its elements.[133X
  
  [1X31.14-15 IsNearRingElement[101X
  
  [33X[1;0Y[29X[2XIsNearRingElement[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0Y[2XIsNearRingElement[102X     is    just    a    synonym    for    the    meet    of
  [2XIsNearAdditiveElementWithInverse[102X   ([14X31.14-6[114X)   and   [2XIsMultiplicativeElement[102X
  ([14X31.14-10[114X).[133X
  
  [1X31.14-16 IsRingElement[101X
  
  [33X[1;0Y[29X[2XIsRingElement[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0Y[2XIsRingElement[102X is just a synonym for the meet of [2XIsAdditiveElementWithInverse[102X
  ([14X31.14-7[114X) and [2XIsMultiplicativeElement[102X ([14X31.14-10[114X).[133X
  
  [1X31.14-17 IsNearRingElementWithOne[101X
  
  [33X[1;0Y[29X[2XIsNearRingElementWithOne[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0Y[2XIsNearRingElementWithOne[102X    is    just   a   synonym   for   the   meet   of
  [2XIsNearAdditiveElementWithInverse[102X                ([14X31.14-6[114X)                and
  [2XIsMultiplicativeElementWithOne[102X ([14X31.14-11[114X).[133X
  
  [1X31.14-18 IsRingElementWithOne[101X
  
  [33X[1;0Y[29X[2XIsRingElementWithOne[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0Y[2XIsRingElementWithOne[102X    is    just    a    synonym    for    the   meet   of
  [2XIsAdditiveElementWithInverse[102X  ([14X31.14-7[114X)  and  [2XIsMultiplicativeElementWithOne[102X
  ([14X31.14-11[114X).[133X
  
  [1X31.14-19 IsNearRingElementWithInverse[101X
  
  [33X[1;0Y[29X[2XIsNearRingElementWithInverse[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0Y[2XIsNearRingElementWithInverse[102X   is   just   a   synonym   for   the  meet  of
  [2XIsNearAdditiveElementWithInverse[102X                ([14X31.14-6[114X)                and
  [2XIsMultiplicativeElementWithInverse[102X ([14X31.14-13[114X).[133X
  
  [1X31.14-20 IsRingElementWithInverse[101X
  
  [33X[1;0Y[29X[2XIsRingElementWithInverse[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsScalar[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0Y[2XIsRingElementWithInverse[102X  and  [2XIsScalar[102X  are  just  synonyms for the meet of
  [2XIsAdditiveElementWithInverse[102X                  ([14X31.14-7[114X)                  and
  [2XIsMultiplicativeElementWithInverse[102X ([14X31.14-13[114X).[133X
  
  
  [1X31.15 [33X[0;0YUseful Categories for all Elements of a Family[133X[101X
  
  [33X[0;0YThe  following  categories  of  elements  are  to  be  understood  mainly as
  categories  for  all  objects  in  a  family, they are usually used as third
  argument  of  [10XNewFamily[110X  (see [14X79.7[114X).  The  purpose  of each of the following
  categories  is  then  to  guarantee  that  each  collection  of its elements
  automatically  lies  in  its  collections  category (see [2XCategoryCollections[102X
  ([14X30.2-4[114X)).[133X
  
  [33X[0;0YFor  example,  the  multiplication of permutations is associative, and it is
  stored  in  the  family  of  permutations  that  each  permutation  lies  in
  [2XIsAssociativeElement[102X  ([14X31.15-1[114X).  As a consequence, each magma consisting of
  permutations  (more  precisely:  each  collection  that  lies  in the family
  [10XCollectionsFamily(  PermutationsFamily  )[110X,  see [2XCollectionsFamily[102X  ([14X30.2-1[114X))
  automatically  lies  in [10XCategoryCollections( IsAssociativeElement )[110X. A magma
  in  this  category  is  always  known  to  be  associative,  via  a  logical
  implication (see [14X78.7[114X).[133X
  
  [33X[0;0YSimilarly,  if  a  family  knows that all its elements are in the categories
  [2XIsJacobianElement[102X  ([14X31.15-5[114X)  and  [2XIsZeroSquaredElement[102X ([14X31.15-6[114X), then each
  algebra  of  these  elements is automatically known to be a Lie algebra (see
  Chapter [14X62[114X).[133X
  
  [1X31.15-1 IsAssociativeElement[101X
  
  [33X[1;0Y[29X[2XIsAssociativeElement[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsAssociativeElementCollection[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsAssociativeElementCollColl[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YAn   element  [3Xobj[103X  in  the  category  [2XIsAssociativeElement[102X  knows  that  the
  multiplication  of  any  elements  in  the family of [3Xobj[103X is associative. For
  example,  all  permutations  lie in this category, as well as those ordinary
  matrices   (see [2XIsOrdinaryMatrix[102X   ([14X24.2-2[114X))   whose  entries  are  also  in
  [2XIsAssociativeElement[102X.[133X
  
  [1X31.15-2 IsAdditivelyCommutativeElement[101X
  
  [33X[1;0Y[29X[2XIsAdditivelyCommutativeElement[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsAdditivelyCommutativeElementCollection[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsAdditivelyCommutativeElementCollColl[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsAdditivelyCommutativeElementFamily[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YAn element [3Xobj[103X in the category [2XIsAdditivelyCommutativeElement[102X knows that the
  addition  of  any elements in the family of [3Xobj[103X is commutative. For example,
  each finite field element and each rational number lies in this category.[133X
  
  [1X31.15-3 IsCommutativeElement[101X
  
  [33X[1;0Y[29X[2XIsCommutativeElement[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsCommutativeElementCollection[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsCommutativeElementCollColl[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YAn   element  [3Xobj[103X  in  the  category  [2XIsCommutativeElement[102X  knows  that  the
  multiplication  of  any  elements  in  the family of [3Xobj[103X is commutative. For
  example,  each  finite  field  element and each rational number lies in this
  category.[133X
  
  [1X31.15-4 IsFiniteOrderElement[101X
  
  [33X[1;0Y[29X[2XIsFiniteOrderElement[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsFiniteOrderElementCollection[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsFiniteOrderElementCollColl[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YAn element [3Xobj[103X in the category [2XIsFiniteOrderElement[102X knows that it has finite
  multiplicative  order.  For  example,  each  finite  field  element and each
  permutation  lies  in  this category. However the value may be [9Xfalse[109X even if
  [3Xobj[103X has finite order, but if this was not known when [3Xobj[103X was constructed.[133X
  
  [33X[0;0YAlthough  it  is  legal to set this filter for any object with finite order,
  this  is  really  useful  only in the case that all elements of a family are
  known to have finite order.[133X
  
  [1X31.15-5 IsJacobianElement[101X
  
  [33X[1;0Y[29X[2XIsJacobianElement[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsJacobianElementCollection[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsJacobianElementCollColl[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsRestrictedJacobianElement[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsRestrictedJacobianElementCollection[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsRestrictedJacobianElementCollColl[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YAn   element   [3Xobj[103X   in   the  category  [2XIsJacobianElement[102X  knows  that  the
  multiplication  of  any elements in the family [22XF[122X of [3Xobj[103X satisfies the Jacobi
  identity, that is, [22Xx * y * z + z * x * y + y * z * x[122X is zero for all [22Xx[122X, [22Xy[122X, [22Xz[122X
  in [22XF[122X.[133X
  
  [33X[0;0YFor  example,  each  Lie  matrix  (see [2XIsLieMatrix[102X  ([14X24.2-3[114X))  lies  in this
  category.[133X
  
  [1X31.15-6 IsZeroSquaredElement[101X
  
  [33X[1;0Y[29X[2XIsZeroSquaredElement[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsZeroSquaredElementCollection[102X( [3Xobj[103X ) [32X Category[133X
  [33X[1;0Y[29X[2XIsZeroSquaredElementCollColl[102X( [3Xobj[103X ) [32X Category[133X
  
  [33X[0;0YAn element [3Xobj[103X in the category [2XIsZeroSquaredElement[102X knows that [10X[3Xobj[103X[10X^2 = Zero(
  [3Xobj[103X[10X  )[110X. For example, each Lie matrix (see [2XIsLieMatrix[102X ([14X24.2-3[114X)) lies in this
  category.[133X
  
  [33X[0;0YAlthough it is legal to set this filter for any zero squared object, this is
  really  useful  only  in the case that all elements of a family are known to
  have square zero.[133X
  
