associahedron_d_stat
The function associahedron_d_stat takes a natural number depth and a tree T : BinTree, and returns the element of ZMod 2 counting preferred left edges of T whose upper endpoint has even path depth: returning 0 for a leaf, and for a node with children l and r, if associahedron_d (associahedron_root_label l) (associahedron_root_label r) = 0 then (if depth % 2 = 0 then 1 else 0) + associahedron_d_stat (depth + 1) l + associahedron_d_stat 0 r, otherwise associahedron_d_stat 0 l + associahedron_d_stat (depth + 1) r.
Statement
def associahedron_d_stat (depth : ℕ) : BinTree → ZMod 2- Defined in
- arXiv:2611.19659, Section 2
- Verified
- 20 Nov 2026
- Axioms
- none listed
- Built on 3
- BinTreeThe inductive type BinTree of ordered full binary trees with constructors leaf and node left right.
- associahedron_dThe function associahedron_d takes two pairs a and b in (ZMod 2) × (ZMod 2) and returns the sum in ZMod 2 of the second component of a and…
- 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…
- Used by 1
- associahedron_colouringThe function associahedron_colouring assigns to each ordered full binary tree T the pair (associahedron_root_label T, associahedron_d_stat…
Read back from the Lean
A definition of a recursive function associahedron_d_stat, which takes a natural number depth and a binary tree (of type BinTree, constructed from leaves and internal nodes) and returns a value in ZMod 2:
- If the tree is a leaf (.leaf), the function returns 0.
- If the tree is a node with left child l and right child r (.node l r), let a = associahedron_root_label l and b = associahedron_root_label r.
- If associahedron_d a b = 0:
it returns the sum (in ZMod 2) of:
- 1 if depth % 2 = 0, else 0
- associahedron_d_stat (depth + 1) l
- associahedron_d_stat 0 r
- Otherwise (if associahedron_d a b ≠ 0):
it returns the sum (in ZMod 2) of:
- associahedron_d_stat 0 l
- associahedron_d_stat (depth + 1) r
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
/-- Parity statistic d(T, depth) in ZMod 2 of preferred left edges with even path depth. -/ def associahedron_d_stat (depth : ℕ) : BinTree → ZMod 2 | .leaf => 0 | .node l r => let a := associahedron_root_label l let b := associahedron_root_label r if associahedron_d a b = 0 then (if depth % 2 = 0 then (1 : ZMod 2) else 0) + associahedron_d_stat (depth + 1) l + associahedron_d_stat 0 r else associahedron_d_stat 0 l + associahedron_d_stat (depth + 1) r