Thank you, it's an interesting question. I am not aware of such functionality available anywhere, but looking at the literature (see references in the comments in the GAP code below), it seems that there may be at least three possible approaches:
1) Calculate the lattice of subgroups and check that it does not contain a sublattice
isomorphic to the "pentagon" lattice.
2) Since groups with modular subgroup lattice (also called M-groups) are classified,
one can try to implement known criteria for a finite group to be an M-group.
3) Straightforward calculation of subgroups of the group and then checking that the modular
I've implemented (3) in GAP as follows:
# 1) R. Schmidt, Subgroup lattices of groups. Expositions in Mathematics, 14.
# Walter de Gruyter, Berlin, 1994.
# 2) P.P. Pálfy, Groups and lattices. Groups St. Andrews 2001 in Oxford.
# Vol. II, 428–454, London Math. Soc. Lecture Note Ser., 305, Cambridge
# Univ. Press, Cambridge, 2003.
# 3) A. Ballester-Bolinches, R. Esteban-Romero, M. Asaad, Products of finite
# groups. Expositions in Mathematics, 53. Walter de Gruyter, Berlin, 2010.
local ccg, ccz, cg, cz, x, y, z, c;
# Easy cases first
# Abelian groups are M-groups
if IsAbelian(G) then
# Every finite M-group is metabelian
if not IsAbelian( DerivedSubgroup(G) ) then
# Now do some work
# The lattice of normal subgroups is modular. Since we already
# know conjugacy classes, let's check if this may be the case.
if ForAll(ccg, c -> Size(c)=1) then
# Check the modular law: x<=z => x v ( y ^ z ) = (x v y) ^ z
for cg in ccg do
# z runs over representatives of conjugacy classes of subgroups G
if Size(z)<>1 and Size(z)<>Size(G) then
for cz in ccz do
# x runs over representatives of conjugacy classes of subgroups of z
if Size(x) <> 1 then
for cg in ccg do
# y runs over all subgroups of G
for y in cg do
if Size(y) <> 1 then
if not ClosureGroup(x,Intersection(y,z)) =
For example, using this function we may find that there are 11 M-groups of order 32:
For larger groups it may take a while to perform the check, especially if the group is an M-group. To avoid spending more time on repetitive checks of the same group, one can declare a property
IsMGroup and then install the function above as a method for that property. For further instructions, enter
?InstallMethod in GAP, and also the chapter "Examples of Extending the System" from the GAP reference manual (enter
?Adding new concepts to see the particularly relevant manual section which, by coincidence, also adds a property "IsMGroup", but for another notion).