Lenstra–Lenstra–Lovász lattice basis reduction algorithm explained

B=\{b1,b2,...,bd\}

with n-dimensional integer coordinates, for a lattice L (a discrete subgroup of Rn) with

d\leqn

, the LLL algorithm calculates an LLL-reduced (short, nearly orthogonal) lattice basis in time \mathcal O(d^5n\log^3 B) where

B

is the largest length of

bi

under the Euclidean norm, that is,

B=max\left(\|b1\|2,\|b2\|2,...,\|bd\|2\right)

.[2] [3]

The original applications were to give polynomial-time algorithms for factorizing polynomials with rational coefficients, for finding simultaneous rational approximations to real numbers, and for solving the integer linear programming problem in fixed dimensions.

LLL reduction

The precise definition of LLL-reduced is as follows: Given a basis\mathbf=\,define its Gram–Schmidt process orthogonal basis\mathbf^*=\,and the Gram-Schmidt coefficients\mu_=\frac, for any

1\lej<i\len

.

Then the basis

B

is LLL-reduced if there exists a parameter

\delta

in such that the following holds:
  1. (size-reduced) For

1\leqj<i\leqn\colon\left|\mui,j\right|\leq0.5

. By definition, this property guarantees the length reduction of the ordered basis.
  1. (Lovász condition) For k = 2,3,..,n

\colon\delta\Vert

*
b
k-1

\Vert2\leq\Vert

2+
b
k\Vert
2\Vert
\mu
k,k-1
*
b
k-1

\Vert2

.

Here, estimating the value of the

\delta

parameter, we can conclude how well the basis is reduced. Greater values of

\delta

lead to stronger reductions of the basis. Initially, A. Lenstra, H. Lenstra and L. Lovász demonstrated the LLL-reduction algorithm for

\delta=

3
4
. Note that although LLL-reduction is well-defined for

\delta=1

, the polynomial-time complexity is guaranteed only for

\delta

in

(0.25,1)

.

The LLL algorithm computes LLL-reduced bases. There is no known efficient algorithm to compute a basis in which the basis vectors are as short as possible for lattices of dimensions greater than 4.[4] However, an LLL-reduced basis is nearly as short as possible, in the sense that there are absolute bounds

ci>1

such that the first basis vector is no more than

c1

times as long as a shortest vector in the lattice,the second basis vector is likewise within

c2

of the second successive minimum, and so on.

Applications

An early successful application of the LLL algorithm was its use by Andrew Odlyzko and Herman te Riele in disproving Mertens conjecture.[5]

The LLL algorithm has found numerous other applications in MIMO detection algorithms[6] and cryptanalysis of public-key encryption schemes: knapsack cryptosystems, RSA with particular settings, NTRUEncrypt, and so forth. The algorithm can be used to find integer solutions to many problems.[7]

In particular, the LLL algorithm forms a core of one of the integer relation algorithms. For example, if it is believed that r=1.618034 is a (slightly rounded) root to an unknown quadratic equation with integer coefficients, one may apply LLL reduction to the lattice in

Z4

spanned by

[1,0,0,10000r2],[0,1,0,10000r],

and

[0,0,1,10000]

. The first vector in the reduced basis will be an integer linear combination of these three, thus necessarily of the form

[a,b,c,10000(ar2+br+c)]

; but such a vector is "short" only if a, b, c are small and

ar2+br+c

is even smaller. Thus the first three entries of this short vector are likely to be the coefficients of the integral quadratic polynomial which has r as a root. In this example the LLL algorithm finds the shortest vector to be [1, -1, -1, 0.00025] and indeed

x2-x-1

has a root equal to the golden ratio, 1.6180339887....

Properties of LLL-reduced basis

Let

B=\{b1,b2,...,bn\}

be a

\delta

-LLL-reduced basis of a lattice

lL

. From the definition of LLL-reduced basis, we can derive several other useful properties about

B

.
  1. The first vector in the basis cannot be much larger than the shortest non-zero vector:

\Vertb1\Vert\le(2/(\sqrt{4\delta-1}))n-1λ1(lL)

. In particular, for

\delta=3/4

, this gives

\Vertb1\Vert\le2(n-1)/2λ1(lL)

.[8]
  1. The first vector in the basis is also bounded by the determinant of the lattice:

\Vertb1\Vert\le(2/(\sqrt{4\delta-1}))(n-1)/2(\det(lL))1/n

. In particular, for

\delta=3/4

, this gives

\Vertb1\Vert\le2(n-1)/4(\det(lL))1/n

.
  1. The product of the norms of the vectors in the basis cannot be much larger than the determinant of the lattice: let

