Introduction

Polynomials constitute of a rich class of functions. A polynomial in a single variable defined on a field F\mathbb{F} is a function of the form:

p(x)=cdxd+cd−1xd−1+...+c1x+c0 p(x) = c_d x^d + c_{d - 1} x^{d - 1} + ... + c_1 x + c_0

where the variable xx and coefficients ci∈F,∀i∈[d]c_i \in \mathbb{F}, \forall i \in [d]. The integer dd is called the degree of p(x)p(x).

Properties

Polynomials have two fundamental properties:

  1. A non-zero polynomial of degree dd has at most dd distinct roots.
  2. Given d+1d + 1 pairs {(ai,bi)∈F2:i∈[d+1]}\{ (a_i, b_i) \in \mathbb{F}^2 : i \in [d + 1] \}, such that ai≠aja_i \neq a_j for i≠ji \neq j, there is a unique polynomial p(x)p(x) with degree at most dd that goes through all these points.

Number of Distinct Roots

We prove claim 1 by induction.

  1. The base case is d=0d = 0. As the polynomial is non-zero, it does not have any root.

  2. Suppose the claim holds for non-negative integers ≤d\le d and p(x)p(x) is a polynomial of degree d+1d + 1. If p(x)p(x) has a root zz, by polynomial division, we can rewrite p(x)p(x) as

    p(x)=(x−a)kq(x) p(x) = (x - a)^k q(x)

    where k≥1k \ge 1 is the largest integer such that (x−a)k∣p(x)(x - a )^k | p(x). Hence q(x)q(x) has degree d+1−kd + 1 - k. For any z≠az \neq a, if p(z)=(z−a)kq(z)=0p(z) = (z - a)^k q( z ) = 0, then q(z)=0q(z) = 0, which implies that zz is a root of q(x)q(x). By the inductive hypothesis, it has at most d+1−kd + 1 - k distinct roots.

Remark: We don't claim that p(x)p(x) must have a root, but it has at most dd distinct roots, if it has degree dd.

Unique Interpolation

We first prove the existence of the interpolation, then prove its uniqueness.

Existence of Interpolation

The method is called Lagrange Interpolation. Our basic building blocks are a collection of special polynomials {δi(x):i∈[d+1]}\{ \delta_i( x ) : i \in [d + 1] \}, which we call signal functions, such that ∀i∈[d+1]\forall i \in [d + 1],

  1. The polynomial δi(x)\delta_i( x ) has degree dd.

  2. The polynomial takes value 1 at aia_i, i.e., δi(ai)=1\delta_i(a_i) = 1.

  3. The polynomial takes value 0 at aja_j for j≠ij \neq i, i.e., δi(aj)=0\delta_i(a_j) = 0.

First, define δi′(x)=∏j≠i(x−aj)\delta_i'(x) = \prod_{j \neq i} (x - a_j). It equals to 00 on aj,∀j≠ia_j, \forall j \neq i. We normalize its value at aia_i, to obtain

δi(x)=δi′(x)δi′(ai)=∏j≠i(x−aj)∏j≠i(ai−aj). \delta_i(x) = \frac{\delta_i'(x)}{\delta_i'(a_i)} = \frac{\prod_{j \neq i} (x - a_j) }{ \prod_{j \neq i} (a_i - a_j) }.

With proper scaling and summation, p(x)p(x) is given by

p(x)=∑i=1d+1bi⋅δi(x) p(x) = \sum_{i = 1}^{d + 1} b_i \cdot \delta_i(x)

Uniqueness of Interpolation

Suppose for contradiction that there is another polynomial q(x)q(x), s.t., p(ai)=q(ai),∀i∈[d+1]p(a_i) = q(a_i), \forall i \in [d + 1]. Let r(x)=p(x)−q(x)r(x) = p(x) - q(x). If r(x)≡0r(x) \equiv 0, then the claim holds trivially. Otherwise, r(x)r(x) is a non-zero polynomial with degree at most dd. Claim 1 asserts that r(x)r(x) has at most dd distinct roots, contradicting that r(ai)=0r(a_i) = 0 for i∈[d+1]i \in [d + 1].

