A-10.6 Isomorphism between Polynomials and Vectors over Integers (and Ring)

Now, let’s define a mapping σ from the (n −1)-degree polynomial ring to the n-dimensional vector space, such that an input polynomial’s list of y values evaluated at n distinct x ∈ ℤ coordinates (e.g., x0,x1,⋯,xn−1) forms the mapping’s output vector. Technically, σ is defined as:

σ : f(x) ∈ ℤ[X]∕(Xn + 1)  (f(x0),f(x1),f(x2),⋯,f(xn−1)) ∈ n

Now, we will explain why the mapping σ is isomorphic, which means that σ is a bijective one-to-one mapping from ℤ[X]∕(Xn + 1) to n, and it preserves the algebraic operations (+,⋅) (i.e., σ is a homomorphism for addition and multiplication).

Bijective: In the (n −1)-degree polynomial ring, a list of y values evaluated at some statically chosen n distinct x coordinates defines a unique polynomial because, algebraically, there exists only one (n −1)-degree (or a lesser degree) polynomial that passes through each given set of n distinct (x,y) coordinates. We proved this in Lagrange Polynomial Interpolation (Theorem A-15 in §A-15).

Homomorphic: The homomorphism of the mapping σ on the (+,⋅) operations means that the following two relationships hold:

σ(fa(X) + fb(X)) = σ(fa(X)) + σ(fb(X))

σ(fa(X) ⋅fb(X)) = σ(fa(X)) ⊙σ(fb(X)) # is Hadamard vector multiplication (Summary A-10.1)

To prove our σ mapping’s homomorphism, let’s denote the input polynomials fa(X), fb(X), and their σ-mapped output vectors as follows:

fa(X) = a0 + a1X + a2X2 + ⋯ + an−1Xn−1

σ(fa(X)) = (fa(x0),fa(x1),fa(x2),⋯,fa(xn−1)) = (i=0n−1ai(x0)i,i=0n−1ai(x1)i,i=0n−1ai(x2)i,⋯,i=0n−1ai(xn−1)i)

fb(X) = b0 + b1X + b2X2 + ⋯ + bn−1Xn−1

σ(fb(X)) = (fb(x0),fb(x1),fb(x2),⋯,fb(xn−1)) = (i=0n−1bi(x0)i,i=0n−1bi(x1)i,i=0n−1bi(x2)i,⋯,i=0n−1bi(xn−1)i)

Given the above setup, we can see that σ preserves homomorphism on the (+) operation as follows:

𝛔(fa(X) + fb(X)) = 𝛔((a0 + b0) + (a1 + b1)X + (a2 + b2)X2 + ⋯ + (an−1 + bn−1)Xn−1)

= (i=0n−1(ai + bi)(x0)i, i=0n−1(ai + bi)(x1)i, i=0n−1(ai + bi)(x2)i,⋯, i=0n−1(ai + bi)(xn−1)i)

= (i=0n−1ai(x0)i, i=0n−1ai(x1)i, i=0n−1ai(x2)i,⋯, i=0n−1ai(xn−1)i)

+ (i=0n−1bi(x0)i, i=0n−1bi(x1)i, i=0n−1bi(x2)i,⋯, i=0n−1bi(xn−1)i)

= 𝛔(fa(X)) + 𝛔(fb(X))

Also, we can see that σ preserves homomorphism on the (⋅) operation as follows:

𝛔(fa(X) ⋅fb(X)) = 𝛔( (i=0n−1aiXi)(i=0n−1biXi) )

= ( (i=0n−1aix0i) (i=0n−1bix0i) ,  (i=0n−1aix1i) (i=0n−1bix1i) ,  (i=0n−1aix2i) (i=0n−1bix2i) ,

      , (i=0n−1aixn−1i) (i=0n−1bixn−1i) )

= (i=0n−1ai(x0)i, i=0n−1ai(x1)i, , i=0n−1ai(xn−1)i)

    (i=0n−1bi(x0)i, i=0n−1bi(x1)i, , i=0n−1bi(xn−1)i)

= 𝛔(fa(X))𝛔(fb(X))

In summary, σ preserves the following homomorphism:

σ(fa(X) + fb(X)) = σ(fa(X)) + σ(fb(X))

σ(fa(X) ⋅fb(X)) = σ(fa(X)) ⊙σ(fb(X))

However, for σ(fa(X) ⋅fb(X)) = σ(fa(X)) ⊙σ(fb(X)), we need further reasoning to justify that this relation holds in polynomial rings, which is explained below.

