Per-coordinate query caps #
For a tree on a product of query sets, Capped t c bounds the number of queries to each
coordinate on every structural root-to-leaf path. It uses DecisionTree.weightedDepth with
indicator costs. Repeated queries count again, and unreachable structural paths still count.
No second notion of tree depth is introduced.
Main definitions #
Cslib.DecisionTree.Capped: a separate structural query cap for each coordinate.
Main results #
Cslib.DecisionTree.capped_node_iff: a node spends one unit from its queried coordinate.Cslib.DecisionTree.capped_of_depth_le: a total structural depth bound implies separate caps.
def Cslib.DecisionTree.Capped {J : Type u_1} {ι : Type u_2} {β : Type u_3} [DecidableEq J] (t : DecisionTree (J × ι) β) (c : J → ℕ) :
Every structural path queries coordinate j at most c j times.
@[simp]
theorem Cslib.DecisionTree.capped_leaf {J : Type u_1} {ι : Type u_2} {β : Type u_3} [DecidableEq J] (b : β) (c : J → ℕ) :
theorem Cslib.DecisionTree.capped_node_iff {J : Type u_1} {ι : Type u_2} {β : Type u_3} [DecidableEq J] {j : J} {i : ι} {left right : DecisionTree (J × ι) β} {c : J → ℕ} :
A node spends one unit from its queried coordinate on both branches.
theorem Cslib.DecisionTree.capped_mono {J : Type u_1} {ι : Type u_2} {β : Type u_3} [DecidableEq J] {t : DecisionTree (J × ι) β} {c d : J → ℕ} (ht : t.Capped c) (hcd : ∀ (j : J), c j ≤ d j) :
t.Capped d
Increasing any coordinate's cap preserves the cap condition.
theorem Cslib.DecisionTree.capped_of_depth_le {J : Type u_1} {ι : Type u_2} {β : Type u_3} [DecidableEq J] {t : DecisionTree (J × ι) β} {n : ℕ} {c : J → ℕ} (ht : t.depth ≤ n) (hc : ∀ (j : J), n ≤ c j) :
t.Capped c
A bound on total structural depth gives the same bound for every coordinate.
theorem Cslib.DecisionTree.weightedCost_le_of_capped {J : Type u_1} {ι : Type u_2} {β : Type u_3} [DecidableEq J] {t : DecisionTree (J × ι) β} {c : J → ℕ} (ht : t.Capped c) (j : J) (x : J × ι → Bool) :
Separate structural caps also bound the queries executed on each actual input.