Documentation

CslibFrontier.Foundations.Combinatorics.SimpleGraph.TreeDecomposition.Nice

Nice tree decompositions #

A nice tree decomposition (SimpleGraph.NiceTreeDecomposition G) is a rooted binary tree decomposition whose root and leaves have empty bags and whose every internal node is of three types ([CFK+15]):

We model the syntax algebraically as SimpleGraph.NiceTree V, define its validity (NiceTree.LocalValid, NiceTree.CoversFinset) and conversion to SimpleGraph.RootedTreeDecomposition (NiceTree.toRootedTreeDecomposition), and prove that every finite clique lies in some bag (NiceTree.exists_coversFinset_of_isClique). Conversely, RootedTreeDecomposition.prune contracts redundant subset bags so that a finite vertex type leaves at most card V + 1 nodes without increasing width, and RootedTreeDecomposition.toNiceTree (computable when [LinearOrder V], with noncomputable [DecidableEq V] counterpart RootedTreeDecomposition.toNice) converts any finite rooted or unrooted tree decomposition into a NiceTreeDecomposition G with width at most the original width and at most (3 * width + 5) * (card V + 1) nodes.

Main definitions #

Main results #

References #

Nice tree decomposition syntax and invariants #

inductive SimpleGraph.NiceTree (V : Type uV) :
Type uV

Algebraic tree structure for a nice tree decomposition over vertex type V.

