MIN-SCTM on the unit-cost RAM — input layout, output seed set and the time bound of Theorem 3
DefinitionTraceAdopt_LPReform_Supplement_RAMIOThese definitions fix how an instance of MIN-SCTM (problem (1), p. 6) is handed to a program of the unit-cost real RAM and how its answer is read back, so that the running time of Theorem 3 is a count of executed instructions.
An instance has firms , supply chains with hyperedges , benefits for , adoption costs and thresholds (natural numbers), and real seeding costs .
- Integer input. The natural-number cells hold, in order: , ; for each chain , its threshold , its size and, for each firm in increasing order, the pair ; then . Each number occupies one cell, so the input has cells.
- Real input. The real cells hold .
- Output. After the run halts, the output seed set is , read from the first integer cells.
- Time bound. For an absolute constant , tree-width parameter and ,
the form of Theorem 3 with shifts that keep the base positive.
Formalization Note The machine is the published unit-cost real RAM MeanCertificates1424.Hardness.Supplement (Program, Cfg, RunsWithin): integer cells with constants, addition, truncated subtraction and indirect addressing; real cells with ; comparisons and jumps; every executed instruction costs one step, and reals cannot be converted to integers. is the published varthetaMax.
import Mathlib
import Definitions.Def_TraceAdopt_LPReform_Model
import Definitions.Def_MeanCertificates1424_Hardness_Supplement_RAM
set_option autoImplicit false
namespace TraceAdopt.LPReform.Supplement
/-- The natural-number part of an MIN-SCTM instance as read by the unit-cost RAM: `n`, `m`;
then for each supply chain `j` (in index order) its threshold `θ_j`, its size `k_j = |e_j|` and,
for each firm `i ∈ e_j` in increasing order, the pair `i, r_ji`; then the adoption costs
`c_1, …, c_n`. Each number occupies one integer cell. Only the benefits `r_ji` with `i ∈ e_j`
are part of the input, as in §3.1. -/
def ramInts (I : Instance) : List ℕ :=
[I.n, I.m] ++
(List.finRange I.m).flatMap (fun j =>
[I.θ j, (I.e j).card] ++ ((I.e j).sort (· ≤ ·)).flatMap (fun i => [i.val, I.r j i])) ++
List.ofFn I.c
/-- The real part of the input: the seeding costs `w_1, …, w_n` in real cells `R[0], …, R[n-1]`. -/
def ramReals (I : Instance) (w : Fin I.n → ℝ) : List ℝ := List.ofFn w
/-- The seed set written by a halted run: firm `i` is in the output set exactly when the
integer cell `I[i]` holds `1`. -/
def outSeeds (n : ℕ) (c : MeanCertificates1424.Hardness.Supplement.Cfg) : Finset (Fin n) :=
Finset.univ.filter (fun i => c.imem i.val = 1)
/-- The running-time bound of Theorem 3 with an absolute constant `C`:
`C · ((ϑ_max + 1)(ω + 2))^{C(ω + 1)} · (n + m + 1)`, the form `[ϑ_max ⋅ ω]^{O(ω)} (n + m)`
with the shifts `+1`, `+2` that keep the base positive at `ϑ_max = 0` or `ω = 0`. -/
def dpTimeBound (C : ℕ) (I : Instance) (ω : ℕ) : ℕ :=
C * ((varthetaMax I + 1) * (ω + 2)) ^ (C * (ω + 1)) * (I.n + I.m + 1)
end TraceAdopt.LPReform.Supplement