Documentation

Complexity.Computability.PolyTime.Int.Jet

Truncated univariate integer Taylor jet subtraction, congruences, and fold combinators #

Builds on Cslib.truncZJet, Cslib.polyAdd, and Cslib.mulZJet from Complexity/Computability/PolyTime/ParityFactorEval.lean to provide truncated length-J addition, subtraction, scalar subtraction, Polynomial.X ^ J divisibility congruences, foldl product invariants, encIntBin bit-length bounds, and a plain ComputableInPolyTime product-fold combinator in ℤ[z] / (z ^ J).

All operations (Cslib.IntJet.add, Cslib.IntJet.sub, Cslib.IntJet.subConst, together with Cslib.truncZJet and Cslib.mulZJet) are total on arbitrary List ℤ inputs: missing entries read as 0 via List.getD _ 0, entries at indices ≥ J are truncated modulo z ^ J, and every output has exact length J.

Main definitions and results #

References #

def Cslib.IntJet.add (J : ℕ) (a b : List ℤ) :

Pointwise addition of two integer jets modulo z ^ J (exact length J), reusing Cslib.truncZJet and Cslib.polyAdd.

Instances For
    def Cslib.IntJet.sub (J : ℕ) (a b : List ℤ) :

    Pointwise subtraction of two integer jets, zero-padded via getD _ 0 to exact length J.

    Instances For
      def Cslib.IntJet.subConst (J : ℕ) (c : ℤ) (a : List ℤ) :

      Subtract an integer jet a from a scalar constant c modulo z ^ J (exact length J).

      Instances For
        @[simp]
        theorem Cslib.IntJet.length_add (J : ℕ) (a b : List ℤ) :
        (add J a b).length = J
        @[simp]
        theorem Cslib.IntJet.length_sub (J : ℕ) (a b : List ℤ) :
        (sub J a b).length = J
        @[simp]
        theorem Cslib.IntJet.length_subConst (J : ℕ) (c : ℤ) (a : List ℤ) :
        (subConst J c a).length = J
        theorem Cslib.IntJet.length_foldl_mulZJet {α : Type u_1} (J : ℕ) (stepJet : α → List ℤ) (l : List α) {acc : List ℤ} (hacc : acc.length = J) :
        (List.foldl (fun (s : List ℤ) (x : α) => mulZJet J s (stepJet x)) acc l).length = J

        Folding Cslib.mulZJet J preserves exact length J whenever acc.length = J.

        Cslib.mulZJet J a b is congruent to ofCoeffList a * ofCoeffList b modulo X ^ J.

        theorem Cslib.IntJet.X_pow_dvd_foldl_mulZJet {α : Type u_1} (J : ℕ) (l : List α) (stepJet : α → List ℤ) (stepPoly : α → Polynomial ℤ) (hstep : ∀ x ∈ l, Polynomial.X ^ J ∣ Polynomial.ofCoeffList (stepJet x) - stepPoly x) (acc : List ℤ) (accPoly : Polynomial ℤ) (hacc : Polynomial.X ^ J ∣ Polynomial.ofCoeffList acc - accPoly) :
        Polynomial.X ^ J ∣ Polynomial.ofCoeffList (List.foldl (fun (s : List ℤ) (x : α) => mulZJet J s (stepJet x)) acc l) - accPoly * (List.map stepPoly l).prod

        Folding Cslib.mulZJet J over l preserves congruence modulo X ^ J.

        Every entry a.getD k 0 has encIntBin bit-length at most coeffNorm1.size + 1.

        theorem Cslib.IntJet.coeffNorm1_foldl_mulZJet_le {α : Type u_1} (J : ℕ) (l : List α) (stepJet : α → List ℤ) (bound : α → ℕ) (hstep : ∀ x ∈ l, (Polynomial.ofCoeffList (stepJet x)).coeffNorm1 ≤ bound x) (acc : List ℤ) :
        (Polynomial.ofCoeffList (List.foldl (fun (s : List ℤ) (x : α) => mulZJet J s (stepJet x)) acc l)).coeffNorm1 ≤ (Polynomial.ofCoeffList acc).coeffNorm1 * (List.map bound l).prod

        Submultiplicative Polynomial.coeffNorm1 bound across foldl of Cslib.mulZJet J.

        Bit-size of (ofCoeffList a).coeffNorm1 is bounded linearly in (encList encIntBin a).length.

        Encoded length of a : List ℤ is bounded by a.length * (2 * coeffNorm1.size + 3).

        Plain polynomial-time combinator for folding Cslib.mulZJet over xs from Cslib.truncZJet J [1], given a polynomial bound K on the bit-sizes of the step factors' ℓ₁ norms.