Documentation

CslibFrontier.Computability.MCSP.PartialHardness.EvaluatorPolyTime

The CMMSA table evaluator runs in polynomial time #

The evaluator of Cslib.Computability.MCSP.PartialHardness.Evaluator computes the partial truth table of FromCMMSA.toInstance from explicit tables. This module proves that it runs in polynomial time for fixed Δ, k and P. The instance I uses CMMSAInstance.encoding, λ and term and slot indices are unary, the input x is binary and the tables T are a framed list of bit strings (encList encBits).

Every statement has the form "if the arguments are polynomial-time functions of an input a, so is the result". A client may therefore compute the arguments from any context, for instance under mapWithInput, and the per-entry statements are fun_prop lemmas.

The widths that place the input fields are polynomial-time in unary. The seed width is a maximum over the variables (seedWidth_eq), so it is read from the largest weight maxWeight. The number 2 ^ L of table entries is polynomial-time in unary, and polynomially bounded for every instance and every λ (two_pow_inputLength_le). Given a list of tables that has the table of every variable (IsVarTable), the instance toInstance I Δ k λ P f is then polynomial-time in PartialMCSP.enc (computableInPolyTime_toInstance).

Main definitions #

Main results #

References #

The seed width as a maximum #

The largest weight of I, 0 when there is none.

Every weight is at most the largest weight.

The largest weight is 0 or one of the weights.

The largest weight is at most any bound on the weights.

The seed width is ⌈log₂ (w_max λ)⌉ for the largest weight w_max.

Polynomial time #

theorem Cslib.PartialMCSP.FromCMMSA.two_pow_inputLength_le (I : Complexity.CMMSAInstance) (Δ k lam : ℕ) :
2 ^ inputLength I Δ k lam ≤ 2 * (I.formulas.length + 1) * ((2 * (maxWeight I * lam + 1)) ^ k * 2) ^ (Δ * Δ)

The number of table entries is polynomial, for every instance I and every λ: 2 ^ L ≤ 2 (m + 1) (2 (2 (w_max λ + 1)) ^ k) ^ Δ² for m formulas and largest weight w_max.

The evaluator #

The formula index x mod 2 ^ indexWidth of a numeric input is polynomial-time, in binary.

A slot bit computed from explicit tables is polynomial-time, for fixed Δ and k: the instance I (in CMMSAInstance.encoding), λ and the slot (t, q) in unary, the tables T and the input x in binary.

The parity of a term computed from explicit tables is polynomial-time, for fixed Δ and k: the instance I (in CMMSAInstance.encoding), λ and the term t in unary, the tables T and the input x in binary.

An entry computed from explicit tables is polynomial-time, for fixed Δ and k: the instance I (in CMMSAInstance.encoding), λ in unary, the tables T and the input x in binary.

The whole table computed from explicit tables is polynomial-time, for fixed Δ and k: the instance I (in CMMSAInstance.encoding), λ in unary, the tables T.

theorem Cslib.PartialMCSP.FromCMMSA.computableInPolyTime_toInstance {α : Type} {input : α ↪ List Bool} {I : α → Complexity.CMMSAInstance} {lam : α → ℕ} {T : α → List (List Bool)} {f : (a : α) → VarFunctions (I a) (lam a)} (Δ k P : ℕ) (hI : Turing.MultiTapeTM.ComputableInPolyTime I input Complexity.CMMSAInstance.encoding) (hlam : Turing.MultiTapeTM.ComputableInPolyTime lam input Turing.MultiTapeTM.encUnary) (hT : Turing.MultiTapeTM.ComputableInPolyTime T input (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits)) (hf : ∀ (a : α) (v : ℕ), IsVarTable (I a) (lam a) (f a) (T a) v) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (a : α) => toInstance (I a) Δ k (lam a) P (f a)) input enc

The partial MCSP instance is polynomial-time from explicit tables, for fixed Δ, k and P. If T a has the table of every variable of I a under the functions f a, then toInstance (I a) Δ k (lam a) P (f a) is computed in polynomial time from the instance I a, λ in unary and the tables T a.