Skip to content

Commit

Permalink
is_trivial for generic groups
Browse files Browse the repository at this point in the history
  • Loading branch information
mantepse committed Dec 13, 2023
1 parent 23dec53 commit 6455956
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/sage/groups/group.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,39 @@ cdef class Group(Parent):
"""
return self.order() != infinity

def is_trivial(self):
r"""
Return ``True`` if this group is the trivial group.
A group is trivial, if it consists only of the identity
element.
.. WARNING::
It is in principle undecidable whether a group is
trivial, for example, if the group is given by a finite
presentation. Thus, this method may not terminate.
EXAMPLES::
sage: groups.presentation.Cyclic(1).is_trivial()
True
sage: G.<a,b> = FreeGroup('a, b')
sage: H = G / (a^2, b^3, a*b*~a*~b)
sage: H.is_trivial()
False
A non-trivial presentation of the trivial group::
sage: F.<a,b> = FreeGroup()
sage: J = F / ((~a)*b*a*(~b)^2, (~b)*a*b*(~a)^2)
sage: J.is_trivial()
True
"""
return self.order() == 1


def is_multiplicative(self):
r"""
Returns True if the group operation is given by \* (rather than
Expand Down

0 comments on commit 6455956

Please sign in to comment.