import Problems.PVersusNP.Millennium import Problems.PVersusNP.Machines.CertificateBound /-! # Polynomial time and computable enumerability Cook's polynomial-time reductions and checking relations can be used as computable ones. For NP, the computable checker also enforces the original certificate bound. -/ namespace Millennium open Computability Turing /-- A polynomial-time many-one reduction is a computable many-one reduction. -/ theorem PolynomialTimeReducible.toManyOneReducible {α β : Type} {ea : FinEncoding α} {eb : FinEncoding β} {L₁ : Language α} {L₂ : Language β} (h : PolynomialTimeReducible ea eb L₁ L₂) : ManyOneReducible ea eb L₁ L₂ := by obtain ⟨f, machine, correct⟩ := h exact ⟨f, machine.toTM2ComputableInTime.toTM2Computable, correct⟩ /-- A polynomial-time checking relation is a computable checking relation. -/ theorem PolynomialTimeCheckingRelation.toComputableCheckingRelation {α β : Type} {ea : FinEncoding α} {eb : FinEncoding β} {R : α → β → Prop} (h : PolynomialTimeCheckingRelation ea eb R) : ComputableCheckingRelation ea eb R := by obtain ⟨verifier, machine, correct⟩ := h exact ⟨verifier, machine.toTM2ComputableInTime.toTM2Computable, fun a b => correct (a, b)⟩ end Millennium