Algorithm Search⌘K

Proofs: Fincke-Pohst enumeration

These are the human proofs of Fincke-Pohst enumeration, at full length.

Fincke-Pohst enumeration lists exactly the lattice vectors in the ball, and its search tree has at most the product of the Gram-Schmidt ratios as nodes per level full

This proof shows: correctness, termination, time.worst.

Setting. The input is n≥1n \ge 1 linearly independent rows b1,…,bn∈Qmb_1, \ldots, b_n \in \mathbb{Q}^m, a target t∈Qmt \in \mathbb{Q}^m and a rational R≥0R \ge 0. We write bi∗b_i^* for the Gram-Schmidt vectors, Ni=∥bi∗∥2>0N_i = \|b_i^*\|^2 > 0, μij=⟨bi,bj∗⟩/Nj\mu_{ij} = \langle b_i, b_j^* \rangle / N_j, τj=⟨t,bj∗⟩/Nj\tau_j = \langle t, b_j^* \rangle / N_j, and o=t−∑jτjbj∗o = t - \sum_j \tau_j b_j^*, the component of tt orthogonal to the span. Indices are 1,…,n1, \ldots, n here; the implementation counts from 0. For an integer vector xx define, for 1≤i≤n1 \le i \le n,

ci(x)=τi−∑j>ixjμji,ρi(x)=∥o∥2+∑j≥i(xj−cj(x))2Nj,ρn+1=∥o∥2.c_i(x) = \tau_i - \sum_{j > i} x_j \mu_{ji}, \qquad \rho_i(x) = \|o\|^2 + \sum_{j \ge i} (x_j - c_j(x))^2 N_j, \qquad \rho_{n+1} = \|o\|^2.

Note that cic_i and ρi\rho_i depend only on xi,…,xnx_i, \ldots, x_n (and cic_i only on xi+1,…,xnx_{i+1}, \ldots, x_n).

Lemma 1 (the distance splits). For every x∈Znx \in \mathbb{Z}^n, ∥t−xB∥2=ρ1(x)\|t - x B\|^2 = \rho_1(x).

Proof. Since bi=bi∗+∑j<iμijbj∗b_i = b_i^* + \sum_{j < i} \mu_{ij} b_j^*,

xB=∑ixibi=∑j(xj+∑i>jxiμij)bj∗,x B = \sum_i x_i b_i = \sum_j \Big(x_j + \sum_{i > j} x_i \mu_{ij}\Big) b_j^*,

so t−xB=o+∑j(cj(x)−xj)bj∗t - x B = o + \sum_j (c_j(x) - x_j) b_j^*. The vectors o,b1∗,…,bn∗o, b_1^*, \ldots, b_n^* are pairwise orthogonal, and Pythagoras gives the claim. □\square

Lemma 2 (pruning is safe). ρn+1≤ρn(x)≤⋯≤ρ1(x)\rho_{n+1} \le \rho_n(x) \le \cdots \le \rho_1(x). So if ∥t−xB∥2≤R\|t - x B\|^2 \le R, then ρi(x)≤R\rho_i(x) \le R for every ii.

Proof. Each step adds a nonnegative term (xi−ci)2Ni(x_i - c_i)^2 N_i. □\square

Call a tuple (xi,…,xn)(x_i, \ldots, x_n) of integers feasible if ρi≤R\rho_i \le R, and call it a node of level ii. By Lemma 2, every prefix (xj,…,xn)(x_j, \ldots, x_n), j≥ij \ge i, of a feasible tuple is feasible.

Lemma 3 (the candidates for one coordinate form an interval). Fix a feasible (xi+1,…,xn)(x_{i+1}, \ldots, x_n), or the empty tuple when i=ni = n and ∥o∥2≤R\|o\|^2 \le R. The integers xix_i that make (xi,…,xn)(x_i, \ldots, x_n) feasible are exactly the integers in the interval ∣xi−ci∣≤(R−ρi+1)/Ni|x_i - c_i| \le \sqrt{(R - \rho_{i+1}) / N_i}, and there are at most 2R/Ni+12 \sqrt{R / N_i} + 1 of them.

Proof. Feasibility means (xi−ci)2Ni≤R−ρi+1(x_i - c_i)^2 N_i \le R - \rho_{i+1}, and cic_i does not depend on xix_i. An interval of length 2(R−ρi+1)/Ni≤2R/Ni2 \sqrt{(R - \rho_{i+1})/N_i} \le 2 \sqrt{R / N_i} contains at most that many plus one integers. □\square

