This page describes the library's program for the block Golub–Kahan process. The driver performs no arithmetic of its own: it draws the start block from a tape, applies \mathbf{A} and its adjoint column by column, and calls an extension operation for every orthogonalization. Full reorthogonalization means that every extension is against all stored columns of its side. The matrix is real and is reached only through the two products. The block width is written \ell; the Lean statements name it b.
The guarantees are of three kinds, kept apart below: a certificate of the program under exact contracts, which identifies its stored output with an exact run of the process; bounds for a mathematical model of a rounded run; and, under Scope, what has not been connected.
Definition (Driver with an abstract extension operation). The dimensions are [m,n,\ell,q]. The call \operatorname{extend}(\mathbf{Q},\mathbf{W}) extends the stored basis \mathbf{Q} by the block \mathbf{W} and returns the new block and its coefficients.
Draw an n\times \ell start block \mathbf{W} from the tape stream into scratch.
\mathbf{W}=\mathbf{A}\mathbf{V}_j, one product per column;
\mathbf{U}_j and block column j of \mathbf{R}=\operatorname{extend}(\mathbf{U}_{<j},\mathbf{W});
\mathbf{W}=\mathbf{A}^{\mathsf{T}}\mathbf{U}_j, one product per column;
\mathbf{V}_{j+1} and block column j of \mathbf{S}=\operatorname{extend}(\mathbf{V}_{\le j},\mathbf{W}).
Return \mathbf{U},\mathbf{V},\mathbf{G},\mathbf{R},\mathbf{S} and release the scratch block.
Storage is column-major, one word per entry: \mathbf{U} has q\ell m words, \mathbf{V} has (q+1)\ell n words, \mathbf{G} has \ell^2 words, and the coefficients \mathbf{R} and \mathbf{S} are packed by block column. The scratch block has \max(m,n)\,\ell words.
The driver uses three groups of operations: the extension of a stored basis by a block, the products with \mathbf{A} and with its adjoint, and scalar draws from a tape stream. Each has a contract. The selector chooses the contracts for products and basis extension. Their assumptions are stated with the corresponding accuracy guarantees. The work and workspace of every primitive are parameters of the model.
A concrete orthogonalization scheme is a separate program certified against one of the two extension contracts and substituted for the operation by linking. The two-pass Gram–Schmidt extension is such a program.
Operations and Storage
Theorem (Primitive operation counts). At the sizes (m,n,\ell,q), the primitive part of the static budget of the fixed program is
n\ell scalar draws from the tape stream;
q\ell products with \mathbf{A};
q\ell products with its adjoint;
2q+1 basis extensions: one of the start block against the empty basis and, for each j<q, one of \ell columns of length m against j\ell stored columns and one of \ell columns of length n against (j+1)\ell stored columns.
The full budget also counts the structural instructions (index arithmetic, addressing, allocation, and control); the library records it as the instruction count of the program, not as a closed formula.
Theorem (Scratch storage). For every resource model, the scratch of the fixed program at the sizes (m,n,\ell,q) is at most
\max(m,n)\,\ell+w+w_{\mathrm{q}},
where w is the largest declared workspace among the primitive calls of the run: a draw, a product with \mathbf{A}, a product with its adjoint, and the 2q+1 basis extensions at their dimensions. No common bound on the workspaces of the primitives is assumed. The block of \max(m,n)\,\ell words holds the drawn block and then the products.
Here w_{\mathrm{q}} is the maximum declared workspace of any query included in the program's instruction budget, with maximum zero when there are no queries. It is also zero when all admitted queries have zero workspace. Adding this reservation allows query scratch to overlap the largest live allocation, giving a conservative total in abstract word cells.
The run consumes exactly n\ell words of the tape. Resident memory is the five output blocks plus the scratch. The cost of an extension is that of the scheme linked for it; after linking, each of the 2q+1 extension calls is replaced by a supplied bound on the cost of the scheme at its dimensions.
Scope
In exact arithmetic the stored product equals \mathsf{rbki}(\mathbf{A},\mathbf\Omega,q), so every statement about that matrix applies to exact factors; for a standard Gaussian start block these are the bounds on the randomized block Krylov iteration page. The following are not stated in the library, and nothing on this page should be read as claiming them.
A concrete linked certificate. The driver has a generic linking theorem, and the two-pass Gram–Schmidt extension program has an exact and a rounded statement of its own, but the certificate of the driver linked with that program over an exact or a rounded level-one model, with its typing side condition and recomputed costs, is not written.
A rounded canonical certificate. The rounded run is stated as total execution of the implementation and as a counted run of a linked program, not as a packaged certificate.
An end-to-end rounded accuracy theorem. The forward bound compares the returned factors with the projection onto the computed left range. The Gaussian bounds for randomized block Krylov iteration are exact-arithmetic statements and are not transferred to a rounded run.
Complex scalars for the program. The exact process and the exact extension contract are over real or complex scalars; the stored-run predicates, the certificate, the rounded run model, and the rounded analysis of the Gram–Schmidt extension are over the reals.
Accuracy
Theorem (Total exact certificate over an abstract extension). For all sizes (m,n,\ell,q), every real m\times n matrix \mathbf{A}, every interpretation whose products are the exact products with \mathbf{A} and its adjoint and whose basis extension meets the exact contract, and every tape, the counted run of the fixed program succeeds within its static budget and resource bounds. It consumes n\ell words of the tape, releases its scratch, and leaves five output blocks that decode to an exact run for \mathbf{A} from the start block decoded from the tape.
There is no rank, nonbreakdown, or successful-run hypothesis. The extension operation is abstract in this statement: it certifies the driver for any interpretation meeting the exact contract and does not name a concrete orthogonalization program.
Lean statement and details
NLAlib.Krylov.GolubKahan.Band.Certification.certifies
(work workspace : Krylov.GolubKahan.Band.Certification.Operation → List ℕ → ℕ) (stream : ℕ) :
(Krylov.GolubKahan.Band.solveProgram stream).Certifies
(Krylov.GolubKahan.Band.Certification.model work workspace)
(Krylov.GolubKahan.Band.Certification.specification work workspace stream)
Theorem (Stored factors of an exact run). Let \mathbf{U}, \mathbf{V}, and the packed coefficient block columns \mathbf{S}_j be the stored blocks of an exact run for a real matrix \mathbf{A} from the start block \mathbf\Omega, and let \mathbf{S} be the assembled (q+1)\ell\times q\ell matrix. Then
Theorem (The stored output on the tape of a given start block). Let a program be certified for the block Golub–Kahan problem with a postcondition that implies the exact-run postcondition, and let \mathbf{A} be the real m\times n input matrix. For every real n\times\ell matrix \mathbf{X}, the stored product of the run on the tape carrying \mathbf{X} is
The equality holds for every \mathbf{X}, not almost surely. The library uses it to transfer a tail bound or an expectation for \mathsf{rbki}(\mathbf{A},\mathbf{X},q) to the stored output of the counted run, and restates two bounds for a standard Gaussian \mathbf{X} in that form: the gapped tail bound for every block size and the gapped expectation bound for t+2\le\ell. These are exact-arithmetic accuracy statements: they use the exact certificate.
Lean statement and details
NLAlib.BlockKrylov.storedOutput_eq_rbki {Lo : Type}
{L : Ops.AccessModel Lo Ops.CmpTst Krylov.GolubKahan.Band.Certification.problem}
{S : Ops.Specification Lo Ops.CmpTst Krylov.GolubKahan.Band.Certification.problem}
(alg : Ops.Algorithm L S) (stream : ℕ)
(hgood :
∀ (d : Fin 4 → ℕ) (x : Krylov.GolubKahan.Band.Certification.problem.Input d) (τ : Ops.Tape ℝ)
(c : Ops.Count (Lo ⊕ Ops.Bookkeeping) Ops.CmpTst) (μ : Ops.Mem ℝ),
S.good d x τ c μ →
Krylov.GolubKahan.Band.Certification.Good stream d
(Krylov.GolubKahan.Band.Certification.matrix x) τ μ)
{d : Fin 4 → ℕ} (input : Krylov.GolubKahan.Band.Certification.problem.Input d)
(I : Ops.Interp Lo Ops.CmpTst ℝ) (hI : L.contracts d input I)
(X : Matrix (Fin (d 1)) (Fin (d 2)) ℝ) :
BlockKrylov.storedOutput alg stream input I X =
rbki (Krylov.GolubKahan.Band.Certification.matrix input) X (d 3)
The rounded statements are over the reals. They concern a mathematical run model: a relation satisfied by stored matrices, with error parameters. Under rounded contracts for the products and the extension, the library states that the same program runs in total mode and that its stored blocks decode to such a run, and it states the orthogonality and forward bounds below for the decoded output words. These are statements under assumed contracts for an abstract extension operation.
Definition (Rounded extension of a basis by a block). For a matrix \mathbf{Q}, let \mathbf{D}(\mathbf{Q})=\mathbf{Q}^{\mathsf{T}}\mathbf{Q}-\operatorname{diag}(\mathbf{s}) be its Gram defect on the support, where s_j=0 at a zero column and s_j=1 otherwise. A rounded extension of \mathbf{Q} by a block \mathbf{W} of \ell columns, with parameters (\eta_0,\mu,\varepsilon), consists of \mathbf{Q}', \mathbf{H}, and an upper triangular \mathbf{R} such that a zero column of \mathbf{W} gives a zero column of \mathbf{Q}' and, whenever \mathbf{Q} lies in the window
every column \mathbf{q}'_c of \mathbf{Q}' is zero, or satisfies \bigl|\|\mathbf{q}'_c\|^2-1\bigr|\le\mu and \|\mathbf{Q}^{\mathsf{T}}\mathbf{q}'_c\|^2+\sum_{c'<c}(\mathbf{q}'_{c'}\cdot\mathbf{q}'_c)^2\le\mu^2.
The bound on a kept column is absolute, so the scheme owns the decision to drop a column.
Lean statement and details
NLAlib.IsBasisExtensionErr {n k b : ℕ} (η₀ μ ε : ℝ) (Q : Matrix (Fin n) (Fin k) ℝ)
(W Q' : Matrix (Fin n) (Fin b) ℝ) (H : Matrix (Fin k) (Fin b) ℝ) (R : Matrix (Fin b) (Fin b) ℝ) :
Prop
Definition (Rounded run of the block Golub–Kahan process). A rounded run with scheme parameters (\eta_0,\mu,\varepsilon) and product parameter \varepsilon_{\mathrm{mv}} has the same stored shape as an exact run. Block 0 of \mathbf{V} is a rounded extension of the empty basis by \mathbf\Omega. For each j<q there are computed products \mathbf{P}\approx\mathbf{A}\mathbf{V}_j and \mathbf{P}'\approx\mathbf{A}^{\mathsf{T}}\mathbf{U}_j whose columns satisfy
such that \mathbf{U}_j is a rounded extension of \mathbf{U}_{<j} by \mathbf{P} and \mathbf{V}_{j+1} is a rounded extension of \mathbf{V}_{\le j} by \mathbf{P}', with coefficients stored as in the exact process.
Lean statement and details
NLAlib.IsBlockGolubKahanErr {m n b : ℕ} (η₀ μ ε εmv : ℝ) (A : Matrix (Fin m) (Fin n) ℝ)
(Ω : Matrix (Fin n) (Fin b) ℝ) (q : ℕ) (U : Matrix (Fin m) (Fin (q * b)) ℝ)
(V : Matrix (Fin n) (Fin ((q + 1) * b)) ℝ) (R₀ : Matrix (Fin b) (Fin b) ℝ)
(R : Matrix (Fin (q * b)) (Fin (q * b)) ℝ) (S : Matrix (Fin ((q + 1) * b)) (Fin (q * b)) ℝ) : Prop
Theorem (Orthogonality of the computed bases). Let \mathbf{U} (q\ell columns) and \mathbf{V} ((q+1)\ell columns) be the bases of a rounded run with scheme parameters (\eta_0,\mu,\varepsilon), and let \mathbf{D}(\cdot) be the Gram defect on the support. If \mu\ge0 and \sqrt{3q\ell}\,\mu\le\eta_0, then
Theorem (Residuals of the two block relations). For a rounded run with parameters (\eta_0,\mu,\varepsilon) and \varepsilon_{\mathrm{mv}}, suppose \mu,\varepsilon,\varepsilon_{\mathrm{mv}}\ge0 and \sqrt{3(q+1)\ell}\,\mu\le\eta_0. With \mathbf{V}_{<q} the first q blocks of \mathbf{V},
Theorem (Forward bound for the returned factors). For a rounded run with parameters (\eta_0,\mu,\varepsilon) and \varepsilon_{\mathrm{mv}}, suppose \mu,\varepsilon,\varepsilon_{\mathrm{mv}}\ge0 and \sqrt{3(q+1)\ell}\,\mu\le\eta_0. Let \mathbf{P}_{\mathbf{U}} be the orthogonal projector onto the range of the computed \mathbf{U}. Then, in the Frobenius norm and in the spectral norm,
where the two unsubscripted norms are the same norm and the last factor is the spectral norm in both cases. The comparison is with the projection of \mathbf{A} onto the computed left range. The statement does not bound the distance from that range to the exact block Krylov range.
The orthogonality bounds rest on a one-step estimate for the Gram defect under a rounded extension, and the forward bound on a comparison of \mathbf{Q}\mathbf{Q}^{\mathsf{T}} with the range projector of \mathbf{Q}; both are listed under Further results.
Further results
Theorem (One block step of the loss of orthogonality).
let \mathbf{D}(\cdot) be the Gram defect on the support, \mathbf{D}(\mathbf{Q}) = \mathbf{Q}^{\mathsf{T}}\mathbf{Q} - \operatorname{diag}(\mathbf{s}) with s_j = 0 at a zero column of \mathbf{Q} and s_j = 1 otherwise. If (\mathbf{Q}', \mathbf{H}, \mathbf{R}) is a rounded extension (NLAlib.IsBasisExtensionErr) of the real basis \mathbf{Q} with parameters (\eta_0, \mu, \varepsilon), \mathbf{Q}' has b columns and \mathbf{Q} is in the window, \sqrt{\|\mathbf{D}(\mathbf{Q})\|_{\mathsf{F}}^2 + 3b\mu^2} \le \eta_0, then \|\mathbf{D}([\mathbf{Q}, \mathbf{Q}'])\|_{\mathsf{F}}^2 \le \|\mathbf{D}(\mathbf{Q})\|_{\mathsf{F}}^2 + 3b\mu^2\,. No printed source.
Lean statement and details
NLAlib.IsBasisExtensionErr.frobNorm_gramDefect_fromCols_sq_le {n k b : ℕ} {η₀ μ ε : ℝ}
{Q : Matrix (Fin n) (Fin k) ℝ} {W Q' : Matrix (Fin n) (Fin b) ℝ} {H : Matrix (Fin k) (Fin b) ℝ}
{R : Matrix (Fin b) (Fin b) ℝ} (hE : IsBasisExtensionErr η₀ μ ε Q W Q' H R)
(hw : ExtensionWindow η₀ μ b Q) :
frobNorm (gramDefect (Q.fromCols Q')) ^ 2 ≤ frobNorm (gramDefect Q) ^ 2 + 3 * ↑b * μ ^ 2
Theorem (The Gram defect on the support bounds the distance to the range projector, Frobenius
norm).
for every matrix \mathbf{Q}, with zero columns allowed, \mathbf{Q}\mathbf{Q}^{\mathsf{H}} differs from the orthogonal projector \mathbf{P}_{\mathbf{Q}} onto the column space of \mathbf{Q} by at most the Gram defect on the support \mathbf{D} = \mathbf{Q}^{\mathsf{H}}\mathbf{Q} - \operatorname{diag}(\mathbf{s}) (s_j = 0 at a zero column, s_j = 1 otherwise), \|\mathbf{Q}\mathbf{Q}^{\mathsf{H}} - \mathbf{P}_{\mathbf{Q}}\|_{\mathsf{F}} \le \|\mathbf{D}\|_{\mathsf{F}}\,. No printed source.