Ideals and Gröbner bases

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 II be an ideal of R=K[x1,…,xn]R = K[x_1, \dots, x_n]. Two polynomials are congruent modulo II when their difference is in II. The congruence classes can be added and multiplied through any representatives, and they form the quotient ring R/IR/I: the polynomials with the relations f=0f = 0 for f∈If \in I imposed. If II is the ideal of a curve or surface, R/IR/I is the ring of polynomial functions on it.

To compute in R/IR/I 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 R/IR/I as a vector space over KK.

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 ff is a unit exactly when I+⟨f⟩I + \langle f\rangle is the whole ring, that is, when ff has no zero on V(I)V(I) 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

R/I is a field  ⟺  I is maximal,R/I is an integral domain  ⟺  I is prime. R/I \text{ is a field} \iff I \text{ is maximal}, \qquad R/I \text{ is an integral domain} \iff I \text{ is prime}.

Every finite extension of Q\mathbb Q arises as a quotient by a maximal ideal: Q[x]/⟨x2−2⟩=Q(2)\mathbb Q[x]/\langle x^2 - 2\rangle = \mathbb Q(\sqrt 2), Q[x]/⟨x2+1⟩=Q(i)\mathbb Q[x]/\langle x^2 + 1\rangle = \mathbb Q(i), 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 I+J=RI + J = R: their solution sets do not meet. Then

R/(I∩J)  ≅  R/I×R/J,I∩J=IJ. R/(I \cap J) \;\cong\; R/I \times R/J, \qquad I \cap J = IJ .

In words: a function on two separate pieces is a function on each, chosen independently. The proof is constructive. Write 1=a+b1 = a + b with a∈Ia \in I and b∈Jb \in J; then fb+gaf b + g a is congruent to ff modulo II and to gg modulo JJ. 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)"
Try itEdit the code and run it with @ratmath/structures and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.
Ctrl/⌘ + Enter runs