Gauss Lattice Reduction in Two Dimensions
Reduce a planar lattice basis by hand, prove that the first reduced vector is shortest, and see how the operations lead to LLL.
Gauss reduction repeatedly subtracts a rounded projection and puts the shorter vector first. For a rank-two Euclidean lattice, the final first vector is a shortest nonzero vector.
The two operations
- Order the basis so that .
- Set and replace by .
- If the new second vector is strictly shorter, swap the two vectors and repeat from step 2. Otherwise stop. Either choice at a rounding tie satisfies the final coefficient bound.
Subtraction and swapping are unimodular basis changes. Each continuing swap strictly decreases the length of the first vector. A bounded ball contains finitely many lattice points, so the swaps terminate.
Reduce the shared skew basis
Take and . The projection coefficient is . Subtract to obtain . The two lengths are 2 and 3, so the algorithm stops.
If you start with the same pair reversed, the initial ordering step swaps them. In either order the output spans the same area-6 lattice.
Why the first vector is shortest
At termination write , with and . The perpendicular component has squared length at least .
- For a nonzero vector with , its length is at least .
- With , the projection is shortest when , with a possible tie. The vector is therefore at least as long as .
- With , the perpendicular component alone is longer than .
From Gauss to LLL
LLL uses the same rounded subtraction in Gram–Schmidt coordinates. Its swap condition compares two consecutive projected vectors with a configurable Lovász parameter. This gives a polynomial-time approximation guarantee in higher dimensions. See the LLL worked example.