Unpadded binary stack addition: exact execution and arithmetic correctness
ProvedTwoAgentSched.TotalTotal.BinaryAdder.adderFullLoop_correct_and_costbinary-encodingcomplexity-theorystack-programtwo-agent-scheduling
Let and be finite little-endian Boolean words, possibly of different lengths, and let be an input carry bit. Write . The unpadded finite-stack adder treats an absent input digit as zero and must satisfy both claims below.
- It consumes both input stacks in exactly source-program steps, leaves the emitted low sum bits in reverse order on the output stack, and leaves the final carry on top of the carry stack.
- If denotes the little-endian low output word and the final carry, then
This unequal-length adder is needed to accumulate the integer scheduling thresholds in the binary transducer. The already verified equal-length adder does not cover this case. This statement does not by itself prove a complete polynomial-time reduction.
Preamble
import Mathlib import Definitions.Def_TwoAgentSched_TotalTotal_BinaryAdder
Formal statement
namespace TwoAgentSched.TotalTotal.BinaryAdder
open CookPvsNP ProjSchedTW.Complexity
theorem adderFullLoop_correct_and_cost (left right : List Bool) (c : Bool)
(output carries : List BSym) :
∃ finalCarryTail : List BSym,
adderFullLoop.Exec
(store (left.map bitSym) (right.map bitSym) output (bitSym c :: carries))
(store [] [] (((addFullAux left right c).1.map bitSym).reverse ++ output)
(bitSym (addFullAux left right c).2 :: finalCarryTail))
(3 * max left.length right.length + 1) ∧
bitWordValue left + bitWordValue right + bitValue c =
bitWordValue (addFullAux left right c).1 +
2 ^ (max left.length right.length) * bitValue (addFullAux left right c).2 := by sorry
end TwoAgentSched.TotalTotal.BinaryAdderSource
Supporting binary arithmetic for Agnetis, Mirchandani, Pacciarelli and Pacifici, Scheduling Problems with Two Competing Agents, Operations Research 52(2), 2004, Theorem 9.2, pp. 237–238. The concrete adder and exact execution bound are auxiliary formalization obligations, not claims from the paper.