NLA-lib Explorer

NLAlib.SpectralBisection.downLevel_kernelWeight_le_of_exec

Library · theorem

One actual allocated downward level adds at most (2 * fuel + 9) * T n to matrix-kernel weight. Inputs are stored canonical level data and ordinary fresh-scratch geometry. The cost function is monotone and superadditive; no accuracy or distribution premise is needed.

NLAlib.SpectralBisection.downLevel_kernelWeight_le_of_exec {K : Type} [Inhabited K]
  (M : Ops.Machine K) (dec : K → ℝ) (mm : MatMulMap (K × K)) (qr : QRMap (K × K))
  {I : Ops.Interp Ops.DenseOp (Ops.CmpTst ⊕ Ops.IdxTst) K} {τ : Ops.Tape K} {μ : Ops.Mem K}
  {n L fuel d base : ℕ} {par lv su sg ma ua qa ea sz kd kp c : ℕ × ℕ} (R0 eps0 beta : K)
  (A : Matrix (Fin n) (Fin n) (K × K)) (hS : Ops.IsScalar M I) (hL : Ops.IsIndexLit M I)
  (hC : Ops.IsCmp dec I) (hMM : Ops.IsMatrixMul (Ops.EntryCodec.pair K) (fun {l m n} ↦ mm) I)
  (hQR : Ops.IsMatrixQR (Ops.EntryCodec.pair K) (fun {m n} ↦ qr) I) (hQ : Ops.IsToNat dec I)
  (hSample : Ops.IsSample I) (hexact : Ops.IsExactNatLit dec M (max n 4))
  (hl : μ.Live [par, lv, su, sg, ma, ua, qa, ea, sz, kd, kp, c])
  (hLevel :
    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, ε := eps0, ℓ := L } d ma sz lv μ)
  (hpar : μ.store.readBlock par.1 par.2 3 = some [R0, eps0, beta])
  (hc :
    μ.store.readBlock c.1 c.2 5 =
      some [M.lit 1, M.lit 2, M.div (M.lit 1) (M.lit 2), M.neg (M.lit 1), M.sqrtHalf])
  (hGeometry :
    ∀ (s : Ops.Store K),
      List.length s = List.length μ.store + 1 →
        s.len (List.length μ.store) = 5 →
          Ops.Store.Below (List.length μ.store) μ.store s →
            SpectralBisection.DownLevelGeometry n d
              (fun lo ↦
                ((fun lo ↦
                      SpectralBisection.nodeAtSlot
                        (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, ε := eps0, ℓ := L } d lo)
                    lo).k)
              par lv su sg ma ua qa ea sz kd kp c (List.length μ.store, 0) s)
  (T : ℕ → ℕ) (hT : Monotone T) (hadd : ∀ (i j : ℕ), T i + T j ≤ T (i + j))
  (W : Ops.DenseOp → List ℕ → ℕ) {a b : Ops.St Ops.DenseOp (Ops.CmpTst ⊕ Ops.IdxTst) K}
  (hmem : a.mem = μ)
  (hr :
    Ops.evalCounted I W τ (SpectralBisection.downLevel SpectralBisection.node)
        (Ops.Env.frame [n, L, fuel, d] [par, lv, su, sg, ma, ua, qa, ea, sz, kd, kp, c]) a =
      some b) :
  (Ops.Dense.kernelWeight T) b.cost ≤ (Ops.Dense.kernelWeight T) a.cost + (2 * fuel + 9) * T n

Full source on GitHub

Import NLAlib.Eigensolvers.SpectralBisection.DownLevelAllocatedWork.