Exact rational arithmetic and dot products on binary stacks
ProvedBinaryTM2.canonical_rational_operations_and_costbin-packingcomputational-complexityfixed-parameter-tractabilityinteger-programming
The canonical signed-fraction routines for addition, subtraction, multiplication and division have polynomial cost. On admissible denominators they produce the exact rational value and a positive denominator. Dot products, integer injections and canonical rational input words obey the corresponding value laws.
Preamble
import Definitions.Def_EdgeSublinearMWIS_Main_BinaryOracleImplementation open OAI.ThreeMachine.StackCompiler EdgeSublinearMWIS.Main EdgeSublinearMWIS.Main.RawStack EdgeSublinearMWIS.Main.RealizerBounds
Formal statement
namespace BinaryTM2
theorem canonical_rational_operations_and_cost :
(∀ (a b : SignedWords),
0 < value a.2.2 →
0 < value b.2.2 →
0 < value (canonicalAdd (a, b)).2.2) ∧
(PolyBound canonicalAddRealizer) ∧
(∀ (a b : SignedWords),
0 < value a.2.2 →
0 < value b.2.2 →
signedFractionValue (canonicalAdd (a, b)) =
signedFractionValue a + signedFractionValue b) ∧
(∀ (a b : SignedWords),
0 < value a.2.2 →
0 < value b.2.1 →
0 < value (canonicalDiv (a, b)).2.2) ∧
(PolyBound canonicalDivRealizer) ∧
(∀ (a b : SignedWords),
0 < value a.2.2 →
0 < value b.2.1 →
signedFractionValue (canonicalDiv (a, b)) =
signedFractionValue a / signedFractionValue b) ∧
(∀ (a b : SignedWords),
0 < value a.2.2 →
0 < value b.2.2 →
0 < value (canonicalMul (a, b)).2.2) ∧
(PolyBound canonicalMulRealizer) ∧
(∀ (a b : SignedWords),
0 < value a.2.2 →
0 < value b.2.2 →
signedFractionValue (canonicalMul (a, b)) =
signedFractionValue a * signedFractionValue b) ∧
(∀ (a b : SignedWords),
0 < value a.2.2 →
0 < value b.2.2 →
0 < value (canonicalSub (a, b)).2.2) ∧
(PolyBound canonicalSubRealizer) ∧
(∀ (a b : SignedWords),
0 < value a.2.2 →
0 < value b.2.2 →
signedFractionValue (canonicalSub (a, b)) =
signedFractionValue a - signedFractionValue b) ∧
(∀ {n : ℕ} (a b : Fin n → SignedWords),
(∀ (i : Fin n), 0 < value (a i).2.2) →
(∀ (i : Fin n), 0 < value (b i).2.2) →
0 <
value
(signedDot (List.ofFn a, List.ofFn b)).2.2 ∧
signedFractionValue
(signedDot (List.ofFn a, List.ofFn b)) =
∑ i : Fin n,
signedFractionValue (a i) *
signedFractionValue (b i)) ∧
(PolyBound signedDotRealizer) ∧
(∀ (q : RationalCode),
signedFractionValue (codeWords q) = q.value) ∧
(∀ (A : List Bool), 0 < value (unsignedIntegerWord A).2.2) ∧
(∀ (A : List Bool),
signedFractionValue (unsignedIntegerWord A) =
↑(value A)) := 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.