Algorithm Search⌘K

Proofs: Subresultant GCD algorithm

These are the human proofs of Subresultant GCD algorithm, at full length.

The subresultant algorithm returns the gcd in Z[x] full

This proof shows: correctness.

Let RR be a unique factorization domain with fraction field KK; the case of the page is R=ZR = \mathbb{Z}, K=QK = \mathbb{Q}. Gcds in R[x]R[x] are taken with a normal leading coefficient (positive over Z\mathbb{Z}). For a,b∈K[x]a, b \in K[x] let DK(a,b)D_K(a, b) be the set of common divisors of aa and bb in K[x]K[x].

Lemma 1 (pseudo-remainder). If A,B∈R[x]A, B \in R[x], B≠0B \ne 0 and deg⁡A≥deg⁡B\deg A \ge \deg B, then prem⁡(A,B)=lc⁡(B)δ+1(Arem⁡B)\operatorname{prem}(A, B) = \operatorname{lc}(B)^{\delta + 1} (A \operatorname{rem} B) in K[x]K[x], where δ=deg⁡A−deg⁡B\delta = \deg A - \deg B. This is proved on the page pseudo-division, from the uniqueness of division with remainder in K[x]K[x].

Lemma 2 (exactness). In every pass of the loop, γhδ\gamma h^{\delta} divides every coefficient of RR in line L9, and the division in line L10 is exact. Moreover γ≠0\gamma \ne 0 and h≠0h \ne 0.

Source. This is the fundamental theorem of subresultants: up to sign, each new BB of line L9 is a subresultant of pp⁡(f)\operatorname{pp}(f) and pp⁡(g)\operatorname{pp}(g), a polynomial whose coefficients are determinants of matrices with entries in RR, and each hh is, up to sign, a leading coefficient of a subresultant (Brown and Traub, 1971; von zur Gathen and Gerhard, Section 11.2; Cohen, Section 3.3). The leading coefficients are nonzero because they are leading coefficients of nonzero polynomials, and a product and an exact quotient of nonzero elements of a domain are nonzero. The implementation checks every division and raises an error if one leaves a remainder.

The case g=0g = 0. After line L1, deg⁡f≥deg⁡g\deg f \ge \deg g, so g=0g = 0 is the only case in which line L2 returns. Then gcd⁡(f,0)=f\gcd(f, 0) = f, normalized, which is the output. If also f=0f = 0, the output is 00.

Invariant. Assume g≠0g \ne 0. Before each test of line L4 (each pass of the loop):

  1. A,B∈R[x]A, B \in R[x], B≠0B \ne 0 and deg⁡A≥deg⁡B\deg A \ge \deg B;
  2. DK(A,B)=DK(f,g)D_K(A, B) = D_K(f, g).

Initialization. After line L3, A=pp⁡(f)A = \operatorname{pp}(f) and B=pp⁡(g)B = \operatorname{pp}(g). They differ from ff and gg by nonzero constants, which are units of KK, so part 2 holds. Part 1 holds by line L1 and since g≠0g \ne 0.

Maintenance. Suppose the loop does not return at lines L7 or L8, so R=prem⁡(A,B)≠0R = \operatorname{prem}(A, B) \ne 0 and deg⁡R≥1\deg R \ge 1. By Lemma 1, R=u⋅(Arem⁡B)R = u \cdot (A \operatorname{rem} B) with u=lc⁡(B)δ+1≠0u = \operatorname{lc}(B)^{\delta + 1} \ne 0. By Lemma 2, the new BB is R/(γhδ)∈R[x]R / (\gamma h^{\delta}) \in R[x], a nonzero constant of KK times Arem⁡BA \operatorname{rem} B. A polynomial divides AA and BB exactly when it divides BB and A−(Aquo⁡B)B=Arem⁡BA - (A \operatorname{quo} B) B = A \operatorname{rem} B, so DK(new A,new B)=DK(B,Arem⁡B)=DK(A,B)D_K(\text{new } A, \text{new } B) = D_K(B, A \operatorname{rem} B) = D_K(A, B). Also deg⁡(new B)=deg⁡(Arem⁡B)<deg⁡B=deg⁡(new A)\deg(\text{new } B) = \deg(A \operatorname{rem} B) < \deg B = \deg(\text{new } A), which gives part 1.

Termination. Each pass that does not return makes deg⁡B\deg B strictly smaller, and deg⁡B≥1\deg B \ge 1 in every pass after the first that continues, since line L8 returns when deg⁡R=0\deg R = 0. So the loop returns after at most deg⁡g+1\deg g + 1 passes.

The output. Let G=gcd⁡(f,g)G = \gcd(f, g) in R[x]R[x], and let c=gcd⁡(cont⁡f,cont⁡g)c = \gcd(\operatorname{cont} f, \operatorname{cont} g). We use two facts that follow from Gauss's lemma, which states that a product of primitive polynomials is primitive.

(a) If p,a∈R[x]p, a \in R[x], pp is primitive and pp divides aa in K[x]K[x], then pp divides aa in R[x]R[x]. Write a=p qa = p\, q with q∈K[x]q \in K[x], and q=λq0q = \lambda q_0 with λ∈K\lambda \in K and q0∈R[x]q_0 \in R[x] primitive. Then pq0p q_0 is primitive, and a=λ pq0a = \lambda\, p q_0, so λ=cont⁡(a)\lambda = \operatorname{cont}(a) up to a unit, which lies in RR. Hence q∈R[x]q \in R[x].

(b) If PP is primitive and PP is a gcd of ff and gg in K[x]K[x], then cPc P is a gcd of ff and gg in R[x]R[x]. By (a), PP divides pp⁡(f)\operatorname{pp}(f) and pp⁡(g)\operatorname{pp}(g) in R[x]R[x], so cPc P divides ff and gg. If d∈R[x]d \in R[x] divides ff and gg, then cont⁡(d)\operatorname{cont}(d) divides cont⁡f\operatorname{cont} f and cont⁡g\operatorname{cont} g, by Gauss's lemma applied to f=d⋅(f/d)f = d \cdot (f / d), so it divides cc. And pp⁡(d)\operatorname{pp}(d) divides ff and gg in K[x]K[x], so it divides PP in K[x]K[x], and by (a) in R[x]R[x]. Hence d=cont⁡(d)pp⁡(d)d = \operatorname{cont}(d) \operatorname{pp}(d) divides cPc P.

Line L7. R=0R = 0, so by Lemma 1, Arem⁡B=0A \operatorname{rem} B = 0 and BB divides AA in K[x]K[x]. Then DK(A,B)D_K(A, B) is the set of divisors of BB, and by the invariant BB is a gcd of ff and gg in K[x]K[x]. So is its primitive part P=pp⁡(B)P = \operatorname{pp}(B), normalized, and by (b) the output cPc P is GG.

Line L8. RR is a nonzero constant, so Arem⁡BA \operatorname{rem} B is a nonzero constant, and DK(B,Arem⁡B)D_K(B, A \operatorname{rem} B) contains only constants. As above, DK(f,g)D_K(f, g) is the set of nonzero constants, so 11 is a gcd in K[x]K[x], and by (b) with P=1P = 1 the output cc is GG. ■\blacksquare

Back to Subresultant GCD algorithm