\delta=3/4

, then \prod_^n \Vert\mathbf_i \Vert \le 2^ \cdot \det(\mathcal L).

LLL algorithm pseudocode

The following description is based on, with the corrections from the errata.[9]

INPUT a lattice basis b1, b2, ..., bn in Zm a parameter δ with 1/4 < δ < 1, most commonly δ = 3/4 PROCEDURE B* <- GramSchmidt = ; and do not normalize μi,j <- InnerProduct(bi, bj*)/InnerProduct(bj*, bj*); using the most current values of bi and bj* k <- 2; while k <= n do for j from k−1 to 1 do if |μk,j| > 1/2 then bk <- bk − ⌊μk,jbj; Update B* and the related μi,j's as needed. (The naive method is to recompute B* whenever bi changes: B* <- GramSchmidt =) end if end for if InnerProduct(bk*, bk*) > (δ − μ2k,k−1) InnerProduct(bk−1*, bk−1*) then k <- k + 1; else Swap bk and bk−1; Update B* and the related μi,j's as needed. k <- max(k−1, 2); end if end while return B the LLL reduced basis of OUTPUT the reduced basis b1, b2, ..., bn in Zm

Examples

Example from Z3

Let a lattice basis

b1,b2,b3\inZ3

, be given by the columns of\begin 1 & -1& 3\\ 1 & 0 & 5\\ 1 & 2 & 6\endthen the reduced basis is \begin 0 & 1& -1\\ 1 & 0 & 0\\ 0 & 1 & 2\end,which is size-reduced, satisfies the Lovász condition, and is hence LLL-reduced, as described above. See W. Bosma.[10] for details of the reduction process.

Example from Z[''i'']4

Likewise, for the basis over the complex integers given by the columns of the matrix below,\begin -2+2i & 7+3i & 7+3i & -5+4i\\ 3+3i & -2+4i & 6+2i & -1+4i\\ 2+2i & -8+0i & -9+1i & -7+5i\\ 8+2i & -9+0i & 6+3i & -4+4i\end,then the columns of the matrix below give an LLL-reduced basis. \begin -6+3i & -2+2i & 2-2i & -3+6i \\ 6-1i & 3+3i & 5-5i & 2+1i \\ 2-2i & 2+2i & -3-1i & -5+3i \\ -2+1i & 8+2i & 7+1i & -2-4i \\\end.

Implementations

LLL is implemented in

See also

References

Notes and References

  1. Lenstra. A. K.. A. K. Lenstra. Lenstra. H. W. Jr.. H. W. Lenstra, Jr.. Lovász. L.. László Lovász. Factoring polynomials with rational coefficients. Mathematische Annalen. 261. 1982. 4. 515–534. 1887/3810. 10.1007/BF01457454. 0682664. 10.1.1.310.318. 5701340.
  2. Book: Galbraith. Steven. Mathematics of Public Key Cryptography. 2012. chapter 17. https://www.math.auckland.ac.nz/~sgal018/crypto-book/crypto-book.html.
  3. Nguyen . Phong Q. . Stehlè . Damien . An LLL Algorithm with Quadratic Complexity . SIAM J. Comput. . September 2009 . 39 . 3 . 874–903 . 10.1137/070705702 . 3 June 2019.
  4. Nguyen. Phong Q.. Stehlé. Damien. 1 October 2009. Low-dimensional lattice basis reduction revisited . ACM Transactions on Algorithms . en. 5. 4. 1–48. 10.1145/1597036.1597050. 10583820.
  5. Odlyzko . Andrew . te Reile . Herman J. J. . Disproving Mertens Conjecture . . 357 . 138–160 . 10.1515/crll.1985.357.138 . 13016831 . 27 January 2020.
  6. D. Wübben et al., "Lattice reduction," IEEE Signal Processing Magazine, Vol. 28, No. 3, pp. 70-91, Apr. 2011.
  7. D. Simon . Selected applications of LLL in number theory . LLL+25 Conference . 2007 . Caen, France .
  8. Web site: Regev . Oded . Lattices in Computer Science: LLL Algorithm . New York University . 1 February 2019.
  9. Web site: Silverman. Joseph. Introduction to Mathematical Cryptography Errata. Brown University Mathematics Dept.. 5 May 2015.
  10. Web site: 4. LLL . Bosma. Wieb. Lecture notes. 28 February 2010.
  11. A Formalization of the LLL Basis Reduction Algorithm . Divasón. Jose. Conference Paper. Lecture Notes in Computer Science . 2018 . 10895 . 160–177 . 10.1007/978-3-319-94821-8_10 . 978-3-319-94820-1 . free .