# Publication details

##
Mechanising Complexity Theory: The Cook-Levin Theorem in Coq

Lennard Gäher, Fabian Kunze

12th International Conference on Interactive Theorem Proving (ITP 2021), pp. 20:1--20:18, Schloss Dagstuhl -Leibniz-Zentrum für Informatik, January 2021

We mechanise the Cook-Levin theorem, i.e. the NP-completeness of SAT, in the proof assistant Coq. We use the call-by-value lambda-calculus L as the model of computation to formalise time complexity, the class NP, and polynomial-time reductions. The latter two notions agree with the usual characterisations via Turing machines (TMs), as L and TMs are polynomial-time equivalent.

The use of L as the computational model, as opposed to TMs, significantly eases program verification and the derivation of resource bounds. However, for showing the NP-hardness of SAT, computations of L need to be encoded in SAT, which is complicated by L's more complex computational structure. Thus, the polynomial-time reduction chain to SAT employs TMs as an intermediate problem, for which we neatly factor out a known textbook reduction from TMs to SAT. Still, all reduction functions are implemented and analysed in L.

To the best of our knowledge, this is the first result in *computational* complexity theory that has been mechanised with respect to any concrete computational model.

We discuss what makes this area of computer science hard to mechanise and highlight the design choices which enable our mechanisations.

Download PDF
Show BibTeX

@CONFERENCE{GaeherKunze:2021:Cook-levin,
title = {Mechanising Complexity Theory: The Cook-Levin Theorem in Coq},
author = {Lennard Gäher and Fabian Kunze},
year = {2021},
month = {Jan},
publisher = {Schloss Dagstuhl -Leibniz-Zentrum für Informatik},
booktitle = {12th International Conference on Interactive Theorem Proving (ITP 2021)},
volume = {193},
pages = {20:1--20:18},
}

Login to edit

Legal notice, Privacy policy