Documentation

MIPRE.Foundations.LowDegree.BinaryDivision

Division by binary monic polynomials #

The divisor is represented by its lower coefficients p; the leading one is implicit. Horner long division keeps a fixed-width remainder and records each discarded leading coefficient in the quotient. Division by the constant one has a separate branch. No irreducibility or field structure is assumed.

The discarded bit records exactly the multiple of the monic modulus removed by one reduction step, without any assumption that the modulus vanishes.

@[reducible, inline]

Modulus, quotient, and remainder for a Horner division step.

Equations
Instances For

    One input coefficient is appended to the Horner computation.

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

      Quotient width increases once per input coefficient; remainder width cannot grow.

      The width invariant holds for arbitrary initial states, including malformed ones.

      On well-formed states, a division step preserves the fixed remainder width.

      Unnormalized Horner division result.

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

        The right-fold state retains its modulus and its prescribed remainder width.

        theorem MIPRE.LowDegree.BinaryPolynomial.evalBits_divisionStep {R : Type u_1} [CommRing R] [CharP R 2] (z : R) (p q r : Cost.BitStr) (b : Bool) (hp : p ≠ []) (hr : List.length r = List.length p) :
        (evalBits z p + z ^ List.length p) * evalBits z (divisionStep (p, q, r) b).2.1 + evalBits z (divisionStep (p, q, r) b).2.2 = ofBool b + z * ((evalBits z p + z ^ List.length p) * evalBits z q + evalBits z r)

        The division-step invariant is an identity in any characteristic-two ring.

        theorem MIPRE.LowDegree.BinaryPolynomial.evalBits_divisionFold {R : Type u_1} [CommRing R] [CharP R 2] (z : R) (p a : Cost.BitStr) (hp : p ≠ []) :
        (evalBits z p + z ^ List.length p) * evalBits z (divisionFold p a).2.1 + evalBits z (divisionFold p a).2.2 = evalBits z a

        Horner long division reconstructs the dividend.

        Quotient and remainder by the monic polynomial polyOfBits (p ++ [true]). The degree-zero case divides by one; all outputs are normalized.

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

          Output widths are bounded by the input and divisor widths.

          Monic division is correct as a polynomial identity, including division by one.

          Coefficients past a representation's width vanish.

          The remainder has degree strictly smaller than the monic divisor.

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

                Ambient Horner long division, with one iteration per dividend coefficient.

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

                    Uniform deterministic polynomial-time division by any binary monic polynomial.

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