Rings and Fields of Fractions of Affine Algebras

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.

RingOfFractions(Q) : RngMPolRes -> RngFunFrac
FieldOfFractions(Q) : RngMPolRes -> RngFunFrac
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.
Numerator(a) : RngFunFracElt -> RngMPolResElt
Denominator(a) : RngFunFracElt -> RngMPolResElt
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.

Example AlgAff_FieldOfFractions (H115E7)

We create the field of fractions of an affine algebra and note the basic operations.
> 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

Example AlgAff_Extension (H115E8)

This example shows the internal operations underlying the method of constructing the field of fractions. If the ideal of relations has dimension d, then the sequence L of d maximally independent variables is passed to the extension/contraction construction, which creates a rational function field with d variables such that the ideal of relations over this field now becomes zero dimensional. Appropriate maps are set up, too.
> 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
V2.28, 13 July 2023