Lemma 6 constructive congruence-preserving rounding and certificate deduplication
ProvedIntConeFPT.lemma_6_round_writerfptinteger-optimizationturing-machine
There exist an absolute constant and a deterministic TM2 machine over that, given framed context ctx encoding with , , and an encoded fractional representation of length at most , strictly positive weights, and weight sum , computes in polynomial time the binary certificate encoding encCert out obtained by: (1) taking integer floors , (2) partitioning copies of each support index into groups of size averaged via , (3) forming the final residual element when , and (4) merging entries sharing identical generator coordinates .
Preamble
import Mathlib import Definitions.Def_OnlineCRS_Combine_Sym import Definitions.Def_OnlineCRS_Combine_encNat import Definitions.Def_OnlineCRS_Combine_encInt import Definitions.Def_OnlineCRS_Combine_encRat import Definitions.Def_OnlineCRS_Combine_encVec import Definitions.Def_IntConeFPT_Machine import Definitions.Def_IntConeFPT_Instance import Definitions.Def_IntConeFPT_Problem import Definitions.Def_IntConeFPT_Residue open OnlineCRS.Combine IntConeFPT
Formal statement
theorem IntConeFPT.lemma_6_round_writer :
let frame := fun (x y : List Sym) => x.flatMap (fun s => [(0 : Sym), s]) ++ 1 :: y
∃ C : ℕ, ∃ P : Machine,
∀ (d k : ℕ), 1 ≤ d →
∀ (r : Residue d) (z : Fin d → ℤ) (n : ℕ), 1 ≤ n →
∀ (o : ℚ × ((Fin d → ℚ) × (Fin k → ℚ)) × ℚ × List ((Fin d → ℤ) × (Fin k → ℚ) × ℚ)),
o.2.2.2.length ≤ 2 ^ d →
(∀ e ∈ o.2.2.2, 0 < e.2.2) →
(o.2.2.2.map fun e => e.2.2).sum = (n : ℚ) →
let rep := o.2.2.2
let q := fun e : (Fin d → ℤ) × (Fin k → ℚ) × ℚ => ⌊e.2.2⌋₊
let δ := fun e : (Fin d → ℤ) × (Fin k → ℚ) × ℚ => e.2.2 - (q e : ℚ)
let ρ := fun e : (Fin d → ℤ) × (Fin k → ℚ) × ℚ => ⌊((2 ^ d : ℕ) : ℚ) * δ e⌋₊
let ℓ := n - (rep.map q).sum
let poolIdx := (List.finRange rep.length).flatMap fun idx => List.replicate (ρ (rep.get idx)) idx
let usedIdx := poolIdx.take (2 ^ d * (ℓ - 1))
let chunk := fun j : Fin (ℓ - 1) => (usedIdx.drop (j.1 * 2 ^ d)).take (2 ^ d)
let xAvg := fun (j : Fin (ℓ - 1)) (i : Fin d) =>
((r i : ℕ) : ℤ) + ((chunk j).map fun idx => ((rep.get idx).1 i - ((r i : ℕ) : ℤ)) / (2 ^ d : ℤ)).sum
let uAvg := fun (j : Fin (ℓ - 1)) (i : Fin k) =>
((chunk j).map fun idx => (rep.get idx).2.1 i).sum / ((2 ^ d : ℕ) : ℚ)
let β := fun idx : Fin rep.length => δ (rep.get idx) - (usedIdx.count idx : ℚ) / ((2 ^ d : ℕ) : ℚ)
let xFinal := fun i : Fin d =>
z i - (rep.map fun e => (q e : ℤ) * e.1 i).sum - ((List.finRange (ℓ - 1)).map fun j => xAvg j i).sum
let uFinal := fun i : Fin k =>
((List.finRange rep.length).map fun idx => β idx * (rep.get idx).2.1 i).sum
let raw : List ((Fin d → ℤ) × (Fin k → ℚ) × ℕ) :=
if ℓ = 0 then rep.map fun e => (e.1, e.2.1, q e)
else (rep.filterMap fun e => if q e = 0 then none else some (e.1, e.2.1, q e)) ++
((List.finRange (ℓ - 1)).map fun j => (xAvg j, uAvg j, 1)) ++
[(xFinal, uFinal, 1)]
let out : List ((Fin d → ℤ) × (Fin k → ℚ) × ℕ) :=
raw.foldr (fun e acc =>
if acc.any (fun h => decide ((h.1, h.2.1) = (e.1, e.2.1))) then
acc.map (fun h => if (h.1, h.2.1) = (e.1, e.2.1) then (h.1, h.2.1, h.2.2 + e.2.2) else h)
else e :: acc) []
let ctx := encNat d ++ [3] ++ encNat k ++ [3] ++ encResidue r ++ encIntVec z ++ encNat n ++ [3]
RunsWithin P (frame ctx (encOracle o)) (encCert out)
(((ctx.length : ℝ) + ((encOracle o).length : ℝ) + (2 ^ d : ℝ) + 2) ^ C) := by sorrySource
Jansen–Ohnesorge–Schumacher, A Constructive FPT Algorithm for Integer Cone Optimization with Convex Costs, arXiv:2609.31328, Lemma 6, pp. 9 and 37