[GAP Forum] Collections of Tuples

Thomas Breuer thomas.breuer at math.rwth-aachen.de
Wed May 27 13:42:51 BST 2009


Dear GAP Forum,

Chris Beck wrote

> Can somebody please explain to me why this returns false?
> 
> gap> IsTuple(Tuples([1,2],2)[1]);
> false
> 
> Is this a glitch or something? It took me a really long time to figure
> out that Tuples did not return a collection of tuples, and if there's
> no good reason that it doesn't, it would save a lot of people some
> headaches if the return type of this were changed.

I agree that the names `IsTuple' and `Tuples' are not consistent.

In order to avoid the confusion Chris mentioned, we will rename `IsTuple'
to `IsDirectProductElement' (and the related undocumented function `Tuple'
to `DirectProductElement'), following a proposal of Burkhard H"ofling.
The names `IsTuple' and `Tuple' will still be available in the next few
versions of GAP, but they will not be documented.

Thanks for pointing out the inconsistency.

All the best,
Thomas Breuer

P.S.:  (For those who are interested in the details)

The name `Tuples' expresses the ``mathematical'' viewpoint of ordered
tuples over a given set,
whereas `IsTuple' is used as a ``technical'' filter that describes
GAP objects wrapping lists of other objects,
such that sum and product are defined componentwise
--of course this is effective only if the objects in the lists admit
an addition or a multiplication.

The only examples of objects in the GAP library for which `IsTuple' is set
to `true' are
- elements in ``inhomogeneous'' direct products of groups,
  such as the direct product of a permutation group and a matrix group
  or a pc group, and
- elements in the underlying relations of general mappings
  (the underlying relation of a general mapping is a subset of the direct
  product of the mapping's source and range).

Currently `Tuples' returns a list whose elements are plain lists.
So the sum and the product of these elements are usually not defined
pointwise.
It is not desirable to change this behaviour.

The new name, `IsDirectProductElement', fits to the intended meaning,
in particular it fits to the abovementioned two kinds of GAP objects.



More information about the Forum mailing list