NLA-lib Explorer

NLAlib.Sign.start_writes

Library · theorem

Execute the initial test and the capped iteration on the same actual matrix. A fragment of NLAlib.Sign.signRoutine.

NLAlib.Sign.start_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 cap : ℕ}
  (B : Matrix (Fin n) (Fin n) (K × K)) (η : K) {x w v t : ℕ × ℕ} {m : Ops.Mem K}
  (h01 : dec (M.lit 0) ≠ dec (M.lit 1)) (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 : m.store.readBlock x.1 x.2 (2 * (n * n)) = some ((Ops.EntryCodec.pair K).packFinMatrix B))
  (hη : m.store.get t.1 t.2 = some η) (hlo : m.store.get t.1 (t.2 + 4) = some (M.neg η))
  (hone : m.store.get t.1 (t.2 + 3) = some (M.lit 1)) (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.start (Ops.Has.inj Ops.MatrixOp.mul))
    (Ops.Env.frame [n, cap] [x, w, v, t, x, w, v, t]) (Sign.loopFootprint n x w v t)
    (fun μ ↦
      μ.pos = m.pos ∧
        μ.store.readBlock x.1 x.2 (2 * (n * n)) =
          some
            ((Ops.EntryCodec.pair K).packFinMatrix
              (newtonSchulzLoop
                (M.toFloatMachine dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) unif normal) η cap B)))
    m

Full source on GitHub

Import NLAlib.Eigensolvers.Sign.Start.