Algorithm Search⌘K

Proofs: Seysen reduction

These are the human proofs of Seysen reduction, at full length.

Seysen's algorithm returns a Seysen-reduced basis of the same lattice after at most S_0 det(G) updates full

This proof shows: correctness, termination, time.worst.

Setting. The input is a list of linearly independent rows b1,…,bn∈Qmb_1, \ldots, b_n \in \mathbb{Q}^m, the matrix BB with these rows, G=BBTG = B B^{\mathsf T}, H=G−1H = G^{-1} and D=HBD = H B with rows d1,…,dnd_1, \ldots, d_n. We write EjiE_{ji} for the matrix with a single 1 in row jj and column ii, and ⌈x⌋=⌊x+1/2⌋\lceil x \rfloor = \lfloor x + 1/2 \rfloor. The line numbers refer to the main block of the page.

Lemma 1 (the dual basis). DBT=ID B^{\mathsf T} = I, that is ⟨dk,bl⟩=1\langle d_k, b_l \rangle = 1 if k=lk = l and 00 otherwise, and DDT=HD D^{\mathsf T} = H. The rows of DD are the only vectors in the row space of BB with the first property.

Proof. DBT=HBBT=HG=ID B^{\mathsf T} = H B B^{\mathsf T} = H G = I and DDT=HGH=HD D^{\mathsf T} = H G H = H. If dd lies in the row space, d=yBd = y B, and ⟨d,bl⟩=(yG)l\langle d, b_l \rangle = (y G)_l; so prescribing these values fixes yy, as GG is invertible. □\square

Lemma 2 (one update). Let i≠ji \ne j, λ∈Z\lambda \in \mathbb{Z}, and T=I+λEjiT = I + \lambda E_{ji}, so that B′=TBB' = T B replaces bjb_j by bj+λbib_j + \lambda b_i. Then B′B' is a basis of the same lattice, its Gram matrix is G′=TGTTG' = T G T^{\mathsf T}, its dual basis is D′=T−TDD' = T^{-\mathsf T} D, which replaces did_i by di−λdjd_i - \lambda d_j, and the dual Gram matrix is H′=T−THT−1H' = T^{-\mathsf T} H T^{-1}. Line L9 computes G′G' and H′H'.

Proof. TT is an integer matrix with det⁡T=1\det T = 1 and integer inverse T−1=I−λEjiT^{-1} = I - \lambda E_{ji} (as Eji2=0E_{ji}^2 = 0), so BB and B′B' generate the same lattice. G′=TBBTTTG' = T B B^{\mathsf T} T^{\mathsf T}. The rows of T−TDT^{-\mathsf T} D lie in the row space and satisfy T−TDBTTT=T−TTT=IT^{-\mathsf T} D B^{\mathsf T} T^{\mathsf T} = T^{-\mathsf T} T^{\mathsf T} = I, so by Lemma 1 they are the dual basis of B′B'; T−T=I−λEijT^{-\mathsf T} = I - \lambda E_{ij} subtracts λ\lambda times row jj from row ii. Multiplying GG on the left by TT adds λ\lambda times row ii to row jj, and on the right by TTT^{\mathsf T} adds λ\lambda times column ii to column jj; likewise for HH with −λ-\lambda and the roles of ii and jj exchanged. These are the four operations of line L9. □\square

Lemma 3 (the change of S). With S=∑kGkkHkkS = \sum_k G_{kk} H_{kk}, the update of Lemma 2 changes SS by

ΔS=2GiiHjj(λ2−2λλ∗),λ∗=12(HijHjj−GijGii).\Delta S = 2 G_{ii} H_{jj} \big( \lambda^2 - 2 \lambda \lambda^* \big), \qquad \lambda^* = \frac12 \left( \frac{H_{ij}}{H_{jj}} - \frac{G_{ij}}{G_{ii}} \right).

