Exact PSLQ returns an integer relation after at most (n - 1) ln X / ln tau^2 iterations full
This proof shows: correctness, termination, time.worst.
Setting. The input is x∈Qn, n≥2, x=0, and γ2>4/3; let τ2=4γ2/(4+γ2), so that 1/τ2=1/γ2+1/4 and 1<τ2<4. We write ai for the rows of A, Px for the orthogonal projection onto x⊥, pi=aiPx=ai−(⟨ai,x⟩/⟨x,x⟩)x, and μij, Bj=∥pj∗∥2 for the Gram-Schmidt data of p1,…,pn, with dk=B1⋯Bk the Gram determinant of p1,…,pk. The line numbers refer to the main block of the page.
Lemma 1 (the integer invariants). At every moment A is an integer matrix with detA=±1, B=A−1, and y=xB, so x=yA=∑iyiai.
Proof. Line L1 sets A=B=I and y=x. Line L7 exchanges rows r,r+1 of A and columns r,r+1 of B, which keeps B=A−1 and permutes the entries of y=xB. Line L11 multiplies A on the left by I−tEij, and line L12 multiplies B on the right by its inverse I+tEij, which adds t times column i to column j; then y=xB changes by yj←yj+tyi. Both matrices are integer with determinant ±1. □
Lemma 2 (the Gram-Schmidt data). At every moment, the stored μij (j≤n−1) and Bj are the Gram-Schmidt data of the rows pi, and Bn=0. After HERMITE-REDUCE, ∣μij∣≤1/2 for all j<i.
Proof. Line L2 computes them from the Gram matrix ⟨pi,pj⟩=⟨ai,aj⟩−⟨ai,x⟩⟨aj,x⟩/⟨x,x⟩, which for A=I is I−xTx/⟨x,x⟩. Since p1,…,pn lie in x⊥, of dimension n−1, and p1,…,pn−1 are independent while all yj=0 (Lemma 3), these span x⊥ and pn∗=0.
The projection Px is linear, so the row operation ai←ai−taj is pi←pi−tpj, and the swap of ar,ar+1 is the swap of pr,pr+1. Line L11 is the update of a size reduction step, exactly as in Lemma 2 of the LLL proof (the vector pi∗ does not change, and μik←μik−tμjk for k<j, μij←μij−t). Line L8 is the swap update of Lemma 3 there, which needs only Br′=Br+1+μr+1,r2Br=0; this holds by Lemma 3 below, as the new p1,…,pn−1 are independent. For r=n−1, with pn∗=0, the derivation gives cn−1∗=μpn−1∗, so Bn−1′=μ2Bn−1, and cn∗=pn−1∗−μ1cn−1∗=0, matching Bn′=Bn−1Bn/Bn−1′=0.
In HERMITE-REDUCE, for a fixed i the steps with j=i−1,…,1 change μik only for k≤j; so after the step at j, ∣μij∣≤1/2, and later steps (smaller j) do not change it. Rows other than i are not changed by the steps of row i. □
Lemma 3 (independence while no relation is found). If all yj=0, then for every j the n−1 vectors pi, i=j, are linearly independent. In particular p1,…,pn−1 are independent and B1,…,Bn−1>0.
Proof. Suppose ∑i=jcipi=0 with the ci not all zero. Then ∑i=jciai=λx for some λ, and λ=0 because the ai are independent. So x lies in the span of the ai, i=j. But x=∑iyiai is the unique expansion in the basis A, and yj=0: a contradiction. □
The checks at lines L1 and L5 guarantee that all yj=0 whenever lines L2, L6 to L8 run; the swap at line L7 only permutes y, so the condition still holds when line L8 runs.
Lemma 4 (the Gram determinants). For k≤n−1, dk=detGram(a1,…,ak,x)/⟨x,x⟩. If x is an integer vector and all yj=0, then dk≥1/⟨x,x⟩.
Proof. Subtracting (⟨ai,x⟩/⟨x,x⟩)x from each ai is an elementary operation on the list a1,…,ak,x that does not change its Gram determinant, and it gives p1,…,pk,x, whose Gram matrix is block diagonal because pi⊥x. So detGram(a1,…,ak,x)=dk⟨x,x⟩. For integer A and x the left side is an integer, and it is positive since dk>0 by Lemma 3; hence it is at least 1. □
Lemma 5 (one iteration). Let D=∏k=1n−1dk=∏j=1n−1Bjn−j. Initially D≤1 and every Bj≤1. Each iteration multiplies D by at most 1/τ2 and does not increase maxj≤n−1Bj.
Proof. For A=I, the Schur complement gives detGram(e1,…,ek,x)=⟨x,x⟩−∑i≤kxi2, so by Lemma 4, dk=∑i>kxi2/∑ixi2≤1, and Bj=dj/dj−1≤1 since the dk decrease. HERMITE-REDUCE does not change any Bj.
Consider the swap at r, after a HERMITE-REDUCE, so μ=μr+1,r has ∣μ∣≤1/2 by Lemma 2. If r≤n−2, the choice at line L6 gives γ2rBr≥γ2(r+1)Br+1, that is Br+1≤Br/γ2, so
Br′=Br+1+μ2Br≤Br(γ21+41)=τ2Br. If r=n−1, then Bn=0 and Bn−1′=μ2Bn−1≤Bn−1/4<Bn−1/τ2. In both cases the first k rows are the same set for every k=r, so dk is unchanged for k=r, and dr′=dr−1Br′≤dr/τ2; since r≤n−1, the factor dr occurs in D, and D′≤D/τ2. For the maximum: Br′≤Br, and for r≤n−2, Br+1′=BrBr+1/Br′≤Br because Br′≥Br+1; for r=n−1, Bn′=0. The other Bj do not change. □
Theorem 1 (correctness). If the algorithm returns a vector m, then m∈Zn, m=0 and ⟨m,x⟩=0.
Proof. It returns ej at line L1 when xj=0, or column j of B at line L5 when yj=0. In the second case m is a column of the invertible integer matrix B, so m=0, and ⟨x,m⟩=(xB)j=yj=0 by Lemma 1. □
Theorem 2 (the lower bound). At every moment when all yj=0, every integer relation m of x satisfies ∥m∥2≥1/maxj≤n−1Bj. This bound never decreases during the run.
Proof. Since ⟨m,x⟩=0, m∈x⊥, and ⟨pi,m⟩=⟨aiPx,m⟩=⟨ai,m⟩, the ith entry of the integer vector z=AmT; z=0 since A is invertible. By Lemma 3 the vectors p1∗,…,pn−1∗ are a nonzero orthogonal basis of x⊥, so some ⟨pk∗,m⟩=0; let k be the least such index. Then zk=⟨pk,m⟩=⟨pk∗,m⟩+∑j<kμkj⟨pj∗,m⟩=⟨pk∗,m⟩=0, so 1≤∣zk∣≤∥pk∗∥∥m∥, and ∥m∥2≥1/Bk≥1/maxjBj. The bound never decreases by Lemma 5. □
Theorem 3 (termination). Let x^ be the primitive integer vector on the line of x and X=∥x^∥2. The number I of iterations satisfies τ2I≤Xn−1, so I≤(n−1)lnX/lnτ2, and the algorithm returns a relation.
Proof. Replacing x by x^=cx with c=0 changes neither Px nor which entries of y=xB are zero, so every step is the same; we may assume x=x^. If X=1, x=±ej has a zero entry and line L1 returns (as n≥2). Otherwise consider the state just after the swap of the tth iteration. All yj were nonzero at line L5 of that iteration, and the swap only permuted them, so by Lemma 4 every dk≥1/X and D≥X−(n−1). By Lemma 5, D≤τ−2t. Hence τ2t≤Xn−1 for every iteration t that is performed. Since τ2>1, only finitely many iterations happen; the loop can only end at line L5, with a relation by Theorem 1. □
Theorem 4 (cost). The algorithm takes O(n3(I+1))=O(n4logX) arithmetic operations, using O(n2) space.
Proof. Line L2 computes the Gram matrix of the pi in O(n2) operations for A=I and the Gram-Schmidt data in O(n3). Line L6 takes O(n) operations, line L7 O(n), and line L8 O(n). HERMITE-REDUCE makes at most n(n−1)/2 steps, each with O(n) operations on μ, on a row of A and on a column of B, so O(n3). There are I iterations, each with one HERMITE-REDUCE, plus the call at line L3 and the checks at line L5 of O(n) each, giving O(n3(I+1)), and I=O(nlogX) by Theorem 3. The stored data are A, B, μ, y and the Bj, which are O(n2) numbers. □