Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section III, p. 385 — a polynomial-time reduction from THREE-DIMENSIONAL MATCHING makes a problem NP-hard

Proved
IntractableCoding.Weights.npHard_of_threeDM_reduction

by mikedeng1 · Oct 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

np-completenessp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1reductionsthree-dimensional-matching

Let PPP be a decision problem on instances of a type α\alphaα, presented through a binary encoding enc\mathrm{enc}enc. Suppose ggg maps every THREE-DIMENSIONAL MATCHING instance III to an instance g(I)g(I)g(I) of PPP, is computed by a polynomial-time multi-stack Turing machine from the encoding of III to enc(g(I))\mathrm{enc}(g(I))enc(g(I)), and satisfies

I has a matching  ⟺  P(g(I))for every I.I\text{ has a matching}\iff P(g(I))\qquad\text{for every }I.I has a matching⟺P(g(I))for every I.

Then PPP is NP-hard with respect to enc\mathrm{enc}enc.

This is the step "a polynomial-time algorithm for COSET WEIGHTS implies a polynomial-time algorithm for THREE-DIMENSIONAL MATCHING, which in turn implies a polynomial-time algorithm for every NP-problem", used once for each of the two coding problems. It rests on the NP-hardness of THREE-DIMENSIONAL MATCHING (Karp's problem 17), published as PricingWithTips.threeDM_np_hard.

Differences from the source:

  • generalization: the reduction to COSET WEIGHTS (and the same argument for SUBSPACE WEIGHTS) → any target problem P with any binary encoding enc; reason: the paper uses the argument twice with the same shape; taking enc = encodeCoset, P = CosetWeightsYes (resp. encodeSubspace, SubspaceWeightsYes) gives exactly the paper's two uses
  • reading: a polynomial-time algorithm for COSET WEIGHTS implies one for every NP-problem (Turing style) → NP-hardness under polynomial-time TM2-computed many-one reductions; reason: the paper's reduction is a many-one map and its notion of NP-completeness is Karp's [4]; many-one hardness implies the Turing-style sentence
Preamble
import Mathlib
import Definitions.Def_IntractableCoding_Weights_NPComplete
Formal statement
namespace IntractableCoding.Weights

open PricingWithTips

/-- NP-hardness transfers along a polynomial-time many-one reduction from
THREE-DIMENSIONAL MATCHING: if a map `g` from 3DM instances to instances of `P`, computed by a
polynomial-time TM2 machine from `encodeThreeDMInstance I` to `enc (g I)`, satisfies
`ThreeDMYes I ↔ P (g I)` for every `I`, then `P` is NP-hard (with respect to `enc`). -/
theorem npHard_of_threeDM_reduction {α : Type} (enc : α → List Bool) (P : α → Prop)
    (g : ThreeDMInstance → α)
    (hg : Nonempty (Turing.TM2ComputableInPolyTime encodeThreeDMInstance enc g))
    (hred : ∀ I : ThreeDMInstance, ThreeDMYes I ↔ P (g I)) :
    NPHardFor enc P := by sorry

end IntractableCoding.Weights
Source
Berlekamp, McEliece & van Tilborg, On the Inherent Intractability of Certain Coding Problems, IEEE Trans. Inform. Theory IT-24(3), 1978, https://doi.org/10.1109/TIT.1978.1055873, p. 385, Section III, reduction of THREE-DIMENSIONAL MATCHING to COSET WEIGHTS ("That is, a polynomial-time algorithm for COSET WEIGHTS implies …")
Human review
  • Endorsed by Shuze Chen · Oct 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 24, 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