# How to test number of containments in subgroups with GAP

Here it is: for a given soluble group $G$, I want to test whether the number of Carter subgroups containing a given nilpotent subgroup $N$ of $G$ is congruent to $0$ or $1$ modulo a certain number $m(G)$, depending on $G$ and defined by $m(G) = \gcd\left\{p-1 : p \mid |G|,\, p \,\text{prime}\right\}$. Since I want $N$ to be arbitrary, I want this test for all nilpotent subgroups of $G$.

Of course, the question is pointless if $G$ is nilpotent, so I would also like to ask how to obtain a filtered list of all soluble but non-nilpotent groups up to a given order (say 100).

For reference, based on Max's suggestions:

LoadPackage("format”);;
count := function(G, N)
return
Number(ConjugacyClassSubgroups(G, CarterSubgroup(G)), x -> IsSubgroup(x, N));
end;;

grps := AllSmallGroups([1..100], IsNilpotentGroup, false, IsSolvableGroup, true);;

for i in [1..Length(grps)] do
G := grps[i];;
nilsubs := Filtered(List(ConjugacyClassesSubgroups(G),Representative),IsNilpotentGroup);;
for N in nilsubs do
if count(G,N) > 0 then
m := G -> Gcd(List(Set(Factors(Size(G))), p -> p-1));;
if count(G,N) mod m(G) > 1 then
Print(false);
fi;
fi;
od;
od;

• This should not be complicated (at least for groups of reasonable orders). See math.stackexchange.com/q/460727 for conjugacy classes of subgroups, and GAP Software Carpentry Lesson for examples of using GAP Small Groups Library Aug 3, 2016 at 20:00
• I know what I'm asking is easy, but I don't have the patience to try and remember what little I knew of GAP from before, so I am essentially looking for someone to do this work for me. I'll start a bounty as soon as possible. Aug 3, 2016 at 23:57
• It would be good if you clarified what you exactly want. So what exactly is missing in the code I provided, resp. the code you derived from it? Aug 6, 2016 at 11:55
• You first say: "For a given nilpotent subgroup" -- my code handles that code. You then say: "I want this test for all nilpotent subgroups of G", which technically I also did (note that your statement was/is ambiguous). Based on your example code, it seems you just want to print a long list of false and true (instead of, say, counting how many of which kind you see). That sounds rather pointless to me, so I assume you want to know something else. But what is a mystery.... Aug 6, 2016 at 11:58
• What I really want is to see if there is a soluble, non-nilpotent group $G$ with a Carter subgroup $C$ and a nilpotent subgroup $N$ such that the number of containments of $N$ in conjugates of $C$ is at least one but not congruent to $1 \pmod{m_G}$. The first requirement is obvious, since there are, in general, nilpotent subgroups not contained in any Carter subgroup. However, if $N$ is contained in at least one Carter subgroup, then I conjecture that the aforementioned congruence holds, and I'd like to have some computational evidence verifying this. Aug 6, 2016 at 12:05

The GAP package FORMAT allows computing things like Carter subgroups.

To compute all solvable but not nilpotent groups of order up to 100, you can use this:

gap> grps := AllSmallGroups([1..100], IsNilpotentGroup, false, IsSolvableGroup, true);;
gap> Length(grps);
463


So let's look at some examples

gap> LoadPackage("format");
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
by Bettina Eick (http://www.icm.tu-bs.de/~beick) and
Charles R.B. Wright (http://www.uoregon.edu/~wright).
Homepage: http://www.uoregon.edu/~wright/RESEARCH/format/
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
true
gap> grps := AllSmallGroups([1..100], IsNilpotentGroup, false, IsSolvableGroup, true);;
gap> G := grps[100]; # some arbitrary group
<pc group of size 50 with 3 generators>
gap> N := NormalSubgroups(G)[3]; # some normal subgroup
Group([ f3 ])
gap> N := Group(G.1*G.3);; # some nilpotent subgroup
gap> IsNilpotentGroup(N);
true


Since all Carter subgroups of a finite solvable group are conjugate, we can count how many of them contain $N$ quite easily:

gap> count := function(G, N) return Number(ConjugacyClassSubgroups(G, CarterSubgroup(G)), x -> IsSubgroup(x, N)); end;;
gap> count(G,N);
1


Finally, you can compute the value mod $m(G)$ as follows:

gap> m := G -> Gcd(List(Set(Factors(Size(G))), p -> p-1));;
gap> count(G,N) mod m(G);
0


UPDATE: Your comments indicate that what you really want to do is to test a conjecture which states that a certain number is always 0 or 1. The code you wrote based on my post does that; I edited it slightly to make it a bit faster.

UPDATE 2: Per your request, I changed the code to skip the case where the Carter subgroup is a Hall subgroup.

LoadPackage("format");;
count := function(G, N)
return Number(ConjugacyClassSubgroups(G, CarterSubgroup(G)),
x -> IsSubgroup(x, N));
end;;
m := G -> Gcd(List(Set(Factors(Size(G))), p -> p-1));;

grps := AllSmallGroups([1..100], IsNilpotentGroup, false, IsSolvableGroup, true);;

for i in [1..Length(grps)] do
if i mod 50 = 0 then Print(i, " of ", Length(grps), "\n"); fi;
G := grps[i];;

# skip if Carter subgroup is a Hall subgroup
H := CarterSubgroup(G);
if Gcd(Size(H), Index(G, H)) = 1 then continue; fi;

nilsubs := Filtered(List(ConjugacyClassesSubgroups(G),Representative),IsNilpotentGroup);;
mG := m(G);
for N in nilsubs do
if count(G,N) mod mG > 1 then
Print("Group ", IdGroup(G), " provides an example\n");
fi;
od;
od;

• Thanks, that comes quite close to what I want. If I may trouble you a little further, how can I iterate (for a given group in the list grps) over all nilpotent subgroups? Aug 5, 2016 at 18:24
• Use something like this to get one representative of each conjugacy class of nilpotent groups: Filtered(List(ConjugacyClassesSubgroups(G),Representative),IsNilpotentGroup) Aug 5, 2016 at 19:14
• I am not clear whether Representative (rather than Elements) suffice. Let me put down what I compile and maybe you can comment on the correctness of that. I will then award the bounty. Aug 5, 2016 at 19:30
• For elementary reasons, the count is the same for every $N$ in the same conjugacy class. So, if you want to try larger examples, you should definitely work with representatives. This, together with the size of the conjugacy class, gives the same information Aug 6, 2016 at 11:55
• I updated the code to skip Hall subgroups (which are trivial to detect: it's a subgroup whose size is coprime to its index). Aug 7, 2016 at 16:08