Skip to content

Commit f6a5560

Browse files
committed
SimpleGroup: some fixes; better input validation; tests
* adjust case of error messages * catch various invalid parameters classical groups, instead of returning non-simple groups with IsSimpleGroup forcibly set * fix error message for 2E(n,q) with n<>6 (referred to 3D with n<>4) * add tests
1 parent 56e19c3 commit f6a5560

File tree

3 files changed

+310
-24
lines changed

3 files changed

+310
-24
lines changed

grp/simple.gi

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ local brg,str,p,a,param,g,s,small,plus,sets;
349349
SetIsSimpleGroup(g,true);
350350
return g;
351351
else
352-
Error("Illegal Parameter for Alternating groups");
352+
Error("illegal parameter for alternating groups");
353353
fi;
354354

355355
elif (str="M" and Length(param)=0) or str="FG" then
@@ -362,7 +362,7 @@ local brg,str,p,a,param,g,s,small,plus,sets;
362362
SetName(g,Concatenation("M",String(param[1])));
363363
return g;
364364
else
365-
Error("Illegal Parameter for Mathieu groups");
365+
Error("illegal parameter for Mathieu groups");
366366
fi;
367367

368368
elif str="J" or str="JANKO" then
@@ -378,7 +378,7 @@ local brg,str,p,a,param,g,s,small,plus,sets;
378378
SetIsSimpleGroup(g,true);
379379
return g;
380380
else
381-
Error("Illegal Parameter for Janko groups");
381+
Error("illegal parameter for Janko groups");
382382
fi;
383383

384384
elif str="CO" or str="." or str="CONWAY" then
@@ -393,7 +393,7 @@ local brg,str,p,a,param,g,s,small,plus,sets;
393393
SetIsSimpleGroup(g,true);
394394
return g;
395395
else
396-
Error("Illegal Parameter for Conway groups");
396+
Error("illegal parameter for Conway groups");
397397
fi;
398398

399399
elif str="FI" or str="FISCHER" then
@@ -404,7 +404,7 @@ local brg,str,p,a,param,g,s,small,plus,sets;
404404
SetIsSimpleGroup(g,true);
405405
return g;
406406
else
407-
Error("Illegal Parameter for Fischer groups");
407+
Error("illegal parameter for Fischer groups");
408408
fi;
409409
elif str="SUZ" or str="SZ" or str="SUZUKI" then
410410
if Length(param)=0 and str="SUZ" then
@@ -418,7 +418,7 @@ local brg,str,p,a,param,g,s,small,plus,sets;
418418
SetIsSimpleGroup(g,true);
419419
return g;
420420
else
421-
Error("Illegal Parameter for Suzuki groups");
421+
Error("illegal parameter for Suzuki groups");
422422
fi;
423423
elif str="R" or str="REE" or str="2G" then
424424
if Length(param)=1 and param[1]>26 and
@@ -428,27 +428,21 @@ local brg,str,p,a,param,g,s,small,plus,sets;
428428
SetIsSimpleGroup(g,true);
429429
return g;
430430
else
431-
Error("Illegal Parameter for Ree groups");
431+
Error("illegal parameter for Ree groups");
432432
fi;
433433

434434
elif str="ON" then
435435
return DoAtlasrepGroup(["ON"]);
436436
elif str="HE" then
437437
return PrimitiveGroup(2058,1);
438-
SetIsSimpleGroup(g,true);
439-
return g;
440438
elif str="HS" then
441439
return PrimitiveGroup(100,3);
442-
SetIsSimpleGroup(g,true);
443-
return g;
444440
elif str="HN" then
445441
return DoAtlasrepGroup(["HN"]);
446442
elif str="LY" then
447443
return DoAtlasrepGroup(["Ly"]);
448444
elif str="MC" or str="MCL" then
449445
return PrimitiveGroup(275,1);
450-
SetIsSimpleGroup(g,true);
451-
return g;
452446
elif str="TH" then
453447
return DoAtlasrepGroup(["Th"]);
454448
elif str="RU" then
@@ -474,18 +468,30 @@ local brg,str,p,a,param,g,s,small,plus,sets;
474468
small:=false;
475469
s:=fail;
476470
if str="L" or str="SL" or str="PSL" then
471+
if param = [2,2] or param = [2,3] then
472+
Error("illegal parameter for linear groups");
473+
fi;
477474
g:=PSL(param[1],param[2]);
478475
s:=Concatenation("PSL(",String(param[1]),",",String(param[2]),")");
479476
elif str="U" or str="SU" or str="PSU" then
477+
if param in [ [2,2], [2,3], [3,2] ] then
478+
Error("illegal parameter for unitary groups");
479+
fi;
480480
g:=PSU(param[1],param[2]);
481481
s:=Concatenation("PSU(",String(param[1]),",",String(param[2]),")");
482482
small:=true;
483483
elif str="S" or str="SP" or str="PSP" then
484+
if param in [ [2,2], [2,3], [4,2] ] then
485+
Error("illegal parameter for symplectic groups");
486+
fi;
484487
g:=PSp(param[1],param[2]);
485488
s:=Concatenation("PSp(",String(param[1]),",",String(param[2]),")");
486489
small:=true;
487490
elif str="O" or str="SO" or str="PSO" then
488491
if Length(param)=2 and IsOddInt(param[1]) then
492+
if param[1] < 3 or (param[1] = 3 and param[2] <= 3) then
493+
Error("illegal parameter for orthogonal groups");
494+
fi;
489495
g:=SO(param[1],param[2]);
490496
g:=Action(g,NormedRowVectors(GF(param[2])^param[1]),OnLines);
491497
s:=DerivedSubgroup(g);
@@ -499,12 +505,18 @@ local brg,str,p,a,param,g,s,small,plus,sets;
499505
s:=Concatenation("O(",String(param[1]),",",String(param[2]),")");
500506
small:=true;
501507
elif Length(param)=3 and param[1]=1 and IsEvenInt(param[2]) then
508+
if param[2] < 6 then
509+
Error("illegal parameter for orthogonal groups");
510+
fi;
502511
g:=SO(1,param[2],param[3]);
503512
g:=Action(g,NormedRowVectors(GF(param[3])^param[2]),OnLines);
504513
g:=DerivedSubgroup(g);
505514
s:=Concatenation("O+(",String(param[2]),",",String(param[3]),")");
506515
small:=true;
507516
elif Length(param)=3 and param[1]=-1 and IsEvenInt(param[2]) then
517+
if param[2] < 4 then
518+
Error("illegal parameter for orthogonal groups");
519+
fi;
508520
g:=SO(-1,param[2],param[3]);
509521
g:=Action(g,NormedRowVectors(GF(param[3])^param[2]),OnLines);
510522
g:=DerivedSubgroup(g);
@@ -568,7 +580,7 @@ local brg,str,p,a,param,g,s,small,plus,sets;
568580

569581
elif str="2E" then
570582
if Length(param)>1 and param[1]<>6 then
571-
Error("3D(n,q) needs n=4");
583+
Error("2E(n,q) needs n=6");
572584
fi;
573585
a:=param[Length(param)];
574586
s:=Concatenation("2E6(",String(a),")");

0 commit comments

Comments
 (0)