• No results found

Real Polynomial Conversion (RPC)

Techniques Using Mixed Integer Linear Programming

5.2 Techniques for Polynomial Conversion

5.2.3 Real Polynomial Conversion (RPC)

In [31], J. Borghoff et al. provided a method based on converting polynomial equations over F2 into polynomial equations over R. We call this method Real Polynomial Con-version (RPC). They studied their method for systems of polynomial equations due to the Bivium Cipher but an algorithm for general systems of polynomial equations is still missing. We provide an algorithm for RPC to solve general systems of polynomial equations. The first ingredient that we need is the following definition.

Definition 5.2.5. The standard conversion is given by the map φ : F2 = {0, 1} → {0, 1} ⊂ R defined by φ(0) = 0 and φ(1) = 1. The map φ can be extended to a map Φ : F2[x1, . . . , xn] −→ R[X1, . . . , Xn] defined by

c 7→ φ(c) xi 7→ Xi

where c ∈ F2. Then the standard representation of a polynomial f ∈ F2[x1, . . . , xn] is Φ(f ).

So the task of solving the polynomial equation system f1 = · · · = fm = 0 can be rephrased as follows: Find a tuple (a1, . . . , an) ∈ {0, 1}n such that

F1(a1, . . . , an) ≡ 0 (mod 2) ...

Fm(a1, . . . , an) ≡ 0 (mod 2)

(5.4)

where Fi ∈ R[X1, . . . , Xn] are standard representations of the polynomials fi. Thus we are looking for an integer solution (a1, . . . , an) of the system 5.4 which satisfies 0 ≤ ai ≤ 1. So the idea is to formulate this system as a system of linear equalities and inequalities over R and solve it using an IP-solver.

Example 5.2.6. Consider the polynomial f = x1x2+x3x4+x5+x6+1 ∈ F2[x1, . . . , x6].

In the following we explicitly explain how to lift this polynomial over R using standard representation in such a way that the residue class of a zero of Φ(f ) in F2 represent a zero of f . We use the following conversion rules for addition and multiplication.

Φ(xixj) = XiXj

Φ(xi+ xj) = Xi+ Xj − 2XiXj

Considering each term as a node we apply the map Φ once for each pair of nodes. This results in the following conversion steps.

1) f = (x1x2+ x3x4) + (x5+ x6) + 1.

2) Taking standard representation we have

(X1X2+ X3X4− 2X1X2X3X4) + (X5+ X6− 2X5X6) + 1.

3) Let f0 = X1X2 + X3X4 − 2X1X2X3X4, and f00 = X5 + X6− 2X5X6. Now the polynomial in step 2) becomes (f0) + (f00) + 1.

4) Taking standard representation we have f0+ f00− 2f0f00+ 1.

5) Let f000 = f0 + f00− 2f0f00. Now the polynomial in step 4) becomes f000+ 1 6) Finally, taking standard representation we have f000+ 1 − 2f000 = 1 − f000. By substituting the values of f0, f00 and f000 we have the polynomial

F = 8X1X2X3X4X5X6− 4X1X2X3X4X5− 4X1X2X3X4X6+ 2X1X2X3X4

−4X1X2X5X6− 4X3X4X5X6+ 2X1X2X5+ 2X3X4X5+ 2X1X2X6+ 2X3X4X6

−X1X2− X3X4+ 2X5X6 − X5− X6+ 1 ∈ R[X1, . . . , X6]

(5.5) The polynomial F has 16 terms in its support and degree 6.

The effect of standard representation is that every tuple (a1, . . . , an) ∈ {0, 1}n at which F is satisfied corresponds uniquely to a zero of f in Fn2, that is, the residue class of (a1, . . . , an) in Fn2 represent a zero of f . To see this it suffices to observe the standard conversion rule for addition which is given by the following table.

x1 x2 x1+ x2 X1+ X2− 2 · X1· X2

0 0 0 0

0 1 1 1

1 0 1 1

1 1 0 0

The standard representation results in increasing degree and increasing number of terms over the real domain.

Remark 5.2.7. (Splitting)

To keep the degrees of converted polynomials low, we introduce some new auxiliary variables. This will split a long polynomial into smaller polynomials, then we take its standard representations. The maximum number of terms in a polynomial over F2 could be four to keep the real polynomial quadratic. For instance, the equation x1x2+ x3x4+ x5+ x6+ 1 = 0 can be split up into two equations y1+ x1x2 = x3x4+ x5

and y1 = x6+ 1 having at most four terms. The variable y1 is the splitting variable.

To keep the degree of real polynomial two we introduce two more variables y2 and y3

as follows:

y1+ y2 = y3+ x5 y1 = x6+ 1 y2 = x1x2 y3 = x3x4

