Quotient rings
Setting some polynomials to zero makes a new ring. In it x can be a square root of 2, or a number whose square is 0, or a point on a circle. This page shows how to compute in such a ring and how to tell what kind of ring it is.
Computing modulo an ideal
Let be an ideal of . Two polynomials are congruent modulo when their difference is in . The congruence classes can be added and multiplied through any representatives, and they form the quotient ring : the polynomials with the relations for imposed. If is the ideal of a curve or surface, is the ring of polynomial functions on it.
To compute in each class needs one preferred representative, and a Gröbner basis provides it: the remainder on division, which uses only standard monomials (those no leading monomial divides). The standard monomials are a basis of as a vector space over .
import { ring, ideal } from "@ratmath/structures";
const R = ring("x");
const A = ideal(R, ["x^2 - 2"]).quotientRing();
String(A); // "Q[x]/(x² − 2)"
const a = A.gens[0]; // the class of x: a square root of 2
String(a.mul(a)); // "2"
String(a.add(1).pow(3)); // "5x + 7": (1 + √2)³ = 7 + 5√2
String(a.add(1).inverse()); // "x − 1": 1/(1 + √2) = √2 − 1
A.dimension; // 2: the basis is 1, x
A.isField(); // true
Units, zero divisors, nilpotents
In a quotient ring the elements sort themselves into kinds that do not occur among polynomials.
- A unit has an inverse. The class of is a unit exactly when is the whole ring, that is, when has no zero on over the complex numbers.
- A zero divisor is a nonzero element with a nonzero partner whose product is zero. They appear when the solution set has several pieces: a function that vanishes on one piece times one that vanishes on the other.
- A nilpotent element has a power equal to zero. They appear when the ideal is not radical, and record multiplicity.
const B = ideal(R, ["x^2 - 1"]).quotientRing(); // two points, x = 1 and x = −1
const b = B.gens[0];
String(b.sub(1).mul(b.add(1))); // "0": two nonzero elements with product zero
b.sub(1).isZeroDivisor(); // true
b.isUnit(); // true: x·x = 1
B.isField(); // false
const D = ideal(R, ["x^2"]).quotientRing(); // the dual numbers
const e = D.gens[0];
e.isNilpotent(); // true: ε² = 0
String(e.add(3).pow(4)); // "108x + 81": (3 + ε)⁴ = 3⁴ + 4·3³ε, value and derivative together
String(e.add(1).inverse()); // "−x + 1"
D.isReduced(); // false
When the quotient is finite-dimensional, all of this is linear algebra. Multiplication by an element is a linear map on the standard monomials (a.matrix()); the element is a unit exactly when that matrix is invertible, a zero divisor when it is singular, and nilpotent when the matrix is. Its minimal polynomial is the minimal polynomial of the matrix.
Fields and domains
Every finite extension of arises as a quotient by a maximal ideal: , , and with more variables, fields generated by several roots at once. A.asField() hands the quotient back as a field that a new polynomial ring can take its coefficients from.
import { gcd } from "@ratmath/structures";
const W = ideal(ring("w"), ["w^2 + w + 1"]).quotientRing(); // Q(ω), ω a cube root of 1
const w = W.gens[0];
String(w.pow(3)); // "1"
String(w.inverse()); // "−w − 1": ω² = −ω − 1
const C = ideal(ring("x, y"), ["x^2 + y^2 - 1"]).quotientRing(); // functions on the circle
const [x, y] = C.gens;
String(x.pow(2).add(y.pow(2))); // "1"
C.isFinite; // false: infinitely many standard monomials
C.isIntegralDomain(); // true: the circle is irreducible
The algebraic package has number fields with more machinery (embeddings, Galois groups). Quotient rings here are more general, since the ideal need not be maximal and may have any number of variables.
The Chinese remainder theorem
Two ideals are comaximal when : their solution sets do not meet. Then
In words: a function on two separate pieces is a function on each, chosen independently. The proof is constructive. Write with and ; then is congruent to modulo and to modulo . For whole numbers this is the classical theorem about congruences; for points on a line it is Lagrange interpolation.
import { chineseRemainder } from "@ratmath/structures";
const P = ideal(R, ["x - 1"]);
const Q = ideal(R, ["x + 1"]);
const c = chineseRemainder(P, Q);
c.comaximal; // true
[String(c.a), String(c.b)]; // ["−(1/2)x + 1/2", "(1/2)x + 1/2"]: a ∈ P, b ∈ Q, a + b = 1
String(c.lift("5", "-3")); // "4x + 1": the line through (1, 5) and (−1, −3)
String(c.intersection); // "(x² − 1)"
@ratmath/structures and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.