Documentation

CslibFrontier.Computability.Complexity.Reduction.Levin

Levin reductions #

A Levin reduction of an NP relation R to an NP relation S is a polynomial-time map f of instances together with two polynomial-time maps of witnesses: a forward map sending each witness w for a to a witness for f a, and a backward map sending each witness for f a to a witness for a. This is the augmented Karp reduction of Goldreich, Exercise 2.28, which Goldreich notes is the definition Levin used [Lev73] (Levin's witness maps read only the witness). Goldreich's Definition 2.12 keeps only the instance map and the backward map; the forward map is what lets an honest prover for S run on the witnesses of R, as in zero-knowledge proofs for all of NP.

Both witness maps read the instance as well as the witness. A Levin reduction is in particular a polynomial-time many-one reduction between the languages (Cslib.Complexity.LevinReduction.toPolyTimeReducible). Levin reductions compose (Cslib.Complexity.LevinReduction.trans), and an NP relation is LevinHard when every NP relation, over any encoded instance type, Levin-reduces to it; its language is then NP-hard (Cslib.Complexity.LevinHard.npHard). This is Goldreich's PC-hardness (the remark following Goldreich, Definition 2.18) for the augmented reductions.

Main definitions #

Main results #

References #

structure Cslib.Complexity.LevinReduction {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} (R : NPRelation encA) (S : NPRelation encB) :

A Levin reduction of the NP relation R to the NP relation S Goldreich, Exercise 2.28: a polynomial-time map toFun of instances, a polynomial-time map forwardWitness sending a witness w for a to the witness forwardWitness (a, w) for toFun a, and a polynomial-time map backwardWitness sending a witness w for toFun a to the witness backwardWitness (a, w) for a.

theorem Cslib.Complexity.LevinReduction.mem_language_iff {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {R : NPRelation encA} {S : NPRelation encB} (r : LevinReduction R S) (a : α) :

The instance map of a Levin reduction preserves membership in the languages.

theorem Cslib.Complexity.LevinReduction.toPolyTimeReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {R : NPRelation encA} {S : NPRelation encB} (r : LevinReduction R S) :

A Levin reduction is a polynomial-time many-one reduction of the languages.

The identity Levin reduction of an NP relation to itself.

def Cslib.Complexity.LevinReduction.trans {α β γ : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {encC : γ ↪ List Bool} {R : NPRelation encA} {S : NPRelation encB} {T : NPRelation encC} (r : LevinReduction R S) (s : LevinReduction S T) :

Composition of Levin reductions. The forward maps compose along the first instance map; the backward map first pulls a witness back to the intermediate instance.

@[simp]
theorem Cslib.Complexity.LevinReduction.trans_toFun {α β γ : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {encC : γ ↪ List Bool} {R : NPRelation encA} {S : NPRelation encB} {T : NPRelation encC} (r : LevinReduction R S) (s : LevinReduction S T) :
def Cslib.Complexity.LevinHard {β : Type} {encB : β ↪ List Bool} (S : NPRelation encB) :

The NP relation S is Levin-hard: every NP relation, over any encoded type of instances, Levin-reduces to it. This is Goldreich's PC-hardness (the remark following Goldreich, Definition 2.18) for reductions with both witness maps, over NP relations with certificates of exactly the prescribed length. As in Cslib.Complexity.HardUnder, the instance type is strict-implicit.

theorem Cslib.Complexity.LevinHard.trans {β γ : Type} {encB : β ↪ List Bool} {encC : γ ↪ List Bool} {S : NPRelation encB} {T : NPRelation encC} (hS : LevinHard S) (s : LevinReduction S T) :

Levin-hardness transfers along a Levin reduction.

theorem Cslib.Complexity.LevinHard.npHard {β : Type} {encB : β ↪ List Bool} {S : NPRelation encB} (hS : LevinHard S) :

The language of a Levin-hard NP relation is NP-hard.