-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance some nilpotent and p-group attributes #442
Merged
fingolfin
merged 5 commits into
gap-system:master
from
hungaborhorvath:NilpotentandPGroups
Jan 18, 2016
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c9c4b01
Enhance IsPGroup
hungaborhorvath 53ab715
Enhance PrimePGroup
hungaborhorvath 548aa4a
Enhance IsNilpotentGroup
hungaborhorvath 0f9725e
Remove code duplication and rename functions
hungaborhorvath b39efb0
Add test file for p-groups
hungaborhorvath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
gap> START_TEST("pgroups.tst"); | ||
gap> A := Group((1,2),(3,4),(5,6)); | ||
Group([ (1,2), (3,4), (5,6) ]) | ||
gap> G := DirectProduct(A, A); | ||
Group([ (1,2), (3,4), (5,6), (7,8), (9,10), (11,12) ]) | ||
gap> IsPGroup(G); | ||
true | ||
gap> HasPrimePGroup(A) and HasPrimePGroup(G); | ||
true | ||
gap> PrimePGroup(A); | ||
2 | ||
gap> PrimePGroup(G); | ||
2 | ||
gap> B := Group((1,2,3),(4,5,6)); | ||
Group([ (1,2,3), (4,5,6) ]) | ||
gap> IsAbelian(B); | ||
true | ||
gap> G := DirectProduct(B, B); | ||
Group([ (1,2,3), (4,5,6), (7,8,9), (10,11,12) ]) | ||
gap> IsPGroup(G); | ||
true | ||
gap> HasPrimePGroup(G); | ||
true | ||
gap> PrimePGroup(G); | ||
3 | ||
gap> C := Group((1,2,3,4),(5,6,7,8)); | ||
Group([ (1,2,3,4), (5,6,7,8) ]) | ||
gap> IsAbelian(C); | ||
true | ||
gap> G := DirectProduct(C, C); | ||
Group([ (1,2,3,4), (5,6,7,8), (9,10,11,12), (13,14,15,16) ]) | ||
gap> Size(G); | ||
256 | ||
gap> IsPGroup(G); | ||
true | ||
gap> HasPrimePGroup(G); | ||
true | ||
gap> PrimePGroup(G); | ||
2 | ||
gap> D := Group((1,3),(1,2,3,4)); | ||
Group([ (1,3), (1,2,3,4) ]) | ||
gap> G := DirectProduct(D, D); | ||
Group([ (1,3), (1,2,3,4), (5,7), (5,6,7,8) ]) | ||
gap> IsPGroup(G); | ||
true | ||
gap> HasPrimePGroup(D) and HasPrimePGroup(G); | ||
true | ||
gap> PrimePGroup(D); | ||
2 | ||
gap> PrimePGroup(G); | ||
2 | ||
gap> Q := Group( (1,2,3,8)(4,5,6,7), (1,7,3,5)(2,6,8,4) ); | ||
Group([ (1,2,3,8)(4,5,6,7), (1,7,3,5)(2,6,8,4) ]) | ||
gap> SetIsPGroup(Q,true); | ||
gap> PrimePGroup(Q); | ||
2 | ||
gap> G := DihedralGroup(IsFpGroup, 8); | ||
<fp group of size 8 on the generators [ r, s ]> | ||
gap> IsPGroup(G); | ||
true | ||
gap> H := CyclicGroup(IsFpGroup, 2); | ||
<fp group of size 2 on the generators [ a ]> | ||
gap> hom := GroupHomomorphismByImages(G, H, [G.1, G.2], [H.1, One(H)]); | ||
[ r, s ] -> [ a, <identity ...> ] | ||
gap> K := Kernel(hom); | ||
Group(<fp, no generators known>) | ||
gap> SetIsPGroup(K, true); | ||
gap> PrimePGroup(K); | ||
2 | ||
gap> IsPGroup(TrivialGroup()); | ||
true | ||
gap> PrimePGroup(TrivialGroup()); | ||
fail | ||
gap> IsPGroup(AbelianGroup([2, 4, 8, 16])); | ||
true | ||
gap> IsPGroup(AbelianGroup([2, 4, 8, 18])); | ||
false | ||
gap> H1 := Group((1,2)(3,4),(1,2,3)); | ||
Group([ (1,2)(3,4), (1,2,3) ]) | ||
gap> IsPGroup(H1); | ||
false | ||
gap> H2 := Group((1,2),(3,4,5)); | ||
Group([ (1,2), (3,4,5) ]) | ||
gap> IsPGroup(H2); | ||
false | ||
gap> H3 := Group((1,2),(3,4,5)); | ||
Group([ (1,2), (3,4,5) ]) | ||
gap> IsAbelian(H3); | ||
true | ||
gap> IsPGroup(H3); | ||
false | ||
gap> H4 := Group((1,2),(3,4,5)); | ||
Group([ (1,2), (3,4,5) ]) | ||
gap> IsAbelian(H4); | ||
true | ||
gap> Size(H4); | ||
6 | ||
gap> IsPGroup(H4); | ||
false | ||
gap> K := Group((1,3),(1,2,3,4),(5,6,7)); | ||
Group([ (1,3), (1,2,3,4), (5,6,7) ]) | ||
gap> IsNilpotentGroup(K); | ||
true | ||
gap> HasIsPGroup(K); | ||
true | ||
gap> IsPGroup(K); | ||
false | ||
gap> L := Group((2,4), (1,2,3,4)); | ||
Group([ (2,4), (1,2,3,4) ]) | ||
gap> IsNilpotentGroup(L); | ||
true | ||
gap> HasIsPGroup(L) and HasPrimePGroup(L); | ||
true | ||
gap> IsPGroup(L); | ||
true | ||
gap> PrimePGroup(L); | ||
2 | ||
gap> F := FreeGroup("r","s"); | ||
<free group on the generators [ r, s ]> | ||
gap> r := F.1; s := F.2; | ||
r | ||
s | ||
gap> G := F/[ r^4, s^2, s*r*s*r ]; | ||
<fp group on the generators [ r, s ]> | ||
gap> IsNilpotentGroup(G); | ||
true | ||
gap> G := F/[ r^3, s^2, r*s*r*s ]; | ||
<fp group on the generators [ r, s ]> | ||
gap> IsNilpotentGroup(G); | ||
false | ||
gap> ForAll(List([1..11], i -> TransitiveGroup(8,i)), IsPGroup); | ||
true | ||
gap> IsPGroup(TransitiveGroup(8, 12)); | ||
false | ||
gap> IsNilpotentGroup(TransitiveGroup(8, 12)); | ||
false | ||
gap> IsPGroup(AlternatingGroup(3)); | ||
true | ||
gap> IsPGroup(AlternatingGroup(4)); | ||
false | ||
gap> IsPGroup(SymmetricGroup(3)); | ||
false | ||
gap> G := SymmetricGroup(8); | ||
Sym( [ 1 .. 8 ] ) | ||
gap> s := Size(G); | ||
40320 | ||
gap> IsPGroup(G); | ||
false | ||
gap> IsNilpotentGroup(G); | ||
false | ||
gap> ForAll(PrimeDivisors(s), p -> HasIsPGroup(SylowSubgroup(G, p))); | ||
true | ||
gap> ForAll(PrimeDivisors(s), p -> HasPrimePGroup(SylowSubgroup(G, p))); | ||
true | ||
gap> ForAll(PrimeDivisors(s), p -> p=PrimePGroup(SylowSubgroup(G, p))); | ||
true | ||
gap> G := DihedralGroup(Factorial(8)); | ||
<pc group of size 40320 with 11 generators> | ||
gap> IsPGroup(G); | ||
false | ||
gap> IsNilpotentGroup(G); | ||
false | ||
gap> s := Size(G); | ||
40320 | ||
gap> ForAll(PrimeDivisors(s), p -> HasIsPGroup(SylowSubgroup(G, p))); | ||
true | ||
gap> ForAll(PrimeDivisors(s), p -> HasPrimePGroup(SylowSubgroup(G, p))); | ||
true | ||
gap> ForAll(PrimeDivisors(s), p -> p=PrimePGroup(SylowSubgroup(G, p))); | ||
true | ||
gap> STOP_TEST("pgroups.tst", 10000); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am somewhat wary of this method. Being able to compute the size is not the same as being able to do so "quickly" or "easily" (as in
CanEasilyComputePcgs
). So this could lead to unexpected slow downs.But perhaps I am just too careful here... The true problem, in any case, is that with all these automatic deductions, the system becomes very hard to predict; seemingly innocent changes can cause major changes in behaviour, both good and bad ones sigh.
So, I am not opposed to that change, just... wary... :/ But probably we should just ignore me in that regard!