BinTree
inductive
The inductive type BinTree of ordered full binary trees with constructors leaf and node left right.
Statement
inductive BinTree- Defined in
- arXiv:2611.19659, Section 2
- Verified
- 20 Nov 2026
- Axioms
- none listed
- Used by 6
- associahedron_colouringThe function associahedron_colouring assigns to each ordered full binary tree T the pair (associahedron_root_label T, associahedron_d_stat…
- TreeRotationThe inductive relation TreeRotation on BinTree relating two trees that differ by a single rotation: rotating right at the root replacing…
- associahedronGraphFor each natural number n, the associahedron graph associahedronGraph n is the simple graph whose vertices are ordered full binary trees T…
- associahedron_d_statThe function associahedron_d_stat takes a natural number depth and a tree T : BinTree, and returns the element of ZMod 2 counting…
- bin_tree_num_leavesThe function bin_tree_num_leaves computes the number of leaves in an ordered full binary tree: 1 for a leaf, and bin_tree_num_leaves l +…
- associahedron_root_labelThe function associahedron_root_label assigns to each ordered full binary tree T a label in (ZMod 2) × (ZMod 2), defined recursively by…
Read back from the Lean
Defines an inductive type BinTree with two constructors:
- leaf : BinTree, with no arguments;
- node : BinTree → BinTree → BinTree, taking two binary trees left and right and constructing a new BinTree.
Neither constructor carries data (representing unlabeled binary trees).
The declaration also derives an instance of DecidableEq BinTree (decidable equality for terms of type BinTree).
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
/-- Ordered full binary trees: each tree is either a leaf or an internal node with left and right subtrees. -/ inductive BinTree | leaf : BinTree | node (left right : BinTree) : BinTree deriving DecidableEq