Documentation

Mathlib.RingTheory.Polynomial.Resultant.Basic

Resultant of two polynomials #

This file contains basic facts about resultant of two polynomials over commutative rings.

Main definitions #

TODO #

def Polynomial.sylvester {R : Type u_1} [Semiring R] (f g : Polynomial R) (m n : ) :
Matrix (Fin (n + m)) (Fin (n + m)) R

The Sylvester matrix of two polynomials f and g of degrees m and n respectively is a (n+m) × (n+m) matrix with the coefficients of f and g arranged in a specific way. Here, m and n are free variables, not necessarily equal to the actual degrees of the polynomials f and g.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    @[simp]
    theorem Polynomial.sylvester_C_right {R : Type u_1} [Semiring R] (f : Polynomial R) (m : ) (a : R) :
    f.sylvester (C a) m 0 = Matrix.diagonal fun (x : Fin (0 + m)) => a
    noncomputable def Polynomial.sylvesterDeriv {R : Type u_1} [Semiring R] (f : Polynomial R) :

    The Sylvester matrix for f and f.derivative, modified by dividing the bottom row by the leading coefficient of f. Important because its determinant is (up to a sign) the discriminant of f.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      We can get the usual Sylvester matrix of f and f.derivative back from the modified one by multiplying the last row by the leading coefficient of f.

      def Polynomial.resultant {R : Type u_1} [CommRing R] (f g : Polynomial R) (m : := f.natDegree) (n : := g.natDegree) :
      R

      The resultant of two polynomials f and g is the determinant of the Sylvester matrix of f and g. The size arguments m and n are implemented as optParam, meaning that the default values are f.natDegree and g.natDegree respectively, but they can also be specified to be other values.

      Equations
      Instances For
        @[simp]
        theorem Polynomial.resultant_C_zero_right {R : Type u_1} [CommRing R] (f : Polynomial R) (m : ) (a : R) :
        f.resultant (C a) m 0 = a ^ m

        For polynomial f and constant a, Res(f, a) = a ^ m.

        theorem Polynomial.resultant_C_right {R : Type u_1} [CommRing R] (f : Polynomial R) (m : ) (a : R) :
        f.resultant (C a) m = a ^ m

        For polynomial f and constant a, Res(f, a) = a ^ m.

        noncomputable def Polynomial.disc {R : Type u_1} [CommRing R] (f : Polynomial R) :
        R

        The discriminant of a polynomial, defined as the determinant of f.sylvesterDeriv modified by a sign. The sign is chosen so polynomials over with all roots real have non-negative discriminant.

        Equations
        Instances For
          @[simp]
          theorem Polynomial.disc_C {R : Type u_1} [CommRing R] (r : R) :
          (C r).disc = 1

          The discriminant of a constant polynomial is 1.

          theorem Polynomial.disc_of_degree_eq_one {R : Type u_1} [CommRing R] {f : Polynomial R} (hf : f.degree = 1) :
          f.disc = 1

          The discriminant of a linear polynomial is 1.

          theorem Polynomial.disc_of_degree_eq_two {R : Type u_1} [CommRing R] {f : Polynomial R} (hf : f.degree = 2) :
          f.disc = f.coeff 1 ^ 2 - 4 * f.coeff 0 * f.coeff 2

          Standard formula for the discriminant of a quadratic polynomial.

          theorem Polynomial.resultant_deriv {R : Type u_1} [CommRing R] {f : Polynomial R} (hf : 0 < f.degree) :

          Relation between the resultant and the discriminant.

          (Note this is actually false when f is a constant polynomial not equal to 1, so the assumption on the degree is genuinely needed.)

          theorem Polynomial.disc_of_degree_eq_three {R : Type u_1} [CommRing R] {f : Polynomial R} (hf : f.degree = 3) :
          f.disc = f.coeff 2 ^ 2 * f.coeff 1 ^ 2 - 4 * f.coeff 3 * f.coeff 1 ^ 3 - 4 * f.coeff 2 ^ 3 * f.coeff 0 - 27 * f.coeff 3 ^ 2 * f.coeff 0 ^ 2 + 18 * f.coeff 3 * f.coeff 2 * f.coeff 1 * f.coeff 0

          Standard formula for the discriminant of a cubic polynomial.