In this section we give a scheme for quantifier elimination algorithms based on virtual substitution. The scheme is presented as algorithm vs-scheme, which is parameterized by three precisely specified sub-algorithms. An instantiation of the scheme is obtained by providing concrete sub-algorithms meeting the specifi- cations and “plugging” them into their places in the scheme. Each instantiation yields a quantifier elimination algorithm using virtual substitution. The scheme is indeed based on the notions of parametric root descriptions, candidate solu- tions, and virtual substitution introduced in previous sections. Our main aim here is to prove the correctness of the scheme as a whole, i.e., any algorithm obtained by instantiation of the scheme is correct and its complexity is given as a function of complexities of the provided sub-algorithms.
We begin our exposition by specifying the three mentioned sub-algorithms: 1. Algorithm at-cs(f % 0, x):
Input: an atomic formula f % 0, where f ∈ Z[u][x] and the relation % is one of {=, 6=, <, ≤, ≥, >}.
Output: a set of candidate solutions for f % 0. 2. Algorithm guard (f, S), x:
Input: a parametric root description (f, S), where f ∈ Z[u][x] and S is a finite set {(t1, r1), . . . , (tk, rk)} of root specifications of f .
Output: a quantifier-free guard of (f, S). 3. Algorithm vs-prd-at g % 0, (f, S), x:
Input: an atomic formula g % 0 and a parametric root description (f, S) such that g, f ∈ Z[u][x], % ∈ {=, 6=, <, ≤, ≥, >}, and deg g < deg f . Output: (g % 0)[x // (f, S)], i.e., a quantifier-free formula in the parameters u meeting our specification of virtual substitution.
Note that the specification of algorithm vs-prd-at was also given in Section 2.3. We repeat the definition here for completeness; all results of Section 2.3 remain valid. In the rest of this section we assume that the mentioned algorithms exist and regard them as black-boxes.
We continue with a description of algorithm vs-at. This algorithm will be called by our scheme to carry out a virtual substitution of a single test point into a single atomic formula.
Algorithm vs-at(g % 0, e, x).
Input: an atomic formula g % 0, where g ∈ Z[u][x] and % ∈ {=, 6=, <, ≤, ≥, >}, test point e is one of the following:
(a) parametric root description (f, S), where f ∈ Z[u][x],
(b) parametric root description plus/minus a positive infinitesimal (f, S) ± ε, where f ∈ Z[u][x],
(c) nonstandard symbol ±∞.
Output: a quantifier-free Tarski formula ψ equivalent to (g % 0)[x // e]. 1. If e is (f, S), then
1.1. h := pseudo-sgn-rem(g, f, x) 1.2. Return vs-prd-at h % 0, (f, S), x. 2. If e is (f, S) + ι, where ι is ±ε, then
2.1. φ := expand-eps-at(g % 0, ι, x)
2.2. Replace each atomic formula h % 0 occurring in φ with quantifier- free formula vs-at(h % 0, (f, S), x), and return the resulting formula obtained this way.
3. If e is ±∞, then
3.1. Return vs-inf-at(g % 0, e, x).
The correctness of algorithm vs-at is a straightforward consequence of the results of Section 2.3:
Lemma 36. Algorithm vs-at meets its specification.
Proof. We distinguish three cases depending on the type of test point e:
1. If e is (f, S), then the correctness of vs-at follows from Proposition 27. 2. If e is (f, S) + ι, where ι is ±ε, then the correctness of vs-at follows from
Proposition 32.
3. If e is ±∞, then the correctness of vs-at follows from Proposition 29. Now we are ready to present our algorithm scheme. The scheme proceeds as follows: Using algorithm at-cs it first computes a set of candidate solutions c for an input Tarski formula ϕ. Afterwards, this set of candidate solutions is converted into a set of test points by selecting appropriate parametric root descriptions from c, adjusting them by adding a positive infinitesimal, if needed.
Finally, each test point obtained this way is substituted into the input formula
ϕ by applying algorithm vs-at to each atomic formula of ϕ.
Algorithm vs-scheme(ϕ, x).
Input: a quantifier-free Tarski formula ϕ(u, x), which is an ∧-∨-combination of atomic formulas, a variable x.
Output: a quantifier-free Tarski formula ψ(u) equivalent to ∃x(ϕ). 1. Extract from ϕ the set A of all atomic formulas containing x. 2. c := ∅
3. For each atomic formula f % 0 in A do 3.1. c := c ∪ at-cs(f % 0, x)
4. E := {−∞}
5. For each candidate solution (f, S, τ ) ∈ c do 5.1. If τ is “IP” or “WLB,” then add (f, S) to E. 5.2. If τ is “EP” or “SLB,” then add (f, S) + ε to E. 6. ψ := false
7. For each test point e ∈ E do 7.1. If e is (f, S), then
7.1.1. Copy ϕ to ϕ0. 7.1.2. γ := guard (f, S), x
7.1.3. Compute ϕ0[x // (f, S)] by replacing each atom g % 0 occurring in ϕ0 with quantifier-free formula vs-at(g % 0, (f, S), x).
7.1.4. ψ := ψ ∨ γ ∧ ϕ0[x // (f, S)] 7.2. If e is (f, S) + ε, then
7.2.1. Copy ϕ to ϕ0. 7.2.2. γ := guard (f, S), x
7.2.3. Compute ϕ0[x // (f, S) + ε] by replacing each atom g % 0 occur- ring in ϕ0with quantifier-free formula vs-at g % 0, (f, S) + ε, x. 7.2.4. ψ := ψ ∨ γ ∧ ϕ0[x // (f, S) + ε]
7.3. If e is −∞, then 7.3.1. Copy ϕ to ϕ0.
7.3.2. Compute ϕ0[x // −∞] by replacing each atom g % 0 occurring in
ϕ0 with quantifier-free formula vs-at(g % 0, −∞, x).
7.3.3. ψ := ψ ∨ ϕ0[x // −∞] 8. Return ψ.
Proof. We have to prove that for any parameter values a ∈ Rm the following
equivalence holds: R |= ψ(a) if and only if there exists β ∈ R such that R |=
ϕ(a, β), i.e., the satisfying set Φ(ϕ, a) is nonempty. Let therefore a ∈ Rm
be arbitrary parameter values. We show that a satisfies ψ if and only if the satisfying set Φ(ϕ, a) is nonempty.
Assume first that a satisfies ψ. Observe that ψ returned by vs-scheme is a quantifier-free disjunction obtained in step 7 by consecutively substituting all the test points from E into ϕ. There are three cases to consider:
1. a satisfies γ ∧ ϕ[x // (f, S)] for some test point (f, S) ∈ E: Since vs-at meets its specification, and a satisfies a guard γ of (f, S), we use Theo- rem 25 to deduce that R |= ϕ(a, (f, S)hai), i.e., Φ(ϕ, a) is nonempty. 2. a satisfies γ ∧ ϕ[x // (f, S) + ε] for some test point (f, S) + ε ∈ E: Similarly
to the previous case, since vs-at meets its specification, and a satisfies a guard γ of (f, S), we use Theorem 35 (i) to deduce that there exists a positive η ∈ R such that R |= ϕ(a, (f, S)hai + η0) for any positive η0 ∈ R smaller than η, i.e., Φ(ϕ, a) is obviously nonempty.
3. a satisfies ϕ[x // −∞]: Since vs-at meets its specification, we use Theo- rem 35 (ii) to deduce that there exists η ∈ R such that R |= ϕ(a, η0) for any η0 ∈ R smaller than η, i.e., Φ(ϕ, a) is unbounded from below and in particular nonempty.
Now we prove the converse implication. Assume that the satisfying set Φ(ϕ, a) is nonempty. Since at-cs returns a set of candidate solutions for an atomic formula, and ϕ is an ∧-∨-combination of atomic formulas, Proposition 15 ensures that the set c computed by algorithm vs-scheme in step 3 is a set of candidate solutions for ϕ. We assume that Φ(ϕ, a) 6= ∅, so Theorem 19 (i) ensures that there exists ξ ∈ L such that R∗ |= ϕ(a, ξ). According to the definition of the set L, now there are three cases to consider:
1. There exists ξ ∈ L such that ξ = (f, S, τ )hai for some (f, S, τ ) ∈ c, where
τ is “IP” or “WLB.” In this case we have R∗ |= ϕ(a, ξ) and in particular R |= ϕ(a, ξ), because ξ ∈ R and R∗ is an extension field of R. Since
ξ = (f, S, τ )hai, a satisfies a guard γ of (f, S). Theorem 25 then guarantees
that R |= ϕ[x // (f, S)](a), so we obtain that R |= (γ ∧ ϕ[x // (f, S)])(a). Now observe that (f, S) ∈ E, because τ is “IP” or “WLB.” Thus, (f, S) was substituted into ϕ in step 7.1. This implies that R |= ψ(a), because
ψ is a disjunction containing γ ∧ ϕ[x // (f, S)] as a disjunct.
2. There exists ξ ∈ L such that ξ = (f, S, τ )hai + ε for some (f, S, τ ) ∈ c, where τ is “EP” or “SLB.” In this case we have R∗|= ϕ(a, ξ+ε). Lemma 16 ensures that there exists a positive η ∈ R such that R |= ϕ(a, ξ+η0) for any positive η0∈ R smaller than η. Since ξ = (f, S, τ )hai, a satisfies a guard γ of (f, S). Theorem 35 (i) then implies that R |= ϕ[x // (f, S) + ε](a), so we obtain that R |= (γ∧ϕ[x // (f, S) + ε])(a). Now observe that (f, S)+ε ∈ E, because τ is “EP” or “SLB.” Thus, (f, S)+ε was substituted into the input formula ϕ in step 7.2. This implies that R |= ψ(a), because ψ contains
γ ∧ ϕ[x // (f, S) + ε] as a disjunct.
3. We have ξ ∈ L for ξ = −∞. In this case we have R∗ |= ϕ(a, −∞). Lemma 17 ensures that there exists η ∈ R such that R |= ϕ(a, η0) for
any η0 ∈ R strictly smaller than η. Theorem 35 (ii) then implies that R |= ϕ[x // −∞]. Since −∞ ∈ E, we know that −∞ was substituted into
ϕ in step 7.3 of the algorithm. Again, this implies that R |= ψ(a), because
the formula ψ contains γ ∧ ϕ[x // −∞] as a disjunct.
We have shown that in each of the three cases a satisfies the output formula ψ, so the proof of the theorem is finished.
The crucial idea behind the proof of Theorem 37 is the following: Since c is a set of candidate solutions for ϕ, the computed test points together with −∞ are guaranteed to intersect a nonempty satisfying set Φ(ϕ, a) for any parameter values a ∈ Rm. To this end observe that the set E of test points obtained in
step 5 is generated only from those candidate solutions that are necessary to use Theorem 19 (i). If we wanted to use part (ii) of Theorem 19, we would have to remove candidate solutions with tag “EP” and add candidate solutions with tag “WLB” in step 5.2 of the algorithm. This would make sense when there were many excluded points, but only a few weak lower bounds candidate solutions.
Observe that the set E of test points obtained in step 5 is an elimination set
for ϕ and x in the following sense: Substituting all test points from E into ϕ
using virtual substitution yields a quantifier-free equivalent of ∃x(ϕ). Algorithm vs-scheme adds to set E all parametric root descriptions that possibly represent a lower bound of a satisfying set. It is straightforward to adjust the algorithm and its proof to use those parametric root descriptions that possibly represent an upper bound of a satisfying set instead—leading to a different elimination set for ϕ and x. Moreover, it is also correct to first analyze the set of candidate solutions c, and then decide whether the upper or the lower bounds parametric root descriptions should be used. This corresponds to the idea of bound selection introduced in [85].
A careful inspection of algorithm vs-scheme reveals that the algorithms guard and vs-prd-at need to handle only such parametric root descriptions (f, S) that are possibly produced as candidate solutions by vs-at. This in particular means that for a fixed degree d, vs-prd-at need not be specified for all possible sets S of root specifications of a polynomial f with deg f ≤ d, but only for such root specification sets that represent a candidate solution returned by vs-at. We will extensively take advantage of this observation when instantiating the scheme in Section 2.5.
Later in Section 2.6 we will show that all existing quantifier elimination algorithms based on virtual substitution can be obtained by an appropriate instantiation of our scheme.