<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>frac -- construct a fraction field</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_fraction.html">next</a> | <a href="___Format.html">previous</a> | <a href="_fraction.html">forward</a> | <a href="___Format.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <hr/> <div><h1>frac -- construct a fraction field</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>frac R</tt></div> </dd></dl> </div> </li> <li><div class="single">Inputs:<ul><li><span><tt>R</tt>, <span>a <a href="___Ring.html">ring</a></span>, an integral domain</span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><span>a <a href="___Fraction__Field.html">fraction field</a></span>, the field of fractions of <tt>R</tt></span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div><table class="examples"><tr><td><pre>i1 : F = frac ZZ o1 = QQ o1 : Ring</pre> </td></tr> <tr><td><pre>i2 : F = frac (ZZ[a,b]) o2 = F o2 : FractionField</pre> </td></tr> </table> After invoking the <tt>frac</tt> command, the elements of the ring are treated as elements of the fraction field:<table class="examples"><tr><td><pre>i3 : R = ZZ/101[x,y];</pre> </td></tr> <tr><td><pre>i4 : gens gb ideal(x^2*y - y^3) o4 = | x2y-y3 | 1 1 o4 : Matrix R <--- R</pre> </td></tr> <tr><td><pre>i5 : K = frac R;</pre> </td></tr> <tr><td><pre>i6 : gens gb ideal(x^2*y - y^3) o6 = | 1 | 1 1 o6 : Matrix K <--- K</pre> </td></tr> </table> Another way to obtain <tt>frac R</tt> is with <tt>x</tt><a href="__sl.html" title="a binary operator, usually used for division">/</a><tt>y</tt> where <tt>x, y</tt> are elements of <tt>R</tt>:<table class="examples"><tr><td><pre>i7 : a*b/b^4 a o7 = -- 3 b o7 : F</pre> </td></tr> </table> Fractions are reduced to the extent possible.<table class="examples"><tr><td><pre>i8 : f = (x-y)/(x^6-y^6) 1 o8 = ---------------------------------- 5 4 3 2 2 3 4 5 x + x y + x y + x y + x*y + y o8 : K</pre> </td></tr> <tr><td><pre>i9 : (x^3 - y^3) * f x - y o9 = ------- 3 3 x + y o9 : K</pre> </td></tr> </table> The parts of a fraction may be extracted.<table class="examples"><tr><td><pre>i10 : numerator f o10 = 1 o10 : R</pre> </td></tr> <tr><td><pre>i11 : denominator f 5 4 3 2 2 3 4 5 o11 = x + x y + x y + x y + x*y + y o11 : R</pre> </td></tr> </table> Alternatively, the functions <a href="_lift.html" title="lift to another ring">lift</a> and <a href="_liftable.html" title="whether lifting to another ring is possible">liftable</a> can be used.<table class="examples"><tr><td><pre>i12 : liftable(1/f,R) o12 = true</pre> </td></tr> <tr><td><pre>i13 : liftable(f,R) o13 = false</pre> </td></tr> <tr><td><pre>i14 : lift(1/f,R) 5 4 3 2 2 3 4 5 o14 = x + x y + x y + x y + x*y + y o14 : R</pre> </td></tr> </table> One can form resolutions and Gröbner bases of ideals in polynomial rings over fraction fields, as in the following example. Note that computations over fraction fields can be quite slow.<table class="examples"><tr><td><pre>i15 : S = K[u,v];</pre> </td></tr> <tr><td><pre>i16 : I = ideal(y^2*u^3 + x*v^3, u^2*v, u^4); o16 : Ideal of S</pre> </td></tr> <tr><td><pre>i17 : gens gb I o17 = | u2v u3+x/y2v3 v4 uv3 | 1 4 o17 : Matrix S <--- S</pre> </td></tr> <tr><td><pre>i18 : Ires = res I 1 3 2 o18 = S <-- S <-- S <-- 0 0 1 2 3 o18 : ChainComplex</pre> </td></tr> <tr><td><pre>i19 : Ires.dd_2 o19 = {3} | 0 y2/xuv | {3} | -v2 -y2/xu2 | {4} | u -v | 3 2 o19 : Matrix S <--- S</pre> </td></tr> </table> One way to compute a blowup of an ideal <tt>I</tt> in <tt>R</tt>, is to compute the kernel of a map of a new polynomial ring into a fraction field of <tt>R</tt>, as shown below.<table class="examples"><tr><td><pre>i20 : A = ZZ/101[a,b,c];</pre> </td></tr> <tr><td><pre>i21 : f = map(K, A, {x^3/y^4, x^2/y^2, (x^2+y^2)/y^4}); o21 : RingMap K <--- A</pre> </td></tr> <tr><td><pre>i22 : kernel f 3 2 2 3 2 3 3 o22 = ideal (b c - a b - a , a*b c - a b*c - a c) o22 : Ideal of A</pre> </td></tr> </table> </div> </div> <div class="single"><h2>Caveat</h2> <div>The input ring should be an integral domain.<p/> Currently, for <tt>S</tt> as above, one cannot define <tt>frac S</tt> or fractions <tt>u/v</tt>. One can get around that by defining <tt>B = ZZ/101[x,y,u,v]</tt> and identify <tt>frac S</tt> with <tt>frac B</tt>.</div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="_numerator.html" title="numerator of a fraction">numerator</a> -- numerator of a fraction</span></li> <li><span><a href="_denominator.html" title="denominator of a fraction">denominator</a> -- denominator of a fraction</span></li> <li><span><a href="_liftable.html" title="whether lifting to another ring is possible">liftable</a> -- whether lifting to another ring is possible</span></li> <li><span><a href="_lift.html" title="lift to another ring">lift</a> -- lift to another ring</span></li> </ul> </div> <div class="waystouse"><h2>Ways to use <tt>frac</tt> :</h2> <ul><li>frac(EngineRing)</li> <li>frac(FractionField)</li> <li>frac(Ring)</li> </ul> </div> </div> </body> </html>