Documentation

DescriptiveComplexity.Problems.Steiner.Defs

Steiner Tree: definitions #

STEINER TREE (Karp 1972) in its node-weighted form with unit weights: given a graph, a set of terminals and a threshold k, is there a connected set of vertices containing every terminal and using at most k non-terminals? The vocabulary FirstOrder.Language.steinerGraph is that of graphs with two unary marks – the terminals, and the marked set carrying k in the unary representation of DescriptiveComplexity.Numbers.Unary.

Karp's original problem weights edges and bounds the total weight; on a tree the two readings differ by one (#edges = #vertices - 1), so the reduction below would carry over, but the bridge between them needs the fact that a connected graph has at least n - 1 edges. Mathlib has it only for trees on a whole vertex type (SimpleGraph.IsTree.card_edgeFinset), so the edge-weighted version waits for that glue; the node-weighted version is the standard variant and is what this file formalizes.

Connectivity, and its first-order certificate #

Connectivity (DescriptiveComplexity.ConnectedOn) is stated with Relation.ReflTransGen over the symmetric restriction of adjacency to the chosen set, so it is the usual undirected notion and is not first-order. As for acyclicity in DescriptiveComplexity.Problems.Feedback, what saves the membership proof is a certificate: a root of the chosen set together with a strict partial order in which every other chosen vertex has a chosen neighbour strictly below it (DescriptiveComplexity.connectedOn_iff_exists_root_order). Walking down that order reaches the root, and the root joins any two vertices.

Producing the certificate from connectivity is the direction with content: it needs a distance, which Relation.ReflTransGen does not carry. The DescriptiveComplexity.reachIn staging below supplies it – reachability in at most n steps, with Nat.find picking the least such n – and that is the whole of the extra machinery. It is stated for an arbitrary relation, so the Hamilton problems and the edge-weighted Steiner tree can reuse it.

Relation symbols of the language of graphs with terminals.

