Algorithm Search⌘K

Proofs: Deep LLL

These are the human proofs of Deep LLL, at full length.

LLL with deep insertions terminates and returns a size-reduced, deep-reduced basis of the same lattice full

This proof shows: correctness, termination.

Setting. The input is n≥1n \ge 1 linearly independent rows b1,…,bn∈Qmb_1, \ldots, b_n \in \mathbb{Q}^m and a parameter δ\delta with 1/4<δ≤11/4 < \delta \le 1. We write bi∗b_i^* for the Gram-Schmidt vectors, Ni=∥bi∗∥2N_i = \|b_i^*\|^2, μkj=⟨bk,bj∗⟩/Nj\mu_{kj} = \langle b_k, b_j^* \rangle / N_j, and πi\pi_i for the orthogonal projection onto span⁡(b1,…,bi−1)⊥\operatorname{span}(b_1, \ldots, b_{i-1})^\perp, so that πi(bk)=bk∗+∑j=ik−1μkjbj∗\pi_i(b_k) = b_k^* + \sum_{j = i}^{k-1} \mu_{kj} b_j^* and

∥πi(bk)∥2=Nk+∑j=ik−1μkj2Nj.\|\pi_i(b_k)\|^2 = N_k + \sum_{j=i}^{k-1} \mu_{kj}^2 N_j.

Indices are 1,…,n1, \ldots, n here; the implementation counts from 0. A basis is deep-reduced with parameter δ\delta if it is size-reduced, ∣μkj∣≤1/2|\mu_{kj}| \le 1/2 for all j<kj < k, and ∥πi(bk)∥2≥δNi\|\pi_i(b_k)\|^2 \ge \delta N_i for all i<ki < k.

Lemma 1 (the lattice is preserved). Every step replaces the basis by another basis of the same lattice.

Proof. Line L3 replaces bkb_k by bk−qbjb_k - q b_j with q∈Zq \in \mathbb{Z} and j<kj < k, an elementary unimodular operation. Line L6 moves bkb_k to position ii and shifts bi,…,bk−1b_i, \ldots, b_{k-1} up by one, a permutation of the rows. Both are integer matrices with determinant ±1\pm 1. □\square

Lemma 2 (size reduction). After line L3, ∣μkj∣≤1/2|\mu_{kj}| \le 1/2 for every j<kj < k, and the Gram-Schmidt vectors are unchanged.

Proof. Subtracting qbjq b_j from bkb_k does not change span⁡(b1,…,bk−1)\operatorname{span}(b_1, \ldots, b_{k-1}) or the component of bkb_k orthogonal to it, so no bl∗b_l^* changes. It changes μkl\mu_{kl} by −qμjl-q \mu_{jl} for l<jl < j, by −q-q for l=jl = j, and not at all for l>jl > j. The loop runs j=k−1,…,1j = k-1, \ldots, 1 and chooses qq as the nearest integer to the current μkj\mu_{kj}, so afterwards ∣μkj∣≤1/2|\mu_{kj}| \le 1/2, and later iterations (with smaller jj) do not touch μkj\mu_{kj} again. □\square

Lemma 3 (the running value). At line L6 with index ii, the variable CC equals ∥πi(bk)∥2\|\pi_i(b_k)\|^2.

Proof. Line L4 sets C=∥bk∥2=∥π1(bk)∥2C = \|b_k\|^2 = \|\pi_1(b_k)\|^2, and line L7 subtracts μki2Ni\mu_{ki}^2 N_i, which is the difference ∥πi(bk)∥2−∥πi+1(bk)∥2\|\pi_i(b_k)\|^2 - \|\pi_{i+1}(b_k)\|^2 by the formula above. □\square

Lemma 4 (invariant). Whenever the loop at line L2 tests its condition, the first k−1k - 1 vectors form a deep-reduced basis of the lattice they generate.

