NLA-lib Explorer

NLAlib.SpectralBisection.child_writes_storesStep

Library · theorem

The actual single-child program stores every field of its mathematical shift outcome, including the signed half-radius recovered from the retained radius on the upward pass. A fragment of NLAlib.SpectralBisection.bisectionRoutine.

NLAlib.SpectralBisection.child_writes_storesStep {K Su Sg Op Tst : Type} [Inhabited K]
  [Ops.Has Ops.ScalarOp Op] [Ops.Has Ops.IndexOp Op] {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) (hL : Ops.IsIndexLit M I) {τ : Ops.Tape K}
  {μ : Ops.Mem K} {n d lo k : ℕ} {ma ua qa ea sz kd ks sigma : ℕ × ℕ} (side : Bool) (R : K)
  (A : Matrix (Fin k) (Fin k) (K × K)) :
  have shift := if side = true then M.div R (M.lit 2) else M.neg (M.div R (M.lit 2));
  have step :=
    EighStep.shift side
      ((M.toFloatMachine dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) unif normal).hermShift A shift)
      shift;
  have x := (ma.1, ma.2 + 2 * (n * n) * d + 2 * n * lo);
  have y := (ma.1, ma.2 + 2 * (n * n) * (d + 1) + 2 * n * lo);
  have z := (sz.1, sz.2 + n * (d + 1) + lo);
  have w := (kd.1, kd.2 + n * d + lo);
  μ.Live [ma, sz, kd, sigma] →
    μ.store.readBlock x.1 x.2 (2 * (k * k)) = some ((Ops.EntryCodec.pair K).packFinMatrix A) →
      μ.store.get sigma.1 sigma.2 = some shift →
        μ.Room [y, z, w] [2 * (k * k), 1, 1] →
          Ops.Fp.Disj (Ops.Store.inBlock x.1 x.2 (2 * (k * k)))
              (Ops.Store.inBlock y.1 y.2 (2 * (k * k))) →
            Ops.Fp.Disj (Ops.Store.inBlock sigma.1 sigma.2 1)
                (Ops.Store.inBlock y.1 y.2 (2 * (k * k))) →
              Ops.Fp.Apart [y, z, w] [2 * (k * k), 1, 1] →
                Ops.Writes Ops.Mode.total I τ SpectralBisection.child
                  (Ops.Env.frame [n, d, lo, k, if side = true then 2 else 3] [ma, sz, kd, sigma])
                  (Ops.Fp.blocks (SpectralBisection.stepOutputs n d lo ma ua qa ea sz kd ks step)
                    (SpectralBisection.stepOutputLengths step))
                  (fun μ' ↦
                    μ'.pos = μ.pos ∧
                      SpectralBisection.StoresStep M R n d lo ma ua qa ea sz kd ks step μ')
                  μ

Full source on GitHub

Import NLAlib.Eigensolvers.SpectralBisection.NodeOutput.