File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1365,6 +1365,29 @@ def ngens(self):
1365
1365
"""
1366
1366
return len (self .gens ())
1367
1367
1368
+ def is_trivial (self ):
1369
+ r"""
1370
+ Return ``True`` if this group is the trivial group.
1371
+
1372
+ A permutation group is trivial, if it consists only of the
1373
+ identity element, that is, if it has no generators.
1374
+
1375
+ EXAMPLES::
1376
+
1377
+ sage: G = PermutationGroup([], domain=["a", "b", "c"])
1378
+ sage: G.is_trivial()
1379
+ True
1380
+ sage: SymmetricGroup(0).is_trivial()
1381
+ True
1382
+ sage: SymmetricGroup(1).is_trivial()
1383
+ True
1384
+ sage: SymmetricGroup(2).is_trivial()
1385
+ False
1386
+ sage: DihedralGroup(1).is_trivial()
1387
+ False
1388
+ """
1389
+ return not self ._gens or (len (self ._gens ) == 1 and self ._gens [0 ].is_one ())
1390
+
1368
1391
@cached_method
1369
1392
def one (self ):
1370
1393
"""
You can’t perform that action at this time.
0 commit comments