Proof. Initially k=2k = 2, and one vector is deep-reduced. Suppose the invariant holds and a pass runs. Line L3 changes only bkb_k. If no insertion happens, then by Lemma 3 ∥πi(bk)∥2≥δNi\|\pi_i(b_k)\|^2 \ge \delta N_i for every i<ki < k, and by Lemma 2 bkb_k is size-reduced, so the first kk vectors are deep-reduced, and line L8 increments kk. If an insertion at position ii happens, the vectors b1,…,bi−1b_1, \ldots, b_{i-1} are unchanged, and so are their Gram-Schmidt data; the new kk is max⁡(i,2)\max(i, 2), and the first max⁡(i,2)−1\max(i, 2) - 1 vectors are either b1,…,bi−1b_1, \ldots, b_{i-1} or, when i=1i = 1, the single new vector b1b_1. In both cases they are deep-reduced. □\square

Lemma 5 (an insertion decreases the Gram determinants lexicographically). Let Dj=∏l≤jNlD_j = \prod_{l \le j} N_l be the Gram determinant of b1,…,bjb_1, \ldots, b_j. An insertion at position ii leaves D1,…,Di−1D_1, \ldots, D_{i-1} unchanged and replaces DiD_i by a value less than δDi≤Di\delta D_i \le D_i. Size reduction changes no DjD_j.

Proof. The first i−1i - 1 vectors are unchanged. The new ii-th Gram-Schmidt vector is the component of bkb_k orthogonal to b1,…,bi−1b_1, \ldots, b_{i-1}, which is πi(bk)\pi_i(b_k), and the insertion happens only if ∥πi(bk)∥2<δNi\|\pi_i(b_k)\|^2 < \delta N_i (Lemma 3). So the new DiD_i is Di−1∥πi(bk)∥2<δDiD_{i-1} \|\pi_i(b_k)\|^2 < \delta D_i. Size reduction changes no bl∗b_l^* (Lemma 2). □\square

Termination. Let ss be a common denominator of the input entries. Every basis in the run generates the same lattice LL (Lemma 1), so every vector has entries in 1sZ\frac1s \mathbb{Z}, and each DjD_j, a Gram determinant of jj such vectors, lies in s−2jZ>0s^{-2j} \mathbb{Z}_{>0}. So the tuple (s2D1,s4D2,…,s2nDn)(s^2 D_1, s^4 D_2, \ldots, s^{2n} D_n) is a tuple of positive integers, and by Lemma 5 it strictly decreases in the lexicographic order at every insertion. The lexicographic order on Z>0n\mathbb{Z}_{>0}^n is a well-order, so there are finitely many insertions. Between two insertions, kk only increases, so at most n−1n - 1 passes occur. Hence the algorithm terminates.

Correctness. When the loop exits, k=n+1k = n + 1, and by Lemma 4 the whole basis is deep-reduced; by Lemma 1 it generates the input lattice. Taking i=k−1i = k - 1 in the deep condition gives Nk+μk,k−12Nk−1≥δNk−1N_k + \mu_{k,k-1}^2 N_{k-1} \ge \delta N_{k-1}, the Lovász condition, so the output is also LLL-reduced with parameter δ\delta, and the LLL bounds apply: with α=1/(δ−1/4)\alpha = 1/(\delta - 1/4), ∥b1∥2≤αn−1λ12\|b_1\|^2 \le \alpha^{n-1} \lambda_1^2.

Theorem. For 1/4<δ≤11/4 < \delta \le 1, the algorithm terminates on every valid input and returns a basis of the same lattice that is size-reduced and deep-reduced with parameter δ\delta, hence also LLL-reduced. Each pass of the main loop costs O(n2m)O(n^2 m) arithmetic operations when Gram-Schmidt is recomputed, as in the implementation. The number of passes is finite but is not bounded here by a polynomial; no such bound is known for unrestricted deep insertions. ■\blacksquare

Back to Deep LLL