NLA-lib Explorer

NLAlib.SpectralBisection.upwardPass_writes_of_arenas

Library · theorem

Full arena capacity and apartness supply every geometric prerequisite for actual upward execution. The returned root is exactly the existing pure recursion with budget L + 1. A fragment of NLAlib.SpectralBisection.bisectionRoutine.

NLAlib.SpectralBisection.upwardPass_writes_of_arenas {K Su Sg Op Tst : Type} [Inhabited K]
  [Ops.Has Ops.ScalarOp Op] [Ops.Has Ops.MatrixOp Op] [Ops.Has Ops.IdxTst Tst] (M : Ops.Machine K)
  (dec : K → ℝ) (mm : MatMulMap (K × K)) (qr : QRMap (K × K)) (n base fuel L : ℕ) (R0 eps beta : K)
  (ell : ℕ) (A : Matrix (Fin n) (Fin n) (K × K)) (τ : Ops.Tape K)
  (c ma ua qa ea sz kd kp lv su sg : ℕ × ℕ) (unif : K → Su → K) (normal : Sg → K × K)
  {I : Ops.Interp Op Tst K} (hS : Ops.IsScalar M I) (hQ : Ops.IsToNat dec I)
  (hMM : Ops.IsMatrixMul (Ops.EntryCodec.pair K) (fun {l m n} ↦ mm) I) {m : Ops.Mem K}
  (hl : m.Live (SpectralBisection.arenaOperands c ma ua qa ea sz kd kp lv su sg))
  (hRoom :
    m.Room (SpectralBisection.arenaOperands c ma ua qa ea sz kd kp lv su sg)
      (SpectralBisection.arenaLengths n L))
  (hAP :
    Ops.Fp.Apart (SpectralBisection.arenaOperands c ma ua qa ea sz kd kp lv su sg)
      (SpectralBisection.arenaLengths n L))
  (hLevel :
    ∀ d ≤ L,
      SpectralBisection.StoresLevel M
        (SpectralBisection.tapeMachine M dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) n base τ) n fuel R0
        beta { k := n, A := A, R := R0, ε := eps, ℓ := ell } d ma sz lv m)
  (hRecords :
    ∀ d ≤ L,
      SpectralBisection.StoresRecords M
        (SpectralBisection.tapeMachine M dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) n base τ) n fuel R0
        beta { k := n, A := A, R := R0, ε := eps, ℓ := ell } d ma ua qa ea sz kd kp m)
  (hBottom :
    SpectralBisection.StoresLevelResults
      (SpectralBisection.tapeMachine M dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) n base τ) n fuel R0
      beta { k := n, A := A, R := R0, ε := eps, ℓ := ell } 0 (L + 1) ua ea m.store)
  (hTwo : m.store.get c.1 (c.2 + 1) = some (M.lit 2)) (hLit : Ops.IsExactNatLit dec M (max n 4)) :
  Ops.Writes Ops.Mode.total I τ SpectralBisection.upwardPass
    (Ops.Env.frame [n, L] [lv, ua, qa, ea, sz, kd, kp, c])
    (SpectralBisection.resultArenaFp n L ua ea)
    (fun m' ↦
      m'.pos = m.pos ∧
        SpectralBisection.StoresResult n 0 0 ua ea
          (eighAux
            (SpectralBisection.tapeMachine M dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) n base τ) n
            fuel R0 beta (L + 1) A R0 eps ell
            (eighSlotTree
              (SpectralBisection.tapeMachine M dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) n base τ) n
              fuel R0 beta 0 0 { k := n, A := A, R := R0, ε := eps, ℓ := ell }))
          m'.store)
    m

Full source on GitHub

Import NLAlib.Eigensolvers.SpectralBisection.UpwardArena.