Documentation

CslibFrontier.Computability.Complexity.Reduction.Isomorphism.Paddable

Paddable languages #

A language A is paddable when arbitrary bit strings y can be appended to an instance a by a polynomial-time map pad a y that preserves membership in A and from which y can be recovered in polynomial time Berman and Hartmanis. Paddability turns any polynomial-time many-one reduction into a one-one, length-increasing reduction with a polynomial-time left inverse: pad the reduct with a self-delimiting copy of the original instance, followed by enough filler to exceed its length. Together with the polynomial-time Cantor–Schröder–Bernstein theorem (Cslib.Complexity.PolyTimeInvertibleLengthIncreasingOneOneReducible.polyTimeIsomorphic), this shows that paddable languages that are many-one interreducible are polynomial-time isomorphic, and in particular that any two paddable NP-complete languages are.

The library's languages are sets of typed instances with injective encodings, rather than sets of strings. Inverting the padded reduction must decode a bit string back into an instance of the source type, so the reduction theorems assume a total polynomial-time Decoder for the source encoding. Every standard encoding built from bits, naturals, pairs, options and lists has one.

Source and adaptations #

The source version is the 1975 Cornell technical report Berman and Hartmanis. Locators in this file refer to that report; the numbering of the 1977 journal version Berman and Hartmanis has not been checked. The padding lemma below corresponds to Lemmas 3 and 5 (printed pp. 10–12), which give length growth and the two-argument padding and read-back condition, and the isomorphism results combine them with §III, Theorem 1 (printed pp. 7–10), formalized in Cslib.Complexity.PolyTimeInvertibleLengthIncreasingOneOneReducible.polyTimeIsomorphic.

The report pads strings. Here pad : α → List Bool → α acts on typed instances, the read-back unpad : α → List Bool is total, and only unpad (pad a y) = y is required of it. The padded reduction is given a total left inverse rather than the report's partial inverse on its range; as in the Schröder–Bernstein module, the forward-image test recovers that range. The padding carries an encoding of the source instance. Over strings that encoding is the instance itself, while here it must be decoded back into a typed instance, which is what the Decoder hypothesis supplies. For bit-string sources (encBits, with Turing.MultiTapeTM.Decoder.bits) the hypothesis is met, and Cslib.Complexity.Paddable.polyTimeIsomorphic_preimage_decode shows that a paddable typed language is ≅ᵖ to its language of words.

Main definitions #

Main results #

References #

def Cslib.Complexity.Paddable {α : Type} (encA : α ↪ List Bool) (A : Set α) :

A language A is paddable under the encoding encA when there are a polynomial-time padding function pad : α → List Bool → α and a polynomial-time decoding function unpad : α → List Bool with unpad (pad a y) = y and pad a y ∈ A ↔ a ∈ A. This is the typed form of the two-argument padding and read-back condition of Berman and Hartmanis, Lemmas 3 and 5. Recovering the padding makes pad a injective; nothing is required of unpad off the range of pad.

theorem Cslib.Complexity.Paddable.compl {α : Type} {encA : α ↪ List Bool} {A : Set α} (h : Paddable encA A) :

Paddability of A is paddability of its complement: the same functions work.

theorem Cslib.Complexity.Paddable.infinite {α : Type} {encA : α ↪ List Bool} {A : Set α} (h : Paddable encA A) (hA : A.Nonempty) :

A nonempty paddable language is infinite: padding a member is injective in the padding.

Padding lemma (Berman and Hartmanis, Lemmas 3 and 5). A polynomial-time many-one reduction from B to a paddable language A upgrades to a length-increasing one-one reduction with a polynomial-time left inverse, given a total polynomial-time decoder for the instances of B. The decoder hypothesis is the typed-model addition described in the module docstring.

The new reduction pads r b with the framed encoding of b, followed by more filler than any polynomial bound on the decoded padding allows from an encoding no longer than encB b.

theorem Cslib.Complexity.Paddable.polyTimeIsomorphic {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (hA : Paddable encA A) (hB : Paddable encB B) (DA : Turing.MultiTapeTM.Decoder encA) (DB : Turing.MultiTapeTM.Decoder encB) (hAB : PolyTimeReducible encA encB A B) (hBA : PolyTimeReducible encB encA B A) :
PolyTimeIsomorphic encA encB A B

Berman–Hartmanis, paddable form. Two paddable languages that are polynomial-time many-one interreducible are polynomial-time isomorphic, given total polynomial-time decoders for both instance encodings: Berman and Hartmanis, §III, Theorem 1 combined with Lemmas 3 and 5.

theorem Cslib.Complexity.PolyTimeIsomorphic.paddable {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : PolyTimeIsomorphic encA encB A B) (hB : Paddable encB B) :
Paddable encA A

Paddability transfers along polynomial-time isomorphisms: conjugate the padding function.

theorem Cslib.Complexity.PolyTimeIsomorphic.paddable_iff {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : PolyTimeIsomorphic encA encB A B) :
Paddable encA A ↔ Paddable encB B

Paddability is invariant under polynomial-time isomorphism.

theorem Cslib.Complexity.NPComplete.polyTimeIsomorphic_of_paddable {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (hA : NPComplete encA A) (hB : NPComplete encB B) (hpA : Paddable encA A) (hpB : Paddable encB B) (DA : Turing.MultiTapeTM.Decoder encA) (DB : Turing.MultiTapeTM.Decoder encB) :
PolyTimeIsomorphic encA encB A B

Paddable NP-complete languages are polynomial-time isomorphic (Berman and Hartmanis, §III, Theorem 1 combined with Lemmas 3 and 5), for instance types with total polynomial-time decoders.

theorem Cslib.Complexity.NPComplete.polyTimeIsomorphic_iff_paddable {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (hA : NPComplete encA A) (hB : NPComplete encB B) (hpB : Paddable encB B) (DA : Turing.MultiTapeTM.Decoder encA) (DB : Turing.MultiTapeTM.Decoder encB) :
PolyTimeIsomorphic encA encB A B ↔ Paddable encA A

For a paddable NP-complete language B, an NP-complete language is polynomial-time isomorphic to B exactly when it is paddable. The reverse direction is NPComplete.polyTimeIsomorphic_of_paddable (Berman and Hartmanis, §III, Theorem 1 combined with Lemmas 3 and 5); the forward direction, transport of paddability along ≅ᵖ, is derived here. With B = SAT, the Berman–Hartmanis conjecture says that every NP-complete language is paddable.

Words read through a decoder #

Reading every word through a total decoder preserves paddability: pad the decoded instance and re-encode it.

A paddable language of typed instances is polynomial-time isomorphic to the language of the words that decode into it. So, for paddable languages, the typed instance model and the string model agree up to ≅ᵖ.

Reading every word through a total decoder preserves NP-completeness: the decoder reduces the word language to A, and the encoding reduces A back to it.