53.1 Generating Rings

  • IsRing( R ) P

    A ring in GAP is an additive group (see IsAdditiveGroup) that is also a magma (see IsMagma), such that addition + and multiplication * are distributive.

    The multiplication need not be associative (see IsAssociative). For example, a Lie algebra (see Lie Algebras) is regarded as a ring in GAP.

  • Ring( r, s, ... ) F
  • Ring( coll ) F

    In the first form Ring returns the smallest ring that contains all the elements r, s... etc. In the second form Ring returns the smallest ring that contains all the elements in the collection coll. If any element is not an element of a ring or if the elements lie in no common ring an error is raised.

    Ring differs from DefaultRing (see DefaultRing) in that it returns the smallest ring in which the elements lie, while DefaultRing may return a larger ring if that makes sense.

    gap> Ring( 2, E(4) );
    <ring with 2 generators>
    

  • DefaultRing( r, s, ... ) F
  • DefaultRing( coll ) F

    In the first form DefaultRing returns a ring that contains all the elements r, s, ... etc. In the second form DefaultRing returns a ring that contains all the elements in the collection coll. If any element is not an element of a ring or if the elements lie in no common ring an error is raised.

    The ring returned by DefaultRing need not be the smallest ring in which the elements lie. For example for elements from cyclotomic fields, DefaultRing may return the ring of integers of the smallest cyclotomic field in which the elements lie, which need not be the smallest ring overall, because the elements may in fact lie in a smaller number field which is itself not a cyclotomic field.

    (For the exact definition of the default ring of a certain type of elements, look at the corresponding method installation.)

    DefaultRing is used by the ring functions like Quotient, IsPrime, Factors, or Gcd if no explicit ring is given.

    Ring (see Ring) differs from DefaultRing in that it returns the smallest ring in which the elements lie, while DefaultRing may return a larger ring if that makes sense.

    gap> DefaultRing( 2, E(4) );
    GaussianIntegers
    

  • RingByGenerators( C ) O

    RingByGenerators returns the ring generated by the elements in the collection C, i. e., the closure of C under addition, multiplication, and taking additive inverses.

    gap> RingByGenerators([ 2, E(4) ]); 
    <ring with 2 generators>
    

  • DefaultRingByGenerators( coll ) O

    gap> DefaultRingByGenerators([ 2, E(4) ]);
    GaussianIntegers
    

  • GeneratorsOfRing( R ) A

    GeneratorsOfRing returns a list of elements such that the ring R is the closure of these elements under addition, multiplication, and taking additive inverses.

    gap> R:=Ring( 2, 1/2 );            
    <ring with 2 generators>
    gap> GeneratorsOfRing( R );
    [ 2, 1/2 ]
    

  • AsRing( C ) A

    If the elements in the collection C form a ring then AsRing returns this ring, otherwise fail is returned.

  • Subring( R, gens ) F
  • SubringNC( R, gens ) F

    returns the ring with parent R generated by the elements in gens. When the second form, SubringNC is used, it is not checked whether all elements in gens lie in R.

    gap> R:= Integers;
    Integers
    gap> S:= Subring( R, [ 2, 3 ] );
    <ring with 2 generators>
    gap> Parent( S );
    Integers
    

  • ClosureRing( R, r ) O
  • ClosureRing( R, S ) O

    For a ring R and either an element r of its elements family or a ring S, ClosureRing returns the ring generated by both arguments.

    gap> ClosureRing( Integers, E(4) );
    <ring-with-one, with 2 generators>
    

  • Quotient( R, r, s ) O
  • Quotient( r, s ) O

    In the first form Quotient returns the quotient of the two ring elements r and s in the ring R. In the second form Quotient returns the quotient of the two ring elements r and s in their default ring. It returns fail if the quotient does not exist in the respective ring.

    (To perform the division in the quotient field of a ring, use the quotient operator /.)

    gap> Quotient( 2, 3 );
    fail
    gap> Quotient( 6, 3 );
    2
    

    [Top] [Up] [Next] [Index]

    GAP 4 manual
    February 2000