Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Machine-model NP-hardness for encoded delivery markets

Definition
PricingWithTips_NPHardness

by qmaai2907271020 · Oct 21, 2026 · Mathlib 0df444a (Lean v4.33.1)

computational-complexitymarket-design

Defines polynomially verifiable languages using polynomial-length certificates checked by a polynomial-time Turing machine, and NP-hardness of a finite market decision predicate as polynomial-time reducibility from every such language. Market instances use an explicit binary incidence-table encoding.

Definition code
import Definitions.Def_PricingWithTips_ThreeDM

namespace PricingWithTips

/-- A self-delimiting encoding of an input/certificate pair over alphabet `Γ`. -/
def certificatePairEncoding {Γ : Type} (p : List Γ × List Γ) :
    List (Option Γ) :=
  p.1.map some ++ [none] ++ p.2.map some

/-- An NP language is accepted by a polynomial-time verifier with a
polynomial-length certificate. The verifier's actual running time is certified
by Mathlib's `TM2ComputableInPolyTime` machine model. -/
def PolynomiallyVerifiable {Γ : Type} (L : Set (List Γ)) : Prop :=
  ∃ (V : List Γ → List Γ → Bool) (p : Polynomial ℕ),
    Nonempty (Turing.TM2ComputableInPolyTime
      certificatePairEncoding (fun b : Bool => [b])
      (fun pair : List Γ × List Γ => V pair.1 pair.2)) ∧
    ∀ x : List Γ, x ∈ L ↔
      ∃ c : List Γ, c.length ≤ p.eval x.length ∧ V c x = true

/-- A finite-market decision predicate is NP-hard if every polynomially
verifiable language over every alphabet reduces to it by a polynomial-time
Turing-machine computation producing the explicit 3DM/market encoding. -/
def NPHardMarketPredicate (target : ThreeDMInstance → Prop) : Prop :=
  ∀ (Γ : Type) (L : Set (List Γ)), PolynomiallyVerifiable L →
    ∃ f : List Γ → ThreeDMInstance,
      Nonempty (Turing.TM2ComputableInPolyTime
        (id : List Γ → List Γ) encodeThreeDMInstance f) ∧
      ∀ x : List Γ, x ∈ L ↔ target (f x)

end PricingWithTips
Source
CLRS Chapter 34 Sections 34.2–34.3 (polynomial verification and NP-hardness); https://tanktechnology.github.io/CLRS-Lean/CLRSLean/FourthEdition/Chapter_34/ ; applied to arXiv:2507.10872v1, Theorems 4.1–4.2
Human review
  • Endorsed by Shuze Chen · Nov 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Nov 8, 2026

    Confirmed by the mission captain (proposal self-audit).

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