Documentation

DescriptiveComplexity.Problems.Partition.Membership

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 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
    Dependency graph
    @[instance_reducible]
    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
      Dependency graph

      The symbol of the running total of the side b.

      Equations
      Instances For
        Dependency graph
        Dependency graph
        Dependency graph
        @[reducible, inline]

        The item symbol in the kernel's vocabulary.

        Equations
        Instances For
          Dependency graph
          @[reducible, inline]

          The position symbol in the kernel's vocabulary.

          Equations
          Instances For
            Dependency graph
            @[reducible, inline]

            The bit symbol in the kernel's vocabulary.

            Equations
            Instances For
              Dependency graph
              @[reducible, inline]

              The order symbol in the kernel's vocabulary.

              Equations
              Instances For
                Dependency graph
                @[reducible, inline]

                The chosen-items symbol in the kernel's vocabulary.

                Equations
                Instances For
                  Dependency graph
                  @[reducible, inline]

                  The running-total symbol of the side b in the kernel's vocabulary.

                  Equations
                  Instances For
                    Dependency graph
                    @[reducible, inline]

                    The carry symbol of the side b in the kernel's vocabulary.

                    Equations
                    Instances For
                      Dependency graph

                      Formula builders #

                      Dependency graph
                      Dependency graph

                      The weight of i has bit 1 at p, as a formula.

                      Equations
                      Instances For
                        Dependency graph
                        Dependency graph
                        Dependency graph
                        Dependency graph
                        def DescriptiveComplexity.ptPSF {α : Type} (b : Bool) (i x p : α) :

                        Bit (x, p) of the running total of the side b at i, as a formula.

                        Equations
                        Instances For
                          Dependency graph
                          def DescriptiveComplexity.ptCyF {α : Type} (b : Bool) (i x p : α) :

                          The carry at (x, p) of the step appending i, as a formula.

                          Equations
                          Instances For
                            Dependency graph
                            Dependency graph
                            noncomputable def DescriptiveComplexity.ptBotF {α : Type} (x : α) :

                            x is a minimum of the order, as a formula.

                            Equations
                            Instances For
                              Dependency graph
                              noncomputable def DescriptiveComplexity.ptTopF {α : Type} (x : α) :

                              x is a maximum of the order, as a formula.

                              Equations
                              Instances For
                                Dependency graph
                                noncomputable def DescriptiveComplexity.ptAddF {α : Type} (b : Bool) (i x p : α) :

                                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
                                  Instances For
                                    Dependency graph

                                    The majority of three formulas.

                                    Equations
                                    Instances For
                                      Dependency graph
                                      noncomputable def DescriptiveComplexity.ptMinItemF {α : Type} (i : α) :

                                      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
                                        noncomputable def DescriptiveComplexity.ptMaxItemF {α : Type} (i : α) :

                                        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
                                          noncomputable def DescriptiveComplexity.ptSuccItemF {α : Type} (i j : α) :

                                          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
                                            noncomputable def DescriptiveComplexity.ptMinPosnF {α : Type} (p : α) :

                                            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
                                              noncomputable def DescriptiveComplexity.ptMaxPosnF {α : Type} (p : α) :

                                              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
                                                noncomputable def DescriptiveComplexity.ptSuccPosnF {α : Type} (p q : α) :

                                                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
                                                  noncomputable def DescriptiveComplexity.ptSuccAllF {α : Type} (x y : α) :

                                                  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
                                                    noncomputable def DescriptiveComplexity.ptMinWideF {α : Type} (x p : α) :

                                                    (x, p) is the lowest wide position, as a formula.

                                                    Equations
                                                    Instances For
                                                      Dependency graph
                                                      noncomputable def DescriptiveComplexity.ptMaxWideF {α : Type} (x p : α) :

                                                      (x, p) is the highest wide position, as a formula.

                                                      Equations
                                                      Instances For
                                                        Dependency graph
                                                        noncomputable def DescriptiveComplexity.ptSuccWideF {α : Type} (x p y q : α) :

                                                        (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
                                                              def DescriptiveComplexity.PPS {A : Type} (ρ : partitionGuessBlock.Assignment A) (b : Bool) (i : A) (u : A × A) :

                                                              The running total of the side b, read off an assignment of the block.

                                                              Equations
                                                              Instances For
                                                                Dependency graph
                                                                def DescriptiveComplexity.PCy {A : Type} (ρ : partitionGuessBlock.Assignment A) (b : Bool) (i : A) (u : A × A) :

                                                                The carries of the side b, read off an assignment of the block.

                                                                Equations
                                                                Instances For
                                                                  Dependency graph
                                                                  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
                                                                  Instances For
                                                                    Dependency graph
                                                                    theorem DescriptiveComplexity.pWt_iff {A : Type} [FirstOrder.Language.binWeights.Structure A] {i : A} {u : A × A} :
                                                                    PWt i u (∀ (y : A), BWLe u.1 y) BWBit i u.2
                                                                    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.

                                                                    Dependency graph