> < ^ Date: Sun, 20 May 2001 03:30:14 +1000 (EST)
> < ^ From: Greg Gamble <greg.gamble@math.rwth-aachen.de >
> < ^ Subject: Re: am I missing something??

GAP forum:
On Sat, May 19, 2001 at 01:28:03PM +0800, MICHAEL HARTLEY wrote:
> In section 36.8 of the GAP4 manual says that "For element
> operations such as in, a double coset behaves like a set of group
> elements".

Hi Michael,

I guess the problem here is that there is no `Elements' method for
double cosets. I'm not sure whether this is intentional; perhaps someone
else will follow up with some more details. We could have done with an
example here of how you intended to use these functions. If you wanted
to print out the elements, then I guess your groups are small and so
the following strategy should do you:

There is an `Elements' method for right cosets and right transversals.
So for a double coset HgK rewrite as:

```    -1                                             -1
HgKg  g =   U   Htg, where T = RightTransversal(gKg  , L) and
t in T                                   -1)
L = Intersection(H, gKg  )
```

i.e. using this approach the double coset HgK is realised as a union
of right cosets. In fact, GAP4 provides: `RepresentativesContainedRightCosets'
which essentially returns the set Tg. So here's an example of how one can
do it:

```gap> G := Group([ (1,2,3,4), (1,2) ]);
Group([ (1,2,3,4), (1,2) ])
gap> H := Subgroup(G, [(1,2,3), (1,2)]);
Group([ (1,2,3), (1,2) ])
gap> K := Subgroup(G, [(3,4)]);
Group([ (3,4) ])
gap> g := (2,4);
(2,4)
gap> D := DoubleCoset(H, g, K);
DoubleCoset(Group( [ (1,2,3), (1,2) ] ),(2,4),Group( [ (3,4) ] ))
gap> Tg := RepresentativesContainedRightCosets(D);
[ (2,3,4) ]
gap> D_as_right_cosets := Union(List(Tg, tg -> RightCoset(H, tg)));
RightCoset(Group( [ (1,2,3), (1,2) ] ),(2,3,4))
gap> Elements(D_as_right_cosets);
[ (2,3,4), (2,4), (1,3,4,2), (1,3)(2,4), (1,4,2), (1,4,2,3) ]
```

If this is the right strategy for you, you could define a function:

DoubleCosetAsRightCosets := function(H, g, K)
local D, Tg;
D := DoubleCoset(H, g, K);
Tg := RepresentativesContainedRightCosets(D);
return Union(List(Tg, tg -> RightCoset(H, tg)));
end;

Then just use `DoubleCosetAsRightCosets' where you would otherwise
have used `DoubleCoset'.

On the other hand, if your groups are big, perhaps you don't really
want to do this at all. In this case, you probably only want to check
whether certain elements are in the intersection or union and in such
cases you should probably translate these to the corresponding logical
`and' and `or' operations i.e.

```x in Intersection(H, K) <=> x in H and x in K
x in Union(H,K)         <=> x in H or  x in K
```

and in this case `DoubleCoset' will be the right function for you to
use.

So, I guess the question is: `How big are your groups?'

But when I try to take the union or intersection of a DoubleCoset
with a Set of group elements, GAP4 can't do it! It enters the break
loop...

How can I (easily) take these unions and intersections??

I hope one of the above solutions is the right one for you and satisfies
the `easy' criterion.

```  Regards,
Greg Gamble
___________________________________________________________________
Greg Gamble   __________________   mailto:gregg@math.rwth-aachen.de
Lehrstuhl D fuer Mathematik                     Tel: +49 241 804545
Templergraben 64
52062 Aachen, Germany   http://www.math.rwth-aachen.de/~Greg.Gamble
___________________________________________________________________
```

> < [top]