Algorithm Search⌘K

Proofs: Cylindrical algebraic decomposition

These are the human proofs of Cylindrical algebraic decomposition, at full length.

The plane CAD is cylindrical, sign-invariant and computed exactly, and it stops full

This proof shows: correctness, termination.

Let F={f1,…,fm}⊂Q[x,y]F = \{f_1, \ldots, f_m\} \subset \mathbb{Q}[x, y]. View each f≠0f \ne 0 as a polynomial in yy over Q[x]\mathbb{Q}[x]. Its content cont⁡(f)∈Q[x]\operatorname{cont}(f) \in \mathbb{Q}[x] is the gcd of its coefficients and its primitive part is prim⁡(f)=f/cont⁡(f)\operatorname{prim}(f) = f / \operatorname{cont}(f). Let T=∏fprim⁡(f)T = \prod_f \operatorname{prim}(f), and let SS be the primitive squarefree part of TT, S=T/gcd⁡(T,∂T/∂y)S = T / \gcd(T, \partial T / \partial y) made primitive. Let D=res⁡y(S,∂S/∂y)D = \operatorname{res}_y(S, \partial S / \partial y) and let PP be the squarefree part of ∏fcont⁡(f)⋅LC⁡(S)⋅D\prod_f \operatorname{cont}(f) \cdot \operatorname{LC}(S) \cdot D, where LC⁡\operatorname{LC} is the leading coefficient in yy. These are the objects of line L1. By Gauss's lemma, SS has exactly the irreducible factors of TT that involve yy, each once, and it has no factor in Q[x]\mathbb{Q}[x] alone. Since SS is squarefree over Q(x)\mathbb{Q}(x), it has no common factor with ∂S/∂y\partial S/\partial y, so D≠0D \ne 0 when deg⁡yS≥1\deg_y S \ge 1.

Lemma 1 (where FF vanishes). Let f∈Ff \in F be nonzero, and suppose f(x0,y0)=0f(x_0, y_0) = 0 at a real point. Then cont⁡(f)(x0)=0\operatorname{cont}(f)(x_0) = 0 or S(x0,y0)=0S(x_0, y_0) = 0. Moreover, S(x0,⋅)S(x_0, \cdot) is never the zero polynomial.

Proof. If cont⁡(f)(x0)≠0\operatorname{cont}(f)(x_0) \ne 0 then prim⁡(f)(x0,y0)=0\operatorname{prim}(f)(x_0, y_0) = 0. Every irreducible factor of prim⁡(f)\operatorname{prim}(f) divides TT and therefore SS, so prim⁡(f)\operatorname{prim}(f) divides SkS^k for some kk. Hence S(x0,y0)k=0S(x_0, y_0)^k = 0. The coefficients of SS have gcd 1 in Q[x]\mathbb{Q}[x], so they have no common complex root, and S(x0,⋅)≠0S(x_0, \cdot) \ne 0. □\square

Lemma 2 (delineability). Let k=deg⁡yS≥1k = \deg_y S \ge 1, and let II be an open interval on which LC⁡(S)\operatorname{LC}(S) and DD have no zero. Then there are r≥0r \ge 0 and continuous functions θ1<⋯<θr\theta_1 < \cdots < \theta_r on II such that, for every x∈Ix \in I, the real roots of S(x,⋅)S(x, \cdot) are exactly θ1(x),…,θr(x)\theta_1(x), \ldots, \theta_r(x).

Proof. For x∈Ix \in I, S(x,⋅)S(x, \cdot) has degree kk, and its derivative has degree k−1k - 1 with leading coefficient kLC⁡(S)(x)≠0k \operatorname{LC}(S)(x) \ne 0. So the resultant specializes: res⁡(S(x,⋅),∂yS(x,⋅))=D(x)≠0\operatorname{res}(S(x, \cdot), \partial_y S(x, \cdot)) = D(x) \ne 0. Then S(x,⋅)S(x, \cdot) has kk distinct complex roots. Fix x0∈Ix_0 \in I and choose disjoint closed discs around these roots, each disc symmetric under complex conjugation when its center is real, and not meeting the real axis when its center is not real. The roots of a polynomial of constant degree depend continuously on its coefficients. So for xx near x0x_0 each disc contains exactly one root of S(x,⋅)S(x, \cdot). A disc that misses the real axis contains no real root. A symmetric disc contains a real root: if its only root zz were not real, then zˉ\bar z would be a second root in the same disc. So the number of real roots is locally constant, hence constant on the connected set II, and each ordered real root stays in its disc, which makes it continuous. Distinct roots never meet, so the order θ1<⋯<θr\theta_1 < \cdots < \theta_r is strict on all of II. □\square

Lemma 3 (sign-invariance over an open column). Let II be a connected component of R\mathbb{R} minus the real roots of PP. Then for every f∈Ff \in F, ff has a constant sign on each sector {(x,y):x∈I, θj(x)<y<θj+1(x)}\{(x, y) : x \in I,\ \theta_j(x) < y < \theta_{j+1}(x)\} (with θ0=−∞\theta_0 = -\infty, θr+1=+∞\theta_{r+1} = +\infty) and on each section {(x,θj(x)):x∈I}\{(x, \theta_j(x)) : x \in I\}.

