NLA-lib Explorer

NLAlib.hessenbergReduceLast_writes_word

Library · theorem

This statement changed in the recorded rename: 2026-11-schur.

NLAlib.hessenbergReduceLast on any scalar machine with exact comparisons stores the machine evaluation NLAlib.hessenbergReduceLastWord of the matrix in place, closes the N - 2 slots NLAlib.hessenbergReduceLastSlots (each accepted) of the log after its closed slots L, writes only the matrix and the log, and reads no tape. The planes and the valid words are exact naturals (hNat up to nmax, with N \le n_{\max} + 1 and 1 \le n_{\max}).

This operand form is the primary statement of the tree, which has no judgment, for two reasons. The log operand Lg is the base of a slotted log of ns slots, and ns is not a dimension of the tree [N, w, j0]: the run writes the slots j_0, \dots, j_0 + N - 3 at an offset from the operand, and its hypothesis and conclusion are the invariant NLAlib.HoldsSlottedLog of the whole log of ns slots, whose length an interface over [N, w, j0] cannot declare. And the statement holds for a matrix block at any offset, while a judgment requires every written operand to lie within its buffer, which a stored matrix does not give when the block is empty (N = 0). Its callers state their invariants on the matrix and the log (HoldsMatrix, HoldsSlottedLog) and use it inside deterministic steps of probabilistic proofs.

NLAlib.hessenbergReduceLast_writes_word {O Q : Type} [Ops.Has Ops.ScalarOp O]
  [Ops.Has Ops.IndexOp O] [Ops.Has Ops.CmpTst Q] {M : Ops.Machine ℝ} {I : Ops.Interp O Q ℝ}
  (hS : Ops.IsScalar M I) (hC : Ops.IsCmp id I) (hL : Ops.IsIndexLit M I) {nmax : ℕ}
  (hNat : Ops.IsExactNatLit id M nmax) (h1 : 1 ≤ nmax) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ} {N : ℕ}
  {a lg : ℕ × ℕ} {A : Matrix (Fin N) (Fin N) ℂ} (hN : N ≤ nmax + 1) {ns w : ℕ}
  {L : List (Option (List GivensEntry))} (hlog : HoldsSlottedLog lg ns w L [] m.store)
  (hj : L.length + (N - 2) ≤ ns) (hw : N - 2 ≤ w) (hl : m.Live [a, lg])
  (hA : HoldsMatrix a A m.store)
  (hd :
    Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * (N * N)))
      (Ops.Store.inBlock lg.1 lg.2 (ns * (1 + 5 * w)))) :
  Ops.Writes Ops.Mode.total I τ hessenbergReduceLast (Ops.Env.frame [N, w, L.length] [a, a, lg])
    (Ops.Store.inBlock a.1 a.2 (2 * (N * N)) ⊔ Ops.Store.inBlock lg.1 lg.2 (ns * (1 + 5 * w)))
    (fun m' ↦
      m'.pos = m.pos ∧
        HoldsMatrix a (hessenbergReduceLastWord M A) m'.store ∧
          HoldsSlottedLog lg ns w (L ++ List.map some (hessenbergReduceLastSlots M A)) [] m'.store)
    m

Full source on GitHub

Import NLAlib.Eigensolvers.HessenbergReduction.