Homogeneous direct products
Dom::Product(Set
, <n
>)
Dom::ProductSetn(e1, e2, …
,en
)
Dom::ProductSetn(List
)
Dom::Product(Set, n)
is an n
fold
direct product of the domain Set.
Dom::Product(Set, n)(e1, e2, ..., en)
creates
the n
tuple (e_{1}, e_{2},
…, e_{n}).
The objects e1
, e2
, ..., en
must
be convertible into elements of the domain Set
,
otherwise an error message is issued.
Dom::Product(Set, n)(List)
creates the n
tuple (l_{1}, l_{2},
…, l_{n}).
The n
elements l_{i} of List
must
be convertible into elements of the domain Set
,
otherwise an error message is issued.
The list must consist of exactly n
elements,
otherwise an error message is issued.
Following to the definition of a direct product many of the
methods such as "D"
and "_negate"
just
map the operation to all the components of the tuple.
Most n
ary methods like "_plus"
and "_mult"
apply
the operation componentwise to the tuples.
If Set
has Ax::canonicalRep
, then Ax::canonicalRep
.
If Set
has Cat::AbelianMonoid
, then Ax::normalRep
.
Define the 3fold direct product of the rational numbers:
P3 := Dom::Product(Dom::Rational, 3)
and create elements:
a := P3([1, 2/3, 0])
b := P3(2/3, 4, 1/2)
We use the standard arithmetical operators to calculate with such tuples:
a + b, a*b, 2*a
Some system functions were overloaded for such elements, such
as diff
, map
or zip
(see the description
of the corresponding methods "diff"
, "map"
and "zip"
above).
For example, to divide each component of a
by
2 we enter:
map(a, `/`, 2)
The quoted character `/`
is another notation
for the function _divide
, the functional form of
the division operator /
.
Be careful that the mapping function returns elements of the
domain the product is defined over. This is not checked by the function map
(for
efficiency reasons) and may lead to "invalid" tuples.
For example:
b := map(a, sin); domtype(b)
But the components of b
are no longer rational
numbers!

An arbitrary domain of elements, i.e., a domain of category 

The dimension of the product (a positive integer); default is 

Elements of 

A list of 
"dimen"  is the dimension of 
"coeffRing"  is the domain 
"one"  is the 
"zero"  is the 