NLAlib.Ops.Program.exec_lift_le_add_selected
Library · theorem
This statement changed in the recorded rename: 2026-11-smalleig.
The weighted count of a run: instructions plus selected calls. Let the weight f of every operation, structural instruction and query be at most one plus g, where g charges only operations selected by sel (and no query). Then every successful counted run of the program p has weighted count at most the monomial bound of the instructions of its static count, at bases bs, each at least 1, bounding its initial index slots, plus the polynomial of its selected calls (NLAlib.Ops.Stmt.keepCalls) at a base at least 2, times a ceiling E of g on the dimensions the selected calls may have.
NLAlib.Ops.Program.exec_lift_le_add_selected {Op Tst K : Type} {r buffers : ℕ}
(p : Ops.Program Op Tst r buffers) (R : Ops.ResourceModel Op Tst) {I : Ops.Interp Op Tst K}
{τ : Ops.Tape K} {formats : Fin buffers → Ops.StorageFormat} {d : Fin r → ℕ} {m : Ops.Mem K}
{st : Ops.St (Op ⊕ Ops.Bookkeeping) Tst K} (hr : Ops.exec p I R formats τ d m = some st)
(sel : Op ⊕ Ops.Bookkeeping → Bool) {f : (Op ⊕ Ops.Bookkeeping) ⊕ Tst → List ℕ → ℕ}
{g : Op ⊕ Ops.Bookkeeping → List ℕ → ℕ}
(hfg : ∀ (k : (Op ⊕ Ops.Bookkeeping) ⊕ Tst) (ds : List ℕ), f k ds ≤ 1 + (g ⊕ᵥ fun x x_1 ↦ 0) k ds)
(hg : ∀ (o : Op ⊕ Ops.Bookkeeping) (ds : List ℕ), sel o = false → g o ds = 0) {bs : List ℕ}
(hb : ∀ b ∈ bs, 1 ≤ b) {σ : List Ops.WorkMono}
(hσ : Ops.SlotsLe bs (Ops.Program.environment d).idx σ) {base E : ℕ} {degrees : List ℕ}
(hbase : 2 ≤ base)
(hi : List.Forall₂ (fun v e ↦ v ≤ base ^ e) (Ops.Program.environment d).idx degrees)
(hE :
Ops.WorkEnvelope g (fun x x_1 ↦ 0) (Ops.Stmt.keepCalls sel p.body.instrument).callArity
(base ^ (Ops.Stmt.keepCalls sel p.body.instrument).callDegreeAt degrees) E) :
(Ops.Count.lift f) st.cost ≤
(Ops.stmtWorkMono p.body.instrument σ).eval bs +
(Ops.Stmt.keepCalls sel p.body.instrument).workCoefficient *
base ^ (Ops.Stmt.keepCalls sel p.body.instrument).workDegreeAt degrees *
EImport NLAlib.Ops.SelectedWork.