Unary 3-Partition
Lax833301.ThreePartition · concepts/Lax833301/ThreePartition.lean · lax-833301
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
There are positive item sizes, each strictly between and , of total size . A solution assigns 3 items of total size to each bin. This restriction of 3-Partition, with all numbers written in unary, is NP-hard (Garey and Johnson, problem SP15).
Concept map
Evidence
Each proof establishes this claim relative to its assumptions.
In the paper
- page 2 of this submission's paper
Lean source view on GitHub
| 1 | import Lax833301.Instances |
| 2 | import Mathlib.Algebra.BigOperators.Group.Finset.Basic |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Unary 3-Partition |
| 7 | type: theorem |
| 8 | --- |
| 9 | There are positive item sizes, each strictly between and , |
| 10 | of total size . A solution assigns 3 items of total size to each bin. |
| 11 | This restriction of 3-Partition, with all numbers written in unary, is |
| 12 | NP-hard (Garey and Johnson, problem SP15). |
| 13 | -/ |
| 14 | |
| 15 | namespace Lax833301.ThreePartition |
| 16 | |
| 17 | open Lax434930.PolynomialTime Lax434930.NondeterministicPolynomialTime |
| 18 | open Lax429075.Encoding Instances |
| 19 | |
| 20 | structure Instance where |
| 21 | m : ℕ |
| 22 | b : ℕ |
| 23 | nonempty : 0 < m |
| 24 | size : Fin (3*m) → ℕ |
| 25 | small : ∀ i, 2 * size i < b |
| 26 | large : ∀ i, b < 4 * size i |
| 27 | total : ∑ i, size i = m * b |
| 28 | |
| 29 | def Instance.bits (I : Instance) : Word := |
| 30 | encodeNat I.m ++ encodeNat I.b ++ (List.ofFn (fun i => encodeNat (I.size i))).flatten |
| 31 | |
| 32 | def Instance.Positive (I : Instance) : Prop := |
| 33 | ∃ bin : Fin (3*I.m) → Fin I.m, ∀ j, |
| 34 | (Finset.univ.filter fun i => bin i = j).card = 3 ∧ |
| 35 | (∑ i ∈ Finset.univ.filter (fun i => bin i = j), I.size i) = I.b |
| 36 | |
| 37 | axiom hardness (A : Language) (hA : A ∈ NP) : |
| 38 | ∃ f : Word → Word, Poly f ∧ ∀ x, ∃ I : Instance, |
| 39 | f x = I.bits ∧ (x ∈ A ↔ I.Positive) |
| 40 | |
| 41 | end Lax833301.ThreePartition |
| 42 |
Builds on
Used by
From Mathlib
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments