If the ideal J of relations defining an affine algebra A = K[x1, ..., xn]/J, where K is a field, is maximal, then A is a field and may be used with any algorithms in Magma which work over fields. Factorization of polynomials over such affine algebras is also supported (in any characteristic, since V2.10). The examples below will demonstrate some of the applications available.
Note that an affine algebra defined over a field which itself is a field also has finite dimension when considered as a vector space over its coefficient field, so all of the operations in the previous section are also available.
> Q := RationalField(); > F<x, a, b> := FunctionField(Q, 3); > A<y> := AffineAlgebra<F, y | y^2 - (x^3 + a*x + b)>; > IsField(A); true > y^2; x^3 + x*a + b > y^-1; 1/(x^3 + x*a + b)*y > E := EllipticCurve([A | a, b]); > E; Elliptic Curve defined by y^2 = x^3 + a*x + b over Affine Algebra of rank 1 over Rational function field of rank 3 over Rational Field Variables: x, a, b > p := E ! [x, y]; > p; (x : y : 1) > q := 2*p; > q; ((1/4*x^4 - 1/2*x^2*a - 2*x*b + 1/4*a^2)/(x^3 + x*a + b) : (1/8*x^6 + 5/8*x^4*a + 5/2*x^3*b - 5/8*x^2*a^2 - 1/2*x*a*b - 1/8*a^3 - b^2)/(x^6 + 2*x^4*a + 2*x^3*b + x^2*a^2 + 2*x*a*b + b^2)*y : 1) > c := LeadingCoefficient(q[2]); > Denominator(c); x^6 + 2*x^4*a + 2*x^3*b + x^2*a^2 + 2*x*a*b + b^2 > Factorization($1); [ <x^3 + x*a + b, 2> ]
> Q := RationalField(); > F<x, a, b> := FunctionField(Q, 3); > A<y> := AffineAlgebra<F, y | y^2 - (x^3 + a*x + b)>; > P<z> := PolynomialRing(A); > f := z^2 - (x^3 + a*x + b); > f; z^2 + -x^3 - x*a - b > time Factorization(f); [ <z - y, 1>, <z + y, 1> ] Time: 0.019
> Q := RationalField(); > A<a,b,c> := AffineAlgebra<Q, a,b,c | a^2 - b*c + 1, b^2 - c + 1, c^2 + 2>; > P<x> := PolynomialRing(A); > time Factorization(x^2 + 2); [ <x - c, 1>, <x + c, 1> ] Time: 0.080 > time Factorization(x^2 - b*c + 1); [ <x - a, 1>, <x + a, 1> ] Time: 0.090 > MinimalPolynomial(a); x^8 + 4*x^6 + 2*x^4 - 4*x^2 + 9 > time Factorization(P ! $1); [ <x - a, 1>, <x + a, 1>, <x - 1/3*a*b*c - 2/3*a*b + 1/3*a*c - 1/3*a, 1>, <x + 1/3*a*b*c + 2/3*a*b - 1/3*a*c + 1/3*a, 1>, <x^4 + 2*x^2 - 2*c - 1, 1> ] Time: 2.809