Documentation

CslibFrontier.Computability.Complexity.Classes.NP.StrictVerifier

Length-checked verifiers #

An NP verifier V is only required by Cslib.Complexity.IsVerifier to decide membership when given a certificate of the prescribed length p |enc a|; its behavior on shorter or longer strings is unconstrained. Wrapping V in Cslib.Complexity.strictVerifier adds an explicit polynomial-time check that the certificate has length p |enc a|.

Because the guarded verifier checks the length itself, an instance belongs to the problem iff some certificate of any length is accepted (IsVerifier.exists_strictVerifier_eq_true_iff). In Fagin's theorem the existential second-order sentence can therefore guess where the certificate ends without evaluating the polynomial p in first-order logic.

Main definitions #

Main results #

References #

def Cslib.Complexity.strictVerifier {α : Type} (enc : α ↪ List Bool) (p : Polynomial ℕ) (V : α × List Bool → Bool) (x : α × List Bool) :

A verifier augmented with an explicit check that the certificate has the prescribed length p.eval (enc a).length.

@[simp]
theorem Cslib.Complexity.strictVerifier_eq_true_iff {α : Type} (enc : α ↪ List Bool) (p : Polynomial ℕ) (V : α × List Bool → Bool) (a : α) (w : List Bool) :
theorem Cslib.Complexity.length_eq_of_strictVerifier_eq_true {α : Type} {enc : α ↪ List Bool} {p : Polynomial ℕ} {V : α × List Bool → Bool} {a : α} {w : List Bool} (h : strictVerifier enc p V (a, w) = true) :
theorem Cslib.Complexity.IsVerifier.strictVerifier {α : Type} {enc : α ↪ List Bool} {p : Polynomial ℕ} {V : α × List Bool → Bool} {A : Set α} (hV : IsVerifier enc p V A) :

Guarding a verifier by its certificate-length check preserves IsVerifier.

theorem Cslib.Complexity.IsVerifier.exists_strictVerifier_eq_true_iff {α : Type} {enc : α ↪ List Bool} {p : Polynomial ℕ} {V : α × List Bool → Bool} {A : Set α} (hV : IsVerifier enc p V A) (a : α) :
a ∈ A ↔ ∃ (w : List Bool), Complexity.strictVerifier enc p V (a, w) = true

Because strictVerifier checks the certificate length itself, an instance belongs to A iff some certificate of any length is accepted.