Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 6.4 — the vertices a_{i,j} lie on a single branch of the DFS tree

Proved
TwinWidthI.MinorFree.lemma_6_4

by mikedeng1 · Oct 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

depth-first-searchgraph-minorp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1twin-width

Let (v1,…,vn;T)(v_1,\dots,v_n;\mathcal T)(v1​,…,vn​;T) be a depth-first search of a finite graph GGG, and let k≥0k\ge 0k≥0. Suppose vertices ai,ja_{i,j}ai,j​ and bi,jb_{i,j}bi,j​ (i,j∈[k]i,j\in[k]i,j∈[k]) satisfy:

  1. ai,jbi,ja_{i,j}b_{i,j}ai,j​bi,j​ is an edge of GGG for all i,ji,ji,j;
  2. ai,j≺ai′,j′a_{i,j}\prec a_{i',j'}ai,j​≺ai′,j′​ in the discovery order whenever i<i′i<i'i<i′;
  3. ai,j≺bi′,j′a_{i,j}\prec b_{i',j'}ai,j​≺bi′,j′​ for all i,j,i′,j′i,j,i',j'i,j,i′,j′.

Then any two of the ai,ja_{i,j}ai,j​ are in ancestor–descendant relation in T\mathcal TT: if ai,j≼ai′,j′a_{i,j}\preccurlyeq a_{i',j'}ai,j​≼ai′,j′​, then ai,ja_{i,j}ai,j​ is an ancestor of ai′,j′a_{i',j'}ai′,j′​,

ai,j≼ai′,j′ ⟹ ai,j is an ancestor of ai′,j′.a_{i,j}\preccurlyeq a_{i',j'}\ \Longrightarrow\ a_{i,j}\ \text{is an ancestor of}\ a_{i',j'} .ai,j​≼ai′,j′​ ⟹ ai,j​ is an ancestor of ai′,j′​.

So all the ai,ja_{i,j}ai,j​ lie on a single branch, first ⋃j{a1,j}\bigcup_j\{a_{1,j}\}⋃j​{a1,j​}, then ⋃j{a2,j}\bigcup_j\{a_{2,j}\}⋃j​{a2,j​}, and so on.

In the proof of Theorem 6.3, k=g(t)/2k=g(t)/2k=g(t)/2, ai,j∈Aia_{i,j}\in A_iai,j​∈Ai​ and bi,j∈Bjb_{i,j}\in B_jbi,j​∈Bj​, where A1,…,AkA_1,\dots,A_kA1​,…,Ak​ are consecutive blocks of the discovery order preceding the consecutive blocks B1,…,BkB_1,\dots,B_kB1​,…,Bk​; the lemma lets the paper contract the paths Ai′A'_iAi′​ into the branch sets of a minor. As the paper notes, only the definition of a DFS is used, not the Lex-DFS tie-break.

Formalization Note Hypotheses 1–3 are exactly the properties of the proof's vertices that the lemma uses; the blocks Ai,BjA_i,B_jAi​,Bj​ themselves are not needed. The "In particular" clause (the minimal subtrees Ai′A'_iAi′​ are pairwise-disjoint paths) is not stated separately.

Preamble
import Mathlib
import Definitions.Def_TwinWidthI_MinorFree_LexDFS
Formal statement
namespace TwinWidthI.MinorFree

/-- Lemma 6.4, p. 3:27. In a DFS (`σ`, `par`) of `G`, let `a i j` (`i, j < k`, the paper's
`a_{i+1,j+1} ∈ A_{i+1}`) be vertices with a neighbour `b i j` (`∈ B_{j+1}`), such that every
`a i j` is discovered before every `a i' j'` with `i < i'` (the `A_i` are consecutive blocks in
this order) and before every `b i' j'` (all of `⋃ A_i` precedes `⋃ B_j`). Then all the `a i j`
lie on a single branch of the DFS tree: an earlier one is an ancestor of a later one. -/
theorem lemma_6_4 {V : Type} [Fintype V] [DecidableEq V] (G : SimpleGraph V) {n : ℕ}
    (σ : V ≃ Fin n) (par : V → V) (hdfs : IsDFSOrder G σ par) {k : ℕ}
    (a b : Fin k → Fin k → V) (hab : ∀ i j, G.Adj (a i j) (b i j))
    (ha : ∀ i j i' j', i < i' → σ (a i j) < σ (a i' j'))
    (hb : ∀ i j i' j', σ (a i j) < σ (b i' j')) :
    ∀ i j i' j', σ (a i j) ≤ σ (a i' j') → IsAncestor par (a i j) (a i' j') := by sorry

end TwinWidthI.MinorFree
Source
Bonnet, Kim, Thomassé and Watrigant, Twin-width I: Tractable FO Model Checking, J. ACM 69(1), Article 3 (2021), p. 3:27, Lemma 6.4 (context p. 3:26, proof of Theorem 6.3)
Human review
  • Endorsed by Shuze Chen · Oct 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 8, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me