Documentation Center |
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 component-wise to the tuples.
If Set has Ax::canonicalRep, then Ax::canonicalRep.
If Set has Cat::AbelianMonoid, then Ax::normalRep.
Define the 3-fold 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!
Set |
An arbitrary domain of elements, i.e., a domain of category Cat::BaseCategory |
n |
The dimension of the product (a positive integer); default is 1 |
e1e2, en, … |
Elements of Set or objects convertible into such |
List |
A list of n elements of Set or objects convertible into such |
"dimen" | is the dimension of Dom::Product(Set, n), which is equal to n. |
"coeffRing" | is the domain S. |
"one" | is the n-tuple (Set::one, Set::one, ..., Set::one). This entry only exists if Set is a monoid, i.e., a domain of category Cat::Monoid. |
"zero" | is the n-tuple (Set::zero, Set::zero, ..., Set::zero). This entry only exists if Set is an Abelian group, i.e., a domain of category Cat::AbelianGroup. |