Instances For
    @[instance_reducible]
    def SimpleGraph.instDecidableEqNiceTree.decEq {V✝ : Type u_1} [DecidableEq V✝] (x✝ x✝¹ : NiceTree V✝) :
    Decidable (x✝ = x✝¹)
    @[instance_reducible]
    instance SimpleGraph.instReprNiceTree {V✝ : Type u_1} [Repr V✝] :
    Repr (NiceTree V✝)

    Total number of nodes minus one in a NiceTree.

    Total number of nodes in a NiceTree.

    @[simp]
    theorem SimpleGraph.NiceTree.size_introduce {V : Type uV} (v : V) (child : NiceTree V) :
    (introduce v child).size = child.size + 1
    @[simp]
    theorem SimpleGraph.NiceTree.size_forget {V : Type uV} (v : V) (child : NiceTree V) :
    (forget v child).size = child.size + 1
    @[simp]
    theorem SimpleGraph.NiceTree.size_join {V : Type uV} (left right : NiceTree V) :
    (left.join right).size = left.size + right.size + 1

    The bag of vertices associated with the root node of T.

    Maximum bag cardinality over all nodes in T.

    Width of a NiceTree: largest bag size minus one.

    Union of all bags occurring in the subtree T.

    Local nice-tree invariant at every node: introduce introduces a vertex not appearing anywhere in the child's subtree, forget removes a vertex present in the child bag, and join combines two children with identical bags whose forgotten subtrees are disjoint.

    Instances For
      @[instance_reducible]
      theorem SimpleGraph.NiceTree.disjoint_join_right {V : Type uV} [DecidableEq V] {left right : NiceTree V} (hbag : left.bag = right.bag) (hdisj : Disjoint (left.subtreeVerts \ left.bag) right.subtreeVerts) :

      Symmetry of the join subtree-separation condition.

      K is contained in at least one node's bag in T.

      theorem SimpleGraph.NiceTree.coversFinset_mono {V : Type uV} [DecidableEq V] {T : NiceTree V} {K₁ K₂ : Finset V} (hsub : K₁ ⊆ K₂) (h : CoversFinset K₂ T) :
      theorem SimpleGraph.NiceTree.exists_coversFinset_of_isClique {V : Type uV} {G : SimpleGraph V} [DecidableEq V] {T : NiceTree V} (hvalid : T.LocalValid) (hedge : ∀ ⦃u v : V⦄, G.Adj u v → u ∈ T.subtreeVerts → v ∈ T.subtreeVerts → CoversFinset {u, v} T) {K : Finset V} (hK : G.IsClique ↑K) (hsub : K ⊆ T.subtreeVerts) :

      Every finite clique contained in T.subtreeVerts lies in some bag of T whenever every edge of G inside T.subtreeVerts is covered.

      def SimpleGraph.NiceTree.map {α : Type u_1} {β : Type u_2} (f : α → β) :
      NiceTree α → NiceTree β

      Relabel the vertices of a NiceTree along f.

      @[simp]
      theorem SimpleGraph.NiceTree.sizePred_map {α : Type u_1} {β : Type u_2} (f : α → β) (T : NiceTree α) :
      @[simp]
      theorem SimpleGraph.NiceTree.size_map {α : Type u_1} {β : Type u_2} (f : α → β) (T : NiceTree α) :
      (map f T).size = T.size
      theorem SimpleGraph.NiceTree.bag_map {α : Type u_1} {β : Type u_2} {f : α → β} (hf : Function.Injective f) (T : NiceTree α) [DecidableEq α] [DecidableEq β] :
      theorem SimpleGraph.NiceTree.subtreeVerts_map {α : Type u_1} {β : Type u_2} (f : α → β) (T : NiceTree α) [DecidableEq α] [DecidableEq β] :
      theorem SimpleGraph.NiceTree.localValid_map {α : Type u_1} {β : Type u_2} {f : α → β} (hf : Function.Injective f) {T : NiceTree α} [DecidableEq α] [DecidableEq β] (h : T.LocalValid) :
      theorem SimpleGraph.NiceTree.maxBagCard_map {α : Type u_1} {β : Type u_2} {f : α → β} (hf : Function.Injective f) (T : NiceTree α) [DecidableEq α] [DecidableEq β] :
      theorem SimpleGraph.NiceTree.width_map {α : Type u_1} {β : Type u_2} {f : α → β} (hf : Function.Injective f) (T : NiceTree α) [DecidableEq α] [DecidableEq β] :
      (map f T).width = T.width
      theorem SimpleGraph.NiceTree.coversFinset_map {α : Type u_1} {β : Type u_2} {f : α → β} (hf : Function.Injective f) {T : NiceTree α} {K : Finset α} [DecidableEq α] [DecidableEq β] (h : CoversFinset K T) :

      Bundled nice tree decomposition #

      A nice tree decomposition of G: a valid NiceTree V with empty root bag that covers all vertices and edges of G.

      • tree : NiceTree V

        The underlying leaf/introduce/forget/join tree.

      • localValid : self.tree.LocalValid

        Local validity of introduce, forget, and join operations.

      • bag_root : self.tree.bag = ∅

        The root bag is empty.

      • exists_mem_bag (v : V) : v ∈ self.tree.subtreeVerts

        Every vertex appears in the tree.

      • exists_adj_mem_bag ⦃u v : V⦄ : G.Adj u v → NiceTree.CoversFinset {u, v} self.tree

        Every edge of G appears in some bag of the tree.

      Width of a nice tree decomposition: largest bag size minus one.

      Number of nodes in a nice tree decomposition.

      Every finite clique of G lies in some bag of N.

      Converting NiceTree to RootedTreeDecomposition #

      def SimpleGraph.NiceTree.toRootedTreeDecomposition {V : Type uV} [DecidableEq V] {G : SimpleGraph V} (T : NiceTree V) (hvalid : T.LocalValid) (hvert : ∀ (v : V), v ∈ T.subtreeVerts) (hedge : ∀ ⦃u v : V⦄, G.Adj u v → CoversFinset {u, v} T) :

      Convert a valid NiceTree covering all vertices and edges of G into a RootedTreeDecomposition with the same width and T.size nodes.

      theorem SimpleGraph.NiceTree.toRootedTreeDecomposition_width {V : Type uV} [DecidableEq V] {G : SimpleGraph V} (T : NiceTree V) (hvalid : T.LocalValid) (hvert : ∀ (v : V), v ∈ T.subtreeVerts) (hedge : ∀ ⦃u v : V⦄, G.Adj u v → CoversFinset {u, v} T) :
      (T.toRootedTreeDecomposition hvalid hvert hedge).width = T.width

      Convert a bundled nice tree decomposition into a RootedTreeDecomposition of the same width and N.size nodes.

      Pruning redundant subset bags (O(|V|) nodes) #

      def SimpleGraph.RootedTreeDecomposition.contractStep {V : Type uV} {G : SimpleGraph V} [DecidableEq V] {n : ℕ} (R : G.RootedTreeDecomposition (n + 1)) (c : Fin (n + 2)) (hc0 : c ≠ 0) (hsub : R.bag c ⊆ R.bag (R.parent c)) :

      Contract a nonroot node c whose bag is a subset of its parent's bag, reducing the node count by one without increasing the width.

      theorem SimpleGraph.RootedTreeDecomposition.contractStep_width_le {V : Type uV} {G : SimpleGraph V} [DecidableEq V] {n : ℕ} (R : G.RootedTreeDecomposition (n + 1)) (c : Fin (n + 2)) (hc0 : c ≠ 0) (hsub : R.bag c ⊆ R.bag (R.parent c)) :
      (R.contractStep c hc0 hsub).width ≤ R.width

      Iteratively contract all nonroot nodes whose bag is contained in their parent's bag.

      When the vertex type V is finite, pruning leaves at most card V + 1 nodes (m ≤ card V), since every nonroot node introduces at least one vertex whose topmost node it is.

      Converting RootedTreeDecomposition and TreeDecomposition to NiceTreeDecomposition #

      Wrap t in a chain of introduce nodes for each element of vs.

      Wrap t in a chain of forget nodes for each element of vs.

      Join a nonempty list of nice trees using binary join nodes.

      Convert a rooted tree decomposition into a nice tree decomposition using sorted bag lists (computable when [LinearOrder V]), without increasing width.

      Prune and convert a rooted tree decomposition into a nice tree decomposition with at most (3 * R.width + 5) * (card V + 1) nodes and width at most R.width.

      Convert any rooted tree decomposition into a nice tree decomposition without requiring a linear order on V.

      Every finite tree decomposition has a nice tree decomposition of width at most D.width and at most (3 * D.width + 5) * (card V + 1) nodes (when V is finite).