Partition is in NP #
The certificate guesses the split and two ripple-carry walks, one along the
chosen items and one along the items left out, and asks that they end on the
same number. Two things differ from Knapsack
(DescriptiveComplexity.Problems.Knapsack.Membership):
- the walks run on the wide positions of
DescriptiveComplexity.Numbers.Wide– pairs(x, p)withpa position of the instance – because each half istotal / 2, which the instance's own positions need not be able to write. A wide position is therefore two variables, guarded byposn palone, and the step from one to the next is either inside a block or from the top of one block to the bottom of the next (DescriptiveComplexity.succPos_wide); - there is no target to reach and no number to guess: the two walks are simply required to agree at the last item, and with no items at all both sums are empty, so Knapsack's degenerate clause has no counterpart here.
The two walks are the same clauses read twice, once for the side b = true
(the chosen items) and once for b = false (the others), so the whole clause
family is written as a function of b, and so is the semantic argument, which
is DescriptiveComplexity.chain_sound and DescriptiveComplexity.exists_chain
(DescriptiveComplexity.Problems.Knapsack.Chain) applied twice.
The relation variables of the certificate: the chosen items, and the running totals and carries of the two walks.
- sel : PIdx
The chosen items.
- ps
(b : Bool)
: PIdx
The running total of the walk on the side
b. - cy
(b : Bool)
: PIdx
The carries of the walk on the side
b.
Instances For
Dependency graph
Dependency graph
Equations
- DescriptiveComplexity.instDecidableEqPIdx.decEq DescriptiveComplexity.PIdx.sel DescriptiveComplexity.PIdx.sel = isTrue ⋯
- DescriptiveComplexity.instDecidableEqPIdx.decEq DescriptiveComplexity.PIdx.sel (DescriptiveComplexity.PIdx.ps b) = isFalse ⋯
- DescriptiveComplexity.instDecidableEqPIdx.decEq DescriptiveComplexity.PIdx.sel (DescriptiveComplexity.PIdx.cy b) = isFalse ⋯
- DescriptiveComplexity.instDecidableEqPIdx.decEq (DescriptiveComplexity.PIdx.ps b) DescriptiveComplexity.PIdx.sel = isFalse ⋯
- DescriptiveComplexity.instDecidableEqPIdx.decEq (DescriptiveComplexity.PIdx.ps a) (DescriptiveComplexity.PIdx.ps b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- DescriptiveComplexity.instDecidableEqPIdx.decEq (DescriptiveComplexity.PIdx.ps b) (DescriptiveComplexity.PIdx.cy b_1) = isFalse ⋯
- DescriptiveComplexity.instDecidableEqPIdx.decEq (DescriptiveComplexity.PIdx.cy b) DescriptiveComplexity.PIdx.sel = isFalse ⋯
- DescriptiveComplexity.instDecidableEqPIdx.decEq (DescriptiveComplexity.PIdx.cy b) (DescriptiveComplexity.PIdx.ps b_1) = isFalse ⋯
- DescriptiveComplexity.instDecidableEqPIdx.decEq (DescriptiveComplexity.PIdx.cy a) (DescriptiveComplexity.PIdx.cy b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Dependency graph
The single existential block of the Σ₁ definition of Partition: the
chosen items (unary), and, for each side, the running totals and the carries
(ternary: an item and a wide position, itself a pair).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The symbol of the chosen-items relation variable.
Equations
Instances For
Dependency graph
The symbol of the running total of the side b.
Equations
Instances For
Dependency graph
The symbol of the carries of the side b.
Equations
Instances For
Dependency graph
The vocabulary of the kernel.
Equations
Instances For
Dependency graph
The item symbol in the kernel's vocabulary.
Instances For
Dependency graph
The position symbol in the kernel's vocabulary.
Instances For
Dependency graph
The bit symbol in the kernel's vocabulary.
Instances For
Dependency graph
The order symbol in the kernel's vocabulary.
Instances For
Dependency graph
The chosen-items symbol in the kernel's vocabulary.
Instances For
Dependency graph
The running-total symbol of the side b in the kernel's vocabulary.
Equations
Instances For
Dependency graph
The carry symbol of the side b in the kernel's vocabulary.
Equations
Instances For
Dependency graph
Formula builders #
x is an item, as a formula.
Equations
Instances For
Dependency graph
x is a bit position, as a formula.
Equations
Instances For
Dependency graph
The weight of i has bit 1 at p, as a formula.
Equations
Instances For
Dependency graph
x ≤ y, as a formula.
Equations
Instances For
Dependency graph
x = y, as a formula.
Equations
Instances For
Dependency graph
x is chosen, as a formula.
Equations
Instances For
Dependency graph
Bit (x, p) of the running total of the side b at i, as a formula.
Equations
Instances For
Dependency graph
The carry at (x, p) of the step appending i, as a formula.
Equations
Instances For
Dependency graph
i belongs to the side b, as a formula.
Equations
Instances For
Dependency graph
x is a minimum of the order, as a formula.
Equations
Instances For
Dependency graph
x is a maximum of the order, as a formula.
Equations
Instances For
Dependency graph
The bit that the item i contributes at the wide position (x, p): its
weight's bit, in the lowest block, if it is on the side b.
Equations
Instances For
Dependency graph
The exclusive or of three formulas, as x ↔ (y ↔ z).
Equations
- DescriptiveComplexity.ptXor3F x y z = x.iff (y.iff z)
Instances For
Dependency graph
The majority of three formulas.
Equations
- DescriptiveComplexity.ptMaj3F x y z = x ⊓ y ⊔ (x ⊓ z ⊔ y ⊓ z)
Instances For
Dependency graph
i is the first item, as a formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
i is the last item, as a formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
j is the item right after i, as a formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
p is the lowest position, as a formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
p is the highest position, as a formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
q is the position right above p, as a formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
y is the element right after x in the whole universe, as a formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
(x, p) is the lowest wide position, as a formula.
Equations
Instances For
Dependency graph
(x, p) is the highest wide position, as a formula.
Equations
Instances For
Dependency graph
(y, q) is the wide position right above (x, p), as a formula: a step
inside a block, or from the top of one block to the bottom of the next.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The clauses #
The first-order kernel of the Σ₁ definition of Partition.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Realization #
The chosen items, read off an assignment of the block.
Equations
Instances For
Dependency graph
The running total of the side b, read off an assignment of the block.
Equations
- DescriptiveComplexity.PPS ρ b i u = ρ (DescriptiveComplexity.PIdx.ps b) ![i, u.1, u.2]
Instances For
Dependency graph
The carries of the side b, read off an assignment of the block.
Equations
- DescriptiveComplexity.PCy ρ b i u = ρ (DescriptiveComplexity.PIdx.cy b) ![i, u.1, u.2]
Instances For
Dependency graph
The items of the side b: the chosen ones, or the others.
Equations
Instances For
Dependency graph
The bit an item contributes at a wide position: its own bit, in the lowest
block. The minimality of the block is written with the Unit-indexed
quantifier the kernel's ∀ produces; DescriptiveComplexity.pWt_iff reads it
back.
Equations
- DescriptiveComplexity.PWt i u = ((∀ (y : Unit → A), DescriptiveComplexity.BWLe u.1 (y ())) ∧ DescriptiveComplexity.BWBit i u.2)
Instances For
Dependency graph
Dependency graph
Membership #
Partition is Σ₁-definable: guess the split and the two ripple-carry
walks, one along the chosen items and one along the others, and check
first-order that they end on the same number. Since NP is defined as
Σ₁-definability, this is the membership half of the NP-completeness of
Partition.