Remark: uniqueness can also be proven by showing the following equation has unique solution [cd,cd−1,...,c0][ c_d, c_{d - 1}, ..., c_0]:

[a1da1d−1...a11a2da2d−1...a21...ad+1dad+1d−1...ad+11][cdcd−1...c0]=[b1b1...bd+1] \begin{bmatrix} a_1^d & a_1^{d - 1} & ... & a_1 & 1\\ a_2^d & a_2^{d - 1} & ... & a_2 & 1\\ ...\\ a_{d + 1}^d & a_{d + 1}^{d - 1} & ... & a_{d + 1} & 1 \end{bmatrix} \begin{bmatrix} c_d \\ c_{d - 1} \\ ... \\ c_0 \end{bmatrix} = \begin{bmatrix} b_1 \\ b_{1} \\ ...\\ b_{d + 1} \end{bmatrix} \\

The left matrix is called Vandermonde Matrix, whose determinant is

det⁡[a1da1d−1...a11a2da2d−1...a21...ad+1dad+1d−1...ad+11]=det⁡[00...01a2d−a1a2d−1a2d−1−a1a2d−2...a2−a11...ad+1d−a1ad+1d−1ad+1d−1−a1ad+1d−2...ad+1−a11]=∏i=1d+1(ai−a1)det⁡[a2da2d−1...a21...ad+1dad+1d−1...ad+11]...=∏i<j(aj−ai) \begin{aligned} &\det \begin{bmatrix} a_1^d & a_1^{d - 1} & ... & a_1 & 1\\ a_2^d & a_2^{d - 1} & ... & a_2 & 1\\ ...\\ a_{d + 1}^d & a_{d + 1}^{d - 1} & ... & a_{d + 1} & 1 \end{bmatrix} \\ =& \det \begin{bmatrix} 0& 0 & ... & 0 & 1\\ a_2^d - a_1 a_2^{d - 1} & a_2^{d - 1} - a_1 a_2^{d - 2}& ... & a_2 - a_1 & 1\\ ...\\ a_{d + 1}^d - a_1 a_{d + 1}^{d - 1} & a_{d + 1}^{d - 1} - a_1 a_{d + 1}^{d - 2}& ... & a_{d + 1} - a_ 1& 1 \end{bmatrix} \\ =&\prod_{i = 1}^{d + 1} (a_i - a_1) \det \begin{bmatrix} a_2^d & a_2^{d - 1} & ... & a_2 & 1\\ ...\\ a_{d + 1}^d & a_{d + 1}^{d - 1} & ... & a_{d + 1} & 1 \end{bmatrix} \\ ...\\ =& \prod_{i < j} (a_j - a_i) \end{aligned}

which is non-zero when ai≠aja_i \neq a_j.

Applications

Pairwise Independent Hash Function.

Assume that we want to map a set of elements U≐{0,1,...,u−1}\mathcal{U} \doteq \{0, 1, ..., u - 1\} into some set F\mathbb{F}, by picking a function hh uniformly at random from a family of functions H≐{h:U→F}\mathcal{H} \doteq \{ h : \mathcal{U} \rightarrow \mathbb{F} \}. For an i∈Ui \in \mathcal{U}, the value Yi≐h(i)Y_i \doteq h(i) is a random variable. The YiY_i's are called pairwise independent, if for i,j∈U,i≠ji, j \in \mathcal{U}, i \neq j and bi,bj∈Fb_i, b_j \in \mathbb{F},

Pr⁡h∈H[Yi=bi,Yj=bj]=Pr⁡h∈H[Yi=bi]Pr⁡h∈H[Yj=bj]. \Pr_{h \in \mathcal{H} } [Y_i = b_i, Y_j = b_j] = \Pr_{h \in \mathcal{H} } [Y_i = b_i] \Pr_{h \in \mathcal{H} } [Y_j = b_j].

Similarly we can define kk-wise independence. For any 0≤i1<i2<...<ik<u0 \le i_1 < i_2 <... < i_k < u, and bi1,bi2,...,bik∈Fb_{i_1} , b_{i_2}, ..., b_{i_k} \in \mathbb{F}, we have