Lemma 4 (the loop is a depth-first traversal). The loop at lines L4 to L10 visits the feasible tuples in the following order. When it enters level ii with new set (line L5), it computes cic_i and sets xix_i to the smallest feasible value, using the exact search for the smallest integer with (x−ci)2≤q(x - c_i)^2 \le q. Line L6 moves to the next integer. Line L7 leaves level ii as soon as xix_i leaves the interval of Lemma 3, and lines L8 to L10 record ρi\rho_i and descend, or output xx at level 1.

Proof. By Lemma 3 the feasible xix_i form a run of consecutive integers, so starting at the smallest and incrementing until the first infeasible value visits exactly that run, in increasing order. Returning to level i+1i + 1 with new cleared resumes the run at that level with the next value. Each visit of a feasible xix_i at level i>1i > 1 descends to level i−1i - 1 with new set, which recomputes ci−1c_{i-1} from the current xi,…,xnx_i, \ldots, x_n. Hence, by induction from level nn down, every feasible tuple is visited exactly once, prefixes in lexicographic order of (xn,…,xi)(x_n, \ldots, x_i). □\square

Correctness. If ∥o∥2>R\|o\|^2 > R, no lattice vector is within the radius by Lemma 1 and Lemma 2, and line L2 correctly returns the empty list. Otherwise, by Lemma 4, line L9 outputs exactly the feasible tuples of level 1, each once and in lexicographic order of (xn,…,x1)(x_n, \ldots, x_1), and by Lemma 1 these are exactly the x∈Znx \in \mathbb{Z}^n with ∥t−xB∥2≤R\|t - x B\|^2 \le R.

Lemma 5 (the size of the tree). The number of nodes of level kk is at most ∏i=kn(2R/Ni+1)\prod_{i = k}^n (2 \sqrt{R / N_i} + 1).

Proof. By induction on kk from nn down. Every node of level k<nk < n extends a node of level k+1k + 1, its prefix, and by Lemma 3 a node of level k+1k + 1 has at most 2R/Nk+12 \sqrt{R / N_k} + 1 extensions. □\square

Termination and cost. Let TT be the total number of nodes. Every pass through the loop either accepts a value at line L8, which creates a node, or goes up at line L7. Going up from level ii happens once for each node of level i+1i + 1, and once for the root when i=ni = n, so the loop runs at most 2T+12T + 1 times and terminates. Computing cic_i costs O(n)O(n) arithmetic operations, the search for the first integer of the interval costs O(1)O(1) operations plus one integer square root, and the other lines cost O(1)O(1). Gram-Schmidt at line L1 costs O(n2m)O(n^2 m). The total is O(n2m+nT)O(n^2 m + n T) arithmetic operations, with T≤∑k=1n∏i=kn(2R/Ni+1)T \le \sum_{k=1}^n \prod_{i=k}^n (2 \sqrt{R / N_i} + 1) by Lemma 5.

Corollary (LLL preprocessing). If the basis is LLL-reduced with δ=3/4\delta = 3/4 and R=∥b1∥2R = \|b_1\|^2, then Ni≥2−(i−1)N1N_i \ge 2^{-(i-1)} N_1, so R/Ni≤2i−1R / N_i \le 2^{i - 1} and T≤n∏i=1n(2(i+1)/2+1)=2O(n2)T \le n \prod_{i=1}^n (2^{(i+1)/2} + 1) = 2^{O(n^2)}.

Proof. The Lovász condition with size reduction gives Ni+1≥Ni/2N_{i+1} \ge N_i / 2. Insert R/Ni≤2(i−1)/2\sqrt{R / N_i} \le 2^{(i-1)/2} into Lemma 5. □\square

Theorem. On every valid input the algorithm outputs exactly the integer vectors xx with ∥t−xB∥2≤R\|t - x B\|^2 \le R, each once, in lexicographic order of (xn,…,x1)(x_n, \ldots, x_1), and it uses O(n2m+nT)O(n^2 m + n T) arithmetic operations, where the number TT of tree nodes satisfies the bound of Lemma 5. ■\blacksquare

Back to Fincke-Pohst enumeration