Binary parsing and serialization of rationals, vectors and matrix rows
ProvedBinaryTM2.rational_vector_matrix_codecs_and_costbin-packingcomputational-complexityfixed-parameter-tractabilityinteger-programming
The self-delimiting word and rational readers recover their input fields and tails. Repeated reading and row serialization respect canonical rational vectors and matrices, including empty lists, with polynomial bounds for the listed parsing and writing operations.
Preamble
import Definitions.Def_EdgeSublinearMWIS_Main_BinaryOracleImplementation open OAI.ThreeMachine.StackCompiler EdgeSublinearMWIS.Main EdgeSublinearMWIS.Main.RawStack EdgeSublinearMWIS.Main.RealizerBounds
Formal statement
namespace BinaryTM2
theorem rational_vector_matrix_codecs_and_cost :
(PolyBound prefixRealizer) ∧
(∀ (b : Bool) (A B : List Bool),
0 < value B →
rationalBits (b, A, B) =
encodeRat
(↑(signedValue b A) / ↑(value B))) ∧
(PolyBound rationalBitsRealizer) ∧
(∀ (q : ℚ), (rationalCode q).value = q) ∧
(∀ {n : ℕ} (a : Fin n → ℚ),
List.flatMap RationalCode.bits
(List.ofFn fun (i : Fin n) => rationalCode (a i)) =
vectorBits a) ∧
(∀ (b : Bool) (A B : List Bool),
0 < value B →
rationalSign (b, A, B) =
Decidable.decide
(((signedValue b A : ℚ) / ↑(value B)).num < 0)) ∧
(∀ (qs : List RationalCode) (rest : List Bool),
readMany qs.length
(List.flatMap RationalCode.bits qs ++ rest) =
(List.map codeWords qs, rest)) ∧
(PolyBound readManyRealizer) ∧
(PolyBound readMatrixRowsRealizer) ∧
(∀ (n : ℕ) (rows : List (List RationalCode)),
(∀ row ∈ rows, row.length = n) →
∀ (rest : List Bool) (acc : List SignedVector),
readMatrixStep^[rows.length]
(n,
List.flatMap
(fun (row : List RationalCode) =>
List.flatMap RationalCode.bits row)
rows ++
rest,
acc) =
(n, rest, (List.map (List.map codeWords) rows).reverse ++ acc)) ∧
(PolyBound readMatrixStepRealizer.iterate) ∧
(∀ (q : RationalCode) (rest : List Bool),
readRational (q.bits ++ rest) =
((Decidable.decide (q.numerator < 0), natBits q.numerator.natAbs,
natBits q.denominator),
rest)) ∧
(PolyBound readRationalRealizer) ∧
(∀ (n : ℕ) (rest : List Bool),
readUnboundedNatural (encodeNat n ++ rest) = (n, rest)) ∧
(∀ (n : ℕ) (rest : List Bool),
readWord (encodeNat n ++ rest) =
(natBits n, rest)) ∧
(PolyBound readWordRealizer) ∧
(∀ (A rest : List Bool),
readWord (prefixBits A ++ rest) = (A, rest)) ∧
(∀ {n : ℕ} (xs : SignedVector) (a : Fin n → ℚ),
RepresentsVector xs (rationalVector a) →
serializeRow xs = vectorBits a) ∧
(PolyBound serializeRowRealizer) := 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.