Algorithm Search⌘K

Proofs: Block Lanczos algorithm

These are the human proofs of Block Lanczos algorithm, at full length.

Block Lanczos returns independent kernel vectors, and it stops full

This proof shows: correctness, termination.

Let BB be an m×nm \times n matrix over F2\mathbb{F}_2, A=BTBA = B^T B, s≥1s \ge 1 the block width and Y∈F2n×sY \in \mathbb{F}_2^{n \times s}. The iteration produces blocks V0,…,VmV_0, \dots, V_m and a block XX, and the final step works with the n×2sn \times 2s matrix Z=[X+Y∣Vm]Z = [X + Y \mid V_m].

Claim. (1) The algorithm stops. (2) It returns a basis of the space col⁡(Z)∩ker⁡B\operatorname{col}(Z) \cap \ker B. In particular every returned vector xx is nonzero with Bx=0Bx = 0, the returned vectors are independent, and if ker⁡B=0\ker B = 0 it returns nothing. (3) If the selection on line L5 succeeds, the matrix WiinvW_i^{\mathrm{inv}} it returns satisfies Wiinv=Si(SiTTiSi)−1SiTW_i^{\mathrm{inv}} = S_i (S_i^T T_i S_i)^{-1} S_i^T, where Ti=ViTAViT_i = V_i^T A V_i.

Claim (2) does not depend on how XX and VmV_m were computed, and it holds for every random choice. How large col⁡(Z)∩ker⁡B\operatorname{col}(Z) \cap \ker B is, which decides how many vectors are found, is a probabilistic question. The remark at the end explains it but does not prove it.

(1) Termination. The loop of line L2 runs at most n+10n + 10 times. Each step does a fixed number of block products and s×ss \times s operations. The selection on line L5 is a loop over ss columns. Each inner reduction loop of line L10 clears the top bit of img, so it runs at most mm times. The final echelon loop clears the top bit of vec in each pass, so it runs at most nn times per vector.

(2) The final step. Write z0,…,z2s−1z_0, \dots, z_{2s-1} for the columns of ZZ. Line L10 treats them in order and keeps a table basis of pairs (g,h)(g, h) that are indexed by distinct leading positions. Two invariants hold:

  • (J1) every stored pair has g=Bhg = Bh and g≠0g \ne 0, and hh is a sum of columns of ZZ;
  • (J2) every pair (g,h)(g, h) handled during the reduction of column cc has g=Bhg = Bh, and h=zc+(a sum of zc′ with c′<c)h = z_c + (\text{a sum of } z_{c'} \text{ with } c' < c).

At the start of column cc, the pair is (Bzc,zc)(Bz_c, z_c), and (J2) holds. A reduction step adds a stored pair (g′,h′)(g', h'). By (J1), g′=Bh′g' = Bh', so g+g′=B(h+h′)g + g' = B(h + h'). Also h′h' is a sum of earlier columns, because a pair is stored only when its column is finished. So (J2) still holds. If the reduced image is nonzero, the pair is stored with the leading position of gg. That position is not in the table, because the loop stopped exactly there. So (J1) holds and the positions stay distinct.

When the image reduces to 00, (J2) gives Bh=0Bh = 0, and the vector hh is put in the list kernel if it is nonzero. So every vector in kernel lies in col⁡(Z)∩ker⁡B\operatorname{col}(Z) \cap \ker B.

Conversely, let PP be the set of columns whose reduced image is nonzero (the pivot columns) and QQ the rest. For c∈Qc \in Q, the reduction gives a coefficient vector uc∈F22su_c \in \mathbb{F}_2^{2s} with Zuc=hcZ u_c = h_c, BZuc=0B Z u_c = 0, a 11 in position cc and zeros in the later positions of QQ. The images BzcB z_c for c∈Pc \in P are independent, because their reduced forms have distinct leading positions. So the rank of BZBZ is ∣P∣|P|, and ker⁡(BZ)\ker(BZ) has dimension ∣Q∣|Q|. The ucu_c for c∈Qc \in Q are independent, since their entries on QQ form a triangular pattern. So they form a basis of ker⁡(BZ)\ker(BZ). Every x∈col⁡(Z)∩ker⁡Bx \in \operatorname{col}(Z) \cap \ker B is x=Zux = Zu for some uu with BZu=0BZu = 0, which is a combination of the ucu_c. Hence xx is a combination of the hc=Zuch_c = Z u_c. So the vectors hch_c span col⁡(Z)∩ker⁡B\operatorname{col}(Z) \cap \ker B, and leaving out the zero ones does not change the span.

