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
- BinaryTree.pairwiseNode a b = Finset.map { toFun := fun (x : BinaryTree Unit × BinaryTree Unit) => BinaryTree.node () x.1 x.2, inj' := BinaryTree.pairwiseNode._proof_1 } (a ×ˢ b)
Instances For
@[irreducible]
A Finset of all trees with n nodes. See mem_treesOfNodesEq
Equations
- One or more equations did not get rendered due to their size.
- BinaryTree.treesOfNumNodesEq 0 = {BinaryTree.nil}
Instances For
@[reducible, inline, deprecated BinaryTree.treesOfNumNodesEq (since := "2026-06-07")]
Alias of BinaryTree.treesOfNumNodesEq.
Instances For
theorem
BinaryTree.treesOfNumNodesEq_succ
(n : ℕ)
:
treesOfNumNodesEq (n + 1) = (Finset.antidiagonal n).biUnion fun (ij : ℕ × ℕ) => pairwiseNode (treesOfNumNodesEq ij.1) (treesOfNumNodesEq ij.2)
@[simp]
@[simp]