Documentation

CompPoly.Univariate.NTT.Domain

NTT Domain #

This file defines the radix-2 NTT domain parameters and basic raw-polynomial shape helpers used by forward/inverse NTT.

structure CompPoly.CPolynomial.NTT.Domain (R : Type u_2) [Field R] :
Type u_2

Parameters for a radix-2 NTT domain of size 2 ^ logN.

Instances For
    @[implicit_reducible]

    Domain size.

    Instances For
      @[reducible, inline]

      Index type for vectors over the domain.

      Instances For
        @[inline]
        def CompPoly.CPolynomial.NTT.Domain.node {R : Type u_1} [Field R] (D : Domain R) (i : D.Idx) :
        R

        The i-th evaluation node omega^i.

        Instances For
          @[inline]

          Inverse root of unity.

          Instances For

            The domain with the inverse root, used by inverse NTT butterflies.

            Instances For
              @[inline]

              Multiplicative inverse of the domain size in R.

              Instances For
                @[simp]
                theorem CompPoly.CPolynomial.NTT.Domain.n_pos {R : Type u_1} [Field R] (D : Domain R) :
                0 < D.n
                @[simp]
                theorem CompPoly.CPolynomial.NTT.Domain.n_ne_zero {R : Type u_1} [Field R] (D : Domain R) :
                D.n 0

                The size of an NTT domain is nonzero in its coefficient field.

                Required convolution length for multiplying p and q.

                Instances For
                  def CompPoly.CPolynomial.NTT.Domain.fits {R : Type u_1} [Field R] [BEq R] (D : Domain R) (p q : Raw R) :

                  Whether domain D is large enough for multiplying p and q.

                  Instances For

                    Truncate a polynomial to at most m coefficients.

                    Instances For

                      The smallest radix-2 exponent that can cover a requested convolution length.

                      Instances For
                        @[inline]

                        Load an array in natural order and pad it to a domain-sized array.

                        Instances For
                          @[simp]
                          @[simp]
                          theorem CompPoly.CPolynomial.NTT.getElem_loadNaturalArray {R : Type u_1} [Field R] (D : Domain R) (a : Array R) (i : ) (hi : i < (loadNaturalArray D a).size) :
                          @[inline]

                          Load an array in natural order and pad it to a domain-sized vector.

                          Instances For
                            @[reducible, inline]
                            abbrev CompPoly.CPolynomial.NTT.FittingDomain (R : Type u_2) [Field R] (requiredLen : ) :
                            Type u_2

                            An NTT domain bundled with proof that it covers the requested convolution length.

                            Instances For
                              def CompPoly.CPolynomial.NTT.bestDomainForLength? {R : Type u_1} [Field R] (maxLogN : ) (domainOfLogN : (logN : ) → logN maxLogNDomain R) (domainOfLogN_logN : ∀ (logN : ) (hlogN : logN maxLogN), (domainOfLogN logN hlogN).logN = logN) (requiredLen : ) :
                              Option (FittingDomain R requiredLen)

                              Generic adapter from field-specific radix-2 domain tables to a best-fitting domain lookup.

                              The adapter chooses logN = Nat.clog 2 requiredLen, then returns none if that exponent is outside the supported table.

                              Instances For