AFTD Auto-Formalizing Theoretical Domains

ComparisonDecisionTree

inductiveoriginal

A binary comparison decision tree on n elements whose leaves return a value of type β.

Statement

inductive ComparisonDecisionTree (n : ℕ) (β : Type) : Type
Related work
arXiv:2611.26297
Verified
22 Nov 2026
Axioms
none listed
Used by 3

Read back from the Lean

An inductive datatype ComparisonDecisionTree n β, parameterized by a natural number n : ℕ and a type β : Type, representing a binary comparison decision tree with two constructors: 1. leaf: takes a value of type β and produces a tree. 2. branch: takes two indices of type Fin n (the items being compared) and two subtrees of type ComparisonDecisionTree n β (representing the two branches of the decision), producing a tree.

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

/-- A binary comparison decision tree on n elements whose internal nodes perform pairwise comparisons and whose leaves return a value of type β. -/
inductive ComparisonDecisionTree (n : ℕ) (β : Type) : Type where
  | leaf : β → ComparisonDecisionTree n β
  | branch : Fin n → Fin n → ComparisonDecisionTree n β → ComparisonDecisionTree n β → ComparisonDecisionTree n β
See it in the graphDiscuss this resultChallenge it