Proof. Every root of cont⁡(f)\operatorname{cont}(f), LC⁡(S)\operatorname{LC}(S) and DD is a root of PP, so none of these vanishes on II, and Lemma 2 applies (with r=0r = 0 when deg⁡yS=0\deg_y S = 0). By Lemma 1, the zeros of ff over II lie on the graphs of the θj\theta_j. A sector is connected, being homeomorphic to II times an open interval through the continuous θj\theta_j. Since ff is continuous with no zero on a sector, its sign is constant there.

For a section, write S=h1⋯hsS = h_1 \cdots h_s with distinct irreducible hlh_l. At each x∈Ix \in I, the root θj(x)\theta_j(x) is simple, so it is a root of exactly one hl(x,⋅)h_l(x, \cdot). The sets Il={x∈I:hl(x,θj(x))=0}I_l = \{x \in I : h_l(x, \theta_j(x)) = 0\} are closed in II, disjoint and cover II, so by connectedness a single h=hlh = h_l vanishes along the whole section. If hh divides prim⁡(f)\operatorname{prim}(f), then ff is zero on the section. Otherwise suppose f(x,θj(x))=0f(x, \theta_j(x)) = 0 at some x∈Ix \in I. Since cont⁡(f)(x)≠0\operatorname{cont}(f)(x) \ne 0, some irreducible factor h′≠hh' \ne h of prim⁡(f)\operatorname{prim}(f) vanishes there. That factor is one of the hlh_l, which contradicts uniqueness. So ff has no zero on the section, which is connected, and its sign is constant. □\square

Lemma 4 (stacks over a point). For a real α\alpha, let β1<⋯<βr\beta_1 < \cdots < \beta_r be the real roots of S(α,⋅)S(\alpha, \cdot). Then each f∈Ff \in F has a constant sign on each open interval {α}×(βj,βj+1)\{\alpha\} \times (\beta_j, \beta_{j+1}) and on each point (α,βj)(\alpha, \beta_j).

Proof. If cont⁡(f)(α)=0\operatorname{cont}(f)(\alpha) = 0, then f(α,⋅)=0f(\alpha, \cdot) = 0 and its sign is 00 everywhere on the line. Otherwise, by Lemma 1, every real zero of f(α,⋅)f(\alpha, \cdot) is some βj\beta_j, so f(α,⋅)f(\alpha, \cdot) has no zero on the open intervals and keeps its sign on each. □\square

Lemma 5 (exact computation). The implementation computes the roots, the stacks and the sign vectors exactly.

Proof. (a) Isolation. For a squarefree p∈Q[x]p \in \mathbb{Q}[x], every real root lies in (−B,B)(-B, B) with B=1+max⁡i∣pi/LC⁡(p)∣B = 1 + \max_i |p_i / \operatorname{LC}(p)| (Cauchy). Sturm's theorem counts the distinct roots in (a,b)(a, b) at non-root endpoints. Bisection keeps the endpoints off the roots, since a midpoint that is a root is moved. It stops: once the intervals are shorter than the smallest gap between roots, each holds at most one root. The output is sorted, disjoint and complete, with one root per interval.

(b) Real algebraic numbers. A number α\alpha is held as a squarefree pp with p(α)=0p(\alpha) = 0 and an interval (a,b)(a, b) that contains no other root of pp, with p(a),p(b)≠0p(a), p(b) \ne 0, or as an exact rational. For a section column, pp is the smallest squarefree factor of a projection polynomial that changes sign on the isolating interval of PP. Its roots are roots of PP, so its only root there is α\alpha. Refinement halves the interval by the sign of pp at the midpoint and keeps the invariant. Then is_zero(q) returns true exactly when q(α)=0q(\alpha) = 0. If the interval enclosure of qq on [a,b][a, b] misses 00, then q(α)≠0q(\alpha) \ne 0. Otherwise let g=gcd⁡(p,q)g = \gcd(p, q). Since p(α)=0p(\alpha) = 0, we have q(α)=0q(\alpha) = 0 if and only if g(α)=0g(\alpha) = 0, and gg, a divisor of the squarefree pp, has at most one root in (a,b)(a, b), a simple one. So g(α)=0g(\alpha) = 0 exactly when gg changes sign on (a,b)(a, b). Then pp is replaced by gg or by p/gp / g, whichever vanishes at α\alpha, and the invariant holds. If q(α)≠0q(\alpha) \ne 0, the enclosures shrink to q(α)q(\alpha) as the interval shrinks, so sign_of stops with the right sign.

