Corollary 3.7.2 (leaves are exactly the absent labels)
ProvedGYGraphTheory.corollary_3_7_2Corollary 3.7.2 (Gross–Yellen, p. 159). For every and labeled tree on vertices, a label occurs in the Prüfer sequence of (pruferEncode T, Algorithm 3.7.1) if and only if the vertex labeled is not a leaf of (i.e. has degree different from ). This is the direct restatement of Proposition 3.7.1 in the case ; the hypothesis is inherited from Proposition 3.7.1 for the same reason.
import Definitions.Def_GYGraphTheory import Mathlib open scoped Classical
namespace GYGraphTheory
theorem corollary_3_7_2 {n : ℕ} (hn : 2 ≤ n) (T : SimpleGraph (Fin n)) (hT : T.IsTree) (k : Fin n) :
haveI : NeZero n := ⟨by omega⟩
k ∈ List.ofFn (pruferEncode T) ↔ T.degree k ≠ 1 := by sorry
end GYGraphTheoryRead-back
What the Lean code literally says, in plain math · claude-sonnet-5
Read-back of corollary_3_7_2.
Fix with (so in particular , which is all the NeZero n instance records), a simple graph on the vertex set that is a tree (connected and acyclic), and an arbitrary vertex . The theorem asserts the biconditional
where is the ordinary degree of in the full graph (the number of vertices of adjacent to ), and is a specific list of length built as follows. For a subset and a vertex , let , the neighbors of in that also lie in ; call an active leaf of if and (i.e. has exactly one neighbor remaining inside ). Starting from and an empty accumulator, repeat for : let be the smallest-indexed active leaf of under the standard order on — or, if happens to have no active leaf, the junk default — let be the smallest-indexed member of (again defaulting to if that set is empty), set , and append to the accumulator. After such steps the accumulator has length and its last entry is, by definition, for each (formally extracted via List.getD with a junk default that is never actually triggered, since the index is always in range of the length- accumulator); then , i.e. exactly this length- record of successively-peeled leaves' neighbors — the standard Prüfer-sequence construction (repeatedly strip the least-labeled degree-one vertex of the shrinking vertex set and record its unique surviving neighbor), here made total by the two getD 0 fallbacks for the edge cases where no active leaf, or no active neighbor, exists in . In the boundary case , , so is the empty list and the left-hand side is false for every ; correspondingly the unique tree on two vertices is the single edge, so both vertices have degree and the right-hand side is false as well, so the iff holds trivially there. For the statement is the classical fact that a vertex occurs in the Prüfer sequence of a tree iff it is not a leaf of the tree (equivalently, its total degree is at least ), asserted here as an exact iff (membership in , not multiplicity, versus degree being different from — not merely at most — ).
Confirmed by the mission captain (proposal self-audit).