The last loop of the algorithm reduces each vector of kernel against a table out with distinct leading positions. Each stored vector is nonzero, and each lies in the span of kernel, since it is a sum of vectors of kernel. The span of the table is the span of kernel: a vector that reduces to zero is a sum of stored vectors. Vectors with distinct leading positions are independent. So out is a basis of col⁡(Z)∩ker⁡B\operatorname{col}(Z) \cap \ker B.

If ker⁡B=0\ker B = 0, this space is 00, and the algorithm returns nothing. If all tries return nothing, the algorithm returns the empty list. That answer is allowed, and the algorithm never reports a wrong vector. □\square

(3) The selection. The procedure runs Gauss-Jordan elimination on the s×2ss \times 2s matrix [Ti∣I][T_i \mid I]. It takes the columns not in Si−1S_{i-1} first. A column cc with a pivot in the left half is put in SiS_i. For a column without a left pivot, the row that has a 11 in position s+cs + c of the right half is used to clear that position in the other rows, and then it is set to zero. Montgomery (1995, Section 8) proves that this produces Wiinv=Si(SiTTiSi)−1SiTW_i^{\mathrm{inv}} = S_i (S_i^T T_i S_i)^{-1} S_i^T and a set SiS_i with ∣Si∣=rank⁡Ti|S_i| = \operatorname{rank} T_i. The cover condition Si∪Si−1={0,…,s−1}S_i \cup S_{i-1} = \{0, \dots, s - 1\} is checked explicitly, and the procedure reports a breakdown if it fails. The tests check both identities against a dense inverse, on 400400 random symmetric matrices. Claim (2) does not use (3): a wrong WiinvW_i^{\mathrm{inv}} could only lower the number of vectors found.

Remark: why ZZ contains kernel vectors. Write Wi=col⁡(ViSi)W_i = \operatorname{col}(V_i S_i). Montgomery (1995, Sections 4 to 6) shows that, with the recurrence of lines L7 and L8 and no breakdown:

  • the spaces WiW_i are pairwise AA-orthogonal, that is, WjTAWi=0W_j^T A W_i = 0 for i≠ji \ne j;
  • each WiTAWiW_i^T A W_i is invertible;
  • W0+⋯+WiW_0 + \dots + W_{i} is the Krylov space spanned by V0,AV0,…V_0, AV_0, \dots up to that step.

The tests check the first property directly on the iterates.

Since the WiW_i are independent, the dimensions ∣Si∣|S_i| add up to at most nn, so with no breakdown there are at most nn iterations. X=∑iViWiinvViTV0X = \sum_i V_i W_i^{\mathrm{inv}} V_i^T V_0 is the AA-orthogonal projection of YY onto the Krylov space. If the iteration ends with Vm=0V_m = 0, then AX=V0=AYAX = V_0 = AY, so A(X+Y)=0A(X + Y) = 0 over F2\mathbb{F}_2. Then B(X+Y)B(X + Y) lies in ker⁡BT∩im⁡B\ker B^T \cap \operatorname{im} B, which is usually small, and the elimination of line L10 removes it.

Over F2\mathbb{F}_2, the iteration usually ends instead with VmTAVm=0V_m^T A V_m = 0 but Vm≠0V_m \ne 0. Montgomery argues that then A(X+Y)A(X + Y) and AVmA V_m together have small rank, so that combinations of the columns of X+YX + Y and VmV_m lie in ker⁡A\ker A, and most of them in ker⁡B\ker B. In the worked example on the page, A(X+Y)=AV1A(X + Y) = A V_1 exactly. That is why ZZ has both. This explanation and the expected count of about n/(s−0.76)n / (s - 0.76) iterations are Montgomery's analysis, not proved here. The page reports the measured counts. ■\blacksquare

Back to Block Lanczos algorithm