Documentation

CompPoly.Bivariate.Basic

Computable Bivariate Polynomials #

This file defines CBivariate R, the computable representation of bivariate polynomials with coefficients in R. The type is CPolynomial (CPolynomial R), i.e. polynomials in Y with coefficients that are polynomials in X, matching Mathlib's R[X][Y] (i.e. Polynomial (Polynomial R)).

The design is intended to be compatible with:

def CompPoly.CBivariate (R : Type u_1) [Zero R] :
Type u_1

Computable bivariate polynomials: F[X][Y] as CPolynomial (CPolynomial R).

Each p : CBivariate R is a polynomial in Y whose coefficients are univariate polynomials in X. The outer structure is indexed by powers of Y, the inner by powers of X.

Instances For
    theorem CompPoly.CBivariate.ext {R : Type u_1} [Zero R] {p q : CBivariate R} (h : p = q) :
    p = q

    Extensionality: two bivariate polynomials are equal if their underlying values are.

    theorem CompPoly.CBivariate.ext_iff {R : Type u_1} [Zero R] {p q : CBivariate R} :
    p = q p = q
    @[implicit_reducible]

    Coerce to the underlying univariate polynomial (in Y) with polynomial coefficients.

    @[implicit_reducible]

    The zero bivariate polynomial is canonical.

    @[implicit_reducible]
    instance CompPoly.CBivariate.instBEq {R : Type u_1} [Zero R] [BEq R] :
    @[implicit_reducible]
    @[implicit_reducible]

    Additive structure on CBivariate R

    @[implicit_reducible]

    Ring structure on CBivariate R (for ring equiv with Mathlib in ToPoly).

    @[implicit_reducible]
    @[implicit_reducible]
    @[implicit_reducible]
    def CompPoly.CBivariate.CC {R : Type u_1} [Zero R] [BEq R] [LawfulBEq R] (r : R) :

    Constant as a bivariate polynomial. Mathlib: Polynomial.Bivariate.CC.

    Instances For

      The variable X (inner variable). As bivariate: polynomial in Y with single coeff X at Y^0.

      Instances For

        The variable Y (outer variable). Monomial Y^1 with coefficient 1.

        Instances For
          def CompPoly.CBivariate.monomialXY {R : Type u_1} [Semiring R] [BEq R] [LawfulBEq R] [Nontrivial R] [DecidableEq R] (n m : ) (c : R) :

          Monomial c * X^n * Y^m. ArkLib: Polynomial.Bivariate.monomialXY.

          Instances For
            def CompPoly.CBivariate.coeff {R : Type u_1} [Zero R] (f : CBivariate R) (i j : ) :
            R

            Coefficient of X^i Y^j in the bivariate polynomial. Here i is the X-exponent (inner) and j is the Y-exponent (outer). ArkLib: Polynomial.Bivariate.coeff f i j.

            Instances For

              The Y-support: indices j such that the coefficient of Y^j is nonzero.

              Instances For

                The X-support: indices i such that the coefficient of X^i is nonzero (i.e. some monomial X^i Y^j has nonzero coefficient).

                Instances For

                  The Y-degree (degree when viewed as a polynomial in Y). ArkLib: Polynomial.Bivariate.natDegreeY.

                  Instances For
                    def CompPoly.CBivariate.natDegreeX {R : Type u_1} [Zero R] [BEq R] (f : CBivariate R) :

                    The X-degree: maximum over all Y-coefficients of their degree in X. ArkLib: Polynomial.Bivariate.natDegreeX.

                    Instances For

                      Total degree: max over monomials of (deg_X + deg_Y). ArkLib: Polynomial.Bivariate.totalDegree.

                      Instances For
                        def CompPoly.CBivariate.natWeightedDegree {R : Type u_1} [Zero R] [BEq R] (f : CBivariate R) (u v : ) :

                        The (u, v)-weighted degree: max over monomials of u * deg_X + v * deg_Y.

                        Instances For
                          def CompPoly.CBivariate.evalX {R : Type u_1} [Semiring R] [BEq R] [LawfulBEq R] [DecidableEq R] (a : R) (f : CBivariate R) :

                          Evaluate in the first variable (X) at a, yielding a univariate polynomial in Y. ArkLib: Polynomial.Bivariate.evalX.

                          Instances For
                            def CompPoly.CBivariate.evalY {R : Type u_1} [Semiring R] [BEq R] [LawfulBEq R] [Nontrivial R] (a : R) (f : CBivariate R) :

                            Evaluate in the second variable (Y) at a, yielding a univariate polynomial in X. ArkLib: Polynomial.Bivariate.evalY.

                            Instances For
                              def CompPoly.CBivariate.evalEval {R : Type u_1} [Semiring R] [BEq R] [LawfulBEq R] [Nontrivial R] (x y : R) (f : CBivariate R) :
                              R

                              Full evaluation at (x, y): p(x, y). Inner variable X at x, outer variable Y at y. Equivalently (evalY y f).eval x. Mathlib: Polynomial.evalEval.

                              Instances For

                                Swap the roles of X and Y. ArkLib/Mathlib: Polynomial.Bivariate.swap. TODO a more efficient implementation

                                Instances For

                                  Leading coefficient when viewed as a polynomial in Y. ArkLib: Polynomial.Bivariate.leadingCoeffY.

                                  Instances For

                                    Leading coefficient when viewed as a polynomial in X. The coefficient of X^(degreeX f): a polynomial in Y.

                                    Instances For

                                      The total degree is the (1, 1)-weighted degree.

                                      The X-degree is the (1, 0)-weighted degree.