Paper
Graphs of twin-width at most 2 have bounded mim-width
23 pages · 24 marked passages · pdflatex · download PDF · lax-528502
-
Twin-width at most 2 implies mim-width at most 8
Every graph of twin-width at most admits a branch decomposition of mim-width at most . Given a witnessing -sequence, one can construct such a decomposition in polynomial time (Theorem 1.1).
- thm✓
Lax528502.MimWidthBound(1st statement) - thm✓
Lax528502.MimWidthBound(2nd statement) - thm✓
Lax528502.MimWidthBound(3rd statement)
1 import Lax528502.DecompositionAlgorithms 2 … module docstring, 9 lines 12 13 namespace Lax528502.MimWidthBound 14 15 open DecompositionAlgorithms Lax228581.TwinWidth 16 17 variable {V : Type} [Fintype V] [DecidableEq V] 18 19 /-- Every graph of twin-width at most 2 admits a branch decomposition of mim-width at most 8. -/ 20 axiom exists_branchDecomposition (G : SimpleGraph V) (h : HasTwinWidthAtMost G 2) : 21 ∃ T, MimWidth.IsBranchDecompositionOfWidthAtMost G T 8 22 23 /-- Every graph of twin-width at most 2 has mim-width at most 8. -/ 24 axiom mimWidth_le_eight (G : SimpleGraph V) (h : HasTwinWidthAtMost G 2) : 25 MimWidth.mimWidth G ≤ 8 26 27 /-- Given a 2-sequence, find a branch decomposition of mim-width at most 8 in polynomial time. -/ 28 axiom construct : 29 ∃ algorithm : PolynomialTimeAlgorithm, ∀ I : GraphWithTwoSequence, 30 ∃ T, MimWidth.IsBranchDecompositionOfWidthAtMost I.graph T 8 ∧ 31 algorithm.OutputsBranchDecomposition I T 32 33 end Lax528502.MimWidthBound 34 - thm✓
-
Maximum induced matching width
For a vertex set , keep only the edges crossing from to its complement. The cut value is the maximum size of an induced matching in this bipartite graph. Adjacencies between two endpoints on the same side play no role.
Rooting a subcubic branch decomposition at an edge gives a binary tree whose leaves are the vertices of the graph. Its width is the largest cut value below a node. The mim-width of the graph is the minimum of these widths. The empty graph has width .
1 import Lax183560.BranchDecompositions 2 import Mathlib.Data.Finset.Lattice.Fold 3 import Mathlib.Data.Finset.Prod 4 import Mathlib.Data.Fintype.Powerset 5 … module docstring, 14 lines 20 21 namespace Lax528502.MimWidth 22 23 open Lax183560 24 25 variable {V : Type} [Fintype V] [DecidableEq V] 26 27 /-- Pairs are oriented from the cut side to its complement. Between the two 28 endpoint sets, the only edges are the matching pairs themselves. -/ 29 structure InducedMatching (G : SimpleGraph V) (X : Finset V) (M : Finset (V × V)) : Prop where 30 sides : ∀ e ∈ M, e.1 ∈ X ∧ e.2 ∉ X 31 induced : ∀ e ∈ M, ∀ f ∈ M, G.Adj e.1 f.2 ↔ e = f 32 33 /-- The largest induced matching across a cut. -/ 34 noncomputable def cutMim (G : SimpleGraph V) (X : Finset V) : ℕ := by 35 classical 36 exact (Finset.univ.filter (InducedMatching G X)).sup Finset.card 37 38 /-- A branch decomposition of width at most the specified bound. The empty 39 tree is available precisely when the vertex type is empty. -/ 40 def Decomposes (G : SimpleGraph V) (k : ℕ) : Option (BranchDecompositions.BinaryTree V) → Prop 41 | none => IsEmpty V 42 | some T => T.Valid Finset.univ ∧ T.cutWidth (cutMim G) ≤ k 43 44 /-- The leaves of the branch tree are the vertices of G and every cut has 45 mim-width at most the stated bound. The empty graph has an empty tree. -/ 46 abbrev IsBranchDecompositionOfWidthAtMost (G : SimpleGraph V) (T : Option (BranchDecompositions.BinaryTree V)) 47 (widthAtMost : ℕ) : Prop := Decomposes G widthAtMost T 48 49 /-- The minimum width of a branch decomposition. -/ 50 noncomputable def mimWidth (G : SimpleGraph V) : ℕ := 51 sInf {k | ∃ T, Decomposes G k T} 52 53 /-- Prefix notation for a branch tree. A fork is 0 and a leaf is its 54 vertex number plus 1. -/ 55 def treeWord {n : ℕ} (order : Fin n ≃ V) : BranchDecompositions.BinaryTree V → List ℕ 56 | .leaf v => [(order.symm v).val + 1] 57 | .fork l r => 0 :: treeWord order l ++ treeWord order r 58 59 /-- The empty list represents the empty decomposition. -/ 60 def encode {n : ℕ} (order : Fin n ≃ V) (T : Option (BranchDecompositions.BinaryTree V)) : List ℕ := 61 T.elim [] (treeWord order) 62 63 end Lax528502.MimWidth 64 -
Twin-width
A partition sequence of a finite simple graph G is a sequence of partitions of its vertex set that starts at the partition into singletons, merges two parts into one at every step, and ends at the partition with a single part. Two parts of a same partition are homogeneous if either every pair of vertices across them is adjacent or none is; two non-homogeneous parts are red-adjacent. The red degree of a part is the number of other parts of its partition that are red-adjacent to it.
The twin-width of G is the least d such that G has a partition sequence in which every part of every partition has red degree at most d.
1 import Mathlib.Combinatorics.SimpleGraph.Basic 2 import Mathlib.Data.Set.Card 3 import Mathlib.Data.Nat.Lattice 4 … module docstring, 25 lines 30 31 namespace Lax228581.TwinWidth 32 33 /-- Two vertex sets are homogeneous in `G`: either every pair of vertices 34 across them is adjacent, or none is. -/ 35 def Homogeneous {V : Type} (G : SimpleGraph V) (A B : Finset V) : Prop := 36 (∀ a ∈ A, ∀ b ∈ B, G.Adj a b) ∨ (∀ a ∈ A, ∀ b ∈ B, ¬ G.Adj a b) 37 38 /-- The red degree of a part `A` in a family of parts `P`: the number of 39 other parts of `P` that are not homogeneous with `A`. -/ 40 noncomputable def redDegree {V : Type} (G : SimpleGraph V) 41 (P : Finset (Finset V)) (A : Finset V) : ℕ := 42 {B | B ∈ P ∧ B ≠ A ∧ ¬ Homogeneous G A B}.ncard 43 44 /-- The partition of a finite vertex type into singletons. -/ 45 def singletonPartition (V : Type) [Fintype V] [DecidableEq V] : 46 Finset (Finset V) := 47 Finset.univ.image fun v : V => ({v} : Finset V) 48 49 /-- A partition sequence of `G` in which every part has red degree at most 50 `d`: starting from the singleton partition, each step merges two parts into 51 one, until a single part remains. -/ 52 structure PartitionSequence {V : Type} [Fintype V] [DecidableEq V] 53 (G : SimpleGraph V) (d : ℕ) where 54 /-- The number of merge steps. -/ 55 stepCount : ℕ 56 /-- The partition after each number of merge steps. -/ 57 partition : ℕ → Finset (Finset V) 58 /-- The sequence starts at the singleton partition. -/ 59 starts : partition 0 = singletonPartition V 60 /-- The sequence ends with a single part. -/ 61 ends : (partition stepCount).card ≤ 1 62 /-- Each step merges two distinct parts into one and keeps all other 63 parts. -/ 64 step_merges : 65 ∀ i, i < stepCount → ∃ A ∈ partition i, ∃ B ∈ partition i, A ≠ B ∧ 66 partition (i + 1) = insert (A ∪ B) (((partition i).erase A).erase B) 67 /-- Every part of every partition in the sequence has red degree at most 68 `d`. -/ 69 redDegree_le : 70 ∀ i, i ≤ stepCount → ∀ ⦃A⦄, A ∈ partition i → 71 redDegree G (partition i) A ≤ d 72 73 /-- `G` has a partition sequence in which every part has red degree at most 74 `d`. -/ 75 def HasTwinWidthAtMost {V : Type} [Fintype V] [DecidableEq V] 76 (G : SimpleGraph V) (d : ℕ) : Prop := 77 Nonempty (PartitionSequence G d) 78 79 /-- The twin-width of a finite simple graph: the least `d` such that the 80 graph has a partition sequence in which every part has red degree at most 81 `d`. -/ 82 noncomputable def twinWidth {V : Type} [Fintype V] [DecidableEq V] 83 (G : SimpleGraph V) : ℕ := 84 sInf {d | HasTwinWidthAtMost G d} 85 86 end Lax228581.TwinWidth 87 -
no assumptions
A crossing induced matching of size 2 cannot be contracted from singletons to one part on each side. At the first merger uniting its two rows or its two columns the resulting part would have two different red neighbors.
-
Fringes and auxiliary partitions
In a red path select the edges between two degree-2 parts. In a red cycle of length at least 5 select every edge. Starting at a selected edge , trace its unique red lift backwards until there is no lift, or an endpoint of the lift has red degree 1. The fringe is empty in the first case and is that endpoint in the second. Move the vertices of a fringe to the opposite part of the selected edge.
Delete the selected edges from the red graph and group vertices according to the component containing their receiving part. Every nonempty auxiliary part has its cut covered by at most 4 chain subgraphs (Lemma 3.5).
1 import Lax528502.ChainCuts 2 import Lax228581.TwinWidth 3 … module docstring, 16 lines 20 21 namespace Lax528502.Fringes 22 23 open Lax228581.TwinWidth 24 25 variable {V : Type} [Fintype V] [DecidableEq V] (G : SimpleGraph V) 26 27 /-- The bipartite graph between two distinct parts of a 1-sequence is a chain graph. -/ 28 axiom one_sequence (S : PartitionSequence G 1) (i : ℕ) (hi : i ≤ S.stepCount) 29 (X Y : Finset V) (hX : X ∈ S.partition i) (hY : Y ∈ S.partition i) (hne : X ≠ Y) : 30 ChainCuts.ChainOn G X Y 31 32 /-- Red adjacency at a partition. -/ 33 def Red (P : Finset (Finset V)) (A B : Finset V) : Prop := 34 A ∈ P ∧ B ∈ P ∧ A ≠ B ∧ ¬ Homogeneous G A B 35 36 /-- The two other red neighbors are distinct and nonadjacent precisely in 37 the path and long-cycle cases of a red graph of maximum degree 2. -/ 38 def Selected (P : Finset (Finset V)) (B C : Finset V) : Prop := 39 Red G P B C ∧ ∃ A D, Red G P A B ∧ Red G P C D ∧ 40 A ≠ C ∧ B ≠ D ∧ A ≠ D ∧ ¬ Red G P A D 41 42 /-- Red edges between earlier parts contained in the two current parts. -/ 43 noncomputable def lifts (P : Finset (Finset V)) (B C : Finset V) : Finset (Finset V × Finset V) := by 44 classical 45 exact (P ×ˢ P).filter fun e => e.1 ⊆ B ∧ e.2 ⊆ C ∧ Red G P e.1 e.2 46 47 def Continues (P : Finset (Finset V)) (B C : Finset V) : Prop := 48 ∃ e, lifts G P B C = {e} ∧ redDegree G P e.1 = 2 ∧ redDegree G P e.2 = 2 49 50 /-- The last earlier partition where tracing the unique degree-2 edge stops. 51 At that partition collect the endpoints of red degree 1. -/ 52 noncomputable def fringe (S : PartitionSequence G 2) (i : ℕ) (B C : Finset V) : Finset V := by 53 classical 54 let stops := (Finset.range i).filter fun j => ¬ Continues G (S.partition j) B C 55 exact if hs : stops.Nonempty then 56 let P := S.partition (stops.max' hs) 57 (lifts G P B C).biUnion fun e => 58 (if redDegree G P e.1 = 1 then e.1 else ∅) ∪ (if redDegree G P e.2 = 1 then e.2 else ∅) 59 else ∅ 60 61 /-- Each vertex is moved at most once, from the part containing it. -/ 62 def Receives (S : PartitionSequence G 2) (i : ℕ) (v : V) (Q : Finset V) : Prop := 63 ∃ P ∈ S.partition i, v ∈ P ∧ 64 ((Selected G (S.partition i) P Q ∧ v ∈ fringe G S i P Q) ∨ 65 (Q = P ∧ ¬ ∃ R, Selected G (S.partition i) P R ∧ v ∈ fringe G S i P R)) 66 67 /-- Group the receivers by red connectivity after deleting selected edges. -/ 68 noncomputable def auxiliary (S : PartitionSequence G 2) (i : ℕ) : Finset (Finset V) := by 69 classical 70 let P := S.partition i 71 let remaining := fun A B => Red G P A B ∧ ¬ Selected G P A B 72 let part := fun R => Finset.univ.filter fun v => 73 ∃ Q, Receives G S i v Q ∧ Relation.ReflTransGen remaining Q R 74 exact (P.image part).erase ∅ 75 76 /-- Every cut used in the auxiliary partitions has a cover by 4 chains. -/ 77 axiom four_chains (S : PartitionSequence G 2) (i : ℕ) (hi : i ≤ S.stepCount) 78 (X : Finset V) (hX : X ∈ auxiliary G S i) : Nonempty (ChainCuts.Cover G X 4) 79 80 end Lax528502.Fringes 81 -
Covers of a cut by chain graphs
A chain subgraph of a cut has nested neighborhoods on one side. If chain subgraphs cover all crossing edges, any induced matching across the cut has size at most .
For the tree-independence bound, put . Let consist of the vertices outside with an independent set of more than neighbors in . Let consist of the vertices in adjacent to an outside vertex outside . The two sets cover the cut. When excludes an induced , their independence numbers are at most and , respectively (Lemma 4.2).
1 import Lax528502.MimWidth 2 import Lax528502.TreeIndependence 3 … module docstring, 16 lines 20 21 namespace Lax528502.ChainCuts 22 23 variable {V : Type} [Fintype V] [DecidableEq V] 24 25 /-- The neighborhoods of vertices of Y in X are linearly ordered by inclusion. -/ 26 def ChainOn (G : SimpleGraph V) (X Y : Finset V) : Prop := 27 ∀ y ∈ Y, ∀ z ∈ Y, 28 (∀ x ∈ X, G.Adj x y → G.Adj x z) ∨ (∀ x ∈ X, G.Adj x z → G.Adj x y) 29 30 /-- For each chain and outside vertex, specify its neighbors on the inside. -/ 31 structure Cover (G : SimpleGraph V) (X : Finset V) (r : ℕ) where 32 neighbors : Fin r → V → Finset V 33 sound : ∀ j v u, u ∈ neighbors j v → u ∈ X ∧ v ∉ X ∧ G.Adj u v 34 nested : ∀ j v w, neighbors j v ⊆ neighbors j w ∨ neighbors j w ⊆ neighbors j v 35 covers : ∀ u ∈ X, ∀ v ∉ X, G.Adj u v → ∃ j, u ∈ neighbors j v 36 37 /-- A cut covered by r chain graphs has induced matching number at most r. -/ 38 axiom cutMim_le {G : SimpleGraph V} {X : Finset V} {r : ℕ} 39 (C : Cover G X r) : MimWidth.cutMim G X ≤ r 40 41 /-- The outside vertices with a large independent set of neighbors inside. -/ 42 noncomputable def heavy (G : SimpleGraph V) (X : Finset V) (k : ℕ) : Finset V := by 43 classical 44 exact Xᶜ.filter fun v => ∃ A ⊆ X, G.IsIndepSet (A : Set V) ∧ k < A.card ∧ ∀ a ∈ A, G.Adj a v 45 46 /-- Inside endpoints of cut edges with an outside endpoint outside H. -/ 47 noncomputable def inside (G : SimpleGraph V) (X : Finset V) (k : ℕ) : Finset V := by 48 classical 49 exact X.filter fun u => ∃ v ∉ X, v ∉ heavy G X k ∧ G.Adj u v 50 51 /-- The independence bounds for the two sides of the cut cover. -/ 52 axiom independence_bounds {G : SimpleGraph V} {X : Finset V} {r t : ℕ} 53 (C : Cover G X r) (ht : 2 ≤ t) (hfree : TreeIndependence.InducedBicliqueFree G t) : 54 let K := r * (t - 1) 55 (∀ A ⊆ heavy G X K, G.IsIndepSet (A : Set V) → A.card ≤ K) ∧ 56 (∀ A ⊆ inside G X K, G.IsIndepSet (A : Set V) → A.card ≤ r * K) 57 58 end Lax528502.ChainCuts 59 -
no assumptions
Each closed red component contributes one complete bipartite graph per part. At a component incident with a selected edge, each of the central part's two neighbors contributes one chain of core edges and one biclique for the fringe or the endpoint. Together they cover every crossing graph edge.
-
no assumptions
Represent an old component by a part in it, taking the neighbor when the part is a red leaf. Every old receiver moves to the new component of the representative's parent. All representatives of one component agree there.
-
no assumptions
Every old child has a representative whose parent lies in the new residual component. Such a component has at most 4 parts, and only the merged part has two preimages. Partition refinement gives the union equality.
-
The auxiliary tree of a 2-sequence
Move each fringe of a red edge to the neighboring part, then group the parts in the red components left after deleting the selected edges. The resulting partitions refine one another. Suppressing repetitions gives a rooted tree. Its internal nodes have between 2 and 5 children. Every cut below a node is covered by at most 4 chain subgraphs (Lemmas 3.5, 3.7, 3.9, and 3.10).
In the prefix encoding, an original fork has tag and a fork added to write a node with more than 2 children has tag . A leaf with vertex number is written as . Contracting the added forks recovers the auxiliary tree.
1 import Lax528502.ChainCuts 2 import Lax759944.RamPolytime 3 … module docstring, 16 lines 20 21 namespace Lax528502.AuxiliaryTree 22 23 open Lax183560 Lax228581.TwinWidth Lax759944.RamPolytime 24 25 inductive Tree (V : Type) 26 | leaf (v : V) 27 | two (a b : Tree V) 28 | three (a b c : Tree V) 29 | four (a b c d : Tree V) 30 | five (a b c d e : Tree V) 31 32 variable {V : Type} 33 34 open BranchDecompositions.BinaryTree in 35 /-- Resolve every node into binary forks. At a node with 5 children, the 36 parent edge and the first child form one of the 3 pairs of incident edges. -/ 37 def Tree.refine : Tree V → BranchDecompositions.BinaryTree V 38 | .leaf v => .leaf v 39 | .two a b => fork a.refine b.refine 40 | .three a b c => fork a.refine (fork b.refine c.refine) 41 | .four a b c d => fork (fork a.refine b.refine) (fork c.refine d.refine) 42 | .five a b c d e => fork a.refine (fork (fork b.refine c.refine) (fork d.refine e.refine)) 43 44 /-- The vertices below the root of this subtree. -/ 45 def Tree.support [DecidableEq V] (h : Tree V) : Finset V := h.refine.leaves.toFinset 46 47 /-- A predicate holds below every node, including the root. -/ 48 def Tree.All (P : Tree V → Prop) : Tree V → Prop 49 | h@(.leaf _) => P h 50 | h@(.two a b) => P h ∧ a.All P ∧ b.All P 51 | h@(.three a b c) => P h ∧ a.All P ∧ b.All P ∧ c.All P 52 | h@(.four a b c d) => P h ∧ a.All P ∧ b.All P ∧ c.All P ∧ d.All P 53 | h@(.five a b c d e) => P h ∧ a.All P ∧ b.All P ∧ c.All P ∧ d.All P ∧ e.All P 54 55 /-- A hierarchy of the vertex set together with the 4-chain property at each cut. -/ 56 def Certified [Fintype V] [DecidableEq V] (G : SimpleGraph V) : Option (Tree V) → Prop 57 | none => IsEmpty V 58 | some h => h.refine.Valid Finset.univ ∧ h.All fun s => Nonempty (ChainCuts.Cover G s.support 4) 59 60 def Tree.word {n : ℕ} (order : Fin n ≃ V) : Tree V → List ℕ 61 | .leaf v => [(order.symm v).val + 2] 62 | .two a b => 0 :: a.word order ++ b.word order 63 | .three a b c => 0 :: a.word order ++ [1] ++ b.word order ++ c.word order 64 | .four a b c d => [0, 1] ++ a.word order ++ b.word order ++ [1] ++ c.word order ++ d.word order 65 | .five a b c d e => 66 0 :: a.word order ++ [1, 1] ++ b.word order ++ c.word order ++ [1] ++ d.word order ++ e.word order 67 68 def encode {n : ℕ} (order : Fin n ≃ V) (h : Option (Tree V)) : List ℕ := 69 h.elim [] (Tree.word order) 70 71 /-- Construct the auxiliary tree in polynomial time from the 2-sequence. -/ 72 axiom construct : 73 ∃ build : List ℕ → List ℕ, RamPolytime build ∧ 74 ∀ {V : Type} [Fintype V] [DecidableEq V] {n : ℕ} (order : Fin n ≃ V) 75 (G : SimpleGraph V) (S : PartitionSequence G 2), 76 ∃ h, Certified G h ∧ build (ContractionInput.encode order G S) = encode order h 77 78 end Lax528502.AuxiliaryTree 79 -
no assumptions
At each stage put the constituent subtrees together in the order supplied by the vertices. Retain a single child when a part persists. At the final stage the root contains all vertices, and each genuine fork has 2 to 5 children.
-
An induced matching splits across a union of 2 cut sides. At a node with 5 children, the complement of 4 children consists of the first child and the outside of the parent. This also gives a sum of at most 2 old cut values.
-
Polynomial-time graph problems given a 2-sequence
For every fixed , a polynomial-time word RAM decides -Coloring on graphs supplied with a -sequence. One can also find a minimum dominating, total dominating, independent dominating, or connected dominating set, a minimum-weight feedback vertex set, a minimum subset feedback vertex set, or a longest induced path.
Corollaries 1.2 and 3.11 follow by applying the bounded-mim-width algorithms to the branch decomposition from Theorem 1.1.
1 import Lax528502.DecompositionAlgorithms 2 … module docstring, 13 lines 16 17 namespace Lax528502.GraphAlgorithms 18 19 open DecompositionAlgorithms Lax228581.TwinWidth GraphProblems 20 21 /-- For every fixed k, decide k-colorability from a 2-sequence in polynomial time. -/ 22 axiom fixedColoring (k : ℕ) : 23 ∃ algorithm : PolynomialTimeAlgorithm, 24 ∀ (n : ℕ) (G : SimpleGraph (Fin n)) (sequence : PartitionSequence G 2), 25 algorithm.Decides (numberedSequenceInput sequence) (G.Colorable k) 26 27 /-- One polynomial-time algorithm finds an optimum for each of the 7 problems. -/ 28 axiom optimization : 29 ∃ algorithm : PolynomialTimeAlgorithm, 30 ∀ (n : ℕ) (G : SimpleGraph (Fin n)) (sequence : PartitionSequence G 2) (problem : Problem n), 31 algorithm.FindsOptimum problem G (numberedSequenceInput sequence) 32 33 end Lax528502.GraphAlgorithms 34 -
Tree-independence number and induced bicliques
The independence number of a tree decomposition is the largest independence number of one of its bags. Minimizing over all tree decompositions gives the tree-independence number. An induced consists of 2 disjoint independent sets of size with all edges between them present.
1 import Lax228581.Treewidth 2 import Lax528502.ContractionInput 3 import Mathlib.Combinatorics.SimpleGraph.Clique 4 … module docstring, 10 lines 15 16 namespace Lax528502.TreeIndependence 17 18 open Lax228581.Treewidth 19 20 variable {V : Type} [DecidableEq V] 21 22 /-- Exclusion of an induced complete bipartite graph with both sides of size t. -/ 23 def InducedBicliqueFree (G : SimpleGraph V) (t : ℕ) : Prop := 24 ¬ ∃ A B : Finset V, A.card = t ∧ B.card = t ∧ Disjoint A B ∧ 25 G.IsIndepSet (A : Set V) ∧ G.IsIndepSet (B : Set V) ∧ 26 ∀ a ∈ A, ∀ b ∈ B, G.Adj a b 27 28 /-- Every independent subset of a bag has at most k vertices. -/ 29 def BagBound {G : SimpleGraph V} (D : TreeDecomposition G) (k : ℕ) : Prop := 30 ∀ i, ∀ A ⊆ D.bag i, G.IsIndepSet (A : Set V) → A.card ≤ k 31 32 /-- The largest size of an independent set contained in a bag of the decomposition. -/ 33 noncomputable def bagIndependenceNumber {G : SimpleGraph V} (D : TreeDecomposition G) : ℕ := by 34 classical 35 letI := D.nodeFintype 36 exact (Finset.univ : Finset D.Node).sup fun i => 37 ((D.bag i).powerset.filter fun A : Finset V => G.IsIndepSet (A : Set V)).sup Finset.card 38 39 /-- Bounding the maximum is equivalent to bounding every independent set in every bag. -/ 40 theorem bagIndependenceNumber_le_iff {G : SimpleGraph V} (D : TreeDecomposition G) (k : ℕ) : 41 bagIndependenceNumber D ≤ k ↔ BagBound D k := by 42 classical 43 simp [bagIndependenceNumber, BagBound, Finset.sup_le_iff] 44 45 /-- The minimum bag independence number over the tree decompositions of G. -/ 46 noncomputable def treeIndependenceNumber (G : SimpleGraph V) : ℕ := 47 sInf (Set.range fun D : TreeDecomposition G => bagIndependenceNumber D) 48 49 /-- Number of tree nodes, adjacency matrix of the tree, then the node-by-vertex 50 bag membership matrix. The choice of node numbering belongs to the producer. -/ 51 noncomputable def encode {n m : ℕ} {G : SimpleGraph V} (order : Fin n ≃ V) 52 (D : TreeDecomposition G) (nodes : Fin m ≃ D.Node) : List ℕ := 53 m :: ContractionInput.matrix m m (fun i j => D.tree.Adj (nodes i) (nodes j)) ++ 54 ContractionInput.matrix m n (fun i j => order j ∈ D.bag (nodes i)) 55 56 end Lax528502.TreeIndependence 57 -
Tree-independence number of induced-biclique-free graphs of twin-width at most 2
Let . If has twin-width at most and contains no induced , its tree-independence number is at most . A word RAM given , , and a -sequence outputs a tree decomposition with this bag bound in instructions (Theorem 4.1).
One program and one absolute constant serve every and every graph order . A word width sufficient to address cells suffices. The addition of includes the cases and .
- thm✓
Lax528502.TreeIndependenceBound(1st statement) - thm✓
Lax528502.TreeIndependenceBound(2nd statement)
1 import Lax528502.DecompositionAlgorithms 2 … module docstring, 14 lines 17 18 namespace Lax528502.TreeIndependenceBound 19 20 open DecompositionAlgorithms Lax228581.TwinWidth Lax228581.Treewidth Lax808846.Ram TreeIndependence 21 22 variable {V : Type} [Fintype V] [DecidableEq V] 23 24 /-- For t ≥ 2, excluding an induced K_{t,t} bounds the tree-independence number. -/ 25 axiom treeIndependence_le (G : SimpleGraph V) (t : ℕ) (ht : 2 ≤ t) 26 (hfree : InducedBicliqueFree G t) (h : HasTwinWidthAtMost G 2) : 27 treeIndependenceNumber G ≤ 84 * (t - 1) 28 29 /-- Given a 2-sequence, find a tree decomposition with the stated bag bound in time n^{O(t)}. -/ 30 axiom construct : 31 ∃ (program : Program) (c : ℕ), 0 < c ∧ 32 ∀ (I : GraphWithTwoSequence) (t : ℕ), 2 ≤ t → InducedBicliqueFree I.graph t → 33 ∃ D : TreeDecomposition I.graph, bagIndependenceNumber D ≤ 84 * (t - 1) ∧ 34 OutputsTreeDecompositionWithin program I t D ((I.n + 2) ^ (c * t)) 35 36 end Lax528502.TreeIndependenceBound 37 - thm✓
-
Bags of the auxiliary tree
Put . For an internal node with leaf set and children with leaf sets , use the bag . Each leaf carries its own vertex. The labels on the parent edges cover the cuts. For each graph vertex their occurrences form a connected subtree containing its leaf. In particular every graph edge has its ends together in a bag.
To compute , enumerate subsets of neighbors of each outside vertex and test independence. The sets then follow by scanning adjacencies. This constructs the bags in time (Section 4).
- lem✓
Lax528502.TreeBags(1st statement) - lem✓
Lax528502.TreeBags(2nd statement) - lem✓
Lax528502.TreeBags(3rd statement)
1 import Lax528502.AuxiliaryTree 2 import Lax808846.Ram 3 … module docstring, 15 lines 19 20 namespace Lax528502.TreeBags 21 22 open AuxiliaryTree Lax228581.Treewidth Lax228581.TwinWidth Lax759944.RamPolytime Lax808846.Ram 23 24 variable {V : Type} 25 26 /-- Children in the order used to serialize the auxiliary tree. -/ 27 def children : AuxiliaryTree.Tree V → List (AuxiliaryTree.Tree V) 28 | .leaf _ => [] 29 | .two a b => [a,b] 30 | .three a b c => [a,b,c] 31 | .four a b c d => [a,b,c,d] 32 | .five a b c d e => [a,b,c,d,e] 33 34 /-- Nodes in preorder. A valid leaf labeling distinguishes all subtrees. -/ 35 def subtrees : AuxiliaryTree.Tree V → List (AuxiliaryTree.Tree V) 36 | s@(.leaf _) => [s] 37 | s@(.two a b) => s :: subtrees a ++ subtrees b 38 | s@(.three a b c) => s :: subtrees a ++ subtrees b ++ subtrees c 39 | s@(.four a b c d) => s :: subtrees a ++ subtrees b ++ subtrees c ++ subtrees d 40 | s@(.five a b c d e) => s :: subtrees a ++ subtrees b ++ subtrees c ++ subtrees d ++ subtrees e 41 42 /-- Use a single node with an empty bag for the empty graph. -/ 43 def nodes : Option (AuxiliaryTree.Tree V) → List (Option (AuxiliaryTree.Tree V)) 44 | none => [none] 45 | some s => (subtrees s).map some 46 47 /-- Tree adjacency, expressed on node labels. -/ 48 def adjacent (x y : Option (AuxiliaryTree.Tree V)) : Prop := 49 match x, y with 50 | some a, some b => b ∈ children a ∨ a ∈ children b 51 | _, _ => False 52 53 variable [Fintype V] [DecidableEq V] 54 55 /-- The union of the inside labels of the children. -/ 56 noncomputable def childLabels (G : SimpleGraph V) (k : ℕ) 57 (cs : List (AuxiliaryTree.Tree V)) : Finset V := 58 (cs.map fun c => ChainCuts.inside G c.support k).foldr (· ∪ ·) ∅ 59 60 noncomputable def bag (G : SimpleGraph V) (k : ℕ) : Option (AuxiliaryTree.Tree V) → Finset V 61 | none => ∅ 62 | some (.leaf v) => {v} 63 | some s => ChainCuts.heavy G s.support k ∪ childLabels G k (children s) 64 65 /-- Node positions are the numbering used on the output tape. -/ 66 abbrev Position (h : Option (AuxiliaryTree.Tree V)) := Fin (nodes h).length 67 68 /-- The concrete incidence matrices of the tree and its bags in preorder. -/ 69 noncomputable def word {n : ℕ} (order : Fin n ≃ V) (G : SimpleGraph V) (k : ℕ) 70 (h : Option (AuxiliaryTree.Tree V)) : List ℕ := 71 let ns := nodes h 72 ns.length :: ContractionInput.matrix ns.length ns.length (fun i j => adjacent (ns.get i) (ns.get j)) ++ 73 ContractionInput.matrix ns.length n (fun i j => order j ∈ bag G k (ns.get i)) 74 75 /-- The stated bags on the specified tree form a tree decomposition of G. -/ 76 axiom decomposition (G : SimpleGraph V) (t : ℕ) (ht : 2 ≤ t) 77 (hfree : TreeIndependence.InducedBicliqueFree G t) 78 (h : Option (AuxiliaryTree.Tree V)) (hc : Certified G h) : 79 ∃ (D : TreeDecomposition G) (number : Position h ≃ D.Node), 80 (∀ i j, D.tree.Adj (number i) (number j) ↔ adjacent ((nodes h).get i) ((nodes h).get j)) ∧ 81 ∀ i, D.bag (number i) = bag G (4 * (t - 1)) ((nodes h).get i) 82 83 /-- Each canonical bag has independence number at most 84(t-1). -/ 84 axiom bag_bound (G : SimpleGraph V) (t : ℕ) (ht : 2 ≤ t) 85 (hfree : TreeIndependence.InducedBicliqueFree G t) 86 (h : Option (AuxiliaryTree.Tree V)) (hc : Certified G h) (i : Position h) : 87 ∀ A ⊆ bag G (4 * (t - 1)) ((nodes h).get i), G.IsIndepSet (A : Set V) → 88 A.card ≤ 84 * (t - 1) 89 90 /-- Construct a certified auxiliary tree and write its bags. The same 91 word RAM handles all values of the forbidden biclique size. -/ 92 axiom compute : 93 ∃ (p : Program) (c : ℕ), 0 < c ∧ 94 ∀ {V : Type} [Fintype V] [DecidableEq V] {n : ℕ} (order : Fin n ≃ V) 95 (G : SimpleGraph V) (S : PartitionSequence G 2) (t : ℕ), 2 ≤ t → 96 ∃ h : Option (AuxiliaryTree.Tree V), Certified G h ∧ 97 ∀ w, (n+2) ^ (c*t) < 2^w → 98 ∃ steps ≤ (n+2) ^ (c*t), 99 RunsTo w p (ContractionInput.tape (t :: ContractionInput.encode order G S)) 100 (word order G (4 * (t-1)) h) steps 101 102 end Lax528502.TreeBags 103 - lem✓
-
no assumptions
An oversized independent set in the heavy side supplies vertices in a single chain. The smallest of their neighborhoods contains an independent -set, giving an induced biclique. On the inside, the largest light neighborhood in each chain suffices to cover the corresponding endpoints.
-
Color propagation between ordered cliques
In a proper -coloring, each ordered -clique uses every color once. Between consecutive cliques, the copy gadget forces their color orders to agree. The swap gadget forces an adjacent transposition. The choice gadget allows either order (Lemma 5.1).
1 import Mathlib.GroupTheory.Perm.Basic 2 import Mathlib.Data.Fin.Basic 3 … module docstring, 10 lines 14 15 namespace Lax528502.ColoringGadgets 16 17 /-- Two consecutive positions in a clique of size k, numbered from 0. -/ 18 structure Consecutive (k : ℕ) where 19 left : Fin k 20 right : Fin k 21 next : right.val = left.val + 1 22 23 inductive Operation (k : ℕ) 24 | copy 25 | swap (i : Consecutive k) 26 | choice (i : Consecutive k) 27 28 variable {k : ℕ} 29 30 /-- A crossing-edge pattern, on either finite clique positions or their numerical labels. -/ 31 inductive EdgePattern (α : Type) 32 | copy 33 | swap (left right : α) 34 | choice (left right : α) 35 deriving DecidableEq, Inhabited 36 37 def EdgePattern.Edge {α : Type} [LT α] (op : EdgePattern α) (p q : α) : Prop := 38 match op with 39 | .copy => p < q 40 | .choice l r => p < q ∧ (p,q) ≠ (l,r) 41 | .swap l r => (p < q ∧ (p,q) ≠ (l,r)) ∨ (p,q) = (l,l) 42 43 /-- Crossing edges from position p of the old clique to q of the new one. -/ 44 def Operation.Edge (op : Operation k) (p q : Fin k) : Prop := 45 let pattern : EdgePattern (Fin k) := match op with 46 | .copy => .copy 47 | .swap i => .swap i.left i.right 48 | .choice i => .choice i.left i.right 49 pattern.Edge p q 50 51 /-- The old position carrying the color at each new position is given by π. -/ 52 def Operation.Proper (op : Operation k) (π : Equiv.Perm (Fin k)) : Prop := 53 ∀ q, ¬ op.Edge (π q) q 54 55 def Operation.Allows (op : Operation k) (π : Equiv.Perm (Fin k)) : Prop := 56 match op with 57 | .copy => π = Equiv.refl _ 58 | .swap i => π = Equiv.swap i.left i.right 59 | .choice i => π = Equiv.refl _ ∨ π = Equiv.swap i.left i.right 60 61 /-- The three gadgets permit exactly the prescribed changes of color order. -/ 62 axiom proper_iff_allows (op : Operation k) (π : Equiv.Perm (Fin k)) : op.Proper π ↔ op.Allows π 63 64 end Lax528502.ColoringGadgets 65 -
Minimum Coloring is NP-complete on graphs of twin-width at most 2
When is part of the input, deciding whether is -colorable is NP-complete even if a -sequence of is given (Theorem 5.2). Every language in NP has a polynomial many-one reduction whose outputs satisfy the promise on both yes and no instances.
1 import Lax528502.ColoringInstances 2 import Lax429075.Reductions 3 … module docstring, 10 lines 14 15 namespace Lax528502.MinimumColoring 16 17 open Lax434930.PolynomialTime Lax434930.NondeterministicPolynomialTime 18 open Lax429075.Reductions ColoringInstances 19 20 /-- Minimum Coloring is NP-complete even when the input supplies a 2-sequence. -/ 21 axiom np_complete : NPComplete minimumColoringWithTwoSequence 22 23 /-- The reduction supplies a valid 2-sequence on both yes and no instances. -/ 24 axiom hardness_with_sequence (A : Language) (hA : A ∈ NP) : 25 PolynomialManyOneReduction A minimumColoringWithTwoSequence (withOutputsIn := validColoringInstances) 26 27 end Lax528502.MinimumColoring 28 -
Vertex-disjoint paths in directed acyclic graphs
Given an acyclic digraph and a list of ordered pairs of distinct terminals, decide whether there are pairwise vertex-disjoint directed paths joining the prescribed pairs. The number of pairs is part of the input. This problem is NP-complete by Ganian, Hliněný, Kneis, Langer, Obdržálek, and Rossmanith, Theorem 4.8(b). The vertices below are numbered in a topological order.
1 import Lax528502.ColoringInstances 2 import Lax429075.Reductions 3 import Mathlib.Data.List.Chain 4 … module docstring, 11 lines 16 17 namespace Lax528502.DisjointPaths 18 19 open Lax434930.PolynomialTime Lax429075.Reductions 20 21 structure Instance where 22 n : ℕ 23 arc : Fin n → Fin n → Prop 24 forward : ∀ u v, arc u v → u < v 25 terminals : List (Fin n × Fin n) 26 nonempty : terminals ≠ [] 27 distinct : (terminals.flatMap fun p => [p.1, p.2]).Nodup 28 29 /-- The order and arc matrix, then the count of terminal pairs and the pairs. -/ 30 noncomputable def Instance.bits (I : Instance) : Word := 31 ColoringInstances.binary (I.n :: ContractionInput.matrix I.n I.n I.arc ++ 32 [I.terminals.length] ++ I.terminals.flatMap fun (s, t) => [s.val, t.val]) 33 34 def Instance.Routable (I : Instance) : Prop := 35 ∃ paths : Fin I.terminals.length → List (Fin I.n), 36 (∀ i, (paths i).head? = some (I.terminals.get i).1 ∧ 37 (paths i).getLast? = some (I.terminals.get i).2 ∧ (paths i).IsChain I.arc) ∧ 38 ∀ i j, i ≠ j → Disjoint (paths i).toFinset (paths j).toFinset 39 40 def language : Language := {w | ∃ I : Instance, I.bits = w ∧ I.Routable} 41 42 /-- The source problem for the coloring reduction. -/ 43 axiom np_complete : NPComplete language 44 45 end Lax528502.DisjointPaths 46 -
The ordered-clique graph and its contraction sequence
The disjoint paths reduction assigns a position to each vertex and each arc, and one extra position to the dummy vertex. Incoming and outgoing arcs are processed in topological order by optional exchanges of two positions. Copies of the ordered cliques align each modified crossing edge with a block boundary. After deleting the dummy, merge the prefixes of the blocks from right to left and then contract consecutive blocks (Section 5).
1 import Lax528502.DisjointPaths 2 import Lax528502.ColoringGadgets 3 … module docstring, 12 lines 16 17 namespace Lax528502.CliqueConstruction 18 19 open ColoringGadgets 20 21 abbrev Step := EdgePattern ℕ 22 23 /-- Exchange p and q optionally, restoring every intermediate position. -/ 24 def exchange (p q : ℕ) : List Step := 25 let moves := (List.range (q - p - 1)).map fun i => 26 EdgePattern.swap (p + i) (p + i + 1) 27 moves ++ [.choice (q - 1) q] ++ moves.reverse 28 29 structure Plan where 30 colors : ℕ 31 steps : List Step 32 33 /-- Number sources, sinks, and old vertices, add private terminal arcs, and 34 process the vertices in a topological order. All positions start at 0. -/ 35 def plan (n : ℕ) (arcs terminals : List (ℕ × ℕ)) : Plan := 36 let pairs := terminals.zipIdx 37 let old := fun v => 2 * terminals.length + v 38 let vertices := pairs.map (fun (_, h) => 2*h) ++ (List.range n).map old ++ 39 pairs.map (fun (_, h) => 2*h+1) 40 let edges := pairs.map (fun ((s,_), h) => (2*h, old s)) ++ 41 arcs.map (fun (u,v) => (old u, old v)) ++ pairs.map (fun ((_,t), h) => (old t, 2*h+1)) 42 let indexed := edges.zipIdx 43 let transfers := fun v (arcsAtVertex : List ((ℕ × ℕ) × ℕ)) => 44 arcsAtVertex.flatMap fun (_, i) => exchange v (vertices.length + i) 45 let route := vertices.flatMap fun v => 46 transfers v (indexed.filter fun ((_,t), _) => t == v) ++ 47 transfers v (indexed.filter fun ((s,_), _) => s == v) 48 let active := vertices.length + edges.length 49 let free := (List.range active).filter fun p => !(p < 2 * pairs.length && p % 2 == 1) 50 let permute := free.flatMap fun p => (free.filter (p < ·)).flatMap (exchange p) 51 let swaps := pairs.map fun (_, h) => EdgePattern.swap (2*h) (2*h+1) 52 ⟨active + 1, .copy :: route ++ permute ++ swaps⟩ 53 54 /-- Insert at least one copy before each operation and at the closing edge. 55 If the left position is p, the new column has index p+2 modulo m=k−1. -/ 56 def pad (m previous : ℕ) : List Step → List Step 57 | [] => List.replicate (m - previous % m) .copy 58 | step :: rest => 59 let copies := match step with 60 | .copy => 1 61 | .swap p _ | .choice p _ => 1 + (p % m + (m - previous % m)) % m 62 List.replicate copies .copy ++ step :: pad m (previous + copies + 1) rest 63 64 /-- Check the congruence of every special step and of the total column count. -/ 65 def Aligned (m previous : ℕ) : List Step → Prop 66 | [] => previous % m = 0 67 | .copy :: xs => Aligned m (previous + 1) xs 68 | .swap p _ :: xs | .choice p _ :: xs => 69 (previous + 1) % m = (p + 2) % m ∧ Aligned m (previous + 1) xs 70 71 /-- Padding places every modified crossing edge at the prescribed block boundary. -/ 72 axiom padding_aligns (m : ℕ) (hm : 0 < m) (previous : ℕ) (ops : List Step) : 73 Aligned m previous (pad m previous ops) 74 75 /-- Delete the dummy vertex of column 0 and use the vertex numbering C−1. -/ 76 def vertexCount (k : ℕ) (steps : List Step) : ℕ := k * (steps.length + 1) - 1 77 78 def graph (k : ℕ) (steps : List Step) : SimpleGraph (Fin (vertexCount k steps)) := 79 let column := fun (v : Fin (vertexCount k steps)) => (v.val + 1) / k 80 let position := fun (v : Fin (vertexCount k steps)) => k - 1 - ((v.val + 1) % k) 81 let forward := fun u v => 82 (column v = column u + 1 ∧ (steps[column u]?.getD .copy).Edge (position u) (position v)) ∨ 83 (column u = steps.length ∧ column v = 0 ∧ position u < position v) 84 { Adj := fun u v => u ≠ v ∧ (column u = column v ∨ forward u v ∨ forward v u) 85 symm := ⟨fun _ _ ⟨hne, h⟩ => ⟨hne.symm, h.elim (fun e => Or.inl e.symm) 86 (fun e => Or.inr e.symm)⟩⟩ 87 loopless := ⟨fun _ h => h.1 rfl⟩ } 88 89 /-- The pair (a,b) means that the part represented by b joins the part 90 represented by a. First grow every block prefix, then merge adjacent blocks. -/ 91 def merges (blockSize blocks : ℕ) : List (ℕ × ℕ) := 92 let grow := (List.range (blockSize - 1)).flatMap fun j => 93 (List.range blocks).reverse.map fun i => (blockSize*i, blockSize*i+j+1) 94 grow ++ (List.range (blocks - 1)).map fun i => (0, blockSize*(i+1)) 95 96 def representative (ms : List (ℕ × ℕ)) (v : ℕ) : ℕ := 97 ms.foldl (fun part (a,b) => if part = b then a else part) v 98 99 /-- Serialize the graph, followed by the equivalence matrix after every 100 prefix of the merge list, in the coloring input format. -/ 101 noncomputable def Plan.words (P : Plan) : List ℕ := 102 let k := P.colors 103 let steps := pad (k-1) 0 P.steps 104 let n := vertexCount k steps 105 let ms := merges (k-1) (n / (k-1)) 106 let partitions := (List.range (ms.length + 1)).flatMap fun i => 107 let rep := representative (ms.take i) 108 ContractionInput.matrix n n fun u v => rep u.val = rep v.val 109 k :: ContractionInput.graph (Equiv.refl _) (graph k steps) ++ [ms.length] ++ partitions 110 111 /-- The graph, color count, and explicit 2-sequence prescribed on a DAG input. -/ 112 noncomputable def words (I : DisjointPaths.Instance) : List ℕ := by 113 classical 114 let arcs := (List.ofFn fun (u : Fin I.n) => (List.ofFn id).filterMap fun v => 115 if I.arc u v then some (u.val,v.val) else none).flatten 116 exact (plan I.n arcs (I.terminals.map fun (s,t) => (s.val,t.val))).words 117 118 end Lax528502.CliqueConstruction 119 -
no assumptions
Copies preserve the color order. Counting the inserted copies places a swap or choice with left position p at column p+2 modulo k−1. The closing copies make the number of columns equal to 1 modulo k−1.
-
A coloring of the padded cliques is equivalent to a successful routing of the terminal colors. Growing block prefixes from right to left and then merging consecutive blocks keeps every red degree at most 2.
-
Reduction to Minimum Coloring with a 2-sequence
The reduction of Section 5 turns disjoint directed paths in a DAG into Minimum Coloring. Its cyclically arranged cliques have a polynomial-size -sequence which is included in the output. On every input, including a negative input, the reduction returns a well-formed target instance.
The output is available both as a list of RAM words and under its binary encoding for polynomial many-one reductions. A certificate for the target language is a color for each vertex. The graph, sequence, and coloring can all be checked in polynomial time.
- lem✓
Lax528502.ColoringReduction(1st statement) - lem✓
Lax528502.ColoringReduction(2nd statement) - lem✓
Lax528502.ColoringReduction(3rd statement)
1 import Lax528502.CliqueConstruction 2 import Lax759944.RamPolytime 3 import Lax434930.NondeterministicPolynomialTime 4 … module docstring, 15 lines 20 21 namespace Lax528502.ColoringReduction 22 23 open Lax434930.PolynomialTime Lax434930.NondeterministicPolynomialTime 24 open Lax759944.RamPolytime ColoringInstances 25 26 /-- The serialized clique graph carries a valid 2-sequence and is colorable 27 exactly when the specified directed paths exist. -/ 28 axiom correct (I : DisjointPaths.Instance) : ∃ J : ColoringInstances.Instance, 29 CliqueConstruction.words I=J.words ∧ (J.graph.Colorable J.colors ↔ I.Routable) 30 31 /-- The same reduction on the RAM and as a map on binary words. -/ 32 axiom reduce : 33 ∃ (ram : List ℕ → List ℕ) (f : Word → Word), RamPolytime ram ∧ 34 Nonempty (Turing.TM2ComputableInPolyTime id id f) ∧ 35 (∀ I : DisjointPaths.Instance, ram (I.bits.map Bool.toNat) = CliqueConstruction.words I) ∧ 36 ∀ x, (∃ I : ColoringInstances.Instance, ram (x.map Bool.toNat) = I.words ∧ f x = I.bits) ∧ 37 (x ∈ DisjointPaths.language ↔ f x ∈ minimumColoringWithTwoSequence) 38 39 /-- Verifying a supplied sequence and a coloring gives membership in NP. -/ 40 axiom membership : minimumColoringWithTwoSequence ∈ NP 41 42 end Lax528502.ColoringReduction 43 - lem✓
Loading the paper…