AFTD Auto-Formalizing Theoretical Domains

comparison_sort_decision_tree_height_ge

theoremverified

If a binary decision tree has at least n! leaves, then 2^(height) >= n!, establishing the comparison sorting lower bound.

Statement

theorem comparison_sort_decision_tree_height_ge {α : Type*} (t : BinaryTree α) (n : ℕ)
    (h : n.factorial ≤ t.numLeaves) :
    n.factorial ≤ 2 ^ t.height
Verified
06 Sep 2026
Axioms
Quot.soundpropext
Built on 1
Used by 1

Lean source view module on GitHub

/-- Any decision tree capable of distinguishing n! permutations has height at least log_2(n!). -/
theorem comparison_sort_decision_tree_height_ge {α : Type*} (t : BinaryTree α) (n : ℕ)
    (h : n.factorial ≤ t.numLeaves) :
    n.factorial ≤ 2 ^ t.height := h.trans (binary_tree_num_leaves_le_pow_height t)
Discuss this resultChallenge it