NLA-lib Explorer

NLAlib.ShiftedQR.decouplePrepared_writes

Library · theorem

Exact arithmetic

Initial scan and capped iteration return an actual decoupled matrix under raw hypotheses. A fragment of the exact decoupler NLAlib.ShiftedQR.scalarDecouple, which exact shifted QR (NLAlib.ShiftedQR.deflationRoutine) takes as its decoupler.

NLAlib.ShiftedQR.decouplePrepared_writes {O Q : Type} [Ops.Has Ops.ScalarOp O]
  [Ops.Has Ops.IndexOp O] [Ops.Has Ops.CmpTst Q] {Mch : Ops.Machine ℝ} {I : Ops.Interp O Q ℝ}
  (hS : Ops.IsScalar Mch I) (hE : Ops.ExactModel id Mch) (hL : Ops.IsIndexLit Mch I)
  (hC : Ops.IsCmp id I) {θ : ℝ} (Iter : Ops.Stmt O Q) (hIter : ShiftedQR.IterationContract θ Iter I)
  {tape : Ops.Tape ℝ} {μ : Ops.Mem ℝ} {n m F M : ℕ} {τ B α γ δ : ℝ} {w p c r : ℕ × ℕ}
  {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} (hyp : RapidDecouplingHyps H τ B θ α γ δ m F)
  (hHess : IsUpperHessenberg H) (hkn : 2 ^ m ≤ n) (hτ : 0 ≤ τ)
  (hM : M = ⌈√2 / exceptionalSpacing (2 ^ m) B θ α ((1 - γ) ^ 2)⌉₊) (hMpos : 0 < M)
  (hW : HoldsMatrix w H μ.store) (hParams : μ.store.readBlock p.1 p.2 5 = some [τ, B, θ, α, γ])
  (hConst : μ.store.readBlock c.1 c.2 2 = some [τ ^ 2, (1 - γ) ^ (2 * 2 ^ m)])
  (hl : μ.Live [w, p, c, w, r]) (hw : w.2 + 2 * ((n + 1) * (n + 1)) ≤ μ.store.len w.1)
  (hr : r.2 + 5 ≤ μ.store.len r.1)
  (hWR :
    Ops.Fp.Disj (Ops.Store.inBlock w.1 w.2 (2 * ((n + 1) * (n + 1)))) (Ops.Store.inBlock r.1 r.2 5))
  (hSep :
    (Ops.Store.inBlock w.1 w.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock r.1 r.2 5).Disj
      (Ops.Store.inBlock p.1 p.2 5 ⊔ Ops.Store.inBlock c.1 c.2 2)) :
  Ops.Writes Ops.Mode.total I tape (ShiftedQR.decouplePrepared Iter)
    (Ops.Env.frame [n + 1, m, 2 ^ m, F, M] [w, p, c, w, r])
    (Ops.Store.inBlock w.1 w.2 (2 * ((n + 1) * (n + 1))) ⊔ Ops.Store.inBlock r.1 r.2 5)
    (fun μ' ↦
      μ'.pos = μ.pos ∧
        ∃ U H',
          HasOrthonormalCols U ∧
            H' = Uᴴ * H * U ∧
              IsUpperHessenberg H' ∧
                IsDecoupledAbs τ H' ∧
                  HoldsMatrix w H' μ'.store ∧ ShiftedQR.ScanHolds H' (τ ^ 2) n r μ'.store)
    μ

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.DecouplePrepared.