Documentation

HexModular.Euclid

One row of the extended Euclidean remainder sequence on (m, a). The omitted coefficient of m is never inspected by reconstruction consumers.

  • r : Int

    The current Euclidean remainder.

  • t : Int

    The coefficient of the second input a.

Instances For
    def Hex.Modular.instDecidableEqRow.decEq (x✝ x✝¹ : Row) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For

      Return the first row of the extended Euclidean remainder sequence on (m, a) whose remainder is at most P. The modulus is interpreted up to sign, and a is reduced before entering the recurrence.

      Equations
      Instances For
        theorem Hex.Modular.euclidUntil_spec {modulus : Nat} {a P : Int} (hmodulus : 0 < modulus) (hP : 0 ≤ P) (hcut : P < ↑modulus) :
        have row := euclidUntil (Int.ofNat modulus) a P; 0 ≤ row.r ∧ row.r ≤ P ∧ row.t ≠ 0 ∧ ↑modulus ∣ row.t * a - row.r ∧ ∀ (p q : Int), ↑p.natAbs ≤ P → 0 < q → ↑modulus ∣ q * a - p → ↑row.t.natAbs ≤ q

        The truncated Euclidean row is a nonzero modular-lattice vector whose second coordinate is no larger than that of any bounded lattice vector.