Documentation

CslibFrontier.Foundations.Combinatorics.SimpleGraph.TreeDecomposition.Rooted

Rooted tree decompositions #

A SimpleGraph.RootedTreeDecomposition G n is a tree decomposition whose nodes are Fin (n + 1) and whose tree is given by a parent array: parent 0 = 0 and parent i < i for i ≠ 0, so the root is 0 and every parent precedes its children. This is the input format of dynamic programming over tree decompositions: processing the nodes in decreasing order handles every child before its parent.

Instead of the connectivity condition, the structure asks that each vertex v have a unique topmost node: a node whose bag contains v and which is the root or whose parent's bag does not contain v. This condition is decidable for concrete data and is equivalent to connectivity (SimpleGraph.RootedTreeDecomposition.preconnected_bag and SimpleGraph.RootedTreeDecomposition.ofPreconnected).

Every finite tree decomposition can be rooted and renumbered into this form with the same bags, along a bijection of nodes that preserves tree adjacency (SimpleGraph.TreeDecomposition.exists_rooted). As an application, every finite clique lies in a single bag (SimpleGraph.TreeDecomposition.exists_subset_bag_of_isClique).

Main definitions #

Main results #

References #

structure SimpleGraph.RootedTreeDecomposition {V : Type uV} (G : SimpleGraph V) (n : ℕ) :
Type uV

A rooted tree decomposition of G on the nodes Fin (n + 1), given by a parent array with root 0 in which every parent precedes its children. Each vertex has a unique topmost node: a node whose bag contains it and which is the root or whose parent's bag does not contain it.

  • parent : Fin (n + 1) → Fin (n + 1)

    The parent of each node; the root 0 is its own parent.

  • parent_zero : self.parent 0 = 0

    The root is its own parent.

  • parent_lt (i : Fin (n + 1)) : i ≠ 0 → self.parent i < i

    Parents precede their children.

  • bag : Fin (n + 1) → Finset V

    The bag of vertices at each node.

  • exists_mem_bag (v : V) : ∃ (i : Fin (n + 1)), v ∈ self.bag i

    Every vertex lies in some bag.

  • exists_adj_mem_bag ⦃u v : V⦄ : G.Adj u v → ∃ (i : Fin (n + 1)), u ∈ self.bag i ∧ v ∈ self.bag i

    Both endpoints of every edge lie in a common bag.

  • top_unique (v : V) (i j : Fin (n + 1)) : v ∈ self.bag i → i = 0 ∨ v ∉ self.bag (self.parent i) → v ∈ self.bag j → j = 0 ∨ v ∉ self.bag (self.parent j) → i = j

    Each vertex has at most one topmost node.

def SimpleGraph.RootedTreeDecomposition.IsTop {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) (v : V) (i : Fin (n + 1)) :

i is a topmost node for v: its bag contains v, and it is the root or its parent's bag does not contain v.

theorem SimpleGraph.RootedTreeDecomposition.isTop_iff_mem {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) {v : V} {i : Fin (n + 1)} :
R.IsTop v i ↔ v ∈ R.bag i ∧ (i = 0 ∨ v ∉ R.bag (R.parent i))
theorem SimpleGraph.RootedTreeDecomposition.parent_iterate_antitone {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) (i : Fin (n + 1)) {a b : ℕ} (hab : a ≤ b) :
theorem SimpleGraph.RootedTreeDecomposition.exists_isTop_of_mem {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) {v : V} {i : Fin (n + 1)} (hi : v ∈ R.bag i) :
∃ (a : ℕ), R.IsTop v (R.parent^[a] i) ∧ ∀ b ≤ a, v ∈ R.bag (R.parent^[b] i)

Climbing from a node whose bag contains v reaches a topmost node for v through bags that all contain v.

theorem SimpleGraph.RootedTreeDecomposition.isTop_unique {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) {v : V} {i j : Fin (n + 1)} (hi : R.IsTop v i) (hj : R.IsTop v j) :
i = j
theorem SimpleGraph.RootedTreeDecomposition.exists_isTop {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) (v : V) :
∃ (i : Fin (n + 1)), R.IsTop v i
noncomputable def SimpleGraph.RootedTreeDecomposition.top {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) (v : V) :
Fin (n + 1)

The topmost node whose bag contains v.

theorem SimpleGraph.RootedTreeDecomposition.isTop_iff {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) {v : V} {i : Fin (n + 1)} :
R.IsTop v i ↔ i = R.top v
theorem SimpleGraph.RootedTreeDecomposition.exists_iterate_eq_top {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) {v : V} {s : Fin (n + 1)} (hs : v ∈ R.bag s) :
∃ (a : ℕ), R.parent^[a] s = R.top v
theorem SimpleGraph.RootedTreeDecomposition.top_le_of_mem {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) {v : V} {s : Fin (n + 1)} (hs : v ∈ R.bag s) :
R.top v ≤ s
theorem SimpleGraph.RootedTreeDecomposition.mem_bag_parent_iterate {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) {v : V} {s : Fin (n + 1)} (hs : v ∈ R.bag s) {a : ℕ} (ha : R.parent^[a] s = R.top v) {b : ℕ} (hb : b ≤ a) :
v ∈ R.bag (R.parent^[b] s)

