  
  [1m[4m[31m2. Semilocalizations of the Integers[0m
  
  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 [1mGAP[0m library, we had to implement
  them in this package.
  
  
  [1m[4m[31m2.1 Defining semilocalizations of the integers[0m
  
  [1m[4m[31m2.1-1 Z_pi[0m
  
  [1m[34m> Z_pi( [0m[22m[34mpi[0m[1m[34m ) _______________________________________________________[0mfunction
  [1m[34m> Z_pi( [0m[22m[34mp[0m[1m[34m ) ________________________________________________________[0mfunction
  [1mReturns:[0m  the ring Z_(pi).
  
  The  function  also accepts a single prime [22m[34mp[0m instead of the one-element list
  [22m[32m[22m[34mpi[0m = [ [22m[34mp[0m ][0m as argument.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> R := Z_pi(2);[0m
    [22m[35mZ_( 2 )[0m
    [22m[35mgap> S := Z_pi([2,5,7]);[0m
    [22m[35mZ_( 2, 5, 7 )[0m
    [22m[35mgap> T := Z_pi([3,11]);[0m
    [22m[35mZ_( 3, 11 )[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m2.1-2 IsZ_pi[0m
  
  [1m[34m> IsZ_pi( [0m[22m[34mR[0m[1m[34m ) ______________________________________________________[0mproperty
  
  Indicates whether [22m[34mR[0m is a ring Z_(pi) for some set of primes pi.
  
  [1m[4m[31m2.1-3 NoninvertiblePrimes[0m
  
  [1m[34m> NoninvertiblePrimes( [0m[22m[34mR[0m[1m[34m ) ________________________________________[0mattribute
  
  The noninvertible primes [22m[34mpi[0m in the semilocalization [22m[34mR[0m of the integers.
  
  
  [1m[4m[31m2.2 Methods for semilocalizations of the integers[0m
  
  [1m[4m[31m2.2-1 \in[0m
  
  [1m[34m> \in( [0m[22m[34mx, R[0m[1m[34m ) ________________________________________________________[0mmethod
  
  Checks whether [22m[34mx[0m is an element of the semilocalization [22m[34mR[0m of the integers.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> 4/7 in R;[0m
    [22m[35mtrue[0m
    [22m[35mgap> 3/2 in R;[0m
    [22m[35mfalse[0m
    [22m[35mgap> 17/35 in S;[0m
    [22m[35mfalse[0m
    [22m[35mgap> 3/17 in S;[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m2.2-2 Intersection[0m
  
  [1m[34m> Intersection( [0m[22m[34mR, S[0m[1m[34m ) _______________________________________________[0mmethod
  [1mReturns:[0m  the intersection of the semilocalizations [22m[34mR[0m and [22m[34mS[0m of the integers.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> U := Intersection(R,S,T);[0m
    [22m[35mZ_( 2, 3, 5, 7, 11 )[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m2.2-3 IsSubset[0m
  
  [1m[34m> IsSubset( [0m[22m[34mR, S[0m[1m[34m ) ___________________________________________________[0mmethod
  
  Checks  whether  [22m[34mS[0m is a subring of [22m[34mR[0m, where [22m[34mR[0m and [22m[34mS[0m are semilocalizations of
  the integers.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> IsSubset(R,U);[0m
    [22m[35mtrue[0m
    [22m[35mgap> IsSubset(T,R);[0m
    [22m[35mfalse[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m2.2-4 StandardAssociate[0m
  
  [1m[34m> StandardAssociate( [0m[22m[34mR, x[0m[1m[34m ) __________________________________________[0mmethod
  [1mReturns:[0m  the  standard  associate  of  [22m[34mx[0m  in  the semilocalization [22m[34mR[0m 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.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> StandardAssociate(R,-6/7);[0m
    [22m[35m2[0m
    [22m[35mgap> StandardAssociate(R,36/5);[0m
    [22m[35m4[0m
    [22m[35mgap> StandardAssociate(U,37/13);[0m
    [22m[35m1[0m
    [22m[35mgap> StandardAssociate(U,36/13);[0m
    [22m[35m36[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m2.2-5 GcdOp[0m
  
  [1m[34m> GcdOp( [0m[22m[34mR, x, y[0m[1m[34m ) ___________________________________________________[0mmethod
  [1m[34m> Gcd( [0m[22m[34mR, x, y[0m[1m[34m ) _____________________________________________________[0mmethod
  [1mReturns:[0m  the  greatest  common divisor of [22m[34mx[0m and [22m[34my[0m in the semilocalization [22m[34mR[0m
            of the integers.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> GcdOp(S,-10/3,8/13);[0m
    [22m[35m2[0m
    [22m[35mgap> Gcd(S,90/3,60/17,120/33);[0m
    [22m[35m10[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m2.2-6 LcmOp[0m
  
  [1m[34m> LcmOp( [0m[22m[34mR, x, y[0m[1m[34m ) ___________________________________________________[0mmethod
  [1m[34m> Lcm( [0m[22m[34mR, x, y[0m[1m[34m ) _____________________________________________________[0mmethod
  [1mReturns:[0m  the  least common multiple of [22m[34mx[0m and [22m[34my[0m in the semilocalization [22m[34mR[0m of
            the integers.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> LcmOp(S,-10/3,8/13);[0m
    [22m[35m40[0m
    [22m[35mgap> Lcm(S,90/3,60/17,120/33);[0m
    [22m[35m40[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m2.2-7 Factors[0m
  
  [1m[34m> Factors( [0m[22m[34mR, x[0m[1m[34m ) ____________________________________________________[0mmethod
  [1mReturns:[0m  a  prime  factorization  of  [22m[34mx[0m  in  the  semilocalization [22m[34mR[0m of the
            integers.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Factors(U,840);[0m
    [22m[35m[ 2, 2, 2, 3, 5, 7 ][0m
    [22m[35mgap> Factors(R,840);[0m
    [22m[35m[ 105, 2, 2, 2 ][0m
    [22m[35mgap> Factors(R,-2/3);[0m
    [22m[35m[ -1/3, 2 ][0m
    [22m[35mgap> Factors(S,60/17);[0m
    [22m[35m[ 3/17, 2, 2, 5 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m2.2-8 IsUnit[0m
  
  [1m[34m> IsUnit( [0m[22m[34mR, x[0m[1m[34m ) _____________________________________________________[0mmethod
  
  Checks  whether  [22m[34mx[0m  is a unit in the semilocalization [22m[34mR[0m of the integers. The
  method returns [22m[32mfail[0m if [22m[34mx[0m is not an element of [22m[34mR[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> IsUnit(S,3/11);[0m
    [22m[35mtrue[0m
    [22m[35mgap> IsUnit(T,-2);[0m
    [22m[35mtrue[0m
    [22m[35mgap> IsUnit(T,0);[0m
    [22m[35mfalse[0m
    [22m[35mgap> IsUnit(T,3);[0m
    [22m[35mfalse[0m
    [22m[35mgap> IsUnit(T,3/11);[0m
    [22m[35mfail[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