Proof. Only bjb_j and did_i change, so only the terms k=ik = i and k=jk = j change, and in them ∥bi∥2=Gii\|b_i\|^2 = G_{ii} and ∥dj∥2=Hjj\|d_j\|^2 = H_{jj} stay fixed. Now ∥bj+λbi∥2=Gjj+2λGij+λ2Gii\|b_j + \lambda b_i\|^2 = G_{jj} + 2 \lambda G_{ij} + \lambda^2 G_{ii} and ∥di−λdj∥2=Hii−2λHij+λ2Hjj\|d_i - \lambda d_j\|^2 = H_{ii} - 2 \lambda H_{ij} + \lambda^2 H_{jj}. Hence

ΔS=Hjj(2λGij+λ2Gii)+Gii(λ2Hjj−2λHij)=2GiiHjjλ2−2λ(GiiHij−HjjGij),\Delta S = H_{jj} (2 \lambda G_{ij} + \lambda^2 G_{ii}) + G_{ii} (\lambda^2 H_{jj} - 2 \lambda H_{ij}) = 2 G_{ii} H_{jj} \lambda^2 - 2 \lambda (G_{ii} H_{ij} - H_{jj} G_{ij}),

and GiiHij−HjjGij=2GiiHjjλ∗G_{ii} H_{ij} - H_{jj} G_{ij} = 2 G_{ii} H_{jj} \lambda^*. □\square

Lemma 4 (the best integer). Let f(λ)=λ2−2λλ∗=(λ−λ∗)2−(λ∗)2f(\lambda) = \lambda^2 - 2 \lambda \lambda^* = (\lambda - \lambda^*)^2 - (\lambda^*)^2. If ∣λ∗∣≤1/2|\lambda^*| \le 1/2 then f(λ)≥0f(\lambda) \ge 0 for all integers λ\lambda. If ∣λ∗∣>1/2|\lambda^*| > 1/2 then f(⌈λ∗⌋)<0f(\lceil \lambda^* \rfloor) < 0, and ⌈λ∗⌋\lceil \lambda^* \rfloor minimizes ff over the integers.

Proof. f(λ)<0f(\lambda) < 0 means ∣λ−λ∗∣<∣λ∗∣|\lambda - \lambda^*| < |\lambda^*|. If ∣λ∗∣≤1/2|\lambda^*| \le 1/2, every integer λ≠0\lambda \ne 0 has ∣λ−λ∗∣≥∣λ∣−∣λ∗∣≥1−1/2≥∣λ∗∣|\lambda - \lambda^*| \ge |\lambda| - |\lambda^*| \ge 1 - 1/2 \ge |\lambda^*|, and f(0)=0f(0) = 0. If ∣λ∗∣>1/2|\lambda^*| > 1/2, then ∣⌈λ∗⌋−λ∗∣≤1/2<∣λ∗∣|\lceil \lambda^* \rfloor - \lambda^*| \le 1/2 < |\lambda^*|. The nearest integer to λ∗\lambda^* minimizes (λ−λ∗)2(\lambda - \lambda^*)^2. □\square

Theorem 1 (correctness). If the algorithm returns, the output is a basis of the input lattice and it is Seysen-reduced: for all i≠ji \ne j and all integers λ\lambda, replacing bjb_j by bj+λbib_j + \lambda b_i does not lower SS. Equivalently ∣λij∗∣≤1/2|\lambda_{ij}^*| \le 1/2 for all ordered pairs.

Proof. By Lemma 2, by induction over the updates, the rows stay a basis of LL and GG, HH are the Gram matrices of the current basis and its dual. Line L7 tests f(⌈λ∗⌋)<0f(\lceil \lambda^* \rfloor) < 0, which by Lemma 3 is ΔS<0\Delta S < 0, as GiiHjj>0G_{ii} H_{jj} > 0. The algorithm returns after a pass in which no test succeeds, and during that pass the matrices did not change, so at the end every pair has f(⌈λij∗⌋)≥0f(\lceil \lambda_{ij}^* \rfloor) \ge 0. By Lemma 4 this gives ∣λij∗∣≤1/2|\lambda_{ij}^*| \le 1/2, and then f(λ)≥0f(\lambda) \ge 0 for all integers λ\lambda, that is ΔS≥0\Delta S \ge 0 for every update. □\square