Polynomial Ring Reduction: Suppose that we did not have the polynomial ring setup Xn + 1. Then, if we multiply fa(X) and fb(X), then fa(X) ⋅fb(X) may become a new polynomial whose degree is higher than n −1. This higher-degree polynomial would still decode into the expected correct vector. Suppose the following:

σ(fa(X)) = (fa(x0),fa(x1),⋯,fa(xn−1)) = (v0,v1,⋯,vn−1)

σ(fb(X)) = (fb(x0),fb(x1),⋯,fb(xn−1)) = (u0,u1,⋯,un−1)

Then, the following is true:

σ(fa(X) ⋅fb(X)) = (fa(x0) ⋅fb(x0),fa(x1) ⋅fb(x1),⋯,fa(xn−1) ⋅fb(xn−1)) = (v0u0,v1u1,⋯,vn−1un−1)

= (v0,v1,⋯,vn−1) ⊙(u0,u1,⋯,un−1)

As shown above, even if fa(X) ⋅fb(X) results in a polynomial with a degree higher than n −1, it can be decoded into the expected correct vector. However, the σ mapping loses the property of isomorphism between a polynomial and a vector because if a polynomial’s degree is higher than n −1, then there can be more than 1 polynomial that passes through the given n distinct X coordinates: {x0,x1,⋯,xn−1}. This is a problem because, if the σ mapping supports only polynomial-to-vector mappings and not vector-to-polynomial mappings, then we cannot convert vectors into polynomials in the first place and do isomorphic computations. Another minor issue is that if the polynomial degree term is higher than n −1, then the computational overhead of decoding (i.e., polynomial evaluation) becomes larger than before.

To resolve these two minor issues, we let the n distinct X coordinates of evaluation be the solutions of the polynomial ring modulo Xn + 1 (where n is some power of 2) and reduce fa(X) ⋅fb(X) to a new polynomial modulo Xn + 1 whose degree is at most n −1. Let fab(X) = fa(X) ⋅fb(X), and fab(X) be the reduced polynomial such that fab(X) = Q(X) ⋅(Xn + 1) + fab(X) for some quotient polynomial Q(X). Then, as illustrated in Summary A-5.1.2 (§A-5.1.2), fab(X) and fab(X) evaluate to the same value if they are evaluated at the roots of Xn + 1 (by zeroing out the Q(X) term). Therefore, if we let the n distinct evaluating points {x0,x1,⋯,xn−1}be the roots of Xn + 1, then we can ensure that the decoded vector of fab(X) is identical to that of fab(X), which we expect. Therefore, we can replace the higher-degree polynomial fab(X) with the reduced polynomial fab(X) and continue with any further polynomial additions or multiplications using fab(X). Also, by applying polynomial ring reduction, we can enhance the computational efficiency of polynomial addition and multiplication, as well as preserve the isomorphism of the σ mapping. Therefore, we can freely convert between vectors & polynomials and perform additions and multiplications.

For applying this polynomial ring reduction, the polynomial modulus can be any polynomial as long as it has at least n distinct roots. In practice, we often choose Xn + 1 as the polynomial ring modulus, which is the (μ = 2n)-th cyclotomic polynomial (§A-8.1). The reason we let the polynomial ring modulus be a cyclotomic polynomial (especially the (μ = 2n)-th cyclotomic polynomial, Xn + 1) is that its n distinct roots are well-defined (i.e., primitive (μ = 2n)-th roots of unity) and thus can be quickly identified even when n is large.

Polynomial Coefficient Modulo Reduction: In addition, we often reduce the polynomial coefficients based on some modulus t to keep the size of the coefficients lower than a certain limit for the purpose of computational efficiency. Suppose two polynomials fc(X) and fd(X) have congruent coefficients modulo t as follows:

fc(X) = w0 + w1xi + w2xi2 + ⋯ + wn−1xin−1

fd(X) = w0+ w1xi + w2xi2 + ⋯ + wn−1xin−1

wiwimod t

Then, their evaluated value fc(xi) and fd(xi) for any xi is guaranteed to be congruent modulo t, as shown below:

fc(xi) = w0 + w1xi + w2xi2 + ⋯ + wn−1xin−1

≡(w0 + w1xi + w2xi2 + ⋯ + wn−1xin−1) mod t

≡(w0 mod t) + (w1 mod t) ⋅xi + (w2 mod t) ⋅xi2 + ⋯ + (wn−1 mod t) ⋅xin−1)

w0+ w1xi + w2xi2 + ⋯ + wn−1xin−1

= fd(xi)

Summary: Since σ is bijective and homomorphic, σ is an isomorphic mapping between the (n −1)-degree polynomial ring t[X]∕Xn + 1 and the n-dimensional vector space tn.

A-10.6.1 Finding Appropriate Modulus t

To isomorphically evaluate a polynomial in t[X]∕Xn + 1 into an n-dimensional vector, we need to evaluate the polynomial at n distinct roots of Xn + 1 mod t. However, Xn + 1 mod t does not have n distinct roots for all combinations of (degree, modulus) = (n,t). For example, if n = 2 and t = 3, then X2 + 1≢0 mod 3 for any possible values of X = {0,1,2}. Therefore, our goal is to find a satisfactory t given a fixed n such that n distinct roots of Xn + 1(modt) exist in order to use the isomorphic σ mapping.

We start with two constraints: (1) choose t to be a prime number; (2) ensure t −1 is a multiple of 2n.

We learned from Fermat’s Little Theorem in Theorem A-4.2.4 (§A-4.2) the following: at−1 ≡1 mod t if and only if a and t are co-prime. This means that if t is a prime, then at−1 ≡1 mod t for all a ∈ t× (i.e., t without {0}). Suppose g is the generator of t× whose powered values generate all elements of t×. Then, 𝖮𝗋𝖽t(g) = t −1 and gt−1 ≡1 mod t. Since t −1 = k ⋅2n for some k, gk⋅2n(gk)2n ≡1 mod t. Then, 𝖮𝗋𝖽t(gk) ≤2n. However, since 𝖮𝗋𝖽t(g) = t −1, for all a such that a < t −1 = k ⋅2n, ga≢1 mod t. In other words, for all b such that b < 2n, (gk)b≢1 mod t. Thus, 𝖮𝗋𝖽t(gk) = 2n.

Let c = gk. Since 𝖮𝗋𝖽t(c) = 2n, c2n ≡1 mod t. In other words, (cn)2 ≡1 mod t. Now, cn can be only 1 or -1. The reason is that in the relation X2 ≡1 mod t, X can be mathematically only 1 or −1 ≡t −1 mod t. If we substitute X = cn, then cn can be only 1 or −1 ≡t −1 mod t. But 𝖮𝗋𝖽t(c) = 2n, thus cn cannot be 1 (because 11 = 1 and 1 is smaller than the order of c: 2n > 1). Thus, cn can be only −1 ≡t −1 mod t. If cn = −1 ≡t −1 mod t, then c is the root of Xn + 1 mod t, because Xn + 1 = cn + 1 ≡(t −1) + 1 ≡0 mod t.

In conclusion, given a cyclotomic polynomial Xn + 1, if we choose a prime t such that t −1 = k ⋅2n for some integer k, then one root of Xn + 1 mod t is: X = c = gk.

Once we have found one root of Xn + 1, then we can derive all n distinct roots of Xn + 1. Suppose ω is one root of Xn + 1 mod t. Then we derive the following:

ωn + 1 ≡0 mod t

ωn ≡t −1 mod t

ω2n ≡(t −1) ⋅(t −1) ≡t2 −2t + 1 ≡1 mod t

While ω2n ≡1 mod t, ωn≢1 mod t, because if so, Xn + 1 = ωn + 1 = 1 + 1 = 2≠0, which contradicts the fact that ω is a root of Xn + 1. Therefore, 𝖮𝗋𝖽t(c) = 2n.

Now, we derive the remaining n −1 distinct roots of Xn + 1 mod t as follows:

(ω3)n + 1 ≡(ω2n) ⋅ωn + 1 ≡ωn + 1 ≡t −1 + 1 ≡0 mod t

(ω5)n + 1 ≡(ω4n) ⋅ωn + 1 ≡ωn + 1 ≡t −1 + 1 ≡0 mod t

(ω2n−1)n + 1 ≡0 mod t
for any odd k = 2j + 1, (ω2j+1)n = (ω2n)jωn = 1j ⋅(−1) = −1, so (ωk)n + 1 = 0

Note that ω,ω3,ω5,⋯,ω2n−1 are all distinct values in t×, because 𝖮𝗋𝖽t(c) = 2n. Thus, {ω2i+1}i=0n−1 are n distinct roots of Xn + 1. At the same time, since these are the roots of the cyclotomic polynomial Xn + 1, these are n distinct primitive (μ = 2n)-th roots of unity.

We summarize our findings as follows:

Theorem A-10.6.1 Isomorphism between Polynomials and Vectors over Integers (Ring)