Semilocalizations of the Integers

In the following we need the semilocalizations \Z_{(\pi)} of the ring of integers as base rings for unions of residue classes. Since these rings are not already implemented as domains in the &GAP; library, we had to implement them in this package.

Defining semilocalizations of the integers
the ring \Z_{(\pi)}.
The function also accepts a single prime p instead of the one-element list pi = [ p ] as argument. gap> R := Z_pi(2); Z_( 2 ) gap> S := Z_pi([2,5,7]); Z_( 2, 5, 7 ) gap> T := Z_pi([3,11]); Z_( 3, 11 )
Indicates whether R is a ring \Z_{(\pi)} for some set of primes \pi.
The noninvertible primes pi in the semilocalization R of the integers.
Methods for semilocalizations of the integers
Checks whether x is an element of the semilocalization R of the integers. gap> 4/7 in R; true gap> 3/2 in R; false gap> 17/35 in S; false gap> 3/17 in S; true
the intersection of the semilocalizations R and S of the integers.
gap> U := Intersection(R,S,T); Z_( 2, 3, 5, 7, 11 )
Checks whether S is a subring of R, where R and S are semilocalizations of the integers. gap> IsSubset(R,U); true gap> IsSubset(T,R); false
the standard associate of x in the semilocalization R of the integers.
We define the standard associate of an element of \Z_{(\pi)} by the product of the non-invertible prime factors of its numerator. gap> StandardAssociate(R,-6/7); 2 gap> StandardAssociate(R,36/5); 4 gap> StandardAssociate(U,37/13); 1 gap> StandardAssociate(U,36/13); 36
the greatest common divisor of x and y in the semilocalization R of the integers.
gap> GcdOp(S,-10/3,8/13); 2 gap> Gcd(S,90/3,60/17,120/33); 10
the least common multiple of x and y in the semilocalization R of the integers.
gap> LcmOp(S,-10/3,8/13); 40 gap> Lcm(S,90/3,60/17,120/33); 40
a prime factorization of x in the semilocalization R of the integers.
gap> Factors(U,840); [ 2, 2, 2, 3, 5, 7 ] gap> Factors(R,840); [ 105, 2, 2, 2 ] gap> Factors(R,-2/3); [ -1/3, 2 ] gap> Factors(S,60/17); [ 3/17, 2, 2, 5 ]
Checks whether x is a unit in the semilocalization R of the integers. The method returns fail if x is not an element of R. gap> IsUnit(S,3/11); true gap> IsUnit(T,-2); true gap> IsUnit(T,0); false gap> IsUnit(T,3); false gap> IsUnit(T,3/11); fail