Merging a fractional representation by integer coordinates (proof of Lemma 5)
DefinitionIntConeFPT_fracMergeconvex-optimizationinteger-cones
Let be a list of weighted generators with , and . The list combines all entries with the same integer coordinates. For each integer vector that occurs in , with index set , it contains the single entry
This is the averaging step in the proof of Lemma 5: "Combine generators with the same integer coordinates by averaging their continuous coordinates with their fractional multiplicities as weights."
The list is computed by folding fracMergeInsert from the right. fracMergeInsert either merges the entry into an existing entry , replacing it by , or appends it. Repeated pairwise averaging gives the weighted average displayed above. The formula is meaningful when all multiplicities are positive, which is the case where it is used.
Definition code
import Mathlib
namespace IntConeFPT
/-- **Insert one weighted generator `(x, u, θ)` into a merged list** (proof of Lemma 5, p.36:
"Combine generators with the same integer coordinates by averaging their continuous coordinates
with their fractional multiplicities as weights").
If the list already has an entry `(x, u', θ')` with the same integer coordinates `x`, that entry
becomes `(x, (θ' u' + θ u) / (θ' + θ), θ' + θ)`; otherwise `(x, u, θ)` is appended at the end. -/
def fracMergeInsert {d k : ℕ} (e : (Fin d → ℤ) × (Fin k → ℚ) × ℚ) :
List ((Fin d → ℤ) × (Fin k → ℚ) × ℚ) → List ((Fin d → ℤ) × (Fin k → ℚ) × ℚ)
| [] => [e]
| h :: l =>
if h.1 = e.1 then
(h.1, (fun j => (h.2.2 * h.2.1 j + e.2.2 * e.2.1 j) / (h.2.2 + e.2.2)), h.2.2 + e.2.2) :: l
else h :: fracMergeInsert e l
/-- **Merging a fractional representation by integer coordinates** (proof of Lemma 5, p.36).
`fracMerge L` folds `fracMergeInsert` over `L` (from the right). For positive multiplicities the
result has one entry per distinct integer coordinate vector `x` occurring in `L`: its multiplicity
is the total multiplicity `Σ θ_i` of the entries with that `x`, and its continuous coordinates are
the weighted average `Σ θ_i u_i / Σ θ_i`. -/
def fracMerge {d k : ℕ} (L : List ((Fin d → ℤ) × (Fin k → ℚ) × ℚ)) :
List ((Fin d → ℤ) × (Fin k → ℚ) × ℚ) :=
L.foldr fracMergeInsert []
end IntConeFPT
Source
Jansen–Ohnesorge–Schumacher, A Constructive FPT Algorithm for Integer Cone Optimization with Convex Costs, arXiv:2609.31328 (preprint), proof of Lemma 5, Section B.1, p.36