The Horowitz-Ostrogradsky system has exactly one solution full
This proof shows: correctness, termination.
Let K be a field of characteristic 0 and A,D∈K[x] with D=0, d=degD≥1 and degA<d. Write D=c∏i=1rpiei with c∈K×, distinct monic irreducible pi and ei≥1.
Fact 1. gcd(D,D′)=∏ipiei−1. Hence D−=∏ipiei−1 and D∗=D/D−=c∏ipi, which is square-free.
Proof. Fix i and write D=pieiR with pi∤R. Then D′=piei−1(eipi′R+piR′), so piei−1∣D′. The factor eipi′R is not divisible by pi: ei=0 in characteristic 0; pi′=0 has degree less than degpi, so pi∤pi′; and pi∤R. Since pi is prime, pi∤eipi′R+piR′, so piei∤D′. As every irreducible factor of gcd(D,D′) divides D, the gcd is ∏ipiei−1. □
Fact 2. E=D∗(D−)′/D− is a polynomial of degree less than m=degD∗.
Proof. By the product rule, (D−)′=∑i(ei−1)piei−2pi′∏j=ipjej−1, where terms with ei=1 vanish. Multiplying the i-th term by D∗=c∏jpj gives c(ei−1)pi′∏j=ipj⋅piei−1∏j=ipjej−1, a multiple of D−. So D−∣D∗(D−)′. If (D−)′=0, degE=m+(n−1)−n=m−1, where n=degD−. □
Fact 3. Let P,Q∈K[x] with Q=0, gcd(P,Q)=1, and let p be irreducible with pk∥Q, k≥1. Then in lowest terms the denominator of (P/Q)′ is divisible by pk+1.
Proof. (P/Q)′=(P′Q−PQ′)/Q2. Write Q=pkR with p∤R. Then P′Q−PQ′=pk−1N with N=P′pR−P(kp′R+pR′), and N≡−kPp′R(modp). Here p∤P because gcd(P,Q)=1, and p∤kp′R as in Fact 1. So p∤N, and pk−1∥P′Q−PQ′, while p2k∥Q2. After cancelling, p2k−(k−1)=pk+1 remains in the denominator. □
Lemma (equivalence). For B,C∈K[x], DA=(D−B)′+D∗C holds if and only if A=B′D∗−BE+CD−.
Proof. Multiply by D=D−D∗: D⋅(B/D−)′=D−D∗(B′D−−B(D−)′)/(D−)2=B′D∗−BE, and D⋅C/D∗=CD−. Multiplication by D=0 is invertible in K(x). □
Theorem. The linear map Φ(B,C)=B′D∗−BE+CD− from V={(B,C):degB<n,degC<m} to W={P:degP<d} is a bijection. Hence the system of line L5 has exactly one solution.
Proof. Φ maps into W: deg(B′D∗)≤(n−2)+m, deg(BE)≤(n−1)+(m−1) by Fact 2, and deg(CD−)≤(m−1)+n, all less than d=n+m. Both V and W have dimension d over K. So it suffices to show Φ is injective.
Suppose Φ(B,C)=0. By the lemma with A=0, (B/D−)′=−C/D∗. Write B/D−=P/Q in lowest terms with Q monic. If degQ≥1, pick an irreducible p with pk∥Q, k≥1. By Fact 3, pk+1, and so p2, divides the reduced denominator of (P/Q)′. But the reduced denominator of −C/D∗ divides D∗, which is square-free by Fact 1, so p2 does not divide it. This is a contradiction, so Q=1 and B/D− is a polynomial. Since degB<degD−, this forces B=0. Then CD−=0, so C=0. ■
Correctness of the algorithm. Lines L1 and L2 compute D− and D∗ (Fact 1). Line L5 writes the identity of the lemma coefficient by coefficient for x0,…,xd−1, which is the equation Φ(B,C)=A in W, because A∈W. By the theorem the matrix is nonsingular, so Gaussian elimination at line L6 finds a pivot in every column and returns the unique solution. By the lemma, the returned B and C satisfy the output specification, and D∗ is square-free by Fact 1.
Termination. The Euclidean algorithm, the exact division and Gaussian elimination on a d×d system each perform finitely many steps. ■