wimmers / poly-reductions

Polynomial-time reductions in Isabelle/HOL
2 stars 13 forks source link

Definitions of P, NP, polynomial time and space bounding, reductions #27

Closed BilelGho closed 3 years ago

BilelGho commented 3 years ago

issue #18

BilelGho commented 3 years ago

TODO: further explanation on the approach of defining P/ NP, what worked and what did not.

So .. ehm.. Here we go. Let's begin by defining/explaining the abstractions used in the theory:

Abstractions of the theory

The most basic dual, computing and verifying:

Definitions

Remark: the universal and existential quantifiers, are kind of similar and easy to confuse in the context of using IMP- semantics to define our abstractions due to the determinism of our semantics. Although there's still a difference. The universal quantifier does not exclude the possibility of the computation not halting, so you're saying if it halts then so and so is going to happen. The existential does give us a more precise info. The computation will halt and give us such a result. We know in both cases that no more than one computation might happen/halt . But we don't know if at least one will halt.

Properties:

Bounds, bounds, bounds:

Since we're interested in complexity theory, rather than pure computability theory, some space and time bounds should be involved. We will represent bounding functions as nat => nat. We need our bounding functions to be polynomial. The theory developed by Manuel Eberl on polynomial growth is really helpful.

Let's start with time bounds:

Time bounds:

This already delivers a definition of the complexity class P: it is the set of problems/languages, who have a decider that is polynomially time bounded. One can see already the pros of the way we are approaching the problem. Through the presented abstractions we do separate the concepts if correctness and complexity (even though there's still a kind of intersection of both of them, since both will mean that the program always halt)

What about polynomial reductions? We try to define them as reductions that are polynomial time bounded. We know that sequencing a reduction and a decider would result in a decider for the "easier" language. So we will need to say that the sequencing of the polynomial reduction and the polynomial decider would also halt in a polynomial time.

This is not as trivial as it sounds. The time bound of the second program does depend on its own input which is the result of the first program, not the initial input. So we need to also know that the result of the first program (i.e: the reduction) is bounded.

result bound: