Lenstra–Lenstra–Lovász lattice basis reduction algorithm

From Wikipedia, the free encyclopedia
(Redirected from LLL algorithm)
Jump to navigation Jump to search

The Lenstra–Lenstra–Lovász (LLL) lattice basis reduction algorithm is a polynomial time lattice reduction algorithm invented by Arjen Lenstra, Hendrik Lenstra and László Lovász in 1982.[1] Given a basis 𝐁={𝐛1,𝐛2,,𝐛d} with n-dimensional integer coordinates, for a lattice L (a discrete subgroup of Rn) with dn, the LLL algorithm calculates an LLL-reduced (short, nearly orthogonal) lattice basis in time 𝒪(d5nlog3B) where B is the largest length of 𝐛i under the Euclidean norm, that is, B=max(𝐛12,𝐛22,,𝐛d2).[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

[edit | edit source]

The precise definition of LLL-reduced is as follows: Given a basis 𝐁={𝐛1,𝐛2,,𝐛n}, define its Gram–Schmidt process orthogonal basis 𝐁*={𝐛1*,𝐛2*,,𝐛n*}, and the Gram-Schmidt coefficients μi,j=𝐛i,𝐛j*𝐛j*,𝐛j*, for any 1j<in.

Then the basis B is LLL-reduced if there exists a parameter δ in (0.25, 1] such that the following holds:

  1. (size-reduced) For 1j<in:|μi,j|0.5. By definition, this property guarantees the length reduction of the ordered basis.
  2. (Lovász condition) For k = 2,3,..,n :δ𝐛k1*2𝐛k*2+μk,k12𝐛k1*2.

Here, estimating the value of the δ parameter, we can conclude how well the basis is reduced. Greater values of δ lead to stronger reductions of the basis. Initially, A. Lenstra, H. Lenstra and L. Lovász demonstrated the LLL-reduction algorithm for δ=34. Note that although LLL-reduction is well-defined for δ=1, the polynomial-time complexity is guaranteed only for δ 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

[edit | edit source]

An early successful application of the LLL algorithm was its use by Andrew Odlyzko and Herman te Riele in disproving the 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 𝐑4 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 x2x1 has a root equal to the golden ratio, 1.6180339887....

Properties of LLL-reduced basis

[edit | edit source]

Let 𝐁={𝐛1,𝐛2,,𝐛n} be a δ-LLL-reduced basis of a lattice . From the definition of LLL-reduced basis, we can derive several other useful properties about 𝐁.

  1. The first vector in the basis cannot be much larger than the shortest non-zero vector: 𝐛1(2/(4δ1))n1λ1(). In particular, for δ=3/4, this gives 𝐛12(n1)/2λ1().[8]
  2. The first vector in the basis is also bounded by the determinant of the lattice: 𝐛1(2/(4δ1))(n1)/2(det())1/n. In particular, for δ=3/4, this gives 𝐛12(n1)/4(det())1/n.
  3. The product of the norms of the vectors in the basis cannot be much larger than the determinant of the lattice: let δ=3/4, then i=1n𝐛i2n(n1)/4det().

LLL algorithm pseudocode

[edit | edit source]

The following description is based on (Hoffstein, Pipher & Silverman 2008, Theorem 6.68), 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({b1, ..., bn}) = {b1*, ..., bn*};  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({b1, ..., bn}) = {b1*, ..., bn*})
            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 {b1, ..., bn}
OUTPUT
    the reduced basis b1, b2, ..., bn in Zm

Examples

[edit | edit source]

Example from Z3

[edit | edit source]

Let a lattice basis 𝐛1,𝐛2,𝐛3𝐙3, be given by the columns of [113105126] then the reduced basis is [011100012], 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

[edit | edit source]

Likewise, for the basis over the complex integers given by the columns of the matrix below, [2+2i7+3i7+3i5+4i3+3i2+4i6+2i1+4i2+2i8+0i9+1i7+5i8+2i9+0i6+3i4+4i], then the columns of the matrix below give an LLL-reduced basis. [6+3i2+2i22i3+6i61i3+3i55i2+1i22i2+2i31i5+3i2+1i8+2i7+1i24i].

Implementations

[edit | edit source]

LLL is implemented in

  • Arageli as the function lll_reduction_int
  • fpLLL as a stand-alone implementation
  • FLINT as the function fmpz_lll
  • GAP as the function LLLReducedBasis
  • Macaulay2 as the function LLL in the package LLLBases
  • Magma as the functions LLL and LLLGram (taking a gram matrix)
  • Maple as the function IntegerRelations[LLL]
  • Mathematica as the function LatticeReduce
  • Number Theory Library (NTL) as the function LLL
  • PARI/GP as the function qflll
  • Pymatgen as the function analysis.get_lll_reduced_lattice
  • SageMath as the method LLL driven by fpLLL and NTL
  • Isabelle/HOL in the 'archive of formal proofs' entry LLL_Basis_Reduction. This code exports to efficiently executable Haskell.[11]

See also

[edit | edit source]

Notes

[edit | edit source]
  1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  5. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  6. ^ D. Wübben et al., "Lattice reduction," IEEE Signal Processing Magazine, Vol. 28, No. 3, pp. 70-91, Apr. 2011.
  7. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  8. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  9. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  10. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  11. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).

References

[edit | edit source]
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).