Binary natural-number arithmetic and its bit-cost bounds
ProvedBinaryTM2.binary_natural_operations_and_costbin-packingcomputational-complexityfixed-parameter-tractabilityinteger-programming
Binary word comparison, subtraction, multiplication and division return their specified natural-number values in polynomial time. Trimming, word construction, prefix handling, sums and the bitwise list operations preserve the stated length and cost bounds.
Preamble
import Definitions.Def_EdgeSublinearMWIS_Main_BinaryOracleImplementation open OAI.ThreeMachine.StackCompiler EdgeSublinearMWIS.Main EdgeSublinearMWIS.Main.RawStack EdgeSublinearMWIS.Main.RealizerBounds
Formal statement
namespace BinaryTM2
theorem binary_natural_operations_and_cost :
(Linear BinaryAdder.headBit) ∧
(Linear BinaryAdder.tailBits) ∧
(∀ (A : List Bool), volume A ≤ 4 * A.length + 1) ∧
(PolyBound BinarySubtract.differenceRealizer) ∧
(∀ (A B : List Bool),
value (BinarySubtract.difference A B) =
value A - value B) ∧
(∀ (A B : List Bool),
BinarySubtract.less A B = Bool.true ↔
value A < value B) ∧
(PolyBound BinarySubtract.lessRealizer) ∧
(PolyBound Realizer.add) ∧
(PolyBound BinaryAdder.wordLength) ∧
(PolyBound appendBits) ∧
(∀ (L : List Bool), L.length ≤ volume L) ∧
(Linear boolNat) ∧
(∀ (A B : List Bool),
trim (BinarySubtract.difference A B) =
BinarySubtract.difference A B) ∧
(PolyBound divideRealizer) ∧
(∀ (A B : List Bool),
0 < value B →
value (divide A B).1 =
value A / value B ∧
value (divide A B).2 =
value A % value B) ∧
(∀ {α : Type} [inst : Coding α] (a : α),
PolyBound (lookupList a)) ∧
(∀ (A B : List Bool), (multiply A B).length ≤ A.length + B.length) ∧
(PolyBound multiplyRealizer) ∧
(∀ (A B : List Bool),
value (multiply A B) =
value A * value B) ∧
(Linear Realizer.pred) ∧
(Linear nonemptyBits) ∧
(PolyBound replicateTrue) ∧
(PolyBound (Realizer.reverse : Realizer (fun L : List Bool => L.reverse))) ∧
(Linear Realizer.succ) ∧
(PolyBound sumWordsRealizer) ∧
(∀ (A B : List Bool),
value (sumWords A B) =
value A + value B) ∧
(∀ (L : List Bool) (B : ℕ),
value L < 2 ^ B → (trim L).length ≤ B) ∧
(PolyBound trimRealizer) ∧
(∀ (L : List Bool), value L < 2 ^ L.length) ∧
(∀ (n : ℕ), value (natBits n) = n) ∧
(PolyBound BinaryAdder.wordRealizer) := by sorry
end BinaryTM2Source
Binary stack-compiler development of EdgeSublinearMWIS.Main.exact_binary_oracle_feasibility on Prove2Me (Apache-2.0). The same primitives implement bit-level integer feasibility in Lemma 5 of Koana and Kumabe, High-Multiplicity Bin Packing is FPT.