Now the standard representation results in the following four quadratic equations which hold over reals.

Y1+ Y2− 2Y1Y2 = Y3+ X5− 2Y3X5

Y1 = 1 − X6 Y2− X1X2 = 0 Y3− X3X4 = 0

While converting a boolean equation, we ensure that the new equations are defined over R. The only requirement we have is that the solution of the system over F2 is also a solution of the real system. The additional non-binary solutions of the real system can be ignored.

In the following we abuse the notation Tn. Since the monoid of terms Tn does not depend on the ring of coefficients, we consider Tn as monoid of terms of F2[x1, . . . , xn] and R[X1, . . . , Xn]. The only distinction we make is the following. An element of the monoid of terms for F2[x1, . . . , xn] will be denoted by t and an element of the monoid of terms for R[X1, . . . , Xn] will be denoted by T . The following proposition turns above ideas into an effective algorithm.

Proposition 5.2.8. (Real Polynomial Conversion (RPC) )

Let f1, . . . , fm ∈ P = F2[x1, . . . , xn]. Then the following instructions define an algo-rithm which computes a tuple (a1, . . . , an) ∈ {0, 1}n whose residue class in Fn2 represent a zero of the 0-dimensional radical ideal I = hf1, . . . , fm, x21+ x1, . . . , x2n+ xni.

1) Reduce f1, . . . , fm modulo the field equations, i.e. make their support squarefree.

For i = 1, . . . , m, let Si be the set of terms of degree ≥ 2 in fi. Let S =Sm i=1Si and s = |S|.

2) For every tj ∈ S, introduce a new indeterminate xn+j and form the equation fm+j0 : xn+j = tj. For i = 1, . . . , m, write fi = P

jtj + `i where the sum extends over all j such that tj ∈ Si and where `i ∈ P≤1. Form the equation fi0 :P

