[Next] [Prev] [Right] [Left] [Up] [Index] [Root]
Cartesian Product Constructor and Functions

Cartesian Product Constructor and Functions

The special constructor car< ... > is used for the creation of cartesian products of structures.

car< R_1, ..., R_k > : Str, ..., Str -> SetCart
Given a list of sets or algebraic structures R_1, ..., R_k, construct the cartesian product set R_1 x ... x R_k.
CartesianProduct(R, S) : Str, ..., Str -> SetCart
Given structures R and S, construct the cartesian product set R x S. This is the same as calling the car constructor with the two arguments R and S.
CartesianPower(R, k) : Str, RngIntElt -> SetCart
Given a structure R and an integer k, construct the cartesian power set R^(k)
Flat(C) : SetCart -> SetCart
Given a cartesian product C of structures which may themselves be cartesian products, return the cartesian product of the base structures, considered in depth-first order.
NumberOfComponents(C) : SetCart -> RngIntElt
Given a cartesian product C, return the number of components of C.
Component(C, i) : SetCart, RngIntElt -> Str
C[i] : SetCart, RngIntElt -> Str
The i-th component of C.
# C : SetCart -> RngIntElt
Given a cartesian product C, return the cardinality of C.
Rep(C) : SetCart -> Elt
Given a cartesian product C, return a representative of C.
Random(C) : SetCart -> Elt
Given a cartesian product C, return a random element of C.

Example Tup_CartesianProduct (H9E1)

We create the product of Q and Z.

> C := car< RationalField(), Integers() >;
> C;
Cartesian Product<Rational Field, Ring of Integers>

[Next] [Prev] [Right] [Left] [Up] [Index] [Root]