The nearest plane method returns a lattice vector whose error has Gram-Schmidt coordinates at most one half, decodes within half the shortest Gram-Schmidt vector, and approximates CVP within 2^(n/2) on LLL-reduced bases full
This proof shows: correctness, termination, time.worst.
Setting. The input is n≥1 linearly independent rows b1,…,bn∈Qm and a target t∈Qm. We write L for the lattice they generate, b1∗,…,bn∗ for the Gram-Schmidt vectors, Ni=∥bi∗∥2>0, and μij=⟨bi,bj∗⟩/Nj. Then bi=bi∗+∑j<iμijbj∗, so ⟨bi,bj∗⟩=0 for i<j and ⟨bi,bi∗⟩=Ni. The nearest integer is ⌈z⌋=⌊z+1/2⌋, so −1/2≤z−⌈z⌋<1/2. Indices in the loop at line L3 run i=n,n−1,…,1; w(i) denotes the value of w after the iteration for i, and w(n+1)=t.
Lemma 1 (invariant). For every i, w(i)=t−∑j≥ixjbj with integers xj. Hence the output v=t−w(1)=∑jxjbj lies in L, with coefficients x.
Proof. Line L2 sets w=t, and each pass of line L5 subtracts xibi with the integer xi of line L4. □
Lemma 2 (the error). Write t−v=o+∑i=1ncibi∗ with o orthogonal to span(L). Then −1/2≤ci<1/2 for every i. In particular ∥t−v∥2≤∥o∥2+41∑iNi.
Proof. Fix i. Line L4 sets xi=⌈⟨w(i+1),bi∗⟩/Ni⌋, and line L5 gives ⟨w(i),bi∗⟩/Ni=⟨w(i+1),bi∗⟩/Ni−xi, which lies in [−1/2,1/2). The later iterations subtract multiples of bj with j<i, and ⟨bj,bi∗⟩=0, so ⟨w(1),bi∗⟩=⟨w(i),bi∗⟩. Since w(1)=t−v and the bk∗ are orthogonal, ci=⟨t−v,bi∗⟩/Ni∈[−1/2,1/2). The bound follows from Pythagoras. □
Lemma 3 (the first wrong coefficient). Let u=∑izibi be any lattice vector and e=t−u. If x=z, let k be the largest index with xk=zk. Then ∥e∥≥21∥bk∗∥.
Proof. For j>k, xj=zj, so w(k+1)=t−∑j>kzjbj=e+∑j≤kzjbj. Taking the inner product with bk∗ and dividing by Nk gives zk+ε with ε=⟨e,bk∗⟩/Nk, because ⟨bj,bk∗⟩=0 for j<k. Line L4 rounds zk+ε to zk+⌈ε⌋, and this differs from zk, so ⌈ε⌋=0 and ∣ε∣≥1/2. By Cauchy-Schwarz ∥e∥≥∣⟨e,bk∗⟩∣/∥bk∗∥=∣ε∣∥bk∗∥≥21∥bk∗∥. □
Lemma 4 (decoding). If some u∈L satisfies ∥t−u∥<21mini∥bi∗∥, then v=u.
Proof. Otherwise Lemma 3 gives an index k with ∥t−u∥≥21∥bk∗∥≥21mini∥bi∗∥. □
Lemma 5 (approximation). Let u be a closest lattice vector to t. Then
∥t−v∥2≤(1+1≤k≤nmaxi≤k∑NkNi)∥t−u∥2. Proof. If v=u there is nothing to prove. Otherwise let k be as in Lemma 3, e=t−u. The difference v−u=∑j≤k(xj−zj)bj lies in span(b1,…,bk)=span(b1∗,…,bk∗). So t−v and e have the same component o orthogonal to span(L) and the same coordinates along bi∗ for i>k. With Lemma 2 for the coordinates i≤k,
∥t−v∥2=∥o∥2+i>k∑Ni⟨e,bi∗⟩2+i≤k∑ci2Ni≤∥e∥2+41i≤k∑Ni. Lemma 3 gives 41Nk≤∥e∥2, so 41∑i≤kNi≤∥e∥2∑i≤kNi/Nk, and the claim follows. □
Corollary (LLL-reduced bases). If the basis is LLL-reduced with parameter δ∈(1/4,1] and α=1/(δ−1/4), then ∥t−v∥2≤(1+α−1αn−1)dist(t,L)2. For δ=3/4, α=2 and ∥t−v∥≤2n/2dist(t,L).
Proof. The Lovász condition and ∣μi+1,i∣≤1/2 give Ni+1≥(δ−μi+1,i2)Ni≥Ni/α, so Ni≤αk−iNk for i≤k. Then ∑i≤kNi/Nk≤∑j=0k−1αj=(αk−1)/(α−1), which is largest at k=n. Insert this into Lemma 5. For α=2 the factor is 1+2n−1=2n. □
Termination and cost. Line L1 computes Gram-Schmidt in O(n2m) arithmetic operations. The loop at line L3 runs n times; line L4 is one inner product, O(m), and line L5 is O(m), so the loop costs O(nm). The total is O(n2m) arithmetic operations, and the algorithm terminates.
Theorem. On every valid input the algorithm returns x∈Zn and v=xB∈L (Lemma 1) such that the Gram-Schmidt coordinates of t−v lie in [−1/2,1/2) (Lemma 2). It returns a closest vector whenever dist(t,L)<21mini∥bi∗∥ (Lemma 4), it is within the factor of Lemma 5 of the optimum on every basis and within 2n/2 on bases that are LLL-reduced with δ=3/4, and it uses O(n2m) arithmetic operations. ■