Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4(a) — Polynomial-Time Multiplicity-Encoding Reduction from KNAPSACK to n∣1∣rn≥0,wj=1∣∑wjCjn|1|r_n\ge 0, w_j=1|\sum w_j C_jn∣1∣rn​≥0,wj​=1∣∑wj​Cj​

Proved
SchedComplexity.TotalCompletion.knapsack_mult_encoding_reduction

by kmehltretter82 · Oct 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

computational-complexityknapsackscheduling

There exists a polynomial-time computable function fff on BSym\mathrm{BSym}BSym strings that maps binary-coded KNAPSACK instances knapsackCode(a,b)\mathrm{knapsackCode}(a, b)knapsackCode(a,b) with 0<b<A0 < b < A0<b<A to multiplicity-encoded instances in sumCLangMult\mathrm{sumCLangMult}sumCLangMult representing (procTime(a,b),weight(a,b),release(a,b),yThreshold(a,b))(\mathrm{procTime}(a,b), \mathrm{weight}(a,b), \mathrm{release}(a,b), \mathrm{yThreshold}(a,b))(procTime(a,b),weight(a,b),release(a,b),yThreshold(a,b)), and resolves boundary instances b≥Ab \ge Ab≥A.

Preamble
import Mathlib.Data.Real.Basic
import Mathlib.Data.Rat.Defs
import Mathlib.Data.Nat.Bits
import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Fintype.Sum
import Mathlib.Data.Finset.Max
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Finset.Lattice.Fold
import Mathlib.Data.Set.Card
import Mathlib.Data.List.Sort
import Mathlib.Logic.Equiv.Fin.Rotate
import Mathlib.Combinatorics.SimpleGraph.Basic
import Mathlib.Tactic
import Definitions.Def_CookPvsNP_defs
import Definitions.Def_SchedComplexity_TotalCompletion_Knapsack
import Definitions.Def_SchedComplexity_TotalCompletion_SingleMachine
import Definitions.Def_SchedComplexity_TotalCompletion_Construction
Formal statement
namespace SchedComplexity.TotalCompletion

open ProjSchedTW.Complexity (BSym encNats)

/-- Polynomial-time multiplicity-encoding reduction for Theorem 4(a) (Brucker, Lenstra &
Rinnooy Kan 1975, pp. 22–23, Remark p. 23): there is a polynomial-time computable function `f` on
`BSym` strings that maps binary-coded KNAPSACK instances `knapsackCode a b` with `0 < b < sumA a`
to multiplicity-encoded instances in `sumCLangMult` representing `(procTime a b, weight a b,
release a b, yThreshold a b)`, and handles boundary instances `b ≥ sumA a`. -/
theorem knapsack_mult_encoding_reduction :
    ∃ f : List BSym → List BSym, CookPvsNP.PolyTimeComputable f ∧
      ∀ x : List BSym,
        ((∃ (t : ℕ) (a : Fin t → ℕ) (b : ℕ),
            IsKnapsackInstance a b ∧ b < sumA a ∧
            IsYes (procTime a b) (weight a b) (release a b) (yThreshold a b) ∧
            x = knapsackCode a b) ∨
          (∃ (t : ℕ) (a : Fin t → ℕ) (b : ℕ),
            IsKnapsackInstance a b ∧ b = sumA a ∧ x = knapsackCode a b)) ↔
          f x ∈ sumCLangMult := by sorry

end SchedComplexity.TotalCompletion
Source
Brucker, Lenstra & Rinnooy Kan 1975, Complexity of Machine Scheduling Problems, Report BW 43/75, pp. 22–23, Theorem 4(a) and Remark

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