The Cauchy index of a rational function #
The Cauchy index of a rational function f on (a, b) counts the jumps of f from -∞ to +∞
minus those from +∞ to -∞ at the poles of f in (a, b). It is the central quantity in
Sturm's theorem and the Sturm–Tarski theorem (via Tarski queries), and also underlies the
Routh–Hurwitz stability criterion and the counting of complex roots through winding numbers.
Main definitions #
RatFunc.jump f x: the jump offatx.RatFunc.cauchyIndex f a b: the Cauchy index offon(a, b), the sum of the jumps offat its poles in(a, b).
Main results #
RatFunc.jump_div: the jump ofq / pcomputed frompandq, for any representation of the rational function as a quotient of polynomials.RatFunc.jump_eq_zero_of_eval_denom_ne_zero,RatFunc.jump_algebraMap: there is no jump away from the poles; in particular polynomials have no jumps.RatFunc.jump_add_algebraMap,RatFunc.cauchyIndex_add_algebraMap: adding a polynomial does not change the jump or the Cauchy index. In particularq / pcan be replaced by(q % p) / p(RatFunc.cauchyIndex_div_mod).RatFunc.jump_algebraMap_mul: multiplying by a polynomial that does not vanish atxmultiplies the jump atxby the sign of that polynomial atx.RatFunc.jump_derivative_mul_div: at a rootxofp, the jump ofp' * q / pissign (q.eval x). This links the Cauchy index to the sign ofqat the roots ofp, as needed for the Sturm–Tarski theorem.
Implementation notes #
The jump is defined algebraically, through the reduced representation f = f.num / f.denom. Since
f.num and f.denom are coprime, f has a pole of odd order at x exactly when
rootMultiplicity x f.denom is odd, and only poles of odd order make f change sign. At such a
pole the direction of the jump is the sign of f.num * f.denom (which is equal to the sign of f)
immediately to the right of x, that is signRight x (f.num * f.denom). For an arbitrary
representation f = q / p, RatFunc.jump_div recovers the formula of [Li14]: the jump is
signRight x (p * q) when rootMultiplicity x p - rootMultiplicity x q is odd (with truncated
subtraction), and 0 otherwise.
References #
The jump of a rational function at a point #
The jump of the rational function f at x: 1 if it goes from -∞ to +∞, -1 if it
goes from +∞ to -∞, and 0 otherwise (in particular when f has no pole at x).
Equations
Instances For
There is no jump at a point that is not a pole.
The jump of q / p at x, computed from any representation of the rational function as a
quotient of polynomials.
Note that the statement uses truncated ℕ subtraction since if x is a root of both p and q
but with greater multiplicity in the numerator q, then there is no jump.
Adding a polynomial does not change the jump.
Multiplying by a polynomial g that does not vanish at x multiplies the jump at x by the
sign of g at x.
Scaling by a constant c scales the jump by sign c.
At a root x of p, the jump of derivative p * q / p is the sign of q at x.
The Cauchy index #
The Cauchy index of the rational function f on the open interval (a, b): the sum of the
jumps of f at its poles in (a, b). The roots of f.denom are exactly the poles of f.
Instances For
The Cauchy index can be computed as a sum over the roots of any nonzero multiple of the denominator.
The Cauchy index of q / p is the sum of its jumps at the roots of p.
The Cauchy index on an empty interval is zero.
Adding a polynomial does not change the Cauchy index.
The Cauchy index of q / p only depends on q modulo p.
Scaling by a constant c scales the Cauchy index by sign c.