The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V15. Real analysis in one variable

Mathlib.Analysis.Polynomial.CauchyIndex

22 declarations. Mathlib docs · Source

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 of f at x.
  • RatFunc.cauchyIndex f a b: the Cauchy index of f on (a, b), the sum of the jumps of f at its poles in (a, b).

Main results

  • RatFunc.jump_div: the jump of q / p computed from p and q, 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 particular q / p can be replaced by (q % p) / p (RatFunc.cauchyIndex_div_mod).
  • RatFunc.jump_algebraMap_mul: multiplying by a polynomial that does not vanish at x multiplies the jump at x by the sign of that polynomial at x.
  • RatFunc.jump_derivative_mul_div: at a root x of p, the jump of p' * q / p is sign (q.eval x). This links the Cauchy index to the sign of q at the roots of p, 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 [li2014]: the jump is signRight x (p * q) when rootMultiplicity x p - rootMultiplicity x q is odd (with truncated subtraction), and 0 otherwise.

References

  • [S. Basu, R. Pollack, M.-F. Roy, Algorithms in Real Algebraic Geometry][basu2006]
  • [W. Li, The Sturm–Tarski Theorem, Archive of Formal Proofs][li2014]

The jump of a rational function at a point

The Cauchy index

def RatFunc.jump E1 #

{K : Type u_1} → [inst : Field K] → [LinearOrder K] → RatFunc K → K → ℤ

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).

theorem RatFunc.jump_eq_zero_of_eval_denom_ne_zero E3 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] {f : RatFunc K} {x : K},
  Polynomial.eval x f.denom ≠ 0 → f.jump x = 0

There is no jump at a point that is not a pole.

theorem RatFunc.jump_algebraMap E3 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] (p : Polynomial K) (x : K),
  ((algebraMap (Polynomial K) (RatFunc K)) p).jump x = 0

theorem RatFunc.jump_zero E0 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] (x : K), RatFunc.jump 0 x = 0

theorem RatFunc.jump_div E3 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] (p q : Polynomial K) (x : K),
  ((algebraMap (Polynomial K) (RatFunc K)) q / (algebraMap (Polynomial K) (RatFunc K)) p).jump x =
    if Odd (Polynomial.rootMultiplicity x p - Polynomial.rootMultiplicity x q) then ↑(Polynomial.signRight x (p * q))
    else 0

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.

theorem RatFunc.jump_add_algebraMap E3 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] (f : RatFunc K) (g : Polynomial K)
  (x : K), (f + (algebraMap (Polynomial K) (RatFunc K)) g).jump x = f.jump x

Adding a polynomial does not change the jump.

theorem RatFunc.jump_algebraMap_add E0 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] (f : RatFunc K) (g : Polynomial K)
  (x : K), ((algebraMap (Polynomial K) (RatFunc K)) g + f).jump x = f.jump x

theorem RatFunc.jump_algebraMap_mul E3 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] {g : Polynomial K} {x : K},
  Polynomial.eval x g ≠ 0 →
    ∀ (f : RatFunc K),
      ((algebraMap (Polynomial K) (RatFunc K)) g * f).jump x = ↑(SignType.sign (Polynomial.eval x g)) * f.jump x

Multiplying by a polynomial g that does not vanish at x multiplies the jump at x by the sign of g at x.

theorem RatFunc.jump_smul E1 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] (c : K) (f : RatFunc K) (x : K),
  (c • f).jump x = ↑(SignType.sign c) * f.jump x

Scaling by a constant c scales the jump by sign c.

theorem RatFunc.jump_neg E0 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] (f : RatFunc K) (x : K),
  (-f).jump x = -f.jump x

theorem RatFunc.jump_derivative_mul_div E3 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] {p : Polynomial K} {x : K},
  p ≠ 0 →
    Polynomial.eval x p = 0 →
      ∀ (q : Polynomial K),
        ((algebraMap (Polynomial K) (RatFunc K)) (Polynomial.derivative p * q) /
                (algebraMap (Polynomial K) (RatFunc K)) p).jump
            x =
          ↑(SignType.sign (Polynomial.eval x q))

At a root x of p, the jump of derivative p * q / p is the sign of q at x.

def RatFunc.cauchyIndex E1 #

{K : Type u_1} → [inst : Field K] → [LinearOrder K] → RatFunc K → K → K → ℤ

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.

theorem RatFunc.cauchyIndex_eq_sum E1 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] {f : RatFunc K} {p : Polynomial K} {a b : K},
  p ≠ 0 → f.denom ∣ p → f.cauchyIndex a b = ∑ x ∈ p.roots.toFinset with x ∈ Set.Ioo a b, f.jump x

The Cauchy index can be computed as a sum over the roots of any nonzero multiple of the denominator.

theorem RatFunc.cauchyIndex_div E1 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] (p q : Polynomial K) (a b : K),
  ((algebraMap (Polynomial K) (RatFunc K)) q / (algebraMap (Polynomial K) (RatFunc K)) p).cauchyIndex a b =
    ∑ x ∈ p.roots.toFinset with x ∈ Set.Ioo a b,
      ((algebraMap (Polynomial K) (RatFunc K)) q / (algebraMap (Polynomial K) (RatFunc K)) p).jump x

The Cauchy index of q / p is the sum of its jumps at the roots of p.

theorem RatFunc.cauchyIndex_algebraMap E0 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] (p : Polynomial K) (a b : K),
  ((algebraMap (Polynomial K) (RatFunc K)) p).cauchyIndex a b = 0

theorem RatFunc.cauchyIndex_zero E0 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] (a b : K), RatFunc.cauchyIndex 0 a b = 0

theorem RatFunc.cauchyIndex_of_le E1 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] (f : RatFunc K) {a b : K}, b ≤ a → f.cauchyIndex a b = 0

The Cauchy index on an empty interval is zero.

theorem RatFunc.cauchyIndex_add_algebraMap E3 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] (f : RatFunc K) (g : Polynomial K)
  (a b : K), (f + (algebraMap (Polynomial K) (RatFunc K)) g).cauchyIndex a b = f.cauchyIndex a b

Adding a polynomial does not change the Cauchy index.

theorem RatFunc.cauchyIndex_algebraMap_add E0 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] (f : RatFunc K) (g : Polynomial K)
  (a b : K), ((algebraMap (Polynomial K) (RatFunc K)) g + f).cauchyIndex a b = f.cauchyIndex a b

theorem RatFunc.cauchyIndex_div_mod E3 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] (p q : Polynomial K) (a b : K),
  ((algebraMap (Polynomial K) (RatFunc K)) q / (algebraMap (Polynomial K) (RatFunc K)) p).cauchyIndex a b =
    ((algebraMap (Polynomial K) (RatFunc K)) (q % p) / (algebraMap (Polynomial K) (RatFunc K)) p).cauchyIndex a b

The Cauchy index of q / p only depends on q modulo p.

theorem RatFunc.cauchyIndex_smul E1 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] (c : K) (f : RatFunc K) (a b : K),
  (c • f).cauchyIndex a b = ↑(SignType.sign c) * f.cauchyIndex a b

Scaling by a constant c scales the Cauchy index by sign c.

theorem RatFunc.cauchyIndex_neg E0 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] (f : RatFunc K) (a b : K),
  (-f).cauchyIndex a b = -f.cauchyIndex a b