Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Build a DPT witness from a concrete machine package

Definition
sgl_dpt_from_machine

by Henry Yuen · Jul 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

complexity-theorypolynomial-timeutility

This utility repackages the concrete data in the mission definition of deterministic polynomial-time decidability. If a finite-tape machine, a time bound, a proof that the time bound is polynomial, and the accept/reject correctness equivalences are supplied explicitly, then the corresponding predicate satisfies DecidesInPolynomialTime.

It is the converse bookkeeping step to unpacking a DecidesInPolynomialTime hypothesis into its witness machine.

Definition code
import Definitions.Def_sipser_gacs_lautemann

namespace SipserGacsLautemann

theorem DecidesInPolynomialTime.of_machine
    {tapes : Nat}
    {predicate : (Fin tapes → List Bool) → Prop}
    (states : Nat)
    (machine : Machine tapes states)
    (time : Nat → Nat)
    (htime : PolynomiallyBounded time)
    (hcorrect :
      ∀ input : Fin tapes → List Bool,
        (machine.acceptsWithin input
            (time (totalInputLength input)) ↔
          predicate input) ∧
        (machine.rejectsWithin input
            (time (totalInputLength input)) ↔
          ¬ predicate input)) :
    DecidesInPolynomialTime predicate :=
  ⟨states, machine, time, htime, hcorrect⟩

end SipserGacsLautemann
Source
Prove2me Sipser--Gács--Lautemann mission; direct repackaging of the `DecidesInPolynomialTime` definition.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me