Algorithm Search⌘K

Proofs: XL algorithm

These are the human proofs of XL algorithm, at full length.

Correctness of XL with field equations full

This proof shows: correctness.

We prove that one XL step returns only true information about the first coordinates of the solutions, that at the full degree it returns the exact projection, and that the solver returns exactly the solutions in Fpn\mathbb{F}_p^n.

Setting. pp is a prime, Fp=Z/pZ\mathbb{F}_p = \mathbb{Z}/p\mathbb{Z}, and A=Fp[x1,…,xn]/(x1p−x1,…,xnp−xn)A = \mathbb{F}_p[x_1, \ldots, x_n] / (x_1^p - x_1, \ldots, x_n^p - x_n). Every element of AA has a unique representative in which every exponent is at most p−1p - 1 (reduce xex^e to xe−(p−1)x^{e - (p-1)} while e≥pe \ge p; uniqueness follows from Lemma 1 by counting dimensions). The code works with these representatives. For F={f1,…,fm}F = \{f_1, \ldots, f_m\}, let I=(F)⊆AI = (F) \subseteq A and S={a∈Fpn:fi(a)=0 for all i}S = \{a \in \mathbb{F}_p^n : f_i(a) = 0 \text{ for all } i\}. Let A1⊂AA_1 \subset A be the span of 1,x1,…,x1p−11, x_1, \ldots, x_1^{p-1}, the univariate part.

Lemma 1 (functions). Evaluation gives an isomorphism of AA with the ring of all functions Fpn→Fp\mathbb{F}_p^n \to \mathbb{F}_p, and I={g∈A:g(a)=0 for all a∈S}I = \{g \in A : g(a) = 0 \text{ for all } a \in S\}.

Proof. For a∈Fpna \in \mathbb{F}_p^n, aip=aia_i^p = a_i by Fermat's little theorem, so evaluation at aa is a well-defined ring map on AA. For b∈Fpnb \in \mathbb{F}_p^n the element δb=∏i(1−(xi−bi)p−1)\delta_b = \prod_i (1 - (x_i - b_i)^{p-1}) takes the value 11 at bb and 00 elsewhere, again by Fermat. So evaluation is onto the pnp^n-dimensional space of functions, and the reduced monomials, pnp^n of them, span AA; hence the map is bijective and the reduced representatives are unique. Every g∈Ig \in I vanishes on SS. Conversely, let gg vanish on SS. For b∉Sb \notin S some fi(b)≠0f_i(b) \ne 0, and δb=fi⋅fi(b)−1δb\delta_b = f_i \cdot f_i(b)^{-1} \delta_b as functions, so δb∈I\delta_b \in I. Then g=∑b∉Sg(b) δb∈Ig = \sum_{b \notin S} g(b)\, \delta_b \in I. □\square

Lemma 2 (echelon form). Let EE be the reduced row echelon form of a matrix whose columns are split into a left block NN and a right block UU. Then the vectors of the row space with zero entries in NN are exactly the combinations of the rows of EE that are zero in NN.

Proof. Such combinations are in the row space and are zero in NN. Conversely, let w=∑iciEiw = \sum_i c_i E_i be zero in NN. A row EiE_i that is not zero in NN has its pivot, its first nonzero entry, in NN, and in reduced form the pivot column of EiE_i is zero in every other row. So ww at that column equals cic_i, and ci=0c_i = 0. Hence ww is a combination of the rows that are zero in NN. □\square

Theorem 1 (one step). Let XL-STEP(F,D)(F, D) run with the columns of the univariate monomials x1jx_1^j last.

  • (a) If it returns "none", then S=∅S = \emptyset.
  • (b) If it returns univariate polynomials g1,…,gsg_1, \ldots, g_s, then gj(a1)=0g_j(a_1) = 0 for every a∈Sa \in S.
  • (c) If D≥n(p−1)+max⁡ideg⁡fiD \ge n(p-1) + \max_i \deg f_i, the step returns "fail" exactly when {a1:a∈S}=Fp\{a_1 : a \in S\} = \mathbb{F}_p, and otherwise the common roots of the gjg_j are exactly {a1:a∈S}\{a_1 : a \in S\}, or it returns "none" exactly when S=∅S = \emptyset.

