While this submission is a draft, it cannot be used by other submissions.

Unary 3-Partition

Lax833301.ThreePartition · concepts/Lax833301/ThreePartition.lean · lax-833301

proven

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Theorem

    There are 3m3m positive item sizes, each strictly between b/4b/4 and b/2b/2, of total size mbmb. A solution assigns 3 items of total size bb to each bin. This restriction of 3-Partition, with all numbers written in unary, is NP-hard (Garey and Johnson, problem SP15).

    Concept map
    9 concepts; 6 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A
    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

    1import Lax833301.Instances
    2import Mathlib.Algebra.BigOperators.Group.Finset.Basic
    3
    4/-!
    5---
    6title: Unary 3-Partition
    7type: theorem
    8---
    9There are 3m3m positive item sizes, each strictly between b/4b/4 and b/2b/2,
    10of total size mbmb. A solution assigns 3 items of total size bb to each bin.
    11This restriction of 3-Partition, with all numbers written in unary, is
    12NP-hard (Garey and Johnson, problem SP15).
    13-/
    14
    15namespace Lax833301.ThreePartition
    16
    17open Lax434930.PolynomialTime Lax434930.NondeterministicPolynomialTime
    18open Lax429075.Encoding Instances
    19
    20structure 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
    29def Instance.bits (I : Instance) : Word :=
    30 encodeNat I.m ++ encodeNat I.b ++ (List.ofFn (fun i => encodeNat (I.size i))).flatten
    31
    32def 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
    37axiom 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
    41end Lax833301.ThreePartition
    42
    Show Proof

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…