Skip to content

Commit 1ef1380

Browse files
mantepsedimpase
authored andcommitted
is_trivial for generic groups
1 parent 9222df6 commit 1ef1380

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/sage/groups/group.pyx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,39 @@ cdef class Group(Parent):
186186
"""
187187
return self.order() != infinity
188188

189+
def is_trivial(self):
190+
r"""
191+
Return ``True`` if this group is the trivial group.
192+
193+
A group is trivial, if it consists only of the identity
194+
element.
195+
196+
.. WARNING::
197+
198+
It is in principle undecidable whether a group is
199+
trivial, for example, if the group is given by a finite
200+
presentation. Thus, this method may not terminate.
201+
202+
EXAMPLES::
203+
204+
sage: groups.presentation.Cyclic(1).is_trivial()
205+
True
206+
207+
sage: G.<a,b> = FreeGroup('a, b')
208+
sage: H = G / (a^2, b^3, a*b*~a*~b)
209+
sage: H.is_trivial()
210+
False
211+
212+
A non-trivial presentation of the trivial group::
213+
214+
sage: F.<a,b> = FreeGroup()
215+
sage: J = F / ((~a)*b*a*(~b)^2, (~b)*a*b*(~a)^2)
216+
sage: J.is_trivial()
217+
True
218+
"""
219+
return self.order() == 1
220+
221+
189222
def is_multiplicative(self):
190223
r"""
191224
Returns True if the group operation is given by \* (rather than

0 commit comments

Comments
 (0)