Given any affine algebra Q = K[x1, ..., xn]/J, where K is a field, one may create the ring of fractions R of Q. This is the set of fractions a/b, where a, b∈Q and b is invertible, and it forms a ring.
The defining ideal J does not need to be zero-dimensional. The ring of fractions R is itself represented internally by an affine algebra over an appropriate rational function field, but has the appearance to the user of the set of fractions, so one may access the numerator and denominator of elements of R, for example.
If the ideal J is prime, then R is the field of fractions of A and may be used with any algorithms in Magma which work over fields. For example, factorization of polynomials over such fields of fractions is supported (in any characteristic).
Rings of fractions have type RngFunFrac and their elements RngFunFracElt.
Given an affine algebra Q over a field K, return the ring of fractions of Q. The only difference between the two functions is that for FieldOfFractions, the defining ideal of Q must be prime.
Given an element a from the ring of fractions of an affine algebra Q, return the numerator (resp. denominator) of a as an element of Q.
> A<x,y> := AffineAlgebra<RationalField(), x,y | y^2 - x^3 - 1>; > IsField(A); false > F<a,b> := FieldOfFractions(A); > F; Ring of Fractions of Affine Algebra of rank 2 over Rational Field Lexicographical Order Variables: x, y Quotient relations: [ x^3 - y^2 + 1 ] > a; a > b; b > a^-1; > a^-1; 1/(b^2 - 1)*a^2 > b^-1; 1/b > c := b/a; > c; b/(b^2 - 1)*a^2 > Numerator(c); x^2*y > Denominator(c); y^2 - 1 > P<X> := PolynomialRing(F); > time Factorization(X^3 - b^2 + 1); [ <X - a, 1>, <X^2 + a*X + a^2, 1> ] Time: 0.000 > P<X,Y> := PolynomialRing(F, 2); > time Factorization((X + Y)^3 - b^2 + 1); [ <X + Y - a, 1>, <X^2 + 2*X*Y + a*X + Y^2 + a*Y + a^2, 1> ] Time: 0.030 > time Factorization((b*X^2 - a)*(a*Y^3 - b + 1)*(X^3 - b^2 + 1)); [ <Y^3 - 1/(b + 1)*a^2, 1>, <X - a, 1>, <X^2 - 1/b*a, 1>, <X^2 + a*X + a^2, 1> ] Time: 0.010
> Q := RationalField(); > A<x,y> := AffineAlgebra<RationalField(), x,y | y^2 - x^3 - 1>; > IsField(A); false > I := DivisorIdeal(A); > I; Ideal of Polynomial ring of rank 2 over Rational Field Lexicographical Order Variables: x, y Groebner basis: [ x^3 - y^2 + 1 ] > d, L := Dimension(I); > d; 1 > L; [ 2 ] > E, f := Extension(I, L); > E; Ideal of Polynomial ring of rank 1 over Multivariate rational function field of rank 1 over Integer Ring Graded Reverse Lexicographical Order Variables: x Basis: [ x^3 - y^2 + 1 ] > F := Generic(E)/E; Affine Algebra of rank 1 over Multivariate rational function field of rank 1 over Integer Ring Graded Reverse Lexicographical Order Variables: x Quotient relations: [ x^3 - y^2 + 1 ] > g := map<A -> F | x :-> F!f(x)>; > > g(x); x > g(y); y > g(x)^-1; 1/(y^2 - 1)*x^2 > g(y)^-1; 1/y > g(x^2 + x*y); x^2 + y*x > g(x^2 + x*y)^-1; y^2/(y^5 + y^4 - y^3 - 2*y^2 + 1)*x^2 + 1/(y^3 + y^2 - 1)*x - y/ (y^3 + y^2 - 1) > $1 * $2; 1