GAP Manual: 5.11. IsUnit

IsUnit( r )
IsUnit( R, r )

In the first form IsUnit returns true if the ring element r is a unit in its default ring (see DefaultRing). In the second form IsUnit returns true if r is a unit in the ring R.

An element r is called a unit in a ring R, if r has an inverse in R.

    gap> IsUnit( Integers, 2 );
    false
    gap> IsUnit( Integers, -1 );
    true 

IsUnit calls R.operations.IsUnit( R, r ) and returns the value.

The default function called this way is RingOps.IsUnit, which tries to compute the inverse of r with R.operations.Quotient( R, R.one, r ) and returns true if the result is not false, and false otherwise. Special categories of rings overlay this default function with more efficient functions.


[next] [prev] [up]