GAP:IsFiniteJoinClosedGivenClosedUnderJoinWithNormalAndWeakerThanNormalForPGroup

Function type
The function takes as input a group and a subgroup property and outputs a boolean variable.

Behavior
The function behaves as follows:


 * If the group is a group of prime power order, and every normal subgroup of the group has the property, and further, the join of any normal subgroup and any subgroup with the property also has the property, then the function returns true if the join of any two subgroups with the property has the property ,and false otherwise.

Typical usage
The typical usage is in the form:

IsFiniteJoinClosedGivenClosedUnderJoinWithNormalAndWeakerThanNormalForPGroup(group,property);

where property is satisfied by every normal subgroup of the group, and the join of any subgroup with the property with any subgroup of the group also has the property.

Code
IsFiniteJoinClosedGivenClosedUnderJoinWithNormalAndWeakerThanNormalForPGroup := function(G,P) local H, K, L, R, S, Q;	Q := PrimePGroup(G); L := Filtered(ConjugacyClassesSubgroups(G),C -> P(G,Representative(C)) 	    and Index(G,Representative(C)) > Q^2	     and not IsNormal(G,Representative(C))); for R in L do           H := Representative(R); for S in L do               for K in AsList(S) do                    if (not P(G,Group(Union(H,K)))) then return false; fi; od; od; od; return true; end;;