Documentation

CompPoly.Univariate.Raw.Division

Raw Univariate Polynomial Division #

Division algorithms for raw computable univariate polynomials.

Division with remainder by a monic polynomial using polynomial long division.

Instances For
    def CompPoly.CPolynomial.Raw.divModByMonicAux.go {R : Type u_1} [BEq R] [CommRing R] :
    Raw RRaw RRaw R × Raw R
    Instances For
      def CompPoly.CPolynomial.Raw.divByMonic {R : Type u_1} [BEq R] [CommRing R] (p q : Raw R) :
      Raw R

      Division of p : CPolynomial.Raw R by a monic q : CPolynomial.Raw R.

      Instances For
        def CompPoly.CPolynomial.Raw.modByMonic {R : Type u_1} [BEq R] [CommRing R] (p q : Raw R) :
        Raw R

        Modulus of p : CPolynomial.Raw R by a monic q : CPolynomial.Raw R.

        Instances For
          @[inline, specialize #[]]
          def CompPoly.CPolynomial.Raw.subScaledShift {R : Type u_1} [BEq R] [Field R] (p q : Raw R) (scale : R) (shift : ) :
          Raw R

          Subtract scale * q * X^shift from p without using general polynomial multiplication.

          Instances For
            @[inline, specialize #[]]

            Remainder-only long division by a monic polynomial.

            Unlike modByMonic, this does not compute the quotient and avoids the general polynomial multiplications used by each cancellation step. It is intended as an executable implementation for the canonical modByMonic specification.

            Instances For
              Instances For
                @[inline, specialize #[]]
                def CompPoly.CPolynomial.Raw.inverseModX {R : Type u_1} [BEq R] [Field R] [LawfulBEq R] (M : MulLowContext R) (k : ) (p : Raw R) :
                Raw R

                Inverse modulo X^k, using Newton iteration and the supplied low-product backend.

                Instances For
                  def CompPoly.CPolynomial.Raw.inverseModX.go {R : Type u_1} [BEq R] [Field R] [LawfulBEq R] (M : MulLowContext R) (k : ) (p : Raw R) :
                  Raw RRaw R
                  Instances For
                    @[inline, specialize #[]]

                    Remainder by a monic polynomial through reversal and truncated products.

                    For canonical monic inputs this computes the quotient from the reversed divisor inverse modulo X^k, then subtracts only the low coefficients needed for the remainder. Inputs outside the fast-path guard use the simple monic-remainder implementation.

                    Instances For
                      def CompPoly.CPolynomial.Raw.div {R : Type u_1} [BEq R] [Field R] (p q : Raw R) :
                      Raw R

                      Division of two CPolynomial.Raws.

                      Instances For
                        def CompPoly.CPolynomial.Raw.mod {R : Type u_1} [BEq R] [Field R] (p q : Raw R) :
                        Raw R

                        Modulus of two CPolynomial.Raws.

                        Instances For
                          @[implicit_reducible]
                          @[implicit_reducible]
                          def CompPoly.CPolynomial.Raw.monicNormalize {R : Type u_1} [BEq R] [Field R] (p : Raw R) :
                          Raw R

                          Normalize a nonzero raw polynomial to monic form. The zero polynomial stays zero.

                          Instances For
                            def CompPoly.CPolynomial.Raw.gcdMonicWithFuel {R : Type u_1} [BEq R] [Field R] :
                            Raw RRaw RRaw R

                            Raw Euclidean gcd with explicit fuel, normalized to a monic result.

                            Instances For
                              def CompPoly.CPolynomial.Raw.gcdMonic {R : Type u_1} [BEq R] [Field R] (p q : Raw R) :
                              Raw R

                              Raw monic Euclidean gcd.

                              Instances For