Documentation

CslibFrontier.Computability.Complexity.ProofSystem.Optimal

Optimal and p-optimal proof systems #

Following Krajíček and Pudlák, a proof system P for a set L is optimal (Cslib.Complexity.ProofSystem.IsOptimal) when it simulates every proof system for L, and p-optimal (Cslib.Complexity.ProofSystem.IsPOptimal) when it p-simulates every proof system for L.

Any two proof systems P and Q for L admit a combined proof system P.join Q that routes a proof word to P or Q according to its leading tag bit, witnessing that Simulates and PSimulates are directed preorders with binary joins (Cslib.Complexity.ProofSystem.pSimulates_join_iff, Cslib.Complexity.ProofSystem.simulates_join_iff). Every polynomially bounded proof system is optimal (Cslib.Complexity.ProofSystem.PolynomiallyBounded.isOptimal), so when an optimal system exists, it is polynomially bounded if and only if some proof system is polynomially bounded — and for UNSAT, if and only if NP = coNP (Cslib.Complexity.ProofSystem.IsOptimal.polynomiallyBounded_UNSAT_iff_NP_eq_coNP).

An optimal proof system P for L proves every NP subset X ⊆ L with proofs of length polynomial in the encoded instance length (Cslib.Complexity.ProofSystem.IsOptimal.polyBounded_on_NP_subset). For any paddable decodable language L (Cslib.Complexity.Paddable), the converse also holds (Cslib.Complexity.ProofSystem.exists_isOptimal_iff_of_paddable), specializing via Cslib.Complexity.UNSAT_paddable to the full (2) ↔ (3) equivalence of [KrajicekPudlak1989, Theorem 2.1(i)] for UNSAT (Cslib.Complexity.ProofSystem.exists_isOptimal_UNSAT_iff).

Source-to-Lean mapping #

Main definitions #

Main results #

References #

Optimality and p-optimality #

def Cslib.Complexity.ProofSystem.IsOptimal {α : Type} {enc : α ↪ List Bool} {L : Set α} (P : ProofSystem enc L) :

P is an optimal proof system for L [KrajicekPudlak1989, §0, p. 1063; §2, Statement (2), p. 1066]: it simulates every proof system for L. In [KP89], P ≤ Q denotes that P simulates Q, so an optimal system is a least element of ≤; here P.Simulates Q places the simulating system on the left.

def Cslib.Complexity.ProofSystem.IsPOptimal {α : Type} {enc : α ↪ List Bool} {L : Set α} (P : ProofSystem enc L) :

P is a p-optimal proof system for L [KrajicekPudlak1989, §2, Statement (7), p. 1067]: it p-simulates every proof system for L.

theorem Cslib.Complexity.ProofSystem.IsPOptimal.isOptimal {α : Type} {enc : α ↪ List Bool} {L : Set α} {P : ProofSystem enc L} (hP : P.IsPOptimal) :

Every p-optimal proof system is optimal. This is a derived fixed-system consequence of the definitions and PSimulates.simulates (underlying the existential (7) → (2) implication in [KrajicekPudlak1989, Theorem 2.1(i)]; Theorem 2.1(ii) treats equivalences among (6)–(9)).

theorem Cslib.Complexity.ProofSystem.IsOptimal.of_simulates {α : Type} {enc : α ↪ List Bool} {L : Set α} {P Q : ProofSystem enc L} (hP : P.IsOptimal) (hQP : Q.Simulates P) :

Optimality transfers upward along simulation.

theorem Cslib.Complexity.ProofSystem.IsPOptimal.of_pSimulates {α : Type} {enc : α ↪ List Bool} {L : Set α} {P Q : ProofSystem enc L} (hP : P.IsPOptimal) (hQP : Q.PSimulates P) :

p-optimality transfers upward along p-simulation.

theorem Cslib.Complexity.ProofSystem.IsOptimal.simulates_iff {α : Type} {enc : α ↪ List Bool} {L : Set α} {P : ProofSystem enc L} (hP : P.IsOptimal) (Q : ProofSystem enc L) :

Relative to an optimal proof system P, a system Q is optimal iff it simulates P.

theorem Cslib.Complexity.ProofSystem.IsPOptimal.pSimulates_iff {α : Type} {enc : α ↪ List Bool} {L : Set α} {P : ProofSystem enc L} (hP : P.IsPOptimal) (Q : ProofSystem enc L) :

Relative to a p-optimal proof system P, a system Q is p-optimal iff it p-simulates P.

theorem Cslib.Complexity.ProofSystem.IsOptimal.mutual_simulates {α : Type} {enc : α ↪ List Bool} {L : Set α} {P Q : ProofSystem enc L} (hP : P.IsOptimal) (hQ : Q.IsOptimal) :

Any two optimal proof systems for L mutually simulate each other.

theorem Cslib.Complexity.ProofSystem.IsPOptimal.mutual_pSimulates {α : Type} {enc : α ↪ List Bool} {L : Set α} {P Q : ProofSystem enc L} (hP : P.IsPOptimal) (hQ : Q.IsPOptimal) :