Theorem 2 (termination and the number of updates). Let the input rows be integer vectors, S0S_0 the initial measure and SendS_{\text{end}} the final one. Then the number of updates satisfies K≤(S0−Send)det⁡(G)≤S0det⁡(G)≤nXnK \le (S_0 - S_{\text{end}}) \det(G) \le S_0 \det(G) \le n X^n, where XX bounds the squared lengths of the input rows. For a rational input, scaling all rows by a common denominator changes neither the tests nor SS, so the same bound holds for the scaled basis.

Proof. det⁡G′=det⁡(T)2det⁡G=det⁡G\det G' = \det(T)^2 \det G = \det G, so Δ:=det⁡G\Delta := \det G is a fixed positive integer. Since H=adj⁡(G)/ΔH = \operatorname{adj}(G) / \Delta, we have SΔ=∑kGkkadj⁡(G)kkS \Delta = \sum_k G_{kk} \operatorname{adj}(G)_{kk}, an integer, at every moment, as GG stays an integer matrix by Lemma 2. Each update lowers SS strictly (Lemma 3 and line L7), so it lowers SΔS \Delta by at least 1; hence K≤(S0−Send)ΔK \le (S_0 - S_{\text{end}}) \Delta. Finally adj⁡(G)kk\operatorname{adj}(G)_{kk} is the Gram determinant of the rows other than bkb_k, at most ∏l≠kGll≤Xn−1\prod_{l \ne k} G_{ll} \le X^{n-1} by Hadamard's inequality, and Gkk≤XG_{kk} \le X, so S0Δ≤nXnS_0 \Delta \le n X^n. Scaling the rows by qq multiplies GG by q2q^2 and HH by q−2q^{-2}, which leaves λ∗\lambda^* and SS unchanged. □\square

Theorem 3 (cost). The algorithm takes O(n3+n2m+(n2+m)K)O(n^3 + n^2 m + (n^2 + m) K) arithmetic operations. For an integer input, every number it stores is an integer or a rational with denominator dividing det⁡G\det G, of O(nlog⁡X)O(n \log X) digits, assuming X≥2X \ge 2.

Proof. Line L1 computes GG with O(n2m)O(n^2 m) operations and HH by Gauss-Jordan elimination with O(n3)O(n^3). A pass runs line L5 to L7 for n(n−1)n(n-1) pairs at O(1)O(1) each. An update costs O(m)O(m) at line L8 and O(n)O(n) at line L9. Every pass but the last makes at least one update, so there are at most K+1K + 1 passes, and the total is O(n2m+n3+n2(K+1)+(n+m)K)O(n^2 m + n^3 + n^2 (K + 1) + (n + m) K).

For the sizes: at every moment SΔ≤S0Δ≤nXnS \Delta \le S_0 \Delta \le n X^n. Both GkkG_{kk} and adj⁡(G)kk=ΔHkk\operatorname{adj}(G)_{kk} = \Delta H_{kk} are positive integers (Gram determinants of integer vectors), and their product is at most SΔS \Delta, so each is at most nXnn X^n. By Cauchy-Schwarz for the positive definite matrices GG and adj⁡(G)\operatorname{adj}(G), ∣Gkl∣≤GkkGll|G_{kl}| \le \sqrt{G_{kk} G_{ll}} and the same for adj⁡(G)\operatorname{adj}(G). The basis entries satisfy ∣bjt∣≤∥bj∥≤(nXn)1/2|b_{jt}| \le \|b_j\| \le (n X^n)^{1/2}. So all these integers have O(log⁡n+nlog⁡X)=O(nlog⁡X)O(\log n + n \log X) = O(n \log X) digits, and the entries of HH are such integers over Δ≤Xn\Delta \le X^n. The values λ∗\lambda^* and λ\lambda are computed from them, and ∣λ∣≤∣λ∗∣+1/2|\lambda| \le |\lambda^*| + 1/2 is bounded by the same sizes. The intermediate values of the Gauss-Jordan elimination are ratios of minors of GG, of the same size by Hadamard's inequality. □\square

Back to Seysen reduction