Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 Bib Ind

56 Rings

56.2 Ideals of Rings

56.2-1 TwoSidedIdeal

56.2-2 TwoSidedIdealNC

56.2-3 IsTwoSidedIdeal

56.2-4 TwoSidedIdealByGenerators

56.2-5 LeftIdealByGenerators

56.2-6 RightIdealByGenerators

56.2-7 GeneratorsOfTwoSidedIdeal

56.2-8 GeneratorsOfLeftIdeal

56.2-9 GeneratorsOfRightIdeal

56.2-10 LeftActingRingOfIdeal

56.2-11 AsLeftIdeal

56.2-1 TwoSidedIdeal

56.2-2 TwoSidedIdealNC

56.2-3 IsTwoSidedIdeal

56.2-4 TwoSidedIdealByGenerators

56.2-5 LeftIdealByGenerators

56.2-6 RightIdealByGenerators

56.2-7 GeneratorsOfTwoSidedIdeal

56.2-8 GeneratorsOfLeftIdeal

56.2-9 GeneratorsOfRightIdeal

56.2-10 LeftActingRingOfIdeal

56.2-11 AsLeftIdeal

This chapter deals with domains that are additive groups (see `IsAdditiveGroup`

(55.1-6) closed under multiplication `*`

. Such a domain, if `*`

and `+`

are distributive, is called a *ring* in **GAP**. Each division ring, field (see 58), or algebra (see 62) is a ring. Important examples of rings are the integers (see 14) and matrix rings.

In the case of a *ring-with-one*, additional multiplicative structure is present, see `IsRingWithOne`

(56.3-1). There is a little support in **GAP** for rings that have no additional structure: it is possible to perform some computations for small finite rings; infinite rings are handled by **GAP** in an acceptable way in the case that they are algebras.

Also, the **SONATA** package provides support for near-rings, and a related functionality for multiplicative semigroups of near-rings is available in the **Smallsemi** package.

Several functions for ring elements, such as `IsPrime`

(56.5-8) and `Factors`

(56.5-9), are defined only relative to a ring `R`, which can be entered as an optional argument; if `R` is omitted then a *default ring* is formed from the ring elements given as arguments, see `DefaultRing`

(56.1-3).

`‣ IsRing` ( R ) | ( filter ) |

A *ring* in **GAP** is an additive group (see `IsAdditiveGroup`

(55.1-6)) that is also a magma (see `IsMagma`

(35.1-1)), such that addition `+`

and multiplication `*`

are distributive, see `IsDistributive`

(56.4-5).

The multiplication need *not* be associative (see `IsAssociative`

(35.4-7)). For example, a Lie algebra (see 64) is regarded as a ring in **GAP**.

`‣ Ring` ( r, s, ... ) | ( function ) |

`‣ Ring` ( coll ) | ( function ) |

In the first form `Ring`

returns the smallest ring that contains all the elements `r`, `s`, ... 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`

(56.1-3) in that it returns the smallest ring in which the elements lie, while `DefaultRing`

(56.1-3) may return a larger ring if that makes sense.

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

`‣ DefaultRing` ( r, s, ... ) | ( function ) |

`‣ DefaultRing` ( coll ) | ( function ) |

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 ring functions such as `Quotient`

(56.1-9), `IsPrime`

(56.5-8), `Factors`

(56.5-9), or `Gcd`

(56.7-1) if no explicit ring is given.

`Ring`

(56.1-2) 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 ) | ( operation ) |

`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 ) | ( operation ) |

For a collection `coll`, returns a default ring in which `coll` is contained.

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

`‣ GeneratorsOfRing` ( R ) | ( attribute ) |

