A finite stack program writes a tagged PARTITION weight in linear time
ProvedTwoAgentSched.TotalTotal.stack_tagged_gadget_execGiven the canonical binary code of a positive integer and two counter stacks of lengths and , the finite stack program halts after exactly source-program steps. It consumes both counters and leaves the output stack containing
This is one explicit, linearly bounded component of the distinct-even PARTITION gadget used in the scheduling encoding reduction. The counters must already be available and the initial output must already contain the canonical code of . The result does not assert that a complete reduction transducer, including parsing, sorting, and threshold computation, has been constructed.
Formalization Note The first two stacks supply the counter lengths, their symbol values being immaterial. The third stack starts with the separator-terminated least-significant-bit-first code.
import Mathlib import Definitions.Def_TwoAgentSched_TotalTotal_StackTaggedOutput
namespace TwoAgentSched.TotalTotal
open CookPvsNP ProjSchedTW.Complexity StackTaggedOutput
theorem stack_tagged_gadget_exec (i d : List BSym) (m : ℕ) (hm : 0 < m) :
taggedOutput.Exec (store i d (encNat m))
(store [] [] (encNat (2 * (4 ^ (i.length + d.length + 1) * m + 4 ^ i.length))))
(5 * i.length + 5 * d.length + 9) := by sorry
end TwoAgentSched.TotalTotal