NLA-lib Explorer

NLAlib.Sign.round_writes

Library · theorem

A complete round returns the actual next iterate, its actual cached square and its actual stopping flag. The three control constants are outside the written footprint. The temporary literal and unused matrix scratch require capacity but no initial contents. A fragment of NLAlib.Sign.signRoutine.

NLAlib.Sign.round_writes {K Op Tst Su Sg : Type} [Inhabited K] [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.MatrixOp Op] [Ops.Has Ops.CmpTst Tst] {M : Ops.Machine K} {dec : K → ℝ}
  {mm : MatMulMap (K × K)} {qr : QRMap (K × K)} {unif : K → Su → K} {normal : Sg → K × K}
  {I : Ops.Interp Op Tst K} (hS : Ops.IsScalar M I) (hC : Ops.IsCmp dec I)
  (hMM : Ops.IsMatrixMul (Ops.EntryCodec.pair K) (fun {l m n} ↦ mm) I) {τ : Ops.Tape K} {n : ℕ}
  (A : Matrix (Fin n) (Fin n) (K × K)) (η : K) {x w v t : ℕ × ℕ} {m : Ops.Mem K}
  (hState :
    Sign.LoopState (M.toFloatMachine dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) unif normal) x w t η A
      m.store)
  (hl : m.Live [x, w, v, t])
  (hAP : Ops.Fp.Apart [x, w, v, t] [2 * (n * n), 2 * (n * n), 2 * (n * n), 5])
  (hx : x.2 + 2 * (n * n) ≤ m.store.len x.1) (hw : w.2 + 2 * (n * n) ≤ m.store.len w.1)
  (hv : v.2 + 2 * (n * n) ≤ m.store.len v.1) (ht : t.2 + 5 ≤ m.store.len t.1) :
  Ops.Writes Ops.Mode.total I τ (Sign.round (Ops.Has.inj Ops.MatrixOp.mul))
    (Ops.Env.frame [n] [x, w, v, t, x, w, v, t]) (Sign.loopFootprint n x w v t)
    (fun μ ↦
      Sign.LoopState (M.toFloatMachine dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) unif normal) x w t η
          (newtonSchulzRounded
            (M.toFloatMachine dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) unif normal) A)
          μ.store ∧
        μ.pos = m.pos)
    m

Full source on GitHub

Import NLAlib.Eigensolvers.Sign.Round.