The fundamental theorem of algebra in Logical English

Exact roots counted with multiplicity, and floating-point roots checked by their residuals.

fundamental-theorem-of-algebra-le.le · output · proof · check · playground

The question

For every real x, x⁴ + 4 is positive. Where are its four roots? The fundamental theorem of algebra says a polynomial of degree n with complex coefficients has n complex roots counted with multiplicity. A sextic can therefore have six roots even if it vanishes at just three distinct points.

For the exact cases, the program searches nine Gaussian integers, whose real and imaginary coordinates each range from −1 to 1. It certifies a complete factorization when the roots in that grid account for the polynomial’s entire degree.

Historical background

The theorem took shape as mathematicians moved from formulas for particular degrees to asking whether an arbitrary polynomial must have a root. D’Alembert attempted a general proof in 1746. Gauss’s 1799 dissertation treated the equivalent factorization of real polynomials into real linear and quadratic factors. The quartic and sextic here give concrete factorizations over the complex numbers. University of St Andrews, history of the theorem · Gauss’s dissertation

How a root becomes a factor

The program writes a complex number as [real, imaginary] and lists the coefficients from the highest power to the constant term. For a candidate root z, synthetic division starts with the leading coefficient as the carry. Each step multiplies the carry by z and adds the next coefficient. The carries before the last one are the coefficients of the quotient by x − z. The last carry is the remainder.

For x⁴ + 4 and z = 1 + i the carries are as follows.

Coefficient Carry
1 1
0 1 + i
0 2i
0 −2 + 2i
4 0

A zero remainder lets the program repeat the division on the quotient. The number of successful divisions is the root’s multiplicity. Each division removes one power of x − z.

Floating-point roots

The polynomial x⁴ + 0.5 has a root in each quadrant, with both coordinates near ±0.5946. The program starts Newton’s method at the four points ±1 ± i. For an estimate z, the first synthetic division gives the quotient Q and the remainder P(z). Differentiating P(x) = (x − z)Q(x) + P(z) at z gives P′(z) = Q(z). A second division gives that derivative as its remainder, so the program can take the step z − P(z)/P′(z). NIST DLMF, Newton’s rule

Each search takes at most twelve steps. A point qualifies when the computed modulus of P(z) is at most 10⁻¹². The rule compares squared moduli, so it can check the tolerance using only arithmetic on the two components.

What eyemind concludes

% query roots with scenario polynomials
quartic has root [-1, -1] with multiplicity 1.
quartic has root [-1, 1] with multiplicity 1.
quartic has root [1, -1] with multiplicity 1.
quartic has root [1, 1] with multiplicity 1.
sextic has root [0, -1] with multiplicity 2.
sextic has root [0, 0] with multiplicity 1.
sextic has root [1, 1] with multiplicity 3.

% query completeness with scenario polynomials
quartic has degree 4 with all 4 roots accounted for.
sextic has degree 6 with all 6 roots accounted for.

% query approximations with scenario polynomials
floating quartic has approximate root [-0.5946035575013641, -0.5946035575013641] with residual at most 1e-12.
floating quartic has approximate root [-0.5946035575013641, 0.5946035575013641] with residual at most 1e-12.
floating quartic has approximate root [0.5946035575013641, -0.5946035575013641] with residual at most 1e-12.
floating quartic has approximate root [0.5946035575013641, 0.5946035575013641] with residual at most 1e-12.

The sextic’s factors give 2x(x + i)²(x − (1 + i))³. The scalar 2 is its leading coefficient. The powers give the multiplicities 1, 2 and 3.

struct('le:answer', 'roots', 'polynomials', 'sextic', [1, 1], 3)
struct('le:answer', 'completeness', 'polynomials', 'quartic', 4, 4)
struct('le:answer', 'completeness', 'polynomials', 'sextic', 6, 6)
struct('le:answer', 'approximations', 'polynomials', 'floating quartic', [0.5946035575013641, 0.5946035575013641], 1e-12)

What the proof establishes

The saved proof is checked against the compiled Logic Script program. For each lattice point the checker verifies the exact synthetic divisions and where they stop. It also checks that the sum of the multiplicities is the degree. Since factors for distinct roots are relatively prime, their product divides the polynomial. Once their degrees add up to the degree of the polynomial, only the leading scalar remains.

For the floating-point quartic the checker replays Newton’s steps and verifies the residual comparison at each reported point. The bound applies to the value of the polynomial evaluated at that point.

Try it

node bin/eyemind.js examples/fundamental-theorem-of-algebra-le.le
node bin/eyemind.js --explain examples/fundamental-theorem-of-algebra-le.le
node bin/eyemind.js --check-proof examples/proof/fundamental-theorem-of-algebra-le.js examples/fundamental-theorem-of-algebra-le.le