Domain is GAP's name for structured sets. The ring of Gaussian integers Z[I] is an example of a domain, the group D_{12} of symmetries of a regular hexahedron is another.
The GAP library predefines some domains. For example the ring of
Gaussian integers is predefined as GaussianIntegers
(see Gaussians)
and the field of rationals is predefined as Rationals
(see
Rationals). Most domains are constructed by functions, which are
called domain constructors. For example the group D_{12} is
constructed by the construction Group( (1,2,3,4,5,6), (2,6)(3,5) )
(see
Group) and the finite field with 16 elements is constructed by
GaloisField( 16 )
(see GaloisField).
The first place where you need domains in GAP is the obvious one.
Sometimes you simply want to talk about a domain. For example if you
want to compute the size of the group D_{12}, you had better be able to
represent this group in a way that the Size
function can understand.
The second place where you need domains in GAP 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 Factors( 10 )
will not do, because this will
return the factorization in the ring of integers [ 2, 5 ]
. To allow
operations and computations to happen in a specific domain, Factors
,
and many other functions as well, accept this domain as optional first
argument. Thus Factors( GaussianIntegers, 10 )
yields the desired
result [ 1+E(4), 1-E(4), 2+E(4), 2-E(4) ]
.
Each domain in GAP belongs to one or more categories, which are simply sets of domains. The categories in which a domain lies determine the functions that are applicable to this domain and its elements. Examples of domains are rings (the functions applicable to a domain that is a ring are described in Rings), fields (see Fields), groups (see Groups), vector spaces (see Vector Spaces), and of course the category domains that contains all domains (the functions applicable to any domain are described in this chapter).
Domain Records), how functions that can be applied to different types of domains know how to solve a problem for each of those types (see An Example of a Computation in a Domain), how domains are compared (see Comparisons of Domains), and the set theoretic functions that can be applied to any domain (see Elements, Membership Test for Domains, IsFinite, Size, IsSubset, Intersection, Union, Difference, Random).
The functions described in this chapter are implemented in the file
LIBNAME/"domain.g"
.
GAP 3.4.4