Pr⁡h∈H[Yi1=bi1,...Yik=bik]=∏jPr⁡h∈H[Yij=bij]. \Pr_{h \in \mathcal{H} } [ Y_{i_1} = b_{i_1}, ... Y_{i_k} = b_{i_k} ] = \prod_{j} \Pr_{h \in \mathcal{H} } [ Y_{i_j} = b_{i_j}].

Finite Field Fp\mathbb{F}_p

Now we restrict our discussion to the finite field Fp={0,1,...,p−1}\mathbb{F}_p = \{0, 1, ..., p - 1\}, where pp is a prime larger than uu.

Theorem. The set of all possible functions from U\mathcal{U} to Fp\mathbb{F}_p is pairwise independent.

Proof:

Pr⁡[Yi=a,Yj=b]=pu−2pu=1p2=Pr⁡[Yi=a]⋅Pr⁡[Yj=b]. \begin{aligned} \Pr[Y_i = a, Y_j = b] = \frac{p^{u - 2}}{p^u} = \frac{1}{p^2} = \Pr[Y_i = a] \cdot \Pr[Y_j = b]. \end{aligned}

□\square

However, each of the functions takes ulog⁡pu \log p bits to represent. To reduce the space, we restrict to the family:

H1={p(x)=c1x+c0∣c1,c0∈Fp} \mathcal{H_1} = \{ p(x) = c_1 x + c_0 \mid c_1, c_0 \in \mathbb{F}_p \}

which contains all polynomials with degree at most 1 in the field Fp\mathbb{F}_p, i.e., all lines in Fp\mathbb{F}_p. There are p2p^2 such functions.

We know that, for given x1,x2∈U,x1≠x2x_1, x_2 \in \mathcal{U}, x_1 \neq x_2, then ∀y1,y2∈Fp\forall y_1, y_2 \in \mathbb{F}_p, there is a unique line that goes through (x1,y1),(x2,y2)(x_1, y_1), (x_2, y_2). If we pick a line uniformly at random from H1\mathcal{H}_1, then the probability that it goes through this pair of points is 1/p2{1} / {p^2}.

This already implies pairwise independence, as

Pr⁡[h(x1)=y1]=∑y2=0p−1Pr⁡[h(x1)=y1,h(x2)=y2]=1p \Pr[h(x_1) = y_1 ] = \sum_{y_2 = 0}^{p - 1} \Pr[h(x_1) = y_1, h(x_2) = y_2] = \frac{1}{p}

In a similar manner, we can construct a kk-wise independent family:

Hk−1={p(x)=ck−1xk−1+ck−2xk−2+...+c1x1+c0∣ck−1,...,c0∈Fp}. \mathcal{H_{k - 1}} = \{ p(x) = c_{k - 1} x^{k - 1} + c_{k - 2} x^{k - 2} + ... + c_1 x_1 + c_0 \mid c_{k - 1}, ..., c_0 \in \mathbb{F}_p \}.

Note that ∣H∣=pk|\mathcal{H}| = p^{k}. For 0≤x1<x2<...<xk<u0 \le x_1 < x_2 < ... < x_k < u, and y1,y2,...,yk∈Fpy_1, y_2, ..., y_k \in \mathbb{F}_p, there is a unique polynomial that goes through the points (x1,y1),(x2,y2),...,(xk,yk)(x_1, y_1), (x_2, y_2), ..., (x_k, y_k).

Key-Sharing

Suppose that we have nn-candidates who knows some information about the key and we require that only when no less than kk of them aggragate their information can they figure the actual key. No group of less than kk candidates can achieve this. The way we do it is as follows:

  1. Select a large prime number pp.
  2. Select k+1k+1 random numbers y0,y1,...,yky_0, y_1, ..., y_k from [p−1][p-1].
  3. Generate the unique polynomial p(x)p(x) with degree kk that goes through (0,y0),(1,y1),...,(k,yk)(0, y_0), (1, y_1), ..., (k, y_k).
  4. Inform the value of p(1)p(1) to the first person, p(2)p(2) to the second one, ... and p(n)p(n) to the nn-th person.

If k−1k - 1 people pool their keys together, then there are pp possible polynomials that goes through all their keys, each has different value at point 0. The probability of guessing the correct key is given by 1p\frac{1}{p}.

Reference

[1]. CS 70. Discrete Mathematics and Probability Theory.