Documentation

HexPolyZ.ExactDivision

The first cheap obstruction found before integer-polynomial long division.

The constructors are ordered by the cost of the corresponding check.

  • zeroDivisor : Reject

    Division by the zero polynomial is undefined.

  • degree : Reject

    A nonzero divisor cannot have larger degree than a nonzero dividend.

  • leadingCoeff : Reject

    The divisor's leading coefficient must divide the dividend's.

  • content : Reject

    The divisor's coefficient content must divide the dividend's.

  • evaluation : Reject

    Divisibility must survive evaluation at the fixed small point.

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

      The fixed small evaluation point used by the final exact-division precheck.

      Evaluation at one avoids coefficient growth while still testing a condition independent of the degree, leading-coefficient, and content checks.

      Equations
      Instances For

        Executable coefficient content used by exact-division rejection.

        Equations
        Instances For

          The executable content value agrees with the public specification.

          Executable Horner evaluation at the fixed rejection point.

          Equations
          Instances For

            The executable evaluation value agrees with public polynomial evaluation.

            Return the first cheap reason that g cannot divide f, or none when dense exact division is still necessary.

            The zero dividend is deliberately allowed past the degree check: every nonzero polynomial divides zero, with exact quotient zero.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem Hex.ZPoly.DivExact.reject?_eq_none_of_mul (q g : ZPoly) (hg : g 0) :
              reject? (q * g) g = none

              Every exact multiple passes all cheap rejection tests.

              The exact quotient f / g, or none when g = 0 or the executable integer-polynomial division does not reconstruct f exactly.

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

                Division by the zero polynomial is always rejected.

                A prefilter rejection returns before the dense-division branch.

                theorem Hex.ZPoly.divExact?_product {f g q : ZPoly} (h : f.divExact? g = some q) :
                q * g = f

                A successful exact division carries the checked multiplication witness.

                theorem Hex.ZPoly.divMod_eq_mul_of_ne_zero (f g q : ZPoly) (hg : g 0) (hmul : q * g = f) :

                Long division returns the witnessed quotient for every exact multiple by a nonzero integer polynomial.

                theorem Hex.ZPoly.divExact?_eq {f g q : ZPoly} (hg : g 0) :
                f.divExact? g = some q f = q * g

                Exact division succeeds exactly on a supplied multiplication witness when the divisor is nonzero.

                theorem Hex.ZPoly.divExact?_isSome_of_dvd {f g : ZPoly} (hg : g 0) :
                g f(f.divExact? g).isSome = true

                Every nonzero divisor is found by the executable exact-division check.