Using function with multiple args over a list

55 Views Asked by At

So working in GAP, I have constructed a list, $L$, of the normal subgroups of a given group of interest (which I defined to be $G$). Now I want to construct a new list $Q$ which is to be comprised of the corresponding quotient groups $G/N$ given by the command FactorGroup(G,N) for each $N\in L$, and herein lies the problem. There is a nice way to do this for functions of a single argument:

gap> Q:=List(L,FunctionOfOneVar);

Where FunctionOfOneVar is any function w/ a single argument, and GAP will do exactly what I am wanting it do for this case, but the problem is, FactorGroup takes two arguments, one of which I want to always be $G$, the other running over the list $L$. Is there a nice way to do this for a function of several vars? If so, how?

2

There are 2 best solutions below

0
On

So for anyone else having issues with similar tasks, I figured it out:

You use the command ListX, and you must make the other vars (that aren't to run over a list) into lists, with [var]. So for the case at hand, I did:

gap> Q:=ListX([G],L,FactorGroup);

and voila, I had my new list.

4
On

You can do:

List(L, N -> FactorGroup(G, N));

since one of the two arguments to the function is fixed.