plane_tree_num_internal
def
The number of internal vertices of a plane tree T, denoted n(T).
Statement
def plane_tree_num_internal : PlaneTree → ℕ- Defined in
- arXiv:2611.10154 Sec. 2.2
- Verified
- 10 Nov 2026
- Axioms
- none listed
- Built on 1
- PlaneTreeA finite plane tree is either a leaf or an internal node with a list of child plane trees.
- Used by 6
- in_m_leafy_treesLT_n^m is the set of m-leafy trees with n internal vertices and mn + 1 leaves.
- op_1429_mirror_symmetric_m_leafy_trees_involutionThe mirror reflection involution τ preserves the class LT_n^m of m-leafy trees with n internal vertices and mn + 1 leaves.
- is_m_leafyA tree T is m-leafy if every rooted subtree T_v satisfies ℓ(T_v) > m * n(T_v).
- op_1429_mirror_symmetric_m_leafy_trees_n_one_uniqueFor every natural number m ≥ 1, there exists a unique tree t such that t ∈ mirror_symmetric_m_leafy_trees m 1.
- op_1429_mirror_symmetric_m_leafy_trees_nonemptyFor all natural numbers m ≥ 1 and n ≥ 1, the set mirror_symmetric_m_leafy_trees m n is nonempty.
- op_1430_involution_group_n_oneFor n = 1 and any m ≥ 1, any two involutions on MLeafyTree m 1 generate a trivial (subsingleton) permutation subgroup.
Read back from the Lean
A recursively defined function plane_tree_num_internal mapping a PlaneTree to a natural number (ℕ):
- PlaneTree.leaf maps to 0.
- PlaneTree.node cs (where cs : List PlaneTree is the list of child subtrees) maps to 1 plus the sum of plane_tree_num_internal c for all children c in cs.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- The number of internal vertices in a finite plane tree. -/ def plane_tree_num_internal : PlaneTree → ℕ | .leaf => 0 | .node cs => 1 + (cs.attach.map (fun ⟨c, _⟩ => plane_tree_num_internal c) |>.sum) termination_by t => sizeOf t