Proof. Every row is a reduced product ufiu f_i, an element of II, and so is every row of the echelon form. A row with zero entries outside the univariate block is an element g∈I∩A1g \in I \cap A_1. (a) A nonzero constant in II vanishes on SS by Lemma 1 and is nowhere zero, so SS is empty. (b) Each gj∈Ig_j \in I vanishes on SS, so gj(a1)=0g_j(a_1) = 0.

(c) For this DD every reduced monomial uu satisfies deg⁡u≤n(p−1)≤D−deg⁡fi\deg u \le n(p-1) \le D - \deg f_i, so the rows span ∑iAfi=I\sum_i A f_i = I. By Lemma 2 the rows found at line L4 span I∩A1I \cap A_1. By Lemma 1, I∩A1I \cap A_1 is the set of univariate gg of degree less than pp that vanish on π(S)={a1:a∈S}\pi(S) = \{a_1 : a \in S\}. If S=∅S = \emptyset, then 1∈I∩A11 \in I \cap A_1, and the reduced echelon form of a space containing the constant has the constant row 11, so the answer is "none"; if S≠∅S \ne \emptyset, no constant is in II and the answer is not "none". If π(S)=Fp\pi(S) = \mathbb{F}_p, a univariate gg of degree less than pp vanishing on all of Fp\mathbb{F}_p is 00, so no row is found and the answer is "fail". Otherwise, for b∉π(S)b \notin \pi(S) the element 1−(x1−b)p−11 - (x_1 - b)^{p-1} is in I∩A1I \cap A_1 and equals 11 at bb; it is a combination of the gjg_j, so some gj(b)≠0g_j(b) \ne 0. With (b), the common roots are exactly π(S)\pi(S), and since the span is nonzero, "fail" is not returned. □\square

Theorem 2 (solver). XL-SOLVE(F)(F) terminates and returns exactly SS.

Proof. Termination: the inner loop raises DD at most up to the full degree of Theorem 1 (c). Each stack entry with kk free variables pushes at most pp entries with k−1k - 1, so at most ∑kpk\sum_k p^k entries are processed.

We show by induction on kk that an entry (prefix,G,k)(\text{prefix}, G, k) adds to the output exactly the points prefix×SG\text{prefix} \times S_G, where SG⊆FpkS_G \subseteq \mathbb{F}_p^k is the set of common zeros of GG. For k=0k = 0 each gg is a constant, and the prefix is output exactly when all are 00. If GG has no nonzero polynomial, every point is a zero, and the code outputs them all. Otherwise the loop stops at the first DD with a non-"fail" answer, or at the full degree. If the answer is "none", SG=∅S_G = \emptyset by (a). If it returns univariate polynomials, their common roots contain π(SG)\pi(S_G) by (b). If it returns "fail" at the full degree, π(SG)=Fp\pi(S_G) = \mathbb{F}_p by (c), and the code tries all values. So the tried values contain every first coordinate of a point of SGS_G. For a tried value cc, the substituted system G(c,x2,…,xk)G(c, x_2, \ldots, x_k) has zero set {b:(c,b)∈SG}\{b : (c, b) \in S_G\}, and by induction the child entry outputs prefix×{c}×\text{prefix} \times \{c\} \times this set. The union over the tried values is prefix×SG\text{prefix} \times S_G, because values outside π(SG)\pi(S_G) contribute nothing. The first entry has empty prefix, G=FG = F and k=nk = n, so the output is SS. Distinct entries have distinct prefixes, so no point is output twice. ■\blacksquare

Back to XL algorithm