Documentation

CslibFrontier.Computability.DecisionTree.CoordinateCap

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 #

Main results #

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 → ℕ) :
(leaf b).Capped c
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 → ℕ} :
(node (j, i) left right).Capped c ↔ 0 < c j ∧ left.Capped (Function.update c j (c j - 1)) ∧ right.Capped (Function.update c j (c j - 1))

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) :
t.weightedCost (fun (p : J × ι) => if p.1 = j then 1 else 0) x ≤ c j

Separate structural caps also bound the queries executed on each actual input.