NLAlib.Krylov.CG.HSCG.Certification.cg_checked
Library · theorem
What the certificate states, with no reference to routines or contracts. For every positive-definite \mathbf{A} of order n and right-hand side \mathbf{b} whose Krylov grade is at least the horizon k, every interpretation of exact scalar arithmetic, exact level-one vector operations and exact products with \mathbf{A}, and every tape, the counted run of the fixed program from \mathbf{b} and three blank vectors succeeds, executes at most 6 n + 127 k + 92 instructions (each vector operation and each product counting one), keeps its resident memory within the memory of the specification, and the three vectors then hold the iterate, residual and direction of conjugate gradient after k steps from the zero iterate. Every such system is admitted (NLAlib.Ops.Inputs.covers). The matrix is in no buffer: it is reached only through the product operation, and the work is counted in calls of it (NLAlib.Krylov.CG.HSCG.Certification.oracles).
NLAlib.Krylov.CG.HSCG.Certification.cg_checked (domain : (Fin 2 → ℕ) → Prop)
(admitted : ∃ d, domain d)
(supply : ∀ (d : Fin 2 → ℕ), domain d → ∃ x, Krylov.CG.HSCG.Certification.accepts d x)
(d : Fin 2 → ℕ) (hd : domain d) (A : Matrix (Fin (d 0)) (Fin (d 0)) ℝ) (rhs : Fin (d 0) → ℝ)
(hA : A.PosDef) (hrhs : d 1 ≤ krylovGrade A rhs)
(I : Ops.Interp Krylov.CG.HSPCG.Signature Empty ℝ)
(hI :
(Krylov.CG.HSCG.Certification.unitModel domain admitted supply).contracts d
((Krylov.CG.HSCG.Certification.inputs domain admitted supply).input d (A, rhs) ⋯) I)
(τ : Ops.Tape ℝ) :
∃ st,
Ops.Reference.Execution Krylov.CG.HSCG.Certification.program I
(Krylov.CG.HSCG.Certification.unitModel domain admitted supply).resources
(Krylov.CG.HSCG.Certification.inputs domain admitted supply).formats τ d
((Krylov.CG.HSCG.Certification.inputs domain admitted supply).memory d (A, rhs)) st ∧
(Krylov.CG.HSCG.Certification.unitModel domain admitted supply).resources.work st.cost ≤
6 * d 0 + 127 * d 1 + 92 ∧
(Krylov.CG.HSCG.Certification.inputs domain admitted supply).bytes d + st.peak ≤
(Krylov.CG.HSCG.Certification.countedSpecification domain admitted supply).memory d ∧
∃ x r p,
st.mem.Holds (Ops.Codec.vector (d 0)) 1 x ∧
st.mem.Holds (Ops.Codec.vector (d 0)) 2 r ∧
st.mem.Holds (Ops.Codec.vector (d 0)) 3 p ∧
cgState A rhs 0 (d 1) = { x := x, r := r, p := p }Import NLAlib.Krylov.CG.HSCG.Certification.