NLA-lib Explorer

NLAlib.Krylov.CG.HSCG.Stored.Certification.stored_checked

Library · theorem

What the certificate states, with no reference to routines or contracts. For every order n and horizon k, every positive-definite matrix \mathbf{A} and every right-hand side \mathbf{b} whose Krylov grade is at least k, every interpretation of exact scalar arithmetic and exact level-one vector operations, and every tape, the counted run of the fixed program from \mathbf{A} stored column by column, \mathbf{b} and three blank vectors succeeds, executes at most 33 n^2 k + 23 n k + 156 k + 33 n^2 + 29 n + 125 instructions (each vector operation counting one; products with the matrix are executed and counted), 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).

NLAlib.Krylov.CG.HSCG.Stored.Certification.stored_checked (domain : (Fin 2 → ℕ) → Prop)
  (admitted : ∃ d, domain d)
  (supply : ∀ (d : Fin 2 → ℕ), domain d → ∃ x, Krylov.CG.HSCG.Stored.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 Ops.RCLikeBlas.Operation Ops.CmpTst ℝ)
  (hI :
    (Ops.ExactBlas.model (Krylov.CG.HSCG.Stored.Certification.problem domain admitted supply)
          Ops.Standard.Costing.unit).contracts
      d ((Krylov.CG.HSCG.Stored.Certification.inputs domain admitted supply).input d (A, rhs) ⋯) I)
  (τ : Ops.Tape ℝ) :
  ∃ st,
    Ops.Reference.Execution Krylov.CG.HSCG.Stored.Certification.program I
        (Ops.ExactBlas.model (Krylov.CG.HSCG.Stored.Certification.problem domain admitted supply)
            Ops.Standard.Costing.unit).resources
        (Krylov.CG.HSCG.Stored.Certification.inputs domain admitted supply).formats τ d
        ((Krylov.CG.HSCG.Stored.Certification.inputs domain admitted supply).memory d (A, rhs)) st ∧
      (Ops.ExactBlas.model (Krylov.CG.HSCG.Stored.Certification.problem domain admitted supply)
                  Ops.Standard.Costing.unit).resources.work
            st.cost ≤
          Krylov.CG.HSCG.Stored.Certification.operationCount d ∧
        (Krylov.CG.HSCG.Stored.Certification.inputs domain admitted supply).bytes d + st.peak ≤
            (Krylov.CG.HSCG.Stored.Certification.countedSpecification domain admitted supply).memory
              d ∧
          ∃ x r p,
            st.mem.Holds (Ops.Codec.vector (d 0)) 2 x ∧
              st.mem.Holds (Ops.Codec.vector (d 0)) 3 r ∧
                st.mem.Holds (Ops.Codec.vector (d 0)) 4 p ∧
                  cgState A rhs 0 (d 1) = { x := x, r := r, p := p }

Full source on GitHub

Import NLAlib.Krylov.CG.HSCG.StoredCertification.