Any two p-optimal proof systems for L mutually p-simulate each other.

Tagged join of two proof systems #

def Cslib.Complexity.ProofSystem.join {α : Type} {enc : α ↪ List Bool} {L : Set α} (P Q : ProofSystem enc L) :

The tagged join of two proof systems P and Q for L: a proof false :: π is evaluated by P, a proof true :: π is evaluated by Q, and the empty word defaults to P []. Defining the order A ≤ B by B.PSimulates A (or B.Simulates A), which reverses the ordering of [KrajicekPudlak1989, §0, p. 1063], P.join Q is a least upper bound (join) of P and Q, corresponding to the source's common lower bound.

@[simp]
theorem Cslib.Complexity.ProofSystem.join_false_cons {α : Type} {enc : α ↪ List Bool} {L : Set α} (P Q : ProofSystem enc L) (π : List Bool) :
(P.join Q).toFun (false :: π) = P.toFun π
@[simp]
theorem Cslib.Complexity.ProofSystem.join_true_cons {α : Type} {enc : α ↪ List Bool} {L : Set α} (P Q : ProofSystem enc L) (π : List Bool) :
(P.join Q).toFun (true :: π) = Q.toFun π
@[simp]
theorem Cslib.Complexity.ProofSystem.join_nil {α : Type} {enc : α ↪ List Bool} {L : Set α} (P Q : ProofSystem enc L) :
(P.join Q).toFun [] = P.toFun []
theorem Cslib.Complexity.ProofSystem.join_pSimulates_left {α : Type} {enc : α ↪ List Bool} {L : Set α} (P Q : ProofSystem enc L) :

P.join Q p-simulates P by prepending the tag bit false.

theorem Cslib.Complexity.ProofSystem.join_pSimulates_right {α : Type} {enc : α ↪ List Bool} {L : Set α} (P Q : ProofSystem enc L) :

P.join Q p-simulates Q by prepending the tag bit true.

theorem Cslib.Complexity.ProofSystem.join_simulates_left {α : Type} {enc : α ↪ List Bool} {L : Set α} (P Q : ProofSystem enc L) :
(P.join Q).Simulates P

P.join Q simulates P.

theorem Cslib.Complexity.ProofSystem.join_simulates_right {α : Type} {enc : α ↪ List Bool} {L : Set α} (P Q : ProofSystem enc L) :
(P.join Q).Simulates Q

P.join Q simulates Q.

theorem Cslib.Complexity.ProofSystem.pSimulates_join_iff {α : Type} {enc : α ↪ List Bool} {L : Set α} {R P Q : ProofSystem enc L} :

P.join Q is a binary join (least upper bound) in the order A ≤ B given by B.PSimulates A.

theorem Cslib.Complexity.ProofSystem.simulates_join_iff {α : Type} {enc : α ↪ List Bool} {L : Set α} {R P Q : ProofSystem enc L} :

P.join Q is a binary join (least upper bound) in the order A ≤ B given by B.Simulates A.

Polynomial bounds, Cook–Reckhow, and NP subsets #

Every polynomially bounded proof system is optimal: since every proof system Q computes Q π in polynomial time, (enc (Q π)).length is polynomially bounded in π.length.

An optimal proof system is polynomially bounded iff some proof system for L is polynomially bounded.

For a decodable encoding, an optimal proof system for L is polynomially bounded iff L ∈ NP enc.

An optimal refutation system for UNSAT is polynomially bounded iff NP = coNP: the UNSAT analogue of [KrajicekPudlak1989, §0, p. 1063] (stated there for TAUT), obtained from Cslib.Complexity.ProofSystem.NP_eq_coNP_iff_exists_polynomiallyBounded [CR79b].

theorem Cslib.Complexity.ProofSystem.IsOptimal.polyBounded_on_NP_subset {α : Type} {enc : α ↪ List Bool} {L : Set α} {P : ProofSystem enc L} (hP : P.IsOptimal) (D : Turing.MultiTapeTM.Decoder enc) {X : Set α} (hXL : X ⊆ L) (hX : X ∈ NP enc) :
∃ (p : Polynomial ℕ), ∀ a ∈ X, ∃ (π : List Bool), P.toFun π = a ∧ π.length ≤ Polynomial.eval (enc a).length p

Forward (2) → (3) direction of [KrajicekPudlak1989, Theorem 2.1(i)]: an optimal proof system P for L proves every NP subset X ⊆ L with proofs of length polynomial in the encoded instance length.

For any paddable decodable language (and in particular for UNSAT), the converse (3) → (2) also holds, giving the full (2) ↔ (3) equivalence in Cslib.Complexity.ProofSystem.exists_isOptimal_iff_of_paddable and Cslib.Complexity.ProofSystem.exists_isOptimal_UNSAT_iff.

