Documentation

CompPoly.Fields.Binary.AdditiveNTT.NovelPolynomialBasis

Novel Polynomial Basis #

This file defines the components of a novel polynomial basis over a field L with degree r as an algebra over its prime-characteristic subfield 𝔽q, and an 𝔽q-basis β for L.

Main Definitions #

TODOs #

References #

def AdditiveNTT.U {r : } [NeZero r] {L : Type u} [Field L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) :
Subspace 𝔽q L

𝔽q-linear subspaces Uᵢ

∀ i ∈ {0, ..., r-1}, we define Uᵢ:= <β₀, ..., βᵢ₋₁>_{𝔽q} as the 𝔽q-linear span of the initial i vectors of our basis β.

NOTE: We might allow i = r in the future if needed.

Equations
    Instances For
      instance AdditiveNTT.instModuleSubtypeMemSubspaceU {r : } [NeZero r] {L : Type u} [Field L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) {i : Fin r} :
      Module 𝔽q (U 𝔽q β i)
      Equations
        instance AdditiveNTT.instDecidableEqSubtypeMemSubspaceU {r : } [NeZero r] {L : Type u} [Field L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) {i : Fin r} :
        DecidableEq (U 𝔽q β i)
        Equations
          noncomputable instance AdditiveNTT.instDecidableMemSetCoeSubspaceU {r : } [NeZero r] {L : Type u} [Field L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) {i : Fin r} (x : L) :
          Decidable (x (U 𝔽q β i))
          Equations
            theorem AdditiveNTT.finrank_U {r : } [NeZero r] {L : Type u} [Field L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) :
            Module.finrank 𝔽q (U 𝔽q β i) = i
            noncomputable instance AdditiveNTT.fintype_U {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) :
            Fintype (U 𝔽q β i)
            Equations
              theorem AdditiveNTT.U_card {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) :
              Fintype.card (U 𝔽q β i) = Fintype.card 𝔽q ^ i
              theorem AdditiveNTT.U_i_is_union_of_cosets {r : } [NeZero r] {L : Type u} [Field L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) (hi : 0 < i) :
              (U 𝔽q β i) = ⋃ (c : 𝔽q), (fun (u : L) => c β (i - 1) + u) '' (U 𝔽q β (i - 1))

              An essential helper lemma showing that Uᵢ is the union of all cosets of Uᵢ₋₁ generated by scaling βᵢ₋₁ by elements of 𝔽q.

              theorem AdditiveNTT.βᵢ_not_in_Uᵢ {r : } [NeZero r] {L : Type u} [Field L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) :
              β iU 𝔽q β i

              The basis vector βᵢ is not an element of the subspace Uᵢ.

              theorem AdditiveNTT.root_U_lift_down {r : } [NeZero r] {L : Type u} [Field L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) (h_i_add_1 : i + 1 < r) (a : L) :
              a U 𝔽q β (i + 1)∃! x : 𝔽q, a - x β i U 𝔽q β i
              theorem AdditiveNTT.root_U_lift_up {r : } [NeZero r] {L : Type u} [Field L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) (h_i_add_1 : i + 1 < r) (a : L) (x : 𝔽q) :
              a - x β i U 𝔽q β ia U 𝔽q β (i + 1)
              noncomputable def AdditiveNTT.W {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) :

              The subspace vanishing polynomial Wᵢ(X) := ∏_{u ∈ Uᵢ} (X - u), ∀ i ∈ {0, ..., r-1}. The degree of Wᵢ(X) is |Uᵢ| = 2^i.

              • [LCH14, Lemma 1]: Wᵢ(X) is an 𝔽q-linearized polynomial, i.e., Wᵢ(x) = ∑_{j=0}^i a_{i, j} x^{2^j} for some constants a_{i, j} ∈ L (Equation (3)).
              • The additive property: Wᵢ(x + y) = Wᵢ(x) + Wᵢ(y) for all x, y ∈ L (Equation (4)).
              • For all y ∈ Uᵢ, Wᵢ(x + y) = Wᵢ(x) (Equation (14)).
              Equations
                Instances For
                  theorem AdditiveNTT.degree_W {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) :
                  (W 𝔽q β i).degree = (Fintype.card 𝔽q) ^ i

                  The degree of the subspace vanishing polynomial Wᵢ(X) is 2ⁱ.

                  theorem AdditiveNTT.W_monic {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) :
                  (W 𝔽q β i).Monic

                  The subspace vanishing polynomial Wᵢ(X) is monic.

                  theorem AdditiveNTT.W_ne_zero {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) :
                  W 𝔽q β i 0
                  theorem AdditiveNTT.Wᵢ_eval_βᵢ_neq_zero {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) :
                  Polynomial.eval (β i) (W 𝔽q β i) 0

                  The evaluation of Wᵢ(X) at βᵢ is non-zero.

                  theorem AdditiveNTT.Wᵢ_vanishing {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) (u : L) :
                  u U 𝔽q β iPolynomial.eval u (W 𝔽q β i) = 0
                  theorem AdditiveNTT.W₀_eq_X {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) :
                  W 𝔽q β 0 = Polynomial.X

                  Formalization of linearity of subspace vanishing polynomials #

                  This section formalizes the key properties of the subspace vanishing polynomials Wᵢ, including their recursive structure and 𝔽q-linearity as described in Lemma 2.3 of [GGJ96]. The proofs are done by simultaneous induction on i.

                  theorem AdditiveNTT.W_splits {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) :
                  (W 𝔽q β i).Splits

                  The subspace vanishing polynomial Wᵢ(X) splits into linear factors over L.

                  theorem AdditiveNTT.roots_W {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) :
                  (W 𝔽q β i).roots = Multiset.map (fun (u : (U 𝔽q β i)) => u) Finset.univ.val

                  The roots of Wᵢ(X) are precisely the elements of the subspace Uᵢ.

                  noncomputable def AdditiveNTT.algEquivAevalXSubC {R : Type u_1} [CommRing R] (t : R) :
                  Equations
                    Instances For

                      The multiplicity of a root x in a polynomial p composed with (X - a) is equal to the multiplicity of the root x - a in p.

                      theorem AdditiveNTT.roots_comp_X_sub_C {L : Type u} [Field L] [DecidableEq L] (p : Polynomial L) (a : L) :
                      (p.comp (Polynomial.X - Polynomial.C a)).roots = Multiset.map (fun (r : L) => r + a) p.roots
                      theorem AdditiveNTT.Prod_W_comp_X_sub_C_ne_zero {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) :
                      c : 𝔽q, (W 𝔽q β i).comp (Polynomial.X - Polynomial.C (c β i)) 0
                      theorem AdditiveNTT.rootMultiplicity_W {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) (a : L) :
                      Polynomial.rootMultiplicity a (W 𝔽q β i) = if a (U 𝔽q β i) then 1 else 0

                      The polynomial Wᵢ(X) has simple roots (multiplicity 1) for each element in the subspace Uᵢ, and no other roots.

                      theorem AdditiveNTT.eval_W_eq_zero_iff_in_U {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) (a : L) :
                      Polynomial.eval a (W 𝔽q β i) = 0 a U 𝔽q β i
                      theorem AdditiveNTT.rootMultiplicity_prod_W_comp_X_sub_C {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) (h_i_add_1 : i + 1 < r) (a : L) :
                      Polynomial.rootMultiplicity a (∏ c : 𝔽q, (W 𝔽q β i).comp (Polynomial.X - Polynomial.C (c β i))) = if a (U 𝔽q β (i + 1)) then 1 else 0
                      theorem AdditiveNTT.W_prod_comp_decomposition {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) (hi : i > 0) :
                      W 𝔽q β i = c : 𝔽q, (W 𝔽q β (i - 1)).comp (Polynomial.X - Polynomial.C (c β (i - 1)))

                      The generic product form of the recursion for Wᵢ. This follows the first line of the proof for (i) in the description. Wᵢ(X) = ∏_{c ∈ 𝔽q} Wᵢ₋₁ ∘ (X - cβᵢ₋₁).

                      theorem AdditiveNTT.comp_sub_C_of_linear_eval {L : Type u} [Field L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (p : Polynomial L) (h_lin : IsLinearMap 𝔽q fun (inner_p : Polynomial L) => p.comp inner_p) (a : L) :
                      theorem AdditiveNTT.inductive_rec_form_W_comp {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) (h_i_add_1 : i + 1 < r) (h_prev_linear_map : IsLinearMap 𝔽q fun (inner_p : Polynomial L) => (W 𝔽q β i).comp inner_p) (p : Polynomial L) :
                      (W 𝔽q β (i + 1)).comp p = (W 𝔽q β i).comp p ^ Fintype.card 𝔽q - Polynomial.C (Polynomial.eval (β i) (W 𝔽q β i)) ^ (Fintype.card 𝔽q - 1) * (W 𝔽q β i).comp p
                      theorem AdditiveNTT.inductive_linear_map_W {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [h_Fq_char_prime : Fact (Nat.Prime (ringChar 𝔽q))] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) (h_i_add_1 : i + 1 < r) (h_prev_linear_map : IsLinearMap 𝔽q fun (inner_p : Polynomial L) => (W 𝔽q β i).comp inner_p) :
                      IsLinearMap 𝔽q fun (inner_p : Polynomial L) => (W 𝔽q β (i + 1)).comp inner_p
                      theorem AdditiveNTT.W_linearity {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [h_Fq_char_prime : Fact (Nat.Prime (ringChar 𝔽q))] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) :
                      IsLinearMap 𝔽q fun (inner_p : Polynomial L) => (W 𝔽q β i).comp inner_p

                      Simultaneous Proof of Linearity for Wᵢ from the paper [GGJ96] (Lemma 2.3) Wᵢ is an 𝔽q-linearized polynomial. This means for all polynomials f, g with coefficients in L (i.e. L[X]) and for all c ∈ 𝔽q, we have: Wᵢ(f + g) = Wᵢ(f) + Wᵢ(g) and Wᵢ(c * f) = c * Wᵢ(f). As a corollary of this, Wᵢ is 𝔽q-linear when evaluated on elements of L: Wᵢ(x + y) = Wᵢ(x) + Wᵢ(y) for all x, y ∈ L.

                      noncomputable def AdditiveNTT.polyEvalLinearMap {L : Type u_1} {𝔽q : Type u_2} [Field L] [Field 𝔽q] [Algebra 𝔽q L] (p : Polynomial L) (hp_add : IsLinearMap 𝔽q fun (x : L) => Polynomial.eval x p) :
                      L →ₗ[𝔽q] L

                      Helper function to create a linear map from a polynomial whose evaluation is additive.

                      Equations
                        Instances For
                          theorem AdditiveNTT.W_linear_comp_decomposition {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [h_Fq_char_prime : Fact (Nat.Prime (ringChar 𝔽q))] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) (h_i_add_1 : i + 1 < r) (p : Polynomial L) :
                          (W 𝔽q β (i + 1)).comp p = (W 𝔽q β i).comp p ^ Fintype.card 𝔽q - Polynomial.C (Polynomial.eval (β i) (W 𝔽q β i)) ^ (Fintype.card 𝔽q - 1) * (W 𝔽q β i).comp p
                          theorem AdditiveNTT.W_is_additive {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [h_Fq_char_prime : Fact (Nat.Prime (ringChar 𝔽q))] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) :
                          IsLinearMap 𝔽q fun (x : L) => Polynomial.eval x (W 𝔽q β i)

                          The additive property of Wᵢ: Wᵢ(x + y) = Wᵢ(x) + Wᵢ(y).

                          theorem AdditiveNTT.kernel_W_eq_U {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [h_Fq_char_prime : Fact (Nat.Prime (ringChar 𝔽q))] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) :
                          (polyEvalLinearMap (W 𝔽q β i) ).ker = U 𝔽q β i
                          theorem AdditiveNTT.W_add_U_invariant {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [h_Fq_char_prime : Fact (Nat.Prime (ringChar 𝔽q))] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) (x y : L) :
                          y U 𝔽q β iPolynomial.eval (x + y) (W 𝔽q β i) = Polynomial.eval x (W 𝔽q β i)

                          For all y ∈ Uᵢ, Wᵢ(x + y) = Wᵢ(x).

                          Normalized Subspace Vanishing Polynomials Ŵᵢ(X) := Wᵢ(X) / Wᵢ(βᵢ), ∀ i ∈ {0, ..., r-1} #

                          noncomputable def AdditiveNTT.normalizedW {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) :
                          Equations
                            Instances For
                              theorem AdditiveNTT.normalizedWᵢ_eval_βᵢ_eq_1 {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] {i : Fin r} :
                              Polynomial.eval (β i) (normalizedW 𝔽q β i) = 1

                              The evaluation of the normalized polynomial Ŵᵢ(X) at βᵢ is 1.

                              theorem AdditiveNTT.normalizedW₀_eq_1_div_β₀ {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) :
                              theorem AdditiveNTT.eval_normalizedW_succ_at_beta_prev {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) (h_i_add_1 : i + 1 < r) :
                              Polynomial.eval (β i) (normalizedW 𝔽q β (i + 1)) = 0

                              The evaluation Ŵᵢ₊₁(βᵢ) is 0. This is because Ŵᵢ₊₁ = q⁽ⁱ⁾ ∘ Ŵᵢ and q⁽ⁱ⁾(1) = 0.

                              theorem AdditiveNTT.degree_normalizedW {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) :
                              (normalizedW 𝔽q β i).degree = (Fintype.card 𝔽q) ^ i

                              The degree of Ŵᵢ(X) remains |𝔽q|ⁱ.

                              theorem AdditiveNTT.β_lt_mem_U {r : } [NeZero r] {L : Type u} [Field L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) (j : Fin i) :
                              β j, U 𝔽q β i
                              theorem AdditiveNTT.normalizedWᵢ_vanishing {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) (i : Fin r) (u : L) :
                              u U 𝔽q β iPolynomial.eval u (normalizedW 𝔽q β i) = 0

                              The normalized polynomial Ŵᵢ(X) vanishes on Uᵢ.

                              theorem AdditiveNTT.normalizedW_is_linear_map {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [h_Fq_char_prime : Fact (Nat.Prime (ringChar 𝔽q))] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) :
                              IsLinearMap 𝔽q fun (inner_p : Polynomial L) => (normalizedW 𝔽q β i).comp inner_p

                              The normalized subspace vanishing polynomial Ŵᵢ(X) is 𝔽q-linear.

                              theorem AdditiveNTT.normalizedW_is_additive {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [h_Fq_char_prime : Fact (Nat.Prime (ringChar 𝔽q))] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) :
                              IsLinearMap 𝔽q fun (x : L) => Polynomial.eval x (normalizedW 𝔽q β i)
                              theorem AdditiveNTT.kernel_normalizedW_eq_U {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [h_Fq_char_prime : Fact (Nat.Prime (ringChar 𝔽q))] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] (i : Fin r) :
                              (polyEvalLinearMap (normalizedW 𝔽q β i) ).ker = U 𝔽q β i
                              noncomputable def AdditiveNTT.Xⱼ {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) ( : ) (h_ℓ : r) (j : Fin (2 ^ )) :

                              The Novel Polynomial Basis {Xⱼ(X), j ∈ Fin 2^ℓ} for the space L⦃<2^ℓ⦄[X] over L

                              Equations
                                Instances For
                                  theorem AdditiveNTT.Xⱼ_zero_eq_one {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) ( : ) (h_ℓ : r) :
                                  Xⱼ 𝔽q β h_ℓ 0, = 1

                                  The zero-th element of the novel polynomial basis is the constant 1

                                  theorem AdditiveNTT.degree_Xⱼ {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) (j : Fin (2 ^ )) :
                                  (Xⱼ 𝔽q β h_ℓ j).degree = j

                                  The degree of Xⱼ(X) is j: deg(Xⱼ(X)) = Σ_{i=0}^{ℓ-1} jᵢ * deg(Ŵᵢ(X)) = Σ_{i=0}^{ℓ-1} jᵢ * 2ⁱ = j

                                  noncomputable def AdditiveNTT.basisVectors {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) :
                                  Fin (2 ^ )(Polynomial.degreeLT L (2 ^ ))

                                  The basis vectors {Xⱼ(X), j ∈ Fin 2^ℓ} forms a basis for L⦃<2^ℓ⦄[X]

                                  Equations
                                    Instances For
                                      @[reducible, inline]
                                      abbrev AdditiveNTT.CoeffVecSpace (L : Type u) ( : ) :

                                      The vector space of coefficients for polynomials of degree < 2^ℓ.

                                      Equations
                                        Instances For
                                          noncomputable instance AdditiveNTT.instAddCommGroupCoeffVecSpace {L : Type u} [Field L] ( : ) :
                                          Equations
                                            def AdditiveNTT.toCoeffsVec {L : Type u} [Field L] ( : ) :

                                            The linear map from polynomials (in the subtype) to their coefficient vectors.

                                            Equations
                                              Instances For
                                                theorem AdditiveNTT.linearIndependent_rows_of_lower_triangular_ne_zero_diag {n : } {R : Type u_1} [Field R] (A : Matrix (Fin n) (Fin n) R) (h_lower_triangular : A.BlockTriangular OrderDual.toDual) (h_diag : ∀ (i : Fin n), A i i 0) :

                                                The rows of a square lower-triangular matrix with non-zero diagonal entries are linearly independent.

                                                noncomputable def AdditiveNTT.changeOfBasisMatrix {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) :
                                                Matrix (Fin (2 ^ )) (Fin (2 ^ )) L

                                                The change-of-basis matrix from the novel basis to the monomial basis. Aⱼᵢ = coeff of Xⁱ in novel basis vector 𝕏ⱼ. novel_coeffs * A = monomial_coeffs

                                                Equations
                                                  Instances For
                                                    theorem AdditiveNTT.changeOfBasisMatrix_lower_triangular {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) :
                                                    theorem AdditiveNTT.changeOfBasisMatrix_diag_ne_zero {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) (i : Fin (2 ^ )) :
                                                    changeOfBasisMatrix 𝔽q β h_ℓ i i 0
                                                    theorem AdditiveNTT.changeOfBasisMatrix_det_ne_zero {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) :
                                                    (changeOfBasisMatrix 𝔽q β h_ℓ).det 0

                                                    The determinant of the change-of-basis matrix is non-zero.

                                                    noncomputable instance AdditiveNTT.changeOfBasisMatrix_invertible {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) :
                                                    Invertible (changeOfBasisMatrix 𝔽q β h_ℓ)

                                                    The change-of-basis matrix is invertible, this is required by the proofs of inversion between monomial and novel polynomial basis coefficients.

                                                    Equations
                                                      theorem AdditiveNTT.coeff_vectors_linear_independent {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) :
                                                      LinearIndependent L ((toCoeffsVec ) basisVectors 𝔽q β h_ℓ)

                                                      The coefficient vectors of the novel basis polynomials are linearly independent. This is proven by showing that the change-of-basis matrix to the monomial basis is lower-triangular with a non-zero diagonal.

                                                      theorem AdditiveNTT.basisVectors_linear_independent {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) :
                                                      LinearIndependent L (basisVectors 𝔽q β h_ℓ)

                                                      The basis vectors are linearly independent over L.

                                                      theorem AdditiveNTT.basisVectors_span {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) :
                                                      Submodule.span L (Set.range (basisVectors 𝔽q β h_ℓ)) =

                                                      The basis vectors span the space of polynomials with degree less than 2^ℓ.

                                                      noncomputable def AdditiveNTT.novelPolynomialBasis {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) :
                                                      Module.Basis (Fin (2 ^ )) L (Polynomial.degreeLT L (2 ^ ))

                                                      The novel polynomial basis for L⦃<2^ℓ⦄[X]

                                                      Equations
                                                        Instances For
                                                          noncomputable def AdditiveNTT.polynomialFromNovelCoeffs {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] (𝔽q : Type u) [Field 𝔽q] [Algebra 𝔽q L] (β : Fin rL) ( : ) (h_ℓ : r) (a : Fin (2 ^ )L) :

                                                          The polynomial P(X) derived from coefficients a in the novel polynomial basis (Xⱼ), P(X) := ∑_{j=0}^{2^ℓ-1} aⱼ ⋅ Xⱼ(X)

                                                          Equations
                                                            Instances For
                                                              noncomputable def AdditiveNTT.polynomialFromNovelCoeffsF₂ {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) (a : Fin (2 ^ )L) :
                                                              (Polynomial.degreeLT L (2 ^ ))
                                                              Equations
                                                                Instances For
                                                                  theorem AdditiveNTT.novelPolynomialBasis_is_basisVectors {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) :
                                                                  (novelPolynomialBasis 𝔽q β h_ℓ) = basisVectors 𝔽q β h_ℓ

                                                                  Proof that the novel polynomial basis is indeed the indicated basis vectors

                                                                  noncomputable def AdditiveNTT.monomialToNovelCoeffs {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) (monomial_coeffs : Fin (2 ^ )L) :
                                                                  Fin (2 ^ )L

                                                                  Convert monomial coefficients to novel polynomial basis coefficients. Using row vectors: n = m * A⁻¹.

                                                                  Equations
                                                                    Instances For
                                                                      noncomputable def AdditiveNTT.novelToMonomialCoeffs {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) (novel_coeffs : Fin (2 ^ )L) :
                                                                      Fin (2 ^ )L

                                                                      Convert novel polynomial basis coefficients to monomial coefficients. Using row vectors: m = n * A.

                                                                      Equations
                                                                        Instances For
                                                                          theorem AdditiveNTT.monomialToNovel_novelToMonomial_inverse {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) (coeffs : Fin (2 ^ )L) :
                                                                          novelToMonomialCoeffs 𝔽q β h_ℓ (monomialToNovelCoeffs 𝔽q β h_ℓ coeffs) = coeffs

                                                                          The conversion functions are inverses of each other. (Monomial -> Novel -> Monomial)

                                                                          theorem AdditiveNTT.novelToMonomial_monomialToNovel_inverse {r : } [NeZero r] {L : Type u} [Field L] [Fintype L] [DecidableEq L] (𝔽q : Type u) [Field 𝔽q] [Fintype 𝔽q] [hF₂ : Fact (Fintype.card 𝔽q = 2)] [Algebra 𝔽q L] (β : Fin rL) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)] ( : ) (h_ℓ : r) (coeffs : Fin (2 ^ )L) :
                                                                          monomialToNovelCoeffs 𝔽q β h_ℓ (novelToMonomialCoeffs 𝔽q β h_ℓ coeffs) = coeffs

                                                                          The conversion functions are inverses of each other. (Novel -> Monomial -> Novel)