Instances For
    Dependency graph
    Dependency graph
    Dependency graph

    The relational language of graphs with terminals: adjacency, a set of terminals to be spanned, and a marked set whose cardinality is the budget of non-terminals.

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

      The adjacency symbol of terminal-marked graphs.

      Equations
      Instances For
        Dependency graph
        @[reducible, inline]

        The terminal symbol of terminal-marked graphs.

        Equations
        Instances For
          Dependency graph
          @[reducible, inline]

          The mark symbol of terminal-marked graphs.

          Equations
          Instances For
            Dependency graph

            Connectivity and its certificate #

            def DescriptiveComplexity.ConnectedOn {A : Type} (Adjp : AAProp) (S : AProp) :

            A set of vertices is connected if any two of its members are joined by a path inside it.

            Equations
            Instances For
              Dependency graph

              Reachability in a bounded number of steps #

              Relation.ReflTransGen carries no length, and the certificate needs one: the order it guesses is “distance to the root”.

              def DescriptiveComplexity.reachIn {A : Type} (R : AAProp) :
              AAProp

              Reachability in at most n steps.

              Equations
              Instances For
                Dependency graph
                theorem DescriptiveComplexity.reflTransGen_iff_exists_reachIn {A : Type} (R : AAProp) (x y : A) :
                Relation.ReflTransGen R x y ∃ (n : ), reachIn R n x y

                Reachability is reachability in some bounded number of steps.

                Dependency graph
                theorem DescriptiveComplexity.reflTransGen_symm {A : Type} {R : AAProp} (hsymm : ∀ (a b : A), R a bR b a) {x y : A} (h : Relation.ReflTransGen R x y) :

                The reflexive-transitive closure of a symmetric relation is symmetric.

                Dependency graph

                The certificate #

                theorem DescriptiveComplexity.connectedOn_iff_exists_root_order {A : Type} [Finite A] (Adjp : AAProp) (S : AProp) :
                ConnectedOn Adjp S ∀ (r : A), S r∃ (Lt : AAProp), (∀ (x y z : A), Lt x yLt y zLt x z) (∀ (x : A), ¬Lt x x) ∀ (x : A), S xx r∃ (y : A), Link Adjp S x y Lt y x

                Connectivity is first-order certifiable: a set is connected exactly when, from any of its members chosen as root, some strict partial order makes every other member have a neighbour strictly below it. Walking down the order reaches the root, and the root joins any two members.

                Dependency graph
                theorem DescriptiveComplexity.connectedOn_iff_exists_root {A : Type} [Finite A] (Adjp : AAProp) (S : AProp) :
                ConnectedOn Adjp S ∃ (Rt : AProp), (∀ (x : A), Rt xS x) (∀ (x y : A), Rt xRt yx = y) ∃ (Lt : AAProp), (∀ (x y z : A), Lt x yLt y zLt x z) (∀ (x : A), ¬Lt x x) ∀ (x : A), S x¬Rt x∃ (y : A), Link Adjp S x y Lt y x

                The existential form of the certificate, the one a Σ₁ definition guesses: a root relation (constrained to hold of at most one element of the set) together with the order. The empty set is connected and has no root, which is why the root is guessed as a relation rather than an element.

                Dependency graph
                theorem DescriptiveComplexity.ConnectedOn.of_equiv {A B : Type} (u : B A) {AdjB : BBProp} {SB : BProp} {AdjA : AAProp} {SA : AProp} (hadj : ∀ (b b' : B), AdjB b b' AdjA (u b) (u b')) (hS : ∀ (b : B), SB b SA (u b)) (h : ConnectedOn AdjB SB) :
                ConnectedOn AdjA SA

                ConnectedOn transports along an equivalence commuting with the adjacency relations and the chosen sets.

                Dependency graph

                Connectivity costs edges #

                The certificate gives each non-root member of a connected set a parent edge, and that assignment is injective: two members sharing an edge would have to be each other's parent, hence strictly below each other. This is the n - 1 edge bound for connected graphs, in the form the edge-weighted Steiner tree needs, and it is proved from the certificate rather than from a spanning tree.

                theorem DescriptiveComplexity.ncard_le_ncard_of_connected {A : Type} [Finite A] {T : AAProp} {S : AProp} {r : A} (hr : S r) (hconn : ConnectedOn T S) :
                {x : A | S x x r}.ncard {p : A × A | T p.1 p.2}.ncard

                A connected set costs edges: a set connected through T has at most one more element than T has pairs.

                Dependency graph

                The problem #

                def DescriptiveComplexity.SteinerOn {A : Type} (Adjp : AAProp) (Term Kp : AProp) :

                Some connected set contains every terminal and uses at most as many non-terminals as the number encoded by the marked set.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Dependency graph
                  theorem DescriptiveComplexity.steinerOn_iff_certificate {A : Type} [Finite A] (Adjp : AAProp) (Term Kp : AProp) :
                  SteinerOn Adjp Term Kp ∃ (S : AProp), (∀ (x : A), Term xS x) (∃ (Rt : AProp), (∀ (x : A), Rt xS x) (∀ (x y : A), Rt xRt yx = y) ∃ (Lt : AAProp), (∀ (x y z : A), Lt x yLt y zLt x z) (∀ (x : A), ¬Lt x x) ∀ (x : A), S x¬Rt x∃ (y : A), Link Adjp S x y Lt y x) Nonempty ({ x : A // S x ¬Term x } { x : A // Kp x })

                  The certified form, with connectivity witnessed by a root and an order and the threshold by an injection: the shape the second-order definition guesses.

                  Dependency graph
                  def DescriptiveComplexity.SteinerEdgeOn {A : Type} (Adjp : AAProp) (Term Kp : AProp) :

                  Some set of edges of the graph, connecting a set that contains every terminal, is at most as large as the number encoded by the marked set: the edge-weighted Steiner tree with unit weights, Karp's original reading.

                  The chosen edges are given as a set of ordered pairs, one per edge, and connectivity reads them symmetrically (DescriptiveComplexity.ConnectedOn); a witness listing both orientations of an edge merely pays for it twice, so the yes-instances are unaffected. The threshold compares a count of pairs with a count of elements, which is meaningful because a threshold is just a number – and necessary here, since an edge set can be quadratically larger than the universe.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Dependency graph
                    theorem DescriptiveComplexity.steinerEdgeOn_iff_certificate {A : Type} [Finite A] (Adjp : AAProp) (Term Kp : AProp) :
                    SteinerEdgeOn Adjp Term Kp ∃ (T : AAProp) (S : AProp), (∀ (a b : A), T a bAdjp a b) (∀ (x : A), Term xS x) (∃ (Rt : AProp), (∀ (x : A), Rt xS x) (∀ (x y : A), Rt xRt yx = y) ∃ (Lt : AAProp), (∀ (x y z : A), Lt x yLt y zLt x z) (∀ (x : A), ¬Lt x x) ∀ (x : A), S x¬Rt x∃ (y : A), Link T S x y Lt y x) Nonempty ({ p : A × A // T p.1 p.2 } { x : A // Kp x })

                    The certified form of the edge-weighted problem.

                    Dependency graph
                    theorem DescriptiveComplexity.SteinerOn.of_equiv {A B : Type} (u : B A) {AdjB : BBProp} {TermB KB : BProp} {AdjA : AAProp} {TermA KA : AProp} (hadj : ∀ (b b' : B), AdjB b b' AdjA (u b) (u b')) (hterm : ∀ (b : B), TermB b TermA (u b)) (hK : ∀ (b : B), KB b KA (u b)) (h : SteinerOn AdjB TermB KB) :
                    SteinerOn AdjA TermA KA

                    SteinerOn transports along an equivalence commuting with the three predicates.

                    Dependency graph
                    theorem DescriptiveComplexity.SteinerOn.equiv_iff {A B : Type} (u : B A) {AdjB : BBProp} {TermB KB : BProp} {AdjA : AAProp} {TermA KA : AProp} (hadj : ∀ (b b' : B), AdjB b b' AdjA (u b) (u b')) (hterm : ∀ (b : B), TermB b TermA (u b)) (hK : ∀ (b : B), KB b KA (u b)) :
                    SteinerOn AdjB TermB KB SteinerOn AdjA TermA KA

                    SteinerOn transports along an equivalence, iff version.

                    Dependency graph
                    theorem DescriptiveComplexity.SteinerEdgeOn.of_equiv {B A : Type} (u : B A) {AdjB : BBProp} {TermB KB : BProp} {AdjA : AAProp} {TermA KA : AProp} (hadj : ∀ (b b' : B), AdjB b b' AdjA (u b) (u b')) (hterm : ∀ (b : B), TermB b TermA (u b)) (hK : ∀ (b : B), KB b KA (u b)) (h : SteinerEdgeOn AdjB TermB KB) :
                    SteinerEdgeOn AdjA TermA KA

                    SteinerEdgeOn transports along an equivalence commuting with the three predicates.

                    Dependency graph
                    theorem DescriptiveComplexity.SteinerEdgeOn.equiv_iff {B A : Type} (u : B A) {AdjB : BBProp} {TermB KB : BProp} {AdjA : AAProp} {TermA KA : AProp} (hadj : ∀ (b b' : B), AdjB b b' AdjA (u b) (u b')) (hterm : ∀ (b : B), TermB b TermA (u b)) (hK : ∀ (b : B), KB b KA (u b)) :
                    SteinerEdgeOn AdjB TermB KB SteinerEdgeOn AdjA TermA KA

                    SteinerEdgeOn transports along an equivalence, iff version.

                    Dependency graph
                    Dependency graph
                    Dependency graph
                    Dependency graph

                    A graph with terminals admits a connected set spanning the terminals and using at most as many non-terminals as its marked set has elements. (Finiteness of the universe is part of the property: cardinality thresholds are only meaningful on finite structures.)

                    Equations
                    Instances For
                      Dependency graph
                      Dependency graph

                      A graph with terminals admits a set of edges connecting its terminals, of size at most the number encoded by the marked set.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Dependency graph
                        Dependency graph

                        STEINER TREE (edge-weighted, unit weights) – Karp's original reading – as a problem on graphs with terminals: is there a set of at most k edges connecting all the terminals?

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          Dependency graph

                          STEINER TREE (node-weighted, unit weights), as a problem on graphs with terminals: is there a connected set of vertices containing every terminal and using at most as many non-terminals as the marked set has elements?

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            Dependency graph