Decision trees #
A decision tree over Boolean variables indexed by ι queries a variable at each internal node
and follows the branch for its value; the leaf it reaches is the output (DecisionTree.eval). Its
depth is the longest structural root-to-leaf path, an upper bound on the number of queries on
any input. Repeated variables can make a longest path unreachable. The variables queried on the
way to the leaf of an input x determine the output: every input that agrees with x on them
reaches the same leaf (DecisionTree.eval_eq_of_forall_mem_queries) along the same path
(DecisionTree.path_eq_of_forall_mem_queries), so with the same queries
(DecisionTree.queries_eq_of_forall_mem_queries).
Querying every variable in turn computes any function, so over finitely many variables every
function has a decision tree of depth at most the number of variables (exists_computes). The
decision tree complexity DecisionTree.complexity f of f is the least depth of a tree computing
it Jukna, Chapter 14.
Main definitions #
Cslib.DecisionTree: decision trees.Cslib.DecisionTree.eval,Cslib.DecisionTree.depth,Cslib.DecisionTree.queries.Cslib.DecisionTree.path: the answers along the path taken by an input.Cslib.DecisionTree.mapQueries: relabel queries without changing the tree shape.Cslib.DecisionTree.map: relabel the leaves of a decision tree.Cslib.DecisionTree.complexity: the decision tree complexity of a function.
Main results #
Cslib.DecisionTree.eval_eq_of_forall_mem_queries: the queried variables certify the output.Cslib.DecisionTree.queries_eq_of_forall_mem_queries,Cslib.DecisionTree.path_eq_of_forall_mem_queries: the queried variables determine the queries and the path.Cslib.DecisionTree.complexity_le_card: decision tree complexity is at most the number of variables.
References #
A decision tree over Boolean variables indexed by ι, with outputs in β: a leaf, or a query
of a variable with a subtree for each of its values.
- leaf {ι : Type u_1} {β : Type u_2} (b : β) : DecisionTree ι β
Output
b. - node {ι : Type u_1} {β : Type u_2} (i : ι) (ifFalse ifTrue : DecisionTree ι β) : DecisionTree ι β
Query variable
i, then continue withifFalseorifTrue.
The output of a decision tree on an input.
The longest structural root-to-leaf path, bounding the queries executed on any input. Repeated variables can make a longest path unreachable.
A decision tree computes f when it agrees with f on every input.
Relabel the queries while preserving every branch and leaf, even when f is not injective.
Relabel the leaves of a decision tree.
The answers along the path to the reached leaf.
The variables queried on the way to the leaf of x.
At most depth variables are queried on any input.
Inputs that agree on the variables queried for x reach the same leaf.
Inputs that agree on the variables queried for x make the same queries.
Inputs that agree on the variables queried for x follow the same path.
Query the variables of l in turn, starting from the assignment a, and continue with the
tree k a' for the assignment a' reached.
Grafting adds at most the number of queried variables to the depth.
Query the variables of l in turn, starting from the assignment a, and output f of the
assignment reached.
Over finitely many variables, every function is computed by a decision tree of depth at most the number of variables.
Some decision tree computing f has depth exactly its decision tree complexity.
A function has decision tree complexity zero exactly when it is constant.
Decision tree complexity is at most the number of variables.