Polynomial-time decidability is invariant under pointwise equivalence
Definitionsgl_dpt_congrcomplexity-theorypolynomial-timeutility
This utility records the extensional congruence principle for the mission predicate DecidesInPolynomialTime. If a predicate on a fixed number of tapes is decided in polynomial time, and a second predicate is pointwise logically equivalent to it on every input, then the second predicate is also decided in polynomial time by the same machine and time bound. This is useful for replacing executable verifier constructions by definitionally or propositionally equal normal forms.
Definition code
import Definitions.Def_sipser_gacs_lautemann
namespace SipserGacsLautemann
theorem DecidesInPolynomialTime.congr
{tapes : Nat}
{predicate₁ predicate₂ :
(Fin tapes → List Bool) → Prop}
(hdecides : DecidesInPolynomialTime predicate₁)
(hequiv : ∀ input, predicate₁ input ↔ predicate₂ input) :
DecidesInPolynomialTime predicate₂ := by
rcases hdecides with
⟨states, machine, time, htime, hcorrect⟩
refine ⟨states, machine, time, htime, ?_⟩
intro input
constructor
· exact (hcorrect input).1.trans (hequiv input)
· exact (hcorrect input).2.trans (not_congr (hequiv input))
end SipserGacsLautemann
Source
Prove2me Sipser--Gács--Lautemann mission; standard extensionality bookkeeping for deterministic polynomial-time deciders.