(c) Arithmetic in Q(α)\mathbb{Q}(\alpha). Reduction modulo pp commutes with evaluation at α\alpha, since x↦αx \mapsto \alpha defines a ring homomorphism Q[x]/(p)→R\mathbb{Q}[x]/(p) \to \mathbb{R}. The decisions taken (is a leading coefficient zero at α\alpha?) are exact by (b). An inverse is taken only for qq with q(α)≠0q(\alpha) \ne 0. Removing g=gcd⁡(p,q)g = \gcd(p, q) from pp keeps α\alpha as a root, because g(α)≠0g(\alpha) \ne 0. Then the extended Euclidean algorithm gives ss with sq≡1 mod psq \equiv 1 \bmod p, so s(α)=1/q(α)s(\alpha) = 1/q(\alpha). So the trimmed polynomials, remainders, monic gcds and derivatives computed over Q(α)\mathbb{Q}(\alpha) evaluate at α\alpha to those of the evaluated inputs in R[y]\mathbb{R}[y]. In particular, the stack polynomial gg evaluates to the monic squarefree part of S(α,y)S(\alpha, y), and the Sturm sequence built from gg is the Sturm sequence of the real polynomial g(α,⋅)g(\alpha, \cdot). Dividing by a monic multiple of BB leaves the remainder unchanged.

(d) Sections. As a polynomial in yy with coefficients in Q[x]/(p)\mathbb{Q}[x]/(p), gg has leading coefficient exactly 11. With pp monic, Poisson's formula gives res⁡x(p(x),g(x,y))=∏p(α′)=0g(α′,y)\operatorname{res}_x(p(x), g(x, y)) = \prod_{p(\alpha') = 0} g(\alpha', y). This is a product of monic polynomials in yy, so it is nonzero, has degree deg⁡p⋅deg⁡yg\deg p \cdot \deg_y g, and is recovered exactly by interpolation at that many points plus one. Every root of g(α,⋅)g(\alpha, \cdot) is a root of this norm. Its squarefree part NsN_s is isolated by (a). In each interval, which holds one root of NsN_s and has endpoints that are not roots of g(α,⋅)g(\alpha, \cdot), the Sturm count of g(α,⋅)g(\alpha, \cdot) is 00 or 11. Keeping the intervals with count 11 gives exactly the real roots of S(α,⋅)S(\alpha, \cdot), in increasing order, with rational sector samples between them. For a rational α\alpha, the squarefree part of S(α,y)∈Q[y]S(\alpha, y) \in \mathbb{Q}[y] is isolated directly.

(e) Signs. At a rational y0y_0, the sign of f(α,y0)f(\alpha, y_0) is sign_of of a polynomial in Q(α)\mathbb{Q}(\alpha), which is exact by (b). At a section β\beta, the unique root of NsN_s and of g(α,⋅)g(\alpha, \cdot) in (c,d)(c, d): f(α,β)=0f(\alpha, \beta) = 0 if and only if G=gcd⁡(f(α,⋅),g(α,⋅))G = \gcd(f(\alpha, \cdot), g(\alpha, \cdot)) has a root in (c,d)(c, d). GG divides a squarefree polynomial, so its Sturm count decides this. Otherwise f(α,β)≠0f(\alpha, \beta) \ne 0, and the box enclosures of ff shrink to it: α\alpha is refined by (b), and β\beta is refined by bisection of NsN_s, whose only root in the interval is β\beta. So the loop stops with the correct sign. □\square

Theorem. cad(F) terminates and returns a cylindrical decomposition of R2\mathbb{R}^2 into connected cells, each with the correct sign vector of FF, and every f∈Ff \in F has a constant sign on every cell.

Proof. Columns. By Lemma 5(a), lines L2 and L3 find all real roots α1<⋯<αk\alpha_1 < \cdots < \alpha_k of PP. Each sector sample is the midpoint between the right end of one isolating interval and the left end of the next, or a point beyond the extreme intervals. It lies strictly between consecutive roots and is not a root. So the x-cells, the points αi\alpha_i and the open intervals between them, partition R\mathbb{R}.

Open columns. Let II be an open x-cell with sample aa. Lemma 2 gives rr continuous root functions on II. By Lemma 5(d), the stack computed at aa has exactly rr sections, so the sections and sectors over II correspond one to one to the cells of the stack at aa. By Lemma 3, each ff has a constant sign on each of these cells. By Lemma 5(e), the sign at the sample is computed exactly, so it is the sign on the whole cell.

Point columns. Over αi\alpha_i, the stack consists of the real roots of S(αi,⋅)S(\alpha_i, \cdot) and the open intervals between them (Lemma 5(d)). Signs are constant on them by Lemma 4 and computed exactly by Lemma 5(e).

Partition and cylindricity. Every vertical line is partitioned by the stack over its x-cell, so the cells partition R2\mathbb{R}^2. Their projections are exactly the x-cells, which makes the decomposition cylindrical. Each cell is connected, being a point, an interval, the graph of a continuous function over an interval, or the region between two such graphs.

Termination. Every loop either decreases a degree (the Euclidean and Sturm sequences, division), runs over a finite list (columns, cells, polynomials), or is a refinement loop. The refinement loops stop by Lemma 5(a), (b) and (e). ■\blacksquare

Back to Cylindrical algebraic decomposition