Tree surgery at a non-root DFS position #
Combinatorial helpers for the proofs of Lemmas lem:S_rary(ii), lem:C_rary and lem:C_lh
(source lines 2670–2753, 2768–2792, 3190–3236; inventory P19, P21, P25), in which a fringe
subtree T_{u_{ℓ+1}} at a non-root DFS position ℓ ≥ 1 is cut out and replaced.
A non-root DFS position of node ts lies in exactly one child: writing ts = pre ++ t :: post,
the positions of the vertices of t are forestSize pre + q + 1 with q < |t|, where
forestSize pre is the total size of the preceding children (the DFS bookkeeping of the paper).
exists_append_of_lt_forestSize: every positioni < forestSize tsof the foresttsis of the formforestSize pre + qwithts = pre ++ t :: post,q < |t|;fringeAt_node_append: at that position the fringe subtree ofnode tsisfringeAt t q;replaceAt_node_append: replacing it bySreplaces the childtbyreplaceAt t q S;sum_range_forestSize: a sum over the positions of a forest splits over its trees;graft_cut_eq_replaceAt:Cut_ℓ(T)[S]isTwithT_{u_{ℓ+1}}replaced byS.
The total number of vertices ∑_i |t_i| of a forest (t_1, …, t_m).
Equations
Instances For
The fringe subtree at DFS index i fits inside T: i + |T_{u_{i+1}}| ≤ |T|.
Every position of a forest lies in exactly one of its trees.
At the DFS position forestSize pre + q + 1 of node (pre ++ t :: post) sits the vertex of
DFS index q of the child t.
Replacing the fringe subtree at the DFS position forestSize pre + q + 1 of
node (pre ++ t :: post) replaces the child t by replaceAt t q S.
A sum over the positions 0 ≤ i < forestSize ts of a forest splits into the sums over the
positions of its trees.
Replacement below the root preserves a declumped mark Ghat = 1{k_∅ ∈ B} 1{∃ child c, G(T_c)}
as soon as replacement inside the witnessing child preserves G: the root degree is unchanged,
and a witnessing child either does not contain the replaced vertex or is modified only inside.
(This is the common step of the proofs of Lemmas lem:C_rary and lem:C_lh.)