Documentation

MIPRE.Foundations.LowDegree.BinaryPolynomial

Binary polynomial arithmetic on coefficient lists #

Coefficient lists are little-endian. XOR implements addition, and multiplication by the indeterminate is reduced using the lower coefficients of a monic modulus. The semantic lemmas work in every characteristic-two commutative ring containing a root of that modulus; the programs are uniform in the coefficient lists.

Evaluate a little-endian binary coefficient list by Horner's rule.

Equations
Instances For
    @[simp]
    theorem MIPRE.LowDegree.BinaryPolynomial.evalBits_cons {R : Type u_1} [CommRing R] (z : R) (b : Bool) (l : Cost.BitStr) :
    evalBits z (b :: l) = ofBool b + z * evalBits z l

    Horner semantics agrees with evaluation of the coefficient polynomial.

    Fixed-width XOR, used only with equal-width operands in correctness lemmas.

    Equations
    Instances For

      Shift by one coefficient and discard the new highest coefficient.

      Equations
      Instances For

        Multiply by the indeterminate modulo X^k + p, with p represented by exactly k lower coefficients.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem MIPRE.LowDegree.BinaryPolynomial.evalBits_shiftReduce {R : Type u_1} [CommRing R] [CharP R 2] (z : R) (p a : Cost.BitStr) (hlen : List.length a = List.length p) (hroot : z ^ List.length p = evalBits z p) :

          Reduction is correct whenever the chosen element satisfies the monic modulus.

          Horner multiplication, reducing after every shift.

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

            Even malformed moduli and operands cannot increase the accumulator width.

            theorem MIPRE.LowDegree.BinaryPolynomial.evalBits_mulReduce {R : Type u_1} [CommRing R] [CharP R 2] (z : R) (p a b : Cost.BitStr) (hlen : List.length a = List.length p) (hroot : z ^ List.length p = evalBits z p) :

            The reduced multiplication algorithm computes multiplication in every characteristic-two algebra in which the specified monic modulus vanishes.

            Take a unary-specified number of coefficients in polynomial time.

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

              XOR of two bits, as an ambient program.

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

                Uniform polynomial-time addition of fixed-width coefficient vectors.

                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
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        Uniform polynomial-time multiplication by the indeterminate modulo a binary monic polynomial. The input is the lower-coefficient vector and the operand.

                        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
                              theorem MIPRE.LowDegree.BinaryPolynomial.foldr_mulStep (l p a acc : Cost.BitStr) :
                              List.foldr (fun (bit : Bool) (s : MulState) => mulStep s bit) (p, a, acc) l = (p, a, List.foldr (fun (bit : Bool) (v : Cost.BitStr) => if bit = true then xorBits (shiftReduce p v) a else shiftReduce p v) acc l)

                              Uniform polynomial-time multiplication modulo a binary monic polynomial. The input carries its lower coefficients and the two operands.

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