NLAlib.Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.exec_scalarProgram_work_le_and_quadForm_le
Library · theorem
Headline of cg-scalar-rounded-operation-count-energy-error Standard rounding
Scalar conjugate gradient in rounded arithmetic: termination, operation count and energy-norm error. Let \mathbf{A} \in \mathbb{R}^{n \times n} be symmetric with spectrum in [a, a'], a > 0, stored entry by entry, let \mathbf{b} \in \mathbb{R}^n and let k be the iteration cap; write \kappa = a'/a. The program is Hestenes–Stiefel conjugate gradient from \mathbf{x}_0 = \mathbf{0} that keeps the residual self-product between rounds, with every matrix-vector product and every vector operation written out as scalar loops. Its arithmetic is any scalar machine in the standard model with unit roundoff u: each of +, -, \times, /, \sqrt{\cdot} returns the e\mathbf{x}act result times 1 + \delta, \lvert \delta \rvert \le u, with no overflow or underflow, and comparisons of stored numbers are exact. Let E be an allowance with E \le 1/100 that dominates the rounding of one scalar operation (16 u \le E), of one dot product, vector update and scaling of length n, and of one row-by-row matrix-vector product (Standard.Accuracy), and assume 3 E a' \le a and k^{2} \sqrt{k}\, E\, \kappa^{2} \le 10^{-5}.
Then for every such input, every interpretation of the scalar operations that meets the model, and every tape, the run succeeds, and
* it executes at most 33 n^{2} k + 157 n k + 242 k + 50 n + 127 instructions (scalar operations, comparisons, index arithmetic, operand addressing, loop control and allocation, each of unit cost); * it performs some number m \le k of rounds and leaves in memory an iterate \hat{\mathbf{x}}, a residual vector \hat{\mathbf{r}} and a direction; if m < k then \hat{\mathbf{r}} = \mathbf{0} exactly (the program stops before the cap only when the computed residual self-product is zero); * for every solution \mathbf{x} of \mathbf{A}\mathbf{x} = \mathbf{b}, (\mathbf{x} - \hat{\mathbf{x}})^{\mathsf{T}} \mathbf{A} (\mathbf{x} - \hat{\mathbf{x}}) \le 4 \Bigl(\frac{\sqrt{2\kappa + 1} - 1}{\sqrt{2\kappa + 1} + 1}\Bigr)^{2m} \mathbf{x}^{\mathsf{T}} \mathbf{A} \mathbf{x} + \frac{12000\, m^{2} \sqrt{m}\, E\, \kappa\, a'\, \|\mathbf{b}\|^{2}}{a^{2}} + \frac{135\, m^{2} E\, \kappa\, \|\mathbf{b}\|^{2}}{a}.
The first term is the exact conjugate gradient rate at the condition number 2\kappa + 1; the other two are the accumulated rounding. The bound is in terms of the rounds m actually performed: reaching the cap is not a convergence claim. The count is an upper bound read off the fixed program (NLAlib.Ops.Program.countPoly). The energy bound is NLAlib.CGRun.quadForm_sub_x_le_four_mul_pow_add [Greenbaum1997SIMAX]; [StrakosTichy2002, §10] for the run that the program executes. Result: cg-scalar-rounded-operation-count-energy-error
NLAlib.Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.exec_scalarProgram_work_le_and_quadForm_le
{lower upper : (Fin 2 → ℕ) → ℝ} {domain : (Fin 2 → ℕ) → Prop} {admitted : ∃ d, domain d}
{supply :
∀ (d : Fin 2 → ℕ),
domain d → ∃ x, Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.accepts lower upper d x}
(M : Ops.Machine ℝ) (u : ℝ) (hM : Ops.StdModel u id M) (hu : 0 ≤ u) (em E : (Fin 2 → ℕ) → ℝ)
(hMatvec : ∀ (d : Fin 2 → ℕ), domain d → Ops.ScalarProducts.roundoff u (d 0) * √↑(d 0) ≤ em d)
(hAccuracy :
∀ (d : Fin 2 → ℕ), domain d → Ops.Standard.Accuracy (em d) u (E d) (Ops.Blas.seq.err u) (d 0))
(ha : ∀ (d : Fin 2 → ℕ), domain d → 0 < lower d)
(hprec : ∀ (d : Fin 2 → ℕ), domain d → 3 * E d * upper d ≤ lower d)
(hwindow :
∀ (d : Fin 2 → ℕ), domain d → ↑(d 1) ^ 2 * √↑(d 1) * E d * (upper d / lower d) ^ 2 ≤ 1 / 10 ^ 5)
{d : Fin 2 → ℕ} (hd : domain d)
(x :
(Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.problem lower upper domain admitted
supply).Input
d)
(I : Ops.Interp Ops.ScalarOp Ops.CmpTst ℝ)
(hI :
(Ops.RoundedScalarBlas.model
(Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.problem lower upper domain admitted
supply)
M).contracts
d x I)
(τ : Ops.Tape ℝ) :
∃ st,
Ops.Reference.Execution Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.scalarProgram I
Ops.RoundedScalarBlas.resources
(Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.problem lower upper domain admitted
supply).formats
τ d
((Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.problem lower upper domain admitted
supply).initial
d x)
st ∧
Ops.RoundedScalarBlas.resources.work st.cost ≤
33 * d 0 ^ 2 * d 1 + 157 * d 0 * d 1 + 242 * d 1 + 50 * d 0 + 127 ∧
∃ m ≤ d 1,
∃ s rho,
Krylov.CG.HSCG.Carried.Rounded.StoresValues id (d 0) (2, 0) (3, 0) (4, 0) (5, 0) s rho
st.mem ∧
(m < d 1 → s.r = 0) ∧
∀ (xs : Fin (d 0) → ℝ),
Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.inputMatrix x *ᵥ xs =
Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.inputRhs x →
quadForm (Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.inputMatrix x)
(xs - s.x) ≤
4 *
((√(2 * (upper d / lower d) + 1) - 1) /
(√(2 * (upper d / lower d) + 1) + 1)) ^
(2 * m) *
quadForm
(Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.inputMatrix x)
xs +
2 *
‖WithLp.toLp 2
(Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.inputRhs
x)‖ ^
2 *
(6000 * ↑m ^ 2 * √↑m * E d * (upper d / lower d) * upper d) /
lower d ^ 2 +
135 * ↑m ^ 2 * E d * (upper d / lower d) *
(‖WithLp.toLp 2
(Krylov.CG.HSCG.Carried.Rounded.Stored.Certification.inputRhs
x)‖ ^
2 /
lower d)Import NLAlib.Krylov.CG.HSCG.Carried.Rounded.ScalarTheorem.