jxn+j+ `i = 0.

3) For i = 1, . . . , m + s, let Fi be the equation which is the standard representation of fi0. Let Si0 be the set of terms of degree ≥ 2 in Fi and let S0 =Sm+s

i=1 Si0. 4) For every Tk∈ S0, introduce a new real indeterminate Xn+s+k. For i = 1, . . . , m+

s, replace Tk ∈ Si0 by Xn+s+k in the support of Fi. This makes Fi linear.

5) For Tk ∈ S0, write Tk =Q

α∈NkXα. Form the linear inequalities In+s+k : P

α∈NkXα− Xn+s+k ≤ |Nk| − 1, and

I : Xα ≥ Xn+s+k for all α ∈ Nk.

.

6) For all α ∈ {1, . . . , n}, let Iα : Xα ≤ 1.

7) Choose a linear polynomial C ∈ Q[Xα, Xn+j, Xn+s+k] and use an IP solver to find the tuple of natural numbers (aα, an+j, an+s+k) which solves the system of equations and inequalities {Fi, In+s+k, I, Iα} and minimizes (or maximizes) C.

8) Return (a1, . . . , an) and stop.

Proof. For α = 1, . . . , n, we are looking for natural numbers aα for which Iα holds, therefore we have aα ∈ {0, 1}. Similarly, we have an+j ∈ {0, 1} by Iα and Fm+j

where j = 1, . . . , s. Also we have an+s+k ∈ {0, 1} by Iα, Fm+j and I. Moreover, if Tk = Q

α∈NkXα ∈ S0 and if one of the numbers aα for α ∈ Nk is zero then I implies an+s+k = 0. On the other hand, if aα = 1 for all α ∈ Nk then In+s+k implies an+s+k ≥ 1. Altogether, this means that an+s+k equals Q

α∈Nkaα, the value of Tk at (a1, . . . , an, an+1, . . . , an+s).

Next it follows from standard representation 5.2.5 that Fi ∈ {0, 1}. In this way the solutions of the IP problem correspond uniquely to the tuples (a1, . . . , an) ∈ {0, 1}n which satisfy the above reformulation of the given polynomial system.

Assume that we are in the setting of the algorithm in Proposition 5.2.8. Note that if max{deg(fi) | i ∈ {1, . . . , m}} ≤ 2 and for i = 1, . . . , m, the maximum number of terms in the support of fi does not exceed 4, the algorithm works with quadratic polynomials in all of its iterations.

Remark 5.2.9. Assume that we are in the setting of the algorithm in Proposition 5.2.8. As in Remark 5.2.3, if we can find a feasible binary/integer-valued solution for the MILP for an arbitrary objective function, this solution can be converted into a solution for the original system. Hence it is not important to find a minimal (or maximum) solution but a feasible point. But we have three natural questions again.

Which linear function might be a good objective function? Which variables should be restricted to be binary or integers? Which optimization direction (maximize or minimize) should we choose?

An objective function can affect the running time of an IP solver strongly. We try to study it with the help of computation experiences in Section 5.2.4. A partial answer to the second question could be the following. The difficulty of solving a mixed integer program depends more on the number of integer variables than on the number

of continuous variables (see [87]). Therefore our intuition tells us to keep as many variables continues as we can. As proposed by F. Glover and E. Woolsey in [87], the linear inequalities in step 4) of the algorithm keep the variables Xn+s+k continuous. It is however necessary to keep upper bounds of 1 on these variables, as noted by A.J.

Goldman [88].

In view of these remarks we fix variables as follows. The initial state variables X1, . . . , Xnwill be forced to take on binary values. All other newly introduced variables will be kept continuous in the interval [0, 1]. These variables depend on the initial state variables. This means that we do not have to restrict them to be integer or binary. In Section 5.2.4 we confirm our intuition by experiments.

Again we do not have an answer for the third question at this stage but we remark that it can affect the running time of an IP solver in certain cases. We try to study it with the help of computation experiences in Section 5.2.4.

To understand Proposition 5.2.8 better, we now apply it in a concrete case.

Example 5.2.10. Over the field K = F2, consider f1, f2, f3 ∈ K[x1, x2, x3], where f1 = x1x2+ x1x3 + 1, f2 = x1x3+ x2x3 + x1, and f3 = x1x2+ x1x3 + x2+ 1. Let us follow the steps of the algorithm in Proposition 5.2.8.

1) Let S1 = {x1x2, x1x3}, S2 = {x1x3, x2x3}, and S3 = {x1x2, x1x3}. Let S = {x1x2, x1x3, x2x3} and s = 3.

2) Introduce new indeterminates x1, x2, x3. Form the equations f40 : x4 = x1x2, f50 : x5 = x1x3 and f60 : x6 = x2x3. Form the equations f10 : x4 = x5 + 1, f20 : x5 = x6+ x1 and f30 : x4+ x5 = x2+ 1.

3) The standard representations of the equations f10, . . . , f60 are:

F1 : X4+ X5− 1 = 0, F2 : X5− X6− X1+ 2X1X6 = 0, F3 : X4+ X5− 2X4X5+ X2− 1 = 0, F4 : X4− X1X2 = 0, F5 : X5− X1X3 = 0, F6 : X6− X2X3 = 0.

Let S10 = ∅, S20 = {X1X6}, S30 = {X4X5}, S40 = {X1X2}, S50 = {X1X3} and S60 = {X2X3}. Let S0 = {X1X2, X1X3, X1X6, X2X3, X4X5}.

4) Introduce new real indeterminates X7, . . . , X11for X1X2, X1X3, X1X6, X2X3, X4X5

respectively. Using new real indeterminates linearize Fi as follows F1 : X4+ X5− 1 = 0, F2 : X5− X6− X1+ 2X9 = 0, F3 : X4+ X5− 2X11+ X2− 1 = 0, F4 : X4− X7 = 0, F5 : X5− X8 = 0, F6 : X6− X10 = 0.

5) Form the linear inequalities

I7 : X1+ X2− X7 ≤ 1, I11 : X1 ≥ X7, I12 : X2 ≥ X7, I8 : X1+ X3− X8 ≤ 1, I21 : X1 ≥ X8, I23 : X3 ≥ X8, I9 : X1+ X6− X9 ≤ 1, I31 : X1 ≥ X9, I36 : X6 ≥ X9. I10 : X2+ X3 − X10≤ 1, I42 : X2 ≥ X10, I43 : X3 ≥ X10, I11 : X4+ X5 − X11≤ 1, I54 : X4 ≥ X11, I45 : X5 ≥ X11.

6) Let I1 : X1 ≤ 1, I2 : X2 ≤ 1 and I3 : X3 ≤ 1.

7) Let C = X1+ X2+ X3. Now use an IP solver to minimize C subject to {F1, . . . , F6, I7, . . . , I11, I11, I12, I21, I23, I31, I36, I42, I43, I54, I55, I1, I2, I3}.

8) Choose values for X1, X2 and X3 from the solution provided by an IP solver.

This will return (1, 0, 1).

Remark 5.2.11. Integer Polynomial Conversion (IPC) introduces one new integer variable per term and per equation. In hope of getting more and stronger constraints one can do the following. Apply RPC to equations with no more than three terms.

In this case the number of terms per equation and the number of new variables is the same as when using the IPC. But by replacing a quadratic term by a new variable we get three constraints instead of only the restriction that the variable is binary. It looks like that we get stronger constraints by using RPC in these cases. For equations with more than three terms we use the IPC. We call this strategy Mixed Polynomial Conversion (MPC) and is omitted. But computational experiences shows that MPC does not provide any improvement.