Documentation

CslibFrontier.Computability.Complexity.Problems.RationalIntegerProgramming

Rational-input integer programming #

Theorem 2.17 of the January 8, 2007 web draft of [AB07], printed p. 52 / PDF p. 68, asks whether rational linear inequalities admit a nonnegative integer assignment. RationalIntegerProgram.Feasible states this problem, with unary dimension and binary rational numerators and denominators. Lists are padded with zero or truncated to the declared dimension; all supplied coefficients are charged in the encoding.

clearDenominators multiplies each row by the product of its positive denominators (including the right-hand side), then adds nonnegativity rows. satisfies_clearDenominators_iff preserves exactly the integer assignments, with no new unknowns. Binary product, division and multiplication certificates prove polynomial time, including the bit cost of the denominator products. NP membership follows from the integer-input small-solution theorem. Hardness reuses the zero-one reduction to integer inequalities, casting its coefficients to rationals.

Main results #

A rational inequality in variable order.

  • coeffs : List ℚ

    Coefficient list, padded with zero or truncated to the declared dimension.

  • rhs : ℚ

    Rational upper bound.

Instances For
    theorem Cslib.Complexity.RationalIntegerProgram.encInequality_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → List ℚ} {x1 : γ → ℚ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encRat) budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encRat budget) :
    Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { coeffs := x0 x, rhs := x1 x }) encIn encInequality budget
    theorem Cslib.Complexity.RationalIntegerProgram.encInequality_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List ℚ} {T0 S0 : γ → ℕ} {x1 : γ → ℚ} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encRat) T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encRat T1 S1) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { coeffs := x0 x, rhs := x1 x }) encIn encInequality (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x

    Framed list of binary rationals followed by the binary rational bound. Each rational uses its reduced signed-binary numerator, framed, followed by its positive binary denominator.

    theorem Cslib.Complexity.RationalIntegerProgram.encInequality_rhs_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Inequality} :

    Rational linear inequalities whose unknowns range over nonnegative integers.

    • numVars : ℕ

      Number of variables, charged in unary.

    • constraints : List Inequality

      The rational inequality rows.

    Instances For
      @[reducible, inline]

      The tuple of the fields of enc.

      Unary dimension, framed, then a framed list of rows under encInequality. Rational coefficients use explicit signed-binary numerators and positive binary denominators.

      theorem Cslib.Complexity.RationalIntegerProgram.enc_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 : γ → ℕ} {x1 : γ → List Inequality} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Turing.MultiTapeTM.encList encInequality) T1 S1) :
      Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { numVars := x0 x, constraints := x1 x }) encIn enc (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
      theorem Cslib.Complexity.RationalIntegerProgram.enc_numVars_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RationalIntegerProgram} :
      theorem Cslib.Complexity.RationalIntegerProgram.enc_constraints_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RationalIntegerProgram} :
      theorem Cslib.Complexity.RationalIntegerProgram.enc_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 : γ → ℕ} {x1 : γ → List Inequality} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn (Turing.MultiTapeTM.encList encInequality) budget) :
      Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { numVars := x0 x, constraints := x1 x }) encIn enc budget

      Feasibility with nonnegative integer coordinates, as in draft Theorem 2.17.

      Clear each row by its positive denominator product, including the bound, and append -x j ≤ 0 for every variable. The dimension and integer solution set are preserved.

      @[simp]

      Denominator clearing does not introduce auxiliary variables.

      theorem Cslib.Complexity.RationalIntegerProgram.satisfies_clearDenominators_iff (P : RationalIntegerProgram) (x : Fin P.numVars → ℤ) :
      (∀ c ∈ P.clearDenominators.constraints, ∑ j : Fin P.numVars, c.coeffs.getD (↑j) 0 * x j ≤ c.rhs) ↔ (∀ (j : Fin P.numVars), 0 ≤ x j) ∧ ∀ c ∈ P.constraints, ∑ j : Fin P.numVars, c.coeffs.getD (↑j) 0 * ↑(x j) ≤ c.rhs

      Denominator clearing preserves exactly the nonnegative integer assignments, with no change of dimension. In particular it does not substitute rational witnesses for integer ones.

      Rational-input feasibility belongs to NP by the proved integer small-solution bound.

      Rational-input integer programming with nonnegative integer unknowns is NP-complete ([AB07], January 8, 2007 draft, Theorem 2.17, printed p. 52 / PDF p. 68). The explicit encoding uses unary dimension and binary reduced numerators/denominators.