Documentation

CslibFrontier.Computability.DecisionTree.Prune

Removing repeated decision-tree queries #

prune remembers every observed answer in a partial assignment. Queries already answered are skipped. On agreeing inputs it preserves evaluation and decreases pointwise natural weighted cost; on a finite coordinate space its depth is bounded by the initially free coordinates.

A pruned tree never queries a coordinate twice on a path (DecisionTree.queriesDistinctFrom_prune), as the book insists for decision trees O'Donnell, Definition 3.13, and it has no more leaves than the original (DecisionTree.leafCount_prune_le). So bounds in terms of the leaves of trees without repeated queries transfer to every tree.

Main definitions #

Main results #

References #

Prune queries whose answers are known, recording each newly queried coordinate before recursing. Unlike restrict, the assignment grows along each branch.

theorem Cslib.DecisionTree.eval_prune_of_agrees {ι : Type u_1} {β : Type u_2} [DecidableEq ι] (t : DecisionTree ι β) (ρ : BitString.PartialAssignment ι) {x : ι → Bool} (hx : ρ.Agrees x) :
(t.prune ρ).eval x = t.eval x

Pruning preserves evaluation on inputs agreeing with the initial assignment.

theorem Cslib.DecisionTree.weightedCost_prune_le_of_agrees {ι : Type u_1} {β : Type u_2} [DecidableEq ι] (t : DecisionTree ι β) (ρ : BitString.PartialAssignment ι) {x : ι → Bool} (hx : ρ.Agrees x) (w : ι → ℕ) :

Pruning never increases the weighted cost on an agreeing input. Costs may be zero.

The depth after pruning is at most the number of initially free coordinates.

@[simp]
theorem Cslib.DecisionTree.eval_prune_empty {ι : Type u_1} {β : Type u_2} [DecidableEq ι] (t : DecisionTree ι β) (x : ι → Bool) :
def Cslib.DecisionTree.QueriesDistinctFrom {ι : Type u_1} {β : Type u_2} [DecidableEq ι] (A : Finset ι) :
DecisionTree ι β → Prop

No path of the tree queries a coordinate of A, or any coordinate twice.

@[reducible, inline]
abbrev Cslib.DecisionTree.QueriesDistinct {ι : Type u_1} {β : Type u_2} [DecidableEq ι] (t : DecisionTree ι β) :

No path of the tree queries a coordinate twice, as the book insists for decision trees O'Donnell, Definition 3.13.

theorem Cslib.DecisionTree.QueriesDistinctFrom.notMem_queries {ι : Type u_1} {β : Type u_2} [DecidableEq ι] {A : Finset ι} {t : DecisionTree ι β} (h : QueriesDistinctFrom A t) (x : ι → Bool) {j : ι} (hj : j ∈ t.queries x) :
j ∉ A

A tree that avoids A never queries a coordinate of A.

Pruning does not add leaves.

theorem Cslib.DecisionTree.queriesDistinctFrom_prune {ι : Type u_1} {β : Type u_2} [DecidableEq ι] {ρ : BitString.PartialAssignment ι} {A : Finset ι} (hA : ∀ j ∈ A, ρ j ≠ none) (t : DecisionTree ι β) :

A pruned tree never repeats a query, nor queries a coordinate fixed by ρ.