Documentation

QedShare.Poly.Arith

Polynomial arithmetic #

Addition, scaling and multiplication of coefficient lists, each with a theorem that evaluation respects it (eval_add, eval_smul, eval_mul). These are the building blocks for the vanishing polynomial used in the proof of perfect_secrecy.

Coefficient-wise sum of two polynomials (the shorter one is padded with zeros).

Equations
Instances For

    Multiply every coefficient by the scalar c.

    Equations
    Instances For

      Product of two polynomials (schoolbook): (a + x·p)·q = a·q + x·(p·q).

      Equations
      Instances For
        @[simp]

        Adding the empty (zero) polynomial on the left changes nothing.

        @[simp]

        Adding the empty (zero) polynomial on the right changes nothing.

        @[simp]
        theorem QedShare.Poly.add_cons_cons (a b : GF256) (p q : Poly) :
        add (a :: p) (b :: q) = (a + b) :: p.add q

        Polynomials are added coefficient by coefficient, lowest degree first.

        theorem QedShare.Poly.eval_add (p q : Poly) (x : GF256) :
        (p.add q).eval x = p.eval x + q.eval x

        Evaluation respects polynomial addition.

        theorem QedShare.Poly.eval_smul (c : GF256) (p : Poly) (x : GF256) :
        (smul c p).eval x = c * p.eval x

        Evaluation respects scaling.

        theorem QedShare.Poly.eval_mul (p q : Poly) (x : GF256) :
        (p.mul q).eval x = p.eval x * q.eval x

        Evaluation respects polynomial multiplication.