Climbing from a node whose bag contains v, every bag up to the topmost node for v contains v.

theorem SimpleGraph.RootedTreeDecomposition.mem_bag_top_of_adj {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) {u w : V} (huw : G.Adj u w) (h : R.top w ≤ R.top u) :
w ∈ R.bag (R.top u)

If u and w are adjacent and the topmost node for w is numbered no later than the topmost node for u, then the bag at the topmost node for u contains w.

theorem SimpleGraph.RootedTreeDecomposition.exists_subset_bag_of_isClique {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) {K : Finset V} (hK : G.IsClique ↑K) :
∃ (i : Fin (n + 1)), K ⊆ R.bag i

Every finite clique lies in some bag of a rooted tree decomposition: the topmost node of the clique vertex whose topmost node is numbered last.

The index tree of a rooted tree decomposition.

theorem SimpleGraph.RootedTreeDecomposition.reachable_top {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) {v : V} {i : Fin (n + 1)} (hi : v ∈ R.bag i) :
(induce {j : Fin (n + 1) | v ∈ R.bag j} R.tree).Reachable ⟨i, hi⟩ ⟨R.top v, ⋯⟩

The nodes whose bags contain a given vertex induce a connected subtree.

The tree decomposition underlying a rooted tree decomposition.

def SimpleGraph.RootedTreeDecomposition.ofPreconnected {V : Type uV} {G : SimpleGraph V} {n : ℕ} (parent : Fin (n + 1) → Fin (n + 1)) (parent_zero : parent 0 = 0) (parent_lt : ∀ (i : Fin (n + 1)), i ≠ 0 → parent i < i) (bag : Fin (n + 1) → Finset V) (exists_mem_bag : ∀ (v : V), ∃ (i : Fin (n + 1)), v ∈ bag i) (exists_adj_mem_bag : ∀ ⦃u v : V⦄, G.Adj u v → ∃ (i : Fin (n + 1)), u ∈ bag i ∧ v ∈ bag i) (preconnected_bag : ∀ (v : V), (induce {i : Fin (n + 1) | v ∈ bag i} (parentTree parent)).Preconnected) :

Build a rooted tree decomposition from the connectivity condition of tree decompositions in place of the uniqueness of topmost nodes.

The width of a rooted tree decomposition: the largest bag size minus one.

theorem SimpleGraph.RootedTreeDecomposition.width_le_iff {V : Type uV} {G : SimpleGraph V} {n : ℕ} (R : G.RootedTreeDecomposition n) {k : ℕ} :
R.width ≤ k ↔ ∀ (i : Fin (n + 1)), (R.bag i).card ≤ k + 1

In every nonempty finite vertex set S some vertex u has at most width neighbours in S: u and its neighbours in S all lie in one bag. Take u ∈ S whose topmost node is numbered last.

Rooting a tree decomposition #

theorem SimpleGraph.TreeDecomposition.exists_rooted {V : Type uV} {ι : Type uι} {G : SimpleGraph V} [Finite ι] (D : G.TreeDecomposition ι) :
∃ (n : ℕ) (R : G.RootedTreeDecomposition n) (e : Fin (n + 1) ≃ ι), (∀ (i : Fin (n + 1)), R.bag i = D.bag (e i)) ∧ ∀ (i j : Fin (n + 1)), R.tree.Adj i j ↔ D.tree.Adj (e i) (e j)

Every tree decomposition with finitely many nodes can be rooted and renumbered: there is a rooted tree decomposition with the same bags whose parent-array tree corresponds to the index tree along a bijection of nodes.

theorem SimpleGraph.TreeDecomposition.exists_rooted_width_eq {V : Type uV} {ι : Type uι} {G : SimpleGraph V} [Fintype ι] (D : G.TreeDecomposition ι) :
∃ (n : ℕ) (R : G.RootedTreeDecomposition n), R.width = D.width

Every tree decomposition with finitely many nodes has a rooted one of the same width.

theorem SimpleGraph.TreeDecomposition.exists_subset_bag_of_isClique {V : Type uV} {ι : Type uι} {G : SimpleGraph V} [Finite ι] (D : G.TreeDecomposition ι) {K : Finset V} (hK : G.IsClique ↑K) :
∃ (t : ι), K ⊆ D.bag t

Every finite clique lies in a single bag of a tree decomposition with finitely many nodes.

theorem SimpleGraph.TreeDecomposition.exists_card_filter_adj_le_width {V : Type uV} {ι : Type uι} {G : SimpleGraph V} [Fintype ι] [DecidableRel G.Adj] (D : G.TreeDecomposition ι) {S : Finset V} (hS : S.Nonempty) :
∃ u ∈ S, (Finset.filter (G.Adj u) S).card ≤ D.width

In every nonempty finite vertex set S some vertex has at most width neighbours in S.

theorem SimpleGraph.TreeDecomposition.card_le_width_add_one_of_isClique {V : Type uV} {ι : Type uι} {G : SimpleGraph V} [Fintype ι] (D : G.TreeDecomposition ι) {K : Finset V} (hK : G.IsClique ↑K) :
K.card ≤ D.width + 1

A tree decomposition has width at least the size of any finite clique minus one.

A graph on a finite vertex type has treewidth at most k if and only if it has a rooted tree decomposition of width at most k.