The fraction field of a ring (which must be an integral domain) is obtained with the function frac.
i1 : frac ZZ |
i2 : R = ZZ/101[x,y]/(x^3 + 1 + y^3) |
i3 : frac R |
After defining a ring such as R, fractions in its fraction field can be obtained by writing them explicitly.
i4 : x |
i5 : 1/x |
i6 : x/1 |
Alternatively, after applying the function use, or assigning the fraction ring to a global variable, the symbols you used become associated with the corresponding elements of the fraction field.
i7 : use frac R |
i8 : x |
Fractions are reduced to the extent possible. This is done by computing the syzygies between the numerator and denominator, and picking one of low degree.
i9 : f = (x-y)/(x^6-y^6) |
i10 : (x^3 - y^3) * f |
The parts of a fraction may be extracted.
i11 : numerator f |
i12 : denominator f |
Alternatively, the functions lift and liftable can be used.
i13 : liftable(1/f,R) |
i14 : liftable(f,R) |
i15 : lift(1/f,R) |
Note that computations, such as Groebner bases, over fraction fields can be quite slow.