Main results #
treesOfNumNodesEq_card_eq_catalan: The number of binary trees withninternal nodes iscatalan n
@[reducible, inline]
Given two finsets, find all trees that can be formed with
left child in a and right child in b
Equations
- Tree.pairwiseNode a b = Finset.map { toFun := fun (x : Tree Unit × Tree Unit) => Tree.node () x.1 x.2, inj' := Tree.pairwiseNode._proof_1 } (a ×ˢ b)
Instances For
theorem
Tree.treesOfNumNodesEq_succ
(n : ℕ)
:
treesOfNumNodesEq (n + 1) = (Finset.antidiagonal n).biUnion fun (ij : ℕ × ℕ) => pairwiseNode (treesOfNumNodesEq ij.1) (treesOfNumNodesEq ij.2)
@[simp]