Coercing elements into a set in MAGMA

989 Views Asked by At

Suppose I had a permutation group $G$ for example, that corresponded to the intersection of some elements of a list $H$ where the elements are groups. Then, if I wanted to create a set or some structure that enumerates elements in the form $\{G,\{i_{1}...i_{n}\}\}$ where $G = H[i_{1}]\cap ... \cap H[i_{n}]$, how would I construct such a structure? I attempted to do this by explicitly constructing a set, but MAGMA would not allow me to create a set consisting of both integers and a group structure in the same universe. Moreover, I tried some coercion commands, but that would not allow me to achieve this either. Is there any way to do this?

1

There are 1 best solutions below

0
On BEST ANSWER

If I understand you correctly, your main issue appears to be that you tried to create the set $\{G, \{i_1...i_n\}\}$ and MAGMA did not allow you to do so. This is because, in MAGMA, all elements of a set (or sequence) are required to be of the same type. If you want to aggregate elements of different types then you will need to use either a tuple (represented by angled brackets: < >) or a list (represented by square brackets with asterisks: [* *]). For cases where the length will not change, such as here, it would seem that a tuple is more appropriate. So what you should use is <$G, \{i_1...i_n\}$> instead.

To (I hope) answer your larger issue, you seem to want to iterate through the possible non-empty intersections of the groups in H. If that was all that you wished to do then you could convert H to a set and use the Subsets intrinsic:

> for S in Subsets(Set(H)) do
>     if #S eq 0 then continue; end if;
>     G := &meet S;
>     // do something with G
> end for;

If you want to generate all such groups G then it is a one-liner:

> allG := [ &meet S : S in Subsets(Set(H)) | #S gt 0 ];

However, if you also want to keep track of those indices then you have to be a little less direct:

> for S in Subsets({1..#H}) do
>     if #S eq 0 then continue; end if;
>     G := &meet H[Setseq(S)];    // Setseq converts the set to a sequence
>     // do something with G and S
> end for;

Or the generate-all-at-once approach:

> allG := [ <&meet H[Setseq(S)], S> : S in Subsets({1..#H}) | #S gt 0 ];