Documentation

Starlib.Data.Polynomial.Bivariate

Starlib-Specific Bivariate Polynomial Extensions #

The core bivariate polynomial definitions and degree/eval/multiplicity theory are provided by CompPoly (CompPoly.ToMathlib.Polynomial.BivariateDegree, BivariateWeightedDegree, BivariateMultiplicity). This file contains only Starlib-specific extensions:

The set of coefficients of a bivariate polynomial.

Instances For

    A bivariate polynomial is non-zero if and only if its coefficient function is non-zero.

    The set of Y-degrees is non-empty.

    theorem Polynomial.Bivariate.natDegree_sum_lt_of_forall_lt {F : Type} [Semiring F] {α : Type} {s : Finset α} {g : αPolynomial F} {deg : } :
    0 < deg(∀ xs, (g x).natDegree < deg)(∑ xs, g x).natDegree < deg
    theorem Polynomial.Bivariate.natDeg_sum_eq_of_unique {F : Type} [Semiring F] {α : Type} {s : Finset α} {f : αPolynomial F} {deg : } (mx : α) (h : mx s) :
    (f mx).natDegree = deg(∀ ys, y mx(f y).natDegree < deg f y = 0)(∑ xs, f x).natDegree = deg
    theorem Polynomial.Bivariate.sup_eq_of_le_of_reach {α β : Type} [SemilatticeSup β] [OrderBot β] {s : Finset α} {f : αβ} (x : α) {y : β} (h : x s) :
    f x = y(∀ xs, f x y)s.sup f = y

    If some element x ∈ s maps to y under f, and every element of s maps to a value less than or equal to y, then the supremum of f over s is exactly y.

    noncomputable def Polynomial.Bivariate.evalSetX {F : Type} [Semiring F] [DecidableEq F] (f : Polynomial (Polynomial F)) (P : Finset F) [Nonempty P] :

    Evaluating a bivariate polynomial in the first variable X on a set of points. This results in a set of univariate polynomials in Y.

    Instances For
      noncomputable def Polynomial.Bivariate.evalSetY {F : Type} [Semiring F] [DecidableEq F] (f : Polynomial (Polynomial F)) (P : Finset F) [Nonempty P] :

      Evaluating a bivariate polynomial in the second variable Y on a set of points resulting in a set of univariate polynomials in X.

      Instances For

        The bivariate quotient polynomial.

        Instances For
          theorem Polynomial.Bivariate.quotient_nezero {F : Type} [Semiring F] {f q : Polynomial (Polynomial F)} (hg : q * f 0) :
          q 0

          The quotient of two non-zero bivariate polynomials is non-zero.

          theorem Polynomial.Bivariate.coeff_ne_zero {F : Type} [Semiring F] {f q : Polynomial (Polynomial F)} (hg : q * f 0) :

          If a non-zero bivariate polynomial f divides a non-zero bivariate polynomial g, then all the coefficients of the quoetient are non-zero.

          Each coefficient's total-degree contribution is bounded by totalDegree when in support.

          theorem Polynomial.Bivariate.exists_max_index_totalDegree {F : Type} [Semiring F] (f : Polynomial (Polynomial F)) (hf : f 0) :
          mmf.support, (f.coeff mm).natDegree + mm = totalDegree f ∀ (n : ), mm < n(f.coeff n).natDegree + n < totalDegree f f.coeff n = 0

          There exists a maximal Y-index achieving totalDegree. Above it, total-degree contributions are strictly smaller or the coefficient vanishes.

          @[simp]
          theorem Polynomial.Bivariate.totalDegree_mul {F : Type} [Semiring F] [IsDomain F] {f g : Polynomial (Polynomial F)} (hf : f 0) (hg : g 0) :

          The total degree of the product of two bivariate polynomials is the sum of their total degrees.

          Definition of a monomial when the bivariate polynomial is considered as a univariate polynomial in Y.

          Instances For
            noncomputable def Polynomial.Bivariate.monomialXY {F : Type} [Semiring F] (n m : ) :

            Definition of the bivariate monomial X^n * Y^m

            Instances For

              The bivariate monomial is well-defined.

              @[simp]
              theorem Polynomial.Bivariate.monomialXY_add {F : Type} [Semiring F] {n m : } {a b : F} :
              (monomialXY n m) (a + b) = (monomialXY n m) a + (monomialXY n m) b

              Adding bivariate monomials works as expected. In particular, (a + b) * X^n * Y^m = a * X^n * Y^m + b * X^n * Y^m.

              theorem Polynomial.Bivariate.monomialXY_mul_monomialXY {F : Type} [Semiring F] {n m p q : } {a b : F} :
              (monomialXY n m) a * (monomialXY p q) b = (monomialXY (n + p) (m + q)) (a * b)

              Multiplying bivariate monomials works as expected. In particular, (a * X^n * Y^m) * (b * X^p * Y^q) = (a * b) * X^(n+p) * Y^(m+q).

              @[simp]
              theorem Polynomial.Bivariate.monomialXY_pow {F : Type} [Semiring F] {n m k : } {a : F} :
              (monomialXY n m) a ^ k = (monomialXY (n * k) (m * k)) (a ^ k)

              Taking a bivariate monomial to a power works as expected. In particular, (a * X^n * Y^m)^k = (a^k) * X^(n * k) * Y^(m * k).

              @[simp]
              theorem Polynomial.Bivariate.smul_monomialXY {F : Type} [Semiring F] {n m : } {a : F} {S : Type u_1} [SMulZeroClass S F] {b : S} :
              (monomialXY n m) (b a) = b (monomialXY n m) a

              Multiplying a bivariate monomial by a scalar works as expected. In particular, b * a * X^n * Y^m = b * (a * X^n * Y^m).

              @[simp]
              theorem Polynomial.Bivariate.monomialXY_eq_zero_iff {F : Type} [Semiring F] {n m : } {a : F} :
              (monomialXY n m) a = 0 a = 0

              A bivariate monimial a * X^n * Y^m is equal to zero if and only if a = 0.

              theorem Polynomial.Bivariate.monomialXY_eq_monomialXY_iff {F : Type} [Semiring F] {n m p q : } {a b : F} :
              (monomialXY n m) a = (monomialXY p q) b n = p m = q a = b a = 0 b = 0

              Two bivariate monomials a * X^n * Y^m and b * X^p * Y^q are equal if and only if a = b n = p and m = q or if both are zero, i.e., a = b = 0.

              @[simp]
              theorem Polynomial.Bivariate.totalDegree_monomialXY {F : Type} [Semiring F] {n m : } {a : F} (ha : a 0) :
              totalDegree ((monomialXY n m) a) = n + m

              The total degree of the monomial a * X^n * Y^m is n + m.

              @[simp]
              theorem Polynomial.Bivariate.degreeX_monomialXY {F : Type} [Semiring F] {n m : } {a : F} (ha : a 0) :
              degreeX ((monomialXY n m) a) = n

              The X-degree of the monomial a * X^n * Y^m is n.

              @[simp]
              theorem Polynomial.Bivariate.degreeY_monomialXY {F : Type} [Semiring F] {n m : } {a : F} (ha : a 0) :
              natDegreeY ((monomialXY n m) a) = m

              The Y-degree of the monomial a * X^n * Y^m is m.

              noncomputable def Polynomial.Bivariate.weightedDegreeMonomialXY {n m : } (a b t : ) :

              (a,b)-weighted degree of a monomial X^i * Y^j

              Instances For
                theorem Polynomial.Bivariate.evalX_mul {F : Type} [CommSemiring F] (x : F) (f g : Polynomial (Polynomial F)) :
                evalX x (f * g) = evalX x f * evalX x g

                evalX is multiplicative.