Pruning after placing the new leaf last #
The degree-three case suppresses the penultimate vertex and restores the edge between its other two neighbours.
theorem
BGW.StableTrees.Marchal.exists_graft_edge_canonical
{n m : ℕ}
(G : SimpleGraph (Fin (m + 2)))
(tree : G.IsTree)
(labels : Fin (n + 2) ↪ Fin (m + 2))
(leaf : ∀ (v : Fin (m + 2)), G.degree v = 1 ↔ v ∈ Set.range ⇑labels)
(branch : ∀ (v : Fin (m + 2)), G.degree v ≠ 1 → 3 ≤ G.degree v)
(hlast : labels (Fin.last (n + 1)) = Fin.last (m + 1))
(hnew : ∀ (x : Fin (m + 2)), G.Adj (Fin.last (m + 1)) x ↔ x = (Fin.last m).castSucc)
(hdegree : G.degree (Fin.last m).castSucc = 3)
:
Canonical degree-three pruning gives a labelled parent.