Discrete helpers/set part

This class implements set partitions, which are essentially the same as es. The partitioned set (called domain) is usually that of non-negative integers.

Cayley tables


can be used to model the of a group. It makes sense to use a set of simple IDs for the elements of the group. (Typically that should be integers or pairs of integers.) Then the  argument is the Cartesian square of the set of IDs. The entries of the Cayley table are IDs added as labels to the blocks. The method  will take care of creating the blocks.

Let  be a   from IDs to permutations.

Only the blocks decide if two  objects are equal. The labels are additional information.

The attribute  is a bidict from blocks (converted to tuples for technical reasons) to labels.

What are the products of permutations 3 and 5?

Which (other) products create the permutations 1 and 2?

meet and join
The methods can be used to combine two partitions into one.
 * The meet $$\land$$ (greatest lower bound) is the coarsest partition finer than both.
 * The join $$\lor$$ (least upper bound) is the finest partition coarser than both.

The meet is easy to calculate. The join is currently expensive, and will hopefully be improved.

meet
The default partition is the finest, and it can be made coarser. But one can not start with the coarsest, and make it finer. (Although theoretically there would be nothing wrong with that.) This method is a way to make blocks smaller instead of bigger.

This example shows how to find all intersections of three sets. (This is related to Boolf.)