theorem Cslib.Complexity.ProofSystem.exists_isOptimal_iff_of_paddable {α : Type} {enc : α ↪ List Bool} {L : Set α} (D : Turing.MultiTapeTM.Decoder enc) (hL : Paddable enc L) :
(∃ (P : ProofSystem enc L), P.IsOptimal) ↔ ∃ (P : ProofSystem enc L), ∀ X ⊆ L, X ∈ NP enc → ∃ (p : Polynomial ℕ), ∀ a ∈ X, ∃ (π : List Bool), P.toFun π = a ∧ π.length ≤ Polynomial.eval (enc a).length p

Equivalence (2) ↔ (3) of [KrajicekPudlak1989, Theorem 2.1(i)] for paddable decodable languages: a paddable language L (Cslib.Complexity.Paddable) with a total polynomial-time decoder has an optimal proof system if and only if some proof system for L proves every NP subset of L with proofs of length polynomial in the encoded instance length.

In [KrajicekPudlak1989, §2–§3, pp. 1066–1067, 1070–1071], (3) → (2) is established for TAUT via first-order arithmetic consistency statements (3) → (5) → (4) → (1) → (2). Here we prove the converse directly from Paddable: unpadding P yields an optimal system because every proof system Q embeds its pairs (Q w, w) into the NP subset {pad (Q w) (frame (enc (Q w)) ++ w) | w}.

theorem Cslib.Complexity.ProofSystem.exists_isOptimal_UNSAT_iff :
(∃ (P : ProofSystem encCNF UNSAT), P.IsOptimal) ↔ ∃ (P : ProofSystem encCNF UNSAT), ∀ X ⊆ UNSAT, X ∈ NP encCNF → ∃ (p : Polynomial ℕ), ∀ φ ∈ X, ∃ (π : List Bool), P.toFun π = φ ∧ π.length ≤ Polynomial.eval (encCNF φ).length p

Equivalence (2) ↔ (3) of [KrajicekPudlak1989, Theorem 2.1(i)] for UNSAT: UNSAT has an optimal refutation system if and only if some refutation system for UNSAT has polynomial-length refutations on every NP subset of UNSAT.

Conditional existence of optimal and p-optimal proof systems #

theorem Cslib.Complexity.ProofSystem.exists_isOptimal_of_mem_NP {α : Type} {enc : α ↪ List Bool} {L : Set α} (D : Turing.MultiTapeTM.Decoder enc) (hL : L.Nonempty) (hNP : L ∈ NP enc) :
∃ (P : ProofSystem enc L), P.IsOptimal

Every nonempty decodable NP set has an optimal proof system.

If NP = coNP, then UNSAT has an optimal refutation system: the UNSAT analogue of [KrajicekPudlak1989, §0, p. 1063], obtained via NP_eq_coNP_iff_exists_polynomiallyBounded.

def Cslib.Complexity.ProofSystem.ofDecider {α : Type} {enc : α ↪ List Bool} {L : Set α} (D : Turing.MultiTapeTM.Decoder enc) {f : α → Bool} (hf : Turing.MultiTapeTM.ComputableInPolyTime f enc Turing.MultiTapeTM.encBool) (hfL : ∀ (a : α), a ∈ L ↔ f a = true) {a₀ : α} (ha₀ : a₀ ∈ L) :

The proof system of a polynomial-time decider f for L, with a default member a₀: each word is decoded by D; if f accepts the decoded instance, the word proves it, and otherwise it proves a₀.

theorem Cslib.Complexity.ProofSystem.ofDecider_enc {α : Type} {enc : α ↪ List Bool} {L : Set α} (D : Turing.MultiTapeTM.Decoder enc) {f : α → Bool} (hf : Turing.MultiTapeTM.ComputableInPolyTime f enc Turing.MultiTapeTM.encBool) (hfL : ∀ (a : α), a ∈ L ↔ f a = true) {a₀ : α} (ha₀ : a₀ ∈ L) {a : α} (ha : a ∈ L) :
(ofDecider D hf hfL ha₀).toFun (enc a) = a

In ofDecider, the encoding of any member a ∈ L proves a itself.

theorem Cslib.Complexity.ProofSystem.isPOptimal_ofDecider {α : Type} {enc : α ↪ List Bool} {L : Set α} (D : Turing.MultiTapeTM.Decoder enc) {f : α → Bool} (hf : Turing.MultiTapeTM.ComputableInPolyTime f enc Turing.MultiTapeTM.encBool) (hfL : ∀ (a : α), a ∈ L ↔ f a = true) {a₀ : α} (ha₀ : a₀ ∈ L) :
(ofDecider D hf hfL ha₀).IsPOptimal

The proof system of a polynomial-time decider is p-optimal: any proof π in any proof system Q is translated in polynomial time to enc (Q π).

theorem Cslib.Complexity.ProofSystem.exists_isPOptimal_of_mem_P {α : Type} {enc : α ↪ List Bool} {L : Set α} (D : Turing.MultiTapeTM.Decoder enc) (hL : L.Nonempty) (hP : L ∈ P enc) :
∃ (Q : ProofSystem enc L), Q.IsPOptimal

Every nonempty decodable set in P has a p-optimal proof system.