The fraction field of a ring (which must be an integral domain) is obtained with the function
frac.
i1 : frac ZZ
o1 = QQ
o1 : Ring
|
i2 : R = ZZ/101[x,y]/(x^3 + 1 + y^3)
o2 = R
o2 : QuotientRing
|
i3 : frac R
o3 = frac R
o3 : FractionField
|
After defining a ring such as
R, fractions in its fraction field can be obtained by writing them explicitly.
i4 : x
o4 = x
o4 : R
|
i5 : 1/x
1
o5 = -
x
o5 : frac R
|
i6 : x/1
o6 = x
o6 : R
|
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
o7 = frac R
o7 : FractionField
|
i8 : x
o8 = x
o8 : frac R
|
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)
-1
o9 = -------------
2 2
x + x*y + y
o9 : frac R
|
i10 : (x^3 - y^3) * f
o10 = - x + y
o10 : frac R
|
The parts of a fraction may be extracted.
i11 : numerator f
o11 = -1
o11 : R
|
i12 : denominator f
2 2
o12 = x + x*y + y
o12 : R
|
Alternatively, the functions
lift and
liftable can be used.
i13 : liftable(1/f,R)
o13 = true
|
i14 : liftable(f,R)
o14 = false
|
i15 : lift(1/f,R)
2 2
o15 = - x - x*y - y
o15 : R
|
Note that computations, such as Gröbner bases, over fraction fields can be quite slow.