`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 ]

`‣ Subring` ( R, gens ) | ( function ) |

`‣ SubringNC` ( R, gens ) | ( function ) |

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, [ 4, 6 ] ); <ring with 1 generators> gap> Parent( S ); Integers

`‣ ClosureRing` ( R, r ) | ( operation ) |

`‣ ClosureRing` ( R, S ) | ( operation ) |

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 ) | ( operation ) |

`Quotient`

returns the quotient of the two ring elements `r` and `s` in the ring `R`, if given, and otherwise in their default ring (see `DefaultRing`

(56.1-3)). 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

A *left ideal* in a ring R is a subring of R that is closed under multiplication with elements of R from the left.

A *right ideal* in a ring R is a subring of R that is closed under multiplication with elements of R from the right.

A *two-sided ideal* or simply *ideal* in a ring R is both a left ideal and a right ideal in R.

So being a (left/right/two-sided) ideal is not a property of a domain but refers to the acting ring(s). Hence we must ask, e. g., `IsIdeal( `

R, I` )`

if we want to know whether the ring I is an ideal in the ring R. The property `IsTwoSidedIdealInParent`

(56.2-3) can be used to store whether a ring is an ideal in its parent.

(Whenever the term `"Ideal"`

occurs in an identifier without a specifying prefix `"Left"`

or `"Right"`

, this means the same as `"TwoSidedIdeal"`

. Conversely, any occurrence of `"TwoSidedIdeal"`

can be substituted by `"Ideal"`

.)

For any of the above kinds of ideals, there is a notion of generators, namely `GeneratorsOfLeftIdeal`

(56.2-8), `GeneratorsOfRightIdeal`

(56.2-9), and `GeneratorsOfTwoSidedIdeal`

(56.2-7). The acting rings can be accessed as `LeftActingRingOfIdeal`

(56.2-10) and `RightActingRingOfIdeal`

(56.2-10), respectively. Note that ideals are detected from known values of these attributes, especially it is assumed that whenever a domain has both a left and a right acting ring then these two are equal.

Note that we cannot use `LeftActingDomain`

(57.1-11) and `RightActingDomain`

here, since ideals in algebras are themselves vector spaces, and such a space can of course also be a module for an action from the right. In order to make the usual vector space functionality automatically available for ideals, we have to distinguish the left and right module structure from the additional closure properties of the ideal.

Further note that the attributes denoting ideal generators and acting ring are used to create ideals if this is explicitly wanted, but the ideal relation in the sense of `IsTwoSidedIdeal`

(56.2-3) is of course independent of the presence of the attribute values.

Ideals are constructed with `LeftIdeal`

(56.2-1), `RightIdeal`

(56.2-1), `TwoSidedIdeal`

(56.2-1). Principal ideals of the form x * R, R * x, R * x * R can also be constructed with a simple multiplication.

Currently many methods for dealing with ideals need linear algebra to work, so they are mainly applicable to ideals in algebras.

`‣ TwoSidedIdeal` ( R, gens[, "basis"] ) | ( function ) |

`‣ Ideal` ( R, gens[, "basis"] ) | ( function ) |

`‣ LeftIdeal` ( R, gens[, "basis"] ) | ( function ) |

`‣ RightIdeal` ( R, gens[, "basis"] ) | ( function ) |

Let `R` be a ring, and `gens` a list of collection of elements in `R`. `TwoSidedIdeal`

, `LeftIdeal`

, and `RightIdeal`

return the two-sided, left, or right ideal, respectively, I in `R` that is generated by `gens`. The ring `R` can be accessed as `LeftActingRingOfIdeal`

(56.2-10) or `RightActingRingOfIdeal`

(56.2-10) (or both) of I.

If `R` is a left F-module then also I is a left F-module, in particular the `LeftActingDomain`

(57.1-11) values of `R` and I are equal.

If the optional argument `"basis"`

is given then `gens` are assumed to be a list of basis vectors of I viewed as a free F-module. (This is mainly applicable to ideals in algebras.) In this case, it is *not* checked whether `gens` really is linearly independent and whether `gens` is a subset of `R`.

`Ideal`

is simply a synonym of `TwoSidedIdeal`

.

gap> R:= Integers;; gap> I:= Ideal( R, [ 2 ] ); <two-sided ideal in Integers, (1 generators)>

`‣ TwoSidedIdealNC` ( R, gens[, "basis"] ) | ( function ) |

`‣ IdealNC` ( R, gens[, "basis"] ) | ( function ) |

`‣ LeftIdealNC` ( R, gens[, "basis"] ) | ( function ) |

`‣ RightIdealNC` ( R, gens[, "basis"] ) | ( function ) |

The effects of `TwoSidedIdealNC`

, `LeftIdealNC`

, and `RightIdealNC`

are the same as `TwoSidedIdeal`

(56.2-1), `LeftIdeal`

(56.2-1), and `RightIdeal`

(56.2-1), respectively, but they do not check whether all entries of `gens` lie in `R`.

`‣ IsTwoSidedIdeal` ( R, I ) | ( operation ) |

`‣ IsLeftIdeal` ( R, I ) | ( operation ) |

`‣ IsRightIdeal` ( R, I ) | ( operation ) |

`‣ IsTwoSidedIdealInParent` ( I ) | ( property ) |

`‣ IsLeftIdealInParent` ( I ) | ( property ) |

`‣ IsRightIdealInParent` ( I ) | ( property ) |

The properties `IsTwoSidedIdealInParent`

etc., are attributes of the ideal, and once known they are stored in the ideal.

gap> A:= FullMatrixAlgebra( Rationals, 3 ); ( Rationals^[ 3, 3 ] ) gap> I:= Ideal( A, [ Random( A ) ] ); <two-sided ideal in ( Rationals^[ 3, 3 ] ), (1 generators)> gap> IsTwoSidedIdeal( A, I ); true

`‣ TwoSidedIdealByGenerators` ( R, gens ) | ( operation ) |

`‣ IdealByGenerators` ( R, gens ) | ( operation ) |

`TwoSidedIdealByGenerators`

returns the ring that is generated by the elements of the collection `gens` under addition, multiplication, and multiplication with elements of the ring `R` from the left and from the right.

`R` can be accessed by `LeftActingRingOfIdeal`

(56.2-10) or `RightActingRingOfIdeal`

(56.2-10), `gens` can be accessed by `GeneratorsOfTwoSidedIdeal`

(56.2-7).

`‣ LeftIdealByGenerators` ( R, gens ) | ( operation ) |

`LeftIdealByGenerators`

returns the ring that is generated by the elements of the collection `gens` under addition, multiplication, and multiplication with elements of the ring `R` from the left.

`R` can be accessed by `LeftActingRingOfIdeal`

(56.2-10), `gens` can be accessed by `GeneratorsOfLeftIdeal`

(56.2-8).

`‣ RightIdealByGenerators` ( R, gens ) | ( operation ) |

`RightIdealByGenerators`

returns the ring that is generated by the elements of the collection `gens` under addition, multiplication, and multiplication with elements of the ring `R` from the right.

`R` can be accessed by `RightActingRingOfIdeal`

(56.2-10), `gens` can be accessed by `GeneratorsOfRightIdeal`

(56.2-9).

`‣ GeneratorsOfTwoSidedIdeal` ( I ) | ( attribute ) |

`‣ GeneratorsOfIdeal` ( I ) | ( attribute ) |

is a list of generators for the ideal `I`, with respect to the action of the rings that are stored as the values of `LeftActingRingOfIdeal`

(56.2-10) and `RightActingRingOfIdeal`

(56.2-10), from the left and from the right, respectively.

gap> A:= FullMatrixAlgebra( Rationals, 3 );; gap> I:= Ideal( A, [ One( A ) ] );; gap> GeneratorsOfIdeal( I ); [ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] ]

`‣ GeneratorsOfLeftIdeal` ( I ) | ( attribute ) |

is a list of generators for the left ideal `I`, with respect to the action from the left of the ring that is stored as the value of `LeftActingRingOfIdeal`

(56.2-10).

`‣ GeneratorsOfRightIdeal` ( I ) | ( attribute ) |

is a list of generators for the right ideal `I`, with respect to the action from the right of the ring that is stored as the value of `RightActingRingOfIdeal`

(56.2-10).

`‣ LeftActingRingOfIdeal` ( I ) | ( attribute ) |

`‣ RightActingRingOfIdeal` ( I ) | ( attribute ) |

returns the left (resp. right) acting ring of an ideal `I`.

`‣ AsLeftIdeal` ( R, S ) | ( operation ) |

`‣ AsRightIdeal` ( R, S ) | ( operation ) |

`‣ AsTwoSidedIdeal` ( R, S ) | ( operation ) |

Let `S` be a subring of the ring `R`.

If `S` is a left ideal in `R` then `AsLeftIdeal`

returns this left ideal, otherwise `fail`

is returned.

If `S` is a right ideal in `R` then `AsRightIdeal`

returns this right ideal, otherwise `fail`

is returned.

If `S` is a two-sided ideal in `R` then `AsTwoSidedIdeal`

returns this two-sided ideal, otherwise `fail`

is returned.

gap> A:= FullMatrixAlgebra( Rationals, 3 );; gap> B:= DirectSumOfAlgebras( A, A ); <algebra over Rationals, with 6 generators> gap> C:= Subalgebra( B, Basis( B ){[1..9]} ); <algebra over Rationals, with 9 generators> gap> I:= AsTwoSidedIdeal( B, C ); <two-sided ideal in <algebra of dimension 18 over Rationals>, (9 generators)>

`‣ IsRingWithOne` ( R ) | ( filter ) |

A *ring-with-one* in **GAP** is a ring (see `IsRing`

(56.1-1)) that is also a magma-with-one (see `IsMagmaWithOne`

(35.1-2)).

Note that the identity and the zero of a ring-with-one need *not* be distinct. This means that a ring that consists only of its zero element can be regarded as a ring-with-one.

This is especially useful in the case of finitely presented rings, in the sense that each factor of a ring-with-one is again a ring-with-one.

`‣ RingWithOne` ( r, s, ... ) | ( function ) |

`‣ RingWithOne` ( coll ) | ( function ) |

In the first form `RingWithOne`

returns the smallest ring with one that contains all the elements `r`, `s`, ... In the second form `RingWithOne`

returns the smallest ring with one that contains all the elements in the collection `C`. If any element is not an element of a ring or if the elements lie in no common ring an error is raised.

gap> RingWithOne( [ 4, 6 ] ); Integers

`‣ RingWithOneByGenerators` ( coll ) | ( operation ) |

`RingWithOneByGenerators`

returns the ring-with-one generated by the elements in the collection `coll`, i. e., the closure of `coll` under addition, multiplication, taking additive inverses, and taking the identity of an element.

`‣ GeneratorsOfRingWithOne` ( R ) | ( attribute ) |

`GeneratorsOfRingWithOne`

returns a list of elements such that the ring `R` is the closure of these elements under addition, multiplication, taking additive inverses, and taking the identity element `One( `

.`R` )

`R` itself need *not* be known to be a ring-with-one.

gap> R:= RingWithOne( [ 4, 6 ] ); Integers gap> GeneratorsOfRingWithOne( R ); [ 1 ]

`‣ SubringWithOne` ( R, gens ) | ( function ) |

`‣ SubringWithOneNC` ( R, gens ) | ( function ) |

returns the ring with one with parent `R` generated by the elements in `gens`. When the second form, `SubringWithOneNC`

is used, it is *not* checked whether all elements in `gens` lie in `R`.

gap> R:= SubringWithOne( Integers, [ 4, 6 ] ); Integers gap> Parent( R ); Integers

`‣ IsIntegralRing` ( R ) | ( property ) |

A ring-with-one `R` is integral if it is commutative, contains no nontrivial zero divisors, and if its identity is distinct from its zero.

gap> IsIntegralRing( Integers ); true

`‣ IsUniqueFactorizationRing` ( R ) | ( category ) |

A ring `R` is called a *unique factorization ring* if it is an integral ring (see `IsIntegralRing`

(56.4-1)), and every nonzero element has a unique factorization into irreducible elements, i.e., a unique representation as product of irreducibles (see `IsIrreducibleRingElement`

(56.5-7)). Unique in this context means unique up to permutations of the factors and up to multiplication of the factors by units (see `Units`

(56.5-2)).

Mathematically, a field should therefore also be a unique factorization ring, since every nonzero element is a unit. In **GAP**, however, at least at present fields do not lie in the filter `IsUniqueFactorizationRing`

, since operations such as `Factors`

(56.5-9), `Gcd`

(56.7-1), `StandardAssociate`

(56.5-5) and so on do not apply to fields (the results would be trivial, and not especially useful) and methods which require their arguments to lie in `IsUniqueFactorizationRing`

expect these operations to work.

(Note that we cannot install a subset maintained method for this filter since the factorization of an element needs not exist in a subring. As an example, consider the subring 4 ℕ + 1 of the ring 4 ℤ + 1; in the subring, the element 3 ⋅ 3 ⋅ 11 ⋅ 7 has the two factorizations 33 ⋅ 21 = 9 ⋅ 77, but in the large ring there is the unique factorization (-3) ⋅ (-3) ⋅ (-11) ⋅ (-7), and it is easy to see that every element in 4 ℤ + 1 has a unique factorization.)

gap> IsUniqueFactorizationRing( PolynomialRing( Rationals, 1 ) ); true

`‣ IsLDistributive` ( C ) | ( property ) |

is `true`

if the relation a * ( b + c ) = ( a * b ) + ( a * c ) holds for all elements a, b, c in the collection `C`, and `false`

otherwise.

`‣ IsRDistributive` ( C ) | ( property ) |

is `true`

if the relation ( a + b ) * c = ( a * c ) + ( b * c ) holds for all elements a, b, c in the collection `C`, and `false`

otherwise.

`‣ IsDistributive` ( C ) | ( property ) |

is `true`

if the collection `C` is both left and right distributive (see `IsLDistributive`

(56.4-3), `IsRDistributive`

(56.4-4)), and `false`

otherwise.

gap> IsDistributive( Integers ); true

`‣ IsAnticommutative` ( R ) | ( property ) |

is `true`

if the relation a * b = - b * a holds for all elements a, b in the ring `R`, and `false`

otherwise.

`‣ IsZeroSquaredRing` ( R ) | ( property ) |

is `true`

if a * a is the zero element of the ring `R` for all a in `R`, and `false`

otherwise.

`‣ IsJacobianRing` ( R ) | ( property ) |

is `true`

if the Jacobi identity holds in the ring `R`, and `false`

otherwise. The Jacobi identity means that x * (y * z) + z * (x * y) + y * (z * x) is the zero element of `R`, for all elements x, y, z in `R`.

gap> L:= FullMatrixLieAlgebra( GF( 5 ), 7 ); <Lie algebra over GF(5), with 13 generators> gap> IsJacobianRing( L ); true

`‣ IsUnit` ( [R, ]r ) | ( operation ) |

`IsUnit`

returns `true`

if `r` is a unit in the ring `R`, if given, and otherwise in its default ring (see `DefaultRing`

(56.1-3)). If `r` is not a unit then `false`

is returned.

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

`IsUnit`

may call `Quotient`

(56.1-9).

`‣ Units` ( R ) | ( attribute ) |

`Units`

returns the group of units of the ring `R`. This may either be returned as a list or as a group.

An element r is called a *unit* of a ring R if r has an inverse in R. It is easy to see that the set of units forms a multiplicative group.

gap> Units( GaussianIntegers ); [ -1, 1, -E(4), E(4) ] gap> Units( GF( 16 ) ); <group with 1 generators>

`‣ IsAssociated` ( [R, ]r, s ) | ( operation ) |

`IsAssociated`

returns `true`

if the two ring elements `r` and `s` are associated in the ring `R`, if given, and otherwise in their default ring (see `DefaultRing`

(56.1-3)). If the two elements are not associated then `false`

is returned.

Two elements `r` and `s` of a ring `R` are called *associated* if there is a unit u of `R` such that `r` u =`s`.

`‣ Associates` ( [R, ]r ) | ( operation ) |

`Associates`

returns the set of associates of `r` in the ring `R`, if given, and otherwise in its default ring (see `DefaultRing`

(56.1-3)).

Two elements `r` and s of a ring R are called *associated* if there is a unit u of R such that `r` u = s.

gap> Associates( Integers, 2 ); [ -2, 2 ] gap> Associates( GaussianIntegers, 2 ); [ -2, 2, -2*E(4), 2*E(4) ]

`‣ StandardAssociate` ( [R, ]r ) | ( operation ) |

`StandardAssociate`

returns the standard associate of the ring element `r` in the ring `R`, if given, and otherwise in its default ring (see `DefaultRing`

(56.1-3)).

The *standard associate* of a ring element `r` of `R` is an associated element of `r` which is, in a ring dependent way, distinguished among the set of associates of `r`. For example, in the ring of integers the standard associate is the absolute value.

gap> x:= Indeterminate( Rationals, "x" );; gap> StandardAssociate( -x^2-x+1 ); x^2+x-1

`‣ StandardAssociateUnit` ( [R, ]r ) | ( operation ) |

`StandardAssociateUnit`

returns a unit in the ring `R` such that the ring element `r` times this unit equals the standard associate of `r` in `R`.

If `R` is not given, the default ring of `r` is used instead. (see `DefaultRing`

(56.1-3)).

gap> y:= Indeterminate( Rationals, "y" );; gap> r:= -y^2-y+1; -y^2-y+1 gap> StandardAssociateUnit( r ); -1 gap> StandardAssociateUnit( r ) * r = StandardAssociate( r ); true

`‣ IsIrreducibleRingElement` ( [R, ]r ) | ( operation ) |

`IsIrreducibleRingElement`

returns `true`

if the ring element `r` is irreducible in the ring `R`, if given, and otherwise in its default ring (see `DefaultRing`

(56.1-3)). If `r` is not irreducible then `false`

is returned.

An element `r` of a ring `R` is called *irreducible* if `r` is not a unit in `R` and if there is no nontrivial factorization of `r` in `R`, i.e., if there is no representation of `r` as product s t such that neither s nor t is a unit (see `IsUnit`

(56.5-1)). Each prime element (see `IsPrime`

(56.5-8)) is irreducible.

gap> IsIrreducibleRingElement( Integers, 2 ); true

`‣ IsPrime` ( [R, ]r ) | ( operation ) |

`IsPrime`

returns `true`

if the ring element `r` is a prime in the ring `R`, if given, and otherwise in its default ring (see `DefaultRing`

(56.1-3)). If `r` is not a prime then `false`

is returned.

An element `r` of a ring `R` is called *prime* if for each pair s and t such that `r` divides s t the element `r` divides either s or t. Note that there are rings where not every irreducible element (see `IsIrreducibleRingElement`

(56.5-7)) is a prime.

`‣ Factors` ( [R, ]r ) | ( operation ) |

`Factors`

returns the factorization of the ring element `r` in the ring `R`, if given, and otherwise in in its default ring (see `DefaultRing`

(56.1-3)). The factorization is returned as a list of primes (see `IsPrime`

(56.5-8)). Each element in the list is a standard associate (see `StandardAssociate`

(56.5-5)) except the first one, which is multiplied by a unit as necessary to have `Product( Factors( `

. This list is usually also sorted, thus smallest prime factors come first. If `R`, `r` ) ) = `r``r` is a unit or zero, `Factors( `

.`R`, `r` ) = [ `r` ]

gap> x:= Indeterminate( GF(2), "x" );; gap> pol:= x^2+x+1; x^2+x+Z(2)^0 gap> Factors( pol ); [ x^2+x+Z(2)^0 ] gap> Factors( PolynomialRing( GF(4) ), pol ); [ x+Z(2^2), x+Z(2^2)^2 ]

`‣ PadicValuation` ( r, p ) | ( operation ) |

`PadicValuation`

is the operation to compute the `p`-adic valuation of a ring element `r`.

`‣ IsEuclideanRing` ( R ) | ( category ) |

A ring R is called a Euclidean ring if it is an integral ring and there exists a function δ, called the Euclidean degree, from R-{0_R} to the nonnegative integers, such that for every pair r ∈ R and s ∈ R-{0_R} there exists an element q such that either r - q s = 0_R or δ(r - q s) < δ( s ). In **GAP** the Euclidean degree δ is implicitly built into a ring and cannot be changed. The existence of this division with remainder implies that the Euclidean algorithm can be applied to compute a greatest common divisor of two elements, which in turn implies that R is a unique factorization ring.

gap> IsEuclideanRing( GaussianIntegers ); true

`‣ EuclideanDegree` ( [R, ]r ) | ( operation ) |

`EuclideanDegree`

returns the Euclidean degree of the ring element `r` in the ring `R`, if given, and otherwise in its default ring (see `DefaultRing`

(56.1-3)).

The ring `R` must be a Euclidean ring (see `IsEuclideanRing`

(56.6-1)).

gap> EuclideanDegree( GaussianIntegers, 3 ); 9

`‣ EuclideanQuotient` ( [R, ]r, m ) | ( operation ) |

`EuclideanQuotient`

returns the Euclidean quotient of the ring elements `r` and `m` in the ring `R`, if given, and otherwise in their default ring (see `DefaultRing`

(56.1-3)).

The ring `R` must be a Euclidean ring (see `IsEuclideanRing`

(56.6-1)), otherwise an error is signalled.

gap> EuclideanQuotient( 8, 3 ); 2

`‣ EuclideanRemainder` ( [R, ]r, m ) | ( operation ) |

`EuclideanRemainder`

returns the Euclidean remainder of the ring element `r` modulo the ring element `m` in the ring `R`, if given, and otherwise in their default ring (see `DefaultRing`

(56.1-3)).

The ring `R` must be a Euclidean ring (see `IsEuclideanRing`

(56.6-1)), otherwise an error is signalled.

gap> EuclideanRemainder( 8, 3 ); 2

`‣ QuotientRemainder` ( [R, ]r, m ) | ( operation ) |

`QuotientRemainder`

returns the Euclidean quotient and the Euclidean remainder of the ring elements `r` and `m` in the ring `R`, if given, and otherwise in their default ring (see `DefaultRing`

(56.1-3)). The result is a pair of ring elements.

The ring `R` must be a Euclidean ring (see `IsEuclideanRing`

(56.6-1)), otherwise an error is signalled.

gap> QuotientRemainder( GaussianIntegers, 8, 3 ); [ 3, -1 ]

`‣ Gcd` ( [R, ]r1, r2, ... ) | ( function ) |

`‣ Gcd` ( [R, ]list ) | ( function ) |

`Gcd`

returns the greatest common divisor of the ring elements `r1`, `r2`, ... resp. of the ring elements in the list `list` in the ring `R`, if given, and otherwise in their default ring, see `DefaultRing`

(56.1-3).

`Gcd`

returns the standard associate (see `StandardAssociate`

(56.5-5)) of the greatest common divisors.

A divisor of an element r in the ring R is an element d∈ R such that r is a multiple of d. A common divisor of the elements r_1, r_2, ... in the ring R is an element d∈ R which is a divisor of each r_1, r_2, .... A greatest common divisor d in addition has the property that every other common divisor of r_1, r_2, ... is a divisor of d.

Note that this in particular implies the following: For the zero element z of `R`, we have `Gcd( `

z`r`, ` ) = Gcd( `

z`, `

and `r` ) = StandardAssociate( `r` )`Gcd( `

z`, `

z` ) = `

z.

gap> Gcd( Integers, [ 10, 15 ] ); 5

`‣ GcdOp` ( [R, ]r, s ) | ( operation ) |

`GcdOp`

is the operation to compute the greatest common divisor of two ring elements `r`, `s` in the ring `R` or in their default ring.

`‣ GcdRepresentation` ( [R, ]r1, r2, ... ) | ( function ) |

`‣ GcdRepresentation` ( [R, ]list ) | ( function ) |

`GcdRepresentation`

returns a representation of the greatest common divisor of the ring elements `r1`, `r2`, ... resp. of the ring elements in the list `list` in the Euclidean ring `R`, if given, and otherwise in their default ring, see `DefaultRing`

(56.1-3).

A representation of the gcd g of the elements r_1, r_2, ... of a ring R is a list of ring elements s_1, s_2, ... of R, such that g = s_1 r_1 + s_2 r_2 + ⋯. Such representations do not exist in all rings, but they do exist in Euclidean rings (see `IsEuclideanRing`

(56.6-1)), which can be shown using the Euclidean algorithm, which in fact can compute those coefficients.

gap> a:= Indeterminate( Rationals, "a" );; gap> GcdRepresentation( a^2+1, a^3+1 ); [ -1/2*a^2-1/2*a+1/2, 1/2*a+1/2 ]

`Gcdex`

(14.3-5) provides similar functionality over the integers.

`‣ GcdRepresentationOp` ( [R, ]r, s ) | ( operation ) |

`GcdRepresentationOp`

is the operation to compute the representation of the greatest common divisor of two ring elements `r`, `s` in the Euclidean ring `R` or in their default ring, respectively.

`‣ ShowGcd` ( a, b ) | ( function ) |

This function takes two elements `a` and `b` of an Euclidean ring and returns their greatest common divisor. It will print out the steps performed by the Euclidean algorithm, as well as the rearrangement of these steps to express the gcd as a ring combination of `a` and `b`.

gap> ShowGcd(192,42); 192=4*42 + 24 42=1*24 + 18 24=1*18 + 6 18=3*6 + 0 The Gcd is 6 = 1*24 -1*18 = -1*42 + 2*24 = 2*192 -9*42 6

`‣ Lcm` ( [R, ]r1, r2, ... ) | ( function ) |

`‣ Lcm` ( [R, ]list ) | ( function ) |

`Lcm`

returns the least common multiple of the ring elements `r1`, `r2`, ... resp. of the ring elements in the list `list` in the ring `R`, if given, and otherwise in their default ring, see `DefaultRing`

(56.1-3).

`Lcm`

returns the standard associate (see `StandardAssociate`

(56.5-5)) of the least common multiples.

A least common multiple of the elements r_1, r_2, ... of the ring R is an element m that is a multiple of r_1, r_2, ..., and every other multiple of these elements is a multiple of m.

Note that this in particular implies the following: For the zero element z of `R`, we have `Lcm( `

z`r`, ` ) = Lcm( `

z`, `

and `r` ) = StandardAssociate( `r` )`Lcm( `

z`, `

z` ) = `

z.

`‣ LcmOp` ( [R, ]r, s ) | ( operation ) |

`LcmOp`

is the operation to compute the least common multiple of two ring elements `r`, `s` in the ring `R` or in their default ring, respectively.

The default methods for this uses the equality lcm( m, n ) = m*n / gcd( m, n ) (see `GcdOp`

(56.7-2)).

`‣ QuotientMod` ( [R, ]r, s, m ) | ( operation ) |

`QuotientMod`

returns the quotient of the ring elements `r` and `s` modulo the ring element `m` in the ring `R`, if given, and otherwise in their default ring, see `DefaultRing`

(56.1-3).

`R` must be a Euclidean ring (see `IsEuclideanRing`

(56.6-1)) so that `EuclideanRemainder`

(56.6-4) can be applied. If the modular quotient does not exist (i.e. when `s` and `m` are not coprime), `fail`

is returned.

The quotient q of `r` and `s` modulo `m` is an element of `R` such that q `s` = `r` modulo m, i.e., such that q `s` - `r` is divisible by `m` in `R` and that q is either zero (if `r` is divisible by `m`) or the Euclidean degree of q is strictly smaller than the Euclidean degree of `m`.

gap> QuotientMod( 7, 2, 3 ); 2

`‣ PowerMod` ( [R, ]r, e, m ) | ( operation ) |

`PowerMod`

returns the `e`-th power of the ring element `r` modulo the ring element `m` in the ring `R`, if given, and otherwise in their default ring, see `DefaultRing`

(56.1-3). `e` must be an integer.

`R` must be a Euclidean ring (see `IsEuclideanRing`

(56.6-1)) so that `EuclideanRemainder`

(56.6-4) can be applied to its elements.

If `e` is positive the result is `r``^`

`e` modulo `m`. If `e` is negative then `PowerMod`

first tries to find the inverse of `r` modulo `m`, i.e., i such that i `r` = 1 modulo `m`. If the inverse does not exist an error is signalled. If the inverse does exist `PowerMod`

returns `PowerMod( `

.`R`, `i`, -`e`, `m` )

`PowerMod`

reduces the intermediate values modulo `m`, improving performance drastically when `e` is large and `m` small.

gap> PowerMod( 12, 100000, 7 ); 2

`‣ InterpolatedPolynomial` ( R, x, y ) | ( operation ) |

`InterpolatedPolynomial`

returns, for given lists `x`, `y` of elements in a ring `R` of the same length n, say, the unique polynomial of degree less than n which has value `y`[i] at `x`[i], for all i ∈ { 1, ..., n }. Note that the elements in `x` must be distinct.

gap> InterpolatedPolynomial( Integers, [ 1, 2, 3 ], [ 5, 7, 0 ] ); -9/2*x^2+31/2*x-6

A *ring homomorphism* is a mapping between two rings that respects addition and multiplication.

Currently **GAP** supports ring homomorphisms between finite rings (using straightforward methods) and ring homomorphisms with additional structures, where source and range are in fact algebras and where also the linear structure is respected, see 62.10.

`‣ RingGeneralMappingByImages` ( R, S, gens, imgs ) | ( operation ) |

is a general mapping from the ring `A` to the ring `S`. This general mapping is defined by mapping the entries in the list `gens` (elements of `R`) to the entries in the list `imgs` (elements of `S`), and taking the additive and multiplicative closure.

`gens` need not generate `R` as a ring, and if the specification does not define an additive and multiplicative mapping then the result will be multivalued. Hence, in general it is not a mapping.

`‣ RingHomomorphismByImages` ( R, S, gens, imgs ) | ( function ) |

`RingHomomorphismByImages`

returns the ring homomorphism with source `R` and range `S` that is defined by mapping the list `gens` of generators of `R` to the list `imgs` of images in `S`.

If `gens` does not generate `R` or if the homomorphism does not exist (i.e., if mapping the generators describes only a multi-valued mapping) then `fail`

is returned.

One can avoid the checks by calling `RingHomomorphismByImagesNC`

(56.8-3), and one can construct multi-valued mappings with `RingGeneralMappingByImages`

(56.8-1).

`‣ RingHomomorphismByImagesNC` ( R, S, gens, imgs ) | ( operation ) |

`RingHomomorphismByImagesNC`

is the operation that is called by the function `RingHomomorphismByImages`

(56.8-2). Its methods may assume that `gens` generates `R` as a ring and that the mapping of `gens` to `imgs` defines a ring homomorphism. Results are unpredictable if these conditions do not hold.

For creating a possibly multi-valued mapping from `R` to `S` that respects addition and multiplication, `RingGeneralMappingByImages`

(56.8-1) can be used.

`‣ NaturalHomomorphismByIdeal` ( R, I ) | ( operation ) |

is the homomorphism of rings provided by the natural projection map of `R` onto the quotient ring `R`/`I`. This map can be used to take pre-images in the original ring from elements in the quotient.

**GAP** contains a library of small (order up to 15) rings.

`‣ SmallRing` ( s, n ) | ( function ) |

returns the n-th ring of order s from a library of rings of small order (up to isomorphism).

gap> R:=SmallRing(8,37); <ring with 3 generators> gap> ShowMultiplicationTable(R); * | 0*a c b b+c a a+c a+b a+b+c ------+------------------------------------------------ 0*a | 0*a 0*a 0*a 0*a 0*a 0*a 0*a 0*a c | 0*a 0*a 0*a 0*a 0*a 0*a 0*a 0*a b | 0*a 0*a 0*a 0*a b b b b b+c | 0*a 0*a 0*a 0*a b b b b a | 0*a c b b+c a+b a+b+c a a+c a+c | 0*a c b b+c a+b a+b+c a a+c a+b | 0*a c b b+c a a+c a+b a+b+c a+b+c | 0*a c b b+c a a+c a+b a+b+c

`‣ NumberSmallRings` ( s ) | ( function ) |

returns the number of (nonisomorphic) rings of order s stored in the library of small rings.

gap> List([1..15],NumberSmallRings); [ 1, 2, 2, 11, 2, 4, 2, 52, 11, 4, 2, 22, 2, 4, 4 ]

`‣ Subrings` ( R ) | ( attribute ) |

for a finite ring `R` this function returns a list of all subrings of `R`.

gap> Subrings(SmallRing(8,37)); [ <ring with 1 generators>, <ring with 1 generators>, <ring with 1 generators>, <ring with 1 generators>, <ring with 1 generators>, <ring with 1 generators>, <ring with 2 generators>, <ring with 2 generators>, <ring with 2 generators>, <ring with 2 generators>, <ring with 3 generators> ]

`‣ Ideals` ( R ) | ( attribute ) |

for a finite ring `R` this function returns a list of all ideals of `R`.

gap> Ideals(SmallRing(8,37)); [ <ring with 1 generators>, <ring with 1 generators>, <ring with 1 generators>, <ring with 2 generators>, <ring with 3 generators> ]

`‣ DirectSum` ( R{, S} ) | ( function ) |

`‣ DirectSumOp` ( list, expl ) | ( operation ) |

These functions construct the direct sum of the rings given as arguments. `DirectSum`

takes an arbitrary positive number of arguments and calls the operation `DirectSumOp`

, which takes exactly two arguments, namely a nonempty list of rings and one of these rings. (This somewhat strange syntax allows the method selection to choose a reasonable method for special cases.)

gap> DirectSum(SmallRing(5,1),SmallRing(5,1)); <ring with 2 generators>

`‣ RingByStructureConstants` ( moduli, sctable[, nameinfo] ) | ( function ) |

returns a ring R whose additive group is described by the list `moduli`, with multiplication defined by the structure constants table `sctable`. The optional argument `nameinfo` can be used to prescribe names for the elements of the canonical generators of R; it can be either a string `name` (then `name``1`

, `name``2`

etc. are chosen) or a list of strings which are then chosen.

Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 Bib Ind

generated by GAPDoc2HTML