<!-- #################################################################### -->
<!-- ##                                                                ## -->
<!-- ##  z_pi.xml        ResClasses documentation         Stefan Kohl  ## -->
<!-- ##                                                                ## -->
<!-- ##  $Id: z_pi.xml,v 1.8 2004/01/23 13:56:28 stefan Exp $          ## -->
<!-- ##                                                                ## -->
<!-- #################################################################### -->

<Chapter Label="ch:Z_pi">
<Heading>Semilocalizations of the Integers</Heading>

In the following we need the semilocalizations <M>\Z_{(\pi)}</M> 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. 

<!-- #################################################################### -->

<Section Label="sec:DefiningZ_pi">
<Heading>Defining semilocalizations of the integers</Heading>

  <ManSection>
    <Func Name="Z_pi" Arg="pi"/>
    <Func Name="Z_pi" Arg="p"/>
    <Returns>the ring <M>\Z_{(\pi)}</M>.</Returns>
    <Description>
      The function also accepts a single prime <A>p</A> instead of the
      one-element list <C><A>pi</A> = [ <A>p</A> ]</C> as argument.
<Example>
<![CDATA[
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 )
]]>
</Example>
    </Description>
  </ManSection>

  <ManSection>
    <Prop Name="IsZ_pi" Arg="R"/>
    <Description>
      Indicates whether <A>R</A> is a ring <M>\Z_{(\pi)}</M> for some
      set of primes <M>\pi</M>.
    </Description>
  </ManSection>

  <ManSection>
    <Attr Name="NoninvertiblePrimes" Arg="R"/>
    <Description>
      The noninvertible primes <A>pi</A> in the semilocalization <A>R</A>
      of the integers.
    </Description>
  </ManSection>

</Section>

<!-- #################################################################### -->

<Section Label="sec:MethodsForZ_pi">
<Heading>Methods for semilocalizations of the integers</Heading>

  <ManSection>
    <Meth Name="\in" Arg="x, R"/>
    <Description>
      Checks whether <A>x</A> is an element of the semilocalization <A>R</A>
      of the integers.
<Example>
<![CDATA[
gap> 4/7 in R;
true
gap> 3/2 in R;
false
gap> 17/35 in S;
false
gap> 3/17 in S;
true
]]>
</Example>
    </Description>
  </ManSection>

  <ManSection>
    <Meth Name="Intersection" Arg="R, S"/>
    <Returns>
      the intersection of the semilocalizations <A>R</A> and <A>S</A>
      of the integers.
    </Returns>
    <Description>
<Example>
<![CDATA[
gap> U := Intersection(R,S,T);
Z_( 2, 3, 5, 7, 11 )
]]>
</Example>
    </Description>
  </ManSection>

  <ManSection>
    <Meth Name="IsSubset" Arg="R, S"/>
    <Description>
      Checks whether <A>S</A> is a subring of <A>R</A>, where <A>R</A> and
      <A>S</A> are semilocalizations of the integers.
<Example>
<![CDATA[
gap> IsSubset(R,U);
true
gap> IsSubset(T,R);
false
]]>
</Example>
    </Description>
  </ManSection>

  <ManSection>
    <Meth Name="StandardAssociate" Arg="R, x"/>
    <Returns>
      the standard associate of <A>x</A> in the semilocalization
      <A>R</A> of the integers.
    </Returns>
    <Description>
      We define the standard associate of an element of <M>\Z_{(\pi)}</M>
      by the product of the non-invertible prime factors of its numerator.
<Example>
<![CDATA[
gap> StandardAssociate(R,-6/7);
2
gap> StandardAssociate(R,36/5);
4
gap> StandardAssociate(U,37/13);
1
gap> StandardAssociate(U,36/13);
36
]]>
</Example>
    </Description>
  </ManSection>

  <ManSection>
    <Meth Name="GcdOp" Arg="R, x, y"/>
    <Meth Name="Gcd"   Arg="R, x, y"/>
    <Returns>
      the greatest common divisor of <A>x</A> and <A>y</A>
      in the semilocalization <A>R</A> of the integers.
    </Returns>
    <Description>
<Example>
<![CDATA[
gap> GcdOp(S,-10/3,8/13);
2
gap> Gcd(S,90/3,60/17,120/33);
10
]]>
</Example>
    </Description>
  </ManSection>

  <ManSection>
    <Meth Name="LcmOp" Arg="R, x, y"/>
    <Meth Name="Lcm"   Arg="R, x, y"/>
    <Returns>
      the least common multiple of <A>x</A> and <A>y</A>
      in the semilocalization <A>R</A> of the integers.
    </Returns>
    <Description>
<Example>
<![CDATA[
gap> LcmOp(S,-10/3,8/13);
40
gap> Lcm(S,90/3,60/17,120/33);
40
]]>
</Example>
    </Description>
  </ManSection>

  <ManSection>
    <Meth Name="Factors" Arg="R, x"/>
    <Returns>
      a prime factorization of <A>x</A> in the semilocalization
      <A>R</A> of the integers.
    </Returns>
    <Description>
<Example>
<![CDATA[
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 ]
]]>
</Example>
    </Description>
  </ManSection>

  <ManSection>
    <Meth Name="IsUnit" Arg="R, x"/>
    <Description>
      Checks whether <A>x</A> is a unit in the semilocalization
      <A>R</A> of the integers.
      The method returns <C>fail</C> if <A>x</A> is not
      an element of <A>R</A>.
<Example>
<![CDATA[
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
]]>
</Example>
    </Description>
  </ManSection>

  <Alt Only="HTML">&nbsp;</Alt>

</Section>

<!-- #################################################################### -->

</Chapter>

<!-- #################################################################### -->


