Polynomial sign counts and Tarski queries #
Finset.signCount counts the points of a finite set realizing a given polynomial
sign condition. Finset.signSum sums a polynomial's signs on that set.
Polynomial.tarskiQuery p q specializes the sum to the distinct roots of p.
For nonzero p its cardinality characterization counts the actual zeros of p;
for p = 0 the value is zero and does not describe the infinite zero set.
The definitions and their basic API are independent of matrix inversion.
References #
S. Basu, R. Pollack, and M.-F. Roy, Algorithms in Real Algebraic Geometry, second edition, Chapter 10, for sign conditions and Tarski queries.
The number of points realizing a specified polynomial sign condition.
Equations
- Z.signCount Q σ = Function.occCount (fun (x : ↥Z) (j : J) => SignType.sign (Polynomial.eval (↑x) (Q j))) σ
Instances For
Polynomial sign counts are multiplicities in the finite family of pointwise signs.
Sign counts are cardinalities of the realizing subset of the original finite set.
The sign conditions partition the original finite set of points.
A positive sign count is equivalent to realization at a point of the finite set.
The integer sum of signs at a specified finite set of points.
Equations
- Z.signSum p = ∑ x : ↥Z, ↑(SignType.sign (Polynomial.eval (↑x) p))
Instances For
Sign sums are integer sums of pointwise polynomial signs.
Sign sums expressed directly over the original finite set.
A finite sign sum is the number of positive evaluations minus the number of negative ones.
Sum of the signs of q at the distinct roots of p, with value zero when p = 0.
Equations
- p.tarskiQuery q = p.roots.toFinset.signSum q
Instances For
The Tarski query expressed as a sum over distinct polynomial roots.
The number of distinct roots of p where q is positive minus the number
where q is negative.
Counts at the roots of a nonzero polynomial count exactly its realizing zeros.
A Tarski query counts the zeros of p where q is positive, minus those
where q is negative.
A positive count at the roots of a nonzero polynomial is an actual realizable condition.