A-10.6 Isomorphism between Polynomials and Vectors over Integers

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,,xn1) form the mapping’s output vector. Technically, σ is defined as:

σ : f(x) [X](Xn + 1)  (f(x0),f(x1),f(x2),,f(xn1)) 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 the algebraic operations (+,⋅) of the mapped elements preserve correctness with homomorphism.

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 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 + + an1Xn1

σ(fa(X)) = (fa(x0),fa(x1),fa(x2),,fa(xn1)) = ( i=0n1ai(x0)i, i=0n1ai(x1)i, i=0n1ai(x2)i,, i=0n1ai(xn1)i)

fb(X) = b0 + b1X + b2X2 + + bn1Xn1

σ(fb(X)) = (fb(x0),fb(x1),fb(x2),,fb(xn1)) = ( i=0n1bi(x0)i, i=0n1bi(x1)i, i=0n1bi(x2)i,, i=0n1bi(xn1)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 + + (an1 + bn1)Xn1)

= ( i=0n1(ai + bi)(x0)i,  i=0n1(ai + bi)(x1)i,  i=0n1(ai + bi)(x2)i,,  i=0n1(ai + bi)(xn1)i)

= ( i=0n1ai(x0)i,  i=0n1ai(x1)i,  i=0n1ai(x2)i,,  i=0n1ai(xn1)i)

+ ( i=0n1bi(x0)i,  i=0n1bi(x1)i,  i=0n1bi(x2)i,,  i=0n1bi(xn1)i)

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

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

𝛔(fa(X) fb(X)) = 𝛔( ( i=0n1aiXi) ( i=0n1biXi) )

= ( ( i=0n1aix0i) ( i=0n1bix0i) ,  ( i=0n1aix1i) ( i=0n1bix1i) ,  ( i=0n1aix2i) ( i=0n1bix2i) ,

      , ( i=0n1aixn1i) ( i=0n1bixn1i) )

= ( i=0n1ai(x0)i,  i=0n1ai(x1)i, ,  i=0n1ai(xn1)i)

     ( i=0n1bi(x0)i,  i=0n1bi(x1)i, ,  i=0n1bi(xn1)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(xn1)) = (v0,v1,,vn1)

σ(fb(X)) = (fb(x0),fb(x1),,fb(xn1)) = (u0,u1,,un1)

Then, the following is true:

σ(fa(X) fb(X)) = (fa(x0) fb(x0),fa(x1) fb(x1),,fa(xn1) fb(xn1)) = (v0u0,v1u1,,vn1un1)

= (v0,v1,,vn1) (u0,u1,,un1)

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,,xn1}. 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 computation 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 to 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 f𝑎𝑏(X) = fa(X) fb(X), and f𝑎𝑏(X) is the reduced polynomial such that f𝑎𝑏(X) = Q(X) (Xn + 1) + f𝑎𝑏(X) for some quotient polynomial Q(X). Then, as illustrated in Summary A-5.1.2 (§A-5.1.2), f𝑎𝑏(X) and f𝑎𝑏(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,,xn1}to be the roots of Xn + 1, then we can ensure that the decoded vector of f𝑎𝑏(X) is identical to that of f𝑎𝑏(X) which we expect. Therefore, we can replace the higher-degree polynomial f𝑎𝑏(X) with the reduced polynomial f𝑎𝑏(X) and continue with any further polynomial additions or multiplications by using f𝑎𝑏(X). Also, by applying polynomial ring reduction, we can enhance the computational efficiency of polynomial addition/multiplication as well as preserve the isomorphism of the σ mapping, and therefore we can freely convert between vectors & polynomials and do additions/multiplications.

For applying this polynomial ring reduction, the polynomial modulus can be any polynomial as far 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 why we let the polynomial ring modulus be a cyclotomic polynomial (especially the (μ = 2n)-th cyclotomic polynomial, Xn + 1) is because its n distinct roots are well-defined (i.e., primitive (μ = 2n)-th roots of unity) and thus can be quickly computed even in the case 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 + w1 xi + w2 xi2 + + wn1 xin1

fd(X) = w0+ w1xi + w2xi2 + + wn1xin1

wi wimod 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 + w1 xi + w2 xi2 + + wn1 xin1

(w0 + w1 xi + w2 xi2 + + wn1 xin1) mod t

(w0 mod t) + (w1 mod t) xi + (w2 mod t) xi2 + + (wn1 mod t) xin1)

w0+ w1xi + w2xi2 + + wn1xin1

= 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 + 10 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(𝑚𝑜𝑑t) exist, in order to use the isomorphic σ mapping.

We start with two constraints: (1) we choose t only such that t is a prime number p; (2) 𝑡–1 is some multiple of 2n (i.e., (𝑡–1) = k 2n for some integer k).

We learned from Fermat’s Little Theorem in Theorem A-4.2.4 (§A-4.2) the following: at1 1 mod t if and only if a and t are co-prime. This means that if t is a prime, then at1 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 gt1 1 mod t. Since t 1 = k 2n for some k, gk2n (gk)2n 1 mod t. Then, 𝖮𝗋𝖽t(gk) 2n. However, since 𝖮𝗋𝖽t(g) = t 1, for all a such that a < 𝑡–1 = k 2n, ga1 mod t. In other words, for all b such that b < 2n, (gk)b1 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 𝑡–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 𝑡–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 𝑡–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) t22t + 1 1 mod t

While ω2n 1 mod t, ωn1 mod t, because if so, Xn + 1 = ωn + 1 = 1 + 1 = 20, 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

(ω2n1)n + 1 (ω2n2) ωn + 1 ωn + 1 t 1 + 1 0 mod t

Note that ω,ω3,ω5,,ω2n1 are all distinct values in t×, because 𝖮𝗋𝖽t(c) = 2n. Thus, {ω2i+1}i=0n1 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.5 Isomorphism between Polynomials and Vectors over Integer (Ring)