Computable stack-port lifting preserves exact execution time
ProvedStackProgPortLift.liftProgC_execLet a structured stack program execute from local store to local store in exactly source steps. Let embed the local stack ports into a larger port set, and suppose an explicit decoder returns the unique local port exactly on the image of . If a global store restricts along to , then the computably lifted program executes in exactly steps and produces the global store obtained by replacing the selected ports with .
All ports outside the image of retain their original contents. This compositional property lets independently verified parser, comparator, and gadget programs share one global store without changing their source-step bounds.
Formalization Note The decoder is part of the computable program construction; projection and write-back describe the input and output stores.
import Mathlib import Definitions.Def_StackProgPortLift
namespace StackProgPortLift
open CookPvsNP
theorem liftProgC_exec {K L A : Type} (r : K ↪ L) (decode : L → Option K)
(hdecode : ∀ l k, decode l = some k ↔ r k = l)
{p : StackProg K A} {s t : K → List A} {n : ℕ} (h : p.Exec s t n)
(base : L → List A) (hb : project r base = s) :
(liftProgC r decode p).Exec base (write r t base) n := by sorry
end StackProgPortLift