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).
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.mapQueries: relabel queries without changing the tree shape.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.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.
Instances For
The output of a decision tree on an input.
Instances For
The longest structural root-to-leaf path, bounding the queries executed on any input. Repeated variables can make a longest path unreachable.
Instances For
A decision tree computes f when it agrees with f on every input.
Instances For
Relabel the queries while preserving every branch and leaf, even when f is not injective.
Instances For
The variables queried on the way to the leaf of x.
Instances For
At most depth variables are queried on any input.
Inputs that agree on the variables queried for x reach the same leaf.
Query the variables of l in turn, starting from the assignment a, and continue with the
tree k a' for the assignment a' reached.
Instances For
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.
Instances For
Over finitely many variables, every function has a decision tree that queries each variable once.
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.