Documentation

HexMvPoly.KernelResidue.Denote

Producer-side conversion from machine-word residues to quoted naturals.

Equations
Instances For

    Interpret natural coefficients as residues. This is a semantic conversion, never part of the closed Boolean certificate computation.

    Equations
    Instances For
      @[simp]

      Reading back producer residues is exact, with no support assumptions.

      theorem Hex.MvPoly.Kernel.ofResidues_toResidues (p : Nat) [ZMod64.Bounds p] {a : PolyList Nat} (ha : ∀ (t : Term Nat), t ∈ a → t.snd < p) :

      Reading and quoting a bounded natural coefficient leaves it unchanged.

      The encoding is injective on the executable coefficient carrier.

      Executable canonical lists quote to canonical residue lists.

      Canonical natural residues have canonical executable denotation lists.

      Quoting commutes with modular addition.

      Quoting commutes with modular multiplication.

      Quoting commutes with scalar multiplication.

      Quoting commutes with negation.

      Natural scalars may be unreduced; multiplication reduces them modulo p.

      theorem Hex.MvPoly.Kernel.toResidues_addMod (p : Nat) [ZMod64.Bounds p] {a b : PolyList Nat} (ha : ∀ (t : Term Nat), t ∈ a → t.snd < p) (hb : ∀ (t : Term Nat), t ∈ b → t.snd < p) :
      toResidues p (addMod p a b) = add (toResidues p a) (toResidues p b)

      Reading modular addition agrees with executable addition on bounded inputs.

      theorem Hex.MvPoly.Kernel.toResidues_mulMod (p : Nat) [ZMod64.Bounds p] {a b : PolyList Nat} (ha : ∀ (t : Term Nat), t ∈ a → t.snd < p) (hb : ∀ (t : Term Nat), t ∈ b → t.snd < p) :
      toResidues p (mulMod p a b) = mul (toResidues p a) (toResidues p b)

      Reading modular multiplication agrees with executable multiplication.

      theorem Hex.MvPoly.Kernel.toResidues_negMod (p : Nat) [ZMod64.Bounds p] {a : PolyList Nat} (ha : ∀ (t : Term Nat), t ∈ a → t.snd < p) :

      Reading modular negation agrees with executable negation.

      theorem Hex.MvPoly.Kernel.toResidues_smulMod (p : Nat) [ZMod64.Bounds p] (c : Nat) {a : PolyList Nat} (ha : ∀ (t : Term Nat), t ∈ a → t.snd < p) :

      Reading modular scalar multiplication agrees with executable scaling.

      Reading the modular identity gives the executable list identity.

      def Hex.MvPoly.Kernel.denoteMod (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] (a : PolyList Nat) :
      MvPoly n (ZMod64 p) cmp

      Semantic denotation in the executable residue polynomial ring.

      Equations
      Instances For
        @[simp]
        theorem Hex.MvPoly.Kernel.denoteMod_nil (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] :

        The empty residue list denotes zero.

        @[simp]
        theorem Hex.MvPoly.Kernel.denoteMod_oneMod (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] :
        denoteMod p (oneMod p n) = 1

        The residue-list identity denotes the polynomial identity.

        theorem Hex.MvPoly.Kernel.denoteMod_addMod (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] {a b : PolyList Nat} (ha : CanonicalMod p n a) (hb : CanonicalMod p n b) :

        Modular addition denotes polynomial addition on canonical inputs.

        theorem Hex.MvPoly.Kernel.denoteMod_mulMod (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] {a b : PolyList Nat} (ha : CanonicalMod p n a) (hb : CanonicalMod p n b) :

        Modular multiplication denotes polynomial multiplication on canonical inputs.

        theorem Hex.MvPoly.Kernel.denoteMod_negMod (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] {a : PolyList Nat} (ha : CanonicalMod p n a) :

        Modular negation denotes polynomial negation on canonical inputs.

        theorem Hex.MvPoly.Kernel.denoteMod_smulMod (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] (c : Nat) {a : PolyList Nat} (ha : CanonicalMod p n a) :

        Modular scalar multiplication denotes multiplication by a residue constant.

        theorem Hex.MvPoly.Kernel.denoteMod_subMod (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] {a b : PolyList Nat} (ha : CanonicalMod p n a) (hb : CanonicalMod p n b) :

        Modular subtraction denotes polynomial subtraction on canonical inputs.

        theorem Hex.MvPoly.Kernel.denoteMod_injective (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] {a b : PolyList Nat} (ha : CanonicalMod p n a) (hb : CanonicalMod p n b) (h : denoteMod p a = denoteMod p b) :
        a = b

        Canonical residue lists are uniquely determined by their denotation.

        theorem Hex.MvPoly.Kernel.isZero_mod_iff (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] {a : PolyList Nat} (ha : CanonicalMod p n a) :

        The existing structural zero test is exact for canonical residue lists.

        theorem Hex.MvPoly.Kernel.beq_mod_iff (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] {a b : PolyList Nat} (ha : CanonicalMod p n a) (hb : CanonicalMod p n b) :

        The existing structural equality test is exact for canonical residue lists.

        theorem Hex.MvPoly.Kernel.ofResidues_toList_canonical (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] (a : MvPoly n (ZMod64 p) cmp) :

        A producer polynomial quotes to a canonical residue list.

        @[simp]
        theorem Hex.MvPoly.Kernel.denoteMod_ofResidues (p : Nat) [ZMod64.Bounds p] {n : Nat} {cmp : Mono n → Mono n → Ordering} [Std.TransCmp cmp] [Std.LawfulEqCmp cmp] (a : MvPoly n (ZMod64 p) cmp) :

        The complete producer-to-kernel encoding round trip.