NLA-lib Explorer

NLAlib.Krylov.Lanczos.Linked.Certification.algorithm_checked

Library · theorem

Standard rounding Oracle: matrix–vector product

What the certificate states: at every admitted size, for every admitted input, every interpretation satisfying the contracts of the model and every tape, the run of the fixed program from the supplied buffers succeeds within the scratch, the budget, the work, the span and the memory of the specification, and its final memory satisfies the output condition (NLAlib.Ops.Inputs.Checked). The matrix is not in memory: it is reached only through the products of the model, and the work is counted in those products and the vector operations.

NLAlib.Krylov.Lanczos.Linked.Certification.algorithm_checked {K : Type} [Inhabited K]
  {domain : (Fin 2 → ℕ) → Prop} {admitted : ∃ d, domain d}
  (model : Ops.Standard.Model (Krylov.Lanczos.Certification.problem domain admitted) fun d ↦ d 0)
  (cost : Ops.Standard.Costing) (matvecWork matvecScratch : List ℕ → ℕ)
  (hresources : model.resources = Ops.Standard.resources model.scheme cost matvecWork matvecScratch)
  (em E : (Fin 2 → ℕ) → ℝ)
  (haccuracy :
    ∀ (d : Fin 2 → ℕ),
      domain d →
        Ops.Standard.Accuracy (em d) (model.scheme.roundoff model.unit) (E d)
          (Ops.Blas.seq.err (model.scheme.roundoff model.unit)) (d 0))
  (hbudget :
    ∀ (d : Fin 2 → ℕ),
      domain d →
        ∀ (x : (Krylov.Lanczos.Certification.problem domain admitted).Input d),
          model.scheme.roundoff (model.matvecAllowance d x) ≤ em d * specNorm (model.matrix d x))
  (hAT :
    ∀ (d : Fin 2 → ℕ),
      domain d →
        ∀ (x : (Krylov.Lanczos.Certification.problem domain admitted).Input d),
          (model.matrix d x)ᵀ = model.matrix d x) :
  ((Krylov.Lanczos.Certification.inputs domain admitted).cast Krylov.Lanczos.Rounded.seqSolveRoutine
        ⋯ ⋯).Checked
    (Krylov.Lanczos.Linked.Certification.algorithm model cost matvecWork matvecScratch hresources em
      E haccuracy hbudget hAT)

Full source on GitHub

Import NLAlib.Krylov.Lanczos.LinkedCertification.