Documentation

CslibFrontier.Computability.Complexity.Problems.Partition

Partition #

Partition is the set of lists of natural numbers, possibly with repetitions, that split into two sub-multisets with equal sums [Kar72]. Numbers are encoded in binary (encNat).

Appending the two numbers a.sum + 1 and 2 * t + 1 to the numbers a reduces SubsetSum to Partition: together these two exceed half of the new total, so they lie on opposite sides of any partition, and the side holding a.sum + 1 holds numbers of a summing to exactly t. Neither number needs subtraction, so the reduction is defined for every target, including targets larger than a.sum.

Main definitions #

Main results #

References #

The lists of natural numbers that split into two sub-multisets with equal sums [Kar72].

Instances For
    theorem Cslib.Complexity.mem_Partition_iff {l : List ℕ} :
    l ∈ Partition ↔ ∃ s ≤ ↑l, 2 * s.sum = l.sum

    A partition is a sub-multiset holding half of the total sum.

    A partition is a subsequence holding half of the total sum.

    The verifier for Partition, a mask verifier (Cslib.Complexity.maskVerifier): the numbers selected by the certificate mask hold half of the total sum.

    Instances For

      The reduction from SubsetSum to Partition: append a.sum + 1 and 2 * t + 1.

      Instances For