Proofs: Vincent-Collins-Akritas algorithm
These are the human proofs of Vincent-Collins-Akritas algorithm, at full length.
The Vincent-Collins-Akritas method isolates every real root exactly once full
This proof shows: correctness.
Let be square-free with and . For a polynomial of degree at most and real write , and write for the number of sign changes in a coefficient list, zeros ignored. The algorithm is the one in the main pseudocode, lines L1 to L12.
Notation for the work list. For integers and put , , and , an open interval with midpoint .
Claim 1 (the bound). Every real root of satisfies . Let , so by line L1. If , then , and square-free forces and . If and , then
so . Hence , and all real roots lie in .
Claim 2 (the invariant of an entry). Every entry that is pushed onto the stack satisfies
Line L2 sets , which is (J) for with . Suppose satisfies (J), and let and . Line L9 gives
Since , and , both children satisfy (J), with the constant . In particular each has degree exactly , since its leading coefficient is .
Claim 3 (the test). Let satisfy (J) and let be the number of roots of in . Then the number of line L6 satisfies and is even. In particular implies , and implies .
With and ,
The map is a bijection from onto , and for , so the positive roots of , with multiplicity, correspond to the roots of in . These roots are simple because is square-free, so there are of them. The factor does not change the signs. Descartes' rule of signs says that is at least the number of positive roots counted with multiplicity and differs from it by an even number. This is the claim.
Claim 4 (the midpoint). For with (J), . So line L10 reports if and only if it is a root of .
Claim 5 (the partition invariant). At the start of each pass of the loop in line L4, the following hold.
- (P1) The open intervals of the stack entries and the items of
outare pairwise disjoint. - (P2) Each item of
outis either an open interval that contains exactly one root of , or a single point that is a root of . - (P3) Each real root of lies in exactly one stack interval or in exactly one item of
out, and not in both.
Initially the stack holds and out is empty. (P1) and (P2) hold trivially, and (P3) holds by claim 1. Suppose the invariant holds and line L5 pops , with interval and midpoint .
- If , then holds no root by claim 3, so dropping it keeps (P3); (P1) and (P2) are unchanged.
- If , then holds exactly one root by claim 3. Moving from the stack to
outkeeps (P1), adds an item that satisfies (P2), and moves that root from a stack interval to an item ofout, which keeps (P3). - If , then , a disjoint union. Line L10 adds to
outexactly when is a root, by claim 4, and line L11 pushes the two halves. The new items are pairwise disjoint subsets of , so (P1) holds, (P2) holds for , and each root that was in is now in exactly one of the three parts, either reported or on the stack. If is not a root, dropping it loses nothing. So (P3) holds.
Claim 6 (termination). If , then has degree at most , so for every entry and the root entry is never split. Let and let be the least distance between two distinct complex roots of , which exists because is square-free. An entry at depth has interval length . If , then part 3 of Vincent's theorem gives , so by claim 3 and the entry is not split. So no entry has depth greater than . Each pass of the loop pops one entry and pushes at most two entries of depth one more, and each pair with is pushed at most once, since is pushed only by its parent . So at most entries are ever pushed, and the loop ends.
Conclusion. When the loop ends, the stack is empty. By (P3) every real root of lies in exactly one item of out, by (P2) every item holds exactly one root (an open interval) or is a root (a point), and by (P1) the items are disjoint. Line L12 only sorts the list. Hence the output is a list of disjoint isolating